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

[MIRROR] Rewrites unarmed attacks on fellow humans #1050

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion code/datums/uplink/stealth_and_camouflage_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

/datum/uplink_item/item/stealth_items/cosmetic_surgery_kit
name = "Cosmetic Surgery Auto-Kit"
desc = "A small self-contained auto-surgery device that has the ability to conduct larynxial, facial and even melanin re-structuring surgery, \
desc = "A small self-contained auto-surgery device that has the ability to conduct laryngeal, facial and even melanin re-structuring surgery, \
in a (mostly) blood-less manner."
item_cost = 12
path = /obj/item/device/cosmetic_surgery_kit
Expand Down
9 changes: 6 additions & 3 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ var/global/list/slot_flags_enumeration = list(
//For non-projectile attacks this usually means the attack is blocked.
//Otherwise should return 0 to indicate that the attack is not affected in any way.
/obj/item/proc/handle_shield(mob/user, damage, atom/damage_source = null, mob/attacker = null, def_zone = null, attack_text = "the attack")
var/parry_chance = get_parry_chance(user)
var/parry_chance = get_parry_chance(user, attacker)
if(parry_chance)
if(default_parry_check(user, attacker, damage_source) && prob(parry_chance))
user.visible_message(SPAN_DANGER("\The [user] parries [attack_text] with \the [src]!"))
Expand All @@ -561,12 +561,15 @@ var/global/list/slot_flags_enumeration = list(
/obj/item/proc/on_parry(damage_source)
return

/obj/item/proc/get_parry_chance(mob/user)
/obj/item/proc/get_parry_chance(mob/user, mob/attacker)
. = base_parry_chance
if (!istype(user) || !istype(attacker))
return
if (user.a_intent == I_HELP)
. = 0
if (.)
. += clamp((user.get_skill_value(SKILL_COMBAT) * 10) - 20, 0, 75)
. += (user.get_skill_difference(SKILL_COMBAT, attacker) * 5)
. = clamp(., 0, 75)

/obj/item/proc/on_disarm_attempt(mob/target, mob/living/attacker)
if(force < 1)
Expand Down
21 changes: 12 additions & 9 deletions code/game/objects/items/weapons/RPD.dm
Original file line number Diff line number Diff line change
Expand Up @@ -132,25 +132,28 @@ GLOBAL_LIST_INIT(rpd_pipe_selection_skilled, list(
popup.close()

/obj/item/rpd/afterattack(atom/A, mob/user, proximity)
if(!proximity) return
if(istype(A, /obj/item/pipe))
if (!proximity || istype(A, /obj/item/storage))
return
if (istype(A, /obj/item/pipe))
recycle(A,user)
else
if(user.skill_fail_prob(SKILL_ATMOS, 80, SKILL_TRAINED))
if (user.skill_fail_prob(SKILL_ATMOS, 80, SKILL_TRAINED))
var/C = pick(GLOB.rpd_pipe_selection)
P = pick(GLOB.rpd_pipe_selection[C])
user.visible_message(SPAN_WARNING("[user] cluelessly fumbles with \the [src]."))
user.visible_message(SPAN_WARNING("\The [user] cluelessly fumbles with \the [src]."))
var/turf/T = get_turf(A)
if(!T.Adjacent(src.loc)) return //checks so it can't pipe through window and such
if (!T.Adjacent(loc))
return

playsound(get_turf(user), 'sound/machines/click.ogg', 50, 1)
if(T.is_wall()) //pipe through walls!
if(!do_after(user, 3 SECONDS, T, DO_PUBLIC_UNIQUE))
if (T.is_wall())
if (!do_after(user, 3 SECONDS, T, DO_PUBLIC_UNIQUE))
return
playsound(get_turf(user), 'sound/items/Deconstruct.ogg', 50, 1)
playsound (get_turf(user), 'sound/items/Deconstruct.ogg', 50, 1)

P.Build(P, T, pipe_colors[pipe_color])
if(prob(20)) src.spark_system.start()
if (prob(20))
spark_system.start()

/obj/item/rpd/examine(mob/user, distance)
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/material/twohanded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
..()
update_icon()

/obj/item/material/twohanded/get_parry_chance(mob/user)
/obj/item/material/twohanded/get_parry_chance(mob/user, mob/attacker)
. = ..()
if(wielded)
. += wielded_parry_bonus
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/melee/energy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
playsound(user.loc, 'sound/weapons/blade1.ogg', 50, 1)


/obj/item/melee/energy/sword/get_parry_chance(mob/user)
/obj/item/melee/energy/sword/get_parry_chance(mob/user, mob/attacker)
return active ? ..() : 0


Expand Down
9 changes: 9 additions & 0 deletions code/game/objects/items/weapons/storage/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
/obj/item/storage/cigpaper/filters
)

/obj/item/storage/cigpaper/on_update_icon()
if (!length(contents))
icon_state = "[icon_state]_empty"
else
icon_state = initial(icon_state)

/obj/item/storage/cigpaper/fancy
name = "\improper Trident cigarette paper"
desc = "A book of Trident-brand cigarette paper, for rolling to impress. Made to cater to individuals who appreciates the finer things in life."
Expand All @@ -81,6 +87,9 @@
icon_state = "filterbin"
startswith = list(/obj/item/paper/cig/filter = 10)

/obj/item/storage/cigpaper/filters/on_update_icon()
return

/obj/item/storage/chewables
name = "box of chewing wads master"
desc = "A generic brands of Waffle Co Wads, unflavored chews. Why do these exist?"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/holodeck/HolodeckObjects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
spark_system.start()
playsound(user.loc, 'sound/weapons/blade1.ogg', 50, 1)

/obj/item/holo/esword/get_parry_chance(mob/user)
/obj/item/holo/esword/get_parry_chance(mob/user, mob/attacker)
return active ? ..() : 0

/obj/item/holo/esword/Initialize()
Expand Down
Loading