diff --git a/code/controllers/configuration/entries/dynamic.dm b/code/controllers/configuration/entries/dynamic.dm index 8a45894728..df57bd5aa8 100644 --- a/code/controllers/configuration/entries/dynamic.dm +++ b/code/controllers/configuration/entries/dynamic.dm @@ -105,6 +105,14 @@ config_entry_value = 10 min_val = 0 +/datum/config_entry/number/dynamic_staff_of_change_requirement + config_entry_value = 20 + min_val = 0 + +/datum/config_entry/number/dynamic_staff_of_change_cost + config_entry_value = 10 + min_val = 0 + /datum/config_entry/number/dynamic_apprentice_cost config_entry_value = 10 min_val = 0 diff --git a/code/modules/antagonists/wizard/equipment/spellbook.dm b/code/modules/antagonists/wizard/equipment/spellbook.dm index 2ca6d86e11..52d18a37d9 100644 --- a/code/modules/antagonists/wizard/equipment/spellbook.dm +++ b/code/modules/antagonists/wizard/equipment/spellbook.dm @@ -286,6 +286,20 @@ desc = "An artefact that spits bolts of coruscating energy which cause the target's very form to reshape itself." item_path = /obj/item/gun/magic/staff/change +/datum/spellbook_entry/item/staffchange/IsAvailible() + if(istype(SSticker.mode,/datum/game_mode/dynamic)) + var/datum/game_mode/dynamic/mode = SSticker.mode + if(mode.threat < CONFIG_GET(number/dynamic_staff_of_change_requirement)) + return 0 + +/datum/spellbook_entry/item/staffchange/Buy(mob/living/carbon/human/user,obj/item/spellbook/book) + if(istype(SSticker.mode,/datum/game_mode/dynamic)) + var/datum/game_mode/dynamic/mode = SSticker.mode + var/threat_spent = CONFIG_GET(number/dynamic_staff_of_change_cost) + mode.spend_threat(threat_spent) + mode.log_threat("Wizard spent [threat_spent] on staff of change.") + return ..() + /datum/spellbook_entry/item/staffanimation name = "Staff of Animation" desc = "An arcane staff capable of shooting bolts of eldritch energy which cause inanimate objects to come to life. This magic doesn't affect machines." diff --git a/config/dynamic_config.txt b/config/dynamic_config.txt index e27844d336..f9b78f046f 100644 --- a/config/dynamic_config.txt +++ b/config/dynamic_config.txt @@ -293,6 +293,9 @@ DYNAMIC_SUMMON_MAGIC_COST 10 DYNAMIC_SUMMON_EVENTS_REQUIREMENT 20 DYNAMIC_SUMMON_EVENTS_COST 10 +DYNAMIC_STAFF_OF_CHANGE_REQUIREMENT 20 +DYNAMIC_STAFF_OF_CHANGE_COST 10 + ## As above, but for apprentice. Note that this is just a cost, since apprentices aren't as universally disruptive as above. DYNAMIC_APPRENTICE_COST 10