From f934b85e383b248f534fdef5db71b74b921e078b Mon Sep 17 00:00:00 2001 From: John Candlebury Date: Fri, 6 Dec 2019 23:17:48 -0600 Subject: [PATCH 1/7] Magiclysm- Light Manipulation Spellbook --- data/mods/Magiclysm/Spells/classless.json | 19 +++++++++++++++++++ .../mods/Magiclysm/itemgroups/spellbooks.json | 1 + data/mods/Magiclysm/items/ethereal_items.json | 16 ++++++++++++++++ data/mods/Magiclysm/items/spellbooks.json | 15 +++++++++++++++ 4 files changed, 51 insertions(+) diff --git a/data/mods/Magiclysm/Spells/classless.json b/data/mods/Magiclysm/Spells/classless.json index 237e84768340a..be9d56fa45068 100644 --- a/data/mods/Magiclysm/Spells/classless.json +++ b/data/mods/Magiclysm/Spells/classless.json @@ -124,6 +124,25 @@ "difficulty": 3, "damage_type": "bash" }, + { + "id": "obfuscated_body", + "type": "SPELL", + "name": "Obfuscated body", + "description": "A magical aura distorts light around your body, making it easier to dodge enemy attacks.", + "valid_targets": [ "self" ], + "effect": "spawn_item", + "effect_str": "obfuscating_aura", + "energy_source": "MANA", + "spell_class": "NONE", + "flags": [ "CONCENTRATE", "NO_LEGS" ], + "difficulty": 4, + "max_level": 15, + "base_casting_time": 200, + "base_energy_cost": 400, + "min_duration": 21000, + "max_duration": 90000, + "duration_increment": 4500 + }, { "id": "protection_aura", "type": "SPELL", diff --git a/data/mods/Magiclysm/itemgroups/spellbooks.json b/data/mods/Magiclysm/itemgroups/spellbooks.json index 481f973a214ff..029c6a11217cc 100644 --- a/data/mods/Magiclysm/itemgroups/spellbooks.json +++ b/data/mods/Magiclysm/itemgroups/spellbooks.json @@ -137,6 +137,7 @@ [ "magus_spellbook", 15 ], [ "magus_spellbook_move", 30 ], [ "translocate_spellbook", 20 ], + [ "light_manipulation_spellbook", 5 ], [ "recovery_spellbook", 30 ] ] }, diff --git a/data/mods/Magiclysm/items/ethereal_items.json b/data/mods/Magiclysm/items/ethereal_items.json index c31f505814bdf..ddb4191fe7f81 100644 --- a/data/mods/Magiclysm/items/ethereal_items.json +++ b/data/mods/Magiclysm/items/ethereal_items.json @@ -344,6 +344,22 @@ "max_charges": 15, "use_action": "WATER_PURIFIER" }, + { + "id": "obfuscating_aura", + "type": "ARMOR", + "name": "obfuscating aura", + "description": "An all-encompassing, invisible layer of magic distorts light around your body. Makes it easier to dodge attacks.", + "weight": "1g", + "volume": "1ml", + "price": 3646, + "symbol": "o", + "color": "white", + "covers": [ "LEGS", "TORSO", "ARMS", "HANDS", "HEAD", "FEET", "MOUTH", "EYES" ], + "flags": [ "AURA", "SEMITANGIBLE", "OVERSIZE", "ONLY_ONE", "TRADER_AVOID", "NO_TAKEOFF", "NONCONDUCTIVE" ], + "relic_data": { + "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "BONUS_DODGE", "multiply": 1 } ] } ] + } + }, { "id": "acid_res_aura", "type": "ARMOR", diff --git a/data/mods/Magiclysm/items/spellbooks.json b/data/mods/Magiclysm/items/spellbooks.json index 7f75fbe8c1f86..45252f4a35dec 100644 --- a/data/mods/Magiclysm/items/spellbooks.json +++ b/data/mods/Magiclysm/items/spellbooks.json @@ -148,6 +148,21 @@ "color": "magenta", "use_action": { "type": "learn_spell", "spells": [ "seismic_stomp", "create_atomic_lamp", "ethereal_grasp" ] } }, + { + "id": "light_manipulation_spellbook", + "type": "GENERIC", + "name": "Of Light and Falsehoods", + "description": "A small white book, it subtly amplifies the ambient light around it.", + "weight": 430, + "volume": 3, + "price": 5000, + "symbol": "?", + "color": "light_gray", + "use_action": { + "type": "learn_spell", + "spells": [ "dark_sight", "blinding_flash", "obfuscated_body", "create_atomic_light", "mirror_image", "invisibility" ] + } + }, { "id": "biomancer_spellbook", "type": "GENERIC", From 8c124f3bd6244ea49c931fb67d41fb8b57060398 Mon Sep 17 00:00:00 2001 From: John Candlebury Date: Sat, 7 Dec 2019 00:02:35 -0600 Subject: [PATCH 2/7] Add spell scroll --- data/mods/Magiclysm/Spells/classless.json | 2 +- data/mods/Magiclysm/itemgroups/spellbooks.json | 1 + data/mods/Magiclysm/items/spell_scrolls.json | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/data/mods/Magiclysm/Spells/classless.json b/data/mods/Magiclysm/Spells/classless.json index be9d56fa45068..e23cc2943eddc 100644 --- a/data/mods/Magiclysm/Spells/classless.json +++ b/data/mods/Magiclysm/Spells/classless.json @@ -127,7 +127,7 @@ { "id": "obfuscated_body", "type": "SPELL", - "name": "Obfuscated body", + "name": "Obfuscated Body", "description": "A magical aura distorts light around your body, making it easier to dodge enemy attacks.", "valid_targets": [ "self" ], "effect": "spawn_item", diff --git a/data/mods/Magiclysm/itemgroups/spellbooks.json b/data/mods/Magiclysm/itemgroups/spellbooks.json index 029c6a11217cc..a31b1c587008c 100644 --- a/data/mods/Magiclysm/itemgroups/spellbooks.json +++ b/data/mods/Magiclysm/itemgroups/spellbooks.json @@ -101,6 +101,7 @@ [ "spell_scroll_magus_mana_blast", 50 ], [ "lightning_storm_scroll", 50 ], [ "spell_scroll_invisibility", 10 ], + [ "spell_scroll_obfuscated_body", 10 ], [ "spell_scroll_lava_bomb", 5 ] ] }, diff --git a/data/mods/Magiclysm/items/spell_scrolls.json b/data/mods/Magiclysm/items/spell_scrolls.json index 9056ceab8cbfe..02bd8dc269a2f 100644 --- a/data/mods/Magiclysm/items/spell_scrolls.json +++ b/data/mods/Magiclysm/items/spell_scrolls.json @@ -26,6 +26,14 @@ "description": "The light can not interact with you unless you want it to. Become invisible!", "use_action": { "type": "learn_spell", "spells": [ "invisibility" ] } }, + { + "type": "GENERIC", + "copy-from": "spell_scroll", + "id": "spell_scroll_obfuscated_body", + "name": "Scroll of Obfuscated Body", + "description": "A magical aura distorts light around your body, making it easier to dodge enemy attacks.", + "use_action": { "type": "learn_spell", "spells": [ "obfuscated_body" ] } + }, { "type": "GENERIC", "copy-from": "spell_scroll", From 2700e73018fc3eafc42590da655e92b4f29ab0bd Mon Sep 17 00:00:00 2001 From: John Candlebury Date: Sat, 7 Dec 2019 15:10:33 -0600 Subject: [PATCH 3/7] Implement BONUS_DODGE --- src/magic_enchantment.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/magic_enchantment.cpp b/src/magic_enchantment.cpp index e16c0d427f0d3..abe65454d4d30 100644 --- a/src/magic_enchantment.cpp +++ b/src/magic_enchantment.cpp @@ -370,6 +370,9 @@ void enchantment::activate_passive( Character &guy ) const guy.mod_speed_bonus( get_value_add( mod::SPEED ) ); guy.mod_speed_bonus( mult_bonus( mod::SPEED, guy.get_speed_base() ) ); + + guy.mod_dodge_bonus( get_value_add( mod::BONUS_DODGE ) ); + guy.mod_dodge_bonus( mult_bonus( mod::BONUS_DODGE, guy.get_dodge_base() ) ); } void enchantment::cast_hit_you( Character &caster, const tripoint &target ) const From a683e981889f77b8bf4ca5c0d3a576a609df4e19 Mon Sep 17 00:00:00 2001 From: John Candlebury Date: Sun, 8 Dec 2019 14:54:58 -0600 Subject: [PATCH 4/7] Modify dodging bonus --- data/mods/Magiclysm/items/ethereal_items.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/mods/Magiclysm/items/ethereal_items.json b/data/mods/Magiclysm/items/ethereal_items.json index ddb4191fe7f81..3f00ce2eedc78 100644 --- a/data/mods/Magiclysm/items/ethereal_items.json +++ b/data/mods/Magiclysm/items/ethereal_items.json @@ -357,7 +357,7 @@ "covers": [ "LEGS", "TORSO", "ARMS", "HANDS", "HEAD", "FEET", "MOUTH", "EYES" ], "flags": [ "AURA", "SEMITANGIBLE", "OVERSIZE", "ONLY_ONE", "TRADER_AVOID", "NO_TAKEOFF", "NONCONDUCTIVE" ], "relic_data": { - "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "BONUS_DODGE", "multiply": 1 } ] } ] + "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "BONUS_DODGE", "add": 2 } ] } ] } }, { From 2060fbb26454e0c1ab24091ba5cecc9ea668cda2 Mon Sep 17 00:00:00 2001 From: John Candlebury Date: Sun, 8 Dec 2019 15:24:15 -0600 Subject: [PATCH 5/7] Lint Json --- data/mods/Magiclysm/items/ethereal_items.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/data/mods/Magiclysm/items/ethereal_items.json b/data/mods/Magiclysm/items/ethereal_items.json index 3f00ce2eedc78..6165104db722c 100644 --- a/data/mods/Magiclysm/items/ethereal_items.json +++ b/data/mods/Magiclysm/items/ethereal_items.json @@ -356,9 +356,7 @@ "color": "white", "covers": [ "LEGS", "TORSO", "ARMS", "HANDS", "HEAD", "FEET", "MOUTH", "EYES" ], "flags": [ "AURA", "SEMITANGIBLE", "OVERSIZE", "ONLY_ONE", "TRADER_AVOID", "NO_TAKEOFF", "NONCONDUCTIVE" ], - "relic_data": { - "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "BONUS_DODGE", "add": 2 } ] } ] - } + "relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "BONUS_DODGE", "add": 2 } ] } ] } }, { "id": "acid_res_aura", From a8bb7502d91450f3b255c6e1d72e812d0c7fbcb2 Mon Sep 17 00:00:00 2001 From: John Candlebury Date: Sun, 8 Dec 2019 21:04:35 -0600 Subject: [PATCH 6/7] Rework Bonus Dodge to add dodge attempts Also adds two new rings with this effect --- data/mods/Magiclysm/Spells/classless.json | 2 +- .../Magiclysm/enchanted/enchanted_rings.json | 16 ++++++++++++++++ data/mods/Magiclysm/itemgroups/itemgroups.json | 2 ++ data/mods/Magiclysm/items/ethereal_items.json | 2 +- src/creature.cpp | 8 ++++++-- src/creature.h | 3 ++- src/magic_enchantment.cpp | 4 ++-- src/martialarts.cpp | 2 +- 8 files changed, 31 insertions(+), 8 deletions(-) diff --git a/data/mods/Magiclysm/Spells/classless.json b/data/mods/Magiclysm/Spells/classless.json index e23cc2943eddc..1552f6feefb51 100644 --- a/data/mods/Magiclysm/Spells/classless.json +++ b/data/mods/Magiclysm/Spells/classless.json @@ -128,7 +128,7 @@ "id": "obfuscated_body", "type": "SPELL", "name": "Obfuscated Body", - "description": "A magical aura distorts light around your body, making it easier to dodge enemy attacks.", + "description": "A magical aura distorts light around your body, increasing the amount of attacks you might dodge in a given turn.", "valid_targets": [ "self" ], "effect": "spawn_item", "effect_str": "obfuscating_aura", diff --git a/data/mods/Magiclysm/enchanted/enchanted_rings.json b/data/mods/Magiclysm/enchanted/enchanted_rings.json index 016d95249481c..aa244348eacb3 100644 --- a/data/mods/Magiclysm/enchanted/enchanted_rings.json +++ b/data/mods/Magiclysm/enchanted/enchanted_rings.json @@ -76,6 +76,22 @@ "charges_per_use": 1, "artifact_data": { "charge_type": "ARTC_TIME" } }, + { + "copy-from": "mring_silver", + "type": "TOOL_ARMOR", + "id": "mring_dodge_bonus_1", + "name": "eel ring", + "description": "A thin silver band ring, depicting an eel coiled on itself. Allows you to dodge an extra attack per turn.", + "relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "BONUS_DODGE", "add": 2 } ] } ] } + }, + { + "copy-from": "mring_gold", + "type": "TOOL_ARMOR", + "id": "mring_dodge_bonus_2", + "name": "bicephalous eel ring", + "description": "A thin gold band ring, depicting a bicephalous eel coiled on itself. Allows you to dodge two extra attacks per turn.", + "relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "BONUS_DODGE", "add": 2 } ] } ] } + }, { "copy-from": "mring_copper", "type": "TOOL_ARMOR", diff --git a/data/mods/Magiclysm/itemgroups/itemgroups.json b/data/mods/Magiclysm/itemgroups/itemgroups.json index e7b8c2e50a77a..3252b9ee4386c 100644 --- a/data/mods/Magiclysm/itemgroups/itemgroups.json +++ b/data/mods/Magiclysm/itemgroups/itemgroups.json @@ -306,6 +306,7 @@ { "item": "mring_strength_2", "prob": 10 }, { "item": "mring_dexterity_2", "prob": 10 }, { "item": "mring_intelligence_2", "prob": 10 }, + { "item": "mring_dodge_bonus_1", "prob": 10 }, { "item": "mring_perception_2", "prob": 10 }, { "item": "mring_speed_5", "prob": 10 }, { "item": "mring_protection_4", "prob": 10 } @@ -319,6 +320,7 @@ "items": [ { "item": "mring_strength_3", "prob": 10 }, { "item": "mring_dexterity_3", "prob": 10 }, + { "item": "mring_dodge_bonus_2", "prob": 10 }, { "item": "mring_intelligence_3", "prob": 10 }, { "item": "mring_perception_3", "prob": 10 }, { "item": "mring_speed_7", "prob": 10 }, diff --git a/data/mods/Magiclysm/items/ethereal_items.json b/data/mods/Magiclysm/items/ethereal_items.json index 6165104db722c..3ccd4de3c3ac3 100644 --- a/data/mods/Magiclysm/items/ethereal_items.json +++ b/data/mods/Magiclysm/items/ethereal_items.json @@ -348,7 +348,7 @@ "id": "obfuscating_aura", "type": "ARMOR", "name": "obfuscating aura", - "description": "An all-encompassing, invisible layer of magic distorts light around your body. Makes it easier to dodge attacks.", + "description": "An all-encompassing, invisible layer of magic distorts light around your body. Allows you to dodge two extra attacks in a given turn.", "weight": "1g", "volume": "1ml", "price": 3646, diff --git a/src/creature.cpp b/src/creature.cpp index 17126a28b6771..e8bbbf36cda2a 100644 --- a/src/creature.cpp +++ b/src/creature.cpp @@ -1337,6 +1337,10 @@ int Creature::get_num_dodges_bonus() const { return num_dodges_bonus; } +int Creature::get_num_dodges_base() const +{ + return num_dodges; +} // currently this is expected to be overridden to actually have use int Creature::get_env_resist( body_part ) const @@ -1460,9 +1464,9 @@ void Creature::set_num_blocks_bonus( int nblocks ) { num_blocks_bonus = nblocks; } -void Creature::set_num_dodges_bonus( int ndodges ) +void Creature::mod_num_dodges_bonus( int ndodges ) { - num_dodges_bonus = ndodges; + num_dodges_bonus += ndodges; } void Creature::set_armor_bash_bonus( int nbasharm ) diff --git a/src/creature.h b/src/creature.h index d704cee54f85d..f87f308676b29 100644 --- a/src/creature.h +++ b/src/creature.h @@ -402,6 +402,7 @@ class Creature virtual int get_num_dodges() const; virtual int get_num_blocks_bonus() const; virtual int get_num_dodges_bonus() const; + virtual int get_num_dodges_base() const; virtual int get_env_resist( body_part bp ) const; @@ -474,7 +475,7 @@ class Creature virtual void mod_stat( const std::string &stat, float modifier ); virtual void set_num_blocks_bonus( int nblocks ); - virtual void set_num_dodges_bonus( int ndodges ); + virtual void mod_num_dodges_bonus( int ndodges ); virtual void set_armor_bash_bonus( int nbasharm ); virtual void set_armor_cut_bonus( int ncutarm ); diff --git a/src/magic_enchantment.cpp b/src/magic_enchantment.cpp index abe65454d4d30..a4e67a359e42f 100644 --- a/src/magic_enchantment.cpp +++ b/src/magic_enchantment.cpp @@ -371,8 +371,8 @@ void enchantment::activate_passive( Character &guy ) const guy.mod_speed_bonus( get_value_add( mod::SPEED ) ); guy.mod_speed_bonus( mult_bonus( mod::SPEED, guy.get_speed_base() ) ); - guy.mod_dodge_bonus( get_value_add( mod::BONUS_DODGE ) ); - guy.mod_dodge_bonus( mult_bonus( mod::BONUS_DODGE, guy.get_dodge_base() ) ); + guy.mod_num_dodges_bonus( get_value_add( mod::BONUS_DODGE ) ); + guy.mod_num_dodges_bonus( mult_bonus( mod::BONUS_DODGE, guy.get_num_dodges_base() ) ); } void enchantment::cast_hit_you( Character &caster, const tripoint &target ) const diff --git a/src/martialarts.cpp b/src/martialarts.cpp index 1e73b4050ee27..ed1cfb8e40a2c 100644 --- a/src/martialarts.cpp +++ b/src/martialarts.cpp @@ -583,7 +583,7 @@ bool ma_buff::is_valid_character( const Character &u ) const void ma_buff::apply_character( Character &u ) const { - u.set_num_dodges_bonus( u.get_num_dodges_bonus() + dodges_bonus ); + u.mod_num_dodges_bonus( dodges_bonus ); u.set_num_blocks_bonus( u.get_num_blocks_bonus() + blocks_bonus ); } From b1eaabe59e18bd4eb908584310b6ec36b9333f1b Mon Sep 17 00:00:00 2001 From: KorGgenT Date: Tue, 17 Dec 2019 09:40:56 -0500 Subject: [PATCH 7/7] minor adjustment --- data/mods/Magiclysm/enchanted/enchanted_rings.json | 2 +- data/mods/Magiclysm/items/spellbooks.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/mods/Magiclysm/enchanted/enchanted_rings.json b/data/mods/Magiclysm/enchanted/enchanted_rings.json index aa244348eacb3..b35b5f5db9066 100644 --- a/data/mods/Magiclysm/enchanted/enchanted_rings.json +++ b/data/mods/Magiclysm/enchanted/enchanted_rings.json @@ -82,7 +82,7 @@ "id": "mring_dodge_bonus_1", "name": "eel ring", "description": "A thin silver band ring, depicting an eel coiled on itself. Allows you to dodge an extra attack per turn.", - "relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "BONUS_DODGE", "add": 2 } ] } ] } + "relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "BONUS_DODGE", "add": 1 } ] } ] } }, { "copy-from": "mring_gold", diff --git a/data/mods/Magiclysm/items/spellbooks.json b/data/mods/Magiclysm/items/spellbooks.json index 45252f4a35dec..9b9a5d2efe4ba 100644 --- a/data/mods/Magiclysm/items/spellbooks.json +++ b/data/mods/Magiclysm/items/spellbooks.json @@ -153,8 +153,8 @@ "type": "GENERIC", "name": "Of Light and Falsehoods", "description": "A small white book, it subtly amplifies the ambient light around it.", - "weight": 430, - "volume": 3, + "weight": "430 g", + "volume": "750 ml", "price": 5000, "symbol": "?", "color": "light_gray",