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 s = construct.skills[i];
|
||||||
const ko = construct.green_life.value === 0 ? 'ko' : '';
|
const ko = construct.green_life.value === 0 ? 'ko' : '';
|
||||||
|
|
||||||
if (!s) {
|
if (!s || !game) {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
disabled='true'
|
disabled='true'
|
||||||
|
|||||||
@ -26,6 +26,7 @@ class TargetSvg extends Component {
|
|||||||
render(props, state) {
|
render(props, state) {
|
||||||
const { game, account, animating, animTarget } = props;
|
const { game, account, animating, animTarget } = props;
|
||||||
const { width, height } = state;
|
const { width, height } = state;
|
||||||
|
if (!game) return false; // game will be null when battle ends
|
||||||
|
|
||||||
// resolutions happening
|
// resolutions happening
|
||||||
// just put skill name up
|
// just put skill name up
|
||||||
|
|||||||
@ -246,7 +246,7 @@ fn logout(req: &mut Request) -> IronResult<Response> {
|
|||||||
|
|
||||||
tx.commit().or(Err(MnmlHttpError::ServerError))?;
|
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()]));
|
res.headers.set(SetCookie(vec![AUTH_CLEAR.to_string()]));
|
||||||
Ok(res)
|
Ok(res)
|
||||||
|
|
||||||
|
|||||||
@ -272,7 +272,7 @@ pub fn resolve(skill: Skill, source: &mut Construct, target: &mut Construct, mut
|
|||||||
Skill::Stun => stun(source, target, resolutions, skill),
|
Skill::Stun => stun(source, target, resolutions, skill),
|
||||||
|
|
||||||
//Triggered
|
//Triggered
|
||||||
Skill::Electrocute|
|
Skill::Electrocute |
|
||||||
Skill::ElectrocutePlus |
|
Skill::ElectrocutePlus |
|
||||||
Skill::ElectrocutePlusPlus => panic!("should only trigger from electrify hit"),
|
Skill::ElectrocutePlusPlus => panic!("should only trigger from electrify hit"),
|
||||||
Skill::HasteStrike => panic!("should only trigger from haste"),
|
Skill::HasteStrike => panic!("should only trigger from haste"),
|
||||||
@ -314,7 +314,7 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
|
|||||||
.find(|e| e.effect == Effect::Absorb).unwrap().clone();
|
.find(|e| e.effect == Effect::Absorb).unwrap().clone();
|
||||||
match meta {
|
match meta {
|
||||||
Some(EffectMeta::Skill(s)) => {
|
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"),
|
_ => 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));
|
let electrocute = ConstructEffect::new(effect, duration).set_tick(Cast::new_tick(source, target, tick_skill));
|
||||||
results.push(Resolution::new(source, target)
|
results.push(Resolution::new(source, target)
|
||||||
.event(target.add_effect(skill, electrocute))
|
.event(target.add_effect(skill, electrocute))
|
||||||
.stages(EventStages::StartPost));
|
.stages(EventStages::EndPost));
|
||||||
return electrocute_tick(source, target, results, tick_skill);
|
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 {
|
if turns > 0 {
|
||||||
let mut effect = skill.effect()[0];
|
let mut effect = skill.effect()[0];
|
||||||
effect.duration = effect.duration * turns;
|
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;
|
return results;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user