Merge pull request #12296 from Couls/too-many-monkeys-jumping-on-the-bed

limit the amount of monkeys spawned from monkey cubes
This commit is contained in:
variableundefined
2019-09-15 22:19:20 -04:00
committed by GitHub
16 changed files with 37 additions and 19 deletions
@@ -271,6 +271,12 @@
return 1
/obj/item/reagent_containers/food/snacks/monkeycube/proc/Expand()
if(LAZYLEN(SSmobs.cubemonkeys) >= config.cubemonkeycap)
if(fingerprintslast)
to_chat(get_mob_by_ckey(fingerprintslast), "<span class='warning'>Bluespace harmonics prevent the spawning of more than [config.cubemonkeycap] monkeys on the station at one time!</span>")
else
visible_message("<span class='notice'>[src] fails to expand!</span>")
return
if(!QDELETED(src))
visible_message("<span class='notice'>[src] expands!</span>")
if(fingerprintslast)
@@ -283,6 +289,7 @@
if(LAZYLEN(fingerprintshidden))
creature.fingerprintshidden = fingerprintshidden.Copy()
creature.set_species(monkey_type)
SSmobs.cubemonkeys += creature
qdel(src)
/obj/item/reagent_containers/food/snacks/monkeycube/syndicate
@@ -101,11 +101,11 @@
return FALSE
set_heartattack(FALSE)
SSmobs.cubemonkeys -= src
if(dna.species)
dna.species.handle_hud_icons(src)
//Handle species-specific deaths.
dna.species.handle_death(src)
dna.species.handle_death(gibbed, src)
if(ishuman(LAssailant))
var/mob/living/carbon/human/H=LAssailant
@@ -304,10 +304,7 @@
/datum/species/proc/handle_dna(mob/living/carbon/human/H, remove) //Handles DNA mutations, as that doesn't work at init. Make sure you call genemutcheck on any blocks changed here
return
/datum/species/proc/handle_death(mob/living/carbon/human/H) //Handles any species-specific death events (such as dionaea nymph spawns).
return
/datum/species/proc/spec_death(gibbed, mob/living/carbon/human/C)
/datum/species/proc/handle_death(gibbed, mob/living/carbon/human/H) //Handles any species-specific death events (such as dionaea nymph spawns).
return
/datum/species/proc/apply_damage(damage = 0, damagetype = BRUTE, def_zone = null, blocked = 0, mob/living/carbon/human/H, sharp = 0, obj/used_weapon = null)
@@ -410,7 +410,7 @@
prefix = "Sand"
special_names = list("Castle", "Bag", "Dune", "Worm", "Storm")
/datum/species/golem/sand/handle_death(mob/living/carbon/human/H)
/datum/species/golem/sand/handle_death(gibbed, mob/living/carbon/human/H)
H.visible_message("<span class='danger'>[H] turns into a pile of sand!</span>")
for(var/obj/item/W in H)
H.unEquip(W)
@@ -442,7 +442,7 @@
prefix = "Glass"
special_names = list("Lens", "Prism", "Fiber", "Bead")
/datum/species/golem/glass/handle_death(mob/living/carbon/human/H)
/datum/species/golem/glass/handle_death(gibbed, mob/living/carbon/human/H)
playsound(H, "shatter", 70, 1)
H.visible_message("<span class='danger'>[H] shatters!</span>")
for(var/obj/item/W in H)
@@ -679,7 +679,7 @@
active = null
..()
/datum/species/golem/bananium/handle_death(mob/living/carbon/human/H)
/datum/species/golem/bananium/handle_death(gibbed, mob/living/carbon/human/H)
playsound(get_turf(H), 'sound/misc/sadtrombone.ogg', 70, 0)
/datum/unarmed_attack/golem/bananium
@@ -90,7 +90,7 @@
if(monitor)
monitor.Remove(H)
/datum/species/machine/handle_death(mob/living/carbon/human/H)
/datum/species/machine/handle_death(gibbed, mob/living/carbon/human/H)
var/obj/item/organ/external/head/head_organ = H.get_organ("head")
if(!head_organ)
return
@@ -34,7 +34,7 @@
H.light_color = "#1C1C00"
H.set_light(2)
/datum/species/nucleation/handle_death(mob/living/carbon/human/H)
/datum/species/nucleation/handle_death(gibbed, mob/living/carbon/human/H)
var/turf/T = get_turf(H)
H.visible_message("<span class='warning'>[H]'s body explodes, leaving behind a pile of microscopic crystals!</span>")
explosion(T, 0, 0, 2, 2) // Create a small explosion burst upon death
@@ -55,5 +55,5 @@
"is twisting their own neck!",
"is holding their breath!")
/datum/species/tajaran/handle_death(mob/living/carbon/human/H)
/datum/species/tajaran/handle_death(gibbed, mob/living/carbon/human/H)
H.stop_tail_wagging(1)
@@ -102,7 +102,7 @@
to_chat(user, "<span class='warning'>You run out of momentum!</span>")
return
/datum/species/unathi/handle_death(mob/living/carbon/human/H)
/datum/species/unathi/handle_death(gibbed, mob/living/carbon/human/H)
H.stop_tail_wagging(1)
/datum/species/unathi/ashwalker
@@ -81,7 +81,7 @@
speciesbox = /obj/item/storage/box/survival_vox
/datum/species/vox/handle_death(mob/living/carbon/human/H)
/datum/species/vox/handle_death(gibbed, mob/living/carbon/human/H)
H.stop_tail_wagging(1)
/datum/species/vox/after_equip_job(datum/job/J, mob/living/carbon/human/H)
@@ -49,5 +49,5 @@
"is twisting their own neck!",
"is holding their breath!")
/datum/species/vulpkanin/handle_death(mob/living/carbon/human/H)
/datum/species/vulpkanin/handle_death(gibbed, mob/living/carbon/human/H)
H.stop_tail_wagging(1)
@@ -49,7 +49,7 @@
default_hair = "Antennae"
/datum/species/wryn/handle_death(mob/living/carbon/human/H)
/datum/species/wryn/handle_death(gibbed, mob/living/carbon/human/H)
for(var/mob/living/carbon/C in GLOB.living_mob_list)
if(C.get_int_organ(/obj/item/organ/internal/wryn/hivenode))
to_chat(C, "<span class='danger'><B>Your antennae tingle as you are overcome with pain...</B></span>")
@@ -67,7 +67,7 @@
playsound(H, pick(spooks), 50, TRUE, 10)
//Congrats you somehow died so hard you stopped being a zombie
/datum/species/zombie/infectious/spec_death(gibbed, mob/living/carbon/C)
/datum/species/zombie/infectious/handle_death(gibbed, mob/living/carbon/C)
. = ..()
var/obj/item/organ/internal/zombie_infection/infection
infection = C.get_organ_slot("zombie_infection")
@@ -217,8 +217,12 @@
var/obj/machinery/computer/camera_advanced/xenobio/X = target
if(cameranet.checkTurfVis(remote_eye.loc))
if(X.monkeys >= 1)
if(LAZYLEN(SSmobs.cubemonkeys) >= config.cubemonkeycap)
to_chat(owner, "<span class='warning'>Bluespace harmonics prevent the spawning of more than [config.cubemonkeycap] monkeys on the station at one time!</span>")
return
else if(X.monkeys >= 1)
var/mob/living/carbon/human/monkey/food = new /mob/living/carbon/human/monkey(remote_eye.loc)
SSmobs.cubemonkeys += food
food.LAssailant = C
X.monkeys --
to_chat(owner, "[X] now has [X.monkeys] monkeys left.")