colony.common
Class PlayerConstants

java.lang.Object
  |
  +--colony.common.PlayerConstants

public class PlayerConstants
extends Object

Public collection of droid properties, moniker subtypes, and ability monikers which you may use in your droid software.

This class is a collection of public constant Monikers for abilities, which are part of droid hardware, moniker subtypes for droids and ore, and droid properties.

All interaction between your software and the game universe takes the form of using abilities, which are modules in hardware. Not all hardware supports all of these abilities. The use of all abilities involves the DroidHandle.useAbility(colony.common.Moniker, colony.common.Moniker, java.lang.Object) method, which takes three arguments:

The method also returns an array of Objects (Object[]). The Moniker of each ability below contains a description of the target, parameter, and return value associated with it.

Note that abilities can be either active or passive.

An active ability changes the state of the game and causes your software's timeslice to end so that the engine can resolve a consistent game state for all software; active abilities usually specify a target, have a parameter, return null.

A passive ability returns information to your software, usually information that has been collected from active abilities; consequently, they usually return one or more Objects in an array. Passive abilities do not change game state, and may be called multiple times in one cycle; however, they are idempotent in that calling them more than once per cycle gives you no new information.


Field Summary
static Moniker ATTACK
           Moniker for the attack active ability.
static int BEETLE_ASSEMBLY_TIME
          Beetle assembly time in stone.
static int BEETLE_ATTACK_DAMAGE
          Beetle attack damage in stone.
static int BEETLE_ATTACK_RANGE
          Beetle attack range in spans.
static int BEETLE_MAX_HIT_POINTS
          Beetle maximum hit points in stone.
static int BEETLE_MAX_STORAGE
          Beetle maximum storage capacity in stone.
static int BEETLE_RADIO_BUFFER_SIZE
          Beetle radio receive buffer size in messages.
static int BEETLE_RADIO_RANGE
          Beetle radio transmission range in spans.
static int BEETLE_SENSOR_RANGE
          Beetle sensor range in spans.
static String BEETLE_SUBTYPE
          Beetle moniker subtype.
static Moniker DISCARD
           Moniker for the discard active ability.
static Moniker GET_ASSEMBLY
           Moniker for getting assembly (passive ability).
static Moniker GET_GOAL_STATUS
           Moniker for getting the status of a goal (passive ability).
static Moniker GET_HIT_POINTS
           Moniker for getting hit points (passive ability).
static Moniker GET_ORE_AMOUNT
           Moniker for getting the amount of ore carried by a droid within sensor range (passive ability).
static Moniker GET_OWNER
           Moniker for getting the moniker of a droid's owner (passive ability).
static Moniker GET_POSITION
           Moniker for getting position (passive ability).
static Moniker GET_STORAGE
           Moniker for getting storage monikers (passive ability).
static Moniker GET_STORAGE_AVAILABLE
           Moniker for getting the amount of storage available (passive ability).
static Moniker GET_TERRAIN
           Moniker for getting terrain moniker for a given MapPoint (passive ability).
static Moniker GET_VELOCITY
           Moniker for getting velocity (passive ability).
static int HEMLOCK_ASSEMBLY_TIME
          Hemlock assembly time in cycles.
static int HEMLOCK_ATTACK_DAMAGE
          Hemlock attack damage in stone.
static int HEMLOCK_ATTACK_RANGE
          Hemlock attack range in spans.
static int HEMLOCK_MAX_HIT_POINTS
          Hemlock maximum hit points in stone.
static int HEMLOCK_MAX_STORAGE
          Hemlock maximum storage capacity in stone.
static int HEMLOCK_RADIO_BUFFER_SIZE
          Hemlock radio receive buffer size in messages.
static int HEMLOCK_RADIO_RANGE
          Hemlock radio transmission range in spans.
static int HEMLOCK_SENSOR_RANGE
          Hemlock sensor range in spans.
static String HEMLOCK_SUBTYPE
          Hemlock moniker subtype.
static String INDUCTION_ENGINE_SUBTYPE
           Moniker subtype for induction engine artifacts.
static Moniker LAND_TERRAIN
          Moniker for the land terrain.
