Merge branch 'develop' of ssh://git.mnml.gg:40022/~/mnml into develop
base = develop
This commit is contained in:
commit
caa5d31012
@ -63,6 +63,8 @@ class AnimText extends preact.Component {
|
||||
}
|
||||
case 'Ko': return <h1><span>KO!</span></h1>;
|
||||
case 'Reflection': return <h1><span>REFLECT</span></h1>;
|
||||
case 'CooldownIncrease': return <h1>+{event.turns}T cooldowns</h1>;
|
||||
case 'CooldownDecrease': return <h1>-{event.turns}T cooldowns</h1>;
|
||||
default: return false;
|
||||
}
|
||||
};
|
||||
|
||||
@ -470,24 +470,26 @@ impl Construct {
|
||||
}
|
||||
|
||||
pub fn increase_cooldowns(&mut self, turns: usize) -> Vec<Event> {
|
||||
let mut events = vec![];
|
||||
|
||||
let mut cd_event = false;
|
||||
for skill in self.skills.iter_mut() {
|
||||
if skill.skill.base_cd().is_some() { // if has a cooldown
|
||||
cd_event = true;
|
||||
match skill.cd {
|
||||
Some(cd) => {
|
||||
skill.cd = Some(cd.saturating_add(turns));
|
||||
events.push(Event::CooldownIncrease { construct: self.id, turns })
|
||||
},
|
||||
None => {
|
||||
skill.cd = Some(turns);
|
||||
events.push(Event::CooldownIncrease { construct: self.id, turns })
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return events;
|
||||
if cd_event {
|
||||
return vec![Event::CooldownIncrease { construct: self.id, turns }];
|
||||
}
|
||||
|
||||
return vec![];
|
||||
}
|
||||
|
||||
pub fn reduce_cooldowns(&mut self) -> &mut Construct {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user