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
@@ -19,6 +19,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.wands;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
@@ -36,8 +37,8 @@ public class WandOfAmok 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) {
if (ch == Dungeon.hero) {
@@ -52,9 +53,10 @@ public class WandOfAmok extends Wand {
}
}
protected void fx( int cell, Callback callback ) {
MagicMissile.purpleLight( curUser.sprite.parent, curUser.pos, cell, callback );
@Override
protected void fx( Ballistica bolt, Callback callback ) {
MagicMissile.purpleLight( curUser.sprite.parent, bolt.sourcePos, bolt.collisionPos, callback );
Sample.INSTANCE.play( Assets.SND_ZAP );
}