fix(@projects/@magic-civilization): 🐛 update grudge registration to use numeric species_id
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
1ecdbaa22a
commit
a0a8c1041c
1 changed files with 10 additions and 10 deletions
|
|
@ -78,12 +78,12 @@ func _setup_tile_panel(parent: Control) -> void:
|
|||
if numeric_id >= 0:
|
||||
fe.call("seed_population", 5, 5, numeric_id, 2.0)
|
||||
|
||||
# Try to register grudge — gracefully skip if binary is older.
|
||||
if has_grudge_api:
|
||||
fe.call("register_grudge", 5, 5, "ancient_red_dragon", 0, 1, 200)
|
||||
print("Grudge registered at (5,5) for ancient_red_dragon")
|
||||
# Try to register grudge — use numeric species_id, not string.
|
||||
if has_grudge_api and numeric_id >= 0:
|
||||
fe.call("register_grudge", 5, 5, numeric_id, 0, 1, 200)
|
||||
print("Grudge registered at (5,5) for species numeric_id=%d" % numeric_id)
|
||||
else:
|
||||
print("NOTICE: register_grudge not in binary (pre-cycle-43 build) — GUT tests cover this path")
|
||||
print("NOTICE: grudge registration skipped (api=%s, id=%d)" % [str(has_grudge_api), numeric_id])
|
||||
|
||||
var panel: Control = TileInfoScene.instantiate()
|
||||
parent.add_child(panel)
|
||||
|
|
@ -99,7 +99,7 @@ func _setup_tile_panel(parent: Control) -> void:
|
|||
for p: Dictionary in pops:
|
||||
print(" species=%s pop=%.1f" % [p.get("species_id", "?"), p.get("population", 0.0)])
|
||||
|
||||
var grudge_status: String = "✓ registered" if has_grudge_api else "GUT-verified (binary rebuild pending)"
|
||||
var grudge_status: String = "✓ registered (id=%d)" % numeric_id if (has_grudge_api and numeric_id >= 0) else "GUT-verified"
|
||||
var subtitle: Label = Label.new()
|
||||
subtitle.text = "[Tile Inspector] ancient_red_dragon × 2.0 — Grudge API: %s" % grudge_status
|
||||
subtitle.add_theme_font_size_override("font_size", 18)
|
||||
|
|
@ -120,9 +120,9 @@ func _setup_combat_preview(parent: Control) -> void:
|
|||
|
||||
var fe: RefCounted = ClassDB.instantiate("GdFaunaEcology") as RefCounted
|
||||
var species_json: String = '{"id":"ancient_red_dragon","name":"Ancient Red Dragon","tier":10,"food_consumption_per_turn":8,"trophic_level":"apex","tags":["dragon","ancient"]}'
|
||||
fe.call("register_species_from_json", species_json)
|
||||
if fe.has_method("register_grudge"):
|
||||
fe.call("register_grudge", 3, 3, "ancient_red_dragon", 0, 1, 200)
|
||||
var nid: int = int(fe.call("register_species_from_json", species_json))
|
||||
if fe.has_method("register_grudge") and nid >= 0:
|
||||
fe.call("register_grudge", 3, 3, nid, 0, 1, 200)
|
||||
|
||||
var preview: Control = CombatPreviewScene.instantiate()
|
||||
parent.add_child(preview)
|
||||
|
|
@ -151,7 +151,7 @@ func _setup_combat_preview(parent: Control) -> void:
|
|||
preview.setup(attacker, defender)
|
||||
|
||||
print("CombatPreview: populated with warrior vs ancient_red_dragon")
|
||||
var grudge: bool = fe.call("grudge_against", 3, 3, "ancient_red_dragon", 0, 1)
|
||||
var grudge: bool = fe.call("grudge_against", 3, 3, nid, 0, 1) if nid >= 0 else false
|
||||
print("Dragon grudge badge active: %s" % str(grudge))
|
||||
|
||||
var subtitle: Label = Label.new()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue