Skip to content

Commit 140271f

Browse files
committed
eoc: use typed variables in run_eocs
1 parent f57a190 commit 140271f

36 files changed

+395
-298
lines changed

data/json/effects_on_condition/example_eocs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"names": [ "name_1", "name_2", "<context_val:name>", "should_fail" ],
1212
"keys": [ "a", "b", "c", "d" ],
1313
"descriptions": [ "option 1", "option 2", "<context_val:description>", "should not be available" ],
14-
"variables": [ { "val": "8" } ],
14+
"variables": [ { "val": 8 } ],
1515
"title": "<context_val:title>",
1616
"allow_cancel": true
1717
}
@@ -47,7 +47,7 @@
4747
"names": [ "name_1", "name_2", "name_3", "should_fail" ],
4848
"keys": [ "a", "b", "c", "d" ],
4949
"descriptions": [ "option 1", "option 2", "option 3", "should not be available" ],
50-
"variables": [ { "val": "8" } ],
50+
"variables": [ { "val": 8 } ],
5151
"hide_failing": true
5252
}
5353
]

data/json/effects_on_condition/mutation_eocs/mutation_activation_eocs.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
{
3838
"run_eocs": "EOC_GENERIC_SPELL_MUTATION",
3939
"variables": {
40-
"prep_time": "3",
40+
"prep_time": 3,
4141
"spell_to_cast": "spell_spit_flare",
4242
"message_success": { "i18n": true, "str": "You launch a glob of bioluminescent material!" },
4343
"message_fail": { "i18n": true, "str": "Your body is too starved to activate your bioluminescent flare." }
@@ -52,7 +52,7 @@
5252
{
5353
"run_eocs": "EOC_GENERIC_SPELL_MUTATION",
5454
"variables": {
55-
"prep_time": "1",
55+
"prep_time": 1,
5656
"spell_to_cast": "spell_slime_spray",
5757
"message_success": { "i18n": true, "str": "You spit out some goo onto your enemies!" },
5858
"message_fail": { "i18n": true, "str": "Your body is too starved to activate your slime spray." }
@@ -67,8 +67,8 @@
6767
{
6868
"run_eocs": "EOC_GENERIC_SPELL_MUTATION",
6969
"variables": {
70-
"energy_amount": "2000",
71-
"prep_time": "1",
70+
"energy_amount": 2000,
71+
"prep_time": 1,
7272
"spell_to_cast": "spell_feline_leap",
7373
"message_success": {
7474
"i18n": true,
@@ -86,8 +86,8 @@
8686
{
8787
"run_eocs": "EOC_GENERIC_SPELL_MUTATION",
8888
"variables": {
89-
"energy_amount": "2000",
90-
"prep_time": "2",
89+
"energy_amount": 2000,
90+
"prep_time": 2,
9191
"spell_to_cast": "spell_short_leap",
9292
"message_success": {
9393
"i18n": true,
@@ -105,8 +105,8 @@
105105
{
106106
"run_eocs": "EOC_GENERIC_SPELL_MUTATION",
107107
"variables": {
108-
"energy_amount": "6000",
109-
"prep_time": "3",
108+
"energy_amount": 6000,
109+
"prep_time": 3,
110110
"spell_to_cast": "spell_crushing_leap",
111111
"message_success": { "i18n": true, "str": "You squat down, build up tension in your legs and release. Death from above." },
112112
"message_fail": { "i18n": true, "str": "Your legs are too tired to perform a jump." }
@@ -121,8 +121,8 @@
121121
{
122122
"run_eocs": "EOC_GENERIC_SPELL_MUTATION",
123123
"variables": {
124-
"energy_amount": "2500",
125-
"prep_time": "1",
124+
"energy_amount": 2500,
125+
"prep_time": 1,
126126
"spell_to_cast": "spell_avian_leap",
127127
"message_success": {
128128
"i18n": true,

data/json/encounters/randec_independent_travelers.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"omt": "roadstop_a",
1313
"map_update": "nest_RandEnc_campervan_traveler_add",
1414
"map_removal": "nest_RandEnc_campervan_traveler_remove",
15-
"chance": "10",
16-
"days_till_spawn": "7"
15+
"chance": 10,
16+
"days_till_spawn": 7
1717
}
1818
}
1919
]

data/json/encounters/randenc_caravans.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"omt": "roadstop_a",
1313
"map_update": "nest_RandEnc_roadstop_a_add",
1414
"map_removal": "nest_RandEnc_roadstop_a_remove",
15-
"chance": "10",
16-
"days_till_spawn": "7"
15+
"chance": 10,
16+
"days_till_spawn": 7
1717
}
1818
}
1919
]
@@ -62,8 +62,8 @@
6262
"omt": "roadstop_a",
6363
"map_update": "nest_RandEnc_roadstop_a_refugee_add",
6464
"map_removal": "nest_RandEnc_roadstop_a_refugee_remove",
65-
"chance": "10",
66-
"days_till_spawn": "7"
65+
"chance": 10,
66+
"days_till_spawn": 7
6767
}
6868
}
6969
]

data/json/items/chemicals_and_resources.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@
12541254
"volume": "2 ml",
12551255
"flags": [ "NO_INGEST", "WATER_DISSOLVE" ],
12561256
"//6": "The ratio of how much water can be purified per tablet (maximum). Should match the water_purifying recipe",
1257-
"variables": { "water_per_tablet": "4" }
1257+
"variables": { "water_per_tablet": 4 }
12581258
},
12591259
{
12601260
"type": "ITEM",

data/json/items/comestibles/med.json

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@
574574
"id": "EOC_myopia_contacts_weekly",
575575
"effect": {
576576
"run_eocs": "EOC_CONTACTS",
577-
"variables": { "flag1": "MYOPIC", "flag2": "MYOPIC_IN_LIGHT", "effect": "contacts", "time": "604800" }
577+
"variables": { "flag1": "MYOPIC", "flag2": "MYOPIC_IN_LIGHT", "effect": "contacts", "time": 604800 }
578578
}
579579
}
580580
]
@@ -602,7 +602,7 @@
602602
"id": "EOC_myopia_transition_contacts_weekly",
603603
"effect": {
604604
"run_eocs": "EOC_CONTACTS",
605-
"variables": { "flag1": "MYOPIC", "flag2": "MYOPIC_IN_LIGHT", "effect": "transition_contacts", "time": "604800" }
605+
"variables": { "flag1": "MYOPIC", "flag2": "MYOPIC_IN_LIGHT", "effect": "transition_contacts", "time": 604800 }
606606
}
607607
}
608608
]
@@ -628,7 +628,7 @@
628628
"id": "EOC_myopia_contacts_daily",
629629
"effect": {
630630
"run_eocs": "EOC_CONTACTS",
631-
"variables": { "flag1": "MYOPIC", "flag2": "MYOPIC_IN_LIGHT", "effect": "contacts", "time": "57600" }
631+
"variables": { "flag1": "MYOPIC", "flag2": "MYOPIC_IN_LIGHT", "effect": "contacts", "time": 57600 }
632632
}
633633
}
634634
]
@@ -654,7 +654,7 @@
654654
"id": "EOC_myopia_transition_contacts_daily",
655655
"effect": {
656656
"run_eocs": "EOC_CONTACTS",
657-
"variables": { "flag1": "MYOPIC", "flag2": "MYOPIC_IN_LIGHT", "effect": "transition_contacts", "time": "57600" }
657+
"variables": { "flag1": "MYOPIC", "flag2": "MYOPIC_IN_LIGHT", "effect": "transition_contacts", "time": 57600 }
658658
}
659659
}
660660
]
@@ -678,7 +678,7 @@
678678
"effect_on_conditions": [
679679
{
680680
"id": "EOC_hyperopia_contacts_weekly",
681-
"effect": { "run_eocs": "EOC_CONTACTS", "variables": { "flag1": "HYPEROPIC", "effect": "contacts", "time": "604800" } }
681+
"effect": { "run_eocs": "EOC_CONTACTS", "variables": { "flag1": "HYPEROPIC", "effect": "contacts", "time": 604800 } }
682682
}
683683
]
684684
}
@@ -701,7 +701,7 @@
701701
"effect_on_conditions": [
702702
{
703703
"id": "EOC_hyperopia_transition_contacts_weekly",
704-
"effect": { "run_eocs": "EOC_CONTACTS", "variables": { "flag1": "HYPEROPIC", "effect": "transition_contacts", "time": "604800" } }
704+
"effect": { "run_eocs": "EOC_CONTACTS", "variables": { "flag1": "HYPEROPIC", "effect": "transition_contacts", "time": 604800 } }
705705
}
706706
]
707707
}
@@ -724,7 +724,7 @@
724724
"effect_on_conditions": [
725725
{
726726
"id": "EOC_hyperopia_contacts_daily",
727-
"effect": { "run_eocs": "EOC_CONTACTS", "variables": { "flag1": "HYPEROPIC", "effect": "contacts", "time": "57600" } }
727+
"effect": { "run_eocs": "EOC_CONTACTS", "variables": { "flag1": "HYPEROPIC", "effect": "contacts", "time": 57600 } }
728728
}
729729
]
730730
}
@@ -747,7 +747,7 @@
747747
"effect_on_conditions": [
748748
{
749749
"id": "EOC_hyperopia_transition_contacts_daily",
750-
"effect": { "run_eocs": "EOC_CONTACTS", "variables": { "flag1": "HYPEROPIC", "effect": "transition_contacts", "time": "57600" } }
750+
"effect": { "run_eocs": "EOC_CONTACTS", "variables": { "flag1": "HYPEROPIC", "effect": "transition_contacts", "time": 57600 } }
751751
}
752752
]
753753
}
@@ -772,7 +772,7 @@
772772
"id": "EOC_bifocal_contacts_weekly",
773773
"effect": {
774774
"run_eocs": "EOC_CONTACTS",
775-
"variables": { "flag1": "MYOPIC", "flag2": "MYOPIC_IN_LIGHT", "flag3": "HYPEROPIC", "effect": "contacts", "time": "604800" }
775+
"variables": { "flag1": "MYOPIC", "flag2": "MYOPIC_IN_LIGHT", "flag3": "HYPEROPIC", "effect": "contacts", "time": 604800 }
776776
}
777777
}
778778
]
@@ -798,13 +798,7 @@
798798
"id": "EOC_bifocal_transition_contacts_weekly",
799799
"effect": {
800800
"run_eocs": "EOC_CONTACTS",
801-
"variables": {
802-
"flag1": "MYOPIC",
803-
"flag2": "MYOPIC_IN_LIGHT",
804-
"flag3": "HYPEROPIC",
805-
"effect": "transition_contacts",
806-
"time": "604800"
807-
}
801+
"variables": { "flag1": "MYOPIC", "flag2": "MYOPIC_IN_LIGHT", "flag3": "HYPEROPIC", "effect": "transition_contacts", "time": 604800 }
808802
}
809803
}
810804
]
@@ -830,7 +824,7 @@
830824
"id": "EOC_bifocal_contacts_daily",
831825
"effect": {
832826
"run_eocs": "EOC_CONTACTS",
833-
"variables": { "flag1": "MYOPIC", "flag2": "MYOPIC_IN_LIGHT", "flag3": "HYPEROPIC", "effect": "contacts", "time": "57600" }
827+
"variables": { "flag1": "MYOPIC", "flag2": "MYOPIC_IN_LIGHT", "flag3": "HYPEROPIC", "effect": "contacts", "time": 57600 }
834828
}
835829
}
836830
]
@@ -856,13 +850,7 @@
856850
"id": "EOC_bifocal_transition_contacts_daily",
857851
"effect": {
858852
"run_eocs": "EOC_CONTACTS",
859-
"variables": {
860-
"flag1": "MYOPIC",
861-
"flag2": "MYOPIC_IN_LIGHT",
862-
"flag3": "HYPEROPIC",
863-
"effect": "transition_contacts",
864-
"time": "57600"
865-
}
853+
"variables": { "flag1": "MYOPIC", "flag2": "MYOPIC_IN_LIGHT", "flag3": "HYPEROPIC", "effect": "transition_contacts", "time": 57600 }
866854
}
867855
}
868856
]
@@ -886,7 +874,7 @@
886874
"effect_on_conditions": [
887875
{
888876
"id": "EOC_plano_transition_contacts_weekly",
889-
"effect": { "run_eocs": "EOC_CONTACTS", "variables": { "effect": "transition_contacts_plano", "plano": "1", "time": "604800" } }
877+
"effect": { "run_eocs": "EOC_CONTACTS", "variables": { "effect": "transition_contacts_plano", "plano": 1, "time": 604800 } }
890878
}
891879
]
892880
}
@@ -909,7 +897,7 @@
909897
"effect_on_conditions": [
910898
{
911899
"id": "EOC_plano_transition_contacts_daily",
912-
"effect": { "run_eocs": "EOC_CONTACTS", "variables": { "plano": "1", "effect": "transition_contacts_plano", "time": "57600" } }
900+
"effect": { "run_eocs": "EOC_CONTACTS", "variables": { "plano": 1, "effect": "transition_contacts_plano", "time": 57600 } }
913901
}
914902
]
915903
}

