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 <noreply@anthropic.com>
This commit is contained in:
1 parent
073417567f
commit
f8d764b5f5
2 files changed
+4
-51
No files matched your search
@@ -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<String, AbstractPowerAction> 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");
|
||||
|
||||
@@ -52,7 +52,6 @@ public class EffectsBase {
|
||||
public static HashMap<Integer, HashSet<mbEnums.DamageType>> EffectDamageTypes = new HashMap<>();
|
||||
public static HashSet<AbstractEffectModifier> DefaultModifiers = new HashSet<>();
|
||||
private static ConcurrentHashMap<String, String> 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
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user