Adds Wizard Wars admin event (#10965)

* Wizard Wars

* No casting during invincibility period

* Removes fuck, adds testing

* Fuck it, let's do both

* Here I fixed it
This commit is contained in:
Exxion
2016-08-12 23:27:02 -04:00
committed by clusterfack
parent 3ac5b5db78
commit 9c09e44f51
4 changed files with 106 additions and 23 deletions

View File

@@ -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

View File

@@ -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, "<B>You are a highlander!</B>")
var/obj_count = 1
for(var/datum/objective/OBJ in H.mind.objectives)
to_chat(H, "<B>Objective #[obj_count]</B>: [OBJ.explanation_text]")
obj_count++
to_chat(H, "<B>Objective #[obj_count++]</B>: [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)
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, "<span class='danger'>You are a Space Wizard!</span>")
var/obj_count = 1
for(var/datum/objective/OBJ in H.mind.objectives)
to_chat(H, "<B>Objective #[obj_count++]</B>: [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, "<span class='notice'>Your solid plasma vanishes, leaving behind only bones!</span>")
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, "<span class='info'>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.</span>")
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, "<span class='warning'>Invincibility period over. Let the battle begin!</span>")

View File

@@ -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, "<span class='warning'>Your power is suppressed!</span>")
return 0
if(!(src in user.spell_list) && holder == user)
to_chat(user, "<span class='warning'>You shouldn't have this spell! Something's wrong.</span>")
return 0

View File

@@ -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."