Build powers, cast prereqs and power fail conditions from Powers.cfg

PowersBase(PowerTemplate, id) and PowerPrereq template constructors;
PowersManager.loadPowers fills both maps on the world and login servers
(ids 1..1465 in file order, identical to the DB IDs). The 3.10 target
type exceptions and applyClientTargetTypes are gone; the dead
BLEED-DOT-10.5-RANGE token override is removed (the power is
BLEED-DOT-10.5-RANGED and its DB token is already its hash).

Parity (JSON-Refactor-Plan/scripts/p48.py, every column): 1465/1465 ids,
tokens = SBStringHash(id), flags 1465/1465, prereqs 720/720 rows, fail
conditions 103/105 powers. Absent MAXNUM*TARGETS stay 7 (patch notes).

Value changes (cfg wins, user 2026-10-26):
- target types HLR-025 PC->CORPSE, HNT-023 PC->SELF, RNG-033 GROUP->SELF
- HNT-023 SPELL->SKILL, target select CLICK->NONE
- cast time RNG-033 3->0.2, ROG-002 10->12, WIZ-067 6->7
- WIZ-067 release 1->0, init ramp 0->-0.13; SCT-004 cost ramp 0.5->0
- recycle ALF-001 300->180, FGM-002/003 600->900
- WLR-018 category HEAL->none
- BRD-016, PRS-031 lose the power CastSpell fail condition
- 4 name typos and 167 descriptions from the cfg; 2 effect prereq
  messages (SAB-001, SAP-004) untruncated (unread)
- canCastWhileFlying true by default (client ctor; no live reader)
- category BOON-CLASS/BOON-RACE -> BOONCLASS/BOONRACE: GetSourceType now
  resolves them instead of logging an error (no effect blocks them)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-26 09:57:46 -04:00
1 parent 3cf966d0eb
commit ac72d2c8d2
4 files changed
+240 -50

No files matched your search

+29
View File
@@ -10,6 +10,8 @@
package engine.powers;
import engine.gameManager.DbManager;
import engine.mbEnums.EquipSlotType;
import engine.parsers.objects.wpak.PowerTemplate;
import org.pmw.tinylog.Logger;
import java.sql.Connection;
@@ -61,6 +63,33 @@ public class PowerPrereq {
}
}
// EFFECTPREREQ= on the caster
public PowerPrereq(PowerTemplate.EffectPrereq effectPrereq) {
this.effect = effectPrereq.effect_id;
this.message = effectPrereq.message;
this.mainHand = false;
this.required = false;
}
// TARGETEFFECTPREREQS_ANDED= / _ORED= on the target
public PowerPrereq(PowerTemplate.EffectPrereq targetPrereq, boolean anded) {
this.effect = targetPrereq.effect_id;
this.message = "";
this.mainHand = false;
this.required = anded;
}
// EQPREREQ=: the message holds the skill name
public PowerPrereq(PowerTemplate.EquipPrereq equipPrereq) {
this.effect = "";
this.message = equipPrereq.skill;
this.mainHand = equipPrereq.slot == EquipSlotType.RHELD;
this.required = equipPrereq.required;
}
public static void getAllPowerPrereqs(HashMap<String, PowersBase> powers) {
try (Connection connection = DbManager.getConnection();