Gets all allied drones currently within the sight radius of this drone.
Returns the number of free storage capacity.
Returns the number of free storage capacity.
Order the drone to start the construction of a new drone.
Order the drone to start the construction of a new drone. While construction is in progress, the drone cannot move.
The drone controller that will govern the behaviour of the new drone.
The new drone's number of storage modules.
The new drone's number of missile batteries.
The new drone's number of constructors.
The new drone's number of engines.
The new drone's number of shield generators.
Order the drone to start the construction of a new drone.
Order the drone to start the construction of a new drone. While construction is in progress, the drone cannot move.
The drone controller that will govern the behaviour of the new drone.
The specification for the number of copies for each module equipped by the new drone.
Returns the number of constructor modules
Returns the number of constructor modules
Returns a string that encodes various properties of the drone.
Returns a string that encodes various properties of the drone.
Gets all drones currently within the sight radius of this drone.
Gets all enemy drones currently within the sight radius of this drone.
Returns the number of engine modules
Returns the number of engine modules
Fires all homing missiles at target
.
Fires all homing missiles at target
.
Order the drone to give all its resources to otherDrone
.
Order the drone to give all its resources to otherDrone
.
The drone which will receive the resources.
Order the drone to stop moving.
Order the drone to stop moving.
Order the drone to harvest mineralCrystal
.
Order the drone to harvest mineralCrystal
.
Must already be close to the position of the mineralCrystal
.
Returns the current number of hitpoints, including shields.
Returns the current number of hitpoints, including shields.
Returns true if this drone is currently constructing another drone.
Returns true if this drone is currently constructing another drone.
Returns true if this drone is dead, false otherwise.
Returns true if this drone is dead, false otherwise.
Always returns false.
Always returns false.
Returns true if this drone is currently harvesting a mineral.
Returns true if this drone is currently harvesting a mineral.
Returns true if mineralCrystal
is within harvesting range, otherwise false.
Returns true if mineralCrystal
is within harvesting range, otherwise false.
Returns true if otherDrone
is within range of this drones homing missiles, otherwise false.
Returns true if otherDrone
is within range of this drones homing missiles, otherwise false.
Returns true of this drone has a movement command active or queued up, false otherwise.
Returns true of this drone has a movement command active or queued up, false otherwise.
Always returns true
Always returns true
The orientation of this drone at the last time it was seen by any of your drones.
The orientation of this drone at the last time it was seen by any of your drones.
The position of this drone at the last time it was seen by any of your drones.
The position of this drone at the last time it was seen by any of your drones.
Returns the amount of hitpoints at full health.
Returns the amount of hitpoints at full health.
Returns the drone's maximum speed.
Returns the drone's maximum speed.
When you start the game, this method will be called once on your initial drone controller to give you an opportunity to provide a cwinter.codecraft.core.api.MetaController.
When you start the game, this method will be called once on your initial drone controller to give you an opportunity to provide a cwinter.codecraft.core.api.MetaController.
Returns the number of missile battery modules.
Returns the number of missile battery modules.
Returns the drone's homing missile cooldown.
Returns the drone's homing missile cooldown.
Order the drone to keep moving in the direction of direction
.
Order the drone to keep moving in the direction of direction
.
Order the drone to keep moving in the direction of directionVector
.
Order the drone to keep moving in the direction of directionVector
.
Order the drone to move to position
.
Order the drone to move to position
.
Order the drone to move to coordinates (x
, y
).
Order the drone to move to coordinates (x
, y
).
Order the drone to move towards mineralCrystal
.
Order the drone to move towards mineralCrystal
.
Order the drone to move towards otherDrone
, until it is within 10 units distance of colliding.
Order the drone to move towards otherDrone
, until it is within 10 units distance of colliding.
Called when this drone arrives at another drone after invoking the moveTo(drone: DroneHandle) command.
Called when this drone arrives at another drone after invoking the moveTo(drone: DroneHandle) command.
Called when this drone arrives at a mineral crystal after invoking the moveTo(mineral: MineralCrystalHandle) command.
Called when this drone arrives at a mineral crystal after invoking the moveTo(mineral: MineralCrystalHandle) command.
Called when this drone arrives a position after invoking the one of the moveTo
methods.
Called when this drone arrives a position after invoking the one of the moveTo
methods.
Called if the drone constructing this drone is destroyed before construction completes.
Called if the drone constructing this drone is destroyed before construction completes. In such a case, this is the only event function to be called.
Called if the drone is destroyed.
Called if the drone is destroyed.
Called when another drone enters the sight radius of this drone.
Called when another drone enters the sight radius of this drone.
Called when a mineral crystal enters the sight radius of this drone.
Called when a mineral crystal enters the sight radius of this drone.
Called once when the drone is spawned.
Called once when the drone is spawned. Called before any other onEvent
method is called.
Called once every tick, after all other onEvent
methods have been called.
Called once every tick, after all other onEvent
methods have been called.
Returns the drones orientation in radians.
Returns the drones orientation in radians.
Returns the identifier of the player that owns this drone.
Returns the identifier of the player that owns this drone.
Returns the drone's position.
Returns the drone's position.
Returns the number of shield generator modules
Returns the number of shield generator modules
Draws the specified text at the position of the drone on this timestep.
Draws the specified text at the position of the drone on this timestep.
Returns an object that specifies how many copies of each module the drone has.
Returns an object that specifies how many copies of each module the drone has.
Returns the number of storage modules.
Returns the number of storage modules.
Returns the amount of resources store by this drone.
Returns the amount of resources store by this drone.
Returns the confines of the game world.
Returns the confines of the game world.
Returns 0.
Returns 0.
(Since version 0.2.4.0) The refinery module has been removed.
Order the drone to start the construction of a new drone.
Order the drone to start the construction of a new drone. While construction is in progress, the drone cannot move.
The specification for the number of copies for each module equipped by the new drone.
The drone controller that will govern the behaviour of the new drone.
(Since version 0.2.4.3) Swap the positions of the spec
and controller
arguments.
(Since version 0.2.4.3) Use giveResourcesTo instead.
Returns an empty Seq.
Returns an empty Seq.
(Since version 0.2.4.0) Drones do not store mineral crystals anymore, only resources.
Returns the total amount of resources available to this drone.
Returns the total amount of resources available to this drone. This includes any mineral crystals that are small enough to be processed by this drone.
(Since version 0.2.4.0) Use storedResources
instead.
(Since version 0.2.4.3) Use missileCooldown instead.
A drone controller is an object that governs the behaviour of a drone. It exposes a wide range of methods to query the underlying drone's state and give it commands. You can inherit from this class to and override the
onEvent
methods to implement a drone controller with custom behaviour.In Java, use JDroneController instead.