data/json/items/tool/cooking.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@
9696
"effect": {
9797
"run_eocs": "EOC_toolweapon_activate",
9898
"variables": {
99-
"turn_cost": "0.8",
99+
"turn_cost": 0.8,
100100
"transform_target": "carver_on",
101101
"success_message": { "i18n": true, "str": "The electric carver's serrated blades start buzzing!" },
102-
"volume": "20",
102+
"volume": 20,
103103
"failure_message": { "i18n": true, "str": "You pull the trigger, but nothing happens." }
104104
}
105105
}
@@ -145,9 +145,9 @@
145145
"effect": {
146146
"run_eocs": "EOC_toolweapon_running",
147147
"variables": {
148-
"sound_chance": "10",
148+
"sound_chance": 10,
149149
"sound_message": { "i18n": true, "str": "Your electric carver buzzes." },
150-
"volume": "8",
150+
"volume": 8,
151151
"revert_to": "carver_off"
152152
}
153153
}

data/json/items/tool/electronics.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,9 +1218,9 @@
12181218
"effect": {
12191219
"run_eocs": "EOC_toolweapon_running",
12201220
"variables": {
1221-
"sound_chance": "0",
1221+
"sound_chance": 0,
12221222
"sound_message": { "i18n": true, "str": "Your super noise emitter produces an unholy blast of sonic chaos." },
1223-
"volume": "300",
1223+
"volume": 300,
12241224
"revert_to": "noise_emitter_super"
12251225
}
12261226
}

