|
Classes |
struct | a_unit |
| Unit. More...
|
struct | a_unit_extras |
| Unit exta options. More...
|
struct | a_unit_view |
| Unit View. More...
|
struct | ParamBoxUnit |
struct | ParamBoxUnitAt |
struct | ParamBoxUnitUnit |
struct | ParamBoxUnitSide |
struct | a_seer_node |
struct | ParamBoxUnitSideSeers |
struct | ParamBoxUnitUnitSeers |
struct | a_unitvectorentry |
struct | a_unitvector |
struct | a_actiondefn |
| Action definition. More...
|
struct | a_action |
| Action. More...
|
struct | a_actorstate |
struct | a_goaldefn |
| Goal definition. More...
|
struct | a_goal |
| Goal. More...
|
struct | a_task |
| Task. More...
|
struct | a_taskdefn |
| Task definition. More...
|
struct | a_plan |
| Plan. More...
|
Defines |
#define | for_all_units(v) for (v = unitlist; v != NULL; v = v->unext) |
| Iteration over all units.
|
#define | for_all_side_units(s, v) for (v = (s)->unithead->next; v != (s)->unithead; v = v->next) |
| Iterate over all units.
|
#define | for_all_occupants(u1, v) for (v = (u1)->occupant; v != NULL; v = v->nexthere) |
| Iterate over direct components.
|
#define | for_all_occs_with_occs(u, var) |
| Iterate over ALL components.
|
#define | is_unit(unit) ((unit) != NULL && is_unit_type((unit)->type)) |
| Is valid Unit type?
|
#define | alive(unit) ((unit)->hp > 0) |
| Is alive?
|
#define | indep(unit) ((unit)->side == indepside) |
| Is independant?
|
#define | completed(unit) ((unit)->cp >= u_cp((unit)->type)) |
| Is complete?
|
#define | unit_alt(unit) (((unit)->z & 1) == 0 ? ((unit)->z >> 1) : 0) |
| Unit altitude.
|
#define | unit_conn(unit) (((unit)->z & 1) == 1 ? ((unit)->z >> 1) : NONTTYPE) |
| Unit connection.
|
#define | in_play(unit) (is_unit(unit) && alive(unit) && inside_area((unit)->x, (unit)->y)) |
#define | is_active(unit) (in_play(unit) && completed(unit)) |
| Is Unit Active?
|
#define | is_located_at(unit, x, y) (in_play(unit) && (unit)->x == wrapx(x) && (unit)->y == (y)) |
| Is unit located at (x,y)?
|
#define | was_located_at(unit, x, y) (is_unit(unit) && (unit)->prevx == wrapx(x) && (unit)->prevy == (y)) |
| Was unit located at (x,y)?
|
#define | side_tracking_unit(side, unit) (side_in_set((side), (unit)->tracking)) |
| Is unit being tracked?
|
#define | unit_opinion(unit, side) ((unit)->opinions != NULL ? x_opinion((unit)->opinions[side_number(side)]) : 0) |
| Unit opinion.
|
#define | unit_courage(unit, side) ((unit)->opinions != NULL ? x_courage((unit)->opinions[side_number(side)]) : 0) |
| Unit courage.
|
#define | x_opinion(val) (((val) & 0xff) - 128) |
| Extract opinion.
|
#define | x_courage(val) (((val) >> 8) & 0xff) |
| Extract courage.
|
#define | s_opinion(val, val2) (((val) & ~0xff) | (val2 + 128)) |
| Set opinion value.
|
#define | s_courage(val, val2) (((val) & ~0xff00) | (val2 << 8)) |
| Set courage value.
|
#define | supply_inflow(unit) ((unit)->s_flow / 163) |
#define | supply_connectedness(unit) ((unit)->s_conn / 254) |
#define | DETONATE_FLAG_BIT 0 |
#define | was_detonated(unit) ((unit)->flags & (1 << DETONATE_FLAG_BIT)) |
#define | set_was_detonated(unit, v) |
#define | unit_point_value(unit) ((unit)->extras ? (unit)->extras->point_value : -1) |
#define | unit_appear_turn(unit) ((unit)->extras ? (unit)->extras->appear : -1) |
#define | unit_appear_var_x(unit) ((unit)->extras ? (unit)->extras->appear_var_x : -1) |
#define | unit_appear_var_y(unit) ((unit)->extras ? (unit)->extras->appear_var_y : -1) |
#define | unit_disappear_turn(unit) ((unit)->extras ? (unit)->extras->disappear : -1) |
#define | unit_extra_priority(unit) ((unit)->extras ? (unit)->extras->priority : -1) |
#define | unit_symbol(unit) ((unit)->extras ? (unit)->extras->sym : lispnil) |
#define | unit_sides(unit) ((unit)->extras ? (unit)->extras->sides : lispnil) |
#define | unit_doctrine(unit) ((unit)->side->udoctrine[(unit)->type]) |
#define | construction_run_doctrine(unit, u2) (unit_doctrine(unit)->construction_run[u2]) |
#define | unit_side_treasury(unit) ((unit)->side->treasury) |
#define | MAXSORTKEYS 5 |
#define | unit_in_vector(uvec, ix) ((uvec)->units[ix].unit) |
| Unit in vector?
|
#define | DEF_ACTION(name, CODE, args, prepfn, netprepfn, dofn, checkfn, argdecl, doc) CODE, |
#define | MAXACTIONARGS 4 |
| Maximum number of arguments to action.
|
#define | valid(x) ((x) == A_ANY_OK) |
#define | has_pending_action(unit) ((unit)->act && (unit)->act->nextaction.type != ACTION_NONE) |
#define | acp_indep(unit) u_acp_independent((unit)->type) |
#define | has_acp_left(unit) ((unit)->act && ((0 < (unit)->act->acp) || acp_indep(unit))) |
| Does unit have ACP left?
|
#define | type_acp_max(u) ((u_acp_max(u) >= 0) ? u_acp_max(u) : u_acp(u)) |
#define | DEF_GOAL(name, dname, GOALTYPE, args) GOALTYPE, |
#define | MAXGOALARGS 5 |
| Maximum number of goal arguments.
|
#define | DEF_TASK(name, dname, CODE, argtypes, dofn, createfn, setfn, netsetfn, pushfn, netpushfn, argdecl) CODE, |
#define | MAXTASKARGS 6 |
| Maximum arguments for a task.
|
#define | is_task_type(x) (between(0, (x), NUMTASKTYPES - 1)) |
#define | DEF_PLAN(name, CODE) CODE, |
#define | for_all_tasks(plan, task) for (task = (plan)->tasks; task != NULL; task = task->next) |
#define | ai_controlled(unit) ((unit)->plan && (unit)->plan->aicontrol && side_has_ai(unit->side)) |
#define | could_auto_upgrade_to(u, u2) ((u2) == u_auto_upgrade_to(u)) |
#define | DEF_ACTION(name, code, args, prepfn, netprepfn, dofn, CHECKFN, ARGDECL, doc) extern int CHECKFN ARGDECL; |
#define | DEF_TASK(name, dname, code, argtypes, dofn, CREATEFN, setfn, netsetfn, pushfn, netpushfn, ARGDECL) extern Task *CREATEFN ARGDECL; |
Typedefs |
typedef a_unit | Unit |
| Unit.
|
typedef a_unit_extras | UnitExtras |
| Unit exta options.
|
typedef a_unit_view | UnitView |
| Unit View.
|
typedef a_seer_node | SeerNode |
typedef a_unitvectorentry | UnitVectorEntry |
typedef a_unitvector | UnitVector |
typedef enum actiontype | ActionType |
| Action types.
|
typedef a_actiondefn | ActionDefn |
| Action definition.
|
typedef a_action | Action |
| Action.
|
typedef a_actorstate | ActorState |
typedef enum goaltype | GoalType |
typedef a_goaldefn | GoalDefn |
| Goal definition.
|
typedef a_goal | Goal |
| Goal.
|
typedef enum a_tasktype | TaskType |
| Task type.
|
typedef enum a_taskoutcome | TaskOutcome |
| Task outcome.
|
typedef a_task | Task |
| Task.
|
typedef a_taskdefn | TaskDefn |
| Task definition.
|
typedef enum plantype | PlanType |
| Plan type.
|
typedef a_plan | Plan |
| Plan.
|
Enumerations |
enum | sortkeys {
bynothing,
bytype,
byname,
byactorder,
bylocation,
byside,
numsortkeytypes
} |
| Sort types. More...
|
enum | actiontype {
none,
ACTION_NONE,
prep_none_action,
net_prep_none_action,
do_none_action,
check_none_action,
unit,
unit2,
used,
move,
ACTION_MOVE,
xyz,
prep_move_action,
net_prep_move_action,
do_move_action,
check_move_action,
unit,
unit2,
x,
y,
z,
enter,
ACTION_ENTER,
U,
prep_enter_action,
net_prep_enter_action,
do_enter_action,
check_enter_action,
unit,
unit2,
dest,
attack,
ACTION_ATTACK,
Un,
prep_attack_action,
net_prep_attack_action,
do_attack_action,
check_attack_action,
unit,
unit2,
defender,
n,
overrun,
ACTION_OVERRUN,
xyzn,
prep_overrun_action,
net_prep_overrun_action,
do_overrun_action,
check_overrun_action,
unit,
unit2,
x,
y,
z,
n,
at,
ACTION_FIRE_AT,
Um,
prep_fire_at_action,
net_prep_fire_at_action,
do_fire_at_action,
check_fire_at_action,
unit,
unit2,
defender,
m,
into,
ACTION_FIRE_INTO,
xyzm,
prep_fire_into_action,
net_prep_fire_into_action,
do_fire_into_action,
check_fire_into_action,
unit,
unit2,
x,
y,
z,
m,
capture,
ACTION_CAPTURE,
U,
prep_capture_action,
net_prep_capture_action,
do_capture_action,
check_capture_action,
unit,
unit2,
defender,
detonate,
ACTION_DETONATE,
xyz,
prep_detonate_action,
net_prep_detonate_action,
do_detonate_action,
check_detonate_action,
unit,
unit2,
x,
y,
z,
produce,
ACTION_PRODUCE,
mn,
prep_produce_action,
net_prep_produce_action,
do_produce_action,
check_produce_action,
unit,
unit2,
m,
n,
extract,
ACTION_EXTRACT,
xymn,
prep_extract_action,
net_prep_extract_action,
do_extract_action,
check_extract_action,
unit,
unit2,
x,
y,
m,
n,
transfer,
ACTION_TRANSFER,
mnU,
prep_transfer_action,
net_prep_transfer_action,
do_transfer_action,
check_transfer_action,
unit,
unit2,
m,
n,
unit3,
develop,
ACTION_DEVELOP,
u,
prep_develop_action,
net_prep_develop_action,
do_develop_action,
check_develop_action,
unit,
unit2,
u3,
toolup,
ACTION_TOOL_UP,
u,
prep_toolup_action,
net_prep_toolup_action,
do_toolup_action,
check_toolup_action,
unit,
unit2,
u3,
in,
ACTION_CREATE_IN,
uU,
prep_create_in_action,
net_prep_create_in_action,
do_create_in_action,
check_create_in_action,
actor,
creator,
u3,
dest,
at,
ACTION_CREATE_AT,
uxyz,
prep_create_at_action,
net_prep_create_at_action,
do_create_at_action,
check_create_at_action,
actor,
creator,
u3,
x,
y,
z,
build,
ACTION_BUILD,
U,
prep_build_action,
net_prep_build_action,
do_build_action,
check_build_action,
actor,
builder,
newunit,
repair,
ACTION_REPAIR,
U,
prep_repair_action,
net_prep_repair_action,
do_repair_action,
check_repair_action,
actor,
repairer,
repairee,
disband,
ACTION_DISBAND,
prep_disband_action,
net_prep_disband_action,
do_disband_action,
check_disband_action,
unit,
unit2,
type,
ACTION_CHANGE_TYPE,
u,
prep_change_type_action,
net_prep_change_type_action,
do_change_type_action,
check_change_type_action,
unit,
unit2,
u3,
side,
ACTION_CHANGE_SIDE,
S,
prep_change_side_action,
net_prep_change_side_action,
do_change_side_action,
check_change_side_action,
unit,
unit2,
side,
terrain,
ACTION_ALTER_TERRAIN,
xyt,
prep_alter_cell_action,
net_prep_alter_cell_action,
do_alter_cell_action,
check_alter_cell_action,
unit,
unit2,
x,
y,
t,
terrain,
ACTION_ADD_TERRAIN,
xydt,
prep_add_terrain_action,
net_prep_add_terrain_action,
do_add_terrain_action,
check_add_terrain_action,
unit,
unit2,
x,
y,
dir,
t,
terrain,
ACTION_REMOVE_TERRAIN,
xydt,
prep_remove_terrain_action,
net_prep_remove_terrain_action,
do_remove_terrain_action,
check_remove_terrain_action,
unit,
unit2,
x,
y,
dir,
t,
NUMACTIONTYPES
} |
| Action types. More...
|
enum | goaltype { g_t_dummy
} |
| Goal Type. More...
|
enum | a_tasktype {
none,
None,
TASK_NONE,
do_none_task,
create_none_task,
set_none_task,
net_set_none_task,
push_none_task,
net_push_none_task,
build,
of,
TASK_BUILD,
Un,
do_build_task,
create_build_task,
set_build_task,
net_set_build_task,
push_build_task,
net_push_build_task,
unit,
id,
capture,
Capture,
TASK_CAPTURE,
Unn,
do_capture_task,
create_capture_task,
set_capture_task,
net_set_capture_task,
push_capture_task,
net_push_capture_task,
unit,
id,
capmethod,
collect,
Collect,
TASK_COLLECT,
mxy,
do_collect_task,
create_collect_task,
set_collect_task,
net_set_collect_task,
push_collect_task,
net_push_collect_task,
unit,
m,
x,
construct,
Construct,
TASK_CONSTRUCT,
unUxy,
do_construct_task,
create_construct_task,
set_construct_task,
net_set_construct_task,
push_construct_task,
net_push_construct_task,
unit,
u,
run,
transid,
x,
develop,
Develop,
TASK_DEVELOP,
un,
do_develop_task,
create_develop_task,
set_develop_task,
net_set_develop_task,
push_develop_task,
net_push_develop_task,
unit,
u,
disband,
Disband,
TASK_DISBAND,
do_disband_task,
create_disband_task,
set_disband_task,
net_set_disband_task,
push_disband_task,
net_push_disband_task,
pos,
position,
TASK_HIT_POSITION,
xyz,
do_hit_position_task,
create_hit_position_task,
set_hit_position_task,
net_set_hit_position_task,
push_hit_position_task,
net_push_hit_position_task,
unit,
x,
y,
unit,
Hit,
TASK_HIT_UNIT,
Un,
do_hit_unit_task,
create_hit_unit_task,
set_hit_unit_task,
net_set_hit_unit_task,
push_hit_unit_task,
net_push_hit_unit_task,
unit,
id,
hitmethod,
dir,
dir,
TASK_MOVE_DIR,
dn,
do_move_dir_task,
create_move_dir_task,
set_move_dir_task,
net_set_move_dir_task,
push_move_dir_task,
net_push_move_dir_task,
unit,
d,
to,
to,
TASK_MOVE_TO,
xyznc,
do_move_to_task,
create_move_to_task,
set_move_to_task,
net_set_move_to_task,
push_move_to_task,
net_push_move_to_task,
unit,
x,
y,
occupy,
Occupy,
TASK_OCCUPY,
Uc,
do_occupy_task,
create_occupy_task,
set_occupy_task,
net_set_occupy_task,
push_occupy_task,
net_push_occupy_task,
unit,
pickup,
Pickup,
TASK_PICKUP,
Uc,
do_pickup_task,
create_pickup_task,
set_pickup_task,
net_set_pickup_task,
push_pickup_task,
net_push_pickup_task,
unit,
produce,
Produce,
TASK_PRODUCE,
mnn,
do_produce_task,
create_produce_task,
set_produce_task,
net_set_produce_task,
push_produce_task,
net_push_produce_task,
unit,
m,
repair,
Repair,
TASK_REPAIR,
Un,
do_repair_task,
create_repair_task,
set_repair_task,
net_set_repair_task,
push_repair_task,
net_push_repair_task,
unit,
id,
resupply,
Resupply,
TASK_RESUPPLY,
mU,
do_resupply_task,
create_resupply_task,
set_resupply_task,
net_set_resupply_task,
push_resupply_task,
net_push_resupply_task,
unit,
sentry,
Sentry,
TASK_SENTRY,
n,
do_sentry_task,
create_sentry_task,
set_sentry_task,
net_set_sentry_task,
push_sentry_task,
net_push_sentry_task,
unit,
NUMTASKTYPES
} |
| Task type. More...
|
enum | a_taskoutcome {
TASK_UNKNOWN,
TASK_FAILED,
TASK_IS_INCOMPLETE,
TASK_PREPPED_ACTION,
TASK_IS_COMPLETE
} |
| Task outcome. More...
|
enum | plantype { NUMPLANTYPES
} |
| Plan type. More...
|
Functions |
int | side_owns_occupant_of_unit (Side *side, Unit *unit) |
int | side_owns_viewer_in_unit (Side *side, Unit *unit) |
int | type_can_occupy_cell (int u, int x, int y) |
int | side_thinks_type_can_occupy_cell (Side *side, int u, int x, int y) |
int | type_can_occupy_empty_cell (int u, int x, int y) |
int | type_can_occupy_terrain (int u, int t) |
int | can_occupy_cell_without (Unit *unit, int x, int y, Unit *unit3) |
int | type_can_occupy_cell_without (int u, int x, int y, Unit *unit3) |
int | side_can_put_type_at (Side *side, int u, int x, int y) |
int | side_can_put_type_at_without (Side *side, int u, int x, int y, Unit *unit) |
int | side_thinks_it_can_put_type_at (Side *side, int u, int x, int y) |
int | side_thinks_it_can_put_type_at_without (Side *side, int u, int x, int y, Unit *unit) |
int | can_occupy (Unit *unit, Unit *transport) |
int | type_can_occupy (int u, Unit *transport) |
int | side_thinks_type_can_occupy (Side *side, int u, UnitView *transport) |
int | type_can_occupy_without (int u, Unit *transport, Unit *unit) |
int | side_thinks_type_can_occupy_without (int u, UnitView *transport, Unit *unit) |
int | type_can_occupy_empty_type (int u, int u2) |
int | type_can_have_occs (int u) |
int | new_unit_allowed_on_side (int u, Side *side) |
int | unit_allowed_on_side (Unit *unit, Side *side) |
int | num_sides_allowed (int u) |
int | type_allowed_on_side (int u, Side *side) |
int | type_ever_available (int u, Side *side) |
int | unit_trusts_unit (Unit *unit1, Unit *unit2) |
int | type_survives_in_cell (int u, int nx, int ny) |
int | type_survives_in_terrain (int u, int t) |
int | can_build (Unit *unit) |
int | type_can_build (int u, Side *side) |
int | can_move (Unit *unit) |
int | can_extract_at (Unit *unit, int x, int y, int *mp) |
int | can_load_at (Unit *unit, int x, int y, int *mp) |
int | can_develop (Unit *unit) |
int | type_can_develop (int u) |
int | can_change_type (Unit *unit) |
int | can_change_type_to (Unit *unit, int u2) |
int | could_change_type (int u) |
int | could_change_type_to (int u, int u2) |
int | can_disband (Unit *unit) |
int | type_can_disband (int u) |
int | side_can_disband (Side *side, Unit *unit) |
int | can_add_terrain (Unit *unit) |
int | type_can_add_terrain (int u) |
int | can_remove_terrain (Unit *unit) |
int | type_can_remove_terrain (int u) |
int | can_build_attackers (Side *side, int u) |
int | can_build_defenders (Side *side, int u) |
int | can_build_explorers (Side *side, int u) |
int | can_build_colonizers (Side *side, int u) |
int | can_build_facilities (Side *side, int u) |
int | can_build_or_help (Unit *unit) |
int | can_research (Unit *unit) |
int | can_produce (Unit *unit) |
int | total_production (Unit *unit, int m) |
int | base_production (Unit *unit, int m) |
int | total_consumption (Unit *unit, int m) |
int | base_consumption (Unit *unit, int m) |
int | survival_time (Unit *unit) |
int | will_not_move (Unit *unit) |
int | needs_material_to_move (Unit *unit, int m) |
int | needs_material_to_survive (Unit *unit, int m) |
int | operating_range_best (int u) |
int | operating_range_worst (int u) |
int | real_operating_range_best (Unit *unit) |
int | real_operating_range_worst (Unit *unit) |
int | can_build_type (Unit *unit, int u2) |
int | can_develop_or_build_type (Unit *unit, int u2) |
int | unit_can_build_type_at (Unit *unit, int u2, int x, int y) |
int | unit_can_build_type (Unit *unit, int u2) |
int | type_can_build_type (int u, Side *side, int u2) |
Unit * | incomplete_build_target (Unit *unit) |
int | see_chance (int u, int u2, int dist) |
int | see_chance (Unit *seer, Unit *tosee) |
char * | unit_desig (Unit *unit) |
char * | unit_desig_no_loc (Unit *unit) |
char * | utype_name_n (int u, int n) |
char * | shortest_unique_name (int u) |
char * | shortest_generic_name (int u) |
char * | actorstate_desig (struct a_actorstate *as) |
Unit * | find_unit (int n) |
Unit * | find_unit_dead_or_alive (int n) |
Unit * | find_unit_by_name (char *nm) |
Unit * | find_unit_by_number (int nb) |
Unit * | find_unit_by_symbol (Obj *sym) |
UnitVector * | make_unit_vector (int initsize) |
void | clear_unit_vector (UnitVector *vec) |
UnitVector * | add_unit_to_vector (UnitVector *vec, Unit *unit, int flag) |
void | remove_unit_from_vector (UnitVector *vec, Unit *unit, int pos) |
void | sort_unit_vector (UnitVector *vec) |
void | sort_units (int byidonly) |
void | check_all_units (void) |
Variables |
short | default_size |
| Advanced : default size.
|
short | default_usedcells |
| Advanced : default used cells.
|
short | default_maxcells |
| Advanced : default max cells.
|
long | default_population |
| Advanced : default population.
|
UnitView * | viewlist |
Unit * | unitlist |
| Unit list.
|
Unit * | tmpunit |
| Unit temporary.
|
int | numunits |
| Number of Units.
|
int | numliveunits |
| Number of live Units.
|
enum sortkeys | tmpsortkeys [] |
| Temporary sort keys.
|
ActionDefn | actiondefns [] |
| Action function table.
|
GoalDefn | goaldefns [] |
| Goal definition array.
|
TaskDefn | taskdefns [] |
| Task definition array.
|
char * | plantypenames [] |
| Plan type name array.
|
Prototypes, constants, and macros relating to units.