Virus stuff (#7738)

This commit is contained in:
Guti
2024-02-15 23:22:35 +01:00
committed by GitHub
parent 60333859ce
commit 03fca7650e
6 changed files with 106 additions and 7 deletions

View File

@@ -83,7 +83,7 @@
// Temporary power failure, but mitigatead by subgrids
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Grid Check", /datum/event/grid_check, 0, list(ASSIGNMENT_SCIENTIST = 10, ASSIGNMENT_ENGINEER = 25), 1),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Grub Infestation", /datum/event/grub_infestation, -20, list(ASSIGNMENT_SECURITY = 40, ASSIGNMENT_ENGINEER = 40), 1),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Infected Room", /datum/event/infectedroom, -30, list(ASSIGNMENT_MEDICAL = 30, ASSIGNMENT_JANITOR = 10), 1, min_jobs = list(ASSIGNMENT_MEDICAL = 2)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Infected Room", /datum/event/infectedroom, -30, list(ASSIGNMENT_MEDICAL = 30, ASSIGNMENT_JANITOR = 10, ASSIGNMENT_ANY = 1), 1, min_jobs = list(ASSIGNMENT_MEDICAL = 2)),
// Pure RP fun, no mechanical effects.
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Ion Storm", /datum/event/ionstorm, 0, list(ASSIGNMENT_AI = 80, ASSIGNMENT_CYBORG = 50, ASSIGNMENT_ENGINEER = 15, ASSIGNMENT_SCIENTIST = 5), min_jobs = list(ASSIGNMENT_AI = 1)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Jellyfish School", /datum/event/jellyfish_migration, 5, list(ASSIGNMENT_ANY = 1, ASSIGNMENT_SECURITY = 5, ASSIGNMENT_MEDICAL = 3), 1),
@@ -127,7 +127,7 @@
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Carp Migration", /datum/event/carp_migration, -110, list(ASSIGNMENT_SECURITY = 50, ASSIGNMENT_HOS = 10, ASSIGNMENT_WARDEN = 10), 1, min_jobs = list(ASSIGNMENT_SECURITY = 3)),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Exotic Horde Infestation", /datum/event/highdangerinfestation, -50, list(ASSIGNMENT_ENGINEER = 20, ASSIGNMENT_SCIENCE = 5, ASSIGNMENT_ANY = 2)),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Horde Infestation", /datum/event/horde_infestation, -60, list(ASSIGNMENT_SECURITY = 20, ASSIGNMENT_HOS = 10, ASSIGNMENT_WARDEN = 10, ASSIGNMENT_ANY = 3), 0),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Infected Room", /datum/event/infectedroom, -50, list(ASSIGNMENT_MEDICAL = 25, ASSIGNMENT_JANITOR = 10), 1, min_jobs = list(ASSIGNMENT_MEDICAL = 2)),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Infected Room", /datum/event/infectedroom, -50, list(ASSIGNMENT_MEDICAL = 25, ASSIGNMENT_JANITOR = 10, ASSIGNMENT_ANY = 1), 1, min_jobs = list(ASSIGNMENT_MEDICAL = 2)),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Jellyfish Migration", /datum/event/jellyfish_migration, 5, list(ASSIGNMENT_ANY = 1, ASSIGNMENT_SECURITY = 5, ASSIGNMENT_MEDICAL = 3), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meaty Ores Wave", /datum/event/meteor_wave/meatyores, -90, list(ASSIGNMENT_ENGINEER = 50, ASSIGNMENT_MEDICAL = 10, ASSIGNMENT_ANY = 1), 1, min_jobs = list(ASSIGNMENT_ENGINEER = 1)),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meteor Wave", /datum/event/meteor_wave, -90, list(ASSIGNMENT_ENGINEER = 50, ASSIGNMENT_MEDICAL = 10, ASSIGNMENT_ANY = 1), 1, min_jobs = list(ASSIGNMENT_ENGINEER = 1)),

View File

@@ -8,19 +8,56 @@
/area/shuttle,
/area/crew_quarters,
/area/holodeck,
/area/engineering/engine_room
/area/engineering/engine_room)
var/commondisease = list(
"Friday Fever" = list(
/datum/disease2/effect/choreomania,
/datum/disease2/effect/spin,
/datum/disease2/effect/flip,
/datum/disease2/effect/scream),
"Common Cold" = list(
/datum/disease2/effect/sneeze,
/datum/disease2/effect/cough,
/datum/disease2/effect/fridge,
/datum/disease2/effect/drowsness),
"Brain Bloat" = list(
/datum/disease2/effect/invisible,
/datum/disease2/effect/headache,
/datum/disease2/effect/telepathic,
/datum/disease2/effect/nothing
),
"Glutton's Gut" = list(
/datum/disease2/effect/drool,
/datum/disease2/effect/hungry,
/datum/disease2/effect/pica,
/datum/disease2/effect/nothing
),
"Motor System Impairment" = list(
/datum/disease2/effect/twitch,
/datum/disease2/effect/jellylegs,
/datum/disease2/effect/spin,
/datum/disease2/effect/groan
)
)
/datum/event/infectedroom/setup()
announceWhen = rand(0, 3000)
endWhen = announceWhen + 1
var/list/area/affected_area = get_station_areas(excluded)
var/chosenvirus = pick(commondisease)
if(severity == EVENT_LEVEL_MAJOR)
virus.makerandom(rand(2,3))
if(prob(75))
virus.makerandom(rand(2,3))
else
virus.makedisease(commondisease[chosenvirus], rand(2,3), chosenvirus)
infected_tiles = rand(4, 8)
else if(severity == EVENT_LEVEL_MODERATE)
virus.makerandom(2)
if(prob(50))
virus.makerandom(2)
else
virus.makedisease(commondisease[chosenvirus], 2, chosenvirus)
infected_tiles = rand(3, 6)
else
virus.makerandom(1)

View File

@@ -0,0 +1,55 @@
/*
To make a custom disease, make a list with 4 symptoms, give it the severity and a name if you wish.
This is mostly useful for mapping, events or some mobs.
Example custom virus:
var/datum/disease2/disease/virus = new
virus.makedisease(list(
/datum/disease2/effect/invisible,
/datum/disease2/effect/invisible,
/datum/disease2/effect/invisible,
/datum/disease2/effect/invisible
), 2, "Invis")
var/obj/effect/decal/cleanable/mucus/mapped/M
M.virus2[1] = virus.getcopy()
This will create a disease without effects, mildly infectious and with "Invis" as name,
then added to some mucus on the ground for out dear explo team to step on it and get infected.
*/
/datum/disease2/disease/proc/makedisease(symptom, severity, dname)
for(var/i in 1 to 4)
var/datum/disease2/effectholder/holder = new /datum/disease2/effectholder
var/Etype = symptom[i]
holder.stage = i
holder.effect = new Etype()
holder.effect.generate()
holder.chance = rand(0,holder.effect.chance_maxm)
holder.multiplier = rand(1,holder.effect.maxm)
effects += holder
if(dname)
name = "[dname]"
uniqueID = rand(0,10000)
switch(severity)
if(1)
infectionchance = 1
if(2)
infectionchance = rand(15,25)
else
infectionchance = rand(60,90)
antigen = list(pick(ALL_ANTIGENS))
antigen |= pick(ALL_ANTIGENS)
spreadtype = prob(70) ? "Airborne" : "Contact"
resistance = rand(15,70)
if(severity >= 2 && prob(33))
resistance += 10
if(GLOB.all_species.len)
affected_species = get_infectable_species()