Added player actions array (left/right skills)

Added player actions array (left/right skills)
Temporary fix for non-existing complex casting modes
This commit is contained in:
Collin Smith
2019-03-21 01:56:11 -07:00
parent c284e1f7fa
commit 18f4325dff
2 changed files with 7 additions and 1 deletions

View File

@ -732,13 +732,16 @@ public abstract class Entity implements Animation.AnimationListener {
}
public boolean cast(final int spell) {
if (spell < 0) return false;
if (!isCastable(mode)) return false;
setPath(null, null);
//if (mode == getNeutralMode()) return;
//animating = true;
final Skills.Entry skill = Riiablo.files.skills.get(spell);
byte tm = mode;
boolean changed = sequence(type.getMode(skill.anim), getNeutralMode());
byte newMode = type.getMode(skill.anim);
if (newMode == -1) newMode = type.getMode("SC");
boolean changed = sequence(newMode, getNeutralMode());
if (!changed) return false;
System.out.println("cast " + type.MODE[tm] + "->" + type.MODE[mode]);

View File

@ -94,6 +94,7 @@ public class Player extends Entity {
public Stats stats;
public Skills skills;
public int[] skillBar;
public int[][] actions;
public Map map;
public Map.Zone curZone;
public final CharacterClass charClass;
@ -108,6 +109,7 @@ public class Player extends Entity {
stats = new StatsImpl(name, characterClass.id);
skills = new SkillsImpl();
skillBar = new int[16];
actions = new int[2][2];
}
public Player(D2S d2s) {
@ -115,6 +117,7 @@ public class Player extends Entity {
stats = new D2SStats(d2s);
skills = new D2SSkills(d2s);
skillBar = d2s.skillBar;
actions = d2s.actions;
loadEquipped(d2s.items.equipped);
loadInventory(d2s.items.inventory);
}