Skip to content

Commit

Permalink
Merge pull request #76 from imos/potential
Browse files Browse the repository at this point in the history
utilize potential
  • Loading branch information
sulume authored Jul 20, 2020
2 parents 818c4ce + 38a3f94 commit bbe330f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/bin/app_totsugeki.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ fn run() {
}
let player_key = std::env::args().nth(2).unwrap();

client.join(&player_key);
let resp = client.join(&player_key);

// TODO: sideによってトータル変える
let cool = 16;
let mut resp = client.start(448 - cool * 12 - 1 * 2, 0, cool, 1);
let mut resp = client.start(resp.info.ability.potential - cool * 12 - 1 * 2, 0, cool, 1);

let my_id = resp.state.ships.iter().find_map(|s| if s.role == resp.info.role { Some(s.id) } else { None }).unwrap();
let en_id = 1 - my_id; // TODO: 分裂したらやばい・・・・・・しらない・・・・・・
Expand Down
4 changes: 2 additions & 2 deletions src/chokudAI.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ pub fn run(client: Client, join_resp: Response, prep: Preprocess){

let mut router = super::routing::Router::new();

let mut all = 448;
let all = join_resp.info.ability.potential;
let shoot = 64;
let mut heal = 10;
let life = 1;
if join_resp.info.role == 0 { all = 512; heal = 16;}
if join_resp.info.role == 0 { heal = 16;}
let energy = all - shoot * 4 - heal * 12 - life * 2;

let mut resp = client.start(energy, shoot, heal, life);
Expand Down
2 changes: 1 addition & 1 deletion src/wata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ pub fn run() {
let power = 0;
let cool = 4;
let life = 96;
resp = client.start(448 - power * 4 - cool * 12 - life * 2, power, cool, life);
resp = client.start(resp.info.ability.potential - power * 4 - cool * 12 - life * 2, power, cool, life);
}
dbg!(&resp);
while resp.stage != 2 {
Expand Down

0 comments on commit bbe330f

Please sign in to comment.