static double MAP_DEST_TOLERANCE
          Convenience constant; recommended stopping distance from destination based on top speed of fastest unit.
static Moniker MOUNTAIN_TERRAIN
          Moniker for the mountain terrain.
static String ORE_SUBTYPE
           Moniker subtype for metal ore.
static int POPULATION_LIMIT
          Population limit for each side.
static Moniker RADIO_RECEIVE
           Moniker for the radio receive passive ability.
static Moniker RADIO_TRANSMIT
           Moniker for the radio transmit active ability.
static Moniker REBOOT
           Moniker for the reboot active ability.
static Moniker REPAIR
           Moniker for the repair active ability.
static Moniker REPLICATE
           Moniker for the replicate active ability.
static int SCION_ASSEMBLY_TIME
          Scion assembly time in stone.
static int SCION_ATTACK_DAMAGE
          Scion attack damage in stone.
static int SCION_ATTACK_RANGE
          Scion attack range in spans.
static int SCION_MAX_HIT_POINTS
          Scion maximum hit points in stone.
static int SCION_MAX_STORAGE
          Scion maximum storage capacity in stone.
static int SCION_RADIO_BUFFER_SIZE
          Scion radio receive buffer size in messages.
static int SCION_RADIO_RANGE
          Scion radio transmission range in spans.
static int SCION_SENSOR_RANGE
          Scion sensor range in spans.
static String SCION_SUBTYPE
          Scion moniker subtype.
static int SEADRAGON_ASSEMBLY_TIME
          Sea Dragon assembly time in stone.
static int SEADRAGON_ATTACK_DAMAGE
          Sea Dragon attack damage in stone.
static int SEADRAGON_ATTACK_RANGE
          Sea Dragon attack range in spans.
static int SEADRAGON_MAX_HIT_POINTS
          Sea Dragon maximum hit points in stone.
static int SEADRAGON_MAX_STORAGE
          Sea Dragon maximum storage capacity in stone.
static int SEADRAGON_RADIO_BUFFER_SIZE
          Sea Dragon radio receive buffer size in messages.
static int SEADRAGON_RADIO_RANGE
          Sea Dragon radio transmission range in spans.
static int SEADRAGON_SENSOR_RANGE
          Sea Dragon sensor range in spans.
static String SEADRAGON_SUBTYPE
          Sea Dragon moniker subtype.
static Moniker SENSOR
           Moniker for the sensor passive ability.
static Moniker STORE
           Moniker for the store active ability.
static double STORE_DISTANCE
          Maximum distance you can be from an object before storing it.
static Moniker TRAVEL
           Moniker for the travel active ability.
static Moniker WATER_TERRAIN
          Moniker for the water terrain.
static Moniker YIELD
           Moniker for the yield active ability.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Field Detail

ATTACK

public static final Moniker ATTACK

Moniker for the attack active ability.

All droid hardware can inflict damage on other objects at varying ranges and to varying amounts. See the specifications for the attack ranges and damages associated with different hardware types.


BEETLE_ASSEMBLY_TIME

public static final int BEETLE_ASSEMBLY_TIME
Beetle assembly time in stone.

See Also:
Constant Field Values

BEETLE_ATTACK_DAMAGE

public static final int BEETLE_ATTACK_DAMAGE
Beetle attack damage in stone.

See Also:
Constant Field Values

BEETLE_ATTACK_RANGE

public static final int BEETLE_ATTACK_RANGE
Beetle attack range in spans.

See Also:
Constant Field Values

BEETLE_MAX_HIT_POINTS

public static final int BEETLE_MAX_HIT_POINTS
Beetle maximum hit points in stone.

See Also:
Constant Field Values

BEETLE_MAX_STORAGE

public static final int BEETLE_MAX_STORAGE
Beetle maximum storage capacity in stone.

See Also:
Constant Field Values

BEETLE_RADIO_BUFFER_SIZE

public static final int BEETLE_RADIO_BUFFER_SIZE
Beetle radio receive buffer size in messages.

See Also:
Constant Field Values

BEETLE_RADIO_RANGE

