mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
Spiders can now be tamed and ridden (#95194)
## About The Pull Request This lets people ride and tame spiders by feeding them mouse, lizard, moth, fly, and worm meat. You can only do this when a spider is a spiderling or young; once it's fully grown, it's no longer possible. This also refactors some tameable code to use `TRAIT_TAMED` instead of setting variables on mobs individually. ## Why It's Good For The Game It looks cool. <img width="1920" height="1080" alt="dreamseeker_97k7fgzdhv" src="https://github.com/user-attachments/assets/87d53102-468d-4dd7-b0a7-004f9a98df17" /> ## Changelog 🆑 add: Spiders can now be tamed and ridden. They eat mouse, lizard, moth, fly, and worm meat and can only be tamed when they are spiderlings or young. code: Refactored tameable code to use TRAIT_TAMED instead of setting individual variables on each mob. /🆑
This commit is contained in:
@@ -28,8 +28,6 @@
|
||||
|
||||
ai_controller = /datum/ai_controller/basic_controller/mouse
|
||||
|
||||
/// Whether this rat is friendly to players
|
||||
var/tame = FALSE
|
||||
/// What color our mouse is. Brown, gray and white - leave blank for random.
|
||||
var/body_color
|
||||
/// Does this mouse contribute to the ratcap?
|
||||
@@ -63,7 +61,8 @@
|
||||
SSmobs.cheeserats |= src
|
||||
ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT)
|
||||
|
||||
src.tame = tame
|
||||
if(tame)
|
||||
ADD_TRAIT(src, TRAIT_TAMED, INNATE_TRAIT)
|
||||
if(!isnull(new_body_color))
|
||||
body_color = new_body_color
|
||||
if(isnull(body_color))
|
||||
@@ -81,7 +80,7 @@
|
||||
AddComponent(/datum/component/swarming, 16, 16) //max_x, max_y
|
||||
|
||||
/mob/living/basic/mouse/proc/make_tameable()
|
||||
if (tame)
|
||||
if (HAS_TRAIT(src, TRAIT_TAMED))
|
||||
add_faction(FACTION_NEUTRAL)
|
||||
else
|
||||
var/static/list/food_types = list(/obj/item/food/cheese)
|
||||
@@ -196,9 +195,9 @@
|
||||
|
||||
/// Called when a mouse is hand-fed some cheese, it will stop being afraid of humans
|
||||
/mob/living/basic/mouse/tamed(mob/living/tamer, obj/item/food/cheese/cheese)
|
||||
. = ..()
|
||||
new /obj/effect/temp_visual/heart(loc)
|
||||
add_faction(FACTION_NEUTRAL)
|
||||
tame = TRUE
|
||||
try_consume_cheese(cheese)
|
||||
ai_controller.CancelActions() // Interrupt any current fleeing
|
||||
|
||||
@@ -248,7 +247,7 @@
|
||||
|
||||
/// Creates a new mouse based on this mouse's subtype.
|
||||
/mob/living/basic/mouse/proc/create_a_new_rat()
|
||||
new /mob/living/basic/mouse(loc, /* tame = */ tame)
|
||||
new /mob/living/basic/mouse(loc, HAS_TRAIT(src, TRAIT_TAMED))
|
||||
|
||||
/// Biting into a cable will cause a mouse to get shocked and die if applicable. Or do nothing if they're lucky.
|
||||
/mob/living/basic/mouse/proc/try_bite_cable(obj/structure/cable/cable)
|
||||
@@ -302,7 +301,7 @@
|
||||
contributes_to_ratcap = FALSE
|
||||
|
||||
/mob/living/basic/mouse/brown/tom/make_tameable()
|
||||
tame = TRUE
|
||||
ADD_TRAIT(src, TRAIT_TAMED, INNATE_TRAIT)
|
||||
return ..()
|
||||
|
||||
/mob/living/basic/mouse/brown/tom/Initialize(mapload)
|
||||
@@ -312,7 +311,7 @@
|
||||
AddElement(/datum/element/pet_bonus, "squeak")
|
||||
|
||||
/mob/living/basic/mouse/brown/tom/create_a_new_rat()
|
||||
new /mob/living/basic/mouse/brown(loc, /* tame = */ tame) // dominant gene
|
||||
new /mob/living/basic/mouse/brown(loc, HAS_TRAIT(src, TRAIT_TAMED)) // dominant gene
|
||||
|
||||
/mob/living/basic/mouse/rat
|
||||
name = "rat"
|
||||
|
||||
Reference in New Issue
Block a user