mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
[MIRROR] Greatly increases Pun Pun's abilities and strengths (using desk bells, cross stun immunity) [MDB IGNORE] (#15411)
* Greatly increases Pun Pun's abilities and strengths (using desk bells, cross stun immunity) * Update emote.dm Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com>
This commit is contained in:
co-authored by
John Willard
Zonespace
parent
38095e762c
commit
299fe8c5cb
@@ -213,7 +213,7 @@
|
||||
var/mob/living/living_pawn = controller.pawn
|
||||
if(!living_pawn.get_num_held_items())
|
||||
return //we want to fail the search if we don't have something held
|
||||
. = ..()
|
||||
return ..()
|
||||
|
||||
/**
|
||||
* Variant of find and set that also requires the item to be edible. checks hands too
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
/datum/idle_behavior/idle_monkey
|
||||
///Emotes that will be played commonly during idle behavior.
|
||||
var/list/common_emotes = list(
|
||||
"screech",
|
||||
"roar",
|
||||
)
|
||||
///Emotes that will be played rarely during idle behavior.
|
||||
var/list/rare_emotes = list(
|
||||
"scratch",
|
||||
"jump",
|
||||
"roll",
|
||||
"tail",
|
||||
)
|
||||
|
||||
/datum/idle_behavior/idle_monkey/perform_idle_behavior(delta_time, datum/ai_controller/controller)
|
||||
var/mob/living/living_pawn = controller.pawn
|
||||
|
||||
@@ -5,6 +19,18 @@
|
||||
var/move_dir = pick(GLOB.alldirs)
|
||||
living_pawn.Move(get_step(living_pawn, move_dir), move_dir)
|
||||
else if(DT_PROB(5, delta_time))
|
||||
INVOKE_ASYNC(living_pawn, /mob.proc/emote, pick("screech"))
|
||||
INVOKE_ASYNC(living_pawn, /mob.proc/emote, pick(common_emotes))
|
||||
else if(DT_PROB(1, delta_time))
|
||||
INVOKE_ASYNC(living_pawn, /mob.proc/emote, pick("scratch","jump","roll","tail"))
|
||||
INVOKE_ASYNC(living_pawn, /mob.proc/emote, pick(rare_emotes))
|
||||
|
||||
/datum/idle_behavior/idle_monkey/pun_pun
|
||||
common_emotes = list(
|
||||
"tunesing",
|
||||
"dance",
|
||||
"bow",
|
||||
)
|
||||
rare_emotes = list(
|
||||
"clear",
|
||||
"sign",
|
||||
"tail",
|
||||
)
|
||||
|
||||
@@ -29,6 +29,21 @@ have ways of interacting with a specific mob and control it.
|
||||
)
|
||||
idle_behavior = /datum/idle_behavior/idle_monkey
|
||||
|
||||
///Whether this AI is immune to being stunned by being crossed into.
|
||||
var/crossed_immune = FALSE
|
||||
|
||||
/datum/ai_controller/monkey/pun_pun
|
||||
movement_delay = 0.7 SECONDS //pun pun moves slower so the bartender can keep track of them
|
||||
planning_subtrees = list(
|
||||
/datum/ai_planning_subtree/generic_resist,
|
||||
/datum/ai_planning_subtree/monkey_combat,
|
||||
/datum/ai_planning_subtree/generic_hunger,
|
||||
/datum/ai_planning_subtree/generic_play_instrument,
|
||||
/datum/ai_planning_subtree/punpun_shenanigans,
|
||||
)
|
||||
idle_behavior = /datum/idle_behavior/idle_monkey/pun_pun
|
||||
crossed_immune = TRUE
|
||||
|
||||
/datum/ai_controller/monkey/angry
|
||||
|
||||
/datum/ai_controller/monkey/angry/TryPossessPawn(atom/new_pawn)
|
||||
@@ -42,7 +57,8 @@ have ways of interacting with a specific mob and control it.
|
||||
return AI_CONTROLLER_INCOMPATIBLE
|
||||
|
||||
var/mob/living/living_pawn = new_pawn
|
||||
RegisterSignal(new_pawn, COMSIG_MOVABLE_CROSS, .proc/on_crossed)
|
||||
if(!crossed_immune)
|
||||
RegisterSignal(new_pawn, COMSIG_MOVABLE_CROSS, .proc/on_crossed)
|
||||
RegisterSignal(new_pawn, COMSIG_PARENT_ATTACKBY, .proc/on_attackby)
|
||||
RegisterSignal(new_pawn, COMSIG_ATOM_ATTACK_HAND, .proc/on_attack_hand)
|
||||
RegisterSignal(new_pawn, COMSIG_ATOM_ATTACK_PAW, .proc/on_attack_paw)
|
||||
@@ -60,8 +76,10 @@ have ways of interacting with a specific mob and control it.
|
||||
return ..() //Run parent at end
|
||||
|
||||
/datum/ai_controller/monkey/UnpossessPawn(destroy)
|
||||
if(!crossed_immune)
|
||||
UnregisterSignal(pawn, COMSIG_MOVABLE_CROSS)
|
||||
|
||||
UnregisterSignal(pawn, list(
|
||||
COMSIG_MOVABLE_CROSS,
|
||||
COMSIG_PARENT_ATTACKBY,
|
||||
COMSIG_ATOM_ATTACK_HAND,
|
||||
COMSIG_ATOM_ATTACK_PAW,
|
||||
@@ -88,11 +106,11 @@ have ways of interacting with a specific mob and control it.
|
||||
RegisterSignal(pawn, COMSIG_MOVABLE_CROSS, .proc/on_crossed)
|
||||
|
||||
/datum/ai_controller/monkey/able_to_run()
|
||||
. = ..()
|
||||
var/mob/living/living_pawn = pawn
|
||||
|
||||
if(IS_DEAD_OR_INCAP(living_pawn))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
///re-used behavior pattern by monkeys for finding a weapon
|
||||
/datum/ai_controller/monkey/proc/TryFindWeapon()
|
||||
@@ -164,7 +182,7 @@ have ways of interacting with a specific mob and control it.
|
||||
/datum/ai_controller/monkey/proc/on_bullet_act(datum/source, obj/projectile/Proj)
|
||||
SIGNAL_HANDLER
|
||||
var/mob/living/living_pawn = pawn
|
||||
if(istype(Proj , /obj/projectile/beam)||istype(Proj, /obj/projectile/bullet))
|
||||
if(istype(Proj, /obj/projectile/beam) || istype(Proj, /obj/projectile/bullet))
|
||||
if((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE))
|
||||
if(!Proj.nodamage && Proj.damage < living_pawn.health && isliving(Proj.firer))
|
||||
retaliate(Proj.firer)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/datum/ai_planning_subtree/punpun_shenanigans/SelectBehaviors(datum/ai_controller/monkey/controller, delta_time)
|
||||
|
||||
if(prob(5))
|
||||
controller.queue_behavior(/datum/ai_behavior/use_in_hand)
|
||||
|
||||
if(!DT_PROB(MONKEY_SHENANIGAN_PROB, delta_time))
|
||||
return
|
||||
|
||||
if(!controller.blackboard[BB_MONKEY_CURRENT_PRESS_TARGET])
|
||||
controller.queue_behavior(/datum/ai_behavior/find_and_set, BB_MONKEY_CURRENT_PRESS_TARGET, /obj/structure/desk_bell, 2)
|
||||
else if(prob(50))
|
||||
controller.queue_behavior(/datum/ai_behavior/use_on_object, BB_MONKEY_CURRENT_PRESS_TARGET)
|
||||
return SUBTREE_RETURN_FINISH_PLANNING
|
||||
|
||||
if(!controller.blackboard[BB_MONKEY_CURRENT_GIVE_TARGET])
|
||||
controller.queue_behavior(/datum/ai_behavior/find_and_set/pawn_must_hold_item, BB_MONKEY_CURRENT_GIVE_TARGET, /mob/living, 2)
|
||||
else if(prob(30))
|
||||
controller.queue_behavior(/datum/ai_behavior/give, BB_MONKEY_CURRENT_GIVE_TARGET)
|
||||
return SUBTREE_RETURN_FINISH_PLANNING
|
||||
|
||||
@@ -126,6 +126,7 @@
|
||||
if(tail?.wag_flags & WAG_ABLE)
|
||||
return ..()
|
||||
return FALSE
|
||||
|
||||
/datum/emote/living/carbon/human/wing
|
||||
key = "wing"
|
||||
key_third_person = "wings"
|
||||
@@ -156,8 +157,10 @@
|
||||
if(H.dna && H.dna.species && (H.dna.features["wings"] != "None"))
|
||||
return TRUE
|
||||
|
||||
//Ayy lmao
|
||||
|
||||
/datum/emote/living/carbon/human/clear_throat
|
||||
key = "clear"
|
||||
key_third_person = "clears throat"
|
||||
message = "clears their throat."
|
||||
|
||||
///Snowflake emotes only for le epic chimp
|
||||
/datum/emote/living/carbon/human/monkey
|
||||
@@ -194,7 +197,7 @@
|
||||
key = "tail"
|
||||
message = "waves their tail."
|
||||
|
||||
/datum/emote/living/carbon/human/monkeysign
|
||||
/datum/emote/living/carbon/human/monkey/sign
|
||||
key = "sign"
|
||||
key_third_person = "signs"
|
||||
message_param = "signs the number %t."
|
||||
|
||||
@@ -34,10 +34,11 @@
|
||||
|
||||
GLOBAL_DATUM(the_one_and_only_punpun, /mob/living/carbon/human/species/monkey/punpun)
|
||||
|
||||
/mob/living/carbon/human/species/monkey/punpun //except for a few special persistence features, pun pun is just a normal monkey
|
||||
/mob/living/carbon/human/species/monkey/punpun
|
||||
name = "Pun Pun" //C A N O N
|
||||
unique_name = FALSE
|
||||
use_random_name = FALSE
|
||||
ai_controller = /datum/ai_controller/monkey/pun_pun
|
||||
/// If we had one of the rare names in a past life
|
||||
var/ancestor_name
|
||||
/// The number of times Pun Pun has died since he was last gibbed
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
|
||||
#undef BLUSH_DURATION
|
||||
|
||||
/datum/emote/living/sing_tune
|
||||
key = "tunesing"
|
||||
key_third_person = "sings a tune"
|
||||
message = "sings a tune."
|
||||
|
||||
/datum/emote/living/bow
|
||||
key = "bow"
|
||||
key_third_person = "bows"
|
||||
|
||||
@@ -51,6 +51,9 @@
|
||||
COOLDOWN_START(src, ring_cooldown, ring_cooldown_length)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/desk_bell/attack_paw(mob/user, list/modifiers)
|
||||
return attack_hand(user, modifiers)
|
||||
|
||||
/obj/structure/desk_bell/attackby(obj/item/weapon, mob/living/user, params)
|
||||
. = ..()
|
||||
times_rang += weapon.force
|
||||
|
||||
@@ -762,6 +762,7 @@
|
||||
#include "code\datums\ai\monkey\monkey_behaviors.dm"
|
||||
#include "code\datums\ai\monkey\monkey_controller.dm"
|
||||
#include "code\datums\ai\monkey\monkey_subtrees.dm"
|
||||
#include "code\datums\ai\monkey\punpun_subtrees.dm"
|
||||
#include "code\datums\ai\movement\_ai_movement.dm"
|
||||
#include "code\datums\ai\movement\ai_movement_basic_avoidance.dm"
|
||||
#include "code\datums\ai\movement\ai_movement_dumb.dm"
|
||||
|
||||
Reference in New Issue
Block a user