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
|
|
@ -5,7 +5,7 @@
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_plan")
|
script = ExtResource("1_plan")
|
||||||
title = "Crows at the crops"
|
title = "Crows at the crops"
|
||||||
dusk_hint = "The crows are coming for the crops....."
|
dusk_hint = "The crows are coming for the crops..... something in the sky is steering them."
|
||||||
count_scale = 1.0
|
count_scale = 1.0
|
||||||
spacing_scale = 1.0
|
spacing_scale = 1.0
|
||||||
groups = Array[Dictionary]([{
|
groups = Array[Dictionary]([{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_plan")
|
script = ExtResource("1_plan")
|
||||||
title = "Thieves in the yard"
|
title = "Aliens in the yard"
|
||||||
dusk_hint = "The Crows are coming again...... and what are those things?!"
|
dusk_hint = "The Crows are coming again...... and what are those things?!"
|
||||||
groups = Array[Dictionary]([{
|
groups = Array[Dictionary]([{
|
||||||
"count": 3,
|
"count": 3,
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_plan")
|
script = ExtResource("1_plan")
|
||||||
title = "Breakers at the fences"
|
title = "Alien robots at the fences"
|
||||||
dusk_hint = "You guessed it. Crows. Thieves. And.... Oh no..."
|
dusk_hint = "You guessed it. Crows. Aliens. And.... Oh no..."
|
||||||
groups = Array[Dictionary]([{
|
groups = Array[Dictionary]([{
|
||||||
"count": 1,
|
"count": 1,
|
||||||
"every": 2.0,
|
"every": 2.0,
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_plan")
|
script = ExtResource("1_plan")
|
||||||
title = "Fence breakers only"
|
title = "Alien robots only"
|
||||||
groups = Array[Dictionary]([{
|
groups = Array[Dictionary]([{
|
||||||
"count": 1,
|
"count": 1,
|
||||||
"every": 2.0,
|
"every": 2.0,
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_plan")
|
script = ExtResource("1_plan")
|
||||||
title = "Crows and thieves"
|
title = "Crows and aliens"
|
||||||
groups = Array[Dictionary]([{
|
groups = Array[Dictionary]([{
|
||||||
"count": 3,
|
"count": 3,
|
||||||
"every": 1.5,
|
"every": 1.5,
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_plan")
|
script = ExtResource("1_plan")
|
||||||
title = "Ground thieves only"
|
title = "Ground aliens only"
|
||||||
groups = Array[Dictionary]([{
|
groups = Array[Dictionary]([{
|
||||||
"count": 2,
|
"count": 2,
|
||||||
"every": 3.0,
|
"every": 3.0,
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_plan")
|
script = ExtResource("1_plan")
|
||||||
title = "Thieves behind a fence breaker"
|
title = "Aliens behind an alien robot"
|
||||||
groups = Array[Dictionary]([{
|
groups = Array[Dictionary]([{
|
||||||
"count": 1,
|
"count": 1,
|
||||||
"every": 2.0,
|
"every": 2.0,
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ func show_assessment() -> void:
|
||||||
"animals":
|
"animals":
|
||||||
(row[1] as Label).text = "%d%% (%d of %d)" % [pct, s.animals, s.animals_total]
|
(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.text = _totals_text(a["totals"], true)
|
||||||
_stats.visible = true
|
_stats.visible = true
|
||||||
_retry.visible = false
|
_retry.visible = false
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,10 @@ const TYPE_BREAKER := 2
|
||||||
## GameConfig.enemy_types keys, by type id.
|
## GameConfig.enemy_types keys, by type id.
|
||||||
const TYPE_NAMES: Array[String] = ["thief", "crow", "breaker"]
|
const TYPE_NAMES: Array[String] = ["thief", "crow", "breaker"]
|
||||||
## Display names, singular and plural.
|
## Display names, singular and plural.
|
||||||
const NAMES: Array[String] = ["thief", "crow", "fence breaker"]
|
const NAMES: Array[String] = ["alien", "crow", "alien robot"]
|
||||||
const PLURALS: Array[String] = ["thieves", "crows", "fence breakers"]
|
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_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]
|
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:
|
EnemySystem.TYPE_CROW:
|
||||||
return "A crow flew in" + from
|
return "A crow flew in" + from
|
||||||
EnemySystem.TYPE_BREAKER:
|
EnemySystem.TYPE_BREAKER:
|
||||||
return "A fence breaker came in" + from
|
return "An alien robot came in" + from
|
||||||
return "A thief slipped in" + from
|
return "An alien slipped in" + from
|
||||||
|
|
||||||
|
|
||||||
func _on_phase_changed(phase: CampaignController.Phase, _previous: CampaignController.Phase) -> void:
|
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:
|
CampaignController.Phase.DAWN:
|
||||||
behavior.retreat_all(enemies)
|
behavior.retreat_all(enemies)
|
||||||
if enemies.alive_count() > 0 and toasts != null:
|
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:
|
CampaignController.Phase.MORNING:
|
||||||
if partner == null and not replica:
|
if partner == null and not replica:
|
||||||
campaign.state.coop = false # a co-op save continued alone: solo rules
|
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
|
_sub.text = "Night · sunrise in %s" % left
|
||||||
hint = on_the_farm(enemies)
|
hint = on_the_farm(enemies)
|
||||||
CampaignController.Phase.DAWN:
|
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:
|
CampaignController.Phase.FARMERS_RETURN:
|
||||||
_sub.text = "The farmers are back"
|
_sub.text = "The farmers are back"
|
||||||
CampaignController.Phase.GAME_OVER:
|
CampaignController.Phase.GAME_OVER:
|
||||||
|
|
@ -137,7 +137,7 @@ func _on_phase_changed(phase: CampaignController.Phase, _previous: CampaignContr
|
||||||
CampaignController.Phase.DAY:
|
CampaignController.Phase.DAY:
|
||||||
text = "Day %d: gather and build" % s.night
|
text = "Day %d: gather and build" % s.night
|
||||||
CampaignController.Phase.DUSK:
|
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:
|
CampaignController.Phase.NIGHT:
|
||||||
text = "Night %d: %s" % [s.night, _tonight_title("")] if _tonight_title("") != "" else "Night %d" % s.night
|
text = "Night %d: %s" % [s.night, _tonight_title("")] if _tonight_title("") != "" else "Night %d" % s.night
|
||||||
CampaignController.Phase.DAWN:
|
CampaignController.Phase.DAWN:
|
||||||
|
|
@ -169,7 +169,7 @@ static func on_the_farm(es: EnemySystem) -> String:
|
||||||
var parts := PackedStringArray()
|
var parts := PackedStringArray()
|
||||||
for t in [EnemySystem.TYPE_CROW, EnemySystem.TYPE_THIEF, EnemySystem.TYPE_BREAKER]:
|
for t in [EnemySystem.TYPE_CROW, EnemySystem.TYPE_THIEF, EnemySystem.TYPE_BREAKER]:
|
||||||
if counts[t] == 1:
|
if counts[t] == 1:
|
||||||
parts.append("a " + EnemySystem.NAMES[t])
|
parts.append(EnemySystem.ARTICLES[t] + " " + EnemySystem.NAMES[t])
|
||||||
elif counts[t] > 1:
|
elif counts[t] > 1:
|
||||||
parts.append("%d %s" % [counts[t], EnemySystem.PLURALS[t]])
|
parts.append("%d %s" % [counts[t], EnemySystem.PLURALS[t]])
|
||||||
if parts.is_empty():
|
if parts.is_empty():
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ func refresh() -> void:
|
||||||
_title.text = "The farmers are away"
|
_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("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("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:
|
else:
|
||||||
var e: Dictionary = s.night_log[s.night_log.size() - 1]
|
var e: Dictionary = s.night_log[s.night_log.size() - 1]
|
||||||
_title.text = "Morning of day %d of %d" % [s.night, nights]
|
_title.text = "Morning of day %d of %d" % [s.night, nights]
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@ const FADE := 0.6
|
||||||
const SLOTS := 5
|
const SLOTS := 5
|
||||||
## Loot events per category (LootSystem.Category): the text ("%s" is the item's noun) and color.
|
## Loot events per category (LootSystem.Category): the text ("%s" is the item's noun) and color.
|
||||||
const MESSAGES := {
|
const MESSAGES := {
|
||||||
&"stolen": [["A crop was snatched!", "A %s was grabbed!", "Thieves took %s from the shed!"], Color(1.0, 0.6, 0.15)],
|
&"stolen": [["A crop was snatched!", "A %s was grabbed!", "Aliens 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!",
|
&"dropped": [["The alien dropped the crop. Grab it!", "The alien dropped the %s. Catch it before it runs off!",
|
||||||
"The thief dropped %s. Grab it!"], Color(1.0, 0.9, 0.3)],
|
"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)],
|
&"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"],
|
&"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)],
|
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.",
|
"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.",
|
"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.",
|
"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.",
|
"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: thieves come at nightfall, from every side of the farm.",
|
"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].",
|
"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.",
|
"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.",
|
"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,
|
"supplies": LootSystem.Category.SUPPLY,
|
||||||
"any": LootSystem.ANY,
|
"any": LootSystem.ANY,
|
||||||
}
|
}
|
||||||
const TARGET_NAMES := {
|
|
||||||
LootSystem.Category.CROP: "crop",
|
|
||||||
LootSystem.Category.ANIMAL: "animal",
|
|
||||||
LootSystem.Category.SUPPLY: "supply",
|
|
||||||
}
|
|
||||||
|
|
||||||
var enabled := true
|
var enabled := true
|
||||||
var plans: Array[NightPlan] = []
|
var plans: Array[NightPlan] = []
|
||||||
|
|
@ -105,21 +100,26 @@ func tonight_entries() -> Array:
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
## What a [type, want] pair is called: "Crows", "Fence breakers", "Animal thieves", "Supply
|
## What a [type, want] pair is called: "Crows", "Alien robots", "Aliens after the crops",
|
||||||
## thieves", or "Thieves" (any target).
|
## "Aliens after the animals", "Aliens after the supplies", or "Aliens" (any target).
|
||||||
static func entry_label(entry: Array) -> String:
|
static func entry_label(entry: Array) -> String:
|
||||||
match int(entry[0]):
|
match int(entry[0]):
|
||||||
EnemySystem.TYPE_CROW:
|
EnemySystem.TYPE_CROW:
|
||||||
return "Crows"
|
return "Crows"
|
||||||
EnemySystem.TYPE_BREAKER:
|
EnemySystem.TYPE_BREAKER:
|
||||||
return "Fence breakers"
|
return "Alien robots"
|
||||||
if TARGET_NAMES.has(entry[1]):
|
match int(entry[1]):
|
||||||
return "%s thieves" % String(TARGET_NAMES[entry[1]]).capitalize()
|
LootSystem.Category.CROP:
|
||||||
return "Thieves"
|
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
|
## Tonight's warning as lines for the HUD: "Tonight, from every side: crows, aliens after the
|
||||||
## fence breakers".
|
## supplies and alien robots".
|
||||||
func tonight_warning() -> PackedStringArray:
|
func tonight_warning() -> PackedStringArray:
|
||||||
var labels := PackedStringArray()
|
var labels := PackedStringArray()
|
||||||
for e in tonight_entries():
|
for e in tonight_entries():
|
||||||
|
|
|
||||||
|
|
@ -352,7 +352,7 @@ func _ending() -> void:
|
||||||
and panel._rating.text.contains("points") and panel._bars.visible and panel._menu.visible and panel._menu.has_focus()
|
and panel._rating.text.contains("points") and panel._bars.visible and panel._menu.visible and panel._menu.has_focus()
|
||||||
and not panel._retry.visible, "then the final assessment ('%s')" % panel._rating.text)
|
and not panel._retry.visible, "then the final assessment ('%s')" % panel._rating.text)
|
||||||
var a := Assessment.of(c.state, cfg)
|
var a := Assessment.of(c.state, cfg)
|
||||||
r.check(panel._rating.text == "%s · %d points" % [a["tier"], a["score"]] and panel._stats.text.contains("Enemies defeated: 40 crows and 8 thieves")
|
r.check(panel._rating.text == "%s · %d points" % [a["tier"], a["score"]] and panel._stats.text.contains("Enemies defeated: 40 crows and 8 aliens")
|
||||||
and panel._stats.text.contains("Gathered 48 wood"), "with the rating, the shares kept, and the vacation's totals")
|
and panel._stats.text.contains("Gathered 48 wood"), "with the rating, the shares kept, and the vacation's totals")
|
||||||
r.info("assessment: %s\n%s\n%s" % [panel._rating.text, panel._detail.text, panel._stats.text])
|
r.info("assessment: %s\n%s\n%s" % [panel._rating.text, panel._detail.text, panel._stats.text])
|
||||||
ending.clear()
|
ending.clear()
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,7 @@ func _assessment(r: GameTestRunner) -> void:
|
||||||
var b := Assessment.of(no_animals, cfg)
|
var b := Assessment.of(no_animals, cfg)
|
||||||
r.check(not (b["parts"] as Dictionary).has("animals") and b["score"] == roundi(100.0 * (0.5 * 0.5 + 0.2) / 0.7),
|
r.check(not (b["parts"] as Dictionary).has("animals") and b["score"] == roundi(100.0 * (0.5 * 0.5 + 0.2) / 0.7),
|
||||||
"categories not in play are left out and the weights renormalized")
|
"categories not in play are left out and the weights renormalized")
|
||||||
r.check(Assessment.enemies_line({"killed_crow": 3, "killed_thief": 1, "killed_breaker": 0}) == "3 crows and 1 thief"
|
r.check(Assessment.enemies_line({"killed_crow": 3, "killed_thief": 1, "killed_breaker": 0}) == "3 crows and 1 alien"
|
||||||
and Assessment.materials_line({"spent_wood": 4, "spent_straw": 2}, "spent_") == "4 wood, 2 straw"
|
and Assessment.materials_line({"spent_wood": 4, "spent_straw": 2}, "spent_") == "4 wood, 2 straw"
|
||||||
and Assessment.materials_line({}, "gathered_") == "nothing", "the totals read as words")
|
and Assessment.materials_line({}, "gathered_") == "nothing", "the totals read as words")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue