Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

autotest.c File Reference

#include "conq.h"
#include "kernel.h"
#include "imf.h"
#include "ui.h"
#include <stdlib.h>

Include dependency graph for autotest.c:

Include dependency graph

Defines

#define NUMPBT   6

Functions

int do_toolup_action (Unit *unit, Unit *unit2, int u3)
 Do Toolup Action.

int do_enter_action (Unit *unit, Unit *unit2, Unit *newtransport)
int do_create_at_action (Unit *unit, Unit *unit2, int u3, int x, int y, int z)
 Do Create Unit at Location.

int autotest (void)

Define Documentation

#define NUMPBT   6
 


Function Documentation

int autotest void   ) 
 

int do_create_at_action Unit actor,
Unit creator,
int  u3,
int  x,
int  y,
int  z
 

Do Create Unit at Location.

Create the unit at the given location.

  • Try to allocate a new .
  • If allocated,
    • Set the default properties of the .
    • If the can reuse creation points, adjust the new unit's and creator's creation points.
    • If the new unit can occupy the cell
      • enter the cell with the new .
    • else if there is space in cell and the creating can transport the new unit
      • make the creating leave the cell
      • make the new enter the cell
      • make the creator eter the new unit as an occupant.
    • else there was an error.
    • if the new is completed on creation
      • destroy creating , if neccessary. This is for things like creatinn a city from a colonizer that is "used up" in the process of creating the new Unit.
      • complete the new .
    • else record the creation event.
    • if the creating unit is still alive (not destroyed by creating the new unit)
      • record any score gain from creating unit.
      • use supplies for creation (local and/or treasury).
    • use up creation ACP from the unit.
    • else ran out of memory
    See also:
    create_unit, set_created_unit_props, uu_builder_can_reuse_cp, mn, u_cp, can_occupy_cell, enter_cell, can_occupy_cell_without, can_occupy, leave_cell, enter_transport, run_error, completed, garrison_unit, make_unit_complete, recod_event, add_side_to_set, side_number, alive, count_gain, for_all_material_types, um_consumption_on_creation, side_has_treasury, run_warning, use_up_acp.
    Parameters:
    actor is the pointer to the initiating the action.
    creator is a pointer to the doing the creation.
    u3 is the Unit type to be created.
    x is the creation location's x co-ordiate.
    y is the creation location's y co-ordinate.
    z is the creation location's altitude.
    Returns:
    • A_ANY_ERROR if no memory for creation.
    • A_ANY_OK if unit created.

int do_enter_action Unit unit,
Unit unit2,
Unit newtransport
 

int do_toolup_action Unit actor,
Unit constructor,
int  u3
 

Do Toolup Action.

Do the tooup action.

  • If builder tooling pointer is NULL, initialize tooling for it.
  • Get current tooling points (tp), add in the builder tooling points, and clip to the max tooling points for creating the new Unit type.
  • If the number of tooling points changes (can go negative?), notify the side.
  • Adjust the tooling on all other Units, via a crossover array.
  • update Unit display for the side.
  • use up ACP for the unit

See also:
prep_toolup_action, check_tooup_action, init_unit_tooling, uu_tp_per_toolup, uu_tp_max, notify_tp, adjust_tooling_crossover, update_unit_display, use_up_acp, uu_acp_to_toolup.
Parameters:
actor is the pointer to the initiating the action.
constructor is pointer to the which is building the New unit.
u3 is the Unit type for which to tool up.
Returns:
A_ANY_DONE always.


Generated on Sat Sep 17 10:29:02 2005 for XconqKernel by doxygen 1.3.6