Skip to content
This repository has been archived by the owner on Sep 12, 2021. It is now read-only.

Commit

Permalink
Test merge of pull request #490
Browse files Browse the repository at this point in the history
  • Loading branch information
Whitesands-Bot committed Oct 1, 2020
2 parents 4602124 + b5516fa commit b8ea3cc
Show file tree
Hide file tree
Showing 7 changed files with 307 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3158,6 +3158,7 @@
#include "waspstation\code\datums\achievements\scores.dm"
#include "waspstation\code\datums\brain_damage\brain_trauma.dm"
#include "waspstation\code\datums\brain_damage\phobia.dm"
#include "waspstation\code\datums\components\taped.dm"
#include "waspstation\code\datums\components\crafting\recipes.dm"
#include "waspstation\code\datums\components\storage\concrete\pockets.dm"
#include "waspstation\code\datums\diseases\coronavirus.dm"
Expand Down Expand Up @@ -3205,6 +3206,7 @@
#include "waspstation\code\game\objects\items\melee\energy.dm"
#include "waspstation\code\game\objects\items\melee\misc.dm"
#include "waspstation\code\game\objects\items\stacks\medical.dm"
#include "waspstation\code\game\objects\items\stacks\tape.dm"
#include "waspstation\code\game\objects\items\storage\backpack.dm"
#include "waspstation\code\game\objects\items\storage\bags.dm"
#include "waspstation\code\game\objects\items\storage\boxes.dm"
Expand Down Expand Up @@ -3243,6 +3245,7 @@
#include "waspstation\code\modules\client\verbs\minimap.dm"
#include "waspstation\code\modules\clothing\glasses\_glasses.dm"
#include "waspstation\code\modules\clothing\glasses\hud.dm"
#include "waspstation\code\modules\clothing\gloves\tapegloves.dm"
#include "waspstation\code\modules\clothing\head\berets.dm"
#include "waspstation\code\modules\clothing\head\cowboy.dm"
#include "waspstation\code\modules\clothing\head\helmet.dm"
Expand Down
55 changes: 55 additions & 0 deletions waspstation/code/datums/components/taped.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/datum/component/taped
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS

var/taped_integrity = 0
var/mutable_appearance/taped_icon
var/obj/item/stack/tape/tape_used


/datum/component/taped/Initialize(obj/item/stack/tape/tape_used)
if(!isatom(parent) || !tape_used)
return COMPONENT_INCOMPATIBLE
src.tape_used = tape_used
set_tape()

/datum/component/taped/InheritComponent(datum/component/taped/C, i_am_original)
var/obj/I = parent
src.tape_used = C.tape_used
I.cut_overlay(taped_icon)
set_tape()

/datum/component/taped/RegisterWithParent()
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/tape_rip)
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/examine_tape)

/datum/component/taped/UnregisterFromParent()
UnregisterSignal(parent, list(COMSIG_PARENT_ATTACKBY, COMSIG_PARENT_EXAMINE))

/datum/component/taped/proc/set_tape()
var/obj/I = parent

I.obj_integrity = min((I.obj_integrity + tape_used.nonorganic_heal), I.max_integrity)
taped_integrity += tape_used.nonorganic_heal

var/icon/tape_marks = icon(initial(I.icon), initial(I.icon_state))
tape_marks.Blend("#fff", ICON_ADD)
tape_marks.Blend(icon('waspstation/icons/obj/tapes.dmi', "[tape_used.icon_state]_mask"), ICON_MULTIPLY)
taped_icon = new(tape_marks)
I.add_overlay(taped_icon)

/datum/component/taped/proc/tape_rip(datum/source, obj/item/attacker, mob/user)
var/obj/item/I = attacker
if(!I.tool_behaviour == TOOL_WIRECUTTER || !I.sharpness >= IS_SHARP)
return
playsound(parent, 'sound/items/poster_ripped.ogg', 30, TRUE, -2)
user.visible_message("<span class='notice'>[user] cuts and tears [tape_used] off \the [parent].", "<span class='notice'>You finish peeling away all the [tape_used] from \the [parent].</span>")
remove_tape()

