self targeting fix

This commit is contained in:
ntr 2018-12-16 16:27:49 +11:00
parent 92c6da39bf
commit 6a5ecb1b2f
2 changed files with 6 additions and 2 deletions

View File

@ -234,8 +234,10 @@ class CombatSkills extends Phaser.Scene {
const skillPos = targetTextPosition(iter, team); const skillPos = targetTextPosition(iter, team);
const skillObj = new CrypSkill(this, skillPos[0], skillPos[1], skill, cryp); const skillObj = new CrypSkill(this, skillPos[0], skillPos[1], skill, cryp);
this.add.existing(skillObj); this.add.existing(skillObj);
// Don't add interaction for self_target skills // Don't add interaction for self_target skills
if (skill.self_targeting) { const crypSkill = cryp.skills.find(s => s.skill === skill.skill);
if (crypSkill.self_targeting) {
skillObj.skillBox.setFillStyle(0x9d9ea0); skillObj.skillBox.setFillStyle(0x9d9ea0);
} else { } else {
this.input.setDraggable(skillObj); this.input.setDraggable(skillObj);

View File

@ -640,7 +640,7 @@ impl Skill {
Skill::Strangle => panic!("nyi"), // no physical moves Skill::Strangle => panic!("nyi"), // no physical moves
Skill::Stun => stun(cryp, target, resolution), Skill::Stun => stun(cryp, target, resolution),
Skill::Evasion => panic!("nyi"), // additional layer of dmg avoidance Skill::Evasion => evade(cryp, target, resolution), // additional layer of dmg avoidance
// ----------------- // -----------------
// Technology // Technology
@ -733,6 +733,8 @@ impl Skill {
pub fn self_targeting(&self) -> bool { pub fn self_targeting(&self) -> bool {
match self { match self {
Skill::Block => true, Skill::Block => true,
Skill::Evasion => true,
Skill::Parry => true,
Skill::TestBlock => true, Skill::TestBlock => true,
_ => false, _ => false,
} }