Skip to content

Commit

Permalink
Mathifying stuff (CleverRaven#70255)
Browse files Browse the repository at this point in the history
* fix stormshaper spell not working

* Port arithmetic spell level to math spell level

* Port arithmetic vitamins to math vitamins

* Port arithmetic spell exp to math spell exp

* Lint

* Fix vitamins by Andrei8l

Co-authored-by: andrei8l <[email protected]>

* Port arithmetic spellcast adjustment to math spellcast adjustment

* Port arithmetic proficiency to math proficiency

* mathify the rest of vitamins

---------

Co-authored-by: andrei8l <[email protected]>
  • Loading branch information
GuardianDll and andrei8l authored Dec 20, 2023
1 parent a2a8907 commit fecbe9c
Show file tree
Hide file tree
Showing 79 changed files with 2,047 additions and 2,814 deletions.
290 changes: 144 additions & 146 deletions data/json/effects_on_condition/melee_eocs.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
},
{
"text": "Try to gross each other out with tales of mutant butchery.",
"condition": { "math": [ "u_val('proficiency', 'proficiency_id: prof_wp_basic_bug', 'format: percent')", ">=", "50" ] },
"condition": { "math": [ "u_proficiency('prof_wp_basic_bug', 'format': 'percent')", ">=", "50" ] },
"topic": "BEM_CHATTING_VETERANS_TELL_STORY_BUTCHERY"
},
{
Expand Down
4 changes: 2 additions & 2 deletions data/mods/Magiclysm/Spells/biomancer.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
{ "math": [ "u_val('stored_kcal')", "+=", "100000" ] },
{
"queue_eocs": "EOC_GIANT_GROWTH_MUTATION_REMOVE",
"time_in_future": { "math": [ "(( u_val('spell_level', 'spell: biomancer_giant_growth') * 40 ) + 300 )" ] }
"time_in_future": { "math": [ "(( u_spell_level('biomancer_giant_growth') * 40 ) + 300 )" ] }
}
],
"false_effect": [ { "u_message": "You are already enormous--the spell cannot make you any larger!" } ]
Expand Down Expand Up @@ -554,7 +554,7 @@
{ "u_add_trait": "BIO_LASHING_TENTACLES" },
{
"queue_eocs": "EOC_LASHING_TENTACLES_MUTATION_REMOVE",
"time_in_future": { "math": [ "(( u_val('spell_level', 'spell: biomancer_lashing_tentacles') * 15 ) + 70 )" ] }
"time_in_future": { "math": [ "(( u_spell_level('biomancer_lashing_tentacles') * 15 ) + 70 )" ] }
}
],
"false_effect": [ { "u_message": "You are already enormous--the spell cannot make you any larger!" } ]
Expand Down
42 changes: 21 additions & 21 deletions data/mods/Magiclysm/Spells/druid.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@
"effect": "spawn_item",
"effect_str": "druid_quiver",
"shape": "blast",
"min_duration": { "math": [ "( (u_val('spell_level', 'spell: druid_naturebow1') * 24000) + 24000)" ] },
"max_duration": { "math": [ "( (u_val('spell_level', 'spell: druid_naturebow1') * 24000) + 24000)" ] }
"min_duration": { "math": [ "( (u_spell_level('druid_naturebow1') * 24000) + 24000)" ] },
"max_duration": { "math": [ "( (u_spell_level('druid_naturebow1') * 24000) + 24000)" ] }
},
{
"id": "druid_naturearrows1",
Expand All @@ -143,13 +143,13 @@
"description": "This spell conjures magical arrows as part of the nature's bow spell. It's a bug if you have it directly.",
"valid_targets": [ "none" ],
"flags": [ "SILENT" ],
"min_damage": { "math": [ "( (u_val('spell_level', 'spell: druid_naturebow1') * 3) + 15)" ] },
"max_damage": { "math": [ "( (u_val('spell_level', 'spell: druid_naturebow1') * 3) + 15)" ] },
"min_damage": { "math": [ "( (u_spell_level('druid_naturebow1') * 3) + 15)" ] },
"max_damage": { "math": [ "( (u_spell_level('druid_naturebow1') * 3) + 15)" ] },
"effect": "spawn_item",
"effect_str": "druid_naturearrows1",
"shape": "blast",
"min_duration": { "math": [ "( (u_val('spell_level', 'spell: druid_naturebow1') * 24000) + 24000)" ] },
"max_duration": { "math": [ "( (u_val('spell_level', 'spell: druid_naturebow1') * 24000) + 24000)" ] }
"min_duration": { "math": [ "( (u_spell_level('druid_naturebow1') * 24000) + 24000)" ] },
"max_duration": { "math": [ "( (u_spell_level('druid_naturebow1') * 24000) + 24000)" ] }
},
{
"id": "druid_naturebow1_plus",
Expand Down Expand Up @@ -190,8 +190,8 @@
"effect": "spawn_item",
"effect_str": "druid_quiver_plus",
"shape": "blast",
"min_duration": { "math": [ "( (u_val('spell_level', 'spell: druid_naturebow1_plus') * 72000) + 360000)" ] },
"max_duration": { "math": [ "( (u_val('spell_level', 'spell: druid_naturebow1_plus') * 72000) + 360000)" ] }
"min_duration": { "math": [ "( (u_spell_level('druid_naturebow1_plus') * 72000) + 360000)" ] },
"max_duration": { "math": [ "( (u_spell_level('druid_naturebow1_plus') * 72000) + 360000)" ] }
},
{
"id": "druid_naturearrows1_plus",
Expand All @@ -200,13 +200,13 @@
"description": "This spell conjures magical arrows as part of the nature's bow spell. It's a bug if you have it directly.",
"valid_targets": [ "none" ],
"flags": [ "SILENT" ],
"min_damage": { "math": [ "( (u_val('spell_level', 'spell: druid_naturebow1_plus') * 4) + 30)" ] },
"max_damage": { "math": [ "( (u_val('spell_level', 'spell: druid_naturebow1_plus') * 4) + 30)" ] },
"min_damage": { "math": [ "( (u_spell_level('druid_naturebow1_plus') * 4) + 30)" ] },
"max_damage": { "math": [ "( (u_spell_level('druid_naturebow1_plus') * 4) + 30)" ] },
"effect": "spawn_item",
"effect_str": "druid_naturearrows1",
"shape": "blast",
"min_duration": { "math": [ "( (u_val('spell_level', 'spell: druid_naturebow1_plus') * 72000) + 360000)" ] },
"max_duration": { "math": [ "( (u_val('spell_level', 'spell: druid_naturebow1_plus') * 72000) + 360000)" ] }
"min_duration": { "math": [ "( (u_spell_level('druid_naturebow1_plus') * 72000) + 360000)" ] },
"max_duration": { "math": [ "( (u_spell_level('druid_naturebow1_plus') * 72000) + 360000)" ] }
},
{
"id": "recover_fatigue",
Expand Down Expand Up @@ -560,14 +560,14 @@
"effect": [
{
"u_add_effect": "natures_commune",
"duration": { "math": [ "( 300 + (u_val('spell_level', 'spell: druid_natures_commune') * 165)) " ] }
"duration": { "math": [ "( 300 + (u_spell_level('druid_natures_commune') * 165)) " ] }
},
{
"u_add_morale": "morale_forest_unity",
"bonus": 10,
"max_bonus": 15,
"duration": { "math": [ "( 300 + (u_val('spell_level', 'spell: druid_natures_commune') * 165) )" ] },
"decay_start": { "math": [ "(( 300 + (u_val('spell_level', 'spell: druid_natures_commune') * 165) ) / 2)" ] }
"duration": { "math": [ "( 300 + (u_spell_level('druid_natures_commune') * 165) )" ] },
"decay_start": { "math": [ "(( 300 + (u_spell_level('druid_natures_commune') * 165) ) / 2)" ] }
}
],
"false_effect": [ { "u_message": "You must be surrounded by nature to commune with nature", "type": "bad" } ]
Expand Down Expand Up @@ -921,10 +921,10 @@
"spell_class": "DRUID",
"energy_source": "MANA",
"max_level": 15,
"min_range": { "math": [ "( (u_val('spell_level', 'spell: druid_summon_brambles') * 0.6) + 1)" ] },
"max_range": { "math": [ "( (u_val('spell_level', 'spell: druid_summon_brambles') * 0.6) + 1)" ] },
"min_aoe": { "math": [ "( (u_val('spell_level', 'spell: druid_summon_brambles') * 1.9) + 30)" ] },
"max_aoe": { "math": [ "( (u_val('spell_level', 'spell: druid_summon_brambles') * 1.9) + 30)" ] }
"min_range": { "math": [ "( (u_spell_level('druid_summon_brambles') * 0.6) + 1)" ] },
"max_range": { "math": [ "( (u_spell_level('druid_summon_brambles') * 0.6) + 1)" ] },
"min_aoe": { "math": [ "( (u_spell_level('druid_summon_brambles') * 1.9) + 30)" ] },
"max_aoe": { "math": [ "( (u_spell_level('druid_summon_brambles') * 1.9) + 30)" ] }
},
{
"id": "druid_summon_brambles_line",
Expand All @@ -939,8 +939,8 @@
"spell_class": "DRUID",
"energy_source": "MANA",
"max_level": 15,
"min_range": { "math": [ "( (u_val('spell_level', 'spell: druid_summon_brambles') * 1) + 1)" ] },
"max_range": { "math": [ "( (u_val('spell_level', 'spell: druid_summon_brambles') * 1) + 1)" ] }
"min_range": { "math": [ "( (u_spell_level('druid_summon_brambles') * 1) + 1)" ] },
"max_range": { "math": [ "( (u_spell_level('druid_summon_brambles') * 1) + 1)" ] }
},
{
"id": "druid_thorn_skin",
Expand Down
24 changes: 12 additions & 12 deletions data/mods/Magiclysm/Spells/earthshaper.json
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,8 @@
"effect": "spawn_item",
"effect_str": "eshaper_hammer",
"shape": "blast",
"min_duration": { "math": [ "( (u_val('spell_level', 'spell: eshaper_spawn_tools') * 576000) + 576000)" ] },
"max_duration": { "math": [ "( (u_val('spell_level', 'spell: eshaper_spawn_tools') * 576000) + 576000)" ] }
"min_duration": { "math": [ "( (u_spell_level('eshaper_spawn_tools') * 576000) + 576000)" ] },
"max_duration": { "math": [ "( (u_spell_level('eshaper_spawn_tools') * 576000) + 576000)" ] }
},
{
"id": "eshaper_spawn_pickaxe",
Expand All @@ -579,8 +579,8 @@
"effect": "spawn_item",
"effect_str": "eshaper_pickaxe",
"shape": "blast",
"min_duration": { "math": [ "( (u_val('spell_level', 'spell: eshaper_spawn_tools') * 576000) + 576000)" ] },
"max_duration": { "math": [ "( (u_val('spell_level', 'spell: eshaper_spawn_tools') * 576000) + 576000)" ] }
"min_duration": { "math": [ "( (u_spell_level('eshaper_spawn_tools') * 576000) + 576000)" ] },
"max_duration": { "math": [ "( (u_spell_level('eshaper_spawn_tools') * 576000) + 576000)" ] }
},
{
"id": "eshaper_spawn_axe",
Expand All @@ -594,8 +594,8 @@
"effect": "spawn_item",
"effect_str": "eshaper_ax",
"shape": "blast",
"min_duration": { "math": [ "( (u_val('spell_level', 'spell: eshaper_spawn_tools') * 576000) + 576000)" ] },
"max_duration": { "math": [ "( (u_val('spell_level', 'spell: eshaper_spawn_tools') * 576000) + 576000)" ] }
"min_duration": { "math": [ "( (u_spell_level('eshaper_spawn_tools') * 576000) + 576000)" ] },
"max_duration": { "math": [ "( (u_spell_level('eshaper_spawn_tools') * 576000) + 576000)" ] }
},
{
"id": "eshaper_spawn_knife",
Expand All @@ -609,8 +609,8 @@
"effect": "spawn_item",
"effect_str": "eshaper_knife",
"shape": "blast",
"min_duration": { "math": [ "( (u_val('spell_level', 'spell: eshaper_spawn_tools') * 576000) + 576000)" ] },
"max_duration": { "math": [ "( (u_val('spell_level', 'spell: eshaper_spawn_tools') * 576000) + 576000)" ] }
"min_duration": { "math": [ "( (u_spell_level('eshaper_spawn_tools') * 576000) + 576000)" ] },
"max_duration": { "math": [ "( (u_spell_level('eshaper_spawn_tools') * 576000) + 576000)" ] }
},
{
"id": "eshaper_spawn_shovel",
Expand All @@ -624,8 +624,8 @@
"effect": "spawn_item",
"effect_str": "eshaper_shovel",
"shape": "blast",
"min_duration": { "math": [ "( (u_val('spell_level', 'spell: eshaper_spawn_tools') * 576000) + 576000)" ] },
"max_duration": { "math": [ "( (u_val('spell_level', 'spell: eshaper_spawn_tools') * 576000) + 576000)" ] }
"min_duration": { "math": [ "( (u_spell_level('eshaper_spawn_tools') * 576000) + 576000)" ] },
"max_duration": { "math": [ "( (u_spell_level('eshaper_spawn_tools') * 576000) + 576000)" ] }
},
{
"id": "eshaper_melee_damage",
Expand Down Expand Up @@ -795,7 +795,7 @@
"effect": "map",
"shape": "blast",
"max_level": 1,
"min_aoe": { "math": [ "( 7 + (u_val('spell_level', 'spell: earthshaper_reveal_world_map') * 2.2) )" ] }
"min_aoe": { "math": [ "( 7 + (u_spell_level('earthshaper_reveal_world_map') * 2.2) )" ] }
},
{
"id": "earthshaper_danger_sense",
Expand Down Expand Up @@ -824,7 +824,7 @@
"effect": [
{
"u_add_effect": "effect_tremorsense",
"duration": { "math": [ "(u_val('spell_level', 'spell: earthshaper_danger_sense') * 30000)" ] }
"duration": { "math": [ "(u_spell_level('earthshaper_danger_sense') * 30000)" ] }
}
],
"false_effect": [ { "u_message": "Without a direct connection to the living earth, the spell fails.", "type": "bad" } ]
Expand Down
35 changes: 8 additions & 27 deletions data/mods/Magiclysm/Spells/stormshaper.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,25 +481,6 @@
"max_duration": 2160000,
"duration_increment": 72000
},
{
"id": "stormshaper_stormglove_zap",
"type": "SPELL",
"name": "Stormglove Zap",
"description": "This casts when you hit people with the stormglove.",
"valid_targets": [ "hostile" ],
"effect": "attack",
"shape": "blast",
"damage_type": "electric",
"min_damage": 1,
"max_damage": {
"math": [ "(5 + (1 * u_val('spell_level', 'spell: stormfist')) + (1 * u_val('spell_level', 'spell: stormfist_plus')))" ]
},
"flags": [ "RANDOM_DAMAGE", "NO_PROJECTILE" ],
"sound_type": "combat",
"sound_description": "arcing electricity!",
"min_range": 1,
"max_range": 1
},
{
"id": "create_electric_lighter",
"type": "SPELL",
Expand Down Expand Up @@ -1007,8 +988,8 @@
"effect": "attack",
"extra_effects": [ { "id": "stormshaper_cloak_fog_random", "max_level": 20 } ],
"shape": "blast",
"min_damage": { "math": [ "( (u_val('spell_level', 'spell: stormshaper_cloak_of_fog') * 0.5) + 2)" ] },
"max_damage": { "math": [ "( (u_val('spell_level', 'spell: stormshaper_cloak_of_fog') * 0.5) + 2)" ] }
"min_damage": { "math": [ "( (u_spell_level('stormshaper_cloak_of_fog') * 0.5) + 2)" ] },
"max_damage": { "math": [ "( (u_spell_level('stormshaper_cloak_of_fog') * 0.5) + 2)" ] }
},
{
"id": "stormshaper_cloak_fog_random",
Expand Down Expand Up @@ -1064,7 +1045,7 @@
"effect": "directed_push",
"shape": "blast",
"min_damage": 1,
"max_damage": { "math": [ "( (u_val('spell_level', 'spell: stormshaper_heart_of_hurricane') / 2) + 1)" ] },
"max_damage": { "math": [ "( (u_spell_level('stormshaper_heart_of_hurricane') / 2) + 1)" ] },
"min_range": 1
},
{
Expand Down Expand Up @@ -1113,8 +1094,8 @@
{
"queue_eocs": "EOC_LOSE_CLOAK_OF_FROG_MUTATIONS",
"time_in_future": [
{ "math": [ "( (u_val('spell_level', 'spell: stormshaper_cloak_of_frog') * 3750) + 15000)" ] },
{ "math": [ "( (u_val('spell_level', 'spell: stormshaper_cloak_of_frog') * 3750) + 15000)" ] }
{ "math": [ "( (u_spell_level('stormshaper_cloak_of_frog') * 3750) + 15000)" ] },
{ "math": [ "( (u_spell_level('stormshaper_cloak_of_frog') * 3750) + 15000)" ] }
]
}
],
Expand All @@ -1140,8 +1121,8 @@
"effect": "attack",
"extra_effects": [ { "id": "stormshaper_cloak_frog_summon", "max_level": 20 } ],
"shape": "blast",
"min_damage": { "math": [ "( (u_val('spell_level', 'spell: stormshaper_cloak_of_frog') * 1) + 1)" ] },
"max_damage": { "math": [ "( (u_val('spell_level', 'spell: stormshaper_cloak_of_frog') * 1) + 1)" ] }
"min_damage": { "math": [ "( (u_spell_level('stormshaper_cloak_of_frog') * 1) + 1)" ] },
"max_damage": { "math": [ "( (u_spell_level('stormshaper_cloak_of_frog') * 1) + 1)" ] }
},
{
"id": "stormshaper_cloak_frog_summon",
Expand All @@ -1162,6 +1143,6 @@
"min_aoe": 4,
"max_aoe": 20,
"aoe_increment": 0.65,
"min_duration": { "math": [ "( (u_val('spell_level', 'spell: stormshaper_cloak_of_frog') * 3750) + 15000)" ] }
"min_duration": { "math": [ "( (u_spell_level('stormshaper_cloak_of_frog') * 3750) + 15000)" ] }
}
]
4 changes: 2 additions & 2 deletions data/mods/Magiclysm/Spells/technomancer.json
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,8 @@
"min_range": 5,
"max_range": 20,
"range_increment": 1,
"min_damage": { "math": [ "( (u_val('spell_level', 'spell: technomancer_robot_shutdown') * -15) - 200)" ] },
"max_damage": { "math": [ "( (u_val('spell_level', 'spell: technomancer_robot_shutdown') * -25) - 400)" ] },
"min_damage": { "math": [ "( (u_spell_level('technomancer_robot_shutdown') * -15) - 200)" ] },
"max_damage": { "math": [ "( (u_spell_level('technomancer_robot_shutdown') * -25) - 400)" ] },
"energy_source": "MANA",
"base_casting_time": 150,
"base_energy_cost": 350,
Expand Down
Loading

0 comments on commit fecbe9c

Please sign in to comment.