Skip to content

Commit

Permalink
Merge pull request #1432 from NopemanMcHalt/rat-gaming
Browse files Browse the repository at this point in the history
Pied Piper of Nash
  • Loading branch information
Superlagg authored Jan 9, 2023
2 parents 4af36f4 + 43f02d6 commit 852314f
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 3 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
#define TRAIT_HEADPAT_SLUT "headpat_sluuuuut"
#define TRAIT_HYDRA_HEADS "hydra_heads"
#define TRAIT_SHELTERED "sheltered"
#define TRAIT_PIEDPIPER "rat_lord"

// mobility flag traits
// IN THE FUTURE, IT WOULD BE NICE TO DO SOMETHING SIMILAR TO https://github.com/tgstation/tgstation/pull/48923/files (ofcourse not nearly the same because I have my.. thoughts on it)
Expand Down
37 changes: 37 additions & 0 deletions code/datums/traits/good.dm
Original file line number Diff line number Diff line change
Expand Up @@ -879,3 +879,40 @@ GLOBAL_LIST_INIT(former_tribal_recipes, list(
gain_text = span_notice("In a sudden haze you realize that the Mosin Nagant was Gods gift to mankind.")
lose_text = span_danger("After picking some 250 year old cosmoline out from under one of your nails you realize that... Uh, no, the Mosin Nagant is a piece of shit.")
locked = FALSE

/datum/quirk/ratlord
name = "Beast Master - Rats (Experimental)"
desc = "Whenever by psychic means or not, you gained ability to call forth friendly type of rats. <u>Do note they will attack <b>only</b> the hostile mobs</u>."
value = 4 //might be pve imbalanced af tho
mob_trait = TRAIT_PIEDPIPER
gain_text = span_notice("You feel like being a giant rat, that makes all of the rules!")
lose_text = span_danger("You've lost your rat crown...")
locked = FALSE
var/obj/effect/proc_holder/mob_common/summon_backup/rat/tame/gather
var/obj/effect/proc_holder/mob_common/direct_mobs/rat/tame/moveto
var/obj/effect/proc_holder/mob_common/make_nest/rat/tame/build
var/obj/effect/proc_holder/mob_common/unmake_nest/clear
// Damn this action button code structure

/datum/quirk/ratlord/add()
var/mob/living/carbon/human/H = quirk_holder
gather = new
H.AddAbility(gather)
moveto = new
H.AddAbility(moveto)
build = new
H.AddAbility(build)
clear = new
H.AddAbility(clear)

/datum/quirk/ratlord/remove()
var/mob/living/carbon/human/H = quirk_holder
if(H)
H.RemoveAbility(gather)
QDEL_NULL(gather)
H.RemoveAbility(moveto)
QDEL_NULL(moveto)
H.RemoveAbility(build)
QDEL_NULL(build)
H.RemoveAbility(clear)
QDEL_NULL(clear)
8 changes: 8 additions & 0 deletions code/modules/fallout/obj/structures/mob_spawners.dm
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ GLOBAL_LIST_EMPTY(player_made_nests)
spawn_time = 7 SECONDS //squeak
mob_types = list(/mob/living/simple_animal/hostile/rat = 30)

/obj/structure/nest/rat/tame
name = "tame rat nest"
desc = "A man-made nest full of squeakers."
mob_types = list(
/mob/living/simple_animal/hostile/rat/tame = 9,
/mob/living/simple_animal/hostile/rat/skitter/curious = 1
)

/obj/structure/nest/mouse
name = "mouse nest"
max_mobs = 6
Expand Down
16 changes: 14 additions & 2 deletions code/modules/mob/living/simple_animal/hostile/abilities_common.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#define RTS_RATS_ALLOWED list(\
/mob/living/simple_animal/hostile/rat,\
/mob/living/simple_animal/hostile/rat/skitter)
#define RTS_FRATS_ALLOWED list(\
/mob/living/simple_animal/hostile/rat/tame,\
/mob/living/simple_animal/hostile/rat/skitter/curious)
#define RTS_ROBOT_ALLOWED list(\
/mob/living/simple_animal/hostile/handy,\
/mob/living/simple_animal/hostile/handy/protectron,\
Expand Down Expand Up @@ -105,16 +108,19 @@
immune_to_lowpop = TRUE
allowed_mobs = RTS_RATS_ALLOWED

