mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Spiritual successor and extension to #17798, an almost entire rebuild of the SQL ban system backend and interface. Bantypes are removed per #8584 and #6174. All bans are now 'role bans', server bans are when a ban's role is server. Admin bans are a column, meaning it's possible to ban admins from jobs. Bans now have only an expiry datetime, duration is calculated from this when queried. unbanned column is removed as it's superfluous, checking unban status is now done through checking unban_datetime. unban_round_id column added. Each ip and computerid columns rearranged so ip is always first, like in other tables. Bans now permit a null ckey, ip and computerid. Ban checking is split into two procs now is_banned_from() does a check if a ckey is banned from one or more roles and returns true or false. This effectively replaces jobban_isbanned() used in simple if() statements. If connected a client's ban cache is checked rather than querying the DB. This makes it possible for a client connected to two or more servers to ignore any bans made on one server until their ban cache is rebuilt on the others. Could be avoided with cross-server calls to update ban caches or just the removal of the ban cache but as is I've done neither since I think it's enough of an edge case to not be worth it. The second proc is is_banned_from_with_details(), this queries the DB for a role ban on a player's ckey, ip or CID and returns the details. This replaces direct queries in IsBanned.dm and the preferences menu. The legacy ban system is removed. The interfaces for banning, unbanning and editing bans have been remade to require less clicking and easier simultaneous operations. The banning and jobban panel are combined. They also store player connection details when opened so a client disconnecting no longer stops a ban being placed. New banning panel: Key, IP and CID can all be toggled to allow excluding them from a ban. Checking Use IP and CID from last connection lets you enter only a ckey and have the DB fill these fields in for you, if possible. Temporary bans have a drop-menu which lets you select between seconds, minutes, hours, days, weeks, months and years so you don't need to calculate how many minutes a long ban would be. The ban is still converted into minutes on the DB however. Checking any of the head roles will check both of the boxes for you. The red role box indicates there is already a ban on that role for this ckey. You can apply additional role bans to stack them. New unbanning panel: Unbanning panel is now separate from the banning panel but otherwise functionally the same. Ban editing panel: Actually just a modified banning panel, all the features from it work the same here. You can now edit almost all parameters of a ban instead of just the reason. You can't edit severity as it's not really part of the ban. The panels have been tested but I've not been able to get my local server to be accessible so ban functionality isn't properly confirmed. Plenty of testing will be required as I'd rather not break bans. cl admin: Ban interface rework. The banning and unbanning panels have received a new design which is easier to use and allows multiple role bans to be made at once. prefix: Ban search and unbanning moved to unbanning panel, which is now a separate panel to the old banning panel. /cl
328 lines
13 KiB
Plaintext
328 lines
13 KiB
Plaintext
/datum/disease/transformation
|
|
name = "Transformation"
|
|
max_stages = 5
|
|
spread_text = "Acute"
|
|
spread_flags = DISEASE_SPREAD_SPECIAL
|
|
cure_text = "A coder's love (theoretical)."
|
|
agent = "Shenanigans"
|
|
viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey, /mob/living/carbon/alien)
|
|
severity = DISEASE_SEVERITY_BIOHAZARD
|
|
stage_prob = 10
|
|
visibility_flags = HIDDEN_SCANNER|HIDDEN_PANDEMIC
|
|
disease_flags = CURABLE
|
|
var/list/stage1 = list("You feel unremarkable.")
|
|
var/list/stage2 = list("You feel boring.")
|
|
var/list/stage3 = list("You feel utterly plain.")
|
|
var/list/stage4 = list("You feel white bread.")
|
|
var/list/stage5 = list("Oh the humanity!")
|
|
var/new_form = /mob/living/carbon/human
|
|
var/bantype
|
|
|
|
/datum/disease/transformation/Copy()
|
|
var/datum/disease/transformation/D = ..()
|
|
D.stage1 = stage1.Copy()
|
|
D.stage2 = stage2.Copy()
|
|
D.stage3 = stage3.Copy()
|
|
D.stage4 = stage4.Copy()
|
|
D.stage5 = stage5.Copy()
|
|
D.new_form = D.new_form
|
|
return D
|
|
|
|
/datum/disease/transformation/stage_act()
|
|
..()
|
|
switch(stage)
|
|
if(1)
|
|
if (prob(stage_prob) && stage1)
|
|
to_chat(affected_mob, pick(stage1))
|
|
if(2)
|
|
if (prob(stage_prob) && stage2)
|
|
to_chat(affected_mob, pick(stage2))
|
|
if(3)
|
|
if (prob(stage_prob*2) && stage3)
|
|
to_chat(affected_mob, pick(stage3))
|
|
if(4)
|
|
if (prob(stage_prob*2) && stage4)
|
|
to_chat(affected_mob, pick(stage4))
|
|
if(5)
|
|
do_disease_transformation(affected_mob)
|
|
|
|
/datum/disease/transformation/proc/do_disease_transformation(mob/living/affected_mob)
|
|
if(istype(affected_mob, /mob/living/carbon) && affected_mob.stat != DEAD)
|
|
if(stage5)
|
|
to_chat(affected_mob, pick(stage5))
|
|
if(QDELETED(affected_mob))
|
|
return
|
|
if(affected_mob.notransform)
|
|
return
|
|
affected_mob.notransform = 1
|
|
for(var/obj/item/W in affected_mob.get_equipped_items(TRUE))
|
|
affected_mob.dropItemToGround(W)
|
|
for(var/obj/item/I in affected_mob.held_items)
|
|
affected_mob.dropItemToGround(I)
|
|
var/mob/living/new_mob = new new_form(affected_mob.loc)
|
|
if(istype(new_mob))
|
|
if(bantype && is_banned_from(affected_mob.ckey, bantype))
|
|
replace_banned_player(new_mob)
|
|
new_mob.a_intent = INTENT_HARM
|
|
if(affected_mob.mind)
|
|
affected_mob.mind.transfer_to(new_mob)
|
|
else
|
|
new_mob.key = affected_mob.key
|
|
|
|
new_mob.name = affected_mob.real_name
|
|
new_mob.real_name = new_mob.name
|
|
qdel(affected_mob)
|
|
|
|
/datum/disease/transformation/proc/replace_banned_player(var/mob/living/new_mob) // This can run well after the mob has been transferred, so need a handle on the new mob to kill it if needed.
|
|
set waitfor = FALSE
|
|
|
|
var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [affected_mob.name]?", bantype, null, bantype, 50, affected_mob)
|
|
if(LAZYLEN(candidates))
|
|
var/mob/dead/observer/C = pick(candidates)
|
|
to_chat(affected_mob, "Your mob has been taken over by a ghost! Appeal your job ban if you want to avoid this in the future!")
|
|
message_admins("[key_name_admin(C)] has taken control of ([key_name_admin(affected_mob)]) to replace a jobbanned player.")
|
|
affected_mob.ghostize(0)
|
|
affected_mob.key = C.key
|
|
else
|
|
to_chat(new_mob, "Your mob has been claimed by death! Appeal your job ban if you want to avoid this in the future!")
|
|
new_mob.death()
|
|
if (!QDELETED(new_mob))
|
|
new_mob.ghostize(can_reenter_corpse = FALSE)
|
|
new_mob.key = null
|
|
|
|
/datum/disease/transformation/jungle_fever
|
|
name = "Jungle Fever"
|
|
cure_text = "Death."
|
|
cures = list("adminordrazine")
|
|
spread_text = "Monkey Bites"
|
|
spread_flags = DISEASE_SPREAD_SPECIAL
|
|
viable_mobtypes = list(/mob/living/carbon/monkey, /mob/living/carbon/human)
|
|
permeability_mod = 1
|
|
cure_chance = 1
|
|
disease_flags = CAN_CARRY|CAN_RESIST
|
|
desc = "Monkeys with this disease will bite humans, causing humans to mutate into a monkey."
|
|
severity = DISEASE_SEVERITY_BIOHAZARD
|
|
stage_prob = 4
|
|
visibility_flags = 0
|
|
agent = "Kongey Vibrion M-909"
|
|
new_form = /mob/living/carbon/monkey
|
|
bantype = ROLE_MONKEY
|
|
|
|
|
|
stage1 = list()
|
|
stage2 = list()
|
|
stage3 = list()
|
|
stage4 = list("<span class='warning'>Your back hurts.</span>", "<span class='warning'>You breathe through your mouth.</span>",
|
|
"<span class='warning'>You have a craving for bananas.</span>", "<span class='warning'>Your mind feels clouded.</span>")
|
|
stage5 = list("<span class='warning'>You feel like monkeying around.</span>")
|
|
|
|
/datum/disease/transformation/jungle_fever/do_disease_transformation(mob/living/carbon/affected_mob)
|
|
if(affected_mob.mind && !is_monkey(affected_mob.mind))
|
|
add_monkey(affected_mob.mind)
|
|
if(ishuman(affected_mob))
|
|
var/mob/living/carbon/monkey/M = affected_mob.monkeyize(TR_KEEPITEMS | TR_KEEPIMPLANTS | TR_KEEPORGANS | TR_KEEPDAMAGE | TR_KEEPVIRUS | TR_KEEPSE)
|
|
M.ventcrawler = VENTCRAWLER_ALWAYS
|
|
|
|
|
|
/datum/disease/transformation/jungle_fever/stage_act()
|
|
..()
|
|
switch(stage)
|
|
if(2)
|
|
if(prob(2))
|
|
to_chat(affected_mob, "<span class='notice'>Your [pick("back", "arm", "leg", "elbow", "head")] itches.</span>")
|
|
if(3)
|
|
if(prob(4))
|
|
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head.</span>")
|
|
affected_mob.confused += 10
|
|
if(4)
|
|
if(prob(3))
|
|
affected_mob.say(pick("Eeek, ook ook!", "Eee-eeek!", "Eeee!", "Ungh, ungh."), forced = "jungle fever")
|
|
|
|
/datum/disease/transformation/jungle_fever/cure()
|
|
remove_monkey(affected_mob.mind)
|
|
..()
|
|
|
|
/datum/disease/transformation/jungle_fever/monkeymode
|
|
visibility_flags = HIDDEN_SCANNER|HIDDEN_PANDEMIC
|
|
disease_flags = CAN_CARRY //no vaccines! no cure!
|
|
|
|
/datum/disease/transformation/jungle_fever/monkeymode/after_add()
|
|
if(affected_mob && !is_monkey_leader(affected_mob.mind))
|
|
visibility_flags = NONE
|
|
|
|
|
|
|
|
/datum/disease/transformation/robot
|
|
|
|
name = "Robotic Transformation"
|
|
cure_text = "An injection of copper."
|
|
cures = list("copper")
|
|
cure_chance = 5
|
|
agent = "R2D2 Nanomachines"
|
|
desc = "This disease, actually acute nanomachine infection, converts the victim into a cyborg."
|
|
severity = DISEASE_SEVERITY_BIOHAZARD
|
|
visibility_flags = 0
|
|
stage1 = list()
|
|
stage2 = list("Your joints feel stiff.", "<span class='danger'>Beep...boop..</span>")
|
|
stage3 = list("<span class='danger'>Your joints feel very stiff.</span>", "Your skin feels loose.", "<span class='danger'>You can feel something move...inside.</span>")
|
|
stage4 = list("<span class='danger'>Your skin feels very loose.</span>", "<span class='danger'>You can feel... something...inside you.</span>")
|
|
stage5 = list("<span class='danger'>Your skin feels as if it's about to burst off!</span>")
|
|
new_form = /mob/living/silicon/robot
|
|
infectable_biotypes = list(MOB_ORGANIC, MOB_UNDEAD, MOB_ROBOTIC)
|
|
bantype = "Cyborg"
|
|
|
|
/datum/disease/transformation/robot/stage_act()
|
|
..()
|
|
switch(stage)
|
|
if(3)
|
|
if (prob(8))
|
|
affected_mob.say(pick("Beep, boop", "beep, beep!", "Boop...bop"), forced = "robotic transformation")
|
|
if (prob(4))
|
|
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head.</span>")
|
|
affected_mob.Unconscious(40)
|
|
if(4)
|
|
if (prob(20))
|
|
affected_mob.say(pick("beep, beep!", "Boop bop boop beep.", "kkkiiiill mmme", "I wwwaaannntt tttoo dddiiieeee..."), forced = "robotic transformation")
|
|
|
|
|
|
/datum/disease/transformation/xeno
|
|
|
|
name = "Xenomorph Transformation"
|
|
cure_text = "Spaceacillin & Glycerol"
|
|
cures = list("spaceacillin", "glycerol")
|
|
cure_chance = 5
|
|
agent = "Rip-LEY Alien Microbes"
|
|
desc = "This disease changes the victim into a xenomorph."
|
|
severity = DISEASE_SEVERITY_BIOHAZARD
|
|
visibility_flags = 0
|
|
stage1 = list()
|
|
stage2 = list("Your throat feels scratchy.", "<span class='danger'>Kill...</span>")
|
|
stage3 = list("<span class='danger'>Your throat feels very scratchy.</span>", "Your skin feels tight.", "<span class='danger'>You can feel something move...inside.</span>")
|
|
stage4 = list("<span class='danger'>Your skin feels very tight.</span>", "<span class='danger'>Your blood boils!</span>", "<span class='danger'>You can feel... something...inside you.</span>")
|
|
stage5 = list("<span class='danger'>Your skin feels as if it's about to burst off!</span>")
|
|
new_form = /mob/living/carbon/alien/humanoid/hunter
|
|
bantype = ROLE_ALIEN
|
|
|
|
/datum/disease/transformation/xeno/stage_act()
|
|
..()
|
|
switch(stage)
|
|
if(3)
|
|
if (prob(4))
|
|
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head.</span>")
|
|
affected_mob.Unconscious(40)
|
|
if(4)
|
|
if (prob(20))
|
|
affected_mob.say(pick("You look delicious.", "Going to... devour you...", "Hsssshhhhh!"), forced = "xenomorph transformation")
|
|
|
|
|
|
/datum/disease/transformation/slime
|
|
name = "Advanced Mutation Transformation"
|
|
cure_text = "frost oil"
|
|
cures = list("frostoil")
|
|
cure_chance = 80
|
|
agent = "Advanced Mutation Toxin"
|
|
desc = "This highly concentrated extract converts anything into more of itself."
|
|
severity = DISEASE_SEVERITY_BIOHAZARD
|
|
visibility_flags = 0
|
|
stage1 = list("You don't feel very well.")
|
|
stage2 = list("Your skin feels a little slimy.")
|
|
stage3 = list("<span class='danger'>Your appendages are melting away.</span>", "<span class='danger'>Your limbs begin to lose their shape.</span>")
|
|
stage4 = list("<span class='danger'>You are turning into a slime.</span>")
|
|
stage5 = list("<span class='danger'>You have become a slime.</span>")
|
|
new_form = /mob/living/simple_animal/slime/random
|
|
|
|
/datum/disease/transformation/slime/stage_act()
|
|
..()
|
|
switch(stage)
|
|
if(1)
|
|
if(ishuman(affected_mob) && affected_mob.dna)
|
|
if(affected_mob.dna.species.id == "slime" || affected_mob.dna.species.id == "stargazer" || affected_mob.dna.species.id == "lum")
|
|
stage = 5
|
|
if(3)
|
|
if(ishuman(affected_mob))
|
|
var/mob/living/carbon/human/human = affected_mob
|
|
if(human.dna.species.id != "slime" && affected_mob.dna.species.id != "stargazer" && affected_mob.dna.species.id != "lum")
|
|
human.set_species(/datum/species/jelly/slime)
|
|
|
|
/datum/disease/transformation/corgi
|
|
name = "The Barkening"
|
|
cure_text = "Death"
|
|
cures = list("adminordrazine")
|
|
agent = "Fell Doge Majicks"
|
|
desc = "This disease transforms the victim into a corgi."
|
|
severity = DISEASE_SEVERITY_BIOHAZARD
|
|
visibility_flags = 0
|
|
stage1 = list("BARK.")
|
|
stage2 = list("You feel the need to wear silly hats.")
|
|
stage3 = list("<span class='danger'>Must... eat... chocolate....</span>", "<span class='danger'>YAP</span>")
|
|
stage4 = list("<span class='danger'>Visions of washing machines assail your mind!</span>")
|
|
stage5 = list("<span class='danger'>AUUUUUU!!!</span>")
|
|
new_form = /mob/living/simple_animal/pet/dog/corgi
|
|
|
|
/datum/disease/transformation/corgi/stage_act()
|
|
..()
|
|
switch(stage)
|
|
if(3)
|
|
if (prob(8))
|
|
affected_mob.say(pick("YAP", "Woof!"), forced = "corgi transformation")
|
|
if(4)
|
|
if (prob(20))
|
|
affected_mob.say(pick("Bark!", "AUUUUUU"), forced = "corgi transformation")
|
|
|
|
/datum/disease/transformation/morph
|
|
name = "Gluttony's Blessing"
|
|
cure_text = "Unknown" //Yogs - changed "nothing" to "unknown"
|
|
cures = list("adminordrazine")
|
|
agent = "Gluttony's Blessing"
|
|
desc = "A 'gift' from somewhere terrible."
|
|
stage_prob = 20
|
|
severity = DISEASE_SEVERITY_BIOHAZARD
|
|
visibility_flags = 0
|
|
stage1 = list("Your stomach rumbles.")
|
|
stage2 = list("Your skin feels saggy.")
|
|
stage3 = list("<span class='danger'>Your appendages are melting away.</span>", "<span class='danger'>Your limbs begin to lose their shape.</span>")
|
|
stage4 = list("<span class='danger'>You're ravenous.</span>")
|
|
stage5 = list("<span class='danger'>You have become a morph.</span>")
|
|
new_form = /mob/living/simple_animal/hostile/morph
|
|
infectable_biotypes = list(MOB_ORGANIC, MOB_INORGANIC, MOB_UNDEAD) //magic!
|
|
|
|
/datum/disease/transformation/gondola
|
|
name = "Gondola Transformation"
|
|
cure_text = "Condensed Capsaicin, ingested or injected." //getting pepper sprayed doesn't help
|
|
cures = list("condensedcapsaicin") //beats the hippie crap right out of your system
|
|
cure_chance = 80
|
|
stage_prob = 5
|
|
agent = "Tranquility"
|
|
desc = "Consuming the flesh of a Gondola comes at a terrible price."
|
|
severity = DISEASE_SEVERITY_BIOHAZARD
|
|
visibility_flags = 0
|
|
stage1 = list("You seem a little lighter in your step.")
|
|
stage2 = list("You catch yourself smiling for no reason.")
|
|
stage3 = list("<span class='danger'>A cruel sense of calm overcomes you.</span>", "<span class='danger'>You can't feel your arms!</span>", "<span class='danger'>You let go of the urge to hurt clowns.</span>")
|
|
stage4 = list("<span class='danger'>You can't feel your arms. It does not bother you anymore.</span>", "<span class='danger'>You forgive the clown for hurting you.</span>")
|
|
stage5 = list("<span class='danger'>You have become a Gondola.</span>")
|
|
new_form = /mob/living/simple_animal/pet/gondola
|
|
|
|
/datum/disease/transformation/gondola/stage_act()
|
|
..()
|
|
switch(stage)
|
|
if(2)
|
|
if (prob(5))
|
|
affected_mob.emote("smile")
|
|
if (prob(20))
|
|
affected_mob.reagents.add_reagent_list(list("pax" = 5))
|
|
if(3)
|
|
if (prob(5))
|
|
affected_mob.emote("smile")
|
|
if (prob(20))
|
|
affected_mob.reagents.add_reagent_list(list("pax" = 5))
|
|
if(4)
|
|
if (prob(5))
|
|
affected_mob.emote("smile")
|
|
if (prob(20))
|
|
affected_mob.reagents.add_reagent_list(list("pax" = 5))
|
|
if (prob(2))
|
|
to_chat(affected_mob, "<span class='danger'>You let go of what you were holding.</span>")
|
|
var/obj/item/I = affected_mob.get_active_held_item()
|
|
affected_mob.dropItemToGround(I)
|