Skip to content

Commit

Permalink
Adding mouth gripper to passive animals.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 authored and comma committed Aug 26, 2024
1 parent 1cc2cfe commit f10a621
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
6 changes: 0 additions & 6 deletions code/modules/mob/living/human/human_grabs.dm
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/mob/living/human/add_grab(var/obj/item/grab/grab, var/defer_hand = FALSE)
if(defer_hand)
. = put_in_hands(grab)
else
. = put_in_active_hand(grab)

/mob/living/human/can_be_grabbed(var/mob/grabber, var/target_zone, var/defer_hand = FALSE)
. = ..()
if(.)
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
LAZYDISTINCTADD(., slot)

/mob/living/add_held_item_slot(var/datum/inventory_slot/held_slot)
has_had_gripper = TRUE
var/datum/inventory_slot/existing_slot = get_inventory_slot_datum(held_slot.slot_id)
if(existing_slot && existing_slot != held_slot)
var/held = existing_slot.get_equipped_item()
Expand Down
5 changes: 4 additions & 1 deletion code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,7 @@
var/weather_sensitive = FALSE

/// Var used to track current step for footsteps sounds.
var/tmp/step_count
var/tmp/step_count

/// Has this mob -ever- had a gripper? Used to skip hand checks in some cases.
var/has_had_gripper = FALSE
8 changes: 8 additions & 0 deletions code/modules/mob/living/living_grabs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@
return grab

/mob/living/add_grab(var/obj/item/grab/grab, var/defer_hand = FALSE)

if(has_had_gripper)
if(defer_hand)
. = put_in_hands(grab)
else
. = put_in_active_hand(grab)
return

for(var/obj/item/grab/other_grab in contents)
if(other_grab != grab)
return FALSE
Expand Down
4 changes: 0 additions & 4 deletions code/modules/mob/living/simple_animal/_simple_animal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,6 @@ var/global/list/simplemob_icon_bitflag_cache = list()

..(message, null, verb)

/mob/living/simple_animal/put_in_hands(var/obj/item/W) // No hands.
W.forceMove(get_turf(src))
return 1

/mob/living/simple_animal/is_burnable()
return heat_damage_per_tick

Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/living/simple_animal/passive/_passive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
maxbodytemp = 323
base_movement_delay = -1

/mob/living/simple_animal/passive/Initialize()
. = ..()
add_held_item_slot(new /datum/inventory_slot/gripper/mouth/simple)

0 comments on commit f10a621

Please sign in to comment.