mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Monke Business - Ports monkey AI from TG (#31067)
* Monke Mode * Punch * Some comment stuff * Linters, excess * Linters * Emote stuff * Pause monkey AI during do afters * Small improvements * Oops * Fixes monkeys trying to drink forever from a glass * Knockdowns and stamcrit fixes * Removes eating/drinking from Pun Pun * Monkey controller improvement, bug fix * Fixes monkey item giving * Fixes brain swaps * Fixes * Update code/datums/ai/monkey/monkey_controller.dm Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com> * Addresses code review * Oops * Oops round 2 * Fixes monkeys staying in trip mode when evolved --------- Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com> Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
co-authored by
Burzah
parent
82d31ab8a5
commit
a590870d00
@@ -32,6 +32,22 @@
|
||||
/mob/proc/is_holding(obj/item/I)
|
||||
return istype(I) && (I == r_hand || I == l_hand)
|
||||
|
||||
/// Returns a list of items being held
|
||||
/mob/proc/held_items()
|
||||
var/list/items = list()
|
||||
items += get_item_by_slot(ITEM_SLOT_LEFT_HAND)
|
||||
items += get_item_by_slot(ITEM_SLOT_RIGHT_HAND)
|
||||
return items
|
||||
|
||||
/// Returns a number corresponding to an open hand, or null if no open hands.
|
||||
/mob/proc/get_empty_held_indexes()
|
||||
var/list/L
|
||||
var/list/held = held_items()
|
||||
for(var/i in 1 to length(held))
|
||||
if(!held[i])
|
||||
LAZYADD(L, i)
|
||||
return L
|
||||
|
||||
//Checks if we're holding an item of type: typepath
|
||||
/mob/proc/is_holding_item_of_type(typepath)
|
||||
. = FALSE
|
||||
|
||||
@@ -130,6 +130,14 @@
|
||||
muzzled_noises = list("bothered")
|
||||
emote_type = EMOTE_AUDIBLE | EMOTE_MOUTH
|
||||
|
||||
/datum/emote/living/carbon/human/clear_throat
|
||||
key = "clear"
|
||||
key_third_person = "clears throat"
|
||||
message = "clears their throat."
|
||||
message_mime = "silently clears their throat!"
|
||||
muzzled_noises = list("clears their throat.")
|
||||
emote_type = EMOTE_AUDIBLE | EMOTE_MOUTH
|
||||
|
||||
/datum/emote/living/carbon/human/hug
|
||||
key = "hug"
|
||||
key_third_person = "hugs"
|
||||
|
||||
@@ -215,21 +215,27 @@
|
||||
|
||||
/mob/living/carbon/human/monkey/Initialize(mapload)
|
||||
. = ..(mapload, /datum/species/monkey)
|
||||
ai_controller = new /datum/ai_controller/monkey(src)
|
||||
|
||||
/mob/living/carbon/human/farwa/Initialize(mapload)
|
||||
. = ..(mapload, /datum/species/monkey/tajaran)
|
||||
ai_controller = new /datum/ai_controller/monkey(src)
|
||||
|
||||
/mob/living/carbon/human/wolpin/Initialize(mapload)
|
||||
. = ..(mapload, /datum/species/monkey/vulpkanin)
|
||||
ai_controller = new /datum/ai_controller/monkey(src)
|
||||
|
||||
/mob/living/carbon/human/neara/Initialize(mapload)
|
||||
. = ..(mapload, /datum/species/monkey/skrell)
|
||||
ai_controller = new /datum/ai_controller/monkey(src)
|
||||
|
||||
/mob/living/carbon/human/stok/Initialize(mapload)
|
||||
. = ..(mapload, /datum/species/monkey/unathi)
|
||||
ai_controller = new /datum/ai_controller/monkey(src)
|
||||
|
||||
/mob/living/carbon/human/nian_worme/Initialize(mapload)
|
||||
. = ..(mapload, /datum/species/monkey/nian_worme)
|
||||
ai_controller = new /datum/ai_controller/monkey(src)
|
||||
|
||||
/mob/living/carbon/human/moth/Initialize(mapload)
|
||||
. = ..(mapload, /datum/species/moth)
|
||||
|
||||
@@ -45,18 +45,6 @@
|
||||
if(H.radiation > RAD_MOB_GORILLIZE && prob(RAD_MOB_GORILLIZE_PROB))
|
||||
H.gorillize()
|
||||
|
||||
/datum/species/monkey/handle_npc(mob/living/carbon/human/H)
|
||||
if(H.stat != CONSCIOUS)
|
||||
return
|
||||
if(prob(1))
|
||||
H.emote(pick("scratch","jump","roll","tail"))
|
||||
if(prob(33) && (H.mobility_flags & MOBILITY_MOVE) && isturf(H.loc) && !H.pulledby) //won't move if being pulled
|
||||
var/dir_to_go = pick(GLOB.cardinal)
|
||||
var/turf/to_go = get_step(H, dir_to_go)
|
||||
if(islava(to_go) || ischasm(to_go))
|
||||
return
|
||||
step(H, dir_to_go)
|
||||
|
||||
/datum/species/monkey/get_random_name()
|
||||
return "[lowertext(name)] ([rand(100,999)])"
|
||||
|
||||
@@ -65,8 +53,15 @@
|
||||
H.real_name = get_random_name()
|
||||
H.name = H.real_name
|
||||
H.butcher_results = list(/obj/item/food/meat/monkey = 5)
|
||||
H.ai_controller = new /datum/ai_controller/monkey(H)
|
||||
H.dna.blood_type = pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+")
|
||||
|
||||
/datum/species/monkey/on_species_loss(mob/living/carbon/human/H)
|
||||
. = ..()
|
||||
if(H.ai_controller && istype(H.ai_controller, /datum/ai_controller/monkey))
|
||||
var/datum/ai_controller/monkey/controller = H.ai_controller
|
||||
controller.set_trip_mode(mode = FALSE)
|
||||
|
||||
/datum/species/monkey/handle_dna(mob/living/carbon/human/H, remove)
|
||||
..()
|
||||
if(!remove)
|
||||
|
||||
@@ -24,6 +24,14 @@
|
||||
message_param = "bows to %t."
|
||||
message_postfix = "to %t."
|
||||
|
||||
/datum/emote/living/sing_tune
|
||||
key = "tunesing"
|
||||
key_third_person = "sings a tune"
|
||||
message = "sings a tune."
|
||||
message_mime = "opens their mouth rather obnoxiously."
|
||||
emote_type = EMOTE_AUDIBLE
|
||||
muzzled_noises = list("melodic")
|
||||
|
||||
/datum/emote/living/burp
|
||||
key = "burp"
|
||||
key_third_person = "burps"
|
||||
|
||||
@@ -65,13 +65,14 @@
|
||||
return
|
||||
if(L != user)
|
||||
L.visible_message(SPAN_DANGER("[user] is trying to inject [L]!"), \
|
||||
SPAN_USERDANGER("[user] is trying to inject you!"))
|
||||
SPAN_USERDANGER("[user] is trying to inject you!"))
|
||||
SEND_SIGNAL(L, COMSIG_LIVING_TRY_SYRINGE_INJECT, user)
|
||||
if(!do_mob(user, L))
|
||||
return
|
||||
if(L.reagents.total_volume >= L.reagents.maximum_volume)
|
||||
return
|
||||
L.visible_message("<span class='danger'>[user] injects [L] with the syringe!", \
|
||||
"<span class='userdanger'>[user] injects [L] with the syringe!")
|
||||
L.visible_message(SPAN_DANGER("[user] injects [L] with the syringe!"), \
|
||||
SPAN_USERDANGER("[user] injects [L] with the syringe!"))
|
||||
|
||||
var/list/rinject = list()
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
@@ -88,6 +89,7 @@
|
||||
if(L != user)
|
||||
L.visible_message(SPAN_DANGER("[user] is trying to take a blood sample from [L]!"), \
|
||||
SPAN_USERDANGER("[user] is trying to take a blood sample from [L]!"))
|
||||
SEND_SIGNAL(L, COMSIG_LIVING_TRY_SYRINGE_WITHDRAW, user)
|
||||
busy = TRUE
|
||||
if(!do_mob(user, L, syringe_draw_time))
|
||||
busy = FALSE
|
||||
|
||||
@@ -179,25 +179,8 @@
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
var/mob/GM = G.affecting
|
||||
user.visible_message(
|
||||
SPAN_WARNING("[user] starts stuffing [GM] into the disposal unit!"),
|
||||
SPAN_WARNING("You start stuffing [GM] into the disposal unit."),
|
||||
SPAN_WARNING("You hear someone trying to stuff someone else into a disposal unit!")
|
||||
)
|
||||
|
||||
// Abort if the target manages to scurry away.
|
||||
if(!do_after(user, 2 SECONDS, target = GM))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
GM.forceMove(src)
|
||||
user.visible_message(
|
||||
SPAN_WARNING("[GM] has been stuffed into the disposal unit by [user]!"),
|
||||
SPAN_WARNING("You stuff [GM] into the disposal unit."),
|
||||
SPAN_WARNING("You hear someone being stuffed into a disposal unit!")
|
||||
)
|
||||
stuff_mob_in(GM, user)
|
||||
qdel(G)
|
||||
update()
|
||||
add_attack_logs(user, GM, "Disposal'ed", !GM.ckey ? null : ATKLOG_ALL)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if(!user.drop_item() || QDELETED(used))
|
||||
@@ -214,6 +197,32 @@
|
||||
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/// Handles stuffing a grabbed mob into the disposal
|
||||
/obj/machinery/disposal/proc/stuff_mob_in(mob/living/target, mob/living/user)
|
||||
// If there's not actually a mob in the grab, stop it. Get some help.
|
||||
if(!istype(target))
|
||||
return FALSE
|
||||
|
||||
user.visible_message(
|
||||
SPAN_WARNING("[user] starts stuffing [target] into the disposal unit!"),
|
||||
SPAN_WARNING("You start stuffing [target] into the disposal unit."),
|
||||
SPAN_WARNING("You hear someone trying to stuff someone else into a disposal unit!")
|
||||
)
|
||||
|
||||
// Abort if the target manages to scurry away.
|
||||
if(!do_after(user, 2 SECONDS, target = target))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
target.forceMove(src)
|
||||
user.visible_message(
|
||||
SPAN_WARNING("[target] has been stuffed into the disposal unit by [user]!"),
|
||||
SPAN_WARNING("You stuff [target] into the disposal unit."),
|
||||
SPAN_WARNING("You hear someone being stuffed into a disposal unit!")
|
||||
)
|
||||
update()
|
||||
add_attack_logs(user, target, "Disposal'ed", !target.ckey ? null : ATKLOG_ALL)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/disposal/screwdriver_act(mob/user, obj/item/I)
|
||||
if(mode != DISPOSALS_OFF) // It's on
|
||||
to_chat(user, SPAN_WARNING("You need to turn the disposal unit off first!"))
|
||||
|
||||
Reference in New Issue
Block a user