v0.8.0: finalized DM-300's sprite
This commit is contained in:
parent
f24901740d
commit
e40a5b5ab1
Binary file not shown.
Before Width: | Height: | Size: 716 B After Width: | Height: | Size: 843 B |
|
@ -454,7 +454,7 @@ public class NewDM300 extends Mob {
|
||||||
spend(3f);
|
spend(3f);
|
||||||
yell(Messages.get(this, "charging"));
|
yell(Messages.get(this, "charging"));
|
||||||
sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "invulnerable"));
|
sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "invulnerable"));
|
||||||
sprite.resetColor();
|
((DM300Sprite)sprite).charge();
|
||||||
chargeAnnounced = false;
|
chargeAnnounced = false;
|
||||||
|
|
||||||
GLog.h(Messages.get(this, "charging_hint"));
|
GLog.h(Messages.get(this, "charging_hint"));
|
||||||
|
|
|
@ -35,6 +35,7 @@ import com.watabou.utils.Callback;
|
||||||
|
|
||||||
public class DM300Sprite extends MobSprite {
|
public class DM300Sprite extends MobSprite {
|
||||||
|
|
||||||
|
private Animation charge;
|
||||||
private Animation slam;
|
private Animation slam;
|
||||||
|
|
||||||
private Emitter superchargeSparks;
|
private Emitter superchargeSparks;
|
||||||
|
@ -44,25 +45,39 @@ public class DM300Sprite extends MobSprite {
|
||||||
|
|
||||||
texture( Assets.DM300 );
|
texture( Assets.DM300 );
|
||||||
|
|
||||||
TextureFilm frames = new TextureFilm( texture, 22, 20 );
|
setAnimations(false);
|
||||||
|
}
|
||||||
idle = new Animation( 10, true );
|
|
||||||
idle.frames( frames, 0, 1 );
|
private void setAnimations( boolean enraged ){
|
||||||
|
int c = enraged ? 10 : 0;
|
||||||
run = new Animation( 10, true );
|
|
||||||
run.frames( frames, 2, 3 );
|
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 = 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 );
|
slam = attack.clone();
|
||||||
die.frames( frames, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 8 );
|
|
||||||
|
zap = new Animation(15, false);
|
||||||
play( idle );
|
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 ) {
|
public void zap( int cell ) {
|
||||||
|
@ -83,6 +98,10 @@ public class DM300Sprite extends MobSprite {
|
||||||
Sample.INSTANCE.play( Assets.SND_PUFF );
|
Sample.INSTANCE.play( Assets.SND_PUFF );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void charge(){
|
||||||
|
play( charge );
|
||||||
|
}
|
||||||
|
|
||||||
public void slam( int cell ){
|
public void slam( int cell ){
|
||||||
turnTo( ch.pos , cell );
|
turnTo( ch.pos , cell );
|
||||||
play( slam );
|
play( slam );
|
||||||
|
@ -108,10 +127,17 @@ public class DM300Sprite extends MobSprite {
|
||||||
if (anim == die && !exploded) {
|
if (anim == die && !exploded) {
|
||||||
exploded = true;
|
exploded = true;
|
||||||
Sample.INSTANCE.play(Assets.SND_BLAST);
|
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
|
@Override
|
||||||
public void link(Char ch) {
|
public void link(Char ch) {
|
||||||
super.link(ch);
|
super.link(ch);
|
||||||
|
@ -122,7 +148,7 @@ public class DM300Sprite extends MobSprite {
|
||||||
superchargeSparks.on = false;
|
superchargeSparks.on = false;
|
||||||
|
|
||||||
if (ch instanceof NewDM300 && ((NewDM300) ch).isSupercharged()){
|
if (ch instanceof NewDM300 && ((NewDM300) ch).isSupercharged()){
|
||||||
tint(1, 0, 0, 0.33f);
|
setAnimations(true);
|
||||||
superchargeSparks.on = true;
|
superchargeSparks.on = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,8 +159,10 @@ public class DM300Sprite extends MobSprite {
|
||||||
|
|
||||||
if (superchargeSparks != null){
|
if (superchargeSparks != null){
|
||||||
superchargeSparks.visible = visible;
|
superchargeSparks.visible = visible;
|
||||||
if (ch instanceof NewDM300){
|
if (ch instanceof NewDM300
|
||||||
|
&& ((NewDM300) ch).isSupercharged() != superchargeSparks.on){
|
||||||
superchargeSparks.on = ((NewDM300) ch).isSupercharged();
|
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
|
@Override
|
||||||
public int blood() {
|
public int blood() {
|
||||||
return 0xFFFFFF88;
|
return 0xFFFFFF88;
|
||||||
|
|
|
@ -64,10 +64,15 @@ public class PylonSprite extends MobSprite {
|
||||||
if (ch instanceof Pylon && ch.alignment == Char.Alignment.ENEMY){
|
if (ch instanceof Pylon && ch.alignment == Char.Alignment.ENEMY){
|
||||||
activate();
|
activate();
|
||||||
}
|
}
|
||||||
if (parent != null) parent.bringToFront(this);
|
|
||||||
renderShadow = false;
|
renderShadow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void place(int cell) {
|
||||||
|
if (parent != null) parent.bringToFront(this);
|
||||||
|
super.place(cell);
|
||||||
|
}
|
||||||
|
|
||||||
public void activate(){
|
public void activate(){
|
||||||
idle = activeIdle.clone();
|
idle = activeIdle.clone();
|
||||||
idle();
|
idle();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user