Move guard captain powers from static_rune_powers to MinionType

The 14 Magister Captain contracts' powers have no client rune or deed
(Task 3.9), so they live on the MinionType mage entries instead of the
DB fallback in loadAllRunePowers. canCast, mobCast and aiInfoCmd read
them through MinionType.getCaptainPowers.

No value change: same 56 power ids, rank 40, and all 56 DB tokens equal
the powerbase token of their power id (checked on mbdb_108).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-24 12:34:02 -04:00
1 parent b0460ed2d0
commit dff53d5c76
5 files changed
+51 -39

No files matched your search

+10 -14
View File
@@ -17,7 +17,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public class RunePowerEntry {
@@ -41,13 +40,19 @@ public class RunePowerEntry {
this.rank = powerGrant.power_value;
}
// Guard contract powers have no client source, so ids without a rune keep their DB rows.
public static HashMap<Integer, ArrayList<RunePowerEntry>> loadAllRunePowers(HashMap<Integer, ArrayList<RunePowerEntry>> dbRunePowers) {
public RunePowerEntry(String name, String powerType, int rank) {
this.name = name;
this.token = Hasher.SBStringHash(powerType);
this.power_type = powerType;
this.rank = rank;
}
// Guard captain contract powers have no rune; they live on mbEnums.MinionType
public static HashMap<Integer, ArrayList<RunePowerEntry>> loadAllRunePowers() {
HashMap<Integer, ArrayList<RunePowerEntry>> runePowers = new HashMap<>();
ArrayList<RunePowerEntry> powerList;
int entryCount = 0;
int fallbackCount = 0;
for (RuneTemplate rune : RuneTemplate._runes.values()) {
@@ -63,16 +68,7 @@ public class RunePowerEntry {
entryCount += powerList.size();
}
for (Map.Entry<Integer, ArrayList<RunePowerEntry>> dbEntry : dbRunePowers.entrySet()) {
if (RuneTemplate._runes.containsKey(dbEntry.getKey()))
continue;
runePowers.put(dbEntry.getKey(), dbEntry.getValue());
fallbackCount++;
}
Logger.info("Loaded " + entryCount + " rune powers from runes, " + fallbackCount + " ids from the DB; " + runePowers.size() + " ids");
Logger.info("Loaded " + entryCount + " rune powers for " + runePowers.size() + " runes");
return runePowers;
}