mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 04:26:03 +01:00
[MIRROR] Dogs use the Pet Command system [MDB IGNORE] (#18393)
* Dogs use the Pet Command system * modular pets * modular dogs * oops * NO Co-authored-by: Jacquerel <hnevard@gmail.com> Co-authored-by: tastyfish <crazychris32@gmail.com>
This commit is contained in:
@@ -137,8 +137,15 @@
|
||||
. = ..()
|
||||
if(basic_mob_flags & DEL_ON_DEATH)
|
||||
qdel(src)
|
||||
return
|
||||
health = 0
|
||||
else
|
||||
health = 0
|
||||
look_dead()
|
||||
|
||||
/**
|
||||
* Apply the appearance and properties this mob has when it dies
|
||||
* This is called by the mob pretending to be dead too so don't put loot drops in here or something
|
||||
*/
|
||||
/mob/living/basic/proc/look_dead()
|
||||
icon_state = icon_dead
|
||||
if(basic_mob_flags & FLIP_ON_DEATH)
|
||||
transform = transform.Turn(180)
|
||||
@@ -147,8 +154,12 @@
|
||||
|
||||
/mob/living/basic/revive(full_heal_flags = NONE, excess_healing = 0, force_grab_ghost = FALSE)
|
||||
. = ..()
|
||||
if (!.)
|
||||
if(!.)
|
||||
return
|
||||
look_alive()
|
||||
|
||||
/// Apply the appearance and properties this mob has when it is alive
|
||||
/mob/living/basic/proc/look_alive()
|
||||
icon_state = icon_living
|
||||
if(basic_mob_flags & FLIP_ON_DEATH)
|
||||
transform = transform.Turn(180)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
BB_BASIC_MOB_TIPPER = null,
|
||||
)
|
||||
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD
|
||||
ai_movement = /datum/ai_movement/basic_avoidance
|
||||
idle_behavior = /datum/idle_behavior/idle_random_walk
|
||||
planning_subtrees = list(
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic/ignore_faction(),
|
||||
)
|
||||
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD
|
||||
ai_movement = /datum/ai_movement/basic_avoidance
|
||||
idle_behavior = /datum/idle_behavior/idle_random_walk
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
BB_BASIC_MOB_FLEEING = TRUE,
|
||||
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic/ignore_faction(),
|
||||
)
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD
|
||||
ai_movement = /datum/ai_movement/basic_avoidance
|
||||
idle_behavior = /datum/idle_behavior/idle_random_walk
|
||||
planning_subtrees = list(
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
BB_BASIC_MOB_FLEEING = TRUE,
|
||||
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic/ignore_faction(),
|
||||
)
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD
|
||||
ai_movement = /datum/ai_movement/basic_avoidance
|
||||
idle_behavior = /datum/idle_behavior/idle_random_walk
|
||||
planning_subtrees = list(
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
//Dogs.
|
||||
|
||||
// Add 'walkies' as valid input
|
||||
/datum/pet_command/follow/dog
|
||||
speech_commands = list("heel", "follow", "walkies")
|
||||
|
||||
// Add 'good dog' as valid input
|
||||
/datum/pet_command/good_boy/dog
|
||||
speech_commands = list("good dog")
|
||||
|
||||
// Set correct attack behaviour
|
||||
/datum/pet_command/point_targetting/attack/dog
|
||||
attack_behaviour = /datum/ai_behavior/basic_melee_attack/dog
|
||||
|
||||
/datum/pet_command/point_targetting/attack/dog/set_command_active(mob/living/parent, mob/living/commander)
|
||||
. = ..()
|
||||
parent.ai_controller.blackboard[BB_DOG_HARASS_HARM] = TRUE
|
||||
|
||||
/mob/living/basic/pet/dog
|
||||
mob_biotypes = MOB_ORGANIC|MOB_BEAST
|
||||
response_help_continuous = "pets"
|
||||
@@ -12,17 +28,29 @@
|
||||
faction = list(FACTION_NEUTRAL)
|
||||
see_in_dark = 5
|
||||
can_be_held = TRUE
|
||||
ai_controller = /datum/ai_controller/dog
|
||||
///In the case 'melee_damage_upper' is somehow raised above 0
|
||||
ai_controller = /datum/ai_controller/basic_controller/dog
|
||||
// The dog attack pet command can raise melee attack above 0
|
||||
attack_verb_continuous = "bites"
|
||||
attack_verb_simple = "bite"
|
||||
attack_sound = 'sound/weapons/bite.ogg'
|
||||
attack_vis_effect = ATTACK_EFFECT_BITE
|
||||
/// Instructions you can give to dogs
|
||||
var/static/list/pet_commands = list(
|
||||
/datum/pet_command/idle,
|
||||
/datum/pet_command/free,
|
||||
/datum/pet_command/good_boy/dog,
|
||||
/datum/pet_command/follow/dog,
|
||||
/datum/pet_command/point_targetting/attack/dog,
|
||||
/datum/pet_command/point_targetting/fetch,
|
||||
/datum/pet_command/play_dead,
|
||||
)
|
||||
|
||||
/mob/living/basic/pet/dog/Initialize(mapload)
|
||||
. = ..()
|
||||
AddElement(/datum/element/pet_bonus, "woofs happily!")
|
||||
AddElement(/datum/element/footstep, FOOTSTEP_MOB_CLAW)
|
||||
AddElement(/datum/element/befriend_petting, tamed_reaction = "%SOURCE% licks at %TARGET% in a friendly manner!", untamed_reaction = "%SOURCE% fixes %TARGET% with a look of betrayal.")
|
||||
AddComponent(/datum/component/obeys_commands, pet_commands)
|
||||
|
||||
/mob/living/basic/pet/dog/proc/update_dog_speech(datum/ai_planning_subtree/random_speech/speech)
|
||||
speech.speak = string_list(list("YAP", "Woof!", "Bark!", "AUUUUUU"))
|
||||
@@ -42,7 +70,7 @@
|
||||
butcher_results = list(/obj/item/food/meat/slab/corgi = 3, /obj/item/stack/sheet/animalhide/corgi = 1)
|
||||
gold_core_spawnable = FRIENDLY_SPAWN
|
||||
collar_icon_state = "corgi"
|
||||
ai_controller = /datum/ai_controller/dog/corgi
|
||||
ai_controller = /datum/ai_controller/basic_controller/dog/corgi
|
||||
var/obj/item/inventory_head
|
||||
var/obj/item/inventory_back
|
||||
/// Access card for Ian.
|
||||
@@ -522,6 +550,7 @@ GLOBAL_LIST_INIT(strippable_corgi_items, create_strippable_list(list(
|
||||
desc = "At a ripe old age of [record_age], Ian's not as spry as he used to be, but he'll always be the HoP's beloved corgi." //RIP
|
||||
ai_controller?.blackboard[BB_DOG_IS_SLOW] = TRUE
|
||||
is_slow = TRUE
|
||||
speed = 2
|
||||
|
||||
/mob/living/basic/pet/dog/corgi/ian/Life(delta_time = SSMOBS_DT, times_fired)
|
||||
if(!stat && SSticker.current_state == GAME_STATE_FINISHED && !memory_saved)
|
||||
|
||||
@@ -36,6 +36,6 @@
|
||||
ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT)
|
||||
|
||||
/datum/ai_controller/basic_controller/axolotl
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD
|
||||
ai_movement = /datum/ai_movement/basic_avoidance
|
||||
idle_behavior = /datum/idle_behavior/idle_random_walk
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
BB_PET_TARGETTING_DATUM = new /datum/targetting_datum/not_friends(),
|
||||
)
|
||||
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD
|
||||
ai_movement = /datum/ai_movement/basic_avoidance
|
||||
idle_behavior = /datum/idle_behavior/idle_random_walk
|
||||
planning_subtrees = list(
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
/datum/ai_controller/basic_controller/mothroach
|
||||
blackboard = list()
|
||||
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD
|
||||
ai_movement = /datum/ai_movement/basic_avoidance
|
||||
idle_behavior = /datum/idle_behavior/idle_random_walk
|
||||
planning_subtrees = list(
|
||||
|
||||
@@ -357,7 +357,7 @@
|
||||
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic(), // Use this to find people to run away from
|
||||
)
|
||||
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD
|
||||
ai_movement = /datum/ai_movement/basic_avoidance
|
||||
idle_behavior = /datum/idle_behavior/idle_random_walk
|
||||
planning_subtrees = list(
|
||||
@@ -401,7 +401,7 @@
|
||||
BB_LOW_PRIORITY_HUNTING_TARGET = null, // cable
|
||||
)
|
||||
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED
|
||||
ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD
|
||||
ai_movement = /datum/ai_movement/basic_avoidance
|
||||
idle_behavior = /datum/idle_behavior/idle_random_walk
|
||||
planning_subtrees = list(
|
||||
|
||||
Reference in New Issue
Block a user