Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2003:
[Freeciv-Dev] (PR#2581) Layers proposal redux

[Freeciv-Dev] (PR#2581) Layers proposal redux

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: raahul_da_man@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#2581) Layers proposal redux
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Fri, 23 May 2003 14:12:55 -0700
Reply-to: rt@xxxxxxxxxxxxxx

The layers change means:

Change to units.ruleset and unit struct:
 - Every unit gets a "layer" variable (of type char)
 - In civ1 and civ2 rulesets, it is set to 1 for all units (default)
 - In default ruleset, air units get 2, subs 0 and all others 1.

New attack rules:
 - You cannot attack a tile which contains any not-at-war units or a
not-at-war city. (Treaty sanity rule.)
 - You cannot attack a tile if your own layer contains one or more units
but you cannot attack any of them. (Layer superiority rule.)
 - Otherwise, if there is any unit on target tile that you can attack, you
can attack the tile.
 - Layers as such neither allow nor prevent attack.
 - can_unit_attack_unit_at_tile() remains unchanged.

New killstack rules:
 - If you kill any unit on target tile, all units in the same layer on
that tile are destroyed. Units in other layers are unaffected.
 - Exception: Cities, airbases and fortresses. As before.

Additional choose best defender rules:
 - A unit always attacks an opponent in the same layer, if there is any.
 - Otherwise, a unit always attacks a unit in the highest layer where it
can find a unit that it can attack.
 - Cities, airbases and fortresses flatten layers, and all units in them
are treated as being in a single layer.

 - Cargo transported by a transporter which resides in a different layer
are unaffected if their transporter is killed, so they should be
un-sentried. We assume that they scramble into their own layer when
attacked. At the moment, this only applies to carriers and air units.

(If we want to extend this at a later date to cover
which-unit-can-attack-which-unit, then these points apply:
 - By default, units can attack their own layer and only that.
 - You still must be able to move into (in principle) a tile in order to
be able to attack a unit there.
 - Unit effects can specify additional attack properties, such as ability
to attack other layers, additional defense power against attacks from
specified layer, additional attack power when attacking a specified layer,

I think that should cover everything. Comments?

  - Per

[Prev in Thread] Current Thread [Next in Thread]