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
@@ -209,6 +209,9 @@ public class BadgeBanner extends Image {
case 38: case 38:
p.offset( 5, 5 ); p.offset( 5, 5 );
break; break;
case 39:
p.offset( 5, 4 );
break;
case 40: case 40:
case 41: case 41:
case 42: case 42:
@@ -25,7 +25,8 @@ 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 ) {
@@ -40,6 +41,9 @@ public class BannerSprites {
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:
icon.frame( icon.texture.uvRect( 0, 140, 128, 161 ) );
break;
} }
return icon; 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,6 +284,20 @@ public class Speck extends Image {
lifespan = Random.Float( 1f, 3f ); lifespan = Random.Float( 1f, 3f );
break; break;
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: 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;
@@ -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 );
@@ -414,6 +424,10 @@ 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 );
}
public static Emitter.Factory factory( final int type, final boolean lightMode ) {
Emitter.Factory factory = factories.get( type ); Emitter.Factory factory = factories.get( type );
@@ -424,6 +438,10 @@ public class Speck extends Image {
Speck p = (Speck)emitter.recycle( Speck.class ); Speck p = (Speck)emitter.recycle( Speck.class );
p.reset( index, x, y, type ); p.reset( index, x, y, type );
} }
@Override
public boolean lightMode() {
return lightMode;
}
}; };
factories.put( type, factory ); factories.put( type, factory );
} }