Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3291 - Fixes the ability to manipulate a dummy from a distance using the tablet #4268

Merged
merged 4 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion code/game/objects/items/devices/dummy_tablet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
linked_dummy = null
. = ..()

/obj/item/device/professor_dummy_tablet/proc/is_adjacent_to_dummy(mob/user as mob)
Xufysz marked this conversation as resolved.
Show resolved Hide resolved
if (get_dist(linked_dummy, user) > 1)
to_chat(user, "You are too far away to use the tablet.")
return FALSE

return TRUE

/obj/item/device/professor_dummy_tablet/proc/link_mob(mob/living/carbon/human/H)
linked_dummy = H

Expand All @@ -20,6 +27,12 @@
interact(user)

/obj/item/device/professor_dummy_tablet/interact(mob/user as mob)
if (linked_dummy == null)
Xufysz marked this conversation as resolved.
Show resolved Hide resolved
return

if (!is_adjacent_to_dummy(user))
return

user.set_interaction(src)
var/dat = "<head><title>Professor DUMMY Control Tablet</title></head><body>"

Expand Down Expand Up @@ -90,9 +103,11 @@

/obj/item/device/professor_dummy_tablet/Topic(href, href_list)
if(..()) return FALSE
usr.set_interaction(src)

if (!is_adjacent_to_dummy(usr))
return FALSE

usr.set_interaction(src)

switch(href_list["operation"])
if ("brute_damage_organ")
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/human_attackhand.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
return held_weapon.afterattack(target,src)

var/disarm_chance = rand(1, 100)
var/attacker_skill_level = attacking_mob.skills ? skills.get_skill_level(SKILL_CQC) : SKILL_CQC_MAX // No skills, so assume max
var/attacker_skill_level = skills && attacking_mob.skills ? skills.get_skill_level(SKILL_CQC) : SKILL_CQC_MAX // No skills, so assume max
harryob marked this conversation as resolved.
Show resolved Hide resolved
var/defender_skill_level = skills ? skills.get_skill_level(SKILL_CQC) : SKILL_CQC_MAX // No skills, so assume max
disarm_chance -= 5 * attacker_skill_level
disarm_chance += 5 * defender_skill_level
Expand Down
Loading