/datum/component/taped/proc/examine_tape(datum/source, mob/user, list/examine_list)
examine_list += "<span class='warning'>A bunch of [tape_used] is holding this thing together!</span>"

/datum/component/taped/proc/remove_tape()
var/obj/item/I = parent
I.obj_integrity -= taped_integrity
I.cut_overlay(taped_icon)
qdel(src)
236 changes: 236 additions & 0 deletions waspstation/code/game/objects/items/stacks/tape.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
/obj/item/stack/tape
name = "packaging tape"
singular_name = "tape strip"
desc = "Sticks things together with minimal effort."
icon = 'waspstation/icons/obj/tapes.dmi'
icon_state = "tape"
item_flags = NOBLUDGEON
amount = 10
max_amount = 10
grind_results = list(/datum/reagent/cellulose = 5)
usesound = 'waspstation/sound/items/tape.ogg'

var/stop_bleed = 600
var/nonorganic_heal = 5
var/self_delay = 30 //! Also used for the tapecuff delay
var/other_delay = 10
var/prefix = "sticky"
var/list/conferred_embed = EMBED_HARMLESS
var/overwrite_existing = FALSE

/obj/item/stack/tape/attack(mob/living/carbon/C, mob/living/user)
if(!istype(C))
return

//Bootleg bandage
if(user.a_intent == INTENT_HELP)
try_heal(C, user)

//Relatable suffering
if((HAS_TRAIT(user, TRAIT_CLUMSY) && prob(25)))
to_chat(user, "<span class='warning'>Uh... where did the tape edge go?!</span>")
return

//Mouth taping and tapecuffs
if(user.a_intent == INTENT_DISARM)
if(user.zone_selected == BODY_ZONE_PRECISE_MOUTH) //mouth tape
if(C.is_mouth_covered() || C.is_muzzled())
to_chat(user, "<span class='warning'>There is something covering [C]s mouth!</span>")
return
if(use(1))
playsound(loc, usesound, 30, TRUE, -2)
if(do_mob(user, C, other_delay) && (!C.is_mouth_covered() || !C.is_muzzled()))
apply_gag(C, user)
C.visible_message("<span class='notice'>[user] tapes [C]s mouth shut.</span>", \
"<span class='userdanger'>[user] taped your mouth shut!</span>")
log_combat(user, C, "gags")
else
to_chat(user, "<span class='warning'>You fail to tape up [C]!</span>")
else
to_chat(user, "<span class='warning'>There isn't enough tape left!")
else if (!C.handcuffed) //tapecuffs
if(iscarbon(user) && (HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)))
to_chat(user, "<span class='warning'>Uh... which side sticks again?</span>")
apply_tapecuffs(user, user)
return
if(C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore())
if(use(5))
C.visible_message("<span class='danger'>[user] is trying to put [src.name] on [C]!</span>", \
"<span class='userdanger'>[user] is trying to put [src.name] on you!</span>")

playsound(loc, usesound, 30, TRUE, -2)
if(do_mob(user, C, self_delay) && (C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore()))
apply_tapecuffs(C, user)
C.visible_message("<span class='notice'>[user] tapecuffs [C].</span>", \
"<span class='userdanger'>[user] tapecuffs you.</span>")
SSblackbox.record_feedback("tally", "handcuffs", 1, type)

log_combat(user, C, "tapecuffed")
else
to_chat(user, "<span class='warning'>You fail to tapecuff [C]!</span>")
else
to_chat(user, "<span class='warning'>There isn't enough tape left!</span>")
else
to_chat(user, "<span class='warning'>[C] doesn't have two hands...</span>")

