Merge task #14: enemy roster display names (Alien / Alien robot)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
814449afff
17 changed files with 40 additions and 38 deletions
|
|
@ -192,7 +192,7 @@ func show_assessment() -> void:
|
|||
"animals":
|
||||
(row[1] as Label).text = "%d%% (%d of %d)" % [pct, s.animals, s.animals_total]
|
||||
_:
|
||||
(row[1] as Label).text = "%d%% kept from thieves (%d of %d carried off)" % [pct, a["supplies_lost"], a["supplies_handled"]]
|
||||
(row[1] as Label).text = "%d%% kept from aliens (%d of %d carried off)" % [pct, a["supplies_lost"], a["supplies_handled"]]
|
||||
_stats.text = _totals_text(a["totals"], true)
|
||||
_stats.visible = true
|
||||
_retry.visible = false
|
||||
|
|
|
|||
|
|
@ -27,8 +27,10 @@ const TYPE_BREAKER := 2
|
|||
## GameConfig.enemy_types keys, by type id.
|
||||
const TYPE_NAMES: Array[String] = ["thief", "crow", "breaker"]
|
||||
## Display names, singular and plural.
|
||||
const NAMES: Array[String] = ["thief", "crow", "fence breaker"]
|
||||
const PLURALS: Array[String] = ["thieves", "crows", "fence breakers"]
|
||||
const NAMES: Array[String] = ["alien", "crow", "alien robot"]
|
||||
const PLURALS: Array[String] = ["aliens", "crows", "alien robots"]
|
||||
## "a" or "an" for NAMES[t], by type id.
|
||||
const ARTICLES: Array[String] = ["an", "a", "an"]
|
||||
const NB_DX: Array[int] = [0, -1, 0, 1, -1, 1, -1, 0, 1]
|
||||
const NB_DZ: Array[int] = [0, -1, -1, -1, 0, 0, 1, 1, 1]
|
||||
|
||||
|
|
|
|||
|
|
@ -676,8 +676,8 @@ static func arrival_message(type: int, side: String) -> String:
|
|||
EnemySystem.TYPE_CROW:
|
||||
return "A crow flew in" + from
|
||||
EnemySystem.TYPE_BREAKER:
|
||||
return "A fence breaker came in" + from
|
||||
return "A thief slipped in" + from
|
||||
return "An alien robot came in" + from
|
||||
return "An alien slipped in" + from
|
||||
|
||||
|
||||
func _on_phase_changed(phase: CampaignController.Phase, _previous: CampaignController.Phase) -> void:
|
||||
|
|
@ -689,7 +689,7 @@ func _on_phase_changed(phase: CampaignController.Phase, _previous: CampaignContr
|
|||
CampaignController.Phase.DAWN:
|
||||
behavior.retreat_all(enemies)
|
||||
if enemies.alive_count() > 0 and toasts != null:
|
||||
toasts.push("Sunrise! The thieves are running for it", Color(1.0, 0.85, 0.6))
|
||||
toasts.push("Sunrise! The aliens are running for it", Color(1.0, 0.85, 0.6))
|
||||
CampaignController.Phase.MORNING:
|
||||
if partner == null and not replica:
|
||||
campaign.state.coop = false # a co-op save continued alone: solo rules
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ func _process(delta: float) -> void:
|
|||
_sub.text = "Night · sunrise in %s" % left
|
||||
hint = on_the_farm(enemies)
|
||||
CampaignController.Phase.DAWN:
|
||||
_sub.text = "Dawn · the thieves are fleeing (%s)" % left
|
||||
_sub.text = "Dawn · the aliens are fleeing (%s)" % left
|
||||
CampaignController.Phase.FARMERS_RETURN:
|
||||
_sub.text = "The farmers are back"
|
||||
CampaignController.Phase.GAME_OVER:
|
||||
|
|
@ -137,7 +137,7 @@ func _on_phase_changed(phase: CampaignController.Phase, _previous: CampaignContr
|
|||
CampaignController.Phase.DAY:
|
||||
text = "Day %d: gather and build" % s.night
|
||||
CampaignController.Phase.DUSK:
|
||||
text = "Dusk: %s" % _tonight_title("the thieves come at nightfall")
|
||||
text = "Dusk: %s" % _tonight_title("the aliens come at nightfall")
|
||||
CampaignController.Phase.NIGHT:
|
||||
text = "Night %d: %s" % [s.night, _tonight_title("")] if _tonight_title("") != "" else "Night %d" % s.night
|
||||
CampaignController.Phase.DAWN:
|
||||
|
|
@ -169,7 +169,7 @@ static func on_the_farm(es: EnemySystem) -> String:
|
|||
var parts := PackedStringArray()
|
||||
for t in [EnemySystem.TYPE_CROW, EnemySystem.TYPE_THIEF, EnemySystem.TYPE_BREAKER]:
|
||||
if counts[t] == 1:
|
||||
parts.append("a " + EnemySystem.NAMES[t])
|
||||
parts.append(EnemySystem.ARTICLES[t] + " " + EnemySystem.NAMES[t])
|
||||
elif counts[t] > 1:
|
||||
parts.append("%d %s" % [counts[t], EnemySystem.PLURALS[t]])
|
||||
if parts.is_empty():
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ func refresh() -> void:
|
|||
_title.text = "The farmers are away"
|
||||
lines.append("Keep the farm safe for %d nights until they come home: the crops, the animals in the pen, and the supplies in the shed." % nights)
|
||||
lines.append("By day, gather wood, scrap, and straw (hold E), store them at the barn, and build defenses (B). There's more to gather off the farm, to the north, east, and south.")
|
||||
lines.append("At night, stab thieves with your pitchfork (left mouse), scare them off (Q), and pick up anything they drop. A dropped animal runs off: walk up to it and lead it back to the pen. The workbench sells a corn shooter (switch weapons with Tab or 1-2) and pumpkin bombs (throw them with right mouse).")
|
||||
lines.append("At night, stab aliens with your pitchfork (left mouse), scare them off (Q), and pick up anything they drop. A dropped animal runs off: walk up to it and lead it back to the pen. The workbench sells a corn shooter (switch weapons with Tab or 1-2) and pumpkin bombs (throw them with right mouse).")
|
||||
else:
|
||||
var e: Dictionary = s.night_log[s.night_log.size() - 1]
|
||||
_title.text = "Morning of day %d of %d" % [s.night, nights]
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ const FADE := 0.6
|
|||
const SLOTS := 5
|
||||
## Loot events per category (LootSystem.Category): the text ("%s" is the item's noun) and color.
|
||||
const MESSAGES := {
|
||||
&"stolen": [["A crop was snatched!", "A %s was grabbed!", "Thieves took %s from the shed!"], Color(1.0, 0.6, 0.15)],
|
||||
&"dropped": [["The thief dropped the crop. Grab it!", "The thief dropped the %s. Catch it before it runs off!",
|
||||
"The thief dropped %s. Grab it!"], Color(1.0, 0.9, 0.3)],
|
||||
&"stolen": [["A crop was snatched!", "A %s was grabbed!", "Aliens took %s from the shed!"], Color(1.0, 0.6, 0.15)],
|
||||
&"dropped": [["The alien dropped the crop. Grab it!", "The alien dropped the %s. Catch it before it runs off!",
|
||||
"The alien dropped %s. Grab it!"], Color(1.0, 0.9, 0.3)],
|
||||
&"recovered": [["Crop recovered", "The %s is back in the pen", "%s back in the shed"], Color(0.5, 1.0, 0.45)],
|
||||
&"returned": [["A dropped crop went back to its plot", "The %s went back to the pen", "%s went back to the shed"],
|
||||
Color(0.85, 0.95, 1.0)],
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ const TEXT := {
|
|||
"move": "Move with [W A S D] or the left stick. You're the scarecrow: keep the farm safe until the farmers are back.",
|
||||
"gather": "Hold [E / X] at a dead tree, the haystacks, or the scrap heap to gather wood, straw, and scrap.",
|
||||
"store": "Your pouch only holds so much: walk onto the barn's apron (the Supply Shed) to store what you carry.",
|
||||
"build": "Press [B / d-pad up] to build. Pick a fence [1], place it with left mouse / RT. Thieves have to break through fences.",
|
||||
"dusk": "Dusk: thieves come at nightfall, from every side of the farm.",
|
||||
"build": "Press [B / d-pad up] to build. Pick a fence [1], place it with left mouse / RT. Aliens have to break through fences.",
|
||||
"dusk": "Dusk: aliens come at nightfall, from every side of the farm.",
|
||||
"shoot": "Aim with the mouse or the right stick and hold left mouse / RT to stab with your pitchfork. The workbench sells a corn shooter (switch with [Tab / 1-2]) and pumpkin bombs for your off-hand: throw them with [right mouse / LT].",
|
||||
"fear": "Crowded? [Q / LB] Fear scares off everything nearby, and they drop what they carry.",
|
||||
"recover": "Something was dropped! Walk over it to bring it home. A dropped animal follows you back to the pen.",
|
||||
|
|
|
|||
|
|
@ -26,11 +26,6 @@ const TARGETS := {
|
|||
"supplies": LootSystem.Category.SUPPLY,
|
||||
"any": LootSystem.ANY,
|
||||
}
|
||||
const TARGET_NAMES := {
|
||||
LootSystem.Category.CROP: "crop",
|
||||
LootSystem.Category.ANIMAL: "animal",
|
||||
LootSystem.Category.SUPPLY: "supply",
|
||||
}
|
||||
|
||||
var enabled := true
|
||||
var plans: Array[NightPlan] = []
|
||||
|
|
@ -105,21 +100,26 @@ func tonight_entries() -> Array:
|
|||
return out
|
||||
|
||||
|
||||
## What a [type, want] pair is called: "Crows", "Fence breakers", "Animal thieves", "Supply
|
||||
## thieves", or "Thieves" (any target).
|
||||
## What a [type, want] pair is called: "Crows", "Alien robots", "Aliens after the crops",
|
||||
## "Aliens after the animals", "Aliens after the supplies", or "Aliens" (any target).
|
||||
static func entry_label(entry: Array) -> String:
|
||||
match int(entry[0]):
|
||||
EnemySystem.TYPE_CROW:
|
||||
return "Crows"
|
||||
EnemySystem.TYPE_BREAKER:
|
||||
return "Fence breakers"
|
||||
if TARGET_NAMES.has(entry[1]):
|
||||
return "%s thieves" % String(TARGET_NAMES[entry[1]]).capitalize()
|
||||
return "Thieves"
|
||||
return "Alien robots"
|
||||
match int(entry[1]):
|
||||
LootSystem.Category.CROP:
|
||||
return "Aliens after the crops"
|
||||
LootSystem.Category.ANIMAL:
|
||||
return "Aliens after the animals"
|
||||
LootSystem.Category.SUPPLY:
|
||||
return "Aliens after the supplies"
|
||||
return "Aliens"
|
||||
|
||||
|
||||
## Tonight's warning as lines for the HUD: "Tonight, from every side: crows, supply thieves and
|
||||
## fence breakers".
|
||||
## Tonight's warning as lines for the HUD: "Tonight, from every side: crows, aliens after the
|
||||
## supplies and alien robots".
|
||||
func tonight_warning() -> PackedStringArray:
|
||||
var labels := PackedStringArray()
|
||||
for e in tonight_entries():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue