v0.3.0: reworked the ballistica system

This commit is contained in:
Evan Debenham
2015-03-26 22:43:23 -04:00
parent 9c1cfc095f
commit 99f853c190
27 changed files with 230 additions and 162 deletions
@@ -17,6 +17,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
@@ -34,8 +35,8 @@ public class WandOfPoison extends Wand {
}
@Override
protected void onZap( int cell ) {
Char ch = Actor.findChar( cell );
protected void onZap( Ballistica bolt ) {
Char ch = Actor.findChar( bolt.collisionPos );
if (ch != null) {
Buff.affect( ch, Poison.class ).set( Poison.durationFactor( ch ) * (5 + level()) );
@@ -46,9 +47,10 @@ public class WandOfPoison extends Wand {
}
}
protected void fx( int cell, Callback callback ) {
MagicMissile.poison( curUser.sprite.parent, curUser.pos, cell, callback );
@Override
protected void fx( Ballistica bolt, Callback callback ) {
MagicMissile.poison( curUser.sprite.parent, bolt.sourcePos, bolt.collisionPos, callback );
Sample.INSTANCE.play( Assets.SND_ZAP );
}