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
@@ -83,10 +83,13 @@ public class WarriorArmor extends ClassArmor {
public void onSelect( Integer target ) {
if (target != null && target != curUser.pos) {
int cell = Ballistica.cast( curUser.pos, target, false, true );
if (Actor.findChar( cell ) != null && cell != curUser.pos) {
cell = Ballistica.trace[Ballistica.distance - 2];
}
Ballistica route = new Ballistica(curUser.pos, target, Ballistica.PROJECTILE);
int cell = route.collisionPos;
//can't occupy the same cell as another char, so move back one.
if (Actor.findChar( cell ) != null && cell != curUser.pos)
cell = route.path.get(route.dist-1);
curUser.HP -= (curUser.HP / 3);
if (curUser.subClass == HeroSubClass.BERSERKER && curUser.HP <= curUser.HT * Fury.LEVEL) {