resolution result iteration
This commit is contained in:
@@ -412,6 +412,9 @@ impl Game {
|
||||
ResolutionResult::Damage { amount, category: _, immunity: _ } => {
|
||||
self.log.push(format!("{:?} {:?} {:?} {:?}", source.name, cast.skill, target.name, amount));
|
||||
},
|
||||
ResolutionResult::Healing { amount, category: _, immunity: _ } => {
|
||||
self.log.push(format!("{:?} {:?} {:?} {:?}", source.name, cast.skill, target.name, amount));
|
||||
},
|
||||
ResolutionResult::Effect { effect, duration, immunity: _ } => {
|
||||
self.log.push(format!("{:?} {:?} {:?} {:?} {:?}T", source.name, cast.skill, target.name, effect, duration));
|
||||
},
|
||||
|
||||
+11
-11
@@ -82,6 +82,7 @@ impl Disable {
|
||||
#[derive(Debug,Clone,PartialEq,Serialize,Deserialize)]
|
||||
pub enum ResolutionResult {
|
||||
Damage { amount: u64, category: Category , immunity: Immunity },
|
||||
Healing { amount: u64, category: Category , immunity: Immunity },
|
||||
Effect { effect: Effect, duration: u8, immunity: Immunity },
|
||||
Removal { effect: Effect, immunity: Immunity },
|
||||
}
|
||||
@@ -148,10 +149,9 @@ pub enum Effect {
|
||||
impl Effect {
|
||||
pub fn immune(&self, skill: Skill) -> bool {
|
||||
match self {
|
||||
Effect::Block => match skill {
|
||||
Skill::Stun |
|
||||
Skill::TestStun |
|
||||
Skill::Attack => true,
|
||||
Effect::Block => match skill.category() {
|
||||
Category::Spell => false,
|
||||
Category::Physical => true,
|
||||
_ => false,
|
||||
},
|
||||
Effect::Shield => match skill.category() {
|
||||
@@ -455,12 +455,12 @@ impl Skill {
|
||||
// Preservation
|
||||
// -----------------
|
||||
Skill::Heal => Category::Physical,
|
||||
Skill::Triage => Category::Physical, // hot
|
||||
Skill::TriageTick => Category::Physical, // hot
|
||||
Skill::Triage => Category::Spell, // hot
|
||||
Skill::TriageTick => Category::Spell, // hot
|
||||
Skill::Throw => Category::Physical, // no dmg stun, adds vulnerable
|
||||
Skill::Charm => Category::Physical,
|
||||
Skill::Charm => Category::Spell,
|
||||
Skill::Calm => Category::Physical,
|
||||
Skill::Rez => Category::Physical,
|
||||
Skill::Rez => Category::Spell,
|
||||
|
||||
// -----------------
|
||||
// Destruction
|
||||
@@ -852,7 +852,7 @@ fn heal(cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Resol
|
||||
let immunity = target.immune(Skill::Heal);
|
||||
let immune = immunity.immune;
|
||||
|
||||
let heal_result = ResolutionResult::Damage {
|
||||
let heal_result = ResolutionResult::Healing {
|
||||
amount,
|
||||
category: Category::PhysHeal,
|
||||
immunity,
|
||||
@@ -898,7 +898,7 @@ fn triage_tick(cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -
|
||||
let immunity = target.immune(Skill::TriageTick);
|
||||
let immune = immunity.immune;
|
||||
|
||||
let heal_result = ResolutionResult::Damage {
|
||||
let heal_result = ResolutionResult::Healing {
|
||||
amount,
|
||||
category: Category::PhysHeal,
|
||||
immunity,
|
||||
@@ -1074,7 +1074,7 @@ fn drain_tick(cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) ->
|
||||
immunity: immunity.clone(),
|
||||
};
|
||||
|
||||
let drain_tick_heal_result = ResolutionResult::Damage {
|
||||
let drain_tick_heal_result = ResolutionResult::Healing {
|
||||
amount,
|
||||
category: Category::SpellHeal,
|
||||
immunity,
|
||||
|
||||
Reference in New Issue
Block a user