Merging Source v1.7.2: effects changes

This commit is contained in:
Evan Debenham
2014-10-20 23:00:20 -04:00
parent 1e62a6bd88
commit 724338b57f
4 changed files with 76 additions and 50 deletions
@@ -208,6 +208,9 @@ public class BadgeBanner extends Image {
break; break;
case 38: case 38:
p.offset( 5, 5 ); p.offset( 5, 5 );
break;
case 39:
p.offset( 5, 4 );
break; break;
case 40: case 40:
case 41: case 41:
@@ -22,25 +22,29 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
public class BannerSprites { public class BannerSprites {
public enum Type { public enum Type {
PIXEL_DUNGEON, PIXEL_DUNGEON,
BOSS_SLAIN, BOSS_SLAIN,
GAME_OVER GAME_OVER,
}; SELECT_YOUR_HERO
};
public static Image get( Type type ) { public static Image get( Type type ) {
Image icon = new Image( Assets.BANNERS ); Image icon = new Image( Assets.BANNERS );
switch (type) { switch (type) {
case PIXEL_DUNGEON: case PIXEL_DUNGEON:
icon.frame( icon.texture.uvRect( 0, 0, 128, 70 ) ); icon.frame( icon.texture.uvRect( 0, 0, 128, 70 ) );
break; break;
case BOSS_SLAIN: case BOSS_SLAIN:
icon.frame( icon.texture.uvRect( 0, 70, 128, 105 ) ); icon.frame( icon.texture.uvRect( 0, 70, 128, 105 ) );
break; break;
case GAME_OVER: case GAME_OVER:
icon.frame( icon.texture.uvRect( 0, 105, 128, 140 ) ); icon.frame( icon.texture.uvRect( 0, 105, 128, 140 ) );
break; break;
} case SELECT_YOUR_HERO:
return icon; icon.frame( icon.texture.uvRect( 0, 140, 128, 161 ) );
} break;
}
return icon;
}
} }
@@ -53,6 +53,7 @@ public class Flare extends Visual {
super( 0, 0, 0, 0 ); super( 0, 0, 0, 0 );
// FIXME
// Texture is incorrectly created every time we need // Texture is incorrectly created every time we need
// to show the effect, it must be refactored // to show the effect, it must be refactored
@@ -58,6 +58,7 @@ public class Speck extends Image {
public static final int DUST = 109; public static final int DUST = 109;
public static final int STENCH = 110; public static final int STENCH = 110;
public static final int FORGE = 111; public static final int FORGE = 111;
public static final int CONFUSION = 112;
private static final int SIZE = 7; private static final int SIZE = 7;
@@ -100,8 +101,9 @@ public class Speck extends Image {
case JET: case JET:
case TOXIC: case TOXIC:
case PARALYSIS: case PARALYSIS:
case DUST:
case STENCH: case STENCH:
case CONFUSION:
case DUST:
frame( film.get( STEAM ) ); frame( film.get( STEAM ) );
break; break;
default: default:
@@ -275,13 +277,6 @@ public class Speck extends Image {
lifespan = Random.Float( 1f, 3f ); lifespan = Random.Float( 1f, 3f );
break; break;
case DUST:
hardlight( 0xFFFF66 );
angle = Random.Float( 360 );
speed.polar( Random.Float( 2 * 3.1415926f ), Random.Float( 16, 48 ) );
lifespan = 0.5f;
break;
case STENCH: case STENCH:
hardlight( 0x003300 ); hardlight( 0x003300 );
angularSpeed = -30; angularSpeed = -30;
@@ -289,7 +284,21 @@ public class Speck extends Image {
lifespan = Random.Float( 1f, 3f ); lifespan = Random.Float( 1f, 3f );
break; break;
case COIN: case CONFUSION:
hardlight( Random.Int( 0x1000000 ) | 0x000080 );
angularSpeed = Random.Float( -20, +20 );
angle = Random.Float( 360 );
lifespan = Random.Float( 1f, 3f );
break;
case DUST:
hardlight( 0xFFFF66 );
angle = Random.Float( 360 );
speed.polar( Random.Float( 2 * 3.1415926f ), Random.Float( 16, 48 ) );
lifespan = 0.5f;
break;
case COIN:
speed.polar( -PointF.PI * Random.Float( 0.3f, 0.7f ), Random.Float( 48, 96 ) ); speed.polar( -PointF.PI * Random.Float( 0.3f, 0.7f ), Random.Float( 48, 96 ) );
acc.y = 256; acc.y = 256;
lifespan = -speed.y / acc.y * 2; lifespan = -speed.y / acc.y * 2;
@@ -389,6 +398,7 @@ public class Speck extends Image {
case STEAM: case STEAM:
case TOXIC: case TOXIC:
case PARALYSIS: case PARALYSIS:
case CONFUSION:
case DUST: case DUST:
am = p < 0.5f ? p : 1 - p; am = p < 0.5f ? p : 1 - p;
scale.set( 1 + p * 2 ); scale.set( 1 + p * 2 );
@@ -413,21 +423,29 @@ public class Speck extends Image {
} }
} }
public static Emitter.Factory factory( final int type ) { public static Emitter.Factory factory( final int type ) {
return factory( type, false );
}
Emitter.Factory factory = factories.get( type ); public static Emitter.Factory factory( final int type, final boolean lightMode ) {
if (factory == null) { Emitter.Factory factory = factories.get( type );
factory = new Emitter.Factory() {
@Override
public void emit ( Emitter emitter, int index, float x, float y ) {
Speck p = (Speck)emitter.recycle( Speck.class );
p.reset( index, x, y, type );
}
};
factories.put( type, factory );
}
return factory; if (factory == null) {
} factory = new Emitter.Factory() {
@Override
public void emit ( Emitter emitter, int index, float x, float y ) {
Speck p = (Speck)emitter.recycle( Speck.class );
p.reset( index, x, y, type );
}
@Override
public boolean lightMode() {
return lightMode;
}
};
factories.put( type, factory );
}
return factory;
}
} }