ruin & aoe skills

This commit is contained in:
Mashy
2019-07-05 16:54:09 +10:00
parent 3dd3536101
commit 1bc73694ce
5 changed files with 128 additions and 61 deletions
+8 -2
View File
@@ -9,11 +9,16 @@ use game::{Game};
use effect::{Effect, Colour, Cooldown};
pub fn dev_resolve(a_id: Uuid, b_id: Uuid, skill: Skill) -> Resolutions {
let mut resolutions = vec![];
let mut a = Construct::new();
a.id = a_id;
let mut b = Construct::new();
b.id = b_id;
return resolve(skill, &mut a, &mut b, vec![]);
if skill.aoe() { // Send an aoe skill event for anims
resolutions.push(Resolution::new(&a, &b).event(Event::AoeSkill { skill }));
}
return resolve(skill, &mut a, &mut b, resolutions);
}
pub fn resolution_steps(cast: &Cast, game: &mut Game) -> Resolutions {
@@ -31,7 +36,7 @@ pub fn pre_resolve(cast: &Cast, game: &mut Game, mut resolutions: Resolutions) -
if skill.aoe() { // Send an aoe skill event for anims
resolutions.push(Resolution::new(&source,
&game.construct_by_id(cast.target_construct_id).unwrap().clone()).event(Event::Skill { skill }));
&game.construct_by_id(cast.target_construct_id).unwrap().clone()).event(Event::AoeSkill { skill }));
}
for target_id in targets {
@@ -460,6 +465,7 @@ pub enum Event {
Recharge { skill: Skill, red: u64, blue: u64 },
Inversion { skill: Skill },
Reflection { skill: Skill },
AoeSkill { skill: Skill },
Skill { skill: Skill },
Effect { skill: Skill, effect: Effect, duration: u8, construct_effects: Vec<ConstructEffect> },
Removal { effect: Effect, construct_effects: Vec<ConstructEffect> },