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
@@ -20,6 +20,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.wands;
import java.util.ArrayList;
import java.util.HashSet;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.watabou.noosa.Camera;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions;
@@ -47,7 +48,7 @@ public class WandOfLightning extends Wand {
private int nPoints;
@Override
protected void onZap( int cell ) {
protected void onZap( Ballistica bolt ) {
// Everything is processed in fx() method
if (!curUser.isAlive()) {
Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name ) );
@@ -87,10 +88,12 @@ public class WandOfLightning extends Wand {
}
@Override
protected void fx( int cell, Callback callback ) {
protected void fx( Ballistica bolt, Callback callback ) {
nPoints = 0;
points[nPoints++] = Dungeon.hero.pos;
int cell = bolt.collisionPos;
Char ch = Actor.findChar( cell );
if (ch != null) {