v2.1.0: buffed the Charged Shot ability

This commit is contained in:
Evan Debenham
2023-05-15 15:46:08 -04:00
parent 08da3811f0
commit 2c2fec37dc
15 changed files with 77 additions and 38 deletions

View File

@@ -1521,10 +1521,10 @@ items.weapon.melee.battleaxe.desc=The enormous steel head of this battle axe put
items.weapon.melee.crossbow.name=crossbow
items.weapon.melee.crossbow.stats_desc=This weapon enhances the damage of thrown darts when equipped, and will even grant its enchantment to them.
items.weapon.melee.crossbow.ability_name=charged shot
items.weapon.melee.crossbow.ability_desc=The Duelist can ready a _charged shot_ with a crossbow. This ability activates instantly and causes the next fired dart to always hit, apply on-hit effects in a 3x3 tile area, and last longer if it is tipped.
items.weapon.melee.crossbow.ability_desc=The Duelist can ready a _charged shot_ with a crossbow. This ability activates instantly and causes the next fired dart to always hit, apply on-hit effects to enemies in a 5x5 tile area, and last longer if it is tipped.
items.weapon.melee.crossbow.desc=A fairly intricate weapon which shoots bolts at exceptional speeds. While it isn't designed for it, this crossbow's heft and sturdy construction make it a decent melee weapon as well.
items.weapon.melee.crossbow$chargedshot.name=charged shot
items.weapon.melee.crossbow$chargedshot.desc=The Duelist is focusing power into her crossbow. The next dart she fires with it will always hit and apply tipped dart effects and the crossbow's enchantment in a 3x3 area. Tipped darts will also have two extra uses when fired using a charged shot. The Duelist cannot use this ability to apply positive dart effects to herself.
items.weapon.melee.crossbow$chargedshot.desc=The Duelist is focusing power into her crossbow. The next dart she fires with it will always hit and apply tipped dart effects and the crossbow's enchantment in a 5x5 area. Positive dart effects will only affect allies, and harmful effects will only apply to enemies.\n\nTipped darts will also have four extra uses when fired using a charged shot. The Duelist cannot use this ability to apply positive dart effects to herself.
items.weapon.melee.dagger.name=dagger
items.weapon.melee.dagger.stats_desc=This weapon is stronger against unaware enemies.

View File

