From e40a5b5ab18f0bed1613065dc0c1864e3b82c18a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 15 Apr 2020 23:46:09 -0400 Subject: [PATCH] v0.8.0: finalized DM-300's sprite --- core/src/main/assets/dm300.png | Bin 716 -> 843 bytes .../actors/mobs/NewDM300.java | 2 +- .../sprites/DM300Sprite.java | 72 +++++++++++------- .../sprites/PylonSprite.java | 7 +- 4 files changed, 53 insertions(+), 28 deletions(-) diff --git a/core/src/main/assets/dm300.png b/core/src/main/assets/dm300.png index 791b33b9fa88298cee2acf03b66d94ba50272382..4a6377aba2945e22f462b22a2ed1fd52830a6096 100644 GIT binary patch delta 794 zcmV+#1Lge810i0001WktHjCnUs^5foV!RFfT4PduLRdmzi~P zbYER&a9>gY002-q}^g<8rnbTxMRP0`WM0%kI_soeV*&-&+A zc3ZF6;Dls+&${x08VcW)AZ&jYYGBXJ*0Zyp|FOqK;&-MD71)HB$@uXScglJe~xuBdN5|nhM0b1OD z2|b{v73&4FE?DdbycwJjj2Ai8l^4`dcnvJx0rkv|C(mT?f(1@gOi7H1>dK3T0&4_> zp5yuKTAt6$DT)n}dl6B2!~zRKM$Fq6h{5>Bx*%PgiEVdO9-W)zg(3ubwW>c;A}} zKcCOyFzH1cx;W$gcT-_3VoZhO(Q5v>`VI|_(<`u$1B{~TjAc;3a2)KoZ8q5{{a91008g+ YOuT=>23Aib00000NkvXXu0mh|f;D$;$N&HU delta 666 zcmV;L0%iTn2FwMJ7Y-l@0{{R3%6C@Q0001cktHjC|7K>Hl#>7e0GNSkN;@zwE;d3! zO?zilnwOb%a&%u^W^i9pJ32vPP(giqfLBynP)=E2UuKAQW`cBFs;Z-q zr1#!`^Z#G?JcOybLK+#h6=zG5!xdvAlTLtcMz7cFQ|FI^TkR^xKx>_8!f9-=Yj2T` z4{r6}@C!?)DVRnUxV9GQ_~2GY#u%lPsal-I7P^)e>iBa3TkWc$QA4GM`sas#$yu1j z7P~eU>-cklTV<<^%FqrX3Z#L>u9dCo-(UWJrNFodz^!(zWo0evF++hgwAi(>SmU`6 zfLonRCics8<{yL8*kaetGS+s1F6UxC=U);Y0Bm)!%vr5Bv#rxOjV+Kx^)+8urn(S# z7@7+KxYgZ0=Wtwaj@#3T0%>4@^i$pNR2)EcVLIF5ZGD(ArkD#6xYg~N#o1YQQ#}}e zP#_H~kiPn+FM4V&;B6UeRemutSW1AcvffTJw#@XT`G*2&WSi1CrrYpT96)tpww>Z_ z!Nm}t0B-ei^%(7-KpNYs^o|*+y3Z|BUBC|m_w96IE8}vzI&QUAM@BhJ&EkW>c9idX zYwU|HQ?aNpcqNT3>bhroJpHim6~T#UK10!U{(ihp!sNMi4E=8m%wY`=Oj`u(pJ z9l+!9%y~R~`4a03#n~A4_4brjasa%`Q~RIC0R zoQ-Td0tg_nZN3`g*+e3dNF)-8L?V&+Kav0dAc(tF1);c900000NkvXXu0mh|g1S;U A7ytkO diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java index a347ece5e..4431be0e5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java @@ -454,7 +454,7 @@ public class NewDM300 extends Mob { spend(3f); yell(Messages.get(this, "charging")); sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "invulnerable")); - sprite.resetColor(); + ((DM300Sprite)sprite).charge(); chargeAnnounced = false; GLog.h(Messages.get(this, "charging_hint")); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM300Sprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM300Sprite.java index d00ea5c0a..6ef5f3634 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM300Sprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM300Sprite.java @@ -35,6 +35,7 @@ import com.watabou.utils.Callback; public class DM300Sprite extends MobSprite { + private Animation charge; private Animation slam; private Emitter superchargeSparks; @@ -44,25 +45,39 @@ public class DM300Sprite extends MobSprite { texture( Assets.DM300 ); - TextureFilm frames = new TextureFilm( texture, 22, 20 ); - - idle = new Animation( 10, true ); - idle.frames( frames, 0, 1 ); - - run = new Animation( 10, true ); - run.frames( frames, 2, 3 ); - + setAnimations(false); + } + + private void setAnimations( boolean enraged ){ + int c = enraged ? 10 : 0; + + TextureFilm frames = new TextureFilm( texture, 25, 22 ); + + idle = new Animation( enraged ? 15 : 10, true ); + idle.frames( frames, c+0, c+1 ); + + run = new Animation( enraged ? 15 : 10, true ); + run.frames( frames, c+0, c+2 ); + attack = new Animation( 15, false ); - attack.frames( frames, 4, 5, 6 ); + attack.frames( frames, c+3, c+4, c+5 ); - slam = attack.clone(); + //unaffected by enrage state - zap = attack.clone(); + if (charge == null) { + charge = new Animation(4, true); + charge.frames(frames, 0, 10); - die = new Animation( 20, false ); - die.frames( frames, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 8 ); - - play( idle ); + slam = attack.clone(); + + zap = new Animation(15, false); + zap.frames(frames, 6, 7, 7, 6); + + die = new Animation(20, false); + die.frames(frames, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10); + } + + if (curAnim != charge) play(idle); } public void zap( int cell ) { @@ -83,6 +98,10 @@ public class DM300Sprite extends MobSprite { Sample.INSTANCE.play( Assets.SND_PUFF ); } + public void charge(){ + play( charge ); + } + public void slam( int cell ){ turnTo( ch.pos , cell ); play( slam ); @@ -108,10 +127,17 @@ public class DM300Sprite extends MobSprite { if (anim == die && !exploded) { exploded = true; Sample.INSTANCE.play(Assets.SND_BLAST); - emitter().burst( BlastParticle.FACTORY, 25 ); + emitter().burst( BlastParticle.FACTORY, 100 ); + killAndErase(); } } + @Override + public void place(int cell) { + if (parent != null) parent.bringToFront(this); + super.place(cell); + } + @Override public void link(Char ch) { super.link(ch); @@ -122,7 +148,7 @@ public class DM300Sprite extends MobSprite { superchargeSparks.on = false; if (ch instanceof NewDM300 && ((NewDM300) ch).isSupercharged()){ - tint(1, 0, 0, 0.33f); + setAnimations(true); superchargeSparks.on = true; } } @@ -133,8 +159,10 @@ public class DM300Sprite extends MobSprite { if (superchargeSparks != null){ superchargeSparks.visible = visible; - if (ch instanceof NewDM300){ + if (ch instanceof NewDM300 + && ((NewDM300) ch).isSupercharged() != superchargeSparks.on){ superchargeSparks.on = ((NewDM300) ch).isSupercharged(); + setAnimations(((NewDM300) ch).isSupercharged()); } } } @@ -155,14 +183,6 @@ public class DM300Sprite extends MobSprite { } } - @Override - public void resetColor() { - super.resetColor(); - if (ch instanceof NewDM300 && ((NewDM300) ch).isSupercharged()){ - tint(1, 0, 0, 0.33f); - } - } - @Override public int blood() { return 0xFFFFFF88; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/PylonSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/PylonSprite.java index ae91c1dde..61f7e499b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/PylonSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/PylonSprite.java @@ -64,10 +64,15 @@ public class PylonSprite extends MobSprite { if (ch instanceof Pylon && ch.alignment == Char.Alignment.ENEMY){ activate(); } - if (parent != null) parent.bringToFront(this); renderShadow = false; } + @Override + public void place(int cell) { + if (parent != null) parent.bringToFront(this); + super.place(cell); + } + public void activate(){ idle = activeIdle.clone(); idle();