v1.4.0: gladiator no longer gains combo when targeting allies

This commit is contained in:
Evan Debenham
2022-09-30 17:48:40 -04:00
parent 3430bb6a69
commit 0c853d9ef4
3 changed files with 9 additions and 6 deletions
@@ -324,7 +324,7 @@ public class Combo extends Buff implements ActionIndicator.Action {
//special on-hit effects //special on-hit effects
switch (moveBeingUsed) { switch (moveBeingUsed) {
case CLOBBER: case CLOBBER:
hit(enemy); if (!wasAlly) hit(enemy);
//trace a ballistica to our target (which will also extend past them //trace a ballistica to our target (which will also extend past them
Ballistica trajectory = new Ballistica(target.pos, enemy.pos, Ballistica.STOP_TARGET); Ballistica trajectory = new Ballistica(target.pos, enemy.pos, Ballistica.STOP_TARGET);
//trim it to just be the part that goes past them //trim it to just be the part that goes past them
@@ -431,6 +431,7 @@ public class Hero extends Char {
public boolean shoot( Char enemy, MissileWeapon wep ) { public boolean shoot( Char enemy, MissileWeapon wep ) {
this.enemy = enemy; this.enemy = enemy;
boolean wasEnemy = enemy.alignment == Alignment.ENEMY;
//temporarily set the hero's weapon to the missile weapon being used //temporarily set the hero's weapon to the missile weapon being used
//TODO improve this! //TODO improve this!
@@ -438,8 +439,8 @@ public class Hero extends Char {
boolean hit = attack( enemy ); boolean hit = attack( enemy );
Invisibility.dispel(); Invisibility.dispel();
belongings.thrownWeapon = null; belongings.thrownWeapon = null;
if (hit && subClass == HeroSubClass.GLADIATOR){ if (hit && subClass == HeroSubClass.GLADIATOR && wasEnemy){
Buff.affect( this, Combo.class ).hit( enemy ); Buff.affect( this, Combo.class ).hit( enemy );
} }
@@ -1849,13 +1850,14 @@ public class Hero extends Char {
public void onAttackComplete() { public void onAttackComplete() {
AttackIndicator.target(enemy); AttackIndicator.target(enemy);
boolean wasEnemy = enemy.alignment == Alignment.ENEMY;
boolean hit = attack( enemy ); boolean hit = attack( enemy );
Invisibility.dispel(); Invisibility.dispel();
spend( attackDelay() ); spend( attackDelay() );
if (hit && subClass == HeroSubClass.GLADIATOR){ if (hit && subClass == HeroSubClass.GLADIATOR && wasEnemy){
Buff.affect( this, Combo.class ).hit( enemy ); Buff.affect( this, Combo.class ).hit( enemy );
} }
@@ -122,9 +122,10 @@ public class Shockwave extends ArmorAbility {
} }
if (Random.Int(10) < 3*hero.pointsInTalent(Talent.STRIKING_WAVE)){ if (Random.Int(10) < 3*hero.pointsInTalent(Talent.STRIKING_WAVE)){
boolean wasEnemy = ch.alignment == Char.Alignment.ENEMY;
damage = hero.attackProc(ch, damage); damage = hero.attackProc(ch, damage);
ch.damage(damage, hero); ch.damage(damage, hero);
if (hero.subClass == HeroSubClass.GLADIATOR){ if (hero.subClass == HeroSubClass.GLADIATOR && wasEnemy){
Buff.affect( hero, Combo.class ).hit( ch ); Buff.affect( hero, Combo.class ).hit( ch );
} }
} else { } else {