Merge pull request #3208 from Citadel-Station-13/upstream-merge-31386

[MIRROR] Remove drop_item, drop_item_v, put_in_hands_or_del
This commit is contained in:
LetterJay
2017-10-08 16:18:18 -04:00
committed by GitHub
154 changed files with 2047 additions and 2234 deletions
@@ -128,7 +128,7 @@
/obj/effect/particle_effect/smoke/bad/smoke_mob(mob/living/carbon/M)
if(..())
M.drop_item()
M.drop_all_held_items()
M.adjustOxyLoss(1)
M.emote("cough")
return 1
@@ -205,7 +205,6 @@
/obj/effect/particle_effect/smoke/sleeping/smoke_mob(mob/living/carbon/M)
if(..())
M.drop_item()
M.Sleeping(200)
M.emote("cough")
return 1
+1 -1
View File
@@ -531,7 +531,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
to_chat(M, "<span class='danger'>You become nearsighted!</span>")
if(prob(50))
if(M.stat != DEAD)
if(M.drop_item())
if(M.drop_all_held_items())
to_chat(M, "<span class='danger'>You drop what you're holding and clutch at your eyes!</span>")
M.adjust_blurriness(10)
M.Unconscious(20)
+373 -372
View File
@@ -1,372 +1,373 @@
/obj/item/restraints
breakouttime = 600
//Handcuffs
/obj/item/restraints/handcuffs
name = "handcuffs"
desc = "Use this to keep prisoners in line."
gender = PLURAL
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "handcuff"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = SLOT_BELT
throwforce = 0
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 5
materials = list(MAT_METAL=500)
origin_tech = "engineering=3;combat=3"
breakouttime = 600 //Deciseconds = 60s = 1 minute
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 50)
var/cuffsound = 'sound/weapons/handcuffs.ogg'
var/trashtype = null //for disposable cuffs
/obj/item/restraints/handcuffs/attack(mob/living/carbon/C, mob/living/carbon/human/user)
if(!istype(C))
return
if(user.disabilities & CLUMSY && prob(50))
to_chat(user, "<span class='warning'>Uh... how do those things work?!</span>")
apply_cuffs(user,user)
return
// chance of monkey retaliation
if(ismonkey(C) && prob(MONKEY_CUFF_RETALIATION_PROB))
var/mob/living/carbon/monkey/M
M = C
M.retaliate(user)
if(!C.handcuffed)
if(C.get_num_arms() >= 2 || C.get_arm_ignore())
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 [C]!</span>")
playsound(loc, cuffsound, 30, 1, -2)
if(do_mob(user, C, 30) && (C.get_num_arms() >= 2 || C.get_arm_ignore()))
apply_cuffs(C,user)
to_chat(user, "<span class='notice'>You handcuff [C].</span>")
SSblackbox.add_details("handcuffs","[type]")
add_logs(user, C, "handcuffed")
else
to_chat(user, "<span class='warning'>You fail to handcuff [C]!</span>")
else
to_chat(user, "<span class='warning'>[C] doesn't have two hands...</span>")
/obj/item/restraints/handcuffs/proc/apply_cuffs(mob/living/carbon/target, mob/user, var/dispense = 0)
if(target.handcuffed)
return
if(!user.drop_item() && !dispense)
return
var/obj/item/restraints/handcuffs/cuffs = src
if(trashtype)
cuffs = new trashtype()
else if(dispense)
cuffs = new type()
cuffs.loc = target
target.handcuffed = cuffs
target.update_handcuffed()
if(trashtype && !dispense)
qdel(src)
return
/obj/item/restraints/handcuffs/sinew
name = "sinew restraints"
desc = "A pair of restraints fashioned from long strands of flesh."
icon = 'icons/obj/mining.dmi'
icon_state = "sinewcuff"
item_state = "sinewcuff"
breakouttime = 300 //Deciseconds = 30s
cuffsound = 'sound/weapons/cablecuff.ogg'
/obj/item/restraints/handcuffs/cable
name = "cable restraints"
desc = "Looks like some cables tied together. Could be used to tie something up."
icon_state = "cuff_red"
item_state = "coil_red"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
materials = list(MAT_METAL=150, MAT_GLASS=75)
origin_tech = "engineering=2"
breakouttime = 300 //Deciseconds = 30s
cuffsound = 'sound/weapons/cablecuff.ogg'
var/datum/robot_energy_storage/wirestorage = null
/obj/item/restraints/handcuffs/cable/attack(mob/living/carbon/C, mob/living/carbon/human/user)
if(!istype(C))
return
if(wirestorage && wirestorage.energy < 15)
to_chat(user, "<span class='warning'>You need at least 15 wire to restrain [C]!</span>")
return
return ..()
/obj/item/restraints/handcuffs/cable/apply_cuffs(mob/living/carbon/target, mob/user, var/dispense = 0)
if(wirestorage)
if(!wirestorage.use_charge(15))
to_chat(user, "<span class='warning'>You need at least 15 wire to restrain [target]!</span>")
return
return ..(target, user, 1)
return ..()
/obj/item/restraints/handcuffs/cable/red
icon_state = "cuff_red"
item_state = "coil_red"
/obj/item/restraints/handcuffs/cable/yellow
icon_state = "cuff_yellow"
item_state = "coil_yellow"
/obj/item/restraints/handcuffs/cable/blue
icon_state = "cuff_blue"
item_state = "coil_blue"
/obj/item/restraints/handcuffs/cable/green
icon_state = "cuff_green"
item_state = "coil_green"
/obj/item/restraints/handcuffs/cable/pink
icon_state = "cuff_pink"
item_state = "coil_pink"
/obj/item/restraints/handcuffs/cable/orange
icon_state = "cuff_orange"
item_state = "coil_orange"
/obj/item/restraints/handcuffs/cable/cyan
icon_state = "cuff_cyan"
item_state = "coil_cyan"
/obj/item/restraints/handcuffs/cable/white
icon_state = "cuff_white"
item_state = "coil_white"
/obj/item/restraints/handcuffs/alien
icon_state = "handcuffAlien"
/obj/item/restraints/handcuffs/fake
name = "fake handcuffs"
desc = "Fake handcuffs meant for gag purposes."
breakouttime = 10 //Deciseconds = 1s
/obj/item/restraints/handcuffs/fake/kinky
name = "kinky handcuffs"
desc = "Fake handcuffs meant for erotic roleplay."
icon_state = "handcuffGag"
/obj/item/restraints/handcuffs/cable/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/stack/rods))
var/obj/item/stack/rods/R = I
if (R.use(1))
var/obj/item/wirerod/W = new /obj/item/wirerod
remove_item_from_storage(user)
user.put_in_hands(W)
to_chat(user, "<span class='notice'>You wrap the cable restraint around the top of the rod.</span>")
qdel(src)
else
to_chat(user, "<span class='warning'>You need one rod to make a wired rod!</span>")
return
else if(istype(I, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = I
if(M.get_amount() < 6)
to_chat(user, "<span class='warning'>You need at least six metal sheets to make good enough weights!</span>")
return
to_chat(user, "<span class='notice'>You begin to apply [I] to [src]...</span>")
if(do_after(user, 35, target = src))
if(M.get_amount() < 6 || !M)
return
var/obj/item/restraints/legcuffs/bola/S = new /obj/item/restraints/legcuffs/bola
M.use(6)
user.put_in_hands(S)
to_chat(user, "<span class='notice'>You make some weights out of [I] and tie them to [src].</span>")
remove_item_from_storage(user)
qdel(src)
else
return ..()
/obj/item/restraints/handcuffs/cable/zipties/cyborg/attack(mob/living/carbon/C, mob/user)
if(iscyborg(user))
if(!C.handcuffed)
playsound(loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2)
C.visible_message("<span class='danger'>[user] is trying to put zipties on [C]!</span>", \
"<span class='userdanger'>[user] is trying to put zipties on [C]!</span>")
if(do_mob(user, C, 30))
if(!C.handcuffed)
C.handcuffed = new /obj/item/restraints/handcuffs/cable/zipties/used(C)
C.update_handcuffed()
to_chat(user, "<span class='notice'>You handcuff [C].</span>")
add_logs(user, C, "handcuffed")
else
to_chat(user, "<span class='warning'>You fail to handcuff [C]!</span>")
/obj/item/restraints/handcuffs/cable/zipties
name = "zipties"
desc = "Plastic, disposable zipties that can be used to restrain temporarily but are destroyed after use."
icon_state = "cuff_white"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
materials = list()
breakouttime = 450 //Deciseconds = 45s
trashtype = /obj/item/restraints/handcuffs/cable/zipties/used
/obj/item/restraints/handcuffs/cable/zipties/used
desc = "A pair of broken zipties."
icon_state = "cuff_white_used"
item_state = "cuff_white"
/obj/item/restraints/handcuffs/cable/zipties/used/attack()
return
//Legcuffs
/obj/item/restraints/legcuffs
name = "leg cuffs"
desc = "Use this to keep prisoners in line."
gender = PLURAL
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "handcuff"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
flags_1 = CONDUCT_1
throwforce = 0
w_class = WEIGHT_CLASS_NORMAL
origin_tech = "engineering=3;combat=3"
slowdown = 7
breakouttime = 300 //Deciseconds = 30s = 0.5 minute
/obj/item/restraints/legcuffs/beartrap
name = "bear trap"
throw_speed = 1
throw_range = 1
icon_state = "beartrap"
desc = "A trap used to catch bears and other legged creatures."
origin_tech = "engineering=4"
var/armed = 0
var/trap_damage = 20
/obj/item/restraints/legcuffs/beartrap/Initialize()
. = ..()
icon_state = "[initial(icon_state)][armed]"
/obj/item/restraints/legcuffs/beartrap/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is sticking [user.p_their()] head in the [src.name]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return (BRUTELOSS)
/obj/item/restraints/legcuffs/beartrap/attack_self(mob/user)
..()
if(ishuman(user) && !user.stat && !user.restrained())
armed = !armed
icon_state = "[initial(icon_state)][armed]"
to_chat(user, "<span class='notice'>[src] is now [armed ? "armed" : "disarmed"]</span>")
/obj/item/restraints/legcuffs/beartrap/Crossed(AM as mob|obj)
if(armed && isturf(src.loc))
if(isliving(AM))
var/mob/living/L = AM
var/snap = 0
var/def_zone = "chest"
if(iscarbon(L))
var/mob/living/carbon/C = L
snap = 1
if(!C.lying)
def_zone = pick("l_leg", "r_leg")
if(!C.legcuffed && C.get_num_legs() >= 2) //beartrap can't cuff your leg if there's already a beartrap or legcuffs, or you don't have two legs.
C.legcuffed = src
src.loc = C
C.update_inv_legcuffed()
SSblackbox.add_details("handcuffs","[type]")
else if(isanimal(L))
var/mob/living/simple_animal/SA = L
if(SA.mob_size > MOB_SIZE_TINY)
snap = 1
if(L.movement_type & FLYING)
snap = 0
if(snap)
armed = 0
icon_state = "[initial(icon_state)][armed]"
playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
L.visible_message("<span class='danger'>[L] triggers \the [src].</span>", \
"<span class='userdanger'>You trigger \the [src]!</span>")
L.apply_damage(trap_damage,BRUTE, def_zone)
..()
/obj/item/restraints/legcuffs/beartrap/energy
name = "energy snare"
armed = 1
icon_state = "e_snare"
trap_damage = 0
flags_1 = DROPDEL_1
/obj/item/restraints/legcuffs/beartrap/energy/New()
..()
addtimer(CALLBACK(src, .proc/dissipate), 100)
/obj/item/restraints/legcuffs/beartrap/energy/proc/dissipate()
if(!ismob(loc))
do_sparks(1, TRUE, src)
qdel(src)
/obj/item/restraints/legcuffs/beartrap/energy/attack_hand(mob/user)
Crossed(user) //honk
/obj/item/restraints/legcuffs/beartrap/energy/cyborg
breakouttime = 20 // Cyborgs shouldn't have a strong restraint
/obj/item/restraints/legcuffs/bola
name = "bola"
desc = "A restraining device designed to be thrown at the target. Upon connecting with said target, it will wrap around their legs, making it difficult for them to move quickly."
icon_state = "bola"
breakouttime = 35//easy to apply, easy to break out of
gender = NEUTER
origin_tech = "engineering=3;combat=1"
var/knockdown = 0
/obj/item/restraints/legcuffs/bola/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
if(!..())
return
playsound(src.loc,'sound/weapons/bolathrow.ogg', 75, 1)
/obj/item/restraints/legcuffs/bola/throw_impact(atom/hit_atom)
if(..() || !iscarbon(hit_atom))//if it gets caught or the target can't be cuffed,
return//abort
var/mob/living/carbon/C = hit_atom
if(!C.legcuffed && C.get_num_legs() >= 2)
visible_message("<span class='danger'>\The [src] ensnares [C]!</span>")
C.legcuffed = src
src.loc = C
C.update_inv_legcuffed()
SSblackbox.add_details("handcuffs","[type]")
to_chat(C, "<span class='userdanger'>\The [src] ensnares you!</span>")
C.Knockdown(knockdown)
/obj/item/restraints/legcuffs/bola/tactical//traitor variant
name = "reinforced bola"
desc = "A strong bola, made with a long steel chain. It looks heavy, enough so that it could trip somebody."
icon_state = "bola_r"
breakouttime = 70
origin_tech = "engineering=4;combat=3"
knockdown = 20
/obj/item/restraints/legcuffs/bola/energy //For Security
name = "energy bola"
desc = "A specialized hard-light bola designed to ensnare fleeing criminals and aid in arrests."
icon_state = "ebola"
hitsound = 'sound/weapons/taserhit.ogg'
w_class = WEIGHT_CLASS_SMALL
breakouttime = 60
/obj/item/restraints/legcuffs/bola/energy/throw_impact(atom/hit_atom)
if(iscarbon(hit_atom))
var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy/cyborg(get_turf(hit_atom))
B.Crossed(hit_atom)
qdel(src)
..()
/obj/item/restraints
breakouttime = 600
//Handcuffs
/obj/item/restraints/handcuffs
name = "handcuffs"
desc = "Use this to keep prisoners in line."
gender = PLURAL
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "handcuff"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = SLOT_BELT
throwforce = 0
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 5
materials = list(MAT_METAL=500)
origin_tech = "engineering=3;combat=3"
breakouttime = 600 //Deciseconds = 60s = 1 minute
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 50)
var/cuffsound = 'sound/weapons/handcuffs.ogg'
var/trashtype = null //for disposable cuffs
/obj/item/restraints/handcuffs/attack(mob/living/carbon/C, mob/living/carbon/human/user)
if(!istype(C))
return
if(user.disabilities & CLUMSY && prob(50))
to_chat(user, "<span class='warning'>Uh... how do those things work?!</span>")
apply_cuffs(user,user)
return
// chance of monkey retaliation
if(ismonkey(C) && prob(MONKEY_CUFF_RETALIATION_PROB))
var/mob/living/carbon/monkey/M
M = C
M.retaliate(user)
if(!C.handcuffed)
if(C.get_num_arms() >= 2 || C.get_arm_ignore())
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 [C]!</span>")
playsound(loc, cuffsound, 30, 1, -2)
if(do_mob(user, C, 30) && (C.get_num_arms() >= 2 || C.get_arm_ignore()))
apply_cuffs(C,user)
to_chat(user, "<span class='notice'>You handcuff [C].</span>")
SSblackbox.add_details("handcuffs","[type]")
add_logs(user, C, "handcuffed")
else
to_chat(user, "<span class='warning'>You fail to handcuff [C]!</span>")
else
to_chat(user, "<span class='warning'>[C] doesn't have two hands...</span>")
/obj/item/restraints/handcuffs/proc/apply_cuffs(mob/living/carbon/target, mob/user, var/dispense = 0)
if(target.handcuffed)
return
if(!user.temporarilyRemoveItemFromInventory(src) && !dispense)
return
var/obj/item/restraints/handcuffs/cuffs = src
if(trashtype)
cuffs = new trashtype()
else if(dispense)
cuffs = new type()
cuffs.forceMove(target)
target.handcuffed = cuffs
target.update_handcuffed()
if(trashtype && !dispense)
qdel(src)
return
/obj/item/restraints/handcuffs/sinew
name = "sinew restraints"
desc = "A pair of restraints fashioned from long strands of flesh."
icon = 'icons/obj/mining.dmi'
icon_state = "sinewcuff"
item_state = "sinewcuff"
breakouttime = 300 //Deciseconds = 30s
cuffsound = 'sound/weapons/cablecuff.ogg'
/obj/item/restraints/handcuffs/cable
name = "cable restraints"
desc = "Looks like some cables tied together. Could be used to tie something up."
icon_state = "cuff_red"
item_state = "coil_red"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
materials = list(MAT_METAL=150, MAT_GLASS=75)
origin_tech = "engineering=2"
breakouttime = 300 //Deciseconds = 30s
cuffsound = 'sound/weapons/cablecuff.ogg'
var/datum/robot_energy_storage/wirestorage = null
/obj/item/restraints/handcuffs/cable/attack(mob/living/carbon/C, mob/living/carbon/human/user)
if(!istype(C))
return
if(wirestorage && wirestorage.energy < 15)
to_chat(user, "<span class='warning'>You need at least 15 wire to restrain [C]!</span>")
return
return ..()
/obj/item/restraints/handcuffs/cable/apply_cuffs(mob/living/carbon/target, mob/user, var/dispense = 0)
if(wirestorage)
if(!wirestorage.use_charge(15))
to_chat(user, "<span class='warning'>You need at least 15 wire to restrain [target]!</span>")
return
return ..(target, user, 1)
return ..()
/obj/item/restraints/handcuffs/cable/red
icon_state = "cuff_red"
item_state = "coil_red"
/obj/item/restraints/handcuffs/cable/yellow
icon_state = "cuff_yellow"
item_state = "coil_yellow"
/obj/item/restraints/handcuffs/cable/blue
icon_state = "cuff_blue"
item_state = "coil_blue"
/obj/item/restraints/handcuffs/cable/green
icon_state = "cuff_green"
item_state = "coil_green"
/obj/item/restraints/handcuffs/cable/pink
icon_state = "cuff_pink"
item_state = "coil_pink"
/obj/item/restraints/handcuffs/cable/orange
icon_state = "cuff_orange"
item_state = "coil_orange"
/obj/item/restraints/handcuffs/cable/cyan
icon_state = "cuff_cyan"
item_state = "coil_cyan"
/obj/item/restraints/handcuffs/cable/white
icon_state = "cuff_white"
item_state = "coil_white"
/obj/item/restraints/handcuffs/alien
icon_state = "handcuffAlien"
/obj/item/restraints/handcuffs/fake
name = "fake handcuffs"
desc = "Fake handcuffs meant for gag purposes."
breakouttime = 10 //Deciseconds = 1s
/obj/item/restraints/handcuffs/fake/kinky
name = "kinky handcuffs"
desc = "Fake handcuffs meant for erotic roleplay."
icon_state = "handcuffGag"
/obj/item/restraints/handcuffs/cable/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/stack/rods))
var/obj/item/stack/rods/R = I
if (R.use(1))
var/obj/item/wirerod/W = new /obj/item/wirerod
remove_item_from_storage(user)
user.put_in_hands(W)
to_chat(user, "<span class='notice'>You wrap the cable restraint around the top of the rod.</span>")
qdel(src)
else
to_chat(user, "<span class='warning'>You need one rod to make a wired rod!</span>")
return
else if(istype(I, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = I
if(M.get_amount() < 6)
to_chat(user, "<span class='warning'>You need at least six metal sheets to make good enough weights!</span>")
return
to_chat(user, "<span class='notice'>You begin to apply [I] to [src]...</span>")
if(do_after(user, 35, target = src))
if(M.get_amount() < 6 || !M)
return
var/obj/item/restraints/legcuffs/bola/S = new /obj/item/restraints/legcuffs/bola
M.use(6)
user.put_in_hands(S)
to_chat(user, "<span class='notice'>You make some weights out of [I] and tie them to [src].</span>")
remove_item_from_storage(user)
qdel(src)
else
return ..()
/obj/item/restraints/handcuffs/cable/zipties/cyborg/attack(mob/living/carbon/C, mob/user)
if(iscyborg(user))
if(!C.handcuffed)
playsound(loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2)
C.visible_message("<span class='danger'>[user] is trying to put zipties on [C]!</span>", \
"<span class='userdanger'>[user] is trying to put zipties on [C]!</span>")
if(do_mob(user, C, 30))
if(!C.handcuffed)
C.handcuffed = new /obj/item/restraints/handcuffs/cable/zipties/used(C)
C.update_handcuffed()
to_chat(user, "<span class='notice'>You handcuff [C].</span>")
add_logs(user, C, "handcuffed")
else
to_chat(user, "<span class='warning'>You fail to handcuff [C]!</span>")
/obj/item/restraints/handcuffs/cable/zipties
name = "zipties"
desc = "Plastic, disposable zipties that can be used to restrain temporarily but are destroyed after use."
icon_state = "cuff_white"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
materials = list()
breakouttime = 450 //Deciseconds = 45s
trashtype = /obj/item/restraints/handcuffs/cable/zipties/used
/obj/item/restraints/handcuffs/cable/zipties/used
desc = "A pair of broken zipties."
icon_state = "cuff_white_used"
item_state = "cuff_white"
/obj/item/restraints/handcuffs/cable/zipties/used/attack()
return
//Legcuffs
/obj/item/restraints/legcuffs
name = "leg cuffs"
desc = "Use this to keep prisoners in line."
gender = PLURAL
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "handcuff"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
flags_1 = CONDUCT_1
throwforce = 0
w_class = WEIGHT_CLASS_NORMAL
origin_tech = "engineering=3;combat=3"
slowdown = 7
breakouttime = 300 //Deciseconds = 30s = 0.5 minute
/obj/item/restraints/legcuffs/beartrap
name = "bear trap"
throw_speed = 1
throw_range = 1
icon_state = "beartrap"
desc = "A trap used to catch bears and other legged creatures."
origin_tech = "engineering=4"
var/armed = 0
var/trap_damage = 20
/obj/item/restraints/legcuffs/beartrap/Initialize()
. = ..()
icon_state = "[initial(icon_state)][armed]"
/obj/item/restraints/legcuffs/beartrap/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is sticking [user.p_their()] head in the [src.name]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return (BRUTELOSS)
/obj/item/restraints/legcuffs/beartrap/attack_self(mob/user)
..()
if(ishuman(user) && !user.stat && !user.restrained())
armed = !armed
icon_state = "[initial(icon_state)][armed]"
to_chat(user, "<span class='notice'>[src] is now [armed ? "armed" : "disarmed"]</span>")
/obj/item/restraints/legcuffs/beartrap/Crossed(AM as mob|obj)
if(armed && isturf(src.loc))
if(isliving(AM))
var/mob/living/L = AM
var/snap = 0
var/def_zone = "chest"
if(iscarbon(L))
var/mob/living/carbon/C = L
snap = 1
if(!C.lying)
def_zone = pick("l_leg", "r_leg")
if(!C.legcuffed && C.get_num_legs() >= 2) //beartrap can't cuff your leg if there's already a beartrap or legcuffs, or you don't have two legs.
C.legcuffed = src
src.loc = C
C.update_inv_legcuffed()
SSblackbox.add_details("handcuffs","[type]")
else if(isanimal(L))
var/mob/living/simple_animal/SA = L
if(SA.mob_size > MOB_SIZE_TINY)
snap = 1
if(L.movement_type & FLYING)
snap = 0
if(snap)
armed = 0
icon_state = "[initial(icon_state)][armed]"
playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
L.visible_message("<span class='danger'>[L] triggers \the [src].</span>", \
"<span class='userdanger'>You trigger \the [src]!</span>")
L.apply_damage(trap_damage,BRUTE, def_zone)
..()
/obj/item/restraints/legcuffs/beartrap/energy
name = "energy snare"
armed = 1
icon_state = "e_snare"
trap_damage = 0
flags_1 = DROPDEL_1
/obj/item/restraints/legcuffs/beartrap/energy/New()
..()
addtimer(CALLBACK(src, .proc/dissipate), 100)
/obj/item/restraints/legcuffs/beartrap/energy/proc/dissipate()
if(!ismob(loc))
do_sparks(1, TRUE, src)
qdel(src)
/obj/item/restraints/legcuffs/beartrap/energy/attack_hand(mob/user)
Crossed(user) //honk
/obj/item/restraints/legcuffs/beartrap/energy/cyborg
breakouttime = 20 // Cyborgs shouldn't have a strong restraint
/obj/item/restraints/legcuffs/bola
name = "bola"
desc = "A restraining device designed to be thrown at the target. Upon connecting with said target, it will wrap around their legs, making it difficult for them to move quickly."
icon_state = "bola"
breakouttime = 35//easy to apply, easy to break out of
gender = NEUTER
origin_tech = "engineering=3;combat=1"
var/knockdown = 0
/obj/item/restraints/legcuffs/bola/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
if(!..())
return
playsound(src.loc,'sound/weapons/bolathrow.ogg', 75, 1)
/obj/item/restraints/legcuffs/bola/throw_impact(atom/hit_atom)
if(..() || !iscarbon(hit_atom))//if it gets caught or the target can't be cuffed,
return//abort
var/mob/living/carbon/C = hit_atom
if(!C.legcuffed && C.get_num_legs() >= 2)
visible_message("<span class='danger'>\The [src] ensnares [C]!</span>")
C.legcuffed = src
src.loc = C
C.update_inv_legcuffed()
SSblackbox.add_details("handcuffs","[type]")
to_chat(C, "<span class='userdanger'>\The [src] ensnares you!</span>")
C.Knockdown(knockdown)
/obj/item/restraints/legcuffs/bola/tactical//traitor variant
name = "reinforced bola"
desc = "A strong bola, made with a long steel chain. It looks heavy, enough so that it could trip somebody."
icon_state = "bola_r"
breakouttime = 70
origin_tech = "engineering=4;combat=3"
knockdown = 20
/obj/item/restraints/legcuffs/bola/energy //For Security
name = "energy bola"
desc = "A specialized hard-light bola designed to ensnare fleeing criminals and aid in arrests."
icon_state = "ebola"
hitsound = 'sound/weapons/taserhit.ogg'
w_class = WEIGHT_CLASS_SMALL
breakouttime = 60
/obj/item/restraints/legcuffs/bola/energy/throw_impact(atom/hit_atom)
if(iscarbon(hit_atom))
var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy/cyborg(get_turf(hit_atom))
B.Crossed(hit_atom)
qdel(src)
..()
+3 -3
View File
@@ -233,7 +233,7 @@
/obj/item/melee/supermatter_sword/afterattack(target, mob/user, proximity_flag)
if(user && target == user)
user.drop_item()
user.dropItemToGround(src)
if(proximity_flag)
consume_everything(target)
..()
@@ -243,7 +243,7 @@
if(ismob(target))
var/mob/M
if(src.loc == M)
M.drop_item()
M.dropItemToGround(src)
consume_everything(target)
/obj/item/melee/supermatter_sword/pickup(user)
@@ -267,7 +267,7 @@
/obj/item/melee/supermatter_sword/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] touches [src]'s blade. It looks like [user.p_theyre()] tired of waiting for the radiation to kill [user.p_them()]!</span>")
user.drop_item()
user.dropItemToGround(src, TRUE)
shard.CollidedWith(user)
/obj/item/melee/supermatter_sword/proc/consume_everything(target)
+13 -14
View File
@@ -1,14 +1,13 @@
/obj/item/pai_cable
desc = "A flexible coated cable with a universal jack on one end."
name = "data cable"
icon = 'icons/obj/power.dmi'
icon_state = "wire1"
flags_1 = NOBLUDGEON_1
var/obj/machinery/machine
/obj/item/pai_cable/proc/plugin(obj/machinery/M, mob/living/user)
if(!user.drop_item())
return
user.visible_message("[user] inserts [src] into a data port on [M].", "<span class='notice'>You insert [src] into a data port on [M].</span>", "<span class='italics'>You hear the satisfying click of a wire jack fastening into place.</span>")
src.loc = M
machine = M
/obj/item/pai_cable
desc = "A flexible coated cable with a universal jack on one end."
name = "data cable"
icon = 'icons/obj/power.dmi'
icon_state = "wire1"
flags_1 = NOBLUDGEON_1
var/obj/machinery/machine
/obj/item/pai_cable/proc/plugin(obj/machinery/M, mob/living/user)
if(!user.transferItemToLoc(src, M))
return
user.visible_message("[user] inserts [src] into a data port on [M].", "<span class='notice'>You insert [src] into a data port on [M].</span>", "<span class='italics'>You hear the satisfying click of a wire jack fastening into place.</span>")
machine = M
+1 -1
View File
@@ -122,7 +122,7 @@
return
if(user.disabilities & CLUMSY && prob(75) && clumsyCheck)
user.visible_message("<span class='warning'>[user] loses their grip on [src], causing it to go off!</span>", "<span class='userdanger'>[src] slips out of your hands and goes off!</span>")
user.drop_item()
user.dropItemToGround(src, TRUE)
if(prob(10))
target = get_turf(user)
else
+1 -1
View File
@@ -254,7 +254,7 @@
if(!isturf(loc))
to_chat(user, "<span class='warning'>You cannot install[M], the frame has to be standing on the ground to be perfectly precise!</span>")
return
if(!user.drop_item())
if(!user.temporarilyRemoveItemFromInventory(M))
to_chat(user, "<span class='warning'>[M] is stuck to your hand!</span>")
return
qdel(M)
+1 -1
View File
@@ -48,7 +48,7 @@
/obj/item/storage/backpack/holding/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] is jumping into [src]! It looks like [user.p_theyre()] trying to commit suicide.</span>")
user.drop_item()
user.dropItemToGround(src, TRUE)
user.Stun(100, ignore_canstun = TRUE)
sleep(20)
playsound(src, "rustle", 50, 1, -5)
+2 -4
View File
@@ -57,11 +57,9 @@
close_all()
to_chat(user, "<span class='notice'>You fold [src] flat.</span>")
var/obj/item/I = new foldable(get_turf(src))
user.drop_item()
user.put_in_hands(I)
user.update_inv_hands()
var/obj/item/I = new foldable
qdel(src)
user.put_in_hands(I)
/obj/item/storage/box/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stack/packageWrap))
+4 -4
View File
@@ -1022,8 +1022,8 @@
throwforce = 12 //pelt your enemies to death with lumps of snow
/obj/item/toy/snowball/afterattack(atom/target as mob|obj|turf|area, mob/user)
user.drop_item()
src.throw_at(target, throw_range, throw_speed)
if(user.dropItemToGround(src))
throw_at(target, throw_range, throw_speed)
/obj/item/toy/snowball/throw_impact(atom/hit_atom)
if(!..())
@@ -1041,8 +1041,8 @@
w_class = WEIGHT_CLASS_BULKY //Stops people from hiding it in their bags/pockets
/obj/item/toy/beach_ball/afterattack(atom/target as mob|obj|turf|area, mob/user)
user.drop_item()
src.throw_at(target, throw_range, throw_speed)
if(user.dropItemToGround(src))
throw_at(target, throw_range, throw_speed)
/*
* Xenomorph action figure
+107 -107
View File
@@ -1,111 +1,111 @@
/obj/structure
icon = 'icons/obj/structures.dmi'
pressure_resistance = 8
max_integrity = 300
var/climb_time = 20
var/climb_stun = 20
var/climbable = FALSE
var/mob/living/structureclimber
var/broken = 0 //similar to machinery's stat BROKEN
/obj/structure/Initialize()
if (!armor)
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 50)
. = ..()
if(smooth)
queue_smooth(src)
queue_smooth_neighbors(src)
icon_state = ""
/obj/structure
icon = 'icons/obj/structures.dmi'
pressure_resistance = 8
max_integrity = 300
var/climb_time = 20
var/climb_stun = 20
var/climbable = FALSE
var/mob/living/structureclimber
var/broken = 0 //similar to machinery's stat BROKEN
/obj/structure/Initialize()
if (!armor)
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 50)
. = ..()
if(smooth)
queue_smooth(src)
queue_smooth_neighbors(src)
icon_state = ""
GLOB.cameranet.updateVisibility(src)
/obj/structure/Destroy()
/obj/structure/Destroy()
GLOB.cameranet.updateVisibility(src)
if(smooth)
queue_smooth_neighbors(src)
return ..()
/obj/structure/attack_hand(mob/user)
. = ..()
add_fingerprint(user)
if(structureclimber && structureclimber != user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
structureclimber.Knockdown(40)
structureclimber.visible_message("<span class='warning'>[structureclimber.name] has been knocked off the [src]", "You're knocked off the [src]!", "You see [structureclimber.name] get knocked off the [src]</span>")
interact(user)
/obj/structure/interact(mob/user)
ui_interact(user)
/obj/structure/ui_act(action, params)
..()
add_fingerprint(usr)
/obj/structure/MouseDrop_T(atom/movable/O, mob/user)
. = ..()
if(!climbable)
return
if(user == O && iscarbon(O))
if(user.canmove)
climb_structure(user)
return
if ((!( istype(O, /obj/item/weapon) ) || user.get_active_held_item() != O))
return
if(iscyborg(user))
return
if(!user.drop_item())
return
if (O.loc != src.loc)
step(O, get_dir(O, src))
return
/obj/structure/proc/do_climb(atom/movable/A)
if(climbable)
if(smooth)
queue_smooth_neighbors(src)
return ..()
/obj/structure/attack_hand(mob/user)
. = ..()
add_fingerprint(user)
if(structureclimber && structureclimber != user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
structureclimber.Knockdown(40)
structureclimber.visible_message("<span class='warning'>[structureclimber.name] has been knocked off the [src]", "You're knocked off the [src]!", "You see [structureclimber.name] get knocked off the [src]</span>")
interact(user)
/obj/structure/interact(mob/user)
ui_interact(user)
/obj/structure/ui_act(action, params)
..()
add_fingerprint(usr)
/obj/structure/MouseDrop_T(atom/movable/O, mob/user)
. = ..()
if(!climbable)
return
if(user == O && iscarbon(O))
if(user.canmove)
climb_structure(user)
return
if ((!( istype(O, /obj/item) ) || user.get_active_held_item() != O))
return
if(iscyborg(user))
return
if(!user.drop_all_held_items())
return
if (O.loc != src.loc)
step(O, get_dir(O, src))
return
/obj/structure/proc/do_climb(atom/movable/A)
if(climbable)
density = FALSE
. = step(A,get_dir(A,src.loc))
. = step(A,get_dir(A,src.loc))
density = TRUE
/obj/structure/proc/climb_structure(mob/living/user)
src.add_fingerprint(user)
user.visible_message("<span class='warning'>[user] starts climbing onto [src].</span>", \
"<span class='notice'>You start climbing onto [src]...</span>")
var/adjusted_climb_time = climb_time
if(user.restrained()) //climbing takes twice as long when restrained.
adjusted_climb_time *= 2
if(isalien(user))
adjusted_climb_time *= 0.25 //aliens are terrifyingly fast
structureclimber = user
if(do_mob(user, user, adjusted_climb_time))
if(src.loc) //Checking if structure has been destroyed
if(do_climb(user))
user.visible_message("<span class='warning'>[user] climbs onto [src].</span>", \
"<span class='notice'>You climb onto [src].</span>")
add_logs(user, src, "climbed onto")
if(climb_stun)
user.Stun(climb_stun)
. = 1
else
to_chat(user, "<span class='warning'>You fail to climb onto [src].</span>")
structureclimber = null
/obj/structure/examine(mob/user)
..()
if(!(resistance_flags & INDESTRUCTIBLE))
if(resistance_flags & ON_FIRE)
to_chat(user, "<span class='warning'>It's on fire!</span>")
if(broken)
to_chat(user, "<span class='notice'>It appears to be broken.</span>")
var/examine_status = examine_status(user)
if(examine_status)
to_chat(user, examine_status)
/obj/structure/proc/examine_status(mob/user) //An overridable proc, mostly for falsewalls.
var/healthpercent = (obj_integrity/max_integrity) * 100
switch(healthpercent)
if(50 to 99)
return "It looks slightly damaged."
if(25 to 50)
return "It appears heavily damaged."
if(0 to 25)
if(!broken)
return "<span class='warning'>It's falling apart!</span>"
/obj/structure/proc/climb_structure(mob/living/user)
src.add_fingerprint(user)
user.visible_message("<span class='warning'>[user] starts climbing onto [src].</span>", \
"<span class='notice'>You start climbing onto [src]...</span>")
var/adjusted_climb_time = climb_time
if(user.restrained()) //climbing takes twice as long when restrained.
adjusted_climb_time *= 2
if(isalien(user))
adjusted_climb_time *= 0.25 //aliens are terrifyingly fast
structureclimber = user
if(do_mob(user, user, adjusted_climb_time))
if(src.loc) //Checking if structure has been destroyed
if(do_climb(user))
user.visible_message("<span class='warning'>[user] climbs onto [src].</span>", \
"<span class='notice'>You climb onto [src].</span>")
add_logs(user, src, "climbed onto")
if(climb_stun)
user.Stun(climb_stun)
. = 1
else
to_chat(user, "<span class='warning'>You fail to climb onto [src].</span>")
structureclimber = null
/obj/structure/examine(mob/user)
..()
if(!(resistance_flags & INDESTRUCTIBLE))
if(resistance_flags & ON_FIRE)
to_chat(user, "<span class='warning'>It's on fire!</span>")
if(broken)
to_chat(user, "<span class='notice'>It appears to be broken.</span>")
var/examine_status = examine_status(user)
if(examine_status)
to_chat(user, examine_status)
/obj/structure/proc/examine_status(mob/user) //An overridable proc, mostly for falsewalls.
var/healthpercent = (obj_integrity/max_integrity) * 100
switch(healthpercent)
if(50 to 99)
return "It looks slightly damaged."
if(25 to 50)
return "It appears heavily damaged."
if(0 to 25)
if(!broken)
return "<span class='warning'>It's falling apart!</span>"
@@ -58,14 +58,14 @@
playsound(src.loc, W.usesound, 50, 1)
deconstruct()
else if(istype(W, /obj/item/assembly/shock_kit))
if(!user.drop_item())
if(!user.temporarilyRemoveItemFromInventory(W))
return
var/obj/item/assembly/shock_kit/SK = W
var/obj/structure/chair/e_chair/E = new /obj/structure/chair/e_chair(src.loc)
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
E.setDir(dir)
E.part = SK
SK.loc = E
SK.forceMove(E)
SK.master = E
qdel(src)
else
+4 -5
View File
@@ -27,7 +27,8 @@ LINEN BINS
..()
/obj/item/bedsheet/attack_self(mob/user)
user.drop_item()
if(!user.dropItemToGround(src))
return
if(layer == initial(layer))
layer = ABOVE_MOB_LAYER
to_chat(user, "<span class='notice'>You cover yourself with [src].</span>")
@@ -275,18 +276,16 @@ LINEN BINS
/obj/structure/bedsheetbin/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/bedsheet))
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
return
I.loc = src
sheets.Add(I)
amount++
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
update_icon()
else if(amount && !hidden && I.w_class < WEIGHT_CLASS_BULKY) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot hide it among the sheets!</span>")
return
I.loc = src
hidden = I
to_chat(user, "<span class='notice'>You hide [I] among the sheets.</span>")
@@ -229,8 +229,7 @@
"<span class='notice'>You cut \the [src] apart with \the [W].</span>")
deconstruct(TRUE)
return 0
if(user.drop_item()) // so we put in unlit welder too
W.forceMove(loc)
if(user.transferItemToLoc(W, drop_location())) // so we put in unlit welder too
return 1
else if(istype(W, /obj/item/weldingtool) && can_weld_shut)
var/obj/item/weldingtool/WT = W
@@ -602,10 +602,9 @@
if(do_after(user, 40, target = src))
if( src.state != 1 )
return
if(!user.drop_item())
if(!user.transferItemToLoc(W, src))
return
W.loc = src
to_chat(user, "<span class='notice'>You install the airlock electronics.</span>")
src.state = 2
src.name = "near finished airlock assembly"
+1 -2
View File
@@ -54,9 +54,8 @@
return
if(istype(I, /obj/item/extinguisher))
if(!stored_extinguisher && opened)
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
return
contents += I
stored_extinguisher = I
to_chat(user, "<span class='notice'>You place [I] in [src].</span>")
update_icon()
+1 -2
View File
@@ -53,10 +53,9 @@
if(F.wielded)
to_chat(user, "<span class='warning'>Unwield the [F.name] first.</span>")
return
if(!user.drop_item())
if(!user.transferItemToLoc(F, src))
return
fireaxe = F
F.forceMove(src)
to_chat(user, "<span class='caution'>You place the [F.name] back in the [name].</span>")
update_icon()
return
+1 -2
View File
@@ -259,9 +259,8 @@
else if(istype(W, /obj/item/pipe))
var/obj/item/pipe/P = W
if (P.pipe_type in list(0, 1, 5)) //simple pipes, simple bends, and simple manifolds.
if(!user.drop_item())
if(!user.transferItemToLoc(P, drop_location()))
return
P.loc = src.loc
to_chat(user, "<span class='notice'>You fit the pipe into \the [src].</span>")
else
return ..()
+1 -2
View File
@@ -39,9 +39,8 @@
return
if(istype(I, gun_category) && open)
if(LAZYLEN(contents) < capacity)
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
return
I.forceMove(src)
to_chat(user, "<span class='notice'>You place [I] in [src].</span>")
update_icon()
else
+1 -2
View File
@@ -32,9 +32,8 @@
return 1
/obj/structure/janitorialcart/proc/put_in_cart(obj/item/I, mob/user)
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
return
I.loc = src
updateUsrDialog()
to_chat(user, "<span class='notice'>You put [I] into [src].</span>")
return
+1 -2
View File
@@ -159,10 +159,9 @@ FLOOR SAFES
. = 1 //no afterattack
if(I.w_class + space <= maxspace)
space += I.w_class
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot put it in the safe!</span>")
return
I.forceMove(src)
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
updateUsrDialog()
return
-1
View File
@@ -104,7 +104,6 @@
"<span class='notice'>You attach the sign to [T].</span>")
playsound(T, 'sound/items/deconstruct.ogg', 50, 1)
new sign_path(T)
user.drop_item()
qdel(src)
else
return ..()
+4 -6
View File
@@ -131,8 +131,7 @@
// If the tray IS empty, continue on (tray will be placed on the table like other items)
if(user.a_intent != INTENT_HARM && !(I.flags_1 & ABSTRACT_1))
if(user.drop_item())
I.Move(loc)
if(user.transferItemToLoc(I, drop_location()))
var/list/click_params = params2list(params)
//Center the icon where the user clicked.
if(!click_params || !click_params["icon-x"] || !click_params["icon-y"])
@@ -439,7 +438,7 @@
/obj/structure/rack/MouseDrop_T(obj/O, mob/user)
if ((!( istype(O, /obj/item) ) || user.get_active_held_item() != O))
return
if(!user.drop_item())
if(!user.dropItemToGround(O))
return
if(O.loc != src.loc)
step(O, get_dir(O, src))
@@ -452,8 +451,7 @@
return
if(user.a_intent == INTENT_HARM)
return ..()
if(user.drop_item())
W.Move(loc)
if(user.transferItemToLoc(W, drop_location()))
return 1
/obj/structure/rack/attack_paw(mob/living/user)
@@ -516,7 +514,7 @@
building = TRUE
to_chat(user, "<span class='notice'>You start constructing a rack...</span>")
if(do_after(user, 50, target = user, progress=TRUE))
if(!user.drop_item())
if(!user.temporarilyRemoveItemFromInventory(src))
return
var/obj/structure/rack/R = new /obj/structure/rack(user.loc)
user.visible_message("<span class='notice'>[user] assembles \a [R].\
@@ -62,9 +62,8 @@
to_chat(user, "<span class='notice'>[src] can't hold any more of [I].</span>")
return
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
return
I.loc = src
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
update_icon()
+51 -52
View File
@@ -1,55 +1,54 @@
/obj/structure/target_stake
name = "target stake"
desc = "A thin platform with negatively-magnetized wheels."
icon = 'icons/obj/objects.dmi'
icon_state = "target_stake"
/obj/structure/target_stake
name = "target stake"
desc = "A thin platform with negatively-magnetized wheels."
icon = 'icons/obj/objects.dmi'
icon_state = "target_stake"
density = TRUE
flags_1 = CONDUCT_1
var/obj/item/target/pinned_target
/obj/structure/target_stake/Destroy()
if(pinned_target)
pinned_target.nullPinnedLoc()
return ..()
/obj/structure/target_stake/proc/nullPinnedTarget()
pinned_target = null
/obj/structure/target_stake/Move()
..()
if(pinned_target)
pinned_target.loc = loc
/obj/structure/target_stake/attackby(obj/item/target/T, mob/user)
if(pinned_target)
return
if(istype(T) && user.drop_item())
pinned_target = T
T.pinnedLoc = src
var/obj/item/target/pinned_target
/obj/structure/target_stake/Destroy()
if(pinned_target)
pinned_target.nullPinnedLoc()
return ..()
/obj/structure/target_stake/proc/nullPinnedTarget()
pinned_target = null
/obj/structure/target_stake/Move()
..()
if(pinned_target)
pinned_target.loc = loc
/obj/structure/target_stake/attackby(obj/item/target/T, mob/user)
if(pinned_target)
return
if(istype(T) && user.transferItemToLoc(T, drop_location()))
pinned_target = T
T.pinnedLoc = src
T.density = TRUE
T.layer = OBJ_LAYER + 0.01
T.loc = loc
to_chat(user, "<span class='notice'>You slide the target into the stake.</span>")
/obj/structure/target_stake/attack_hand(mob/user)
if(pinned_target)
removeTarget(user)
/obj/structure/target_stake/proc/removeTarget(mob/user)
pinned_target.layer = OBJ_LAYER
pinned_target.loc = user.loc
pinned_target.nullPinnedLoc()
nullPinnedTarget()
if(ishuman(user))
if(!user.get_active_held_item())
user.put_in_hands(pinned_target)
to_chat(user, "<span class='notice'>You take the target out of the stake.</span>")
else
pinned_target.loc = get_turf(user)
to_chat(user, "<span class='notice'>You take the target out of the stake.</span>")
/obj/structure/target_stake/bullet_act(obj/item/projectile/P)
if(pinned_target)
pinned_target.bullet_act(P)
else
..()
T.layer = OBJ_LAYER + 0.01
to_chat(user, "<span class='notice'>You slide the target into the stake.</span>")
/obj/structure/target_stake/attack_hand(mob/user)
if(pinned_target)
removeTarget(user)
/obj/structure/target_stake/proc/removeTarget(mob/user)
pinned_target.layer = OBJ_LAYER
pinned_target.loc = user.loc
pinned_target.nullPinnedLoc()
nullPinnedTarget()
if(ishuman(user))
if(!user.get_active_held_item())
user.put_in_hands(pinned_target)
to_chat(user, "<span class='notice'>You take the target out of the stake.</span>")
else
pinned_target.loc = get_turf(user)
to_chat(user, "<span class='notice'>You take the target out of the stake.</span>")
/obj/structure/target_stake/bullet_act(obj/item/projectile/P)
if(pinned_target)
pinned_target.bullet_act(P)
else
..()
+2 -4
View File
@@ -88,10 +88,9 @@
if(w_items + I.w_class > WEIGHT_CLASS_HUGE)
to_chat(user, "<span class='warning'>The cistern is full!</span>")
return
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot put it in the cistern!</span>")
return
I.loc = src
w_items += I.w_class
to_chat(user, "<span class='notice'>You carefully place [I] into the cistern.</span>")
@@ -173,10 +172,9 @@
if(I.w_class > 1)
to_chat(user, "<span class='warning'>[I] is too large for the drain enclosure.</span>")
return
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\[I] is stuck to your hand, you cannot put it in the drain enclosure!</span>")
return
I.forceMove(src)
hiddenitem = I
to_chat(user, "<span class='notice'>You place [I] into the drain enclosure.</span>")
@@ -208,11 +208,10 @@
//Adding airlock electronics for access. Step 6 complete.
else if(istype(W, /obj/item/electronics/airlock))
if(!user.drop_item())
if(!user.transferItemToLoc(W, src))
return
playsound(loc, W.usesound, 100, 1)
user.visible_message("[user] installs the electronics into the airlock assembly.", "<span class='notice'>You start to install electronics into the airlock assembly...</span>")
W.loc = src
if(do_after(user, 40, target = src))
if(!src || electronics)