V0.1.0 Partial Commit
changed package and application names to differentiate from main PD release
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class AcidicSprite extends ScorpioSprite {
|
||||
|
||||
public AcidicSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.SCORPIO );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 18, 17 );
|
||||
|
||||
idle = new Animation( 12, true );
|
||||
idle.frames( frames, 14, 14, 14, 14, 14, 14, 14, 14, 15, 16, 15, 16, 15, 16 );
|
||||
|
||||
run = new Animation( 4, true );
|
||||
run.frames( frames, 19, 20 );
|
||||
|
||||
attack = new Animation( 15, false );
|
||||
attack.frames( frames, 14, 17, 18 );
|
||||
|
||||
zap = attack.clone();
|
||||
|
||||
die = new Animation( 12, false );
|
||||
die.frames( frames, 14, 21, 22, 23, 24 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blood() {
|
||||
return 0xFF66FF22;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class AlbinoSprite extends MobSprite {
|
||||
|
||||
public AlbinoSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.RAT );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 16, 15 );
|
||||
|
||||
idle = new Animation( 2, true );
|
||||
idle.frames( frames, 16, 16, 16, 17 );
|
||||
|
||||
run = new Animation( 10, true );
|
||||
run.frames( frames, 22, 23, 24, 25, 26 );
|
||||
|
||||
attack = new Animation( 15, false );
|
||||
attack.frames( frames, 18, 19, 20, 21 );
|
||||
|
||||
die = new Animation( 10, false );
|
||||
die.frames( frames, 27, 28, 29, 30 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class BanditSprite extends MobSprite {
|
||||
|
||||
public BanditSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.THIEF );
|
||||
TextureFilm film = new TextureFilm( texture, 12, 13 );
|
||||
|
||||
idle = new Animation( 1, true );
|
||||
idle.frames( film, 21, 21, 21, 22, 21, 21, 21, 21, 22 );
|
||||
|
||||
run = new Animation( 15, true );
|
||||
run.frames( film, 21, 21, 23, 24, 24, 25 );
|
||||
|
||||
die = new Animation( 10, false );
|
||||
die.frames( film, 25, 27, 28, 29, 30 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( film, 31, 32, 33 );
|
||||
|
||||
idle();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class BatSprite extends MobSprite {
|
||||
|
||||
public BatSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.BAT );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 15, 15 );
|
||||
|
||||
idle = new Animation( 8, true );
|
||||
idle.frames( frames, 0, 1 );
|
||||
|
||||
run = new Animation( 12, true );
|
||||
run.frames( frames, 0, 1 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( frames, 2, 3, 0, 1 );
|
||||
|
||||
die = new Animation( 12, false );
|
||||
die.frames( frames, 4, 5, 6 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.noosa.particles.Emitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
|
||||
public class BlacksmithSprite extends MobSprite {
|
||||
|
||||
private Emitter emitter;
|
||||
|
||||
public BlacksmithSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.TROLL );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 13, 16 );
|
||||
|
||||
idle = new Animation( 15, true );
|
||||
idle.frames( frames, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 3 );
|
||||
|
||||
run = new Animation( 20, true );
|
||||
run.frames( frames, 0 );
|
||||
|
||||
die = new Animation( 20, false );
|
||||
die.frames( frames, 0 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void link( Char ch ) {
|
||||
super.link( ch );
|
||||
|
||||
emitter = new Emitter();
|
||||
emitter.autoKill = false;
|
||||
emitter.pos( x + 7, y + 12 );
|
||||
parent.add( emitter );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
if (emitter != null) {
|
||||
emitter.visible = visible;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
super.onComplete( anim );
|
||||
|
||||
if (visible && emitter != null && anim == idle) {
|
||||
emitter.burst( Speck.factory( Speck.FORGE ), 3 );
|
||||
float volume = 0.2f / (Level.distance( ch.pos, Dungeon.hero.pos ));
|
||||
Sample.INSTANCE.play( Assets.SND_EVOKE, volume, volume, 0.8f );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class BruteSprite extends MobSprite {
|
||||
|
||||
public BruteSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.BRUTE );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 12, 16 );
|
||||
|
||||
idle = new Animation( 2, true );
|
||||
idle.frames( frames, 0, 0, 0, 1, 0, 0, 1, 1 );
|
||||
|
||||
run = new Animation( 12, true );
|
||||
run.frames( frames, 4, 5, 6, 7 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( frames, 2, 3, 0 );
|
||||
|
||||
die = new Animation( 12, false );
|
||||
die.frames( frames, 8, 9, 10 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||
import com.watabou.utils.Callback;
|
||||
|
||||
public class BurningFistSprite extends MobSprite {
|
||||
|
||||
public BurningFistSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.BURNING );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 24, 17 );
|
||||
|
||||
idle = new Animation( 2, true );
|
||||
idle.frames( frames, 0, 0, 1 );
|
||||
|
||||
run = new Animation( 3, true );
|
||||
run.frames( frames, 0, 1 );
|
||||
|
||||
attack = new Animation( 8, false );
|
||||
attack.frames( frames, 0, 5, 6 );
|
||||
|
||||
die = new Animation( 10, false );
|
||||
die.frames( frames, 0, 2, 3, 4 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
private int posToShoot;
|
||||
|
||||
@Override
|
||||
public void attack( int cell ) {
|
||||
posToShoot = cell;
|
||||
super.attack( cell );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
if (anim == attack) {
|
||||
|
||||
Sample.INSTANCE.play( Assets.SND_ZAP );
|
||||
MagicMissile.shadow( parent, ch.pos, posToShoot,
|
||||
new Callback() {
|
||||
@Override
|
||||
public void call() {
|
||||
ch.onAttackComplete();
|
||||
}
|
||||
} );
|
||||
|
||||
idle();
|
||||
|
||||
} else {
|
||||
super.onComplete( anim );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,407 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.MovieClip;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.noosa.particles.Emitter;
|
||||
import com.watabou.noosa.tweeners.PosTweener;
|
||||
import com.watabou.noosa.tweeners.Tweener;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.EmoIcon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.IceBlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.TorchHalo;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfInvisibility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
||||
import com.watabou.utils.Callback;
|
||||
import com.watabou.utils.PointF;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip.Listener {
|
||||
|
||||
// Color constants for floating text
|
||||
public static final int DEFAULT = 0xFFFFFF;
|
||||
public static final int POSITIVE = 0x00FF00;
|
||||
public static final int NEGATIVE = 0xFF0000;
|
||||
public static final int WARNING = 0xFF8800;
|
||||
public static final int NEUTRAL = 0xFFFF00;
|
||||
|
||||
private static final float MOVE_INTERVAL = 0.1f;
|
||||
private static final float FLASH_INTERVAL = 0.05f;
|
||||
|
||||
public enum State {
|
||||
BURNING, LEVITATING, INVISIBLE, PARALYSED, FROZEN, ILLUMINATED
|
||||
}
|
||||
|
||||
protected Animation idle;
|
||||
protected Animation run;
|
||||
protected Animation attack;
|
||||
protected Animation operate;
|
||||
protected Animation zap;
|
||||
protected Animation die;
|
||||
|
||||
protected Callback animCallback;
|
||||
|
||||
protected Tweener motion;
|
||||
|
||||
protected Emitter burning;
|
||||
protected Emitter levitation;
|
||||
|
||||
protected IceBlock iceBlock;
|
||||
protected TorchHalo halo;
|
||||
|
||||
protected EmoIcon emo;
|
||||
|
||||
private float flashTime = 0;
|
||||
|
||||
protected boolean sleeping = false;
|
||||
|
||||
// Char owner
|
||||
public Char ch;
|
||||
|
||||
public CharSprite() {
|
||||
super();
|
||||
listener = this;
|
||||
}
|
||||
|
||||
public void link( Char ch ) {
|
||||
this.ch = ch;
|
||||
ch.sprite = this;
|
||||
|
||||
place( ch.pos );
|
||||
turnTo( ch.pos, Random.Int( Level.LENGTH ) );
|
||||
|
||||
ch.updateSpriteState();
|
||||
}
|
||||
|
||||
public PointF worldToCamera( int cell ) {
|
||||
|
||||
final int csize = DungeonTilemap.SIZE;
|
||||
|
||||
return new PointF(
|
||||
((cell % Level.WIDTH) + 0.5f) * csize - width * 0.5f,
|
||||
((cell / Level.WIDTH) + 1.0f) * csize - height
|
||||
);
|
||||
}
|
||||
|
||||
public void place( int cell ) {
|
||||
point( worldToCamera( cell ) );
|
||||
}
|
||||
|
||||
public void showStatus( int color, String text, Object... args ) {
|
||||
if (visible) {
|
||||
if (args.length > 0) {
|
||||
text = Utils.format( text, args );
|
||||
}
|
||||
if (ch != null) {
|
||||
FloatingText.show( x + width * 0.5f, y, ch.pos, text, color );
|
||||
} else {
|
||||
FloatingText.show( x + width * 0.5f, y, text, color );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void idle() {
|
||||
play( idle );
|
||||
}
|
||||
|
||||
public void move( int from, int to ) {
|
||||
play( run );
|
||||
|
||||
motion = new PosTweener( this, worldToCamera( to ), MOVE_INTERVAL );
|
||||
motion.listener = this;
|
||||
parent.add( motion );
|
||||
|
||||
turnTo( from , to );
|
||||
|
||||
if (visible && Level.water[from] && !ch.flying) {
|
||||
GameScene.ripple( from );
|
||||
}
|
||||
}
|
||||
|
||||
public void interruptMotion() {
|
||||
if (motion != null) {
|
||||
onComplete( motion );
|
||||
}
|
||||
}
|
||||
|
||||
public void attack( int cell ) {
|
||||
turnTo( ch.pos, cell );
|
||||
play( attack );
|
||||
}
|
||||
|
||||
public void attack( int cell, Callback callback ) {
|
||||
animCallback = callback;
|
||||
turnTo( ch.pos, cell );
|
||||
play( attack );
|
||||
}
|
||||
|
||||
public void operate( int cell ) {
|
||||
turnTo( ch.pos, cell );
|
||||
play( operate );
|
||||
}
|
||||
|
||||
public void zap( int cell ) {
|
||||
turnTo( ch.pos, cell );
|
||||
play( zap );
|
||||
}
|
||||
|
||||
public void turnTo( int from, int to ) {
|
||||
int fx = from % Level.WIDTH;
|
||||
int tx = to % Level.WIDTH;
|
||||
if (tx > fx) {
|
||||
flipHorizontal = false;
|
||||
} else if (tx < fx) {
|
||||
flipHorizontal = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void die() {
|
||||
sleeping = false;
|
||||
play( die );
|
||||
|
||||
if (emo != null) {
|
||||
emo.killAndErase();
|
||||
}
|
||||
}
|
||||
|
||||
public Emitter emitter() {
|
||||
Emitter emitter = GameScene.emitter();
|
||||
emitter.pos( this );
|
||||
return emitter;
|
||||
}
|
||||
|
||||
public Emitter centerEmitter() {
|
||||
Emitter emitter = GameScene.emitter();
|
||||
emitter.pos( center() );
|
||||
return emitter;
|
||||
}
|
||||
|
||||
public Emitter bottomEmitter() {
|
||||
Emitter emitter = GameScene.emitter();
|
||||
emitter.pos( x, y + height, width, 0 );
|
||||
return emitter;
|
||||
}
|
||||
|
||||
public void burst( final int color, int n ) {
|
||||
if (visible) {
|
||||
Splash.at( center(), color, n );
|
||||
}
|
||||
}
|
||||
|
||||
public void bloodBurstA( PointF from, int damage ) {
|
||||
if (visible) {
|
||||
PointF c = center();
|
||||
int n = (int)Math.min( 9 * Math.sqrt( (double)damage / ch.HT ), 9 );
|
||||
Splash.at( c, PointF.angle( from, c ), 3.1415926f / 2, blood(), n );
|
||||
}
|
||||
}
|
||||
|
||||
// Blood color
|
||||
public int blood() {
|
||||
return 0xFFBB0000;
|
||||
}
|
||||
|
||||
public void flash() {
|
||||
ra = ba = ga = 1f;
|
||||
flashTime = FLASH_INTERVAL;
|
||||
}
|
||||
|
||||
public void add( State state ) {
|
||||
switch (state) {
|
||||
case BURNING:
|
||||
burning = emitter();
|
||||
burning.pour( FlameParticle.FACTORY, 0.06f );
|
||||
if (visible) {
|
||||
Sample.INSTANCE.play( Assets.SND_BURNING );
|
||||
}
|
||||
break;
|
||||
case LEVITATING:
|
||||
levitation = emitter();
|
||||
levitation.pour( Speck.factory( Speck.JET ), 0.02f );
|
||||
break;
|
||||
case INVISIBLE:
|
||||
PotionOfInvisibility.melt( ch );
|
||||
break;
|
||||
case PARALYSED:
|
||||
paused = true;
|
||||
break;
|
||||
case FROZEN:
|
||||
iceBlock = IceBlock.freeze( this );
|
||||
paused = true;
|
||||
break;
|
||||
case ILLUMINATED:
|
||||
GameScene.effect( halo = new TorchHalo( this ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void remove( State state ) {
|
||||
switch (state) {
|
||||
case BURNING:
|
||||
if (burning != null) {
|
||||
burning.on = false;
|
||||
burning = null;
|
||||
}
|
||||
break;
|
||||
case LEVITATING:
|
||||
if (levitation != null) {
|
||||
levitation.on = false;
|
||||
levitation = null;
|
||||
}
|
||||
break;
|
||||
case INVISIBLE:
|
||||
alpha( 1f );
|
||||
break;
|
||||
case PARALYSED:
|
||||
paused = false;
|
||||
break;
|
||||
case FROZEN:
|
||||
if (iceBlock != null) {
|
||||
iceBlock.melt();
|
||||
iceBlock = null;
|
||||
}
|
||||
paused = false;
|
||||
break;
|
||||
case ILLUMINATED:
|
||||
if (halo != null) {
|
||||
halo.putOut();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
|
||||
super.update();
|
||||
|
||||
if (paused && listener != null) {
|
||||
listener.onComplete( curAnim );
|
||||
}
|
||||
|
||||
if (flashTime > 0 && (flashTime -= Game.elapsed) <= 0) {
|
||||
resetColor();
|
||||
}
|
||||
|
||||
if (burning != null) {
|
||||
burning.visible = visible;
|
||||
}
|
||||
if (levitation != null) {
|
||||
levitation.visible = visible;
|
||||
}
|
||||
if (iceBlock != null) {
|
||||
iceBlock.visible = visible;
|
||||
}
|
||||
if (sleeping) {
|
||||
showSleep();
|
||||
} else {
|
||||
hideSleep();
|
||||
}
|
||||
if (emo != null) {
|
||||
emo.visible = visible;
|
||||
}
|
||||
}
|
||||
|
||||
public void showSleep() {
|
||||
if (emo instanceof EmoIcon.Sleep) {
|
||||
|
||||
} else {
|
||||
if (emo != null) {
|
||||
emo.killAndErase();
|
||||
}
|
||||
emo = new EmoIcon.Sleep( this );
|
||||
}
|
||||
}
|
||||
|
||||
public void hideSleep() {
|
||||
if (emo instanceof EmoIcon.Sleep) {
|
||||
emo.killAndErase();
|
||||
emo = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void showAlert() {
|
||||
if (emo instanceof EmoIcon.Alert) {
|
||||
|
||||
} else {
|
||||
if (emo != null) {
|
||||
emo.killAndErase();
|
||||
}
|
||||
emo = new EmoIcon.Alert( this );
|
||||
}
|
||||
}
|
||||
|
||||
public void hideAlert() {
|
||||
if (emo instanceof EmoIcon.Alert) {
|
||||
emo.killAndErase();
|
||||
emo = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kill() {
|
||||
super.kill();
|
||||
|
||||
if (emo != null) {
|
||||
emo.killAndErase();
|
||||
emo = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Tweener tweener ) {
|
||||
if (tweener == motion) {
|
||||
motion.killAndErase();
|
||||
motion = null;
|
||||
ch.onMotionComplete();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
|
||||
if (animCallback != null) {
|
||||
animCallback.call();
|
||||
animCallback = null;
|
||||
} else {
|
||||
|
||||
if (anim == attack) {
|
||||
|
||||
idle();
|
||||
ch.onAttackComplete();
|
||||
|
||||
} else if (anim == operate) {
|
||||
|
||||
idle();
|
||||
ch.onOperateComplete();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class CrabSprite extends MobSprite {
|
||||
|
||||
public CrabSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.CRAB );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 16 );
|
||||
|
||||
idle = new Animation( 5, true );
|
||||
idle.frames( frames, 0, 1, 0, 2 );
|
||||
|
||||
run = new Animation( 15, true );
|
||||
run.frames( frames, 3, 4, 5, 6 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( frames, 7, 8, 9 );
|
||||
|
||||
die = new Animation( 12, false );
|
||||
die.frames( frames, 10, 11, 12, 13 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blood() {
|
||||
return 0xFFFFEA80;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
|
||||
public class DM300Sprite extends MobSprite {
|
||||
|
||||
public DM300Sprite() {
|
||||
super();
|
||||
|
||||
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 );
|
||||
|
||||
attack = new Animation( 15, false );
|
||||
attack.frames( frames, 4, 5, 6 );
|
||||
|
||||
die = new Animation( 20, false );
|
||||
die.frames( frames, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 8 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
|
||||
super.onComplete( anim );
|
||||
|
||||
if (anim == die) {
|
||||
emitter().burst( Speck.factory( Speck.WOOL ), 15 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blood() {
|
||||
return 0xFFFFFF88;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.Game;
|
||||
|
||||
public class DiscardedItemSprite extends ItemSprite {
|
||||
|
||||
public DiscardedItemSprite() {
|
||||
|
||||
super();
|
||||
|
||||
originToCenter();
|
||||
angularSpeed = 720;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop() {
|
||||
scale.set( 1 );
|
||||
am = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
|
||||
super.update();
|
||||
|
||||
scale.set( scale.x * 0.9f );
|
||||
if ((am -= Game.elapsed) <= 0) {
|
||||
remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
|
||||
public class ElementalSprite extends MobSprite {
|
||||
|
||||
public ElementalSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.ELEMENTAL );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 12, 14 );
|
||||
|
||||
idle = new Animation( 10, true );
|
||||
idle.frames( frames, 0, 1, 2 );
|
||||
|
||||
run = new Animation( 12, true );
|
||||
run.frames( frames, 0, 1, 3 );
|
||||
|
||||
attack = new Animation( 15, false );
|
||||
attack.frames( frames, 4, 5, 6 );
|
||||
|
||||
die = new Animation( 15, false );
|
||||
die.frames( frames, 7, 8, 9, 10, 11, 12, 13, 12 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void link( Char ch ) {
|
||||
super.link( ch );
|
||||
add( State.BURNING );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
super.die();
|
||||
remove( State.BURNING );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blood() {
|
||||
return 0xFFFF7D13;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.DeathRay;
|
||||
|
||||
public class EyeSprite extends MobSprite {
|
||||
|
||||
private int attackPos;
|
||||
|
||||
public EyeSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.EYE );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 16, 18 );
|
||||
|
||||
idle = new Animation( 8, true );
|
||||
idle.frames( frames, 0, 1, 2 );
|
||||
|
||||
run = new Animation( 12, true );
|
||||
run.frames( frames, 5, 6 );
|
||||
|
||||
attack = new Animation( 8, false );
|
||||
attack.frames( frames, 4, 3 );
|
||||
|
||||
die = new Animation( 8, false );
|
||||
die.frames( frames, 7, 8, 9 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attack( int pos ) {
|
||||
attackPos = pos;
|
||||
super.attack( pos );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
super.onComplete( anim );
|
||||
|
||||
if (anim == attack) {
|
||||
if (Dungeon.visible[ch.pos] || Dungeon.visible[attackPos]) {
|
||||
parent.add( new DeathRay( center(), DungeonTilemap.tileCenterToWorld( attackPos ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.particles.Emitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
|
||||
public class FetidRatSprite extends RatSprite {
|
||||
|
||||
private Emitter cloud;
|
||||
|
||||
@Override
|
||||
public void link( Char ch ) {
|
||||
super.link( ch );
|
||||
|
||||
if (cloud == null) {
|
||||
cloud = emitter();
|
||||
cloud.pour( Speck.factory( Speck.PARALYSIS ), 0.7f );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
|
||||
super.update();
|
||||
|
||||
if (cloud != null) {
|
||||
cloud.visible = visible;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
super.die();
|
||||
|
||||
if (cloud != null) {
|
||||
cloud.on = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import javax.microedition.khronos.opengles.GL10;
|
||||
|
||||
import android.opengl.GLES20;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShaftParticle;
|
||||
|
||||
public class GhostSprite extends MobSprite {
|
||||
|
||||
public GhostSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.GHOST );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 14, 15 );
|
||||
|
||||
idle = new Animation( 5, true );
|
||||
idle.frames( frames, 0, 1 );
|
||||
|
||||
run = new Animation( 10, true );
|
||||
run.frames( frames, 0, 1 );
|
||||
|
||||
die = new Animation( 20, false );
|
||||
die.frames( frames, 0 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw() {
|
||||
GLES20.glBlendFunc( GL10.GL_SRC_ALPHA, GL10.GL_ONE );
|
||||
super.draw();
|
||||
GLES20.glBlendFunc( GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
super.die();
|
||||
emitter().start( ShaftParticle.FACTORY, 0.3f, 4 );
|
||||
emitter().start( Speck.factory( Speck.LIGHT ), 0.2f, 3 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blood() {
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class GnollSprite extends MobSprite {
|
||||
|
||||
public GnollSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.GNOLL );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 12, 15 );
|
||||
|
||||
idle = new Animation( 2, true );
|
||||
idle.frames( frames, 0, 0, 0, 1, 0, 0, 1, 1 );
|
||||
|
||||
run = new Animation( 12, true );
|
||||
run.frames( frames, 4, 5, 6, 7 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( frames, 2, 3, 0 );
|
||||
|
||||
die = new Animation( 12, false );
|
||||
die.frames( frames, 8, 9, 10 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
|
||||
|
||||
public class GolemSprite extends MobSprite {
|
||||
|
||||
public GolemSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.GOLEM );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 16, 16 );
|
||||
|
||||
idle = new Animation( 4, true );
|
||||
idle.frames( frames, 0, 1 );
|
||||
|
||||
run = new Animation( 12, true );
|
||||
run.frames( frames, 2, 3, 4, 5 );
|
||||
|
||||
attack = new Animation( 10, false );
|
||||
attack.frames( frames, 6, 7, 8 );
|
||||
|
||||
die = new Animation( 15, false );
|
||||
die.frames( frames, 9, 10, 11, 12, 13 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blood() {
|
||||
return 0xFF80706c;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
if (anim == die) {
|
||||
emitter().burst( ElmoParticle.FACTORY, 4 );
|
||||
}
|
||||
super.onComplete( anim );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class GooSprite extends MobSprite {
|
||||
|
||||
private Animation pump;
|
||||
|
||||
public GooSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.GOO );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 20, 14 );
|
||||
|
||||
idle = new Animation( 10, true );
|
||||
idle.frames( frames, 0, 1 );
|
||||
|
||||
run = new Animation( 10, true );
|
||||
run.frames( frames, 0, 1 );
|
||||
|
||||
pump = new Animation( 20, true );
|
||||
pump.frames( frames, 0, 1 );
|
||||
|
||||
attack = new Animation( 10, false );
|
||||
attack.frames( frames, 5, 0, 6 );
|
||||
|
||||
die = new Animation( 10, false );
|
||||
die.frames( frames, 2, 3, 4 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
public void pumpUp() {
|
||||
play( pump );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blood() {
|
||||
return 0xFF000000;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import android.graphics.RectF;
|
||||
|
||||
import com.watabou.gltextures.SmartTexture;
|
||||
import com.watabou.gltextures.TextureCache;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||
|
||||
public class HeroSprite extends CharSprite {
|
||||
|
||||
private static final int FRAME_WIDTH = 12;
|
||||
private static final int FRAME_HEIGHT = 15;
|
||||
|
||||
private static final int RUN_FRAMERATE = 20;
|
||||
|
||||
private static TextureFilm tiers;
|
||||
|
||||
private Animation fly;
|
||||
|
||||
public HeroSprite() {
|
||||
super();
|
||||
|
||||
link( Dungeon.hero );
|
||||
|
||||
texture( Dungeon.hero.heroClass.spritesheet() );
|
||||
updateArmor();
|
||||
|
||||
idle();
|
||||
}
|
||||
|
||||
public void updateArmor() {
|
||||
|
||||
TextureFilm film = new TextureFilm( tiers(), ((Hero)ch).tier(), FRAME_WIDTH, FRAME_HEIGHT );
|
||||
|
||||
idle = new Animation( 1, true );
|
||||
idle.frames( film, 0, 0, 0, 1, 0, 0, 1, 1 );
|
||||
|
||||
run = new Animation( RUN_FRAMERATE, true );
|
||||
run.frames( film, 2, 3, 4, 5, 6, 7 );
|
||||
|
||||
die = new Animation( 20, false );
|
||||
die.frames( film, 8, 9, 10, 11, 12, 11 );
|
||||
|
||||
attack = new Animation( 15, false );
|
||||
attack.frames( film, 13, 14, 15, 0 );
|
||||
|
||||
zap = attack.clone();
|
||||
|
||||
operate = new Animation( 8, false );
|
||||
operate.frames( film, 16, 17, 16, 17 );
|
||||
|
||||
fly = new Animation( 1, true );
|
||||
fly.frames( film, 18 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void place( int p ) {
|
||||
super.place( p );
|
||||
Camera.main.target = this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void move( int from, int to ) {
|
||||
super.move( from, to );
|
||||
if (ch.flying) {
|
||||
play( fly );
|
||||
}
|
||||
Camera.main.target = this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
sleeping = ((Hero)ch).restoreHealth;
|
||||
|
||||
super.update();
|
||||
}
|
||||
|
||||
public boolean sprint( boolean on ) {
|
||||
run.delay = on ? 0.625f / RUN_FRAMERATE : 1f / RUN_FRAMERATE;
|
||||
return on;
|
||||
}
|
||||
|
||||
public static TextureFilm tiers() {
|
||||
if (tiers == null) {
|
||||
// Sprites for all classes are the same in size
|
||||
SmartTexture texture = TextureCache.get( Assets.ROGUE );
|
||||
tiers = new TextureFilm( texture, texture.width, FRAME_HEIGHT );
|
||||
}
|
||||
|
||||
return tiers;
|
||||
}
|
||||
|
||||
public static Image avatar( HeroClass cl, int armorTier ) {
|
||||
|
||||
RectF patch = tiers().get( armorTier );
|
||||
Image avatar = new Image( cl.spritesheet() );
|
||||
RectF frame = avatar.texture.uvRect( 1, 0, FRAME_WIDTH, FRAME_HEIGHT );
|
||||
frame.offset( patch.left, patch.top );
|
||||
avatar.frame( frame );
|
||||
|
||||
return avatar;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Imp;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
|
||||
public class ImpSprite extends MobSprite {
|
||||
|
||||
public ImpSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.IMP );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 12, 14 );
|
||||
|
||||
idle = new Animation( 10, true );
|
||||
idle.frames( frames,
|
||||
0, 1, 2, 3, 0, 1, 2, 3, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 3, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4 );
|
||||
|
||||
run = new Animation( 20, true );
|
||||
run.frames( frames, 0 );
|
||||
|
||||
die = new Animation( 10, false );
|
||||
die.frames( frames, 0, 3, 2, 1, 0, 3, 2, 1, 0 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void link( Char ch ) {
|
||||
super.link( ch );
|
||||
|
||||
if (ch instanceof Imp) {
|
||||
alpha( 0.4f );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
if (anim == die) {
|
||||
|
||||
emitter().burst( Speck.factory( Speck.WOOL ), 15 );
|
||||
killAndErase();
|
||||
|
||||
} else {
|
||||
super.onComplete( anim );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
import com.watabou.gltextures.TextureCache;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.MovieClip;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.watabou.utils.PointF;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class ItemSprite extends MovieClip {
|
||||
|
||||
public static final int SIZE = 16;
|
||||
|
||||
private static final float DROP_INTERVAL = 0.4f;
|
||||
|
||||
protected static TextureFilm film;
|
||||
|
||||
public Heap heap;
|
||||
|
||||
private Glowing glowing;
|
||||
private float phase;
|
||||
private boolean glowUp;
|
||||
|
||||
private float dropInterval;
|
||||
|
||||
public ItemSprite() {
|
||||
this( ItemSpriteSheet.SMTH, null );
|
||||
}
|
||||
|
||||
public ItemSprite( Item item ) {
|
||||
this( item.image(), item.glowing() );
|
||||
}
|
||||
|
||||
public ItemSprite( int image, Glowing glowing ) {
|
||||
super( Assets.ITEMS );
|
||||
|
||||
if (film == null) {
|
||||
film = new TextureFilm( texture, SIZE, SIZE );
|
||||
}
|
||||
|
||||
view( image, glowing );
|
||||
}
|
||||
|
||||
public void originToCenter() {
|
||||
origin.set(SIZE / 2 );
|
||||
}
|
||||
|
||||
public void link() {
|
||||
link( heap );
|
||||
}
|
||||
|
||||
public void link( Heap heap ) {
|
||||
this.heap = heap;
|
||||
view( heap.image(), heap.glowing() );
|
||||
place( heap.pos );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void revive() {
|
||||
super.revive();
|
||||
|
||||
speed.set( 0 );
|
||||
acc.set( 0 );
|
||||
dropInterval = 0;
|
||||
|
||||
heap = null;
|
||||
}
|
||||
|
||||
public PointF worldToCamera( int cell ) {
|
||||
final int csize = DungeonTilemap.SIZE;
|
||||
|
||||
return new PointF(
|
||||
cell % Level.WIDTH * csize + (csize - SIZE) * 0.5f,
|
||||
cell / Level.WIDTH * csize + (csize - SIZE) * 0.5f
|
||||
);
|
||||
}
|
||||
|
||||
public void place( int p ) {
|
||||
point( worldToCamera( p ) );
|
||||
}
|
||||
|
||||
public void drop() {
|
||||
|
||||
if (heap.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
dropInterval = DROP_INTERVAL;
|
||||
|
||||
speed.set( 0, -100 );
|
||||
acc.set( 0, -speed.y / DROP_INTERVAL * 2 );
|
||||
|
||||
if (visible && heap != null && heap.peek() instanceof Gold) {
|
||||
CellEmitter.center( heap.pos ).burst( Speck.factory( Speck.COIN ), 5 );
|
||||
Sample.INSTANCE.play( Assets.SND_GOLD, 1, 1, Random.Float( 0.9f, 1.1f ) );
|
||||
}
|
||||
}
|
||||
|
||||
public void drop( int from ) {
|
||||
|
||||
if (heap.pos == from) {
|
||||
drop();
|
||||
} else {
|
||||
|
||||
float px = x;
|
||||
float py = y;
|
||||
drop();
|
||||
|
||||
place( from );
|
||||
|
||||
speed.offset( (px-x) / DROP_INTERVAL, (py-y) / DROP_INTERVAL );
|
||||
}
|
||||
}
|
||||
|
||||
public ItemSprite view( int image, Glowing glowing ) {
|
||||
frame( film.get( image ) );
|
||||
if ((this.glowing = glowing) == null) {
|
||||
resetColor();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
// Visibility
|
||||
visible = heap == null || Dungeon.visible[heap.pos];
|
||||
|
||||
// Dropping
|
||||
if (dropInterval > 0 && (dropInterval -= Game.elapsed) <= 0) {
|
||||
|
||||
speed.set( 0 );
|
||||
acc.set( 0 );
|
||||
place( heap.pos );
|
||||
|
||||
if (Level.water[heap.pos]) {
|
||||
GameScene.ripple( heap.pos );
|
||||
}
|
||||
}
|
||||
|
||||
// Glowing
|
||||
if (visible && glowing != null) {
|
||||
if (glowUp && (phase += Game.elapsed) > glowing.period) {
|
||||
|
||||
glowUp = false;
|
||||
phase = glowing.period;
|
||||
|
||||
} else if (!glowUp && (phase -= Game.elapsed) < 0) {
|
||||
|
||||
glowUp = true;
|
||||
phase = 0;
|
||||
|
||||
}
|
||||
|
||||
float value = phase / glowing.period * 0.6f;
|
||||
|
||||
rm = gm = bm = 1 - value;
|
||||
ra = glowing.red * value;
|
||||
ga = glowing.green * value;
|
||||
ba = glowing.blue * value;
|
||||
}
|
||||
}
|
||||
|
||||
public static int pick( int index, int x, int y ) {
|
||||
Bitmap bmp = TextureCache.get( Assets.ITEMS ).bitmap;
|
||||
int rows = bmp.getWidth() / SIZE;
|
||||
int row = index / rows;
|
||||
int col = index % rows;
|
||||
return bmp.getPixel( col * SIZE + x, row * SIZE + y );
|
||||
}
|
||||
|
||||
public static class Glowing {
|
||||
|
||||
public static final Glowing WHITE = new Glowing( 0xFFFFFF, 0.6f );
|
||||
|
||||
public float red;
|
||||
public float green;
|
||||
public float blue;
|
||||
public float period;
|
||||
|
||||
public Glowing( int color ) {
|
||||
this( color, 1f );
|
||||
}
|
||||
|
||||
public Glowing( int color, float period ) {
|
||||
red = (color >> 16) / 255f;
|
||||
green = ((color >> 8) & 0xFF) / 255f;
|
||||
blue = (color & 0xFF) / 255f;
|
||||
|
||||
this.period = period;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
public class ItemSpriteSheet {
|
||||
|
||||
// Placeholders
|
||||
public static final int WEAPON = 5;
|
||||
public static final int ARMOR = 6;
|
||||
public static final int RING = 7;
|
||||
public static final int SMTH = 127;
|
||||
|
||||
// Keys
|
||||
public static final int SKELETON_KEY = 8;
|
||||
public static final int IRON_KEY = 9;
|
||||
public static final int GOLDEN_KEY = 10;
|
||||
|
||||
// Melee weapons
|
||||
public static final int SHORT_SWORD = 2;
|
||||
public static final int KNUCKLEDUSTER = 16;
|
||||
public static final int QUARTERSTAFF = 17;
|
||||
public static final int MACE = 18;
|
||||
public static final int DAGGER = 19;
|
||||
public static final int SWORD = 20;
|
||||
public static final int LONG_SWORD = 21;
|
||||
public static final int BATTLE_AXE = 22;
|
||||
public static final int WAR_HAMMER = 23;
|
||||
public static final int SPEAR = 29;
|
||||
public static final int GLAIVE = 30;
|
||||
|
||||
// Missile weapons
|
||||
public static final int SHURIKEN = 15;
|
||||
public static final int DART = 31;
|
||||
public static final int BOOMERANG = 106;
|
||||
public static final int TOMAHAWK = 107;
|
||||
public static final int INCENDIARY_DART = 108;
|
||||
public static final int CURARE_DART = 109;
|
||||
public static final int JAVELIN = 110;
|
||||
|
||||
// Armors
|
||||
public static final int ARMOR_CLOTH = 24;
|
||||
public static final int ARMOR_LEATHER = 25;
|
||||
public static final int ARMOR_MAIL = 26;
|
||||
public static final int ARMOR_SCALE = 27;
|
||||
public static final int ARMOR_PLATE = 28;
|
||||
public static final int ARMOR_ROGUE = 96;
|
||||
public static final int ARMOR_WARRIOR = 97;
|
||||
public static final int ARMOR_MAGE = 98;
|
||||
public static final int ARMOR_HUNTRESS = 99;
|
||||
|
||||
// Wands
|
||||
public static final int WAND_MAGIC_MISSILE = 3;
|
||||
public static final int WAND_HOLLY = 48;
|
||||
public static final int WAND_YEW = 49;
|
||||
public static final int WAND_EBONY = 50;
|
||||
public static final int WAND_CHERRY = 51;
|
||||
public static final int WAND_TEAK = 52;
|
||||
public static final int WAND_ROWAN = 53;
|
||||
public static final int WAND_WILLOW = 54;
|
||||
public static final int WAND_MAHOGANY = 55;
|
||||
public static final int WAND_BAMBOO = 68;
|
||||
public static final int WAND_PURPLEHEART = 69;
|
||||
public static final int WAND_OAK = 70;
|
||||
public static final int WAND_BIRCH = 71;
|
||||
|
||||
// Rings
|
||||
public static final int RING_DIAMOND = 32;
|
||||
public static final int RING_OPAL = 33;
|
||||
public static final int RING_GARNET = 34;
|
||||
public static final int RING_RUBY = 35;
|
||||
public static final int RING_AMETHYST = 36;
|
||||
public static final int RING_TOPAZ = 37;
|
||||
public static final int RING_ONYX = 38;
|
||||
public static final int RING_TOURMALINE = 39;
|
||||
public static final int RING_EMERALD = 72;
|
||||
public static final int RING_SAPPHIRE = 73;
|
||||
public static final int RING_QUARTZ = 74;
|
||||
public static final int RING_AGATE = 75;
|
||||
|
||||
// Potions
|
||||
public static final int POTION_TURQUOISE = 56;
|
||||
public static final int POTION_CRIMSON = 57;
|
||||
public static final int POTION_AZURE = 58;
|
||||
public static final int POTION_JADE = 59;
|
||||
public static final int POTION_GOLDEN = 60;
|
||||
public static final int POTION_MAGENTA = 61;
|
||||
public static final int POTION_CHARCOAL = 62;
|
||||
public static final int POTION_IVORY = 63;
|
||||
public static final int POTION_AMBER = 64;
|
||||
public static final int POTION_BISTRE = 65;
|
||||
public static final int POTION_INDIGO = 66;
|
||||
public static final int POTION_SILVER = 67;
|
||||
|
||||
// Scrolls
|
||||
public static final int SCROLL_KAUNAN = 40;
|
||||
public static final int SCROLL_SOWILO = 41;
|
||||
public static final int SCROLL_LAGUZ = 42;
|
||||
public static final int SCROLL_YNGVI = 43;
|
||||
public static final int SCROLL_GYFU = 44;
|
||||
public static final int SCROLL_RAIDO = 45;
|
||||
public static final int SCROLL_ISAZ = 46;
|
||||
public static final int SCROLL_MANNAZ = 47;
|
||||
public static final int SCROLL_NAUDIZ = 76;
|
||||
public static final int SCROLL_BERKANAN = 77;
|
||||
public static final int SCROLL_ODAL = 78;
|
||||
public static final int SCROLL_TIWAZ = 79;
|
||||
|
||||
// Seeds
|
||||
public static final int SEED_FIREBLOOM = 88;
|
||||
public static final int SEED_ICECAP = 89;
|
||||
public static final int SEED_SORROWMOSS = 90;
|
||||
public static final int SEED_BLINDWEED = 91;
|
||||
public static final int SEED_SUNGRASS = 92;
|
||||
public static final int SEED_EARTHROOT = 93;
|
||||
public static final int SEED_FADELEAF = 94;
|
||||
public static final int SEED_ROTBERRY = 95;
|
||||
|
||||
// Quest items
|
||||
public static final int ROSE = 100;
|
||||
public static final int PICKAXE = 101;
|
||||
public static final int ORE = 102;
|
||||
public static final int SKULL = 103;
|
||||
public static final int DUST = 121;
|
||||
public static final int TOKEN = 122;
|
||||
|
||||
// Heaps (containers)
|
||||
public static final int BONES = 0;
|
||||
public static final int CHEST = 11;
|
||||
public static final int LOCKED_CHEST = 12;
|
||||
public static final int TOMB = 13;
|
||||
public static final int CRYSTAL_CHEST = 105;
|
||||
|
||||
// Food
|
||||
public static final int RATION = 4;
|
||||
public static final int PASTY = 112;
|
||||
public static final int MEAT = 113;
|
||||
public static final int STEAK = 114;
|
||||
public static final int OVERPRICED = 115;
|
||||
public static final int CARPACCIO = 116;
|
||||
|
||||
// Bags
|
||||
public static final int POUCH = 83;
|
||||
public static final int HOLDER = 104;
|
||||
public static final int HOLSTER = 111;
|
||||
|
||||
// Misc
|
||||
public static final int ANKH = 1;
|
||||
public static final int GOLD = 14;
|
||||
public static final int STYLUS = 80;
|
||||
public static final int DEWDROP = 81;
|
||||
public static final int MASTERY = 82;
|
||||
public static final int TORCH = 84;
|
||||
public static final int BEACON = 85;
|
||||
public static final int KIT = 86;
|
||||
public static final int AMULET = 87;
|
||||
public static final int VIAL = 120;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class KingSprite extends MobSprite {
|
||||
|
||||
public KingSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.KING );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 16, 16 );
|
||||
|
||||
idle = new Animation( 12, true );
|
||||
idle.frames( frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2 );
|
||||
|
||||
run = new Animation( 15, true );
|
||||
run.frames( frames, 3, 4, 5, 6, 7, 8 );
|
||||
|
||||
attack = new Animation( 15, false );
|
||||
attack.frames( frames, 9, 10, 11 );
|
||||
|
||||
die = new Animation( 8, false );
|
||||
die.frames( frames, 12, 13, 14, 15 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash;
|
||||
|
||||
public class LarvaSprite extends MobSprite {
|
||||
|
||||
public LarvaSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.LARVA );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 12, 8 );
|
||||
|
||||
idle = new Animation( 5, true );
|
||||
idle.frames( frames, 4, 4, 4, 4, 4, 5, 5 );
|
||||
|
||||
run = new Animation( 12, true );
|
||||
run.frames( frames, 0, 1, 2, 3 );
|
||||
|
||||
attack = new Animation( 15, false );
|
||||
attack.frames( frames, 6, 5, 7 );
|
||||
|
||||
die = new Animation( 10, false );
|
||||
die.frames( frames, 8 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blood() {
|
||||
return 0xbbcc66;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
Splash.at( center(), blood(), 10 );
|
||||
super.die();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage;
|
||||
|
||||
public class MirrorSprite extends MobSprite {
|
||||
|
||||
private static final int FRAME_WIDTH = 12;
|
||||
private static final int FRAME_HEIGHT = 15;
|
||||
|
||||
public MirrorSprite() {
|
||||
super();
|
||||
|
||||
texture( Dungeon.hero.heroClass.spritesheet() );
|
||||
updateArmor( 0 );
|
||||
idle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void link( Char ch ) {
|
||||
super.link( ch );
|
||||
updateArmor( ((MirrorImage)ch).tier );
|
||||
}
|
||||
|
||||
public void updateArmor( int tier ) {
|
||||
TextureFilm film = new TextureFilm( HeroSprite.tiers(), tier, FRAME_WIDTH, FRAME_HEIGHT );
|
||||
|
||||
idle = new Animation( 1, true );
|
||||
idle.frames( film, 0, 0, 0, 1, 0, 0, 1, 1 );
|
||||
|
||||
run = new Animation( 20, true );
|
||||
run.frames( film, 2, 3, 4, 5, 6, 7 );
|
||||
|
||||
die = new Animation( 20, false );
|
||||
die.frames( film, 0 );
|
||||
|
||||
attack = new Animation( 15, false );
|
||||
attack.frames( film, 13, 14, 15, 0 );
|
||||
|
||||
idle();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.tweeners.PosTweener;
|
||||
import com.watabou.noosa.tweeners.Tweener;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.watabou.utils.Callback;
|
||||
import com.watabou.utils.PointF;
|
||||
|
||||
public class MissileSprite extends ItemSprite implements Tweener.Listener {
|
||||
|
||||
private static final float SPEED = 240f;
|
||||
|
||||
private Callback callback;
|
||||
|
||||
public MissileSprite() {
|
||||
super();
|
||||
originToCenter();
|
||||
}
|
||||
|
||||
public void reset( int from, int to, Item item, Callback listener ) {
|
||||
if (item == null) {
|
||||
reset( from, to, 0, null, listener );
|
||||
} else {
|
||||
reset( from, to, item.image(), item.glowing(), listener );
|
||||
}
|
||||
}
|
||||
|
||||
public void reset( int from, int to, int image, Glowing glowing, Callback listener ) {
|
||||
revive();
|
||||
|
||||
view( image, glowing );
|
||||
|
||||
this.callback = listener;
|
||||
|
||||
point( DungeonTilemap.tileToWorld( from ) );
|
||||
PointF dest = DungeonTilemap.tileToWorld( to );
|
||||
|
||||
PointF d = PointF.diff( dest, point() );
|
||||
speed.set( d ).normalize().scale( SPEED );
|
||||
|
||||
if (image == 31 || image == 108 || image == 109 || image == 110) {
|
||||
angularSpeed = 0;
|
||||
angle = 135 - (float)(Math.atan2( d.x, d.y ) / 3.1415926 * 180);
|
||||
} else {
|
||||
angularSpeed = image == 15 || image == 106 ? 1440 : 720;
|
||||
}
|
||||
|
||||
PosTweener tweener = new PosTweener( this, dest, d.length() / SPEED );
|
||||
tweener.listener = this;
|
||||
parent.add( tweener );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Tweener tweener ) {
|
||||
kill();
|
||||
if (callback != null) {
|
||||
callback.call();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.tweeners.AlphaTweener;
|
||||
import com.watabou.noosa.tweeners.ScaleTweener;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.watabou.utils.PointF;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class MobSprite extends CharSprite {
|
||||
|
||||
private static final float FADE_TIME = 3f;
|
||||
private static final float FALL_TIME = 1f;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
sleeping = ch != null && ((Mob)ch).state == Mob.State.SLEEPING;
|
||||
|
||||
super.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
|
||||
super.onComplete( anim );
|
||||
|
||||
if (anim == die) {
|
||||
parent.add( new AlphaTweener( this, 0, FADE_TIME ) {
|
||||
@Override
|
||||
protected void onComplete() {
|
||||
MobSprite.this.killAndErase();
|
||||
parent.erase( this );
|
||||
};
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
public void fall() {
|
||||
|
||||
origin.set( width / 2, height - DungeonTilemap.SIZE / 2 );
|
||||
angularSpeed = Random.Int( 2 ) == 0 ? -720 : 720;
|
||||
|
||||
parent.add( new ScaleTweener( this, new PointF( 0, 0 ), FALL_TIME ) {
|
||||
@Override
|
||||
protected void onComplete() {
|
||||
MobSprite.this.killAndErase();
|
||||
parent.erase( this );
|
||||
};
|
||||
@Override
|
||||
protected void updateValues( float progress ) {
|
||||
super.updateValues( progress );
|
||||
am = 1 - progress;
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class MonkSprite extends MobSprite {
|
||||
|
||||
private Animation kick;
|
||||
|
||||
public MonkSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.MONK );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 15, 14 );
|
||||
|
||||
idle = new Animation( 6, true );
|
||||
idle.frames( frames, 1, 0, 1, 2 );
|
||||
|
||||
run = new Animation( 15, true );
|
||||
run.frames( frames, 11, 12, 13, 14, 15, 16 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( frames, 3, 4, 3, 4 );
|
||||
|
||||
kick = new Animation( 10, false );
|
||||
kick.frames( frames, 5, 6, 5 );
|
||||
|
||||
die = new Animation( 15, false );
|
||||
die.frames( frames, 1, 7, 8, 8, 9, 10 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attack( int cell ) {
|
||||
super.attack( cell );
|
||||
if (Random.Float() < 0.5f) {
|
||||
play( kick );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
super.onComplete( anim == kick ? attack : anim );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
|
||||
public class PiranhaSprite extends MobSprite {
|
||||
|
||||
public PiranhaSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.PIRANHA );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 12, 16 );
|
||||
|
||||
idle = new Animation( 8, true );
|
||||
idle.frames( frames, 0, 1, 2, 1 );
|
||||
|
||||
run = new Animation( 20, true );
|
||||
run.frames( frames, 0, 1, 2, 1 );
|
||||
|
||||
attack = new Animation( 20, false );
|
||||
attack.frames( frames, 3, 4, 5, 6, 7, 8, 9, 10, 11 );
|
||||
|
||||
die = new Animation( 4, false );
|
||||
die.frames( frames, 12, 13, 14 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
super.onComplete( anim );
|
||||
|
||||
if (anim == attack) {
|
||||
GameScene.ripple( ch.pos );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
|
||||
|
||||
public class PlantSprite extends Image {
|
||||
|
||||
private static final float DELAY = 0.2f;
|
||||
|
||||
private static enum State {
|
||||
GROWING, NORMAL, WITHERING
|
||||
}
|
||||
private State state = State.NORMAL;
|
||||
private float time;
|
||||
|
||||
private static TextureFilm frames;
|
||||
|
||||
private int pos = -1;
|
||||
|
||||
public PlantSprite() {
|
||||
super( Assets.PLANTS );
|
||||
|
||||
if (frames == null) {
|
||||
// Hardcoded size
|
||||
frames = new TextureFilm( texture, 16, 16 );
|
||||
}
|
||||
|
||||
// Hardcoded origin
|
||||
origin.set( 8, 12 );
|
||||
}
|
||||
|
||||
public PlantSprite( int image ) {
|
||||
this();
|
||||
reset( image );
|
||||
}
|
||||
|
||||
public void reset( Plant plant ) {
|
||||
|
||||
revive();
|
||||
|
||||
reset( plant.image );
|
||||
alpha( 1f );
|
||||
|
||||
pos = plant.pos;
|
||||
x = pos % Level.WIDTH * DungeonTilemap.SIZE;
|
||||
y = pos / Level.WIDTH * DungeonTilemap.SIZE;
|
||||
|
||||
state = State.GROWING;
|
||||
time = DELAY;
|
||||
}
|
||||
|
||||
public void reset( int image ) {
|
||||
frame( frames.get( image ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
visible = pos == -1 || Dungeon.visible[pos];
|
||||
|
||||
switch (state) {
|
||||
case GROWING:
|
||||
if ((time -= Game.elapsed) <= 0) {
|
||||
state = State.NORMAL;
|
||||
scale.set( 1 );
|
||||
} else {
|
||||
scale.set( 1 - time / DELAY );
|
||||
}
|
||||
break;
|
||||
case WITHERING:
|
||||
if ((time -= Game.elapsed) <= 0) {
|
||||
super.kill();
|
||||
} else {
|
||||
alpha( time / DELAY );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kill() {
|
||||
state = State.WITHERING;
|
||||
time = DELAY;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class RatKingSprite extends MobSprite {
|
||||
|
||||
public RatKingSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.RATKING );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 16, 16 );
|
||||
|
||||
idle = new Animation( 2, true );
|
||||
idle.frames( frames, 0, 0, 0, 1 );
|
||||
|
||||
run = new Animation( 10, true );
|
||||
run.frames( frames, 2, 3, 4, 5, 6 );
|
||||
|
||||
attack = new Animation( 15, false );
|
||||
attack.frames( frames, 0 );
|
||||
|
||||
die = new Animation( 10, false );
|
||||
die.frames( frames, 0 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class RatSprite extends MobSprite {
|
||||
|
||||
public RatSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.RAT );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 16, 15 );
|
||||
|
||||
idle = new Animation( 2, true );
|
||||
idle.frames( frames, 0, 0, 0, 1 );
|
||||
|
||||
run = new Animation( 10, true );
|
||||
run.frames( frames, 6, 7, 8, 9, 10 );
|
||||
|
||||
attack = new Animation( 15, false );
|
||||
attack.frames( frames, 2, 3, 4, 5, 0 );
|
||||
|
||||
die = new Animation( 10, false );
|
||||
die.frames( frames, 11, 12, 13, 14 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class RottingFistSprite extends MobSprite {
|
||||
|
||||
private static final float FALL_SPEED = 64;
|
||||
|
||||
public RottingFistSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.ROTTING );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 24, 17 );
|
||||
|
||||
idle = new Animation( 2, true );
|
||||
idle.frames( frames, 0, 0, 1 );
|
||||
|
||||
run = new Animation( 3, true );
|
||||
run.frames( frames, 0, 1 );
|
||||
|
||||
attack = new Animation( 2, false );
|
||||
attack.frames( frames, 0 );
|
||||
|
||||
die = new Animation( 10, false );
|
||||
die.frames( frames, 0, 2, 3, 4 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attack( int cell ) {
|
||||
super.attack( cell );
|
||||
|
||||
speed.set( 0, -FALL_SPEED );
|
||||
acc.set( 0, FALL_SPEED * 4 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
super.onComplete( anim );
|
||||
if (anim == attack) {
|
||||
speed.set( 0 );
|
||||
acc.set( 0 );
|
||||
place( ch.pos );
|
||||
|
||||
Camera.main.shake( 4, 0.2f );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Dart;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.watabou.utils.Callback;
|
||||
|
||||
public class ScorpioSprite extends MobSprite {
|
||||
|
||||
private int cellToAttack;
|
||||
|
||||
public ScorpioSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.SCORPIO );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 18, 17 );
|
||||
|
||||
idle = new Animation( 12, true );
|
||||
idle.frames( frames, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 2, 1, 2 );
|
||||
|
||||
run = new Animation( 8, true );
|
||||
run.frames( frames, 5, 5, 6, 6 );
|
||||
|
||||
attack = new Animation( 15, false );
|
||||
attack.frames( frames, 0, 3, 4 );
|
||||
|
||||
zap = attack.clone();
|
||||
|
||||
die = new Animation( 12, false );
|
||||
die.frames( frames, 0, 7, 8, 9, 10 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blood() {
|
||||
return 0xFF44FF22;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attack( int cell ) {
|
||||
if (!Level.adjacent( cell, ch.pos )) {
|
||||
|
||||
cellToAttack = cell;
|
||||
turnTo( ch.pos , cell );
|
||||
play( zap );
|
||||
|
||||
} else {
|
||||
|
||||
super.attack( cell );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
if (anim == zap) {
|
||||
idle();
|
||||
|
||||
((MissileSprite)parent.recycle( MissileSprite.class )).
|
||||
reset( ch.pos, cellToAttack, new Dart(), new Callback() {
|
||||
@Override
|
||||
public void call() {
|
||||
ch.onAttackComplete();
|
||||
}
|
||||
} );
|
||||
} else {
|
||||
super.onComplete( anim );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class SeniorSprite extends MobSprite {
|
||||
|
||||
private Animation kick;
|
||||
|
||||
public SeniorSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.MONK );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 15, 14 );
|
||||
|
||||
idle = new Animation( 6, true );
|
||||
idle.frames( frames, 18, 17, 18, 19 );
|
||||
|
||||
run = new Animation( 15, true );
|
||||
run.frames( frames, 28, 29, 30, 31, 32, 33 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( frames, 20, 21, 20, 21 );
|
||||
|
||||
kick = new Animation( 10, false );
|
||||
kick.frames( frames, 22, 23, 22 );
|
||||
|
||||
die = new Animation( 15, false );
|
||||
die.frames( frames, 18, 24, 25, 25, 26, 27 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attack( int cell ) {
|
||||
super.attack( cell );
|
||||
if (Random.Float() < 0.3f) {
|
||||
play( kick );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
super.onComplete( anim == kick ? attack : anim );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Shaman;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Lightning;
|
||||
|
||||
public class ShamanSprite extends MobSprite {
|
||||
|
||||
private int[] points = new int[2];
|
||||
|
||||
public ShamanSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.SHAMAN );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 12, 15 );
|
||||
|
||||
idle = new Animation( 2, true );
|
||||
idle.frames( frames, 0, 0, 0, 1, 0, 0, 1, 1 );
|
||||
|
||||
run = new Animation( 12, true );
|
||||
run.frames( frames, 4, 5, 6, 7 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( frames, 2, 3, 0 );
|
||||
|
||||
zap = attack.clone();
|
||||
|
||||
die = new Animation( 12, false );
|
||||
die.frames( frames, 8, 9, 10 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
public void zap( int pos ) {
|
||||
|
||||
points[0] = ch.pos;
|
||||
points[1] = pos;
|
||||
parent.add( new Lightning( points, 2, (Shaman)ch ) );
|
||||
|
||||
turnTo( ch.pos, pos );
|
||||
play( zap );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class SheepSprite extends MobSprite {
|
||||
|
||||
public SheepSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.SHEEP );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 16, 15 );
|
||||
|
||||
idle = new Animation( 8, true );
|
||||
idle.frames( frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0 );
|
||||
|
||||
run = idle.clone();
|
||||
attack = idle.clone();
|
||||
|
||||
die = new Animation( 20, false );
|
||||
die.frames( frames, 0 );
|
||||
|
||||
play( idle );
|
||||
curFrame = Random.Int( curAnim.frames.length );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class ShieldedSprite extends MobSprite {
|
||||
|
||||
public ShieldedSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.BRUTE );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 12, 16 );
|
||||
|
||||
idle = new Animation( 2, true );
|
||||
idle.frames( frames, 21, 21, 21, 22, 21, 21, 22, 22 );
|
||||
|
||||
run = new Animation( 12, true );
|
||||
run.frames( frames, 25, 26, 27, 28 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( frames, 23, 24 );
|
||||
|
||||
die = new Animation( 12, false );
|
||||
die.frames( frames, 29, 30, 31 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.watabou.noosa.particles.PixelParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class ShopkeeperSprite extends MobSprite {
|
||||
|
||||
private PixelParticle coin;
|
||||
|
||||
public ShopkeeperSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.KEEPER );
|
||||
TextureFilm film = new TextureFilm( texture, 14, 14 );
|
||||
|
||||
idle = new Animation( 10, true );
|
||||
idle.frames( film, 1, 1, 1, 1, 1, 0, 0, 0, 0 );
|
||||
|
||||
run = idle.clone();
|
||||
die = idle.clone();
|
||||
attack = idle.clone();
|
||||
|
||||
idle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
super.onComplete( anim );
|
||||
|
||||
if (visible && anim == idle) {
|
||||
if (coin == null) {
|
||||
coin = new PixelParticle();
|
||||
parent.add( coin );
|
||||
}
|
||||
coin.reset( x + (flipHorizontal ? 0 : 13), y + 7, 0xFFFF00, 1, 0.5f );
|
||||
coin.speed.y = -40;
|
||||
coin.acc.y = +160;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
|
||||
public class SkeletonSprite extends MobSprite {
|
||||
|
||||
public SkeletonSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.SKELETON );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 12, 15 );
|
||||
|
||||
idle = new Animation( 12, true );
|
||||
idle.frames( frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3 );
|
||||
|
||||
run = new Animation( 15, true );
|
||||
run.frames( frames, 4, 5, 6, 7, 8, 9 );
|
||||
|
||||
attack = new Animation( 15, false );
|
||||
attack.frames( frames, 14, 15, 16 );
|
||||
|
||||
die = new Animation( 12, false );
|
||||
die.frames( frames, 10, 11, 12, 13 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
super.die();
|
||||
if (Dungeon.visible[ch.pos]) {
|
||||
emitter().burst( Speck.factory( Speck.BONE ), 6 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blood() {
|
||||
return 0xFFcccccc;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class SpinnerSprite extends MobSprite {
|
||||
|
||||
public SpinnerSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.SPINNER );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 16, 16 );
|
||||
|
||||
idle = new Animation( 10, true );
|
||||
idle.frames( frames, 0, 0, 0, 0, 0, 1, 0, 1 );
|
||||
|
||||
run = new Animation( 15, true );
|
||||
run.frames( frames, 0, 2, 0, 3 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( frames, 0, 4, 5, 0 );
|
||||
|
||||
die = new Animation( 12, false );
|
||||
die.frames( frames, 6, 7, 8, 9 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blood() {
|
||||
return 0xFFBFE5B8;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class StatueSprite extends MobSprite {
|
||||
|
||||
public StatueSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.STATUE );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 12, 15 );
|
||||
|
||||
idle = new Animation( 2, true );
|
||||
idle.frames( frames, 0, 0, 0, 0, 0, 1, 1 );
|
||||
|
||||
run = new Animation( 15, true );
|
||||
run.frames( frames, 2, 3, 4, 5, 6, 7 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( frames, 8, 9, 10 );
|
||||
|
||||
die = new Animation( 5, false );
|
||||
die.frames( frames, 11, 12, 13, 14, 15, 15 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blood() {
|
||||
return 0xFFcdcdb7;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
|
||||
|
||||
public class SuccubusSprite extends MobSprite {
|
||||
|
||||
public SuccubusSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.SUCCUBUS );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 12, 15 );
|
||||
|
||||
idle = new Animation( 8, true );
|
||||
idle.frames( frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 1 );
|
||||
|
||||
run = new Animation( 15, true );
|
||||
run.frames( frames, 3, 4, 5, 6, 7, 8 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( frames, 9, 10, 11 );
|
||||
|
||||
die = new Animation( 10, false );
|
||||
die.frames( frames, 12 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
super.die();
|
||||
emitter().burst( Speck.factory( Speck.HEART ), 6 );
|
||||
emitter().burst( ShadowParticle.UP, 8 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class SwarmSprite extends MobSprite {
|
||||
|
||||
public SwarmSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.SWARM );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 16, 16 );
|
||||
|
||||
idle = new Animation( 15, true );
|
||||
idle.frames( frames, 0, 1, 2, 3, 4, 5 );
|
||||
|
||||
run = new Animation( 15, true );
|
||||
run.frames( frames, 0, 1, 2, 3, 4, 5 );
|
||||
|
||||
attack = new Animation( 20, false );
|
||||
attack.frames( frames, 6, 7, 8, 9 );
|
||||
|
||||
die = new Animation( 15, false );
|
||||
die.frames( frames, 10, 11, 12, 13, 14 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blood() {
|
||||
return 0xFF8BA077;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Shuriken;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.watabou.utils.Callback;
|
||||
|
||||
public class TenguSprite extends MobSprite {
|
||||
|
||||
private Animation cast;
|
||||
|
||||
public TenguSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.TENGU );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 14, 16 );
|
||||
|
||||
idle = new Animation( 2, true );
|
||||
idle.frames( frames, 0, 0, 0, 1 );
|
||||
|
||||
run = new Animation( 15, false );
|
||||
run.frames( frames, 2, 3, 4, 5, 0 );
|
||||
|
||||
attack = new Animation( 15, false );
|
||||
attack.frames( frames, 6, 7, 7, 0 );
|
||||
|
||||
cast = attack.clone();
|
||||
|
||||
die = new Animation( 8, false );
|
||||
die.frames( frames, 8, 9, 10, 10, 10, 10, 10, 10 );
|
||||
|
||||
play( run.clone() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void move( int from, int to ) {
|
||||
|
||||
place( to );
|
||||
|
||||
play( run );
|
||||
turnTo( from , to );
|
||||
|
||||
if (Level.water[to]) {
|
||||
GameScene.ripple( to );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attack( int cell ) {
|
||||
if (!Level.adjacent( cell, ch.pos )) {
|
||||
|
||||
((MissileSprite)parent.recycle( MissileSprite.class )).
|
||||
reset( ch.pos, cell, new Shuriken(), new Callback() {
|
||||
@Override
|
||||
public void call() {
|
||||
ch.onAttackComplete();
|
||||
}
|
||||
} );
|
||||
|
||||
play( cast );
|
||||
turnTo( ch.pos , cell );
|
||||
|
||||
} else {
|
||||
|
||||
super.attack( cell );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
if (anim == run) {
|
||||
idle();
|
||||
ch.onMotionComplete();
|
||||
} else {
|
||||
super.onComplete( anim );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class ThiefSprite extends MobSprite {
|
||||
|
||||
public ThiefSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.THIEF );
|
||||
TextureFilm film = new TextureFilm( texture, 12, 13 );
|
||||
|
||||
idle = new Animation( 1, true );
|
||||
idle.frames( film, 0, 0, 0, 1, 0, 0, 0, 0, 1 );
|
||||
|
||||
run = new Animation( 15, true );
|
||||
run.frames( film, 0, 0, 2, 3, 3, 4 );
|
||||
|
||||
die = new Animation( 10, false );
|
||||
die.frames( film, 5, 6, 7, 8, 9 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( film, 10, 11, 12, 0 );
|
||||
|
||||
idle();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
|
||||
public class UndeadSprite extends MobSprite {
|
||||
|
||||
public UndeadSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.UNDEAD );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 12, 16 );
|
||||
|
||||
idle = new Animation( 12, true );
|
||||
idle.frames( frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3 );
|
||||
|
||||
run = new Animation( 15, true );
|
||||
run.frames( frames, 4, 5, 6, 7, 8, 9 );
|
||||
|
||||
attack = new Animation( 15, false );
|
||||
attack.frames( frames, 14, 15, 16 );
|
||||
|
||||
die = new Animation( 12, false );
|
||||
die.frames( frames, 10, 11, 12, 13 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
super.die();
|
||||
if (Dungeon.visible[ch.pos]) {
|
||||
emitter().burst( Speck.factory( Speck.BONE ), 3 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blood() {
|
||||
return 0xFFcccccc;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import javax.microedition.khronos.opengles.GL10;
|
||||
|
||||
import android.opengl.GLES20;
|
||||
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Halo;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
|
||||
import com.watabou.utils.PointF;
|
||||
|
||||
public class WandmakerSprite extends MobSprite {
|
||||
|
||||
private Shield shield;
|
||||
|
||||
public WandmakerSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.MAKER );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 12, 14 );
|
||||
|
||||
idle = new Animation( 10, true );
|
||||
idle.frames( frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 2, 1 );
|
||||
|
||||
run = new Animation( 20, true );
|
||||
run.frames( frames, 0 );
|
||||
|
||||
die = new Animation( 20, false );
|
||||
die.frames( frames, 0 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void link( Char ch ) {
|
||||
super.link( ch );
|
||||
|
||||
if (shield == null) {
|
||||
parent.add( shield = new Shield() );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
super.die();
|
||||
|
||||
if (shield != null) {
|
||||
shield.putOut();
|
||||
}
|
||||
emitter().start( ElmoParticle.FACTORY, 0.03f, 60 );
|
||||
}
|
||||
|
||||
public class Shield extends Halo {
|
||||
|
||||
private float phase;
|
||||
|
||||
public Shield() {
|
||||
|
||||
super( 14, 0xBBAACC, 1f );
|
||||
|
||||
am = -1;
|
||||
aa = +1;
|
||||
|
||||
phase = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
if (phase < 1) {
|
||||
if ((phase -= Game.elapsed) <= 0) {
|
||||
killAndErase();
|
||||
} else {
|
||||
scale.set( (2 - phase) * radius / RADIUS );
|
||||
am = phase * (-1);
|
||||
aa = phase * (+1);
|
||||
}
|
||||
}
|
||||
|
||||
if (visible = WandmakerSprite.this.visible) {
|
||||
PointF p = WandmakerSprite.this.center();
|
||||
point(p.x, p.y );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw() {
|
||||
GLES20.glBlendFunc( GL10.GL_SRC_ALPHA, GL10.GL_ONE );
|
||||
super.draw();
|
||||
GLES20.glBlendFunc( GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA );
|
||||
}
|
||||
|
||||
public void putOut() {
|
||||
phase = 0.999f;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Warlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||
import com.watabou.utils.Callback;
|
||||
|
||||
public class WarlockSprite extends MobSprite {
|
||||
|
||||
public WarlockSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.WARLOCK );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 12, 15 );
|
||||
|
||||
idle = new Animation( 2, true );
|
||||
idle.frames( frames, 0, 0, 0, 1, 0, 0, 1, 1 );
|
||||
|
||||
run = new Animation( 15, true );
|
||||
run.frames( frames, 0, 2, 3, 4 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( frames, 0, 5, 6 );
|
||||
|
||||
zap = attack.clone();
|
||||
|
||||
die = new Animation( 15, false );
|
||||
die.frames( frames, 0, 7, 8, 8, 9, 10 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
public void zap( int cell ) {
|
||||
|
||||
turnTo( ch.pos , cell );
|
||||
play( zap );
|
||||
|
||||
MagicMissile.shadow( parent, ch.pos, cell,
|
||||
new Callback() {
|
||||
@Override
|
||||
public void call() {
|
||||
((Warlock)ch).onZapComplete();
|
||||
}
|
||||
} );
|
||||
Sample.INSTANCE.play( Assets.SND_ZAP );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete( Animation anim ) {
|
||||
if (anim == zap) {
|
||||
idle();
|
||||
}
|
||||
super.onComplete( anim );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
||||
public class WraithSprite extends MobSprite {
|
||||
|
||||
public WraithSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.WRAITH );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 14, 15 );
|
||||
|
||||
idle = new Animation( 5, true );
|
||||
idle.frames( frames, 0, 1 );
|
||||
|
||||
run = new Animation( 10, true );
|
||||
run.frames( frames, 0, 1 );
|
||||
|
||||
attack = new Animation( 10, false );
|
||||
attack.frames( frames, 0, 2, 3 );
|
||||
|
||||
die = new Animation( 8, false );
|
||||
die.frames( frames, 0, 4, 5, 6, 7 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blood() {
|
||||
return 0x88000000;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2014 Oleg Dolya
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash;
|
||||
|
||||
public class YogSprite extends MobSprite {
|
||||
|
||||
public YogSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.YOG );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 20, 19 );
|
||||
|
||||
idle = new Animation( 10, true );
|
||||
idle.frames( frames, 0, 1, 2, 2, 1, 0, 3, 4, 4, 3, 0, 5, 6, 6, 5 );
|
||||
|
||||
run = new Animation( 12, true );
|
||||
run.frames( frames, 0 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( frames, 0 );
|
||||
|
||||
die = new Animation( 10, false );
|
||||
die.frames( frames, 0, 7, 8, 9 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
super.die();
|
||||
|
||||
Splash.at( center(), blood(), 12 );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user