Skip to content

Commit d0b8e27

Browse files
authored
Merge pull request #82409 from Procyonae/AugmentedAssignmentOperatorsSingleString
Make existing math "augmented" assignment operators single string
2 parents cd5d93b + 2f925af commit d0b8e27

File tree

207 files changed

+1364
-1472
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+1364
-1472
lines changed

data/json/effects_on_condition/addictions_eocs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
]
9999
},
100100
"then": [
101-
{ "math": [ "u_val('focus')", "-=", "u_addiction_intensity('mutagen')" ] },
101+
{ "math": [ "u_val('focus') -= u_addiction_intensity('mutagen')" ] },
102102
{
103103
"u_message": "You daydream what it'd be like if you were *different*. Different is good.",
104104
"type": "warning"

data/json/effects_on_condition/bionic_active_eocs.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"type": "effect_on_condition",
44
"id": "refund_power",
5-
"effect": { "math": [ "u_val('power')", "+=", "_act_cost" ] }
5+
"effect": { "math": [ "u_val('power') += _act_cost" ] }
66
},
77
{
88
"type": "effect_on_condition",
@@ -28,11 +28,11 @@
2828
"if": { "one_in_chance": 3 },
2929
"then": [
3030
{ "u_message": "Your muscles tear with the strain!", "type": "good" },
31-
{ "math": [ "u_hp('arm_l')", "-=", "rng(5, 10)" ] },
32-
{ "math": [ "u_hp('arm_r')", "-=", "rng(5, 10)" ] },
33-
{ "math": [ "u_hp('leg_l')", "-=", "rng(7, 12)" ] },
34-
{ "math": [ "u_hp('leg_r')", "-=", "rng(7, 12)" ] },
35-
{ "math": [ "u_hp('torso')", "-=", "rng(5, 15)" ] }
31+
{ "math": [ "u_hp('arm_l') -= rng(5, 10)" ] },
32+
{ "math": [ "u_hp('arm_r') -= rng(5, 10)" ] },
33+
{ "math": [ "u_hp('leg_l') -= rng(7, 12)" ] },
34+
{ "math": [ "u_hp('leg_r') -= rng(7, 12)" ] },
35+
{ "math": [ "u_hp('torso') -= rng(5, 15)" ] }
3636
]
3737
},
3838
{

data/json/effects_on_condition/bionic_eocs.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"effect": [
99
{ "u_message": "Your batteries discharge slightly.", "type": "bad" },
1010
{ "sound_effect": "elec_crackle_low", "id": "bionics", "volume": 100 },
11-
{ "math": [ "u_val('power')", "-=", "energy('25 kJ')" ] }
11+
{ "math": [ "u_val('power') -= energy('25 kJ')" ] }
1212
]
1313
},
1414
{
@@ -57,7 +57,7 @@
5757
{ "u_message": "Your bionics short-circuit, causing you to tremble and shiver.", "type": "bad" },
5858
{ "sound_effect": "elec_crackle_med", "id": "bionics", "volume": 100 },
5959
{ "u_add_effect": "shakes", "duration": "5 minutes" },
60-
{ "math": [ "u_val('power')", "-=", "energy('25 kJ')" ] }
60+
{ "math": [ "u_val('power') -= energy('25 kJ')" ] }
6161
]
6262
},
6363
{
@@ -75,7 +75,7 @@
7575
"effect": [
7676
{ "u_message": "Your malfunctioning bionic starts to glow!", "type": "bad" },
7777
{ "u_add_effect": "glowy_led", "duration": "5 minutes" },
78-
{ "math": [ "u_val('power')", "-=", "energy('1 kJ')" ] }
78+
{ "math": [ "u_val('power') -= energy('1 kJ')" ] }
7979
]
8080
},
8181
{

data/json/effects_on_condition/effects_eocs.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,17 @@
118118
{ "u_set_field": "fd_blood", "radius": 1, "intensity": 3 },
119119
{ "turn_cost": "6 seconds" },
120120
{ "math": [ "HOW_MUCH_WILL_THIS_SUCK = rng(21, 30)" ] },
121-
{ "math": [ "u_vitamin('blood')", "-=", "HOW_MUCH_WILL_THIS_SUCK * 100" ] },
122-
{ "math": [ "u_vitamin('redcells')", "-=", "HOW_MUCH_WILL_THIS_SUCK * 100" ] },
121+
{ "math": [ "u_vitamin('blood') -= HOW_MUCH_WILL_THIS_SUCK * 100" ] },
122+
{ "math": [ "u_vitamin('redcells') -= HOW_MUCH_WILL_THIS_SUCK * 100" ] },
123123
{
124124
"u_add_effect": "bleed",
125125
"target_part": { "global_val": "IMPREGNATED_BODYPART" },
126126
"duration": { "math": [ "HOW_MUCH_WILL_THIS_SUCK * 60" ] }
127127
},
128-
{ "math": [ "u_pain('type': 'perceived')", "+=", "HOW_MUCH_WILL_THIS_SUCK * 2" ] },
129-
{ "math": [ "u_hp(IMPREGNATED_BODYPART)", "-=", "HOW_MUCH_WILL_THIS_SUCK * 2" ] }
128+
{ "math": [ "u_pain('type': 'perceived') += HOW_MUCH_WILL_THIS_SUCK * 2" ] },
129+
{ "math": [ "u_hp(IMPREGNATED_BODYPART) -= HOW_MUCH_WILL_THIS_SUCK * 2" ] }
130130
],
131-
"else": { "math": [ "u_vitamin('mutant_toxin')", "+=", "u_vitamin('dermatik_larva_size') / 3" ] }
131+
"else": { "math": [ "u_vitamin('mutant_toxin') += u_vitamin('dermatik_larva_size') / 3" ] }
132132
},
133133
{ "u_lose_effect": "dermatik_visible" },
134134
{ "math": [ "u_vitamin('dermatik_larva_size') = 0" ] }

