From a89971b1177f99178f0a900e3eed93da7238b42b Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 9 Apr 2020 16:37:13 -0400 Subject: [PATCH] v0.8.0: finalized ripper demon spritework --- core/src/main/assets/ripper.png | Bin 555 -> 727 bytes .../actors/mobs/RipperDemon.java | 2 + .../sprites/RipperSprite.java | 59 ++++++++++++++---- 3 files changed, 49 insertions(+), 12 deletions(-) diff --git a/core/src/main/assets/ripper.png b/core/src/main/assets/ripper.png index 41d5bf0ad2864cf754da60c0a95ae1b1dc50ba56..77f31ebf7d898196470aae929e442932d6d2d814 100644 GIT binary patch delta 703 zcmV;w0zmz%1lI+SB!5d#OjJex|NmfMU~g}4W@cvpe*mfg0E++sL_|cR006Q804*&o zf&c*J<>g)g00000ng9T^v$Lb4qZk+%CnqNo5)vLB9(w=)D=RBS007+UT|58)00DGT zPE!Ct=GbNc00KHmL_t(|0i=}SlA|yTgR{prgc5Ia#8BS%$=Cddy4bfi~TI z+cr(hKHH3!hlz-9o@3syt8%s~;*cS9_qM&W&o<-rVJ@p*Ic|^2IcBt7v9$Hm{Csjh zIMpNg&~`w*k=eT-BH+k{y5!SD)3jG^DSvtOpa zhnNo=+H5{s+y@F^aVnEY@=+u?PF?H)HsLSB`TvFu)_?Cc0vhkB3=ij2vxs;v;?Nh0 zKlO3E5yrPKQ@;_1wB0%7(YbW;i#@nv6Y{d5GK@Y%V$Am5l?vjE^8qIV9R|fQUJB~> z20Zscf6eQG=&?I3%TvLuh7M@Hae_U#BEq20G#aN8ba)>Iavz%V)<8ju0i0yeK^2=M z#>Mt;eSe56eaP{zxfFm;P#yCKbU?TmpDpzfXW;bAI>NS~qdG|BTpl3dMT{I{nr3y7 z+Hl-#^r2cVNES71l-B}qewJUe3>Cz-M lO{rao_I@b;-$pJN1pxaVJuMAt2Soq?002ovPDHLkV1j&wLTCU0 delta 530 zcmV+t0`2|R1*-&*B!4zgOjJex|NmfMU~g}4W@cv0W&mnxY5)KLFE1}qQBhY{S7tK+ zJ3BikCnp{r9vB!H5)u+kO-(B+D{fvy@Bjb+0d!JMQvg8b*k%9#0i#JoK~#7F%#?wO zgfI+5b#q(wrZw&V|LirST^*nY2+9T)UNjq=M|JwI=330xW`DlB#v$fct(o}JjPn;; z8iklee&mPw(u^}T-{WE&;vJS%WF@{ZLrl%^#5`H!5O0yNEK4B1FvGm{#$Ei%FCUEO zYZzjdtu}%A!VGh301`too;(fo;D!fJsQd~Wm}!1I!#jyz)(8eC=Hb&o5AIkQ-qgz? zD>KaxW=1=mt$&dfERtnBD1bvaR&E9$i0Q<;@oAo}J16JC&dwk4(nPY1)9dhl&$ZSY z<5N(_m?pq(C=hpM7GuRT$(Y2@&dx3XACVi&2**d(Ps6 zJ#>z7KW3as813xrC@|g*8JJu~So(+cegPg$HO0j2U4QXF&ZTiKQPbWSd(z`9v9RHO zXP|MHq3W+j456}NTulHf-&nBq1v|5M01TM3YWbMSx#-lnHl0g^{*zPot+e?c~?0NDj8%c8;jKt{w9`5h#N_DEgc15k=7_4qS0)HFHU=#oVvl=6t UABLMM01E&B07*qoM6N<$g2uk>zyJUM diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RipperDemon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RipperDemon.java index 56dcd2a89..b6d32d28a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RipperDemon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RipperDemon.java @@ -165,6 +165,7 @@ public class RipperDemon extends Mob { } leapPos = -1; + sprite.idle(); Dungeon.level.occupyCell(RipperDemon.this); next(); } @@ -215,6 +216,7 @@ public class RipperDemon extends Mob { if (Dungeon.level.heroFOV[pos]){ GLog.w(Messages.get(RipperDemon.this, "leap")); sprite.parent.addToBack(new TargetedCell(leapPos, 0xFF0000)); + ((RipperSprite)sprite).leapPrep( leapPos ); Dungeon.hero.interrupt(); } return true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/RipperSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/RipperSprite.java index 3ba57ac0c..525de9aa3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/RipperSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/RipperSprite.java @@ -23,36 +23,71 @@ package com.shatteredpixel.shatteredpixeldungeon.sprites; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.watabou.noosa.TextureFilm; +import com.watabou.utils.Callback; +import com.watabou.utils.Random; -//TODO currently just a reskinned warlock sprite public class RipperSprite extends MobSprite { + private Animation stab; + private Animation prep; + private Animation leap; + + private boolean alt = Random.Int(2) == 0; + public RipperSprite() { super(); texture( Assets.RIPPER ); - TextureFilm frames = new TextureFilm( texture, 12, 14 ); + TextureFilm frames = new TextureFilm( texture, 15, 14 ); - idle = new Animation( 2, true ); - idle.frames( frames, 0, 0, 0, 1 ); + idle = new Animation( 4, true ); + idle.frames( frames, 1, 0, 1, 2 ); run = new Animation( 15, true ); - run.frames( frames, 0, 2, 3, 4 ); + run.frames( frames, 3, 4, 5, 6, 7, 8 ); - run = new Animation( 18, true ); - run.frames( frames, 2, 3, 4, 5, 6, 7 ); - - //TODO should probably have 2 attack animations, like monks attack = new Animation( 12, false ); - attack.frames( frames, 0, 8, 9 ); + attack.frames( frames, 0, 9, 10, 9 ); - zap = attack.clone(); + stab = new Animation( 12, false ); + stab.frames( frames, 0, 9, 11, 9 ); + + prep = new Animation( 1, true ); + prep.frames( frames, 9 ); + + leap = new Animation( 1, true ); + leap.frames( frames, 12 ); die = new Animation( 15, false ); - die.frames( frames, 0, 10, 11, 12, 13 ); + die.frames( frames, 1, 13, 14, 15, 16 ); play( idle ); } + public void leapPrep( int cell ){ + turnTo( ch.pos, cell ); + play( prep ); + } + + @Override + public void jump(int from, int to, Callback callback) { + super.jump(from, to, callback); + play( leap ); + } + + @Override + public void attack( int cell ) { + super.attack( cell ); + if (alt) { + play( stab ); + } + alt = !alt; + } + + @Override + public void onComplete( Animation anim ) { + super.onComplete( anim == stab ? attack : anim ); + } + }