lastNegativeId moved to ItemManager

This commit is contained in:
2024-04-19 10:32:36 -04:00
parent c03c1f4057
commit 1a7f63ce05
5 changed files with 24 additions and 9 deletions
+17
View File
@@ -2,10 +2,13 @@ package engine.gameManager;
import engine.mbEnums;
import engine.objects.*;
import engine.powers.EffectsBase;
import engine.powers.poweractions.AbstractPowerAction;
import org.pmw.tinylog.Logger;
import java.util.EnumSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
@@ -17,6 +20,8 @@ import java.util.concurrent.ConcurrentHashMap;
public enum ItemManager {
ITEMMANAGER;
public static final AtomicInteger lastNegativeID = new AtomicInteger(0);
public static Boolean ValidRace(Item item, mbEnums.MonsterType race) {
if (item.template.item_race_req.isEmpty() && item.template.item_race_res.isEmpty())
@@ -220,4 +225,16 @@ public enum ItemManager {
return true;
}
public static void addPrefixOrSuffix(Item item, int token) {
EffectsBase effectsBase = PowersManager.getEffectByToken(token);
AbstractPowerAction apa = PowersManager.getPowerActionByIDString(effectsBase.getIDString());
if (apa == null)
return;
apa.applyEffectForItem(item, 0);
item.getEffectNames().add(effectsBase.getIDString());
}
}