fix absorb, purge, electrocute, end of game bugs
This commit is contained in:
parent
17c2c9708c
commit
c1b5f09d42
@ -38,7 +38,7 @@ function Skill(props) {
|
||||
const s = construct.skills[i];
|
||||
const ko = construct.green_life.value === 0 ? 'ko' : '';
|
||||
|
||||
if (!s) {
|
||||
if (!s || !game) {
|
||||
return (
|
||||
<button
|
||||
disabled='true'
|
||||
|
||||
@ -26,6 +26,7 @@ class TargetSvg extends Component {
|
||||
render(props, state) {
|
||||
const { game, account, animating, animTarget } = props;
|
||||
const { width, height } = state;
|
||||
if (!game) return false; // game will be null when battle ends
|
||||
|
||||
// resolutions happening
|
||||
// just put skill name up
|
||||
|
||||
@ -246,7 +246,7 @@ fn logout(req: &mut Request) -> IronResult<Response> {
|
||||
|
||||
tx.commit().or(Err(MnmlHttpError::ServerError))?;
|
||||
|
||||
let mut res = iron_response(status::Ok, "token_res".to_string());
|
||||
let mut res = iron_response(status::Ok, "logout".to_string());
|
||||
res.headers.set(SetCookie(vec![AUTH_CLEAR.to_string()]));
|
||||
Ok(res)
|
||||
|
||||
|
||||
@ -314,7 +314,7 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
|
||||
.find(|e| e.effect == Effect::Absorb).unwrap().clone();
|
||||
match meta {
|
||||
Some(EffectMeta::Skill(s)) => {
|
||||
resolutions = absorption(&mut target, &mut source, resolutions, skill, amount, s);
|
||||
resolutions = absorption(&mut source, &mut target, resolutions, skill, amount, s);
|
||||
},
|
||||
_ => panic!("no absorb skill"),
|
||||
};
|
||||
@ -1495,7 +1495,7 @@ fn electrocute(source: &mut Construct, target: &mut Construct, mut results: Reso
|
||||
let electrocute = ConstructEffect::new(effect, duration).set_tick(Cast::new_tick(source, target, tick_skill));
|
||||
results.push(Resolution::new(source, target)
|
||||
.event(target.add_effect(skill, electrocute))
|
||||
.stages(EventStages::StartPost));
|
||||
.stages(EventStages::EndPost));
|
||||
return electrocute_tick(source, target, results, tick_skill);
|
||||
}
|
||||
|
||||
@ -1679,7 +1679,7 @@ fn purge(source: &mut Construct, target: &mut Construct, mut results: Resolution
|
||||
if turns > 0 {
|
||||
let mut effect = skill.effect()[0];
|
||||
effect.duration = effect.duration * turns;
|
||||
results.push(Resolution::new(source, target).event(target.add_effect(skill, effect)));
|
||||
results.push(Resolution::new(source, target).event(target.add_effect(skill, effect)).stages(EventStages::PostOnly));
|
||||
}
|
||||
|
||||
return results;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user