data/json/items/tool/landscaping.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,10 @@
375375
"effect": {
376376
"run_eocs": "EOC_toolweapon_activate",
377377
"variables": {
378-
"turn_cost": "0.8",
378+
"turn_cost": 0.8,
379379
"transform_target": "trimmer_on",
380380
"success_message": { "i18n": true, "str": "With a roar, the hedge trimmer leaps to life!" },
381-
"volume": "15",
381+
"volume": 15,
382382
"failure_message": { "i18n": true, "str": "You yank the cord, but nothing happens." }
383383
}
384384
},
@@ -419,9 +419,9 @@
419419
"effect": {
420420
"run_eocs": "EOC_toolweapon_running",
421421
"variables": {
422-
"sound_chance": "15",
422+
"sound_chance": 15,
423423
"sound_message": { "i18n": true, "str": "Your hedge trimmer rumbles." },
424-
"volume": "10",
424+
"volume": 10,
425425
"revert_to": "trimmer_off"
426426
}
427427
}

data/json/items/tool/masonry.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
"effect": {
2828
"run_eocs": "EOC_toolweapon_activate",
2929
"variables": {
30-
"turn_cost": "0.8",
30+
"turn_cost": 0.8,
3131
"transform_target": "masonrysaw_on",
3232
"success_message": { "i18n": true, "str": "With a roar, the <npc_name> screams to life!" },
33-
"volume": "20",
33+
"volume": 20,
3434
"failure_message": { "i18n": true, "str": "You yank the cord, but nothing happens." }
3535
}
3636
},
@@ -74,9 +74,9 @@
7474
"effect": {
7575
"run_eocs": "EOC_toolweapon_running",
7676
"variables": {
77-
"sound_chance": "15",
77+
"sound_chance": 15,
7878
"sound_message": { "i18n": true, "str": "Your masonry saw buzzes." },
79-
"volume": "7",
79+
"volume": 7,
8080
"revert_to": "masonrysaw_off"
8181
}
8282
}
@@ -162,9 +162,9 @@
162162
"effect": {
163163
"run_eocs": "EOC_toolweapon_running",
164164
"variables": {
165-
"sound_chance": "15",
165+
"sound_chance": 15,
166166
"sound_message": { "i18n": true, "str": "Your electric masonry saw buzzes." },
167-
"volume": "7",
167+
"volume": 7,
168168
"revert_to": "electric_masonrysaw_off"
169169
}
170170
}

0 commit comments

Comments
 (0)