diff --git a/code/__HELPERS/turfs.dm b/code/__HELPERS/turfs.dm index 85836281143..c4bae51ff74 100644 --- a/code/__HELPERS/turfs.dm +++ b/code/__HELPERS/turfs.dm @@ -12,9 +12,16 @@ /proc/isfloor(turf/T) return (istype(T, /turf/simulated/floor) || istype(T, /turf/unsimulated/floor) || istype(T, /turf/simulated/shuttle/floor)) + +//Edit by Nanako +//This proc is used in only two places, ive changed it to make more sense +//The old behaviour returned zero if there were any simulated atoms at all, even pipes and wires +//Now it just finds if the tile is blocked by anything solid. /proc/turf_clear(turf/T) + if (T.density) + return 0 for(var/atom/A in T) - if(A.simulated) + if(A.density) return 0 return 1 diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 9b207f8ae61..cfa657fd5b9 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -92,7 +92,7 @@ var/power = 2 var/power_step = 0.75 var/dest - var/shieldsoundrange = 220 // The maximum number of tiles away the sound can be heard, falls off over distance, so it will be quiet near the limit + var/shieldsoundrange = 260 // The maximum number of tiles away the sound can be heard, falls off over distance, so it will be quiet near the limit pass_flags = PASSTABLE var/done = 0//This is set to 1 when the meteor is done colliding, and is used to ignore additional bumps while waiting for deletion @@ -105,7 +105,7 @@ power_step = 0.5 hits = 2 detonation_chance = 30 - shieldsoundrange = 120 + shieldsoundrange = 160 /obj/effect/meteor/Destroy() @@ -236,7 +236,8 @@ for(var/mob/M in world) - if(M.client && M.z == T.z) + var/turf/mobloc = get_turf(M) + if(M.client && mobloc.z == T.z) if(M.ear_deaf <= 0 || !M.ear_deaf) M.playsound_local(T, 'sound/effects/meteorimpact.ogg', range, 1, usepressure = 0) diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 62c13c7e616..fe521d4371c 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -96,6 +96,7 @@ layer = 2.7 health = 3 var/amount_grown = -1 + var/growth_rate = 1 var/obj/machinery/atmospherics/unary/vent_pump/entry_vent var/travelling_in_vent = 0 New() @@ -184,7 +185,7 @@ if(prob(1)) src.visible_message("\blue \the [src] chitters.") if(isturf(loc) && amount_grown > 0) - amount_grown += rand(0,2) + amount_grown += (rand(0,2)*growth_rate) if(amount_grown >= 100) var/spawn_type = pick(typesof(/mob/living/simple_animal/hostile/giant_spider)) new spawn_type(src.loc) diff --git a/code/modules/events/event_container.dm b/code/modules/events/event_container.dm index edb9d74051b..af1fe206a99 100644 --- a/code/modules/events/event_container.dm +++ b/code/modules/events/event_container.dm @@ -127,9 +127,9 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT severity = EVENT_LEVEL_MUNDANE available_events = list( // Severity level, event name, even type, base weight, role weights, one shot, min weight, max weight. Last two only used if set and non-zero - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Nothing", /datum/event/nothing, 100), - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "APC Damage", /datum/event/apc_damage, 20, list(ASSIGNMENT_ENGINEER = 10)), - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Brand Intelligence",/datum/event/brand_intelligence,20, list(ASSIGNMENT_JANITOR = 25), 1), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Nothing", /datum/event/nothing, 120), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "APC Damage", /datum/event/apc_damage, 20, list(ASSIGNMENT_ENGINEER = 15)), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Brand Intelligence",/datum/event/brand_intelligence,15, list(ASSIGNMENT_JANITOR = 20), 1), new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Camera Damage", /datum/event/camera_damage, 20, list(ASSIGNMENT_ENGINEER = 10)), new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Economic News", /datum/event/economic_event, 300), new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Lost Carp", /datum/event/carp_migration, 20, list(ASSIGNMENT_SECURITY = 10), 1), @@ -139,44 +139,44 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT new /datum/event_meta(EVENT_LEVEL_MUNDANE, "PDA Spam", /datum/event/pda_spam, 0, list(ASSIGNMENT_ANY = 3), 0, 0, 50), new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Space Dust", /datum/event/dust , 30, list(ASSIGNMENT_ENGINEER = 5), 0, 0, 50), new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Trivial News", /datum/event/trivial_news, 400), - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Vermin Infestation",/datum/event/infestation, 50, list(ASSIGNMENT_JANITOR = 50)), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Vermin Infestation",/datum/event/infestation, 60, list(ASSIGNMENT_JANITOR = 20, ASSIGNMENT_SECURITY = 10)), new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Wallrot", /datum/event/wallrot, 75, list(ASSIGNMENT_ENGINEER = 5, ASSIGNMENT_GARDENER = 20)), ) /datum/event_container/moderate severity = EVENT_LEVEL_MODERATE available_events = list( - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Nothing", /datum/event/nothing, 150), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Nothing", /datum/event/nothing, 200), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Appendicitis", /datum/event/spontaneous_appendicitis, 0, list(ASSIGNMENT_MEDICAL = 25)), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Carp School", /datum/event/carp_migration, 50, list(ASSIGNMENT_SECURITY = 25)), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Communication Blackout", /datum/event/communications_blackout, 60), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Electrical Storm", /datum/event/electrical_storm, 60, list(ASSIGNMENT_ENGINEER = 5, ASSIGNMENT_JANITOR = 20)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Electrical Storm", /datum/event/electrical_storm, 50, list(ASSIGNMENT_ENGINEER = 5, ASSIGNMENT_JANITOR = 20)), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Gravity Failure", /datum/event/gravity, 100), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Grid Check", /datum/event/grid_check, 100), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Ion Storm", /datum/event/ionstorm, 0, list(ASSIGNMENT_AI = 40, ASSIGNMENT_CYBORG = 20, ASSIGNMENT_ENGINEER = 5, ASSIGNMENT_SCIENTIST = 5)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Meteor Shower", /datum/event/meteor_shower, 50, list(ASSIGNMENT_ENGINEER = 25)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Ion Storm", /datum/event/ionstorm, 0, list(ASSIGNMENT_AI = 45, ASSIGNMENT_CYBORG = 25, ASSIGNMENT_ENGINEER = 6, ASSIGNMENT_SCIENTIST = 6)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Meteor Shower", /datum/event/meteor_shower, 40, list(ASSIGNMENT_ENGINEER = 13)), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Prison Break", /datum/event/prison_break, 0, list(ASSIGNMENT_SECURITY = 15, ASSIGNMENT_CYBORG = 20),1), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Radiation Storm", /datum/event/radiation_storm, 100), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Random Antagonist", /datum/event/random_antag, 0, list(ASSIGNMENT_ANY = 2, ASSIGNMENT_SECURITY = 1),0,10,150), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Random Antagonist", /datum/event/random_antag, 0, list(ASSIGNMENT_ANY = 1, ASSIGNMENT_SECURITY = 1),0,10,125), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Rogue Drones", /datum/event/rogue_drone, 50, list(ASSIGNMENT_SECURITY = 25)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Space Dust", /datum/event/dust, 50, list(ASSIGNMENT_ENGINEER = 5)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Space Dust", /datum/event/dust, 50, list(ASSIGNMENT_ENGINEER = 7)), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Spider Infestation", /datum/event/spider_infestation, 50, list(ASSIGNMENT_SECURITY = 25)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Viral Infection", /datum/event/viral_infection, 0, list(ASSIGNMENT_MEDICAL = 10), 1), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Viral Infection", /datum/event/viral_infection, 0, list(ASSIGNMENT_MEDICAL = 12), 1), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Major Vermin Infestation", /datum/event/infestation, 60, list(ASSIGNMENT_JANITOR = 15, ASSIGNMENT_SECURITY = 15)), ) /datum/event_container/major severity = EVENT_LEVEL_MAJOR available_events = list( - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Blob", /datum/event/blob, 40, list(ASSIGNMENT_ENGINEER = 5,ASSIGNMENT_SECURITY = 5), 1), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Nothing", /datum/event/nothing, 80), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Blob", /datum/event/blob, 50, list(ASSIGNMENT_ENGINEER = 5,ASSIGNMENT_SECURITY = 5), 1), new /datum/event_meta(EVENT_LEVEL_MAJOR, "Carp Migration", /datum/event/carp_migration, 60, list(ASSIGNMENT_SECURITY = 10), 1), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meteor Wave", /datum/event/meteor_wave, 50, list(ASSIGNMENT_ENGINEER = 15),1), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meteor Wave", /datum/event/meteor_wave, 40, list(ASSIGNMENT_ENGINEER = 10),1), new /datum/event_meta(EVENT_LEVEL_MAJOR, "Space Vines", /datum/event/spacevine, 50, list(ASSIGNMENT_ENGINEER = 10, ASSIGNMENT_GARDENER = 20), 1), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Viral Infection", /datum/event/viral_infection, 20, list(ASSIGNMENT_MEDICAL = 10), 1), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Viral Infection", /datum/event/viral_infection, 20, list(ASSIGNMENT_MEDICAL = 13), 1), ) -//NOTE: Removed "Nothing" option from moderate and severe events. -//They are already made rare and varied enough by the time delay mechanics, -//forcing a random failure to pick an event sucks, and lack of stuff happening causes lots of SSDs +//NOTE: Re added nothing option, but with fairly low weight #undef ASSIGNMENT_ANY diff --git a/code/modules/events/infestation.dm b/code/modules/events/infestation.dm index c88472688fa..96fd6e1e596 100644 --- a/code/modules/events/infestation.dm +++ b/code/modules/events/infestation.dm @@ -1,3 +1,8 @@ +//Infestation event now has two modes. +//Mundane event spawns some creatures in a place, and tells you which and where. +//Moderate event spawns twice the amount of two types of creatures, in two places. And tells you where but not what spawns + + #define LOC_KITCHEN 0 #define LOC_ATMOS 1 #define LOC_INCIN 2 @@ -7,56 +12,109 @@ #define LOC_VAULT 6 #define LOC_CONSTR 7 #define LOC_TECH 8 -#define LOC_TACTICAL 9 +#define LOC_ARMORY 9 +#define LOC_DORMS 10 +#define LOC_FITNESS 11 +#define LOC_HOLODECK 12 +#define LOC_DISPOSAL 13 +#define LOC_CARGO 14 +#define LOC_MEETING 15 +#define LOC_LOCKER 16 +#define LOC_XENO 17 + #define VERM_MICE 0 #define VERM_LIZARDS 1 #define VERM_SPIDERS 2 +#define VERM_DIYAAB 3 +#define VERM_BATS 4 +#define VERM_YITHIAN 5 +#define VERM_TINDALOS 6 /datum/event/infestation announceWhen = 10 endWhen = 11 var/location - var/locstring + var/numlocs = 0 + var/list/locstrings var/vermin var/vermstring + var/spawn_area_type + var/list/turf/simulated/floor/turfs /datum/event/infestation/start() + locstrings = new/list(2) + choose_location() + spawn_creatures() + if (severity == EVENT_LEVEL_MODERATE) + choose_location() + spawn_creatures() - location = rand(0,9) - var/list/turf/simulated/floor/turfs = list() - var/spawn_area_type + + + + +/datum/event/infestation/proc/choose_location() + + location = rand(0,17) + turfs = list() + numlocs++ switch(location) if(LOC_KITCHEN) spawn_area_type = /area/crew_quarters/kitchen - locstring = "the kitchen" + locstrings[numlocs] = "the kitchen" if(LOC_ATMOS) spawn_area_type = /area/engineering/atmos - locstring = "atmospherics" + locstrings[numlocs] = "atmospherics" if(LOC_INCIN) spawn_area_type = /area/maintenance/incinerator - locstring = "the incinerator" + locstrings[numlocs] = "the incinerator" if(LOC_CHAPEL) spawn_area_type = /area/chapel/main - locstring = "the chapel" + locstrings[numlocs] = "the chapel" if(LOC_LIBRARY) spawn_area_type = /area/library - locstring = "the library" + locstrings[numlocs] = "the library" if(LOC_HYDRO) spawn_area_type = /area/hydroponics - locstring = "hydroponics" + locstrings[numlocs] = "hydroponics" if(LOC_VAULT) spawn_area_type = /area/security/nuke_storage - locstring = "the vault" + locstrings[numlocs] = "the vault" if(LOC_CONSTR) spawn_area_type = /area/construction - locstring = "the construction area" + locstrings[numlocs] = "the construction area" if(LOC_TECH) spawn_area_type = /area/storage/tech - locstring = "technical storage" - if(LOC_TACTICAL) - spawn_area_type = /area/security/tactical - locstring = "tactical equipment storage" + locstrings[numlocs] = "technical storage" + if(LOC_ARMORY) + spawn_area_type = /area/security/armoury + locstrings[numlocs] = "the armoury" + if(LOC_DORMS) + spawn_area_type = /area/crew_quarters/sleep + locstrings[numlocs] = "the dormitories" + if(LOC_FITNESS) + spawn_area_type = /area/crew_quarters/fitness + locstrings[numlocs] = "the fitness room" + if(LOC_HOLODECK) + spawn_area_type = /area/holodeck/alphadeck + locstrings[numlocs] = "the holodeck" + if(LOC_DISPOSAL) + spawn_area_type = /area/quartermaster/office + locstrings[numlocs] = "the cargo disposals office" + if(LOC_CARGO) + spawn_area_type = /area/quartermaster/storage + locstrings[numlocs] = "the cargo bay" + if(LOC_MEETING) + spawn_area_type = /area/bridge/meeting_room + locstrings[numlocs] = "the command meeting room" + if(LOC_LOCKER) + spawn_area_type = /area/crew_quarters/locker + locstrings[numlocs] = "the locker room" + if(LOC_XENO) + spawn_area_type = /area/rnd/xenobiology + locstrings[numlocs] = "xenobiology" + for(var/areapath in typesof(spawn_area_type)) var/area/A = locate(areapath) @@ -64,40 +122,68 @@ if(turf_clear(F)) turfs += F + +/datum/event/infestation/proc/spawn_creatures() var/list/spawn_types = list() var/max_number - vermin = rand(0,2) + vermin = rand(0,6) switch(vermin) if(VERM_MICE) spawn_types = list(/mob/living/simple_animal/mouse/gray, /mob/living/simple_animal/mouse/brown, /mob/living/simple_animal/mouse/white) - max_number = 12 + max_number = 7 vermstring = "mice" if(VERM_LIZARDS) spawn_types = list(/mob/living/simple_animal/lizard) - max_number = 6 + max_number = 7 vermstring = "lizards" if(VERM_SPIDERS) spawn_types = list(/obj/effect/spider/spiderling) max_number = 3 vermstring = "spiders" + if (VERM_DIYAAB) + spawn_types = list(/mob/living/simple_animal/hostile/diyaab) + max_number = 2 + vermstring = "strange creatures" + if (VERM_BATS) + spawn_types = list(/mob/living/simple_animal/hostile/scarybat) + max_number = 2 + vermstring = "space bats" + if (VERM_YITHIAN) + spawn_types = list(/mob/living/simple_animal/yithian) + max_number = 4 + vermstring = "strange creatures" + if (VERM_TINDALOS) + spawn_types = list(/mob/living/simple_animal/tindalos) + max_number = 4 + vermstring = "strange creatures" - spawn(0) - var/num = rand(2,max_number) - while(turfs.len > 0 && num > 0) - var/turf/simulated/floor/T = pick(turfs) - turfs.Remove(T) - num-- - if(vermin == VERM_SPIDERS) - var/obj/effect/spider/spiderling/S = new(T) - S.amount_grown = -1 - else - var/spawn_type = pick(spawn_types) - new spawn_type(T) + if (severity == EVENT_LEVEL_MODERATE) + max_number *= 2 + var/num = rand(2,max_number) + while(turfs.len > 0 && num > 0) + var/turf/simulated/floor/T = pick(turfs) + + turfs.Remove(T) + num-- + + if(vermin == VERM_SPIDERS) + var/obj/effect/spider/spiderling/S = new(T) + S.amount_grown = 1 + S.growth_rate = (rand(50,300)/1000)//At most, they grow at 30% the usual rate. As low as 1/20th + if (severity == EVENT_LEVEL_MODERATE) + S.growth_rate *= 2//They grow faster on the higher severity event + else + var/spawn_type = pick(spawn_types) + new spawn_type(T) /datum/event/infestation/announce() - command_announcement.Announce("Bioscans indicate that [vermstring] have been breeding in [locstring]. Clear them out, before this starts to affect productivity.", "Vermin infestation") + if (severity == EVENT_LEVEL_MODERATE) + command_announcement.Announce("Bioscans indicate that large numbers of lifeforms have been breeding in [locstrings[1]] and [locstrings[2]]. Clear them out, before this starts to affect productivity.", "Vermin infestation") + else + command_announcement.Announce("Bioscans indicate that [vermstring] have been breeding in [locstrings[1]]. Clear them out, before this starts to affect productivity.", "Vermin infestation") + #undef LOC_KITCHEN #undef LOC_ATMOS @@ -106,9 +192,22 @@ #undef LOC_LIBRARY #undef LOC_HYDRO #undef LOC_VAULT +#undef LOC_CONSTR #undef LOC_TECH -#undef LOC_TACTICAL +#undef LOC_ARMORY +#undef LOC_DORMS +#undef LOC_FITNESS +#undef LOC_HOLODECK +#undef LOC_DISPOSAL +#undef LOC_CARGO +#undef LOC_MEETING +#undef LOC_LOCKER +#undef LOC_XENO #undef VERM_MICE #undef VERM_LIZARDS #undef VERM_SPIDERS +#undef VERM_DIYAAB +#undef VERM_BATS +#undef VERM_YITHIAN +#undef VERM_TINDALOS \ No newline at end of file diff --git a/code/modules/events/meteors.dm b/code/modules/events/meteors.dm index ed20c7789fb..28236c6f1f0 100644 --- a/code/modules/events/meteors.dm +++ b/code/modules/events/meteors.dm @@ -8,7 +8,7 @@ var/max_waves = 16 var/min_meteors = 1 var/max_meteors = 2 - var/duration = 420//Total duration in seconds that the storm will last after it starts + var/duration = 340//Total duration in seconds that the storm will last after it starts var/waves = 8 diff --git a/html/changelogs/Nanako-Infestation.yml b/html/changelogs/Nanako-Infestation.yml new file mode 100644 index 00000000000..5b3e108a4d2 --- /dev/null +++ b/html/changelogs/Nanako-Infestation.yml @@ -0,0 +1,43 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Nanako + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - tweak: "Adjusted event many weights. Made meteors and vendor breakdowns less common, ion storms more common." + - tweak: "Slightly reduced overall frequency of random events." + - rscadd: "Reworked the infestation event!! Can now spawn in a wider variety of locations, and spawn a wider variety of creatures." + - rscadd: "Spiders spawned by the infestation event will now grow up, but much slower." + - rscadd: "Reduced length of meteor storm a little. Total meteors not changed." + + + \ No newline at end of file