From 83b73c50ad05b34b7d9604a8bc38258d41567b42 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 16 Dec 2015 17:46:35 -0500 Subject: [PATCH] v0.3.3: implemented the UNDEAD property --- .../actors/mobs/FetidRat.java | 1 + .../actors/mobs/Guard.java | 2 ++ .../actors/mobs/King.java | 3 +++ .../actors/mobs/Monk.java | 2 ++ .../actors/mobs/Skeleton.java | 2 ++ .../actors/mobs/Warlock.java | 2 ++ .../actors/mobs/Wraith.java | 2 ++ .../shatteredpixeldungeon/actors/mobs/Yog.java | 1 + .../items/wands/WandOfTransfusion.java | 18 +----------------- 9 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/FetidRat.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/FetidRat.java index 99503c810..b8e47604c 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/FetidRat.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/FetidRat.java @@ -46,6 +46,7 @@ public class FetidRat extends Rat { state = WANDERING; properties.add(Property.MINIBOSS); + properties.add(Property.UNDEAD); } @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java index 116cb8b64..a62b353a6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java @@ -53,6 +53,8 @@ public class Guard extends Mob { loot = null; //see createloot. lootChance = 1; + + properties.add(Property.UNDEAD); } @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java index 2dc1a4e51..e235861ba 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java @@ -68,6 +68,7 @@ public class King extends Mob { Undead.count = 0; properties.add(Property.BOSS); + properties.add(Property.UNDEAD); } private boolean nextPedestal = true; @@ -281,6 +282,8 @@ public class King extends Mob { EXP = 0; state = WANDERING; + + properties.add(Property.UNDEAD); } @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Monk.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Monk.java index 6077bc669..5b1ea67ea 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Monk.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Monk.java @@ -52,6 +52,8 @@ public class Monk extends Mob { loot = new Food(); lootChance = 0.083f; + + properties.add(Property.UNDEAD); } @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java index 0aa6560f4..45d377a57 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java @@ -52,6 +52,8 @@ public class Skeleton extends Mob { loot = Generator.Category.WEAPON; lootChance = 0.2f; + + properties.add(Property.UNDEAD); } @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java index 02fc44e63..e33aa0a13 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java @@ -58,6 +58,8 @@ public class Warlock extends Mob implements Callback { loot = Generator.Category.POTION; lootChance = 0.83f; + + properties.add(Property.UNDEAD); } @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java index c22fd6f23..5fb1b04f6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java @@ -49,6 +49,8 @@ public class Wraith extends Mob { EXP = 0; flying = true; + + properties.add(Property.UNDEAD); } private static final String LEVEL = "level"; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java index d29bf2c33..c04d669d3 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java @@ -233,6 +233,7 @@ public class Yog extends Mob { state = WANDERING; properties.add(Property.BOSS); + properties.add(Property.UNDEAD); } @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java index 6e689b778..453fd2c81 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java @@ -69,22 +69,6 @@ public class WandOfTransfusion extends Wand { private boolean freeCharge = false; - //FIXME: this is sloppy - private static HashSet undeadMobs = new HashSet(Arrays.asList( - //Any Location - Wraith.class, - //Sewers - FetidRat.class, - //Prison - Skeleton.class, - //City - Warlock.class, Monk.class, Senior.class, - King.class, King.Undead.class, - //Halls - Succubus.class, - Yog.RottingFist.class - )); - @Override protected void onZap(Ballistica beam) { @@ -114,7 +98,7 @@ public class WandOfTransfusion extends Wand { ch.sprite.showStatus(CharSprite.POSITIVE, "+%dHP", healing); //harms the undead - } else if (undeadMobs.contains(ch.getClass())){ + } else if (ch.properties().contains(Char.Property.UNDEAD)){ //deals 30%+5%*lvl total HP. int damage = (int) Math.ceil(ch.HT*(0.3f+(0.05f*level())));