From 6d95f2b64104663d2f6d5294e22428080ea78235 Mon Sep 17 00:00:00 2001 From: Melledy <121644117+Melledy@users.noreply.github.com> Date: Wed, 6 Dec 2023 04:31:51 -0800 Subject: [PATCH] Fix more character technique(s) that apply debuffs on attack --- .../emu/lunarcore/data/config/SkillAbilityInfo.java | 11 ++++++++--- src/main/java/emu/lunarcore/data/config/TaskInfo.java | 1 + .../java/emu/lunarcore/data/excel/AvatarExcel.java | 5 ----- .../java/emu/lunarcore/game/battle/BattleService.java | 6 ++++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/java/emu/lunarcore/data/config/SkillAbilityInfo.java b/src/main/java/emu/lunarcore/data/config/SkillAbilityInfo.java index 72df9bd29..9617abf1c 100644 --- a/src/main/java/emu/lunarcore/data/config/SkillAbilityInfo.java +++ b/src/main/java/emu/lunarcore/data/config/SkillAbilityInfo.java @@ -23,12 +23,12 @@ public boolean parse(AvatarExcel avatarExcel) { // Skip if not a maze skill if (ability.getName().contains("MazeSkill")) { - skill = new MazeSkill(avatarExcel, 2); + skill = new MazeSkill(avatarExcel, 1); avatarExcel.setMazeSkill(skill); actionList = skill.getCastActions(); } else if (ability.getName().contains("NormalAtk")) { - skill = new MazeSkill(avatarExcel, 1); + skill = new MazeSkill(avatarExcel, 0); avatarExcel.setMazeAttack(skill); actionList = skill.getAttackActions(); @@ -70,7 +70,7 @@ private void parseTask(MazeSkill skill, List actionList, TaskIn parseTask(skill, skill.getAttackActions(), t); } } - if (skill.getIndex() == 2) { + if (skill.getIndex() == 1) { skill.setTriggerBattle(task.isTriggerBattle()); } } else if (task.getType().contains("AdventureFireProjectile")) { @@ -79,6 +79,11 @@ private void parseTask(MazeSkill skill, List actionList, TaskIn parseTask(skill, skill.getAttackActions(), t); } } + if (task.getOnProjectileLifetimeFinish() != null) { + for (TaskInfo t : task.getOnProjectileLifetimeFinish()) { + parseTask(skill, skill.getAttackActions(), t); + } + } } } diff --git a/src/main/java/emu/lunarcore/data/config/TaskInfo.java b/src/main/java/emu/lunarcore/data/config/TaskInfo.java index 1c9dce2d1..a7b6d04a0 100644 --- a/src/main/java/emu/lunarcore/data/config/TaskInfo.java +++ b/src/main/java/emu/lunarcore/data/config/TaskInfo.java @@ -24,6 +24,7 @@ public class TaskInfo { private List OnAttack; private List SuccessTaskList; private List OnProjectileHit; + private List OnProjectileLifetimeFinish; public String getType() { return this.$type; diff --git a/src/main/java/emu/lunarcore/data/excel/AvatarExcel.java b/src/main/java/emu/lunarcore/data/excel/AvatarExcel.java index 28c5da817..0878bc000 100644 --- a/src/main/java/emu/lunarcore/data/excel/AvatarExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/AvatarExcel.java @@ -24,7 +24,6 @@ public class AvatarExcel extends GameResource { private long AvatarName; private DamageType DamageType; private AvatarBaseType AvatarBaseType; - private double SPNeed; private int ExpGroup; private int MaxPromotion; @@ -39,7 +38,6 @@ public class AvatarExcel extends GameResource { private transient List defaultSkillTrees; private transient IntSet skillTreeIds; private transient String nameKey; - private transient int maxSp; @Setter private transient MazeSkill mazeAttack; @Setter private transient MazeSkill mazeSkill; @@ -73,9 +71,6 @@ public void onLoad() { this.promotionData[i] = GameData.getAvatarPromotionExcel(getId(), i); } - // Cache max sp - this.maxSp = (int) this.SPNeed * 100; - // Get name key Matcher matcher = namePattern.matcher(this.JsonPath); diff --git a/src/main/java/emu/lunarcore/game/battle/BattleService.java b/src/main/java/emu/lunarcore/game/battle/BattleService.java index 25222cfdb..3e671a4e7 100644 --- a/src/main/java/emu/lunarcore/game/battle/BattleService.java +++ b/src/main/java/emu/lunarcore/game/battle/BattleService.java @@ -135,9 +135,11 @@ public void startBattle(Player player, int casterId, int attackedGroupId, MazeSk if (isPlayerCaster) { GameAvatar avatar = player.getCurrentLeaderAvatar(); - if (avatar != null && castedSkill != null) { + if (avatar != null) { // Maze skill attack event - castedSkill.onAttack(avatar, battle); + if (castedSkill != null) { + castedSkill.onAttack(avatar, battle); + } // Add elemental weakness buff to enemies MazeBuff buff = battle.addBuff(avatar.getExcel().getDamageType().getEnterBattleBuff(), battle.getLineup().getLeader()); if (buff != null) {