diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 25f6dd849b3..d574e3e6851 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -71,6 +71,8 @@ var/isScrying = 0 var/list/heard_before = list() + var/nospells = 0 //Can't cast spells. + /datum/mind/New(var/key) src.key = key diff --git a/code/modules/admin/verbs/onlyone.dm b/code/modules/admin/verbs/onlyone.dm index c3fe07a92f9..facf63a4205 100644 --- a/code/modules/admin/verbs/onlyone.dm +++ b/code/modules/admin/verbs/onlyone.dm @@ -36,7 +36,7 @@ for(var/mob/M in mobs_to_convert) event.convert_mob(M) - event.event_setup_end() + event.event_setup_end(mobs_to_convert) qdel(event) @@ -60,25 +60,9 @@ if(ishuman(M) || issilicon(M)) return 1 -//Does the actual converting of mobs. Called on each mob in the final conversion list. (The base version of this proc doesn't do anything.) +//Does the actual converting of mobs. Called on each mob in the final conversion list. Returns the converted mob, in case conversion requires spawning a new one. +//The base version of this proc turns just turns silicons into humans, so any events that require that need only call the parent and convert the mob returned. /datum/only_one/proc/convert_mob(var/mob/M) - -//Called at the end of the event setup. -/datum/only_one/proc/event_setup_end() - - -//The classic. -/datum/only_one/highlander - name = "Highlander" - -/datum/only_one/highlander/check_eligibility(var/mob/M) - if(!..()) - return 0 - if(is_special_character(M)) - return 0 - return 1 - -/datum/only_one/highlander/convert_mob(var/mob/M) if(issilicon(M)) var/mob/living/silicon/S = M var/mob/living/carbon/human/new_human = new /mob/living/carbon/human(S.loc, delay_ready_dna=1) @@ -94,7 +78,25 @@ new_human.key = S.key qdel(S) M = new_human - var/mob/living/carbon/human/H = M + return M + +//Called at the end of the event setup. Provided with the list of converted mobs in case something has to be done with them after everything else is done. +/datum/only_one/proc/event_setup_end(var/list/converted_mobs) + + +//The classic. +/datum/only_one/highlander + name = "Highlander" + +/datum/only_one/highlander/check_eligibility(var/mob/M) + if(!..()) + return 0 + if(is_special_character(M)) + return 0 + return 1 + +/datum/only_one/highlander/convert_mob(var/mob/M) + var/mob/living/carbon/human/H = ..(M) ticker.mode.traitors += H.mind H.mind.special_role = HIGHLANDER @@ -117,8 +119,7 @@ to_chat(H, "You are a highlander!") var/obj_count = 1 for(var/datum/objective/OBJ in H.mind.objectives) - to_chat(H, "Objective #[obj_count]: [OBJ.explanation_text]") - obj_count++ + to_chat(H, "Objective #[obj_count++]: [OBJ.explanation_text]") for (var/obj/item/I in H) if (istype(I, /obj/item/weapon/implant)) @@ -148,4 +149,74 @@ W.assignment = "Highlander" W.registered_name = H.real_name H.equip_to_slot_or_del(W, slot_wear_id) - \ No newline at end of file + + return H + + +//MAGIC MISSILE +/datum/only_one/wizardwars + name = "Wizard Wars" + +/datum/only_one/wizardwars/convert_mob(var/mob/M) + var/mob/living/carbon/human/H = ..(M) + + H.revive() //Fully heal all converted mobs... + H.status_flags |= (INVULNERABLE | GODMODE) //...and make them invincible. This invincibility is removed in event_setup_end(), after a delay. + if(H.mind) //Golly gee I sure hope they have a mind or else they might be able to prematurely fuck people up + H.mind.nospells = 1 + ticker.mode.wizards += H + H.mind.special_role = "Wizard" + + var/datum/objective/hijack/hijack_objective = new + hijack_objective.owner = H.mind + H.mind.objectives += hijack_objective + + to_chat(H, "You are a Space Wizard!") + var/obj_count = 1 + for(var/datum/objective/OBJ in H.mind.objectives) + to_chat(H, "Objective #[obj_count++]: [OBJ.explanation_text]") + + for(var/obj/item/I in H) + if(!istype(I, /obj/item/weapon/implant)) + qdel(I) + + if(isplasmaman(H)) + H.set_species("Skellington", 1) //Don't want them just catching fire, and this is the most similar species that doesn't need the suit. + to_chat(H, "Your solid plasma vanishes, leaving behind only bones!") + + H.equip_to_slot_or_del(new /obj/item/device/radio/headset(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/under/lightpurple(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/head/wizard(H), slot_head) + switch(H.backbag) + if(3) //No need to have a case for if they select the normal backpack type, as that's the default in case they haven't selected one. + H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) + if(4) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back) + else + H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/teleportation_scroll(H), slot_r_store) + H.equip_to_slot_or_del(new /obj/item/weapon/spellbook(H), slot_in_backpack) + if(isvox(H)) + H.equip_to_slot_or_del(new /obj/item/clothing/mask/breath/vox(H), slot_wear_mask) + var/obj/item/weapon/tank/nitrogen/T = new(H) + H.put_in_hands(T) + H.internal = T + if(H.internals) + H.internals.icon_state = "internal1" + + H.make_all_robot_parts_organic() + + to_chat(H, "Your spellbook is in your backpack. All wizards are invincible for the next 20 seconds, and no spells can be cast in that time. Take this time to select your spells.") + + return H + +/datum/only_one/wizardwars/event_setup_end(var/list/converted_mobs) + sleep(200) //Twenty seconds. + for(var/mob/M in converted_mobs) + M.status_flags &= ~(INVULNERABLE | GODMODE) + if(M.mind) + M.mind.nospells = 0 + to_chat(M, "Invincibility period over. Let the battle begin!") diff --git a/code/modules/spells/spell_code.dm b/code/modules/spells/spell_code.dm index 0746d5b07ae..08b83e062c0 100644 --- a/code/modules/spells/spell_code.dm +++ b/code/modules/spells/spell_code.dm @@ -259,6 +259,10 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now /spell/proc/cast_check(skipcharge = 0,mob/user = usr) //checks if the spell can be cast based on its settings; skipcharge is used when an additional cast_check is called inside the spell + if(user.mind && user.mind.nospells) + to_chat(user, "Your power is suppressed!") + return 0 + if(!(src in user.spell_list) && holder == user) to_chat(user, "You shouldn't have this spell! Something's wrong.") return 0 diff --git a/html/changelogs/wizardwars.yml b/html/changelogs/wizardwars.yml new file mode 100644 index 00000000000..ac0f4ad93ac --- /dev/null +++ b/html/changelogs/wizardwars.yml @@ -0,0 +1,6 @@ +author: Exxion + +delete-after: True + +changes: +- rscadd: "Added Wizard Wars admin event, accessible through the same button as Highlander. It's pretty much Highlander except with wizards. I recommend playing MAGIC MISSILE when you start it."