rename to red and blue

This commit is contained in:
ntr
2019-02-15 19:01:07 +11:00
parent 08cc37e2b7
commit 8a78528c80
17 changed files with 299 additions and 293 deletions
+5 -5
View File
@@ -6,16 +6,16 @@
Rare `Increased Stamina`
Common `Increased Evasion rating`
Common `Increased Spell Shield rating`
Common `Increased Armour rating`
Common `Increased Blue Shield rating`
Common `Increased RedShield rating`
Common `Increased Healing done`
Common `Increased Healing received`
Common `Increased Spell Damage`
Common `Increased Physical Damage`
Common `Increased Blue Damage`
Common `Increased Red Damage`
Uncommon `Reduced hp loss penalty to evade chance`
Uncommon `Increased base evasion chance per X evasion rating`
Uncommon `Increased % mitigation from armour`
Uncommon `Increased % mitigation from red_shield`
Uncommon `Increased % mitigation from spell shield`
Uncommon `Increased damage over time`
+1 -1
View File
@@ -23,7 +23,7 @@ resolve phase:
## Dmg Chart
| Physical | Magic | Modifiers |
| Red | Magic | Modifiers |
| ------ | ------ | ------ |
| dmg | dmg | speed |
| evasion | resistance | cooldowns |
+8 -2
View File
@@ -30,7 +30,7 @@
* phys is faster and chaotic
* spells are slow and reliable
* defensives are implicit
* armour is restored, not gained
* red_shield is restored, not gained
* players can feel aggressive
# ask sam
@@ -56,10 +56,16 @@ taunt
## NOW
rename physical and spell
inventory + drops table
id
account
data
game
game ref games
index on game,account
drops_buy(game_id, index)
drops_get()
+59 -59
View File
@@ -45,14 +45,14 @@ pub enum Stat {
Hp,
Speed,
Stamina,
PhysicalDamage,
PhysicalDamageTaken,
SpellDamage,
SpellDamageTaken,
RedDamage,
RedDamageTaken,
BlueDamage,
BlueDamageTaken,
Healing,
HealingTaken,
Armour,
SpellShield,
RedShield,
BlueShield,
Evasion,
}
@@ -136,13 +136,13 @@ pub struct CrypRecover {
pub struct Cryp {
pub id: Uuid,
pub account: Uuid,
pub phys_dmg: CrypStat,
pub spell_dmg: CrypStat,
pub red_dmg: CrypStat,
pub red_shield: CrypStat,
pub blue_shield: CrypStat,
pub blue_dmg: CrypStat,
pub speed: CrypStat,
pub stamina: CrypStat,
pub hp: CrypStat,
pub armour: CrypStat,
pub spell_shield: CrypStat,
pub evasion: CrypStat,
pub xp: u64,
pub lvl: u8,
@@ -164,13 +164,13 @@ impl Cryp {
return Cryp {
id,
account: id,
phys_dmg: CrypStat { base: 0, value: 0, stat: Stat::PhysicalDamage },
spell_dmg: CrypStat { base: 0, value: 0, stat: Stat::SpellDamage },
red_dmg: CrypStat { base: 0, value: 0, stat: Stat::RedDamage },
red_shield: CrypStat { base: 0, value: 0, stat: Stat::RedShield },
blue_dmg: CrypStat { base: 0, value: 0, stat: Stat::BlueDamage },
blue_shield: CrypStat { base: 0, value: 0, stat: Stat::BlueShield },
speed: CrypStat { base: 0, value: 0, stat: Stat::Speed },
stamina: CrypStat { base: 0, value: 0, stat: Stat::Stamina },
hp: CrypStat { base: 0, value: 0, stat: Stat::Hp },
armour: CrypStat { base: 0, value: 0, stat: Stat::Armour },
spell_shield: CrypStat { base: 0, value: 0, stat: Stat::SpellShield },
evasion: CrypStat { base: 0, value: 0, stat: Stat::Evasion },
lvl: 0,
xp: 0,
@@ -238,15 +238,15 @@ impl Cryp {
let evasion_max = 5;
match stat {
Stat::PhysicalDamage => self.phys_dmg.set(rng.gen_range(stat_min, stat_max), &self.specs),
Stat::SpellDamage => self.spell_dmg.set(rng.gen_range(stat_min, stat_max), &self.specs),
Stat::RedDamage => self.red_dmg.set(rng.gen_range(stat_min, stat_max), &self.specs),
Stat::BlueDamage => self.blue_dmg.set(rng.gen_range(stat_min, stat_max), &self.specs),
Stat::Speed => self.speed.set(rng.gen_range(stat_min, stat_max), &self.specs),
Stat::Stamina => {
self.stamina.set(rng.gen_range(stam_min, stam_max), &self.specs);
self.hp.set(self.stamina.base, &self.specs)
},
Stat::SpellShield => self.spell_shield.set(rng.gen_range(stat_min, stat_max), &self.specs),
Stat::Armour => self.armour.set(rng.gen_range(stat_min, stat_max), &self.specs),
Stat::BlueShield => self.blue_shield.set(rng.gen_range(stat_min, stat_max), &self.specs),
Stat::RedShield => self.red_shield.set(rng.gen_range(stat_min, stat_max), &self.specs),
Stat::Evasion => self.evasion.set(rng.gen_range(evasion_min, evasion_max), &self.specs),
_ => panic!("{:?} not a rollable stat", stat),
};
@@ -262,8 +262,8 @@ impl Cryp {
self.xp = xp;
self.roll_stat(Stat::PhysicalDamage);
self.roll_stat(Stat::SpellDamage);
self.roll_stat(Stat::RedDamage);
self.roll_stat(Stat::BlueDamage);
self.roll_stat(Stat::Speed);
self.roll_stat(Stat::Stamina);
@@ -331,11 +331,11 @@ impl Cryp {
fn recalculate_stats(&mut self) -> &mut Cryp {
self.stamina.recalculate(&self.specs);
self.hp.recalculate(&self.specs);
self.phys_dmg.recalculate(&self.specs);
self.spell_dmg.recalculate(&self.specs);
self.red_dmg.recalculate(&self.specs);
self.red_shield.recalculate(&self.specs);
self.blue_dmg.recalculate(&self.specs);
self.blue_shield.recalculate(&self.specs);
self.evasion.recalculate(&self.specs);
self.armour.recalculate(&self.specs);
self.spell_shield.recalculate(&self.specs);
self.speed.recalculate(&self.specs);
self
@@ -468,24 +468,24 @@ impl Cryp {
// }
// Stats
pub fn phys_dmg(&self) -> u64 {
let phys_dmg_mods = self.effects.iter()
.filter(|e| e.effect.modifications().contains(&Stat::PhysicalDamage))
pub fn red_dmg(&self) -> u64 {
let red_dmg_mods = self.effects.iter()
.filter(|e| e.effect.modifications().contains(&Stat::RedDamage))
.map(|cryp_effect| cryp_effect.effect)
.collect::<Vec<Effect>>();
let modified_phys_dmg = phys_dmg_mods.iter().fold(self.phys_dmg.value, |acc, m| m.apply(acc));
return modified_phys_dmg;
let modified_red_dmg = red_dmg_mods.iter().fold(self.red_dmg.value, |acc, m| m.apply(acc));
return modified_red_dmg;
}
pub fn spell_dmg(&self) -> u64 {
let spell_dmg_mods = self.effects.iter()
.filter(|e| e.effect.modifications().contains(&Stat::SpellDamage))
pub fn blue_dmg(&self) -> u64 {
let blue_dmg_mods = self.effects.iter()
.filter(|e| e.effect.modifications().contains(&Stat::BlueDamage))
.map(|cryp_effect| cryp_effect.effect)
.collect::<Vec<Effect>>();
let modified_spell_dmg = spell_dmg_mods.iter().fold(self.spell_dmg.value, |acc, m| m.apply(acc));
return modified_spell_dmg;
let modified_blue_dmg = blue_dmg_mods.iter().fold(self.blue_dmg.value, |acc, m| m.apply(acc));
return modified_blue_dmg;
}
pub fn skill_speed(&self, s: Skill) -> u64 {
@@ -518,7 +518,7 @@ impl Cryp {
ResolutionResult::Healing {
amount: 0,
overhealing: 0,
category: Category::PhysHeal,
category: Category::RedHeal,
immunity: immunity.clone(),
};
}
@@ -546,12 +546,12 @@ impl Cryp {
return ResolutionResult::Healing {
amount: healing,
overhealing,
category: Category::PhysHeal,
category: Category::RedHeal,
immunity,
};
}
pub fn deal_phys_dmg(&mut self, skill: Skill, amount: u64) -> ResolutionResult {
pub fn deal_red_dmg(&mut self, skill: Skill, amount: u64) -> ResolutionResult {
let immunity = self.immune(skill);
let immune = immunity.immune;
@@ -559,29 +559,29 @@ impl Cryp {
return ResolutionResult::Damage {
amount: 0,
mitigation: 0,
category: Category::PhysDmg,
category: Category::RedDmg,
immunity,
};
}
let phys_dmg_mods = self.effects.iter()
.filter(|e| e.effect.modifications().contains(&Stat::PhysicalDamageTaken))
let red_dmg_mods = self.effects.iter()
.filter(|e| e.effect.modifications().contains(&Stat::RedDamageTaken))
.map(|cryp_effect| cryp_effect.effect)
.collect::<Vec<Effect>>();
// println!("{:?}", phys_dmg_mods);
// println!("{:?}", red_dmg_mods);
let modified_dmg = phys_dmg_mods.iter().fold(amount, |acc, m| m.apply(acc));
let modified_dmg = red_dmg_mods.iter().fold(amount, |acc, m| m.apply(acc));
// calculate amount of damage armour will not absorb
// eg 50 armour 25 dmg -> 0 remainder 25 mitigation
// 50 armour 100 dmg -> 50 remainder 50 mitigation
// 50 armour 5 dmg -> 0 remainder 5 mitigation
let remainder = modified_dmg.saturating_sub(self.armour.value);
// calculate amount of damage red_shield will not absorb
// eg 50 red_shield 25 dmg -> 0 remainder 25 mitigation
// 50 red_shield 100 dmg -> 50 remainder 50 mitigation
// 50 red_shield 5 dmg -> 0 remainder 5 mitigation
let remainder = modified_dmg.saturating_sub(self.red_shield.value);
let mitigation = modified_dmg.saturating_sub(remainder);
// reduce armour by mitigation amount
self.armour.reduce(mitigation);
// reduce red_shield by mitigation amount
self.red_shield.reduce(mitigation);
// deal remainder to hp
self.hp.reduce(remainder);
@@ -589,12 +589,12 @@ impl Cryp {
return ResolutionResult::Damage {
amount: remainder,
mitigation,
category: Category::PhysDmg,
category: Category::RedDmg,
immunity,
};
}
pub fn deal_spell_dmg(&mut self, skill: Skill, amount: u64) -> ResolutionResult {
pub fn deal_blue_dmg(&mut self, skill: Skill, amount: u64) -> ResolutionResult {
let immunity = self.immune(skill);
let immune = immunity.immune;
@@ -602,29 +602,29 @@ impl Cryp {
return ResolutionResult::Damage {
amount: 0,
mitigation: 0,
category: Category::SpellDmg,
category: Category::BlueDmg,
immunity,
};
}
let spell_dmg_mods = self.effects.iter()
.filter(|e| e.effect.modifications().contains(&Stat::SpellDamageTaken))
let blue_dmg_mods = self.effects.iter()
.filter(|e| e.effect.modifications().contains(&Stat::BlueDamageTaken))
.map(|cryp_effect| cryp_effect.effect)
.collect::<Vec<Effect>>();
// println!("{:?}", spell_dmg_mods);
// println!("{:?}", blue_dmg_mods);
let modified_dmg = spell_dmg_mods.iter().fold(amount, |acc, m| m.apply(acc));
let remainder = modified_dmg.saturating_sub(self.armour.value);
let modified_dmg = blue_dmg_mods.iter().fold(amount, |acc, m| m.apply(acc));
let remainder = modified_dmg.saturating_sub(self.blue_shield.value);
let mitigation = modified_dmg.saturating_sub(remainder);
self.armour.reduce(mitigation);
self.blue_shield.reduce(mitigation);
self.hp.reduce(remainder);
return ResolutionResult::Damage {
amount: remainder,
mitigation,
category: Category::SpellDmg,
category: Category::BlueDmg,
immunity,
};
}
+2 -2
View File
@@ -1014,12 +1014,12 @@ mod tests {
let x_cryp = x_team.cryps[0].clone();
let y_cryp = y_team.cryps[0].clone();
game.team_by_id(y_team.id).cryp_by_id(y_cryp.id).unwrap().phys_dmg.force(u64::max_value());
game.team_by_id(y_team.id).cryp_by_id(y_cryp.id).unwrap().red_dmg.force(u64::max_value());
game.team_by_id(y_team.id).cryp_by_id(y_cryp.id).unwrap().speed.force(u64::max_value());
// just in case
// remove all mitigation
game.team_by_id(x_team.id).cryp_by_id(x_cryp.id).unwrap().armour.force(0);
game.team_by_id(x_team.id).cryp_by_id(x_cryp.id).unwrap().red_shield.force(0);
let _x_stun_id = game.add_skill(x_team.id, x_cryp.id, Some(y_cryp.id), Skill::TestStun).unwrap();
game.add_skill(y_team.id, y_cryp.id, Some(x_cryp.id), Skill::Attack).unwrap();
+1 -1
View File
@@ -1104,7 +1104,7 @@ mod tests {
let x_cryp = x_team.cryps[0].clone();
let y_cryp = y_team.cryps[0].clone();
game.team_by_id(y_team.id).cryp_by_id(y_cryp.id).unwrap().phys_dmg.set(u64::max_value());
game.team_by_id(y_team.id).cryp_by_id(y_cryp.id).unwrap().red_dmg.set(u64::max_value());
let x_stun_id = game.add_skill(x_team.id, x_cryp.id, Some(y_team.id), Skill::TestStun).unwrap();
let y_attack_id = game.add_skill(y_team.id, y_cryp.id, Some(x_team.id), Skill::Attack).unwrap();
+23 -23
View File
@@ -17,19 +17,19 @@ use spec::{Spec, SpecType};
#[derive(Debug,Clone,Copy,PartialEq,Serialize,Deserialize)]
pub enum ItemAction {
RerollPhysDamage,
RerollSpellDamage,
RerollRedDamage,
RerollBlueDamage,
RerollSpeed,
RerollStamina,
RerollArmour,
RerollSpellShield,
RerollRedShield,
RerollBlueShield,
RerollEvasion,
SpecPhysDmg5,
SpecSpellDmg5,
SpecArmour5,
SpecSpellShield5,
SpecSpellEvasion5,
SpecRedDmg5,
SpecBlueDmg5,
SpecRedShield5,
SpecBlueShield5,
SpecBlueEvasion5,
}
#[derive(Debug,Clone,Copy,PartialEq,Serialize,Deserialize)]
@@ -53,15 +53,15 @@ impl Item {
fn apply(&mut self, tx: &mut Transaction, target: Uuid) -> Result<(), Error> {
match self.action {
ItemAction::RerollStamina => reroll(self, tx, target, Stat::Stamina),
ItemAction::RerollPhysDamage => reroll(self, tx, target, Stat::PhysicalDamage),
ItemAction::RerollSpellDamage => reroll(self, tx, target, Stat::SpellDamage),
ItemAction::RerollRedDamage => reroll(self, tx, target, Stat::RedDamage),
ItemAction::RerollBlueDamage => reroll(self, tx, target, Stat::BlueDamage),
ItemAction::RerollSpeed => reroll(self, tx, target, Stat::Speed),
ItemAction::RerollArmour => reroll(self, tx, target, Stat::Armour),
ItemAction::RerollSpellShield => reroll(self, tx, target, Stat::SpellShield),
ItemAction::RerollRedShield => reroll(self, tx, target, Stat::RedShield),
ItemAction::RerollBlueShield => reroll(self, tx, target, Stat::BlueShield),
ItemAction::RerollEvasion => reroll(self, tx, target, Stat::Evasion),
ItemAction::SpecPhysDmg5 => spec_add(self, tx, target, SpecType::PhysDamage5),
ItemAction::SpecSpellDmg5 => spec_add(self, tx, target, SpecType::SpellDamage5),
ItemAction::SpecRedDmg5 => spec_add(self, tx, target, SpecType::RedDamage5),
ItemAction::SpecBlueDmg5 => spec_add(self, tx, target, SpecType::BlueDamage5),
_ => unimplemented!(),
}
}
@@ -86,8 +86,8 @@ fn mode_drops(mode: GameMode) -> Vec<(ItemAction, usize)> {
match mode {
GameMode::Normal => vec![
(ItemAction::RerollStamina, 1),
(ItemAction::RerollPhysDamage, 1),
(ItemAction::RerollSpellDamage, 1),
(ItemAction::RerollRedDamage, 1),
(ItemAction::RerollBlueDamage, 1),
],
GameMode::Pvp => vec![
(ItemAction::RerollSpeed, 1),
@@ -96,19 +96,19 @@ fn mode_drops(mode: GameMode) -> Vec<(ItemAction, usize)> {
GameMode::Zone2v2Caster |
GameMode::Zone3v3MeleeMiniboss => vec![
(ItemAction::RerollEvasion, 1),
(ItemAction::RerollArmour, 1),
(ItemAction::RerollSpellShield, 1),
(ItemAction::RerollRedShield, 1),
(ItemAction::RerollBlueShield, 1),
],
GameMode::Zone3v3HealerBoss => vec![
(ItemAction::RerollSpeed, 1),
],
// _ => vec![
// (ItemAction::RerollStamina, 1),
// (ItemAction::RerollPhysDamage, 1),
// (ItemAction::RerollSpellDamage, 1),
// (ItemAction::RerollRedDamage, 1),
// (ItemAction::RerollBlueDamage, 1),
// (ItemAction::RerollSpeed, 1),
// (ItemAction::RerollArmour, 1),
// (ItemAction::RerollSpellShield, 1),
// (ItemAction::RerollRedShield, 1),
// (ItemAction::RerollBlueShield, 1),
// (ItemAction::RerollEvasion, 1),
// ],
}
+6 -6
View File
@@ -330,15 +330,15 @@ impl Rpc {
fn press_r(_data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
for action in [
ItemAction::RerollPhysDamage,
ItemAction::RerollSpellDamage,
ItemAction::RerollRedDamage,
ItemAction::RerollBlueDamage,
ItemAction::RerollSpeed,
ItemAction::RerollStamina,
ItemAction::RerollArmour,
ItemAction::RerollSpellShield,
ItemAction::RerollRedShield,
ItemAction::RerollBlueShield,
ItemAction::RerollEvasion,
ItemAction::SpecPhysDmg5,
ItemAction::SpecSpellDmg5,
ItemAction::SpecRedDmg5,
ItemAction::SpecBlueDmg5,
].into_iter() {
let item = Item::new(*action, account.id);
item_create(item, tx, account.id)?;
+123 -123
View File
@@ -137,13 +137,13 @@ impl Effect {
pub fn immune(&self, skill: Skill) -> bool {
match self {
Effect::Parry => match skill.category() {
Category::Spell => false,
Category::Physical => true,
Category::Blue => false,
Category::Red => true,
_ => false,
},
Effect::Shield => match skill.category() {
Category::Spell => true,
Category::Physical => false,
Category::Blue => true,
Category::Red => false,
_ => false,
},
Effect::Banish => true,
@@ -157,18 +157,18 @@ impl Effect {
Effect::Hex => true,
Effect::Banish => true,
Effect::Silence => match skill.category() {
Category::Spell => true,
Category::Physical => false,
Category::Blue => true,
Category::Red => false,
_ => false,
},
Effect::Snare => match skill.category() {
Category::Spell => false,
Category::Physical => true,
Category::Blue => false,
Category::Red => true,
_ => false,
},
Effect::Ko => match skill.category() {
Category::SpellTick => false,
Category::BlueTick => false,
_ => true,
},
_ => false,
@@ -177,12 +177,12 @@ impl Effect {
pub fn modifications(&self) -> Vec<Stat> {
match self {
Effect::Empower => vec![Stat::PhysicalDamage],
Effect::Vulnerable => vec![Stat::PhysicalDamageTaken],
Effect::Block => vec![Stat::PhysicalDamageTaken],
Effect::Empower => vec![Stat::RedDamage],
Effect::Vulnerable => vec![Stat::RedDamageTaken],
Effect::Block => vec![Stat::RedDamageTaken],
Effect::Amplify => vec![Stat::SpellDamage],
Effect::Curse => vec![Stat::SpellDamageTaken],
Effect::Amplify => vec![Stat::BlueDamage],
Effect::Curse => vec![Stat::BlueDamageTaken],
Effect::Haste => vec![Stat::Speed],
Effect::Slow => vec![Stat::Speed],
@@ -216,43 +216,43 @@ impl Effect {
pub fn category(&self) -> Category {
match self {
// physical
Effect::Stun => Category::PhysDebuff,
Effect::Block => Category::PhysBuff,
Effect::Parry => Category::PhysBuff,
Effect::Bleed => Category::PhysDebuff,
Effect::Leech => Category::PhysDebuff,
Effect::Airborne => Category::PhysDebuff,
Effect::Untouchable => Category::PhysBuff,
Effect::Deadly => Category::PhysBuff,
Effect::Vulnerable => Category::PhysDebuff,
Effect::Fury => Category::PhysBuff,
Effect::Blind => Category::PhysDebuff,
Effect::Snare => Category::PhysDebuff,
Effect::Stun => Category::RedDebuff,
Effect::Block => Category::RedBuff,
Effect::Parry => Category::RedBuff,
Effect::Bleed => Category::RedDebuff,
Effect::Leech => Category::RedDebuff,
Effect::Airborne => Category::RedDebuff,
Effect::Untouchable => Category::RedBuff,
Effect::Deadly => Category::RedBuff,
Effect::Vulnerable => Category::RedDebuff,
Effect::Fury => Category::RedBuff,
Effect::Blind => Category::RedDebuff,
Effect::Snare => Category::RedDebuff,
Effect::Empower => Category::PhysBuff,
Effect::Empower => Category::RedBuff,
// magic
Effect::Hex => Category::SpellDebuff,
Effect::Curse => Category::SpellDebuff,
Effect::Banish => Category::SpellDebuff, // todo randomise
Effect::Slow => Category::SpellDebuff,
Effect::Haste => Category::SpellBuff,
Effect::Enslave => Category::SpellDebuff,
Effect::Mesmerise => Category::SpellDebuff,
Effect::Amplify => Category::SpellBuff,
Effect::Silence => Category::SpellDebuff,
Effect::Hex => Category::BlueDebuff,
Effect::Curse => Category::BlueDebuff,
Effect::Banish => Category::BlueDebuff, // todo randomise
Effect::Slow => Category::BlueDebuff,
Effect::Haste => Category::BlueBuff,
Effect::Enslave => Category::BlueDebuff,
Effect::Mesmerise => Category::BlueDebuff,
Effect::Amplify => Category::BlueBuff,
Effect::Silence => Category::BlueDebuff,
// magic immunity
Effect::Shield => Category::SpellBuff,
Effect::Shield => Category::BlueBuff,
// effects over time
Effect::Triage => Category::SpellBuff,
Effect::Decay => Category::SpellDebuff,
Effect::Regen => Category::SpellBuff,
Effect::Drain => Category::SpellDebuff,
Effect::Triage => Category::BlueBuff,
Effect::Decay => Category::BlueDebuff,
Effect::Regen => Category::BlueBuff,
Effect::Drain => Category::BlueDebuff,
Effect::SpeedDrain => Category::SpellDebuff,
Effect::SpeedIncrease => Category::SpellBuff,
Effect::SpeedDrain => Category::BlueDebuff,
Effect::SpeedIncrease => Category::BlueBuff,
Effect::Ko => Category::Ko,
}
@@ -296,18 +296,18 @@ impl Effect {
#[derive(Debug,Clone,Copy,PartialEq,Serialize,Deserialize)]
pub enum Category {
Physical,
PhysHeal,
PhysDmg,
PhysDebuff,
PhysBuff,
PhysTick,
Spell,
SpellDmg,
SpellHeal,
SpellDebuff,
SpellBuff,
SpellTick,
Red,
RedHeal,
RedDmg,
RedDebuff,
RedBuff,
RedTick,
Blue,
BlueDmg,
BlueHeal,
BlueDebuff,
BlueBuff,
BlueTick,
Ko,
}
@@ -485,88 +485,88 @@ impl Skill {
pub fn category(&self) -> Category {
match self {
Skill::Attack => Category::Physical,
Skill::Attack => Category::Red,
// -----------------
// Nature
// -----------------
Skill::Block => Category::Physical, // reduce dmg
Skill::Parry => Category::Physical, // avoid all dmg
Skill::Snare => Category::Physical,
Skill::Block => Category::Red, // reduce dmg
Skill::Parry => Category::Red, // avoid all dmg
Skill::Snare => Category::Red,
Skill::Paralyse => Category::Physical,
Skill::Strangle => Category::Physical,
Skill::Paralyse => Category::Red,
Skill::Strangle => Category::Red,
// Strangle
Skill::Stun => Category::Physical,
Skill::Stun => Category::Red,
// -----------------
// Technology
// -----------------
Skill::Replicate => Category::Physical,
Skill::Swarm => Category::Physical,
Skill::Orbit => Category::Physical,
Skill::Repair => Category::Physical,
Skill::Scan => Category::Physical, // track?
Skill::Replicate => Category::Red,
Skill::Swarm => Category::Red,
Skill::Orbit => Category::Red,
Skill::Repair => Category::Red,
Skill::Scan => Category::Red, // track?
// -----------------
// Preservation
// -----------------
Skill::Heal => Category::Physical,
Skill::Triage => Category::Spell, // hot
Skill::TriageTick => Category::SpellTick, // hot
Skill::Throw => Category::Physical, // no dmg stun, adds vulnerable
Skill::Charm => Category::Spell,
Skill::Calm => Category::Physical,
Skill::Rez => Category::Spell,
Skill::Heal => Category::Red,
Skill::Triage => Category::Blue, // hot
Skill::TriageTick => Category::BlueTick, // hot
Skill::Throw => Category::Red, // no dmg stun, adds vulnerable
Skill::Charm => Category::Blue,
Skill::Calm => Category::Red,
Skill::Rez => Category::Blue,
// -----------------
// Destruction
// -----------------
Skill::Blast => Category::Spell,
Skill::Amplify => Category::Spell,
Skill::Decay => Category::Spell, // dot
Skill::DecayTick => Category::SpellTick, // hot
Skill::Drain => Category::Spell,
Skill::DrainTick => Category::SpellTick, // hot
Skill::Curse => Category::Spell,
Skill::Plague => Category::Spell, // aoe dot
Skill::Ruin => Category::Spell, // aoe
Skill::Blast => Category::Blue,
Skill::Amplify => Category::Blue,
Skill::Decay => Category::Blue, // dot
Skill::DecayTick => Category::BlueTick, // hot
Skill::Drain => Category::Blue,
Skill::DrainTick => Category::BlueTick, // hot
Skill::Curse => Category::Blue,
Skill::Plague => Category::Blue, // aoe dot
Skill::Ruin => Category::Blue, // aoe
// -----------------
// Purity
// -----------------
// Skill::Precision => 1,
Skill::Empower => Category::Physical,
Skill::Slay => Category::Physical,
Skill::Shield => Category::Spell,
Skill::Silence => Category::Spell,
Skill::Inquiry => Category::Spell,
Skill::Purify => Category::Spell,
Skill::Purge => Category::Spell,
Skill::Empower => Category::Red,
Skill::Slay => Category::Red,
Skill::Shield => Category::Blue,
Skill::Silence => Category::Blue,
Skill::Inquiry => Category::Blue,
Skill::Purify => Category::Blue,
Skill::Purge => Category::Blue,
// -----------------
// Chaos
// -----------------
Skill::Banish => Category::Spell,
Skill::Hex => Category::Spell,
Skill::Fear => Category::Spell,
Skill::Taunt => Category::Spell,
Skill::Pause => Category::Spell, // extend durations
Skill::Banish => Category::Blue,
Skill::Hex => Category::Blue,
Skill::Fear => Category::Blue,
Skill::Taunt => Category::Blue,
Skill::Pause => Category::Blue, // extend durations
// Skill::Lag => 2, //
Skill::Haste => Category::Spell,
Skill::Slow => Category::Spell,
Skill::Haste => Category::Blue,
Skill::Slow => Category::Blue,
// -----------------
// Test
// -----------------
Skill::TestTouch => Category::Physical,
Skill::TestStun => Category::Physical,
Skill::TestParry => Category::Physical,
Skill::TestBlock => Category::Physical,
Skill::TestDrain => Category::Spell,
Skill::TestTouch => Category::Red,
Skill::TestStun => Category::Red,
Skill::TestParry => Category::Red,
Skill::TestBlock => Category::Red,
Skill::TestDrain => Category::Blue,
}
}
@@ -664,7 +664,7 @@ impl Skill {
return resolution;
}
match self.category() == Category::Physical {
match self.category() == Category::Red {
true => {
if let Some(evasion) = target.evade(*self) {
resolution.results.push(evasion);
@@ -780,8 +780,8 @@ impl Skill {
}
fn attack(cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Resolution {
let amount = cryp.phys_dmg();
resolution.results.push(target.deal_phys_dmg(Skill::Attack, amount));
let amount = cryp.red_dmg();
resolution.results.push(target.deal_red_dmg(Skill::Attack, amount));
return resolution;
}
@@ -828,7 +828,7 @@ fn empower(_cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> R
}
fn heal(cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Resolution {
let amount = cryp.spell_dmg();
let amount = cryp.blue_dmg();
resolution.results.push(target.heal(Skill::Heal, amount));
return resolution;
}
@@ -858,14 +858,14 @@ fn triage(cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Res
}
fn triage_tick(cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Resolution {
let amount = cryp.spell_dmg().wrapping_div(2);
let amount = cryp.blue_dmg().wrapping_div(2);
resolution.results.push(target.heal(Skill::TriageTick, amount));
return resolution;
}
fn blast(cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Resolution {
let amount = cryp.spell_dmg();
resolution.results.push(target.deal_spell_dmg(Skill::Blast, amount));
let amount = cryp.blue_dmg();
resolution.results.push(target.deal_blue_dmg(Skill::Blast, amount));
return resolution;
}
@@ -898,8 +898,8 @@ fn decay(cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Reso
}
fn decay_tick(cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Resolution {
let amount = cryp.spell_dmg();
resolution.results.push(target.deal_spell_dmg(Skill::DecayTick, amount));
let amount = cryp.blue_dmg();
resolution.results.push(target.deal_blue_dmg(Skill::DecayTick, amount));
return resolution;
}
@@ -926,8 +926,8 @@ fn drain(cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Reso
}
fn drain_tick(cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Resolution {
let amount = cryp.spell_dmg();
let drain_dmg = target.deal_spell_dmg(Skill::DrainTick, amount);
let amount = cryp.blue_dmg();
let drain_dmg = target.deal_blue_dmg(Skill::DrainTick, amount);
resolution.results.push(drain_dmg.clone());
match drain_dmg {
@@ -960,7 +960,7 @@ fn purge(_cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Res
if !immune {
for (i, ce) in target.effects.clone().iter_mut().enumerate() {
if ce.effect.category() == Category::SpellBuff {
if ce.effect.category() == Category::BlueBuff {
target.effects.remove(i);
resolution.results.push(ResolutionResult::Removal { effect: ce.effect, immunity: immunity.clone() });
}
@@ -976,7 +976,7 @@ fn purify(_cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Re
if !immune {
for (i, ce) in target.effects.clone().iter_mut().enumerate() {
if ce.effect.category() == Category::SpellDebuff {
if ce.effect.category() == Category::BlueDebuff {
target.effects.remove(i);
resolution.results.push(ResolutionResult::Removal { effect: ce.effect, immunity: immunity.clone() });
}
@@ -1011,7 +1011,7 @@ mod tests {
.learn(Skill::Heal)
.create();
x.deal_phys_dmg(Skill::Attack, 5);
x.deal_red_dmg(Skill::Attack, 5);
heal(&mut y, &mut x, Resolution::new(Skill::Heal));
}
@@ -1051,7 +1051,7 @@ mod tests {
.create();
// ensure it doesn't have 0 pd
x.phys_dmg.force(100);
x.red_dmg.force(100);
y.hp.force(500);
block(&mut y.clone(), &mut y, Resolution::new(Skill::Block));
@@ -1078,13 +1078,13 @@ mod tests {
.create();
// ensure it doesn't have 0 sd
x.spell_dmg.force(50);
x.blue_dmg.force(50);
// remove all mitigation
y.armour.force(0);
y.spell_shield.force(0);
y.red_shield.force(0);
y.blue_shield.force(0);
y.deal_phys_dmg(Skill::Attack, 5);
y.deal_red_dmg(Skill::Attack, 5);
let prev_hp = y.hp();
let res = Resolution::new(Skill::Triage);
@@ -1118,11 +1118,11 @@ mod tests {
.level(8)
.create();
x.spell_dmg.force(50);
x.blue_dmg.force(50);
amplify(&mut x.clone(), &mut x, Resolution::new(Skill::Amplify));
assert!(x.effects.iter().any(|e| e.effect == Effect::Amplify));
assert_eq!(x.spell_dmg(), 100);
assert_eq!(x.blue_dmg(), 100);
}
#[test]
+8 -8
View File
@@ -25,30 +25,30 @@ impl Spec {
pub fn apply(&self, modified: u64, base: u64) -> u64 {
match self.spec {
SpecType::PhysDamage5 => modified + (base * 5 / 100),
SpecType::SpellDamage5 => modified + (base * 5 / 100),
SpecType::RedDamage5 => modified + (base * 5 / 100),
SpecType::BlueDamage5 => modified + (base * 5 / 100),
}
}
}
#[derive(Debug,Copy,Clone,Serialize,Deserialize,PartialEq)]
pub enum SpecType {
PhysDamage5,
SpellDamage5,
RedDamage5,
BlueDamage5,
}
impl SpecType {
fn affects(&self) -> Stat {
match *self {
SpecType::PhysDamage5 => Stat::PhysicalDamage,
SpecType::SpellDamage5 => Stat::SpellDamage,
SpecType::RedDamage5 => Stat::RedDamage,
SpecType::BlueDamage5 => Stat::BlueDamage,
}
}
fn level(&self) -> SpecLevel {
match *self {
SpecType::PhysDamage5 => SpecLevel::Common,
SpecType::SpellDamage5 => SpecLevel::Common,
SpecType::RedDamage5 => SpecLevel::Common,
SpecType::BlueDamage5 => SpecLevel::Common,
}
}
}