/obj/effect/proc_holder/mob_common/summon_backup/rat/tame
allowed_mobs = RTS_FRATS_ALLOWED

/obj/effect/proc_holder/mob_common/summon_backup/robot
allowed_mobs = RTS_ROBOT_ALLOWED
banned_from_lowpop = TRUE

/obj/effect/proc_holder/mob_common/summon_backup/activate(mob/user)
if(!istype(user, /mob/living/simple_animal))
if(!istype(user, /mob/living))
return
if(user.incapacitated())
return
var/mob/living/simple_animal/owner = user
var/mob/living/owner = user

var/turf/the_turf = get_turf(owner)
if(!the_turf)
Expand Down Expand Up @@ -166,6 +172,9 @@
immune_to_lowpop = TRUE
allowed_mobs = RTS_RATS_ALLOWED

/obj/effect/proc_holder/mob_common/direct_mobs/rat/tame
allowed_mobs = RTS_FRATS_ALLOWED

/obj/effect/proc_holder/mob_common/direct_mobs/robot
allowed_mobs = RTS_ROBOT_ALLOWED
banned_from_lowpop = TRUE
Expand Down Expand Up @@ -246,6 +255,9 @@
banned_from_lowpop = FALSE
nest_to_spawn = /obj/structure/nest/rat

/obj/effect/proc_holder/mob_common/make_nest/rat/tame
nest_to_spawn = /obj/structure/nest/rat/tame

/obj/effect/proc_holder/mob_common/make_nest/mouse
immune_to_lowpop = TRUE
banned_from_lowpop = FALSE
Expand Down
22 changes: 21 additions & 1 deletion code/modules/mob/living/simple_animal/hostile/regalrat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@
/mob/living/simple_animal/hostile/rat/skitter/curious
name = "curious mouse"
desc = "A rodent that seems more at ease around people."
response_help_continuous = "pets"
response_help_simple = "pet"
icon_state = "mouse_gray"
icon_living = "mouse_gray"
icon_dead = "mouse_gray_dead"
Expand All @@ -285,7 +287,7 @@
minimum_distance = 7
aggro_vision_range = 7
vision_range = 10
faction = list("rat", "neutral")
faction = list("neutral", "dog") // Alas, rats would still attack this mouse even with `rat` faction in it. Thanks to regal rats faction code.
is_smol = TRUE
call_backup = null
send_mobs = null
Expand All @@ -308,6 +310,24 @@
emote("squeak")
visible_message(span_notice("[src] sure looks friendly!"))

// Servants to Pied Piper of Wasteland
// Should be friendly toward players and docile animals, unless they've got faction differing from "neutral" (such as dogs).
/mob/living/simple_animal/hostile/rat/tame
name = "tame rat"
desc = "It's a dubious rodent of unknown breed, that seem to be more docile with people. Still have anger issues toward raiders and hostile fauna."
response_help_continuous = "pets"
response_help_simple = "pet"
speak = list("Squeak!", "SQUUEEAAAAK!!", "Squeak?")
speak_emote = list("squeaks")
emote_hear = list("Squeaks.")
emote_see = list("charges around in a circle.", "stands on its hind legs.")
color = "#91fdac"
faction = list("neutral", "dog") // Dog faction is here to avoid 'em targeting poor corgis. Rat faction isn't here so they could target hostile ones.
//can_ghost_into = FALSE
desc_short = "Squeak friend!"
call_backup = /obj/effect/proc_holder/mob_common/summon_backup/rat/tame
send_mobs = /obj/effect/proc_holder/mob_common/direct_mobs/rat/tame
make_a_nest = /obj/effect/proc_holder/mob_common/make_nest/rat/tame

/mob/living/simple_animal/hostile/rat/Destroy()
SSmobs.cheeserats -= src
Expand Down

0 comments on commit 852314f

Please sign in to comment.