Skip to content

Commit

Permalink
Merge pull request #73775 from Procyonae/Backport70772And70775
Browse files Browse the repository at this point in the history
Backport #70772 and #70775
  • Loading branch information
kevingranade committed May 14, 2024
2 parents b27e93c + f0c7af1 commit 83554d2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data/mods/Magiclysm/monsters/feral_fantasy_species.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@
"no_dmg_msg_u": "%1$s's lunges at your %2$s, but its teeth glance off your armor.",
"no_dmg_msg_npc": "%1$s's lunges at <npcname>, but its teeth glance off their armor.",
"miss_msg_u": "%s lunges forward to bite you, but you dodge!",
"miss_msg_npc": "%s lunges foward to bite <npcname>, but they dodge!"
"miss_msg_npc": "%s lunges forward to bite <npcname>, but they dodge!"
}
],
"vision_day": 30,
Expand Down
2 changes: 1 addition & 1 deletion data/mods/MindOverMatter/monsters/feral_lab_psychics.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"miss_msg_u": "%1$s stares at you and you narrowly avoid an unseen attack!",
"miss_msg_npc": "%1$s stares and <npcname> narrowly avoids an unseen attack!",
"no_dmg_msg_u": "%1$s stares at you, but the telekinetic attack rebounds off your armor.",
"no_dmg_msg_npc": "%1$s starss at <npcname>, but the telekinetic attack rebounds off their armor."
"no_dmg_msg_npc": "%1$s stares at <npcname>, but the telekinetic attack rebounds off their armor."
},
{
"id": "smash",
Expand Down
2 changes: 1 addition & 1 deletion data/mods/MindOverMatter/monsters/feral_psychics.json
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@
"miss_msg_u": "%1$s stares at you and you narrowly avoid an unseen attack!",
"miss_msg_npc": "%1$s stares and <npcname> narrowly avoids an unseen attack!",
"no_dmg_msg_u": "%1$s stares at you, but the telekinetic attack rebounds off your armor.",
"no_dmg_msg_npc": "%1$s starss at <npcname>, but the telekinetic attack rebounds off their armor."
"no_dmg_msg_npc": "%1$s stares at <npcname>, but the telekinetic attack rebounds off their armor."
},
{
"id": "smash",
Expand Down
4 changes: 4 additions & 0 deletions lang/string_extractor/parsers/monster.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from ..helper import get_singular_name
from ..write_text import write_text
from .monster_attack import parse_monster_attack


def parse_monster_concrete(json, origin, name):
Expand All @@ -14,6 +15,9 @@ def parse_monster_concrete(json, origin, name):

if "special_attacks" in json:
for attack in json["special_attacks"]:
if "type" in attack and attack["type"] == "monster_attack":
parse_monster_attack(attack, origin)
continue
if "description" in attack:
write_text(attack["description"], origin,
comment="Description of special attack of monster "
Expand Down
16 changes: 13 additions & 3 deletions lang/string_extractor/parsers/monster_attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@


def parse_monster_attack(json, origin):
for key in ["hit_dmg_u", "hit_dmg_npc", "miss_msg_u", "miss_msg_npc",
"no_dmg_msg_u", "no_dmg_msg_npc"]:
for key in [
"hit_dmg_u",
"hit_dmg_npc",
"miss_msg_u",
"miss_msg_npc",
"no_dmg_msg_u",
"no_dmg_msg_npc",
]:
if key in json:
write_text(json[key], origin, comment="Monster attack message")
write_text(
json[key],
origin,
comment='Monster attack "{}" message'.format(json["id"]),
)

0 comments on commit 83554d2

Please sign in to comment.