From 1c48866338b448fa55ba4d7e579d65f4276799ba Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 29 Sep 2014 01:16:40 -0400 Subject: [PATCH] V0.2.1 : Initial Improvements to Goo's sprite --- assets/goo.png | Bin 857 -> 1854 bytes .../actors/mobs/Goo.java | 17 ++++++++-- .../sprites/GooSprite.java | 29 ++++++++++++++---- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/assets/goo.png b/assets/goo.png index 5e07a35a85a02ce64506654ce8d083fde6660d24..de000b3fe27e16ffc87632b67f53c57cf601ddc3 100644 GIT binary patch delta 1839 zcmV+~2hjN02EGoEB!32COGiWi{{a60|De66lK=n!32;bRa{vGf6951U69E94oEQKA z00(qQO+^RZ2^|Fm8qHnx7ytkU%Sl8*RCwC$TRn2)It&KhWTZQ=QYGKP6?F|CB~6mX zN6|IRN_Pk=Rl0-K@HK`8fwM`SLfet$f*feawIS-<+RQ z{@YBVgE)*m_qO%MbzQH1pXYf~;kIqTd%u8@jMo4@O%sgc2=DLj;GA1t4*=l3SM_O{ z1^@sqm&s+JkQzsWY`;Gx*{U9 zZ3|u3!7vPPzu&=H3tiX2?RHy{FTeNo^#uR`x7!WAzP@0ZrYwDBzTEHkA7x*eFW2jJ z72l?5kaX5`-SQu|x323&Mv4Cr5vrq z^lO?1$A58r(v#;i_unuKNqf)dbC&La&0$atGay*rHSp-0i+oKREL5#*7cfDR$ zm7W}QKA#sdh*f?rkMxpkKF>2fhnkM$Y$>0BmSOKE36P%N`|$bssmk--L)*4U`t1RK zu8wWnhH)H`Cn}G}{eFJ}yo?7=ptfz{`}=!WzJF*Wa5|ly!fTa?4|Nf5b!l51tG`Y7}<${!{u^`20=cnk=<4tQu4-e44eeMzrRt_lj1?G z>VH-|NKXx{NAe{GehIL??+M7smOYX$S^70ivufj0BcvQBQn}bP4Qg?wf<%PENgyUq z>X*vJ99+GXf;e~n<<*~NU+?{@`t#(n)*>aLtkPWG^?Hp~M$%6(|3U&3(5~yiIk!1e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KlNa5x+vf?oj!0BlmnNAi@M 0) { - - return super.doAttack( enemy ); + + boolean visible = Dungeon.visible[pos]; + + if (visible) { + if (pumpedUp) + ((GooSprite)sprite).pumpAttack(); + else + sprite.attack( enemy.pos ); + } else { + attack( enemy ); + } + + spend( attackDelay() ); + + return !visible; } else { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/sprites/GooSprite.java b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/GooSprite.java index ef6deecbc..7a19cd54e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/sprites/GooSprite.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/GooSprite.java @@ -23,6 +23,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; public class GooSprite extends MobSprite { private Animation pump; + private Animation pumpAttack; public GooSprite() { super(); @@ -32,19 +33,22 @@ public class GooSprite extends MobSprite { TextureFilm frames = new TextureFilm( texture, 20, 14 ); idle = new Animation( 10, true ); - idle.frames( frames, 0, 1 ); + idle.frames( frames, 2, 1, 0, 0, 1 ); - run = new Animation( 10, true ); - run.frames( frames, 0, 1 ); + run = new Animation( 15, true ); + run.frames( frames, 3, 2, 1, 2 ); pump = new Animation( 20, true ); - pump.frames( frames, 0, 1 ); + pump.frames( frames, 4, 3, 2, 1, 0 ); + + pumpAttack = new Animation ( 20, false ); + pumpAttack.frames( frames, 4, 3, 2, 1, 0, 7); attack = new Animation( 10, false ); - attack.frames( frames, 5, 0, 6 ); + attack.frames( frames, 8, 9, 10 ); die = new Animation( 10, false ); - die.frames( frames, 2, 3, 4 ); + die.frames( frames, 5, 6, 7 ); play( idle ); } @@ -52,9 +56,22 @@ public class GooSprite extends MobSprite { public void pumpUp() { play( pump ); } + + public void pumpAttack() { play( pumpAttack ); } @Override public int blood() { return 0xFF000000; } + + @Override + public void onComplete( Animation anim ) { + super.onComplete(anim); + + if (anim == pumpAttack) { + + idle(); + ch.onAttackComplete(); + } + } }