data/json/effects_on_condition/example_eocs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
{ "u_message": "[Skill experience test]" },
9898
{ "math": [ "u_skill_test = u_skill_exp('swimming')" ] },
9999
{ "u_message": "Swimming skill experience before: <u_val:skill_test>" },
100-
{ "math": [ "u_skill_exp('swimming')", "+=", "10" ] },
100+
{ "math": [ "u_skill_exp('swimming') += 10" ] },
101101
{ "math": [ "u_skill_test = u_skill_exp('swimming')" ] },
102102
{ "u_message": "Swimming skill experience after: <u_val:skill_test>" },
103103
{ "u_message": "[Weight and volume test]" },

data/json/effects_on_condition/medicine_eocs/regen_serum_eoc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"//": "todo: move message to snippet?",
3232
"effect": [
3333
{ "u_message": "You feel an immense pain, when something within your bloodstream moves eerily.", "type": "bad" },
34-
{ "math": [ "u_pain('type': 'perceived')", "+=", "rng(15, 55)" ] },
34+
{ "math": [ "u_pain('type': 'perceived') += rng(15, 55)" ] },
3535
{ "run_eocs": "EOC_REGEN_SERUM_PAIN_SPIKE", "time_in_future": [ "1 h", "6 h" ] }
3636
]
3737
},

data/json/effects_on_condition/medicine_eocs/saline_infusion_eocs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
"id": "SALINE_INFUSION_eff",
2626
"//": "4 ml of saline per 1 ml of blood, rate 2L/hour. 1 ml of blood = 10 units of vitamin",
2727
"//2": "because of do_turn_eoc, effect has some precision loss when calculates the amount of blood compensated, in favor of the player",
28-
"effect": [ { "math": [ "u_vitamin('blood')", "+=", "(u_amount_of_saline_infused * ( 10 / 4 )) / 3600" ] } ]
28+
"effect": [ { "math": [ "u_vitamin('blood') += (u_amount_of_saline_infused * ( 10 / 4 )) / 3600" ] } ]
2929
}
3030
]

data/json/effects_on_condition/misc_effect_on_condition.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
{
33
"type": "effect_on_condition",
44
"id": "EOC_SLEEP",
5-
"effect": [ { "u_message": "You feel very sleepy…" }, { "math": [ "u_val('sleepiness')", "+=", "40" ] } ]
5+
"effect": [ { "u_message": "You feel very sleepy…" }, { "math": [ "u_val('sleepiness') += 40" ] } ]
66
},
77
{
88
"type": "effect_on_condition",
99
"id": "EOC_MINOR_SLEEP",
10-
"effect": [ { "u_message": "You feel sleepy…" }, { "math": [ "u_val('sleepiness')", "+=", "20" ] } ]
10+
"effect": [ { "u_message": "You feel sleepy…" }, { "math": [ "u_val('sleepiness') += 20" ] } ]
1111
},
1212
{
1313
"type": "effect_on_condition",
@@ -284,7 +284,7 @@
284284
"u_effect_duration('bile_irritant') > 0 ? u_effect_duration('bile_irritant') + 120 + rand(90) : 240 + rand(180)"
285285
]
286286
},
287-
{ "math": [ "MORALE_MULTIPLIER", "*=", "u_has_trait('SQUEAMISH') ? 4 : 2" ] },
287+
{ "math": [ "MORALE_MULTIPLIER *= u_has_trait('SQUEAMISH') ? 4 : 2" ] },
288288
{ "u_add_effect": "bile_irritant", "duration": { "global_val": "BILE_IRRITANT_DURATION" } }
289289
]
290290
},

data/json/effects_on_condition/mutation_eocs/changing_eocs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
"effect": [
5151
{ "u_message": "You feel a deep, churning sensation fill your body.", "type": "mixed" },
5252
{ "u_mutate": 0 },
53-
{ "math": [ "u_vitamin('mutagen')", "-=", "60" ] },
54-
{ "math": [ "u_vitamin('mutagen')", "-=", "rand(80)" ] }
53+
{ "math": [ "u_vitamin('mutagen') -= 60" ] },
54+
{ "math": [ "u_vitamin('mutagen') -= rand(80)" ] }
5555
],
5656
"false_effect": [ { "run_eocs": [ "changing_reqs_not_met" ] } ]
5757
}

data/json/effects_on_condition/mutation_eocs/mutation_activation_eocs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"effect": [
1717
{ "turn_cost": { "context_val": "prep_time" } },
18-
{ "math": [ "u_val('stamina')", "-=", "_energy_amount" ] },
18+
{ "math": [ "u_val('stamina') -= _energy_amount" ] },
1919
{ "run_eocs": [ "EOC_GENERIC_SPELL_MUTATION_ACT" ] }
2020
],
2121
"false_effect": [ { "u_message": { "context_val": "message_fail" }, "type": "bad" } ]

0 commit comments

Comments
 (0)