From 18f4325dff7b4affdf3054813ff5cb65941b4c59 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Thu, 21 Mar 2019 01:56:11 -0700 Subject: [PATCH] Added player actions array (left/right skills) Added player actions array (left/right skills) Temporary fix for non-existing complex casting modes --- core/src/com/riiablo/entity/Entity.java | 5 ++++- core/src/com/riiablo/entity/Player.java | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/com/riiablo/entity/Entity.java b/core/src/com/riiablo/entity/Entity.java index 3c4333fd..5ea7ba57 100644 --- a/core/src/com/riiablo/entity/Entity.java +++ b/core/src/com/riiablo/entity/Entity.java @@ -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]); diff --git a/core/src/com/riiablo/entity/Player.java b/core/src/com/riiablo/entity/Player.java index 239b47a8..ab7eda03 100644 --- a/core/src/com/riiablo/entity/Player.java +++ b/core/src/com/riiablo/entity/Player.java @@ -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); }