Refine Korean briefing and expand first battle
This commit is contained in:
@@ -50,6 +50,7 @@ const DEFAULT_TERRAIN_DEFS := {
|
||||
"move_cost": 1,
|
||||
"defense": 0,
|
||||
"avoid": 0,
|
||||
"heal": 0,
|
||||
"color": Color(0.43, 0.62, 0.31)
|
||||
},
|
||||
"F": {
|
||||
@@ -57,6 +58,7 @@ const DEFAULT_TERRAIN_DEFS := {
|
||||
"move_cost": 2,
|
||||
"defense": 2,
|
||||
"avoid": 10,
|
||||
"heal": 0,
|
||||
"color": Color(0.20, 0.45, 0.23)
|
||||
},
|
||||
"H": {
|
||||
@@ -64,6 +66,7 @@ const DEFAULT_TERRAIN_DEFS := {
|
||||
"move_cost": 2,
|
||||
"defense": 1,
|
||||
"avoid": 5,
|
||||
"heal": 0,
|
||||
"color": Color(0.55, 0.50, 0.34)
|
||||
},
|
||||
"D": {
|
||||
@@ -71,6 +74,7 @@ const DEFAULT_TERRAIN_DEFS := {
|
||||
"move_cost": {"foot": 1, "mounted": 2, "archer": 1, "water": 99},
|
||||
"defense": 0,
|
||||
"avoid": 0,
|
||||
"heal": 0,
|
||||
"color": Color(0.59, 0.45, 0.29)
|
||||
},
|
||||
"R": {
|
||||
@@ -78,6 +82,7 @@ const DEFAULT_TERRAIN_DEFS := {
|
||||
"move_cost": 1,
|
||||
"defense": 0,
|
||||
"avoid": 0,
|
||||
"heal": 0,
|
||||
"color": Color(0.64, 0.55, 0.42)
|
||||
},
|
||||
"W": {
|
||||
@@ -85,7 +90,24 @@ const DEFAULT_TERRAIN_DEFS := {
|
||||
"move_cost": 99,
|
||||
"defense": 0,
|
||||
"avoid": 0,
|
||||
"heal": 0,
|
||||
"color": Color(0.18, 0.36, 0.62)
|
||||
},
|
||||
"T": {
|
||||
"name": "마을",
|
||||
"move_cost": {"foot": 1, "mounted": 2, "archer": 1, "water": 99},
|
||||
"defense": 1,
|
||||
"avoid": 5,
|
||||
"heal": 6,
|
||||
"color": Color(0.71, 0.54, 0.33)
|
||||
},
|
||||
"C": {
|
||||
"name": "성채",
|
||||
"move_cost": {"foot": 1, "mounted": 2, "archer": 1, "water": 99},
|
||||
"defense": 3,
|
||||
"avoid": 0,
|
||||
"heal": 8,
|
||||
"color": Color(0.50, 0.48, 0.44)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2028,6 +2050,10 @@ func get_terrain_avoid(cell: Vector2i) -> int:
|
||||
return int(terrain_defs.get(get_terrain_key(cell), DEFAULT_TERRAIN_DEFS["G"]).get("avoid", 0))
|
||||
|
||||
|
||||
func get_terrain_heal(cell: Vector2i) -> int:
|
||||
return int(terrain_defs.get(get_terrain_key(cell), DEFAULT_TERRAIN_DEFS["G"]).get("heal", 0))
|
||||
|
||||
|
||||
func get_cell_summary(cell: Vector2i) -> Dictionary:
|
||||
if not is_inside(cell):
|
||||
return {}
|
||||
@@ -2039,6 +2065,7 @@ func get_cell_summary(cell: Vector2i) -> Dictionary:
|
||||
"move_cost": get_move_cost(cell),
|
||||
"defense": get_terrain_defense(cell),
|
||||
"avoid": get_terrain_avoid(cell),
|
||||
"heal": get_terrain_heal(cell),
|
||||
"unit": unit
|
||||
}
|
||||
|
||||
@@ -4169,7 +4196,7 @@ func _emit_ai_target_priority_feedback(unit: Dictionary, previous_priority: int,
|
||||
text = "%s는 여전히 적의 표적입니다." % unit_name
|
||||
_emit_log(text)
|
||||
if bool(unit.get("alive", false)) and bool(unit.get("deployed", true)):
|
||||
_emit_combat_feedback(unit, "標的", "priority")
|
||||
_emit_combat_feedback(unit, "표적", "priority")
|
||||
|
||||
|
||||
func _apply_objective_event(action: Dictionary) -> void:
|
||||
@@ -4187,9 +4214,9 @@ func _apply_objective_event(action: Dictionary) -> void:
|
||||
if not updated:
|
||||
return
|
||||
if action.has("victory") and not updated_victory.is_empty():
|
||||
_emit_log("軍令 개정: %s" % updated_victory)
|
||||
_emit_log("군령 갱신: %s" % updated_victory)
|
||||
if action.has("defeat") and not updated_defeat.is_empty():
|
||||
_emit_log("敗兆 개정: %s" % updated_defeat)
|
||||
_emit_log("패배 조건 갱신: %s" % updated_defeat)
|
||||
objective_updated.emit(updated_victory, updated_defeat)
|
||||
_notify_changed()
|
||||
|
||||
@@ -4296,6 +4323,7 @@ func _reset_team_actions(team: String) -> void:
|
||||
_check_battle_status()
|
||||
if battle_status != STATUS_ACTIVE:
|
||||
return
|
||||
_apply_terrain_recovery_for_team(team)
|
||||
_expire_status_effects_for_team(team)
|
||||
for unit in units:
|
||||
if unit.get("team", "") == team and unit.get("alive", false):
|
||||
@@ -4326,6 +4354,27 @@ func _apply_phase_status_effects_for_team(team: String) -> void:
|
||||
break
|
||||
|
||||
|
||||
func _apply_terrain_recovery_for_team(team: String) -> void:
|
||||
for unit in units:
|
||||
if unit.get("team", "") != team or not unit.get("alive", false) or not unit.get("deployed", true):
|
||||
continue
|
||||
var cell: Vector2i = unit.get("pos", Vector2i(-1, -1))
|
||||
if not is_inside(cell):
|
||||
continue
|
||||
var heal := get_terrain_heal(cell)
|
||||
if heal <= 0:
|
||||
continue
|
||||
var old_hp := int(unit.get("hp", 0))
|
||||
var max_hp := int(unit.get("max_hp", 1))
|
||||
var new_hp: int = mini(max_hp, old_hp + heal)
|
||||
if new_hp <= old_hp:
|
||||
continue
|
||||
unit["hp"] = new_hp
|
||||
var recovered := new_hp - old_hp
|
||||
_emit_log("%s, %s에서 병력 %d 회복." % [unit["name"], get_terrain_name(cell), recovered])
|
||||
_emit_combat_feedback(unit, "+%d" % recovered, "heal")
|
||||
|
||||
|
||||
func _expire_status_effects_for_team(team: String) -> void:
|
||||
for unit in units:
|
||||
if unit.get("team", "") != team:
|
||||
|
||||
@@ -103,6 +103,7 @@ func get_runtime_terrain_defs(default_defs: Dictionary) -> Dictionary:
|
||||
runtime["name"] = str(source.get("name", runtime.get("name", key)))
|
||||
runtime["defense"] = int(source.get("defense", runtime.get("defense", 0)))
|
||||
runtime["avoid"] = int(source.get("avoid", runtime.get("avoid", 0)))
|
||||
runtime["heal"] = int(source.get("heal", runtime.get("heal", 0)))
|
||||
runtime["move_cost"] = source.get("move_cost", runtime.get("move_cost", 1))
|
||||
runtime["color"] = _parse_color(source.get("color", runtime.get("color", Color.WHITE)), runtime.get("color", Color.WHITE))
|
||||
result[key] = runtime
|
||||
|
||||
Reference in New Issue
Block a user