From 5150ef2a10a60d5c978662d14451fb8b9c91a1fb Mon Sep 17 00:00:00 2001 From: ArcaneMusic Date: Fri, 3 Jan 2020 05:33:21 -0500 Subject: [PATCH 1/7] Mouse magic. --- code/modules/mob/living/simple_animal/friendly/mouse.dm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index 8d6364fad4f..bf6db6a6ef0 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -66,8 +66,8 @@ ..() /mob/living/simple_animal/mouse/handle_automated_action() + var/turf/open/floor/F = get_turf(src) if(prob(chew_probability)) - var/turf/open/floor/F = get_turf(src) if(istype(F) && !F.intact) var/obj/structure/cable/C = locate() in F if(C && prob(15)) @@ -79,6 +79,10 @@ else C.deconstruct() visible_message("[src] chews through the [C].") + for(var/obj/item/reagent_containers/food/snacks/cheesewedge/cheese in range(1, src)) + if(prob(10)) + new /mob/living/simple_animal/mouse(loc) + qdel(cheese) /* * Mouse types From 05ec6a9ec97101e16d4f65783cbce84a5f22356b Mon Sep 17 00:00:00 2001 From: ArcaneMusic Date: Fri, 3 Jan 2020 05:39:19 -0500 Subject: [PATCH 2/7] Yeah I didn't wind up using that, whoops --- code/modules/mob/living/simple_animal/friendly/mouse.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index bf6db6a6ef0..0856567f646 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -66,8 +66,8 @@ ..() /mob/living/simple_animal/mouse/handle_automated_action() - var/turf/open/floor/F = get_turf(src) if(prob(chew_probability)) + var/turf/open/floor/F = get_turf(src) if(istype(F) && !F.intact) var/obj/structure/cable/C = locate() in F if(C && prob(15)) From cf83c4d081cbb4b00252c0b99bd1582f3aaf922b Mon Sep 17 00:00:00 2001 From: ArcaneMusic Date: Fri, 3 Jan 2020 22:40:24 -0500 Subject: [PATCH 3/7] Global Variable and config option --- .../configuration/entries/game_options.dm | 4 ++++ code/controllers/subsystem/mobs.dm | 1 + .../mob/living/simple_animal/friendly/mouse.dm | 15 ++++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index f3db9bb3159..ac6ab78afb3 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -379,4 +379,8 @@ config_entry_value = 64 min_val = 0 +/datum/config_entry/number/ratcap + config_entry_value = 64 + min_val = 0 + /datum/config_entry/flag/dynamic_config_enabled diff --git a/code/controllers/subsystem/mobs.dm b/code/controllers/subsystem/mobs.dm index 8caf2a4623c..885587ff554 100644 --- a/code/controllers/subsystem/mobs.dm +++ b/code/controllers/subsystem/mobs.dm @@ -8,6 +8,7 @@ SUBSYSTEM_DEF(mobs) var/static/list/clients_by_zlevel[][] var/static/list/dead_players_by_zlevel[][] = list(list()) // Needs to support zlevel 1 here, MaxZChanged only happens when z2 is created and new_players can login before that. var/static/list/cubemonkeys = list() + var/static/list/cheeserats = list() /datum/controller/subsystem/mobs/stat_entry() ..("P:[GLOB.mob_living_list.len]") diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index 0856567f646..3335bb352f4 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -81,7 +81,14 @@ visible_message("[src] chews through the [C].") for(var/obj/item/reagent_containers/food/snacks/cheesewedge/cheese in range(1, src)) if(prob(10)) - new /mob/living/simple_animal/mouse(loc) + var/cap = CONFIG_GET(number/ratcap) + if(LAZYLEN(SSmobs.cheeserats) > cap) + visible_message("[src] carefully eats the cheese, hiding from the [cap] mice on the station!") + qdel(cheese) + return INITIALIZE_HINT_QDEL + SSmobs.cheeserats += src + new /mob/living/simple_animal/mouse/bred(loc) + visible_message("[src] nibbles through the [cheese], attracting another mouse!") qdel(cheese) /* @@ -100,6 +107,12 @@ body_color = "brown" icon_state = "mouse_brown" +/mob/living/simple_animal/mouse/bred + +/mob/living/simple_animal/mouse/bred/Destroy() + SSmobs.cheeserats -= src + return ..() + //TOM IS ALIVE! SQUEEEEEEEE~K :) /mob/living/simple_animal/mouse/brown/Tom name = "Tom" From cf03da347a162864b36e59d1dafdf4c1427967a5 Mon Sep 17 00:00:00 2001 From: ArcaneMusic Date: Mon, 6 Jan 2020 04:15:57 -0500 Subject: [PATCH 4/7] Lowers the value to a more manageable 32 maximum mice, fixes config, grammar clarification --- code/controllers/configuration/entries/game_options.dm | 2 +- code/modules/mob/living/simple_animal/friendly/mouse.dm | 6 +++--- config/game_options.txt | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index ac6ab78afb3..b0385ccb982 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -380,7 +380,7 @@ min_val = 0 /datum/config_entry/number/ratcap - config_entry_value = 64 + config_entry_value = 32 min_val = 0 /datum/config_entry/flag/dynamic_config_enabled diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index 3335bb352f4..c64fd3c7b59 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -83,9 +83,9 @@ if(prob(10)) var/cap = CONFIG_GET(number/ratcap) if(LAZYLEN(SSmobs.cheeserats) > cap) - visible_message("[src] carefully eats the cheese, hiding from the [cap] mice on the station!") + visible_message("[src] carefully eats the cheese, hiding it from the [cap] mice on the station!") qdel(cheese) - return INITIALIZE_HINT_QDEL + return SSmobs.cheeserats += src new /mob/living/simple_animal/mouse/bred(loc) visible_message("[src] nibbles through the [cheese], attracting another mouse!") @@ -109,7 +109,7 @@ /mob/living/simple_animal/mouse/bred -/mob/living/simple_animal/mouse/bred/Destroy() +/mob/living/simple_animal/mouse/Destroy() SSmobs.cheeserats -= src return ..() diff --git a/config/game_options.txt b/config/game_options.txt index d6ff9420749..00913087881 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -563,5 +563,8 @@ ROUNDSTART_TRAITS ## A cap on how many monkeys may be created via monkey cubes MONKEYCAP 64 +## A cap on how many mice can be bred via cheese wedges +RATCAP 32 + ## Enable the capitalist agenda on your server. ECONOMY From a6f5cc8499dc291d83f270c1441e8b47c151305f Mon Sep 17 00:00:00 2001 From: ArcaneMusic Date: Mon, 6 Jan 2020 16:44:08 -0500 Subject: [PATCH 5/7] Alright, fine, we'll stick with 64 for now. Just in case. --- code/controllers/configuration/entries/game_options.dm | 2 +- config/game_options.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index b0385ccb982..ac6ab78afb3 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -380,7 +380,7 @@ min_val = 0 /datum/config_entry/number/ratcap - config_entry_value = 32 + config_entry_value = 64 min_val = 0 /datum/config_entry/flag/dynamic_config_enabled diff --git a/config/game_options.txt b/config/game_options.txt index 00913087881..91b406be709 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -564,7 +564,7 @@ ROUNDSTART_TRAITS MONKEYCAP 64 ## A cap on how many mice can be bred via cheese wedges -RATCAP 32 +RATCAP 64 ## Enable the capitalist agenda on your server. ECONOMY From 03557acf7c4cfa71e31b84f86e667736197d83e8 Mon Sep 17 00:00:00 2001 From: ArcaneMusic Date: Tue, 7 Jan 2020 01:28:09 -0500 Subject: [PATCH 6/7] Alright this should be fine. --- code/modules/mob/living/simple_animal/friendly/mouse.dm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index c64fd3c7b59..c33818faa0c 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -82,14 +82,15 @@ for(var/obj/item/reagent_containers/food/snacks/cheesewedge/cheese in range(1, src)) if(prob(10)) var/cap = CONFIG_GET(number/ratcap) - if(LAZYLEN(SSmobs.cheeserats) > cap) + if(LAZYLEN(SSmobs.cheeserats) >= cap) visible_message("[src] carefully eats the cheese, hiding it from the [cap] mice on the station!") qdel(cheese) return - SSmobs.cheeserats += src - new /mob/living/simple_animal/mouse/bred(loc) + var/mob/living/newmouse = new /mob/living/simple_animal/mouse(loc, TRUE, src) + SSmobs.cheeserats += newmouse visible_message("[src] nibbles through the [cheese], attracting another mouse!") qdel(cheese) + return /* * Mouse types @@ -107,8 +108,6 @@ body_color = "brown" icon_state = "mouse_brown" -/mob/living/simple_animal/mouse/bred - /mob/living/simple_animal/mouse/Destroy() SSmobs.cheeserats -= src return ..() From 31ddcbd1b0810260416e8eeb073a840225723ba1 Mon Sep 17 00:00:00 2001 From: ArcaneMusic Date: Tue, 7 Jan 2020 03:25:39 -0500 Subject: [PATCH 7/7] Whoops, my bad. Things were breaking so I refered to monkeycube's spawn call --- code/modules/mob/living/simple_animal/friendly/mouse.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index c33818faa0c..51c7db91c28 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -86,7 +86,7 @@ visible_message("[src] carefully eats the cheese, hiding it from the [cap] mice on the station!") qdel(cheese) return - var/mob/living/newmouse = new /mob/living/simple_animal/mouse(loc, TRUE, src) + var/mob/living/newmouse = new /mob/living/simple_animal/mouse(loc) SSmobs.cheeserats += newmouse visible_message("[src] nibbles through the [cheese], attracting another mouse!") qdel(cheese)