public static final int BEETLE_RADIO_RANGE
Beetle radio transmission range in spans.

See Also:
Constant Field Values

BEETLE_SENSOR_RANGE

public static final int BEETLE_SENSOR_RANGE
Beetle sensor range in spans.

See Also:
Constant Field Values

BEETLE_SUBTYPE

public static final String BEETLE_SUBTYPE
Beetle moniker subtype.

See Also:
Constant Field Values

DISCARD

public static final Moniker DISCARD

Moniker for the discard active ability.

Droids have the ability to discard physical objects that they store using STORE.


GET_ASSEMBLY

public static final Moniker GET_ASSEMBLY

Moniker for getting assembly (passive ability).

The target for this ability must be within sensor range. You may invoke this ability on yourself.


GET_GOAL_STATUS

public static final Moniker GET_GOAL_STATUS

Moniker for getting the status of a goal (passive ability).

Returns a status associated with a goal; the type and length of this status information depends on the goal type. For the tournament goal type (collecting artifacts), it will be one Integer containing the number of artifacts left unclaimed.


GET_HIT_POINTS

public static final Moniker GET_HIT_POINTS

Moniker for getting hit points (passive ability).

The target for this ability must be within sensor range. You may invoke this ability on yourself.


GET_ORE_AMOUNT

public static final Moniker GET_ORE_AMOUNT

Moniker for getting the amount of ore carried by a droid within sensor range (passive ability).

The target for this ability must be within sensor range. You may invoke this ability on yourself.


GET_OWNER

public static final Moniker GET_OWNER

Moniker for getting the moniker of a droid's owner (passive ability).

Returns a one-element array containing the calling droid's owner (may be null). You may only call this ability on yourself.


GET_POSITION

public static final Moniker GET_POSITION

Moniker for getting position (passive ability).

The target for this ability must be within sensor range. You may invoke this ability on yourself.


GET_STORAGE

public static final Moniker GET_STORAGE

Moniker for getting storage monikers (passive ability).

Returns the monikers of all stored items belonging to the object whose moniker you specify. The target for this ability must be within sensor range.


GET_STORAGE_AVAILABLE

public static final Moniker GET_STORAGE_AVAILABLE

Moniker for getting the amount of storage available (passive ability).

The moniker you specify must belong to a droid within your sensor range; otherwise, this ability will return an empty array.


GET_TERRAIN

public static final Moniker GET_TERRAIN

Moniker for getting terrain moniker for a given MapPoint (passive ability).

The target for this ability must be within sensor range.


GET_VELOCITY

public static final Moniker GET_VELOCITY

Moniker for getting velocity (passive ability).

The target for this ability must be within sensor range. You may invoke this ability on yourself.


HEMLOCK_ASSEMBLY_TIME

public static final int HEMLOCK_ASSEMBLY_TIME
Hemlock assembly time in cycles.

See Also:
Constant Field Values

HEMLOCK_ATTACK_DAMAGE

public static final int HEMLOCK_ATTACK_DAMAGE
Hemlock attack damage in stone.

See Also:
Constant Field Values

HEMLOCK_ATTACK_RANGE

public static final int HEMLOCK_ATTACK_RANGE
Hemlock attack range in spans.

See Also:
Constant Field Values

HEMLOCK_MAX_HIT_POINTS

public static final int HEMLOCK_MAX_HIT_POINTS
Hemlock maximum hit points in stone.

See Also:
Constant Field Values

HEMLOCK_MAX_STORAGE

public static final int HEMLOCK_MAX_STORAGE
Hemlock maximum storage capacity in stone.

See Also:
Constant Field Values

HEMLOCK_RADIO_BUFFER_SIZE

public static final int HEMLOCK_RADIO_BUFFER_SIZE
Hemlock radio receive buffer size in messages.

See Also:
Constant Field Values

HEMLOCK_RADIO_RANGE

public static final int HEMLOCK_RADIO_RANGE
Hemlock radio transmission range in spans.

See Also:
Constant Field Values

HEMLOCK_SENSOR_RANGE

public static final int HEMLOCK_SENSOR_RANGE
Hemlock sensor range in spans.

