bit of clone cleaning

This commit is contained in:
ntr 2019-03-24 19:08:44 +11:00
parent 0143849ec2
commit d186feed6e
3 changed files with 13 additions and 12 deletions

View File

@ -16,6 +16,7 @@
# WORK WORK # WORK WORK
## NOW ## NOW
cryp vbox cryp vbox
ensure all skills impl ensure all skills impl
ez ez
Skill::Slay -> red attack with bonus somethingorother for blue / maim no healing Skill::Slay -> red attack with bonus somethingorother for blue / maim no healing
@ -28,7 +29,6 @@ ensure all skills impl
Skill::Taunt -> redirect incomnig attacks to self Skill::Taunt -> redirect incomnig attacks to self
Skill::Toxic -> apply debuff to attackers Skill::Toxic -> apply debuff to attackers
update speed of rest of stack on cryp speed change
include target name in effect resolution include target name in effect resolution
eg strangle applies buff to self eg strangle applies buff to self

View File

@ -219,12 +219,12 @@ impl Game {
} }
fn pve_add_skills(&mut self) -> &mut Game { fn pve_add_skills(&mut self) -> &mut Game {
for mobs in self.teams let mut pve_skills = vec![];
.clone()
.into_iter()
.filter(|t| t.bot) {
let player_team = self.teams.iter().find(|t| t.id != mobs.id).unwrap().clone(); for mobs in self.teams
.iter()
.filter(|t| t.bot) {
let player_team = self.teams.iter().find(|t| t.id != mobs.id).unwrap();
for mob in mobs.cryps.iter() { for mob in mobs.cryps.iter() {
let skill = mob.mob_select_skill(); let skill = mob.mob_select_skill();
@ -248,16 +248,17 @@ impl Game {
target = find_target(); target = find_target();
} }
match self.add_skill(mobs.id, mob.id, Some(target.id), s) { pve_skills.push((mobs.id, mob.id, Some(target.id), s));
Ok(_) => (),
Err(e) => println!("{:?} could not add pve skill", e),
}
// println!("{:?}", cast);
}, },
None => continue, None => continue,
}; };
} }
} }
for (team_id, mob_id, target_id, s) in pve_skills {
self.add_skill(team_id, mob_id, target_id, s).expect("unable to add pve mob skill");
}
self self
} }

View File

@ -502,7 +502,7 @@ impl Vbox {
self.bound.get(i).ok_or(format_err!("no var at index {:?}", i))?; self.bound.get(i).ok_or(format_err!("no var at index {:?}", i))?;
let reclaimed = self.bound.remove(i); let reclaimed = self.bound.remove(i);
let refund = reclaimed.cost(); let refund = reclaimed.cost();
println!("reclaiming {:?} for {:?}", refund, reclaimed); // println!("reclaiming {:?} for {:?}", refund, reclaimed);
self.balance_add(refund); self.balance_add(refund);
Ok(self) Ok(self)
} }