Fixes some of the issue with some of the diseases spawning an infinite number of items.

This commit is contained in:
ririchiyo
2014-09-25 18:23:49 -04:00
parent 99ea0706e3
commit 9419af4b6b
4 changed files with 57 additions and 8 deletions

View File

@@ -743,6 +743,7 @@ var/global/floorIsLava = 0
<A href='?src=\ref[src];secretscoder=maint_access_engiebrig'>Change all maintenance doors to engie/brig access only</A><BR>
<A href='?src=\ref[src];secretscoder=maint_access_brig'>Change all maintenance doors to brig access only</A><BR>
<A href='?src=\ref[src];secretscoder=infinite_sec'>Remove cap on security officers</A><BR>
<a href='?src=\ref[src];secretscoder=virus_custom'>Custom Virus Outbreak</a><BR>
<BR>
<B>Coder Secrets</B><BR>
<BR>

View File

@@ -2582,6 +2582,10 @@
J.total_positions = -1
J.spawn_positions = -1
message_admins("[key_name_admin(usr)] has removed the cap on security officers.")
if("virus_custom")
virus2_make_custom(usr.client)
feedback_add_details("admin_secrets_fun_used", "V_C")
message_admins("[key_name_admin(usr)] has trigger a custom virus outbreak.", 1)
else if(href_list["ac_view_wanted"]) //Admin newscaster Topic() stuff be here
src.admincaster_screen = 18 //The ac_ prefix before the hrefs stands for AdminCaster.

View File

@@ -16,7 +16,7 @@
/datum/disease2/disease/New(var/notes="No notes.")
uniqueID = rand(0,10000)
log += "<br />[timestamp()] CREATED - [notes]"
log += "<br />[timestamp()] CREATED - [notes]<br>"
..()
/datum/disease2/disease/proc/makerandom(var/greater=0)
@@ -34,6 +34,38 @@
antigen |= text2num(pick(ANTIGENS))
spreadtype = prob(70) ? "Airborne" : "Contact"
/proc/virus2_make_custom(client/C)
if(!C.holder || !istype(C))
return 0
if(!(C.holder.rights & R_DEBUG))
return 0
var/mob/living/carbon/infectedMob = input(C, "Select person to infect", "Infect Person") in (player_list) // get the selected mob
if(!istype(infectedMob))
return // return if isn't proper mob type
var/datum/disease2/disease/D = new /datum/disease2/disease("custom_disease") //set base name
for(var/i = 1; i <= D.max_stage; i++) // run through this loop until everything is set
var/datum/disease2/effect/sympton = input(C, "Choose a sympton to add ([5-i] remaining)", "Choose a Sympton") in ((typesof(/datum/disease2/effect) - /datum/disease2/effect)) // choose a sympton from the list of them
var/datum/disease2/effectholder/holder = new /datum/disease2/effectholder(infectedMob) // create the infectedMob as a holder for it.
holder.stage = i // set the stage of this holder equal to i.
var/datum/disease2/effect/f = new sympton // initalize the new sympton
holder.effect = f // assign the new sympton to the holder
holder.chance = input(C, "Choose chance", "Chance") as num // set the chance of the sympton that can occur
D.log += "[f.name] [holder.chance]%<br>"
D.effects += holder // add the holder to the disease
D.uniqueID = rand(0, 10000)
D.infectionchance = input(C, "Choose an infection rate percent", "Infection Rate") as num
//pick random antigens for the disease to have
D.antigen |= text2num(pick(ANTIGENS))
D.antigen |= text2num(pick(ANTIGENS))
D.spreadtype = input(C, "Select spread type", "Spread Type") in list("Airborne", "Contact") // select how the disease is spread
infectedMob.virus2["[D.uniqueID]"] = D // assign the disease datum to the infectedMob/ selected user.
log_admin("[infectedMob] was infected with a virus with uniqueID : [D.uniqueID] by [C.ckey]")
message_admins("[infectedMob] was infected with a virus with uniqueID : [D.uniqueID] by [C.ckey]")
return 1
/datum/disease2/disease/proc/activate(var/mob/living/carbon/mob)
if(dead)
cure(mob)

View File

@@ -490,15 +490,20 @@
/datum/disease2/effect/elvis
name = "Elvisism"
stage = 3
activate(var/mob/living/carbon/mob,var/multiplier)
//
if(!istype(mob))
return
var/mob/living/carbon/human/H = mob
var/obj/item/clothing/glasses/virussunglasses = new /obj/item/clothing/glasses/virussunglasses
mob.equip_to_slot(virussunglasses, slot_glasses)
if(H.glasses && !istype(H.glasses, /obj/item/clothing/glasses/virussunglasses))
mob.u_equip(H.glasses)
mob.equip_to_slot(virussunglasses, slot_glasses)
if(!slot_glasses)
mob.equip_to_slot(virussunglasses, slot_glasses)
mob.confused += 10
@@ -511,7 +516,6 @@
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
if(H.species.name == "Human" && !(H.f_style == "Pompadour"))
spawn(50)
H.h_style = "Pompadour"
@@ -550,7 +554,11 @@
activate(var/mob/living/carbon/mob,var/multiplier)
//
var/obj/item/clothing/mask/gas/virusclown_hat = new /obj/item/clothing/mask/gas/virusclown_hat
mob.equip_to_slot(virusclown_hat, slot_wear_mask)
if(mob.wear_mask && !istype(mob.wear_mask, /obj/item/clothing/mask/gas/virusclown_hat))
mob.u_equip(mob.wear_mask)
mob.equip_to_slot(virusclown_hat, slot_wear_mask)
if(!mob.wear_mask)
mob.equip_to_slot(virusclown_hat, slot_wear_mask)
mob.reagents.add_reagent("psilocybin", 20)
mob.say(pick("HONK!", "Honk!", "Honk.", "Honk?", "Honk!!", "Honk?!", "Honk..."))
@@ -583,7 +591,11 @@ var/list/compatible_mobs = list(/mob/living/carbon/human, /mob/living/carbon/mon
var/obj/item/clothing/mask/horsehead/magic/magichead = new /obj/item/clothing/mask/horsehead/magic
mob.equip_to_slot(magichead, slot_wear_mask)
if(mob.wear_mask && !istype(mob.wear_mask, /obj/item/clothing/mask/horsehead/magic))
mob.u_equip(mob.wear_mask)
mob.equip_to_slot(magichead, slot_wear_mask)
if(!mob.wear_mask)
mob.equip_to_slot(magichead, slot_wear_mask)
mob << "<span class='warning'>You feel a little horse!</span>"