autobattler init
This commit is contained in:
parent
cc8ffc946e
commit
9dfd3a733a
@ -189,9 +189,9 @@ impl Game {
|
||||
}
|
||||
|
||||
self.pve_add_skills();
|
||||
if self.skill_phase_finished() { // pve game where both bots will have readied up
|
||||
return self.resolve_phase_start()
|
||||
}
|
||||
//if self.skill_phase_finished() { // pve game where both bots will have readied up
|
||||
// return self.resolve_phase_start()
|
||||
//}
|
||||
|
||||
self
|
||||
}
|
||||
@ -201,8 +201,7 @@ impl Game {
|
||||
let mut rng = thread_rng();
|
||||
|
||||
for mobs in self.players
|
||||
.iter()
|
||||
.filter(|t| t.bot) {
|
||||
.iter() {
|
||||
let player_player = self.players.iter().find(|t| t.id != mobs.id).unwrap();
|
||||
|
||||
for mob in mobs.constructs.iter() {
|
||||
|
||||
@ -55,9 +55,9 @@ impl TimeControl {
|
||||
|
||||
fn game_time_seconds(&self) -> i64 {
|
||||
match self {
|
||||
TimeControl::Standard => 60,
|
||||
TimeControl::Slow => 120,
|
||||
TimeControl::Practice => panic!("practice game seconds called"),
|
||||
TimeControl::Standard => 1,
|
||||
TimeControl::Slow => 1,
|
||||
TimeControl::Practice => 1,
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,12 +77,9 @@ impl TimeControl {
|
||||
}
|
||||
|
||||
pub fn game_phase_end(&self, resolution_time_ms: i64) -> Option<DateTime<Utc>> {
|
||||
match self {
|
||||
TimeControl::Practice => None,
|
||||
_ => Some(Utc::now()
|
||||
.checked_add_signed(Duration::milliseconds(self.game_time_seconds() * 1000 + resolution_time_ms))
|
||||
.expect("could not set game phase end")),
|
||||
}
|
||||
Some(Utc::now()
|
||||
.checked_add_signed(Duration::milliseconds(self.game_time_seconds() * 1000 + resolution_time_ms))
|
||||
.expect("could not set game phase end"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user