See Also:
Constant Field Values

HEMLOCK_SUBTYPE

public static final String HEMLOCK_SUBTYPE
Hemlock moniker subtype.

See Also:
Constant Field Values

INDUCTION_ENGINE_SUBTYPE

public static final String INDUCTION_ENGINE_SUBTYPE

Moniker subtype for induction engine artifacts.

See Also:
Constant Field Values

LAND_TERRAIN

public static final Moniker LAND_TERRAIN
Moniker for the land terrain.


MAP_DEST_TOLERANCE

public static final double MAP_DEST_TOLERANCE
Convenience constant; recommended stopping distance from destination based on top speed of fastest unit.

See Also:
Constant Field Values

MOUNTAIN_TERRAIN

public static final Moniker MOUNTAIN_TERRAIN
Moniker for the mountain terrain.


ORE_SUBTYPE

public static final String ORE_SUBTYPE

Moniker subtype for metal ore.

See Also:
Constant Field Values

POPULATION_LIMIT

public static final int POPULATION_LIMIT
Population limit for each side.

See Also:
Constant Field Values

RADIO_RECEIVE

public static final Moniker RADIO_RECEIVE

Moniker for the radio receive passive ability.

Every droid hardware has a radio, but the receive ability is implemented separately from the transmit ability. That is, you can both send and receive messages in the same cycle. Whether or not you receive a message over the radio is determined by the range of the transmitter, as there is no range associated with the receiver. See RADIO_TRANSMIT.

When you invoke this ability, your receive buffer is emptied. You do not receive messages sent by your own transmitter.


RADIO_TRANSMIT

public static final Moniker RADIO_TRANSMIT

Moniker for the radio transmit active ability.

