Skip to content

Commit

Permalink
Extract special vision descriptions for translation (#79108)
Browse files Browse the repository at this point in the history
* Extract special vision descriptions for translation

* Add includes

* Add origin arguments

* Attempt to appease flake8

* Missed iterating an array

* Fix typo

* Our flake8 makes me want to commit war crimes
  • Loading branch information
Procyonae authored Jan 13, 2025
1 parent ce8b6ef commit 2772dff
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion data/mods/MindOverMatter/items/armor/belt.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
{
"has": "WORN",
"condition": "ACTIVE",
"name": "Active Suppresion Belt",
"name": "Active Suppression Belt",
"description": "The air around you feels cool.",
"incoming_damage_mod": [ { "type": "heat", "multiply": -1 } ],
"values": [ { "value": "CLIMATE_CONTROL_CHILL", "add": 1000 } ],
Expand Down
5 changes: 5 additions & 0 deletions lang/string_extractor/parsers/bionic.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .enchant import parse_enchant
from ..helper import get_singular_name
from ..write_text import write_text

Expand All @@ -11,3 +12,7 @@ def parse_bionic(json, origin):
if "description" in json:
write_text(json["description"], origin, c_format=False,
comment="Description of bionic \"{}\"".format(name))

if "enchantments" in json:
for enchantment in json["enchantments"]:
parse_enchant(enchantment, origin)
5 changes: 5 additions & 0 deletions lang/string_extractor/parsers/effect_type.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .enchant import parse_enchant
from ..helper import get_singular_name
from ..write_text import write_text

Expand Down Expand Up @@ -101,3 +102,7 @@ def parse_effect_type(json, origin):
write_text(json["blood_analysis_description"], origin,
comment="Blood analysis description of effect type \"{}\""
.format(effect_name))

if "enchantments" in json:
for enchantment in json["enchantments"]:
parse_enchant(enchantment, origin)
14 changes: 14 additions & 0 deletions lang/string_extractor/parsers/enchant.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,17 @@ def parse_enchant(json, origin):

if "hit_me_effect" in json:
parse_effect(json["hit_me_effect"], origin)

if "special_vision" in json:
for vision in json["special_vision"]:
if "descriptions" in vision:
for description in vision["descriptions"]:
parse_description(description, origin)


def parse_description(description, origin):
if "text" in description:
special_vision_id = description["id"]
write_text(description["text"], origin,
comment="Description of creature revealed by special "
"vision \"{}\"".format(special_vision_id))
5 changes: 5 additions & 0 deletions lang/string_extractor/parsers/generic.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .enchant import parse_enchant
from ..helper import get_singular_name
from .use_action import parse_use_action
from ..write_text import write_text
Expand Down Expand Up @@ -70,3 +71,7 @@ def parse_generic(json, origin):
write_text(pocket["name"], origin,
comment="Brief name of a pocket in item \"{}\""
.format(name))

if "relic_data" in json and "passive_effects" in json["relic_data"]:
for enchantment in json["relic_data"]["passive_effects"]:
parse_enchant(enchantment, origin)
5 changes: 5 additions & 0 deletions lang/string_extractor/parsers/mutation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .enchant import parse_enchant
from ..helper import get_singular_name
from ..write_text import write_text

Expand Down Expand Up @@ -65,3 +66,7 @@ def parse_mutation(json, origin):
comment="Message when transforming from mutation "
" \"{}\" to \"{}\""
.format(name, json["transform"]["target"]))

if "enchantments" in json:
for enchantment in json["enchantments"]:
parse_enchant(enchantment, origin)

0 comments on commit 2772dff

Please sign in to comment.