mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-01-10 09:23:18 +00:00
Unifying mob scooping, removing some unneeded boilerplate.
This commit is contained in:
@@ -84,6 +84,13 @@ var/list/holder_mob_icon_cache = list()
|
||||
//Mob procs and vars for scooping up
|
||||
/mob/living/var/holder_type
|
||||
|
||||
/mob/living/MouseDrop(var/atom/over_object)
|
||||
var/mob/living/carbon/human/H = over_object
|
||||
if(holder_type && istype(H) && !H.lying && !issmall(H) && Adjacent(H))
|
||||
get_scooped(H, (usr == src))
|
||||
return
|
||||
return ..()
|
||||
|
||||
/mob/living/proc/get_scooped(var/mob/living/carbon/grabber, var/self_grab)
|
||||
|
||||
if(!holder_type || buckled || pinned.len)
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
/mob/living/carbon/alien/diona/MouseDrop(atom/over_object)
|
||||
var/mob/living/carbon/H = over_object
|
||||
if(!istype(H) || !Adjacent(H)) return ..()
|
||||
if(H.a_intent == "help")
|
||||
if(H.species && H.species.name == "Diona" && do_merge(H))
|
||||
return
|
||||
get_scooped(H)
|
||||
return
|
||||
else if(H.a_intent == "grab" && hat && !(H.l_hand && H.r_hand))
|
||||
/mob/living/carbon/alien/diona/MouseDrop(var/atom/over_object)
|
||||
var/mob/living/carbon/human/H = over_object
|
||||
if(!istype(H) || !Adjacent(H))
|
||||
return ..()
|
||||
if(H.a_intent == "grab" && hat && !(H.l_hand && H.r_hand))
|
||||
hat.loc = get_turf(src)
|
||||
H.put_in_hands(hat)
|
||||
H.visible_message("<span class='danger'>\The [H] removes \the [src]'s [hat].</span>")
|
||||
hat = null
|
||||
update_icons()
|
||||
updateicon()
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -1370,13 +1370,6 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/human/MouseDrop(var/atom/over_object)
|
||||
var/mob/living/carbon/human/H = over_object
|
||||
if(holder_type && istype(H) && !H.lying && !issmall(H) && Adjacent(H))
|
||||
get_scooped(H, (usr == src))
|
||||
return
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/verb/pull_punches()
|
||||
set name = "Pull Punches"
|
||||
set desc = "Try not to hurt them."
|
||||
|
||||
@@ -127,9 +127,6 @@
|
||||
return 0
|
||||
..()
|
||||
|
||||
/mob/living/silicon/pai/MouseDrop(atom/over_object)
|
||||
return
|
||||
|
||||
/mob/living/silicon/pai/emp_act(severity)
|
||||
// Silence for 2 minutes
|
||||
// 20% chance to kill
|
||||
@@ -421,12 +418,3 @@
|
||||
grabber.update_inv_l_hand()
|
||||
grabber.update_inv_r_hand()
|
||||
return H
|
||||
|
||||
/mob/living/silicon/pai/MouseDrop(atom/over_object)
|
||||
var/mob/living/carbon/H = over_object
|
||||
if(!istype(H) || !Adjacent(H)) return ..()
|
||||
if(H.a_intent == "help")
|
||||
get_scooped(H)
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -21,13 +21,11 @@
|
||||
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/drone/MouseDrop(atom/over_object)
|
||||
var/mob/living/carbon/H = over_object
|
||||
if(!istype(H) || !Adjacent(H)) return ..()
|
||||
if(H.a_intent == "help")
|
||||
get_scooped(H)
|
||||
return
|
||||
else if(H.a_intent == "grab" && hat && !(H.l_hand && H.r_hand))
|
||||
/mob/living/silicon/robot/drone/MouseDrop(var/atom/over_object)
|
||||
var/mob/living/carbon/human/H = over_object
|
||||
if(!istype(H) || !Adjacent(H))
|
||||
return ..()
|
||||
if(H.a_intent == "grab" && hat && !(H.l_hand && H.r_hand))
|
||||
hat.loc = get_turf(src)
|
||||
H.put_in_hands(hat)
|
||||
H.visible_message("<span class='danger'>\The [H] removes \the [src]'s [hat].</span>")
|
||||
|
||||
@@ -124,17 +124,6 @@
|
||||
. = ..()
|
||||
set_flee_target(AM.thrower? AM.thrower : src.loc)
|
||||
|
||||
/mob/living/simple_animal/cat/MouseDrop(atom/over_object)
|
||||
|
||||
var/mob/living/carbon/H = over_object
|
||||
if(!istype(H) || !Adjacent(H)) return ..()
|
||||
|
||||
if(H.a_intent == "help")
|
||||
get_scooped(H)
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
//Basic friend AI
|
||||
/mob/living/simple_animal/cat/fluff
|
||||
var/mob/living/carbon/human/friend
|
||||
|
||||
@@ -78,21 +78,6 @@
|
||||
if(client)
|
||||
client.time_died_as_mouse = world.time
|
||||
|
||||
/mob/living/simple_animal/mouse/MouseDrop(atom/over_object)
|
||||
|
||||
var/mob/living/carbon/H = over_object
|
||||
if(!istype(H) || !Adjacent(H)) return ..()
|
||||
|
||||
if(H.a_intent == "help")
|
||||
get_scooped(H)
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/mouse/start_pulling(var/atom/movable/AM)//Prevents mouse from pulling things
|
||||
src << "<span class='warning'>You are too small to pull anything.</span>"
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/mouse/Crossed(AM as mob|obj)
|
||||
if( ishuman(AM) )
|
||||
if(!stat)
|
||||
|
||||
Reference in New Issue
Block a user