This ability transmits a single Object (which may be one of the following types: Byte, Short, Integer, Long, Float, Double, Boolean, String, Moniker, MapPoint. You may not transmit arrays of these objects, as was erroneously stated in previous revisions.

See the specifications for the ranges associated with different hardware types. See also RADIO_RECEIVE.

Note that you will not receive messages sent by your own transmitter.


REBOOT

public static final Moniker REBOOT

Moniker for the reboot active ability.

This ability allows your software to reboot its associated hardware to run a different piece of software. You cannot pass any parameters to this new piece of software, but you must specify the name of a Java class within your team package, which must contain a method with the following signature:

public static void main(DroidHandle handle)


REPAIR

public static final Moniker REPAIR

Moniker for the repair active ability.

All droid hardware can repair damage done to themselves by increasing their hit points back to its maximum value (limited by the amount of ore carried). These repairs happen instantaneously (1 cycle). If a droid doesn't have any ore, using this ability has no effect.


REPLICATE

public static final Moniker REPLICATE

Moniker for the replicate active ability.

Units of each droid hardware type can replicate other units of their type, as long as they are carrying enough ore. The cost of replicating a droid is the same as the droid's hit points, measured in stone. See the specifications for the hit points associated with different hardware types.

The replicant is placed at a random location 1 span from its parent and is given a unique moniker by the game engine. It is initially unpowered and have 0 hit points; they require a certain assembly time before they gain a DVM and can run code. During assembly, their hit points increase linearly to their maximum value; a replicant can be attacked at any time while it is assembling and can be destroyed before it finishes assembling.


SCION_ASSEMBLY_TIME

public static final int SCION_ASSEMBLY_TIME
Scion assembly time in stone.

See Also:
Constant Field Values

SCION_ATTACK_DAMAGE

public static final int SCION_ATTACK_DAMAGE
Scion attack damage in stone.

See Also:
Constant Field Values

SCION_ATTACK_RANGE

public static final int SCION_ATTACK_RANGE
Scion attack range in spans.

See Also:
Constant Field Values

SCION_MAX_HIT_POINTS

public static final int SCION_MAX_HIT_POINTS
Scion maximum hit points in stone.

See Also:
Constant Field Values

SCION_MAX_STORAGE

public static final int SCION_MAX_STORAGE
Scion maximum storage capacity in stone.

See Also:
Constant Field Values

SCION_RADIO_BUFFER_SIZE

public static final int SCION_RADIO_BUFFER_SIZE
Scion radio receive buffer size in messages.

See Also:
Constant Field Values

SCION_RADIO_RANGE

public static final int SCION_RADIO_RANGE
Scion radio transmission range in spans.

See Also:
Constant Field Values

SCION_SENSOR_RANGE

public static final int SCION_SENSOR_RANGE
Scion sensor range in spans.

See Also:
Constant Field Values

SCION_SUBTYPE

public static final String SCION_SUBTYPE
Scion moniker subtype.

See Also:
Constant Field Values

SEADRAGON_ASSEMBLY_TIME

public static final int SEADRAGON_ASSEMBLY_TIME
Sea Dragon assembly time in stone.

See Also:
Constant Field Values

SEADRAGON_ATTACK_DAMAGE

public static final int SEADRAGON_ATTACK_DAMAGE
Sea Dragon attack damage in stone.

See Also:
Constant Field Values

SEADRAGON_ATTACK_RANGE

public static final int SEADRAGON_ATTACK_RANGE
Sea Dragon attack range in spans.

See Also:
Constant Field Values

SEADRAGON_MAX_HIT_POINTS

public static final int SEADRAGON_MAX_HIT_POINTS
Sea Dragon maximum hit points in stone.

See Also:
Constant Field Values

SEADRAGON_MAX_STORAGE

public static final int SEADRAGON_MAX_STORAGE
Sea Dragon maximum storage capacity in stone.

See Also:
Constant Field Values

SEADRAGON_RADIO_BUFFER_SIZE

public static final int SEADRAGON_RADIO_BUFFER_SIZE
Sea Dragon radio receive buffer size in messages.

See Also:
Constant Field Values

SEADRAGON_RADIO_RANGE

public static final int SEADRAGON_RADIO_RANGE
Sea Dragon radio transmission range in spans.

See Also:
Constant Field Values

SEADRAGON_SENSOR_RANGE

public static final int SEADRAGON_SENSOR_RANGE
Sea Dragon sensor range in spans.

See Also:
Constant Field Values

SEADRAGON_SUBTYPE

public static final String SEADRAGON_SUBTYPE
Sea Dragon moniker subtype.

See Also:
Constant Field Values

SENSOR

public static final Moniker SENSOR

Moniker for the sensor passive ability.

Every droid hardware has sensors which returns monikers of objects that are within range. Different droid types have different ranges. See the specifications for details.

Since most other abilities operate on monikers of objects rather than on the objects themselves, you will usually invoke the Sensor ability before these other abilities.


STORE

public static final Moniker STORE

Moniker for the store active ability.

Droids have the ability to store other physical objects (including other droids) up to a certain limit in stone. See the specifications for the maximum storage capacities associated with different hardware types.

Droids must approach within a certain distance to store an object, STORE_DISTANCE. A stored droid cannot itself pick up new items or travel independently; its position is the same as its owner. Storage capacity is measured cumulatively; a droid must have enough storage capacity for any droids it wishes to carry as well as those droids' storage items.

The a droid that stores an object is known as that object's owner.

Ore that is stored will automatically coalesce with any ore that is already present; a droid will almost never need to retrieve ore monikers once the ore has been stored, but rather, it can use the GET_ORE_AMOUNT ability. If a droid only has room for part of a piece of ore, as much stone as will fit will coalesce into the droid's possession, and the remaining stone will be left on the map. A mature Hemlock is the only droid that cannot be stored.

Stored objects may also be discarded using DISCARD.


STORE_DISTANCE

public static final double STORE_DISTANCE
Maximum distance you can be from an object before storing it.

See Also:
Constant Field Values

TRAVEL

public static final Moniker TRAVEL

Moniker for the travel active ability.

Some droids are mobile and have a maximum velocity on one or more terrain types. See the specifications for the maximum velocities associated with different hardware types.


WATER_TERRAIN

public static final Moniker WATER_TERRAIN
Moniker for the water terrain.


YIELD

public static final Moniker YIELD

Moniker for the yield active ability.

This active ability has no effect on game state and merely ends a DVM's timeslice.