Skip to content

Commit

Permalink
Fixes some dex issues with food and natural weapons.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Jul 14, 2024
1 parent 9767cac commit 9ca06a3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
9 changes: 5 additions & 4 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ avoid code duplication. This includes items that may sometimes act as a standard
/mob/living/attackby(obj/item/used_item, mob/user)
if(!ismob(user))
return TRUE
if(can_operate(src, user) != OPERATE_DENY && used_item.do_surgery(src,user)) //Surgery
return TRUE
if(try_butcher_in_place(user, used_item))
return TRUE
if(user.a_intent != I_HURT)
if(can_operate(src, user) != OPERATE_DENY && used_item.do_surgery(src,user)) //Surgery
return TRUE
if(try_butcher_in_place(user, used_item))
return TRUE
var/oldhealth = current_health
. = used_item.use_on_mob(src, user)
if(used_item.force && istype(ai) && current_health < oldhealth)
Expand Down
8 changes: 6 additions & 2 deletions code/_onclick/other_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
do_windup_animation(A, attack_delay, no_reset = TRUE)
if(!do_after(src, attack_delay, A) || !Adjacent(A))
visible_message(SPAN_NOTICE("\The [src] misses [G.his] attack on \the [A]!"))
animate(src, pixel_x = default_pixel_x, pixel_y = default_pixel_y, time = 2) // reset wherever the attack animation got us to.
reset_offsets(time = 2)

Check failure on line 89 in code/_onclick/other_mobs.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

bad keyword argument "time" to /mob/proc/reset_offsets
ai?.move_to_target(TRUE) // Restart hostile mob tracking.
return TRUE
ai?.move_to_target(TRUE) // Restart hostile mob tracking.
Expand All @@ -95,10 +95,14 @@
var/mob/mob = A
if(!mob.ckey && !prob(get_melee_accuracy()))
visible_message(SPAN_NOTICE("\The [src] misses [G.his] attack on \the [A]!"))
reset_offsets(time = 2)

Check failure on line 98 in code/_onclick/other_mobs.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

bad keyword argument "time" to /mob/proc/reset_offsets
return TRUE

a_intent = I_HURT
. = A.attackby(attacking_with, src)
if(isliving(A))
if(!.)
reset_offsets(time = 2)

Check failure on line 104 in code/_onclick/other_mobs.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

bad keyword argument "time" to /mob/proc/reset_offsets
else if(isliving(A))
apply_attack_effects(A)

// Attack hand but for simple animals
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/simple_animal/natural_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
canremove = FALSE
obj_flags = OBJ_FLAG_CONDUCTIBLE //for intent of shocking checks, they're right inside the animal
is_spawnable_type = FALSE
needs_attack_dexterity = DEXTERITY_NONE
var/show_in_message // whether should we show up in attack message, e.g. 'urist has been bit with teeth by carp' vs 'urist has been bit by carp'

/obj/item/natural_weapon/attack_message_name()
Expand Down
1 change: 1 addition & 0 deletions code/modules/reagents/reagent_containers/food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
center_of_mass = @'{"x":16,"y":16}'
w_class = ITEM_SIZE_SMALL
abstract_type = /obj/item/chems/food
needs_attack_dexterity = DEXTERITY_NONE

/// Indicates the food should give a stress effect on eating.
// This is set to 1 if the food is created by a recipe, -1 if the food is raw.
Expand Down

0 comments on commit 9ca06a3

Please sign in to comment.