feat: add C6 special interactions

This commit is contained in:
goose
2026-10-03 12:54:52 -04:00
parent 68d35bf94b
commit 7e93cf0b5b
16 changed files with 439 additions and 1 deletions
+7
View File
@@ -27,6 +27,9 @@ var xp_reward := 0
var xp := 0
var loot_table: StringName = &""
var perception := 0
# C6 keeps trap proficiency on the lightweight actor until the full skill state
# owns the player model. Imported traps still name their required `traps` skill.
var trap_skill := 0
# Tactical data is copied from the ASCII enemy definition at spawn/load time.
var ai_behavior: StringName = &"legacy"
# Legacy/demo fixtures did not carry a catalog definition; keep their previous
@@ -65,6 +68,7 @@ func _init(new_id: StringName, new_cell: Vector2i, new_hit_points: int, new_atta
xp = int(combat_data.get("xp", xp))
loot_table = StringName(combat_data.get("loot_table", loot_table))
perception = int(combat_data.get("perception", combat_data.get("per", perception)))
trap_skill = int(combat_data.get("trap_skill", combat_data.get("traps", trap_skill)))
ai_behavior = StringName(combat_data.get("ai", combat_data.get("ai_behavior", ai_behavior)))
vision_range = int(combat_data.get("vision_range", vision_range))
attack_range = int(combat_data.get("range", combat_data.get("attack_range", attack_range)))
@@ -101,6 +105,9 @@ func wound_severity(slot: StringName) -> int:
func effective_perception() -> int:
return perception - wounds.severity_at(&"head")
func effective_trap_skill() -> int:
return trap_skill - wounds.severity_at(&"head")
func effective_max_hit_points() -> int:
var reduction := int(float(max_hit_points) * 0.05 * wounds.severity_at(&"torso"))
return maxi(1, max_hit_points - reduction)