DumbBots.NET Reference Document

IPlayerApi

Point[] GetCustomEntityPositions()

Returns an array representing the locations of all custom entities on the map.

int GetCustomEntitiesDestroyed()

Returns the number of custom entities destroyed by the player.

bool CustomEntityVisible(Point point)

Returns whether a custom entity nearest to the point specified is visibile to the player.

void Stop()

Stops any player movement.

bool MoveToPoint(Point point)

Moves the player to the specified position. Returns false if the movement cannot be made.

bool MoveUp()

Moves the player “up”. Returns false if the movement cannot be made.

bool MoveUpLeft()

Moves the player “up” and “left”. Returns false if the movement cannot be made.

bool MoveUpRight()

Moves the player “up” and “right”. Returns false if the movement cannot be made.

bool MoveDown()

Moves the player “down”. Returns false if the movement cannot be made.

bool MoveDownLeft()

Moves the player “down” and “left”. Returns false if the movement cannot be made.

bool MoveDownRight()

Moves the player “down” and “right”. Returns false if the movement cannot be made.

bool MoveRight()

Moves the player “right”. Returns false if the movement cannot be made.

bool MoveLeft()

Moves the player “left”. Returns false if the movement cannot be made.

void MoveToRandomLocation()

Moves the player to a random location.

void GetRandomBazooka()

Moves the player to the location of a randomly chosen bazooka.

void GetNearestBazooka()

Moves the player to the location of the nearest bazooka to the player.

void GetRandomMedkit()

Moves the player to the location of a randomly chosen medkit.

void GetNearestMedkit()

Moves the player to the location of the nearest medkit to the player.

void SendMessage(string message, TimeSpan time)

Player sends the specified message to itself. The message is delivered in the timespan specified measured from the current time.

void SendMessageToFoe(string message, TimeSpan time)

Player sends the specified message to the opposing player. The message is delivered in the timespan specified measured from the current time.

string FetchMessage()

Fetches the first message delivered to the player. An empty string returned if no messages in the queue.

int GetHealth()

Returns the player’s health.

int GetAmmo()

Returns the player’s bazooka ammo count.

Point GetPosition()

Returns the player’s position.

int GetScoreDiff()

Returns the score difference between the players. A negative result means the player is losing.

double GetHitAccuracy()

Returns the accuracy of the player’s hits. Calculated as the number of shots an enemy has sustained over the number of shots the player has fired.

int GetHitsTaken()

Returns the number of shots the player has sustained.

int GetTotalShots()

Returns the number of shots the player has fired.

int GetLookAngle()

Returns the angle of the player. For example if the player was looking directly “right”, the angle would 90 degrees.

Point GetPointInFrontOfPlayer()

Returns the point just in front of the player.

bool GetEnemySighted()

Returns whether the enemy is visible to the player.

Point GetEnemyPosition()

Returns the position of the enemy.

int GetEnemyLookAngle()

Returns the angle of the enemy. For example if the enemy was looking directly “right”, the angle would 90 degrees.

double GetDistanceFromEnemy()

Returns the distance between the player and the enemy.

Point GetPointInFrontOfEnemy()

Returns the point just in front of the player.

TimeSpan GetGameTime()

Returns the total time of the current game.

Point GetPositionFromMapPoint(Point point)

Returns the game position from the map position. The map position would be the X and Y points of a position in the array of integers representing the map.

bool PointVisible(Point point)

Returns whether the player can see the specified point.

int GetNumberOfVisibleBazookas()

Gets the number of bazooka left on the map.

int GetNumberofVisibleMedkits()

Gets the number of medkits left on the map.

Point[] GetAllMedkitLocations()

Returns an array of points representing all medkit locations.

Point[] GetVisibleMedkitLocations()

Returns an array of points representing all medkit locations that are collectable.

Point[] GetAllBazookaLocations()

Returns an array of points representing all bazooka locations.

Point[] GetVisibleBazookaLocations()

Returns an array of points representing all bazooka locations that are collectable.

Point[] GetAllWallLocations()       

Returns an array of points representing all walls.

Point[] GetEnemyFiredRocketLocations()

Returns an array of points representing all rockets fired by the enemy.

Point[] GetEnemyFiredBulletLocations()

Returns an array of points representing all bullets fired by the enemy.

void SayText(string message)

Displays the specified text above the player.

void SayText(string message, Color colour)

Displays the specified text above the player in the specified colour.

void ShootRocket(Point point)

Shoots a rocket at the specified point. The rocket will continue it’s trajectory if nothing is hit at, or before, the specified point.

void ShootBullet(Point point)

Shoots a bullet at the specified point. The bullet will continue it’s trajectory if nothing is hit at, or before, the specified point.

void HurtSelf(int damage)

Causes the player to harm itself with the specified amount of damage.

void PlaySound(string filename)

Attempts to plays the sound found at the specified file location.

bool IsKeyDown(params Keys[] keys)

Returns true is the all the specified keys are currently pressed, otherwise false.

 


 

IDirectorApi

 

UserEntity CreateCustomEntity(string modelFile, string textureFile, Point position)

Creates a custom entity with the specified 3D model at the file specified (if supported by the Irrlicht engine), with the specified texture, at the specified position.

bool RemoveCustomEntity(UserEntity entity)

Removes a custom entity.

void SendMessageToPlayers(string message, TimeSpan time)

Sends the specified message to all players. The message is delivered in the timespan specified measured from the current time.

void SendMessageToSelf(string message, TimeSpan time)

Sends the specified message to itself. The message is delivered in the timespan specified measured from the current time.

void SendMessageToPlayer(int player, string message, TimeSpan time)

Sends the specified message to a player. The message is delivered in the timespan specified measured from the current time.

string FetchMessage()

Fetches the first message delivered to the director. An empty string returned if no messages in the queue.

void SetBazookaRespawnTime(TimeSpan value)

Set the time to wait before a bazooka respawns. Default is 10 seconds.

void SetBulletDamage(int value)

Sets the amount of damage a bullet will do to a player. Default is 10.

void SetBulletReloadTime(TimeSpan value)

Sets the amount of time needed to reload a bullet. Default is 0.4 seconds.

void SetBulletSpeedModifier(int value)

Modify the speed of the bullet. Default is 10 seconds. Default is 10 seconds.

void SetDefaultAmmo(int value)

Sets the default amount of ammo given to players after respawn. Default is 1.

void SetMaxAmmo(int value)

Sets the maximum amount of ammo players can hold. Default is 3.

void SetMaxHealth(int value)

Sets the maximum health a player can have. Default is 100.

void SetMedkitHealthBoost(int value)

Sets the amount of health a medkit will provide. Default is 25.

void SetMedkitRespawnTime(TimeSpan value)

Set the time to wait before a medkit respawns. Default is 10 seconds.

void SetRocketDamage(int value)

Sets the amount of damage a rocket will do to a player. Default is 40.

void SetRocketReloadTime(TimeSpan value)

Sets the amount of time needed to reload a rocket. Default is 2 seconds.

void SetRocketSpeedModifier(int value)

Modify the speed of the rocket. Default is 1.

void SetPlayerSpeed(int player, double value)

Sets the speed of player’s movement. Default is 5.

void SetPlayerDamageModifier(int player, double value)

Sets the modifier of damage dealt. Default is 1.

void SetGameSpeed(float value)

Sets the game speed. Default is 1.

Point GetPlayerPosition(int player)

Gets player’s position.

void SetPlayerPosition(int player, Point position)

Sets player’s position.

void HealPlayer(int player, int health)

Heals player with the amount specified. Negative health hurts the player.

void GivePlayerAmmo(int player, int ammo)

Gives player the amount of ammo specified. Negative amount removes ammo.

int GetPlayerScore(int player)

Gets player’s score.

void SetPlayerScore(int player, int score)

Sets player’s score.

int GetPlayerHealth(int player)

Gets player’s health.

int GetPlayerAmmo(int player)

Gets player’s ammo.

TimeSpan GetGameTime()

Returns the total time of the current game.

Point GetPositionFromMapPoint(int x, int y)

Returns the game position from the map position. The map position would be the X and Y points of a position in the array of integers representing the map.

void PlaySound(string filename)

Attempts to plays the sound found at the specified file location.

void SayText(string message, Color color, Point position)

Displays the specified text at the specified location in the specified colour.

bool IsKeyDown(params Keys[] keys)

Returns true is the all the specified keys are currently pressed, otherwise false.

 


 

IUserEntity

 

bool Shootable { get; set; }

Get or set whether the entity can be shot by the players.

bool IsObstacle { get; set; }

Get or set whether the entity is an obstacle that prevents player movement.

double SpeedModifier { get; set; }

Get or set the speed modifier of the custom entity. Default is 1.

double DamageModifier { get; set; }

Get or set the damage modifier of the custom entity. Default is 1.

int Health { get; set; }

Get or set the health of the custom entity. Default is 1.

int Ammo { get; set; }

Get or set the ammo of the custom entity. Default is 1.

void SetScale(float scale)

Sets the model scale of the custom entity.

void SetTexture(string filename)

Sets the model texture of the custom entity to the texture found in the specified file.

void MoveToPoint(Point position)

Moves the custom entity to the specified position.

bool CanSeePlayer(int player)

Returns whether the custom entity can see the player specified.

void SetAnimationSpeed(int speed)

Sets the animation speed of the custom entity. Default is 0.

void PlayAnimation(int start, int end, bool loop)

Plays an animation from the starting frame to the ending frame, and whether to loop the animation.

void FireBullet(Point position)

Fires a bullet at the specified position.

void FireRocket(Point position)

Fires a rocket at the specified position.

bool TouchingPlayer(int player)

Returns whether the custom entity is touching the specified player.

void SetRotationY(int rotation)

Rotates a custom entity by the specified number of degrees.

void SayText(string message)

Displays the specified text above the custom entity.

void SayText(string message, Color colour)

Displays the specified text above the custom entity in the specified colour.