mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-18 21:53:22 +00:00
* Monkey Business actually spawns monkeys on the station. (#79276) ## About The Pull Request The monkey business unit test was apparently not actually spawning monkeys on the station like it was supposed to. It was trying to find open turfs inside of area _typepaths_, which obviously do not contain turfs. Functionally, this means it was summoning a number of monkeys into the same turf of the unit test z-level equal to the number of areas on the station map. Now it will actually place one monkey in every area of the station itself. This was an incidental discovery while trying to diagnose #79147 with Jacquerel. We still don't know what's causing that one, and I doubt this will do anything about it, but nonetheless the unit test wasn't working right. ## Why It's Good For The Game Makes a unit test do what it was actually intended to do, which is put a bunch of monkeys all over the station and see if they ruin anything. This might actually cause _more_ test failures since they're being put in a less controlled environment, but we'll see. ## Changelog Nothing player facing. * Monkey Business actually spawns monkeys on the station. --------- Co-authored-by: lizardqueenlexi <105025397+lizardqueenlexi@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
28 lines
1.2 KiB
Plaintext
28 lines
1.2 KiB
Plaintext
/**
|
|
* Monkey Business
|
|
*
|
|
* This unit test spawns a predefined number of monkies, each of which
|
|
* are set to have a 100% chance of attempting to use something next to them each Life
|
|
*
|
|
* This test basically just checks to see if attack procs are working correctly,
|
|
* but its also hilarious and fun to watch locally.
|
|
*/
|
|
/datum/unit_test/monkey_business
|
|
priority = TEST_LONGER
|
|
var/monkey_timer = 30 SECONDS
|
|
var/monkey_angry_nth = 5 // every nth monkey will be angry
|
|
|
|
/datum/unit_test/monkey_business/Run()
|
|
for(var/monkey_id in 1 to length(GLOB.the_station_areas))
|
|
var/area/monkey_zone = GLOB.areas_by_type[GLOB.the_station_areas[monkey_id]]
|
|
var/mob/living/carbon/human/monkey = allocate(/mob/living/carbon/human/consistent, get_first_open_turf_in_area(monkey_zone))
|
|
monkey.set_species(/datum/species/monkey)
|
|
monkey.set_name("Monkey [monkey_id]")
|
|
if(monkey_id % monkey_angry_nth == 0) // BLOOD FOR THE BLOOD GODS
|
|
monkey.put_in_active_hand(new /obj/item/knife/shiv)
|
|
new /datum/ai_controller/monkey/angry(monkey)
|
|
else
|
|
new /datum/ai_controller/monkey(monkey)
|
|
monkey.ai_controller.set_blackboard_key(BB_MONKEY_TARGET_MONKEYS, TRUE)
|
|
sleep(monkey_timer)
|