/obj/item/stack/tape/proc/try_heal(mob/living/carbon/C, mob/user)
if(C == user)
playsound(loc, usesound, 30, TRUE, -2)
user.visible_message("<span class='notice'>[user] starts to apply \the [src] on [user.p_them()]self...</span>", "<span class='notice'>You begin applying \the [src] on yourself...</span>")
if(!do_mob(user, C, self_delay, extra_checks=CALLBACK(C, /mob/living/proc/can_inject, user, TRUE)))
return
else if(other_delay)
user.visible_message("<span class='notice'>[user] starts to apply \the [src] on [C].</span>", "<span class='notice'>You begin applying \the [src] on [C]...</span>")
if(!do_mob(user, C, other_delay, extra_checks=CALLBACK(C, /mob/living/proc/can_inject, user, TRUE)))
return

if(heal(C, user))
log_combat(user, C, "tape bandaged", src.name)
use(1)

/obj/item/stack/tape/proc/heal(mob/living/carbon/C, mob/user)
if(C.stat == DEAD)
to_chat(user, "<span class='notice'>There isn't enough [src] in the universe to fix that...</span>")
return
if(!iscarbon(C))
return
var/obj/item/bodypart/affecting = C.get_bodypart(check_zone(user.zone_selected))
if(!affecting) //Missing limb?
to_chat(user, "<span class='warning'>[C] doesn't have \a [parse_zone(user.zone_selected)]!</span>")
return
if(affecting.status == BODYPART_ORGANIC)
if(ishuman(C))
var/mob/living/carbon/human/H = C
if(!H.bleedsuppress && H.bleed_rate)
H.suppress_bloodloss(stop_bleed)
to_chat(user, "<span class='notice'>You tape up the bleeding of [C]!</span>")
return TRUE
to_chat(user, "<span class='warning'>[C] has a problem \the [src] won't fix!</span>")
else //Robotic patch-up
if(affecting.brute_dam)
user.visible_message("<span class='notice'>[user] applies \the [src] on [C]'s [affecting.name].</span>", "<span class='green'>You apply \the [src] on [C]'s [affecting.name].</span>")
if(affecting.heal_damage(nonorganic_heal))
C.update_damage_overlays()
return TRUE
to_chat(user, "<span class='warning'>[src] can't patch what [C] has...</span>")

/obj/item/stack/tape/proc/apply_gag(mob/living/carbon/target, mob/user)
if(target.is_muzzled() || target.is_mouth_covered())
return
var/obj/item/clothing/mask/muzzle/tape/gag = new /obj/item/clothing/mask/muzzle/tape(get_turf(target))
target.equip_to_slot_or_del(gag, ITEM_SLOT_MASK, 1, 0)
return

/obj/item/stack/tape/proc/apply_tapecuffs(mob/living/carbon/target, mob/user)
if(target.handcuffed)
return
var/obj/item/restraints/handcuffs/tape/tapecuff = new /obj/item/restraints/handcuffs/tape(get_turf(target))
tapecuff.apply_cuffs(target, user, 0)
return

/obj/item/stack/tape/afterattack(obj/item/I, mob/living/user)
if(!istype(I))
return

if(I.embedding && I.embedding == conferred_embed)
to_chat(user, "<span class='warning'>[I] is already coated in [src]!</span>")
return

user.visible_message("<span class='notice'>[user] begins wrapping [I] with [src].</span>", "<span class='notice'>You begin wrapping [I] with [src].</span>")

if(do_after(user, 30, target=I))
use(1)
wrap_item(I, user)

/obj/item/stack/tape/proc/wrap_item(obj/item/I, mob/living/user)
if(istype(I, /obj/item/clothing/gloves/fingerless))
var/obj/item/clothing/gloves/tackler/offbrand/O = new /obj/item/clothing/gloves/tackler/offbrand
to_chat(user, "<span class='notice'>You turn [I] into [O] with [src].</span>")
QDEL_NULL(I)
if(!user.equip_to_slot_if_possible(O, ITEM_SLOT_GLOVES, 0))
user.put_in_hands(O)
return

I.embedding = conferred_embed
I.updateEmbedding()
to_chat(user, "<span class='notice'>You finish wrapping [I] with [src].</span>")
I.name = "[prefix] [I.name]"

