From f8d764b5f5a504a3e7de3fce02ee85ec93b9e850 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 26 Oct 2026 04:35:33 -0400 Subject: [PATCH] Keep action line IDs apart from effect IDs ActionsBase IDs (IgnoreStack effect keys) and EffectsBase IDs are both written as Integer.toString keys into the same effects map, and their ranges overlapped. Action lines now start at 10001. Also drops the unused EffectsBase copy constructor and its NewID counter. Co-Authored-By: Claude Opus 5.5 --- src/engine/powers/ActionsBase.java | 5 ++- src/engine/powers/EffectsBase.java | 50 ------------------------------ 2 files changed, 4 insertions(+), 51 deletions(-) diff --git a/src/engine/powers/ActionsBase.java b/src/engine/powers/ActionsBase.java index eb6a5fd9..d0c053d8 100644 --- a/src/engine/powers/ActionsBase.java +++ b/src/engine/powers/ActionsBase.java @@ -28,6 +28,9 @@ import java.util.HashMap; public class ActionsBase { + // Effect maps key both effects and IgnoreStack action lines by Integer.toString(id); keep the ranges apart + private static final int ACTION_ID_OFFSET = 10000; + public int UUID; public String IDString; public String effectID; @@ -59,7 +62,7 @@ public class ActionsBase { */ public ActionsBase(ResultSet rs, HashMap apa) throws SQLException { - this.UUID = rs.getInt("ID"); + this.UUID = rs.getInt("ID") + ACTION_ID_OFFSET; this.IDString = rs.getString("powerID"); this.effectID = rs.getString("effectID"); this.minTrains = rs.getInt("minTrains"); diff --git a/src/engine/powers/EffectsBase.java b/src/engine/powers/EffectsBase.java index 760965e7..5861718d 100644 --- a/src/engine/powers/EffectsBase.java +++ b/src/engine/powers/EffectsBase.java @@ -52,7 +52,6 @@ public class EffectsBase { public static HashMap> EffectDamageTypes = new HashMap<>(); public static HashSet DefaultModifiers = new HashSet<>(); private static ConcurrentHashMap itemEffectsByName = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); - private static int NewID = 3000; private int UUID; private String IDString; // private String name; @@ -91,55 +90,6 @@ public class EffectsBase { } - public EffectsBase(EffectsBase copyEffect, int newToken, String IDString) { - - UUID = NewID++; - this.IDString = IDString; - this.token = newToken; - - //filll - if (copyEffect == null) { - int flags = 0; - this.isItemEffect = ((flags & 1) != 0) ? true : false; - this.isSpireEffect = ((flags & 2) != 0) ? true : false; - this.ignoreMod = ((flags & 4) != 0) ? true : false; - this.dontSave = ((flags & 8) != 0) ? true : false; - - if (this.IDString.startsWith("PRE-")) - this.isPrefix = true; - else if (this.IDString.startsWith("SUF-")) - this.isSuffix = true; - - } - - - this.amount = copyEffect.amount; - this.amountRamp = copyEffect.amountRamp; - this.isItemEffect = copyEffect.isItemEffect; - this.isSpireEffect = copyEffect.isSpireEffect; - this.ignoreMod = copyEffect.ignoreMod; - this.dontSave = copyEffect.dontSave; - this.cancelOnAttack = copyEffect.cancelOnAttack; - this.cancelOnAttackSwing = copyEffect.cancelOnAttackSwing; - this.cancelOnCast = copyEffect.cancelOnCast; - this.cancelOnCastSpell = copyEffect.cancelOnCastSpell; - this.cancelOnEquipChange = copyEffect.cancelOnEquipChange; - this.cancelOnLogout = copyEffect.cancelOnLogout; - this.cancelOnMove = copyEffect.cancelOnMove; - this.cancelOnNewCharm = copyEffect.cancelOnNewCharm; - this.cancelOnSit = copyEffect.cancelOnSit; - this.cancelOnTakeDamage = copyEffect.cancelOnTakeDamage; - this.cancelOnTerritoryClaim = copyEffect.cancelOnTerritoryClaim; - this.cancelOnUnEquip = copyEffect.cancelOnUnEquip; - this.useRampAdd = copyEffect.useRampAdd; - this.isPrefix = copyEffect.isPrefix; - this.isSuffix = copyEffect.isSuffix; - this.name = copyEffect.name; - this.value = copyEffect.value; - this.resourceCosts = copyEffect.resourceCosts; - - } - /** * ResultSet Constructor */