|
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.
- 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.
|