From fc5961f42442e7c6b702fe5b2fe089a119f3e3f1 Mon Sep 17 00:00:00 2001 From: KorGgenT Date: Mon, 5 Oct 2020 01:45:45 -0400 Subject: [PATCH] [Magiclysm] Attunements - Overclocker traits --- data/mods/Magiclysm/traits/attunements.json | 2 ++ src/character.cpp | 1 + src/magic.cpp | 3 +++ src/mutation.h | 1 + src/mutation_data.cpp | 1 + 5 files changed, 8 insertions(+) diff --git a/data/mods/Magiclysm/traits/attunements.json b/data/mods/Magiclysm/traits/attunements.json index af8dcf3f2defa..c439fa855413e 100644 --- a/data/mods/Magiclysm/traits/attunements.json +++ b/data/mods/Magiclysm/traits/attunements.json @@ -576,6 +576,8 @@ "valid": false, "description": "The Technomancer specializes in augmenting humans without actually modifying them; and the Overclocker takes the heat aptitude of a Kelvinist and puts that to work. You are able to think significantly faster, and are able to align your leylines for spellcasting faster as a result.", "prereqs": [ "KELVINIST", "TECHNOMANCER" ], + "passive_mods": { "int_mod": 5 }, + "casting_time_multiplier": 0.75, "spells_learned": [ [ "overaccelerate", 5 ] ], "cancels": [ "ARTIFICER", diff --git a/src/character.cpp b/src/character.cpp index d73fdc4a7e516..815c6dd7defec 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -7784,6 +7784,7 @@ mutation_value_map = { { "mana_multiplier", calc_mutation_value_multiplicative<&mutation_branch::mana_multiplier> }, { "mana_regen_multiplier", calc_mutation_value_multiplicative<&mutation_branch::mana_regen_multiplier> }, { "bionic_mana_penalty", calc_mutation_value_multiplicative<&mutation_branch::bionic_mana_penalty> }, + { "casting_time_multiplier", calc_mutation_value_multiplicative<&mutation_branch::casting_time_multiplier> }, { "speed_modifier", calc_mutation_value_multiplicative<&mutation_branch::speed_modifier> }, { "movecost_modifier", calc_mutation_value_multiplicative<&mutation_branch::movecost_modifier> }, { "movecost_flatground_modifier", calc_mutation_value_multiplicative<&mutation_branch::movecost_flatground_modifier> }, diff --git a/src/magic.cpp b/src/magic.cpp index ddfc82d721adb..9d2e9c839dfd1 100644 --- a/src/magic.cpp +++ b/src/magic.cpp @@ -869,6 +869,9 @@ int spell::casting_time( const Character &guy, bool ignore_encumb ) const } else { casting_time = type->base_casting_time; } + + casting_time *= guy.mutation_value( "casting_time_multiplier" ); + if( !ignore_encumb ) { if( !has_flag( spell_flag::NO_LEGS ) ) { // the first 20 points of encumbrance combined is ignored diff --git a/src/mutation.h b/src/mutation.h index c7f5d4f5545fd..8ebd72665a477 100644 --- a/src/mutation.h +++ b/src/mutation.h @@ -304,6 +304,7 @@ struct mutation_branch { cata::optional mana_regen_multiplier = cata::nullopt; // for every point of bionic power, reduces max mana pool by 1 * bionic_mana_penalty cata::optional bionic_mana_penalty = cata::nullopt; + cata::optional casting_time_multiplier = cata::nullopt; // spells learned and their associated level when gaining the mutation std::map spells_learned; /** mutation enchantments */ diff --git a/src/mutation_data.cpp b/src/mutation_data.cpp index c267d8578b158..94d3a5c285aa4 100644 --- a/src/mutation_data.cpp +++ b/src/mutation_data.cpp @@ -467,6 +467,7 @@ void mutation_branch::load( const JsonObject &jo, const std::string & ) optional( jo, was_loaded, "mana_multiplier", mana_multiplier, cata::nullopt ); optional( jo, was_loaded, "mana_regen_multiplier", mana_regen_multiplier, cata::nullopt ); optional( jo, was_loaded, "bionic_mana_penalty", bionic_mana_penalty, cata::nullopt ); + optional( jo, was_loaded, "casting_time_multiplier", casting_time_multiplier, cata::nullopt ); if( jo.has_object( "rand_cut_bonus" ) ) { JsonObject sm = jo.get_object( "rand_cut_bonus" );