Skip to content

Commit

Permalink
Fix more character technique(s) that apply debuffs on attack
Browse files Browse the repository at this point in the history
  • Loading branch information
Melledy committed Dec 6, 2023
1 parent 417c8c1 commit 6d95f2b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
11 changes: 8 additions & 3 deletions src/main/java/emu/lunarcore/data/config/SkillAbilityInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -70,7 +70,7 @@ private void parseTask(MazeSkill skill, List<MazeSkillAction> 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")) {
Expand All @@ -79,6 +79,11 @@ private void parseTask(MazeSkill skill, List<MazeSkillAction> actionList, TaskIn
parseTask(skill, skill.getAttackActions(), t);
}
}
if (task.getOnProjectileLifetimeFinish() != null) {
for (TaskInfo t : task.getOnProjectileLifetimeFinish()) {
parseTask(skill, skill.getAttackActions(), t);
}
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/main/java/emu/lunarcore/data/config/TaskInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class TaskInfo {
private List<TaskInfo> OnAttack;
private List<TaskInfo> SuccessTaskList;
private List<TaskInfo> OnProjectileHit;
private List<TaskInfo> OnProjectileLifetimeFinish;

public String getType() {
return this.$type;
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/emu/lunarcore/data/excel/AvatarExcel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -39,7 +38,6 @@ public class AvatarExcel extends GameResource {
private transient List<AvatarSkillTreeExcel> defaultSkillTrees;
private transient IntSet skillTreeIds;
private transient String nameKey;
private transient int maxSp;

@Setter private transient MazeSkill mazeAttack;
@Setter private transient MazeSkill mazeSkill;
Expand Down Expand Up @@ -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);

Expand Down
6 changes: 4 additions & 2 deletions src/main/java/emu/lunarcore/game/battle/BattleService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6d95f2b

Please sign in to comment.