From 8e38649904134eca2cfa69fcaa3bc599b1b92099 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Sun, 15 Dec 2024 16:40:13 -0600 Subject: [PATCH] Update Power Supply --- data/mods/Magiclysm/Spells/technomancer.json | 129 ++++++++++++++++-- data/mods/Magiclysm/items/ethereal_items.json | 54 +------- data/mods/Magiclysm/obsolete/items.json | 50 +++++++ 3 files changed, 171 insertions(+), 62 deletions(-) diff --git a/data/mods/Magiclysm/Spells/technomancer.json b/data/mods/Magiclysm/Spells/technomancer.json index 9fd07e141dc31..1f60cf695fbc8 100644 --- a/data/mods/Magiclysm/Spells/technomancer.json +++ b/data/mods/Magiclysm/Spells/technomancer.json @@ -736,7 +736,7 @@ "id": "technomancer_conjure_ups", "type": "SPELL", "name": "Power Supply", - "description": "For the technomancer with no enhancements, this spell summons a power supply composed of pure mana that can be used to charge any compatible device. It will continually recharge until the duration expires.", + "description": "For the technomancer with no enhancements, this spell summons a power supply composed of pure mana that can be used to charge any compatible device. Just keep it on your person and it will continually recharge your electronic devices until the duration expires.", "valid_targets": [ "self" ], "flags": [ "CONJURATION_SPELL", "CONCENTRATE", "VERBAL", "SOMATIC" ], "extra_effects": [ { "id": "eoc_summon_setup", "hit_self": true } ], @@ -757,25 +757,134 @@ }, { "type": "effect_on_condition", - "id": "EOC_CONJURE_UPS_SWITCHER", + "id": "EOC_CONJURE_UPS_INITIATE", "effect": [ { "run_eocs": "EOC_CONJURE_UPS_REMOVER", "time_in_future": { "math": [ "((u_spell_level('technomancer_conjure_ups') * 100 ) + 1000) * summoning_proficiency_modifier()" ] } }, + { "u_spawn_item": "technomancer_summoned_ups", "suppress_message": true } + ] + }, + { + "type": "effect_on_condition", + "id": "EOC_CONJURE_UPS_EFFECT_BEGIN", + "condition": { "u_has_effect": "effect_electrokin_personal_battery" }, + "effect": [ + { "run_eocs": "EOC_CONJURE_UPS_EFFECT_BEGIN", "time_in_future": 60 }, { - "switch": { "math": [ "u_spell_level('technomancer_conjure_ups')" ] }, - "cases": [ - { "case": 0, "effect": [ { "u_spawn_item": "technomancer_summoned_ups", "suppress_message": true } ] }, - { "case": 4, "effect": [ { "u_spawn_item": "technomancer_summoned_ups_2", "suppress_message": true } ] }, - { "case": 8, "effect": [ { "u_spawn_item": "technomancer_summoned_ups_3", "suppress_message": true } ] }, - { "case": 12, "effect": [ { "u_spawn_item": "technomancer_summoned_ups_4", "suppress_message": true } ] }, - { "case": 16, "effect": [ { "u_spawn_item": "technomancer_summoned_ups_5", "suppress_message": true } ] }, - { "case": 20, "effect": [ { "u_spawn_item": "technomancer_summoned_ups_6", "suppress_message": true } ] } + "math": [ "u_technomancer_conjure_ups_powering", "=", "( (u_spell_level('technomancer_conjure_ups') / 5) + 1) " ] + }, + { "run_eocs": "EOC_CONJURE_UPS_EFFECT" } + ] + }, + { + "type": "effect_on_condition", + "id": "EOC_CONJURE_UPS_EFFECT", + "//": "recursively runs until available power is < 1 or all items are charged", + "condition": { "math": [ "u_technomancer_conjure_ups_powering >= 1" ] }, + "effect": [ + { "math": [ "u_technomancer_conjure_ups_item_count = 0" ] }, + { "run_eocs": "EOC_CONJURE_UPS_EFFECT_GET_ITEM_COUNT" }, + { "run_eocs": "EOC_CONJURE_UPS_EFFECT_AMMEND_ITEM_COUNT" }, + { + "math": [ + "u_technomancer_conjure_ups_max_indv_power", + "=", + "floor(u_technomancer_conjure_ups_powering / u_technomancer_conjure_ups_item_count)" + ] + }, + { "run_eocs": "EOC_CONJURE_UPS_EFFECT_POWER_ITEMS" } + ] + }, + { + "type": "effect_on_condition", + "id": "EOC_CONJURE_UPS_EFFECT_POWER_ITEMS", + "//": "power uncharged items and calls the main eoc to deal with any remaining power left over", + "condition": { + "and": [ + { "math": [ "u_technomancer_conjure_ups_powering >= 1" ] }, + { "math": [ "u_technomancer_conjure_ups_item_count >= 1" ] } + ] + }, + "effect": [ + { + "u_run_inv_eocs": "all", + "search_data": [ { "uses_energy": true, "excluded_flags": [ "USES_BIONIC_POWER" ] } ], + "true_eocs": [ + { + "id": "EOC_CONJURE_UPS_EFFECT_POWER_ITEMS_DISTRIBUTION", + "condition": { + "and": [ { "math": [ "n_val('power') < n_val('power_max')" ] }, { "math": [ "u_technomancer_conjure_ups_powering >= 1" ] } ] + }, + "effect": [ + { + "if": { "math": [ "u_technomancer_conjure_ups_max_indv_power >= 1" ] }, + "then": { + "math": [ + "u_technomancer_conjure_ups_powering_used", + "=", + "min( n_val('power_max') - n_val('power'), u_technomancer_conjure_ups_max_indv_power )" + ] + }, + "else": { + "math": [ + "u_technomancer_conjure_ups_powering_used", + "=", + "min( n_val('power_max') - n_val('power'), u_technomancer_conjure_ups_powering )" + ] + } + }, + { + "math": [ + "u_technomancer_conjure_ups_powering_used", + "=", + "min( n_val('power_max') - n_val('power'), u_technomancer_conjure_ups_max_indv_power )" + ] + }, + { "math": [ "n_val('power')", "+=", "u_technomancer_conjure_ups_powering_used" ] }, + { "math": [ "u_technomancer_conjure_ups_powering", "-=", "u_technomancer_conjure_ups_powering_used" ] } + ] + } + ] + }, + { "run_eocs": "EOC_CONJURE_UPS_EFFECT" } + ] + }, + { + "type": "effect_on_condition", + "id": "EOC_CONJURE_UPS_EFFECT_GET_ITEM_COUNT", + "//": "get total items without max power", + "effect": [ + { + "u_run_inv_eocs": "all", + "search_data": [ { "uses_energy": true } ], + "true_eocs": [ + { + "id": "EOC_CONJURE_UPS_EFFECT_GET_ITEM_COUNT_2", + "condition": { "math": [ "n_val('power')", "<", "n_val('power_max')" ] }, + "effect": [ { "math": [ "u_technomancer_conjure_ups_item_count++" ] } ] + } ] } ] }, + { + "type": "effect_on_condition", + "id": "EOC_CONJURE_UPS_EFFECT_AMMEND_ITEM_COUNT", + "//": "Reduce item count if the total chargeable power / uncharged item count is less than 1.", + "condition": { + "and": [ + { "math": [ "u_technomancer_conjure_ups_powering", ">=", "1" ] }, + { "math": [ "u_technomancer_conjure_ups_item_count", ">=", "1" ] }, + { "math": [ "u_technomancer_conjure_ups_powering / u_technomancer_conjure_ups_item_count", "<", "1" ] } + ] + }, + "effect": [ + { "math": [ "u_technomancer_conjure_ups_item_count--" ] }, + { "run_eocs": "EOC_CONJURE_UPS_EFFECT_AMMEND_ITEM_COUNT" } + ] + }, { "type": "effect_on_condition", "id": "EOC_CONJURE_UPS_REMOVER", diff --git a/data/mods/Magiclysm/items/ethereal_items.json b/data/mods/Magiclysm/items/ethereal_items.json index f316384da2c99..f79dcfcf24837 100644 --- a/data/mods/Magiclysm/items/ethereal_items.json +++ b/data/mods/Magiclysm/items/ethereal_items.json @@ -1313,60 +1313,10 @@ "symbol": "=", "color": "yellow", "ammo_type": [ "battery" ], - "capacity": 1250, + "capacity": 1, "looks_like": "spiral_stone", "flags": [ "TRADER_AVOID", "ONLY_ONE", "NO_DROP", "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD", "IS_UPS" ], - "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 1000 } } ], - "relic_data": { "charge_info": { "recharge_type": "periodic", "time": "2 s", "regenerate_ammo": true } }, - "//": "Recharge time is 2 seconds due to bug #48019, making it actually 1 second. Reduce to 1 second if that ever gets fixed." - }, - { - "id": "technomancer_summoned_ups_2", - "type": "TOOL_ARMOR", - "name": { "str": "technomantic power supply", "str_pl": "technomantic power supplies" }, - "description": "A smoothly-curved conglomeration of mana, humming softly as it provides power.", - "copy-from": "technomancer_summoned_ups", - "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 2000 } } ], - "relic_data": { "charge_info": { "recharge_type": "periodic", "time": "2 s", "regenerate_ammo": true } }, - "//": "Recharge time is 2 seconds due to bug #48019, making it actually 1 second. Reduce to 1 second if that ever gets fixed." - }, - { - "id": "technomancer_summoned_ups_3", - "type": "TOOL_ARMOR", - "name": { "str": "technomantic power supply", "str_pl": "technomantic power supplies" }, - "description": "A smoothly-curved conglomeration of mana, humming softly as it provides power.", - "copy-from": "technomancer_summoned_ups", - "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 4000 } } ], - "relic_data": { "charge_info": { "recharge_type": "periodic", "time": "2 s", "regenerate_ammo": true } }, - "//": "Recharge time is 2 seconds due to bug #48019, making it actually 1 second. Reduce to 1 second if that ever gets fixed." - }, - { - "id": "technomancer_summoned_ups_4", - "type": "TOOL_ARMOR", - "name": { "str": "technomantic power supply", "str_pl": "technomantic power supplies" }, - "description": "A smoothly-curved conglomeration of mana, humming softly as it provides power.", - "copy-from": "technomancer_summoned_ups", - "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 8000 } } ], - "relic_data": { "charge_info": { "recharge_type": "periodic", "time": "2 s", "regenerate_ammo": true } }, - "//": "Recharge time is 2 seconds due to bug #48019, making it actually 1 second. Reduce to 1 second if that ever gets fixed." - }, - { - "id": "technomancer_summoned_ups_5", - "type": "TOOL_ARMOR", - "name": { "str": "technomantic power supply", "str_pl": "technomantic power supplies" }, - "description": "A smoothly-curved conglomeration of mana, humming softly as it provides power.", - "copy-from": "technomancer_summoned_ups", - "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 16000 } } ], - "relic_data": { "charge_info": { "recharge_type": "periodic", "time": "2 s", "regenerate_ammo": true } }, - "//": "Recharge time is 2 seconds due to bug #48019, making it actually 1 second. Reduce to 1 second if that ever gets fixed." - }, - { - "id": "technomancer_summoned_ups_6", - "type": "TOOL_ARMOR", - "name": { "str": "technomantic power supply", "str_pl": "technomantic power supplies" }, - "description": "A smoothly-curved conglomeration of mana, humming softly as it provides power.", - "copy-from": "technomancer_summoned_ups", - "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 32000 } } ], + "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 1 } } ], "relic_data": { "charge_info": { "recharge_type": "periodic", "time": "2 s", "regenerate_ammo": true } }, "//": "Recharge time is 2 seconds due to bug #48019, making it actually 1 second. Reduce to 1 second if that ever gets fixed." }, diff --git a/data/mods/Magiclysm/obsolete/items.json b/data/mods/Magiclysm/obsolete/items.json index ec1c9d5801eed..7661ba8b7e508 100644 --- a/data/mods/Magiclysm/obsolete/items.json +++ b/data/mods/Magiclysm/obsolete/items.json @@ -57,5 +57,55 @@ "ALLOWS_NATURAL_ATTACKS" ], "relic_data": { "passive_effects": [ { "id": "ench_aura_caustic" } ] } + }, + { + "id": "technomancer_summoned_ups_2", + "type": "TOOL_ARMOR", + "name": { "str": "technomantic power supply", "str_pl": "technomantic power supplies" }, + "description": "A smoothly-curved conglomeration of mana, humming softly as it provides power.", + "copy-from": "technomancer_summoned_ups", + "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 2000 } } ], + "relic_data": { "charge_info": { "recharge_type": "periodic", "time": "2 s", "regenerate_ammo": true } }, + "//": "Recharge time is 2 seconds due to bug #48019, making it actually 1 second. Reduce to 1 second if that ever gets fixed." + }, + { + "id": "technomancer_summoned_ups_3", + "type": "TOOL_ARMOR", + "name": { "str": "technomantic power supply", "str_pl": "technomantic power supplies" }, + "description": "A smoothly-curved conglomeration of mana, humming softly as it provides power.", + "copy-from": "technomancer_summoned_ups", + "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 4000 } } ], + "relic_data": { "charge_info": { "recharge_type": "periodic", "time": "2 s", "regenerate_ammo": true } }, + "//": "Recharge time is 2 seconds due to bug #48019, making it actually 1 second. Reduce to 1 second if that ever gets fixed." + }, + { + "id": "technomancer_summoned_ups_4", + "type": "TOOL_ARMOR", + "name": { "str": "technomantic power supply", "str_pl": "technomantic power supplies" }, + "description": "A smoothly-curved conglomeration of mana, humming softly as it provides power.", + "copy-from": "technomancer_summoned_ups", + "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 8000 } } ], + "relic_data": { "charge_info": { "recharge_type": "periodic", "time": "2 s", "regenerate_ammo": true } }, + "//": "Recharge time is 2 seconds due to bug #48019, making it actually 1 second. Reduce to 1 second if that ever gets fixed." + }, + { + "id": "technomancer_summoned_ups_5", + "type": "TOOL_ARMOR", + "name": { "str": "technomantic power supply", "str_pl": "technomantic power supplies" }, + "description": "A smoothly-curved conglomeration of mana, humming softly as it provides power.", + "copy-from": "technomancer_summoned_ups", + "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 16000 } } ], + "relic_data": { "charge_info": { "recharge_type": "periodic", "time": "2 s", "regenerate_ammo": true } }, + "//": "Recharge time is 2 seconds due to bug #48019, making it actually 1 second. Reduce to 1 second if that ever gets fixed." + }, + { + "id": "technomancer_summoned_ups_6", + "type": "TOOL_ARMOR", + "name": { "str": "technomantic power supply", "str_pl": "technomantic power supplies" }, + "description": "A smoothly-curved conglomeration of mana, humming softly as it provides power.", + "copy-from": "technomancer_summoned_ups", + "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 32000 } } ], + "relic_data": { "charge_info": { "recharge_type": "periodic", "time": "2 s", "regenerate_ammo": true } }, + "//": "Recharge time is 2 seconds due to bug #48019, making it actually 1 second. Reduce to 1 second if that ever gets fixed." } ]