From 618fe90a4241976333f65d1f63d87fdfb9720960 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 5 Dec 2019 16:59:40 -0500 Subject: [PATCH] v0.8.0: added an armored rare variant to statues --- core/src/main/assets/statue.png | Bin 1083 -> 2817 bytes .../actors/mobs/ArmoredStatue.java | 110 ++++++++++++++++++ .../actors/mobs/Statue.java | 8 ++ .../levels/rooms/special/StatueRoom.java | 2 +- .../levels/traps/DistortionTrap.java | 2 +- .../sprites/StatueSprite.java | 19 ++- .../messages/actors/actors.properties | 5 +- 7 files changed, 142 insertions(+), 4 deletions(-) create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/ArmoredStatue.java diff --git a/core/src/main/assets/statue.png b/core/src/main/assets/statue.png index 3b2bdb8346c63d66799196f51c4efda60400beb9..d33e1e84824367368561a32914884c9e6650a50a 100644 GIT binary patch delta 2584 zcmV+z3g`8^2!R%m7ZpGV0{{R3!h>0i0005JP)t-s0001yEbxB-9Bh4~#!V^{rhHPK zl7`8_x%=|x092*`MvQA?TlePC0256;Xqt>@MRQd+G#m_UJQ}5+n6JXqWQwo<#vEa9 zd$6#uK~GzqsIkPv#Dk8PWpR5bGCP5en0a}5mzS5$$c5U~k-oZq{}~ykqHVgeQp^+- z<>I(QPg(y00)T&gRBQnOrV$aN0s?GjFF-vUg;_W@3R!hBmsKWolVhxsbg#67&R9fv zS8Zp~;MT#c)7H1;cZ!HvZEcmOqOHZWA1^PKgs(VDNgYVdfdBvi0d!JMQvg8b*k%9# z2=hrqK~#7Fw3TIItUwTiW4On0UEdvecK@rrA~S)GcVvI-*VoNh6?P(Zda8iO5MvB& zGm5jbxqW^<^Tox>< zET-pXjG^uKimPk*x9x`nZf@b<^PG|I?%_WSC)ZE-=K_cmNaHd!!5Bl^uNE?ZG=pRS zPF@scAp?K#tGcNhUvm45e=LA*(RB+=@v`fd8tGG}Mww&ilCKvsfYo}nTB|2uv)ydA z>IvBGcZa?II{#PzdKbr?#$j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R8e`M4ZOg>0;J+)!l};s4 z8FN#PLHw@qd{uuvDmWVmhK6xea5gX++xAhx*Hho{-wBvZk0p>9b5o8%{HF2z+5A{c zfVNmJS4$?qTyM6Ut;u+I$A2aujKVMyILBcaGe!=^+|*-m$v2JXCux$T{0qqPEX(;9 zP?SYgn$P*q1c>2e5(-4dgA$Ipi|Yo>&5GwM$!wNz0eXM7SY%v)Rjk*A`J7>3_scy% zoJ>T4$e5dO%w62pXt2We0A)5)E_;B!Sm>8Mz*_Gt^Ch!7@h=28A_k|hE0K@6i|c8P z=6c2R6bJ}(2pCz`fwTHRavTJr0J_&;a?XR=NhnUlQStt#*-w{YwT_g!T+{<4emh-V zA*hdgmgIkLs}Qth;T%BLZr@wyI0u0{$1O{K7UU+F!IGfC>Dln??DTX5kI(T7cyWF{ zfp4$yt9OIXx~Kb8AjBQVrcK{DOCg2zAG(7%D4)Zv>H3b)F54IwM z`1+fFfgu`jiLd`TI&g^wTqD*M(p|s%xmO`vs8oLxg|ul>)+Fv^yf!9+ICS?M@XnfW z8=S<=fJwz>U6Hvs`QIT59GniG(lpDSM&<)Be#!HX&zFgLb8p|izJGq--o4zjNUIp7 zXxnD%Q|=N{z&s&TjG)@C;{cguZH#4b9W)_htfLZhpH1VI?9nWpFBXe*1W%Uvswj$l z0>6KkUsYXKU+|yqrCSGqqN4$v17odhV{SmEx7~w!2LJeJk2nq4d;JZV#r(0 z_EwsJ-@fiuoCm|EU1G + */ + +package com.shatteredpixel.shatteredpixeldungeon.actors.mobs; + +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.items.Generator; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; +import com.shatteredpixel.shatteredpixeldungeon.sprites.StatueSprite; +import com.watabou.utils.Bundle; +import com.watabou.utils.Random; + +public class ArmoredStatue extends Statue { + + { + spriteClass = StatueSprite.class; + } + + protected Armor armor; + + public ArmoredStatue(){ + super(); + + do { + armor = Generator.randomArmor(); + } while (armor.cursed); + armor.inscribe(Armor.Glyph.random()); + + //double HP + HP = HT = 30 + Dungeon.depth * 10; + } + + private static final String ARMOR = "armor"; + + @Override + public void storeInBundle( Bundle bundle ) { + super.storeInBundle( bundle ); + bundle.put( ARMOR, armor ); + } + + @Override + public void restoreFromBundle( Bundle bundle ) { + super.restoreFromBundle( bundle ); + armor = (Armor)bundle.get( ARMOR ); + } + + @Override + public int drRoll() { + return super.drRoll() + Random.NormalIntRange( armor.DRMin(), armor.DRMax()); + } + + @Override + public int defenseProc(Char enemy, int damage) { + return armor.proc(enemy, this, damage); + } + + @Override + public CharSprite sprite() { + CharSprite sprite = super.sprite(); + ((StatueSprite)sprite).setArmor(armor.tier); + return sprite; + } + + @Override + public float speed() { + return armor.speedFactor(this, super.speed()); + } + + @Override + public float stealth() { + return armor.stealthFactor(this, super.stealth()); + } + + @Override + public int defenseSkill(Char enemy) { + return Math.round(armor.evasionFactor(this, super.defenseSkill(enemy))); + } + + @Override + public boolean isImmune(Class effect) { + return super.isImmune(effect); + } + + @Override + public String description() { + return Messages.get(this, "desc", weapon.name(), armor.name()); + } + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java index 017231de1..6c3f8a243 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java @@ -160,5 +160,13 @@ public class Statue extends Mob { { resistances.add(Grim.class); } + + public static Statue random(){ + if (Random.Int(10) == 0){ + return new ArmoredStatue(); + } else { + return new Statue(); + } + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/StatueRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/StatueRoom.java index 7eeb91660..7c2663e8a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/StatueRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/StatueRoom.java @@ -67,7 +67,7 @@ public class StatueRoom extends SpecialRoom { } - Statue statue = new Statue(); + Statue statue = Statue.random(); statue.pos = cx + cy * level.width(); level.mobs.add( statue ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java index 8e53ed129..c63ce67d4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java @@ -124,7 +124,7 @@ public class DistortionTrap extends Trap{ Mimic.spawnAt(point, new ArrayList<>()); continue; //mimics spawn themselves, no need to do more case 3: - mob = new Statue(); + mob = Statue.random(); break; } break; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/StatueSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/StatueSprite.java index 555a8d5a7..57505b055 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/StatueSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/StatueSprite.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.sprites; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.watabou.noosa.TextureFilm; +import com.watabou.utils.GameMath; public class StatueSprite extends MobSprite { @@ -47,7 +48,23 @@ public class StatueSprite extends MobSprite { play( idle ); } - + + private static int[] tierFrames = {0, 21, 32, 43, 54, 63}; + + public void setArmor( int tier ){ + int c = tierFrames[(int)GameMath.gate(0, tier, 5)]; + + TextureFilm frames = new TextureFilm( texture, 12, 15 ); + + idle.frames( frames, 0+c, 0+c, 0+c, 0+c, 0+c, 1+c, 1+c ); + run.frames( frames, 2+c, 3+c, 4+c, 5+c, 6+c, 7+c ); + attack.frames( frames, 8+c, 9+c, 10+c ); + //death animation is always armorless + + play( idle, true ); + + } + @Override public int blood() { return 0xFFcdcdb7; diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties index a14ee9bd8..787d75ed3 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties @@ -448,6 +448,9 @@ actors.mobs.acidic.desc=These huge arachnid-like demonic creatures avoid close c actors.mobs.albino.name=albino rat actors.mobs.albino.desc=This is a rare breed of marsupial rat, with pure white fur and jagged teeth. +actors.mobs.armoredstatue.name=armored statue +actors.mobs.armoredstatue.desc=You would think that it's just another one of this dungeon's inanimate statues, but its red glowing eyes give it away.\n\nIt seems to be in great condition because of the armor it's wearing, it might be very hard to kill.\n\nWhile the statue itself is made of stone, the _%1$s_ and _%2$s_ it's wielding look real. + actors.mobs.bandit.name=crazy bandit actors.mobs.bat.name=vampire bat @@ -618,7 +621,7 @@ actors.mobs.spinner.desc=These greenish furry cave spiders try to avoid direct c actors.mobs.statue.name=animated statue actors.mobs.statue.def_verb=blocked -actors.mobs.statue.desc=You would think that it's just another one of this dungeon's ugly statues, but its red glowing eyes give it away.\n\nWhile the statue itself is made of stone, the _%s,_ it's wielding, looks real. +actors.mobs.statue.desc=You would think that it's just another one of this dungeon's inanimate statues, but its red glowing eyes give it away.\n\nWhile the statue itself is made of stone, the _%s,_ it's wielding looks real. actors.mobs.succubus.name=succubus actors.mobs.succubus.desc=Succubi are shapeshifting demons that manipulate the minds of their prey. This one has taken the form of a pale gothic humanoid, perhaps to attract dwarven warlocks?\n\nWhen they attack, succubi may charm their target, making them unable to directly attack until the charm wears off. When succubi attack a charmed enemy, they will steal their life essence.