if(istype(I, /obj/item/grenade))
var/obj/item/grenade/sticky_bomb = I
sticky_bomb.sticky = TRUE

/obj/item/clothing/mask/muzzle/tape
name = "tape muzzle"
pickup_sound = 'sound/items/poster_ripped.ogg'
item_flags = DROPDEL

/obj/item/restraints/handcuffs/tape
name = "tapecuffs"
desc = "Seems you are in a sticky situation."
breakouttime = 15 SECONDS
trashtype = /obj/item/restraints/handcuffs/tape/used
flags_1 = NONE

/obj/item/restraints/handcuffs/tape/used
item_flags = DROPDEL

/obj/item/restraints/handcuffs/tape/used/dropped(mob/user)
playsound(loc, 'sound/items/poster_ripped.ogg', 30, TRUE, -2)
user.visible_message("<span class='danger'>[user] rips off the tape around [user.p_their()] hands!</span>", \
"<span class='userdanger'>You tear off the [src] and free yourself!</span>")
. = ..()

/obj/item/stack/tape/industrial
name = "duct tape"
desc = "This roll of silver sorcery can fix just about anything."
icon_state = "tape_d"

stop_bleed = 800
nonorganic_heal = 20
prefix = "super sticky"
conferred_embed = EMBED_HARMLESS_SUPERIOR

/obj/item/stack/tape/afterattack(obj/item/I, mob/living/user)
. = ..()
if(I.obj_integrity < I.max_integrity)
to_chat(user, "<span class='notice'>Nothing a little [src] can't fix...</span>")
play_tool_sound(I, 30)
if(src.use_tool(I, user, other_delay, 1))
I.AddComponent(/datum/component/taped, src)
to_chat(user, "<span class='notice'>You patch up the [I] with a bit of [src].</span>")
else
to_chat(user, "<span class='notice'>[I] looks fine enough to me.</span>")

/obj/item/stack/tape/industrial/electrical
name = "electrical tape"
desc = "Specialty insulated strips of adhesive plastic. Made for securing cables."
icon_state = "tape_e"

stop_bleed = 400
nonorganic_heal = 10
prefix = "insulated sticky"
siemens_coefficient = 0

/obj/item/stack/tape/industrial/electrical/wrap_item(obj/item/I, mob/living/user)
if(istype(I, /obj/item/clothing/gloves/color))
var/obj/item/clothing/gloves/color/yellow/sprayon/tape/O = new /obj/item/clothing/gloves/color/yellow/sprayon/tape
to_chat(user, "<span class='notice'>You turn [I] into [O] with [src].</span>")
QDEL_NULL(I)
user.put_in_hands(O)
return

I.embedding = conferred_embed
I.updateEmbedding()
to_chat(user, "<span class='notice'>You finish wrapping [I] with [src].</span>")
I.name = "[prefix] [I.name]"
I.siemens_coefficient = 0

/obj/item/stack/tape/industrial/pro
name = "professional-grade duct tape"
desc = "Now THIS is engineering."
icon_state = "tape_y"

stop_bleed = 1000
nonorganic_heal = 30
prefix = "industry-standard sticky"
13 changes: 13 additions & 0 deletions waspstation/code/modules/clothing/gloves/tapegloves.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/obj/item/clothing/gloves/color/yellow/sprayon/tape
name = "taped-on insulated gloves"
desc = "This is a totally safe idea."
icon = 'waspstation/icons/obj/clothing/gloves.dmi'
icon_state = "yellowtape"
item_state = "ygloves"
shocks_remaining = 3

/obj/item/clothing/gloves/color/yellow/sprayon/Shocked()
if(prob(50)) //Fear the unpredictable
shocks_remaining--
if(shocks_remaining < 0)
qdel(src)
Binary file added waspstation/icons/obj/clothing/gloves.dmi
Binary file not shown.
Binary file added waspstation/icons/obj/tapes.dmi
Binary file not shown.
Binary file added waspstation/sound/items/tape.ogg
Binary file not shown.

0 comments on commit b8ea3cc

Please sign in to comment.