@@ -36,8 +36,10 @@ public class AdrenalineDart extends TippedDart {
@Override
public int proc(Char attacker, Char defender, int damage) {
if (attacker.alignment == defender.alignment && defender != attacker){
if (processingChargedShot && defender == attacker) {
//do nothing to the hero when processing charged shot
} else if (attacker.alignment == defender.alignment){
Buff.prolong( defender, Adrenaline.class, Adrenaline.DURATION);
return 0;
} else {

View File

@@ -35,8 +35,11 @@ public class BlindingDart extends TippedDart {
@Override
public int proc(Char attacker, Char defender, int damage) {
Buff.affect(defender, Blindness.class, Blindness.DURATION);
//when processing charged shot, only blind enemies
if (!processingChargedShot || attacker.alignment != defender.alignment) {
Buff.affect(defender, Blindness.class, Blindness.DURATION);
}
return super.proc(attacker, defender, damage);
}

View File

@@ -35,11 +35,14 @@ public class ChillingDart extends TippedDart {
@Override
public int proc(Char attacker, Char defender, int damage) {
if (Dungeon.level.water[defender.pos]){
Buff.prolong(defender, Chill.class, Chill.DURATION);
} else {
Buff.prolong(defender, Chill.class, 6f);
//when processing charged shot, only chill enemies
if (!processingChargedShot || attacker.alignment != defender.alignment) {
if (Dungeon.level.water[defender.pos]) {
Buff.prolong(defender, Chill.class, Chill.DURATION);
} else {
Buff.prolong(defender, Chill.class, 6f);
}
}
return super.proc(attacker, defender, damage);

View File

@@ -40,7 +40,9 @@ public class CleansingDart extends TippedDart {
@Override
public int proc(Char attacker, final Char defender, int damage) {
if (attacker.alignment == defender.alignment && defender != attacker){
if (processingChargedShot && defender == attacker) {
//do nothing to the hero when processing charged shot
} else if (attacker.alignment == defender.alignment){
PotionOfCleansing.cleanse(defender, PotionOfCleansing.Cleanse.DURATION*2f);
return 0;
} else {

View File

@@ -135,7 +135,9 @@ public class Dart extends MissileWeapon {
@Override
public int proc(Char attacker, Char defender, int damage) {
if (bow != null){
if (bow != null
//only apply enchant effects to enemies when processing charged shot
&& (!processingChargedShot || attacker.alignment != defender.alignment)){
damage = bow.proc(attacker, defender, damage);
}
@@ -160,13 +162,13 @@ public class Dart extends MissileWeapon {
super.onThrow(cell);
}
private boolean processingChargedShot = false;
protected boolean processingChargedShot = false;
private int chargedShotPos;
protected void processChargedShot( Char target, int dmg ){
//don't update xbow here, as dart may be the active weapon atm
processingChargedShot = true;
if (chargedShotPos != -1 && bow != null && Dungeon.hero.buff(Crossbow.ChargedShot.class) != null) {
PathFinder.buildDistanceMap(chargedShotPos, Dungeon.level.passable, 1);
PathFinder.buildDistanceMap(chargedShotPos, Dungeon.level.passable, 2);
//necessary to clone as some on-hit effects use Pathfinder
int[] distance = PathFinder.distance.clone();
for (Char ch : Actor.chars()){

View File

@@ -46,6 +46,11 @@ public class DisplacingDart extends TippedDart {
@Override
public int proc(Char attacker, Char defender, int damage) {
//only display enemies when processing charge shot
if (processingChargedShot && attacker.alignment == defender.alignment) {
return super.proc(attacker, defender, damage);
}
//attempts to teleport the enemy to a position 8-10 cells away from the hero
//prioritizes the closest visible cell to the defender, or closest non-visible if no visible are present
//grants vision on the defender if teleport goes to non-visible

View File

@@ -37,7 +37,8 @@ public class HealingDart extends TippedDart {
@Override
public int proc(Char attacker, Char defender, int damage) {
if (defender == attacker){
//do nothing to the hero or enemies when processing charged shot
if (processingChargedShot && (defender == attacker || attacker.alignment != defender.alignment)){
return super.proc(attacker, defender, damage);
}

View File

@@ -39,8 +39,13 @@ public class HolyDart extends TippedDart {
@Override
public int proc(Char attacker, Char defender, int damage) {
if (attacker.alignment == defender.alignment && defender != attacker){
//do nothing to the hero when processing charged shot
if (processingChargedShot && defender == attacker){
return super.proc(attacker, defender, damage);
}
if (attacker.alignment == defender.alignment){
Buff.affect(defender, Bless.class, Math.round(Bless.DURATION));
return 0;
}
@@ -49,7 +54,8 @@ public class HolyDart extends TippedDart {
defender.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10+buffedLvl() );
Sample.INSTANCE.play(Assets.Sounds.BURNING);
defender.damage(Random.NormalIntRange(10 + Dungeon.scalingDepth()/3, 20 + Dungeon.scalingDepth()/3), this);
} else {
//also do not bless enemies if processing charged shot
} else if (!processingChargedShot){
Buff.affect(defender, Bless.class, Math.round(Bless.DURATION));
}

View File

@@ -56,7 +56,10 @@ public class IncendiaryDart extends TippedDart {
@Override
public int proc( Char attacker, Char defender, int damage ) {
Buff.affect( defender, Burning.class ).reignite( defender );
//when processing charged shot, only burn enemies
if (!processingChargedShot || attacker.alignment != defender.alignment) {
Buff.affect(defender, Burning.class).reignite(defender);
}
return super.proc( attacker, defender, damage );
}

View File

@@ -34,7 +34,10 @@ public class ParalyticDart extends TippedDart {
@Override
public int proc( Char attacker, Char defender, int damage ) {
Buff.prolong( defender, Paralysis.class, 5f );
//when processing charged shot, only stun enemies
if (!processingChargedShot || attacker.alignment != defender.alignment) {
Buff.prolong(defender, Paralysis.class, 5f);
}
return super.proc( attacker, defender, damage );
}

View File

@@ -35,8 +35,11 @@ public class PoisonDart extends TippedDart {
@Override
public int proc(Char attacker, Char defender, int damage) {
Buff.affect( defender, Poison.class ).set( 3 + Dungeon.scalingDepth() / 2 );
//when processing charged shot, only poison enemies
if (!processingChargedShot || attacker.alignment != defender.alignment) {
Buff.affect(defender, Poison.class).set(3 + Dungeon.scalingDepth() / 2);
}
return super.proc(attacker, defender, damage);
}

View File

@@ -36,11 +36,14 @@ public class RotDart extends TippedDart {
@Override
public int proc(Char attacker, Char defender, int damage) {
if (defender.properties().contains(Char.Property.BOSS)
//when processing charged shot, only corrode enemies
if (processingChargedShot && attacker.alignment == defender.alignment) {
//do nothing
} else if (defender.properties().contains(Char.Property.BOSS)
|| defender.properties().contains(Char.Property.MINIBOSS)){
Buff.affect(defender, Corrosion.class).set(5f, Dungeon.scalingDepth()/3);
} else{
} else {
Buff.affect(defender, Corrosion.class).set(10f, Dungeon.scalingDepth());
}

View File

@@ -41,16 +41,19 @@ public class ShockingDart extends TippedDart {
@Override
public int proc(Char attacker, Char defender, int damage) {
defender.damage(Random.NormalIntRange(5 + Dungeon.scalingDepth()/4, 10 + Dungeon.scalingDepth()/4), this);
CharSprite s = defender.sprite;
if (s != null && s.parent != null) {
ArrayList<Lightning.Arc> arcs = new ArrayList<>();
arcs.add(new Lightning.Arc(new PointF(s.x, s.y + s.height / 2), new PointF(s.x + s.width, s.y + s.height / 2)));
arcs.add(new Lightning.Arc(new PointF(s.x + s.width / 2, s.y), new PointF(s.x + s.width / 2, s.y + s.height)));
s.parent.add(new Lightning(arcs, null));
Sample.INSTANCE.play( Assets.Sounds.LIGHTNING );
//when processing charged shot, only shock enemies
if (!processingChargedShot || attacker.alignment != defender.alignment) {
defender.damage(Random.NormalIntRange(5 + Dungeon.scalingDepth() / 4, 10 + Dungeon.scalingDepth() / 4), this);
CharSprite s = defender.sprite;
if (s != null && s.parent != null) {
ArrayList<Lightning.Arc> arcs = new ArrayList<>();
arcs.add(new Lightning.Arc(new PointF(s.x, s.y + s.height / 2), new PointF(s.x + s.width, s.y + s.height / 2)));
arcs.add(new Lightning.Arc(new PointF(s.x + s.width / 2, s.y), new PointF(s.x + s.width / 2, s.y + s.height)));
s.parent.add(new Lightning(arcs, null));
Sample.INSTANCE.play(Assets.Sounds.LIGHTNING);
}
}
return super.proc(attacker, defender, damage);

View File

@@ -180,9 +180,9 @@ public abstract class TippedDart extends Dart {
}
use *= (1f - lotusPreserve);
//grants 2 extra uses with charged shot
//grants 4 extra uses with charged shot
if (Dungeon.hero.buff(Crossbow.ChargedShot.class) != null){
use = 100f/((100f/use) + 2f) + 0.001f;
use = 100f/((100f/use) + 4f) + 0.001f;
}
return use;