public SnowParticle() { super(); speed.set( 0, Random.Float( 5, 8 ) ); lifespan = 1.2f; }
public void start( Factory factory, float interval, int quantity ) { this.factory = factory; this.lightMode = factory.lightMode(); this.interval = interval; this.quantity = quantity; count = 0; time = Random.Float( interval ); on = true; }
@Override public void emit( Emitter emitter, int index, float x, float y ) { PixelParticle p = (PixelParticle)emitter.recycle( PixelParticle.Shrinking.class ); p.reset( x, y, color, 4, Random.Float( 0.5f, 1.0f ) ); p.speed.polar( Random.Float( dir - cone / 2, dir + cone / 2 ), Random.Float( 40, 80 ) ); p.acc.set( 0, +100 ); } }
@Override public Item upgrade() { super.upgrade(); if (Random.Float() > Math.pow(0.8, level())) { cursed = false; } return this; }
@Override public void attack( int cell ) { super.attack( cell ); if (Random.Float() < 0.3f) { play( kick ); } }
public void reset( float x, float y ) { revive(); this.x = x; this.y = y; speed.set( Random.Float( -2, +2 ), 0 ); left = lifespan = 0.4f; } }
@Override public void update() { super.update(); if (Random.Float() < Game.elapsed * 0.1) { BadgeBanner.highlight( icon, badge.image ); } }
@Override public Item upgrade() { super.upgrade(); if (Random.Float() > Math.pow(0.8, level())) { cursed = false; } updateLevel(); curCharges = Math.min( curCharges + 1, maxCharges ); updateQuickslot(); return this; }
@Override public int proc( Weapon weapon, Char attacker, Char defender, int damage ) { // lvl 0 - 13% // lvl 1 - 22% // lvl 2 - 30% int level = Math.max( 0, weapon.level() ); if (Random.Int( level + 8 ) >= 7) { Buff.prolong( defender, Paralysis.class, Random.Float( 1, 1.5f + level ) ); defender.sprite.emitter().burst(Speck.factory(Speck.LIGHT), 12 ); } return damage; }
public void staffFx( MagesStaff.StaffParticle particle ){ particle.color(0xFFFFFF); particle.am = 0.3f; particle.setLifespan( 1f); particle.speed.polar( Random.Float(PointF.PI2), 2f ); particle.setSize( 1f, 2f ); particle.radiateXY(0.5f); }
@Override public int proc( Armor armor, Char attacker, Char defender, int damage) { if (Random.Int( 8 ) == 0) { if (Dungeon.level.adjacent( attacker.pos, defender.pos )) { Buff.prolong(attacker, Frost.class, Frost.duration(attacker) * Random.Float(0.5f, 1f)); CellEmitter.get(attacker.pos).start(SnowParticle.FACTORY, 0.2f, 6); } Buff.affect( defender, Burning.class ).reignite( defender ); defender.sprite.emitter().burst( FlameParticle.FACTORY, 5 ); } return damage; }