summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2019-08-06 10:59:30 +0200
committerJustin Worthe <justin@worthe-it.co.za>2019-08-06 10:59:30 +0200
commit4d8846395fe12e6d92014da10f1e017267af0c57 (patch)
tree01a054d9286b58e102974a0794bbc0dc1c8e1ac2
parentd23833847724620a8032bedb342d03b3b9184059 (diff)
Extra todos for snowball moves
-rw-r--r--src/constants.rs9
-rw-r--r--src/game.rs2
-rw-r--r--src/strategy/mcts.rs2
-rw-r--r--tests/official-runner-matching.rs1
4 files changed, 12 insertions, 2 deletions
diff --git a/src/constants.rs b/src/constants.rs
index 94be135..344c55b 100644
--- a/src/constants.rs
+++ b/src/constants.rs
@@ -178,5 +178,12 @@ pub const MOVE_SCORE: i32 = 5;
pub const INVALID_COMMAND_SCORE_PENALTY: i32 = 4;
pub const STARTING_BOMBS: u8 = 3;
+pub const STARTING_SNOWBALLS: u8 = 3;
-pub const COLLISSION_DAMAGE: i32 = 20;
+pub const COLLISION_DAMAGE: i32 = 20;
+
+pub const LAVA_DAMAGE: i32 = 3;
+
+pub const LAVA_ROUND_START: u16 = 100;
+pub const LAVA_ROUND_END: u16 = 350;
+pub const MAX_ROUNDS: u16 = 400;
diff --git a/src/game.rs b/src/game.rs
index c9f9b56..5b14e46 100644
--- a/src/game.rs
+++ b/src/game.rs
@@ -224,7 +224,7 @@ impl GameBoard {
fn simulate_moves(&mut self, actions: [Action; 2]) {
match actions {
[Action::Move(p1), Action::Move(p2)] if p1.x == p2.x && p1.y == p2.y => {
- let damage = COLLISSION_DAMAGE;
+ let damage = COLLISION_DAMAGE;
debug_assert_eq!(
Some(false),
diff --git a/src/strategy/mcts.rs b/src/strategy/mcts.rs
index 26edf16..e393685 100644
--- a/src/strategy/mcts.rs
+++ b/src/strategy/mcts.rs
@@ -229,6 +229,8 @@ fn update(node: &mut Node, commands: [Command; 2], score: Score) {
node.score_sum += score;
}
+// TODO: Move into game.rs
+// TODO: Include snowball commands
fn valid_moves(state: &GameBoard, player_index: usize) -> Vec<Command> {
state
.valid_shoot_commands(player_index)
diff --git a/tests/official-runner-matching.rs b/tests/official-runner-matching.rs
index ffe2468..5389558 100644
--- a/tests/official-runner-matching.rs
+++ b/tests/official-runner-matching.rs
@@ -8,6 +8,7 @@ use std::fs::File;
use std::io::prelude::*;
use std::path::Path;
+// TODO: Update the replays to the latest version
#[test]
fn simulates_the_same_match() {
let replays = Path::new("tests/replays/");