v0.9.3: cursed wands can now proc on-zap effects like soul mark
This commit is contained in:
parent
a4b83fbe11
commit
6b6f69ab17
|
@ -38,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.mage.WarpBeacon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GoldenMimic;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Sheep;
|
||||
|
@ -81,7 +82,7 @@ import java.util.ArrayList;
|
|||
public class CursedWand {
|
||||
|
||||
private static float COMMON_CHANCE = 0.6f;
|
||||
private static float UNCOMMON_CHANCE = 10.3f;
|
||||
private static float UNCOMMON_CHANCE = 0.3f;
|
||||
private static float RARE_CHANCE = 0.09f;
|
||||
private static float VERY_RARE_CHANCE = 0.01f;
|
||||
|
||||
|
@ -97,6 +98,12 @@ public class CursedWand {
|
|||
});
|
||||
}
|
||||
|
||||
public static void tryForWandProc( Char target, Item origin ){
|
||||
if (target != null && origin instanceof Wand){
|
||||
Wand.wandProc(target, origin.buffedLvl(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean cursedEffect(final Item origin, final Char user, final Char target){
|
||||
return cursedEffect(origin, user, target.pos);
|
||||
}
|
||||
|
@ -127,11 +134,13 @@ public class CursedWand {
|
|||
Buff.affect(user, Burning.class).reignite(user);
|
||||
if (target != null) Buff.affect(target, Frost.class, Frost.DURATION);
|
||||
}
|
||||
tryForWandProc(target, origin);
|
||||
return true;
|
||||
|
||||
//spawns some regrowth
|
||||
case 1:
|
||||
GameScene.add( Blob.seed(targetPos, 30, Regrowth.class));
|
||||
tryForWandProc(Actor.findChar(targetPos), origin);
|
||||
return true;
|
||||
|
||||
//random teleportation
|
||||
|
@ -146,6 +155,7 @@ public class CursedWand {
|
|||
Char ch = Actor.findChar( targetPos );
|
||||
if (ch != null && !ch.properties().contains(Char.Property.IMMOVABLE)) {
|
||||
ScrollOfTeleportation.teleportChar(ch);
|
||||
tryForWandProc(ch, origin);
|
||||
} else {
|
||||
return cursedEffect(origin, user, targetPos);
|
||||
}
|
||||
|
@ -155,6 +165,7 @@ public class CursedWand {
|
|||
//random gas at location
|
||||
case 3:
|
||||
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
||||
tryForWandProc(Actor.findChar(targetPos), origin);
|
||||
switch (Random.Int(3)) {
|
||||
case 0: default:
|
||||
GameScene.add( Blob.seed( targetPos, 800, ConfusionGas.class ) );
|
||||
|
@ -182,6 +193,7 @@ public class CursedWand {
|
|||
&& Dungeon.level.traps.get(pos) == null
|
||||
&& !Dungeon.isChallenged(Challenges.NO_HERBALISM)) {
|
||||
Dungeon.level.plant((Plant.Seed) Generator.randomUsingDefaults(Generator.Category.SEED), pos);
|
||||
tryForWandProc(Actor.findChar(pos), origin);
|
||||
} else {
|
||||
return cursedEffect(origin, user, targetPos);
|
||||
}
|
||||
|
@ -220,6 +232,7 @@ public class CursedWand {
|
|||
} else {
|
||||
Sample.INSTANCE.play(Assets.Sounds.BURNING);
|
||||
}
|
||||
tryForWandProc(target, origin);
|
||||
} else {
|
||||
return cursedEffect(origin, user, targetPos);
|
||||
}
|
||||
|
@ -228,6 +241,7 @@ public class CursedWand {
|
|||
//Bomb explosion
|
||||
case 2:
|
||||
new Bomb().explode(targetPos);
|
||||
tryForWandProc(Actor.findChar(targetPos), origin);
|
||||
return true;
|
||||
|
||||
//shock and recharge
|
||||
|
|
|
@ -175,12 +175,12 @@ public abstract class Wand extends Item {
|
|||
charger.setScaleFactor( chargeScaleFactor );
|
||||
}
|
||||
|
||||
protected void processSoulMark(Char target, int chargesUsed){
|
||||
processSoulMark(target, buffedLvl(), chargesUsed);
|
||||
protected void wandProc(Char target, int chargesUsed){
|
||||
wandProc(target, buffedLvl(), chargesUsed);
|
||||
}
|
||||
|
||||
//TODO some naming issues here. Consider renaming this method and externalizing char awareness buff
|
||||
protected static void processSoulMark(Char target, int wandLevel, int chargesUsed){
|
||||
//TODO Consider externalizing char awareness buff
|
||||
protected static void wandProc(Char target, int wandLevel, int chargesUsed){
|
||||
if (Dungeon.hero.hasTalent(Talent.ARCANE_VISION)) {
|
||||
int dur = 5 + 5*Dungeon.hero.pointsInTalent(Talent.ARCANE_VISION);
|
||||
Buff.append(Dungeon.hero, TalismanOfForesight.CharAwareness.class, dur).charID = target.id();
|
||||
|
|
|
@ -79,7 +79,7 @@ public class WandOfBlastWave extends DamageWand {
|
|||
Char ch = Actor.findChar(bolt.collisionPos + i);
|
||||
|
||||
if (ch != null){
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
wandProc(ch, chargesPerCast());
|
||||
if (ch.alignment != Char.Alignment.ALLY) ch.damage(damageRoll(), this);
|
||||
|
||||
if (ch.pos == bolt.collisionPos + i) {
|
||||
|
@ -94,7 +94,7 @@ public class WandOfBlastWave extends DamageWand {
|
|||
//throws the char at the center of the blast
|
||||
Char ch = Actor.findChar(bolt.collisionPos);
|
||||
if (ch != null){
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
wandProc(ch, chargesPerCast());
|
||||
ch.damage(damageRoll(), this);
|
||||
|
||||
if (bolt.path.size() > bolt.dist+1 && ch.pos == bolt.collisionPos) {
|
||||
|
|
|
@ -63,7 +63,7 @@ public class WandOfCorrosion extends Wand {
|
|||
for (int i : PathFinder.NEIGHBOURS9) {
|
||||
Char ch = Actor.findChar(bolt.collisionPos + i);
|
||||
if (ch != null) {
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
wandProc(ch, chargesPerCast());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ public class WandOfCorruption extends Wand {
|
|||
}
|
||||
}
|
||||
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
wandProc(ch, chargesPerCast());
|
||||
Sample.INSTANCE.play( Assets.Sounds.HIT_MAGIC, 1, 0.8f * Random.Float(0.87f, 1.15f) );
|
||||
|
||||
} else {
|
||||
|
|
|
@ -110,7 +110,7 @@ public class WandOfDisintegration extends DamageWand {
|
|||
|
||||
int lvl = level + (chars.size()-1) + terrainBonus;
|
||||
for (Char ch : chars) {
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
wandProc(ch, chargesPerCast());
|
||||
ch.damage( damageRoll(lvl), this );
|
||||
ch.sprite.centerEmitter().burst( PurpleParticle.BURST, Random.IntRange( 1, 2 ) );
|
||||
ch.sprite.flash();
|
||||
|
|
|
@ -114,7 +114,7 @@ public class WandOfFireblast extends DamageWand {
|
|||
}
|
||||
|
||||
for ( Char ch : affectedChars ){
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
wandProc(ch, chargesPerCast());
|
||||
ch.damage(damageRoll(), this);
|
||||
if (ch.isAlive()) {
|
||||
Buff.affect(ch, Burning.class).reignite(ch);
|
||||
|
|
|
@ -77,7 +77,7 @@ public class WandOfFrost extends DamageWand {
|
|||
ch.sprite.burst( 0xFF99CCFF, buffedLvl() / 2 + 2 );
|
||||
}
|
||||
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
wandProc(ch, chargesPerCast());
|
||||
ch.damage(damage, this);
|
||||
Sample.INSTANCE.play( Assets.Sounds.HIT_MAGIC, 1, 1.1f * Random.Float(0.87f, 1.15f) );
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ public class WandOfLightning extends DamageWand {
|
|||
if (ch != curUser && ch.alignment == curUser.alignment && ch.pos != bolt.collisionPos){
|
||||
continue;
|
||||
}
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
wandProc(ch, chargesPerCast());
|
||||
if (ch == curUser) {
|
||||
ch.damage(Math.round(damageRoll() * multipler * 0.5f), this);
|
||||
} else {
|
||||
|
|
|
@ -93,7 +93,7 @@ public class WandOfLivingEarth extends DamageWand {
|
|||
if (guardian != null && guardian == ch){
|
||||
guardian.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + buffedLvl() / 2);
|
||||
guardian.setInfo(curUser, buffedLvl(), armorToAdd);
|
||||
processSoulMark(guardian, chargesPerCast());
|
||||
wandProc(guardian, chargesPerCast());
|
||||
Sample.INSTANCE.play( Assets.Sounds.HIT_MAGIC, 1, 0.9f * Random.Float(0.87f, 1.15f) );
|
||||
|
||||
//shooting the guardian at a location
|
||||
|
@ -109,7 +109,7 @@ public class WandOfLivingEarth extends DamageWand {
|
|||
|
||||
ch.sprite.centerEmitter().burst(MagicMissile.EarthParticle.BURST, 5 + buffedLvl()/2);
|
||||
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
wandProc(ch, chargesPerCast());
|
||||
ch.damage(damage, this);
|
||||
|
||||
int closest = -1;
|
||||
|
@ -153,7 +153,7 @@ public class WandOfLivingEarth extends DamageWand {
|
|||
|
||||
ch.sprite.centerEmitter().burst(MagicMissile.EarthParticle.BURST, 5 + buffedLvl() / 2);
|
||||
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
wandProc(ch, chargesPerCast());
|
||||
ch.damage(damage, this);
|
||||
Sample.INSTANCE.play( Assets.Sounds.HIT_MAGIC, 1, 0.8f * Random.Float(0.87f, 1.15f) );
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ public class WandOfMagicMissile extends DamageWand {
|
|||
Char ch = Actor.findChar( bolt.collisionPos );
|
||||
if (ch != null) {
|
||||
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
wandProc(ch, chargesPerCast());
|
||||
ch.damage(damageRoll(), this);
|
||||
Sample.INSTANCE.play( Assets.Sounds.HIT_MAGIC, 1, Random.Float(0.87f, 1.15f) );
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ public class WandOfPrismaticLight extends DamageWand {
|
|||
|
||||
Char ch = Actor.findChar(beam.collisionPos);
|
||||
if (ch != null){
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
wandProc(ch, chargesPerCast());
|
||||
affectTarget(ch);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ public class WandOfRegrowth extends Wand {
|
|||
}
|
||||
Char ch = Actor.findChar(cell);
|
||||
if (ch != null){
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
wandProc(ch, chargesPerCast());
|
||||
Buff.prolong( ch, Roots.class, 4f * chrgUsed );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class WandOfTransfusion extends Wand {
|
|||
|
||||
if (ch instanceof Mob){
|
||||
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
wandProc(ch, chargesPerCast());
|
||||
|
||||
//this wand does different things depending on the target.
|
||||
|
||||
|
|
|
@ -302,7 +302,7 @@ public class WandOfWarding extends Wand {
|
|||
int dmg = Random.NormalIntRange( 2 + wandLevel, 8 + 4*wandLevel );
|
||||
enemy.damage( dmg, this );
|
||||
if (enemy.isAlive()){
|
||||
Wand.processSoulMark(enemy, wandLevel, 1);
|
||||
Wand.wandProc(enemy, wandLevel, 1);
|
||||
}
|
||||
|
||||
if (!enemy.isAlive() && enemy == Dungeon.hero) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user