Inspired by brains - write a bot that finds treasure, kills people and claims glory.
- You spawn at your stash.
- You can navigate and pick up treasure which you can return to your stash for 10 points.
- Players can steal treasure from your stash and you lose 10 points.
- You earn 1 point for each player you kill.
- When you're carrying treasure you can't attack.
- You can see two tiles in every direction.
- You can can attack or move one tile per tick
- You can make an action (attack/move/pick up treasure/drop treasure) at most once per 2 seconds. Last command wins and invalid moves will be discarded.
- You can't move to a location where another player is standing.
Treasure War runs over websockets,
Requires coffesscript
The server generates a tile based dungeon of configurable size
The server "ticks" every second in which you may make a move. When the server ticks it runs the following logic
- Evaluate any attacks
- Kill any players that are dead
- Process any moves/treasure pickups
- Respawn any dead players at their stash
- Send tick results
IMPORTANT: the tiles key in the json response is really what you want to look at, not the nearby_* keys
On connect/tick:
{
you: {
name: 'unnamed coward',
health: 100,
score: 0,
carrying_treasure: false,
stash_location: {
x: int,
y: int
}
position: {
x: int,
y: int
}
}
tiles: [{x: 1, y: 1, type: "wall"}, {x: 2, y: 1, type: "wall"}, {x: 2, y: 3, type: "floor"}, {x: 2, y: 4, type: "player"}, {x: 2, y: 3, type: "treasure"}, {x: 2, y: 3, type: "stash"}, ]
nearby_players: [
{
name: "@mtcmorris",
health: 55,
score: 4,
carry_treasure: false
x: 3,
y: 4
}
],
nearby_stashes: [{
x: 4,
y: 4
name: "@mtcmorris",
treasure: int (3)
}],
nearby_items: [{
x: 5
y: 6
is_treasure: true
}]
}
You may send the server one message in every tick interval. The server will accept the last message you send it if you send multiple messages. Each move must specify a direction
You can perform any of the following actions:
- Attack
- Pick up treasure
- Throw treasure
- Move
You cannot attack when you are carrying treasure
Event: attack
{
dir: "n"
}
You cannot pick up treasure if you're already carrying treasure. Stand on top of treasure to pick it up.
Event: pick up
{ }
Event: move
{
dir: "n"
}
You cannot drop an item if you're not carrying an item
Event: drop
{ }