mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-21 19:19:12 +01:00
A lot of new defines are now in inventory_sizes.dm, which contains; All the size identifiers (the thing that tells the game if something is bulky, or w/e). Storage costs for all the sizes, which are exponents of two, as previously. A few constants for inventory size. Also changes all storage item's capacity definitions by basing it off of how many 'normal slots' exist for it. This allows one to change the definition for all of the defines in the file, and everything will follow along without needing to change 500 files. In testing, I made all ITEMSIZE_COST_* defines doubled, and nothing had broke. The benefit of doing all of this is that it makes adding new weight classes in the future much simpler, and makes knowing how much space a container has easier, as seeing ITEMSIZE_COST_NORMAL * 7 means it can hold seven normal items.
99 lines
2.9 KiB
Plaintext
99 lines
2.9 KiB
Plaintext
/* Weapons
|
|
* Contains:
|
|
* Sword
|
|
* Classic Baton
|
|
* Telescopic Baton
|
|
*/
|
|
|
|
/*
|
|
* Classic Baton
|
|
*/
|
|
/obj/item/weapon/melee/classic_baton
|
|
name = "police baton"
|
|
desc = "A wooden truncheon for beating criminal scum."
|
|
icon = 'icons/obj/weapons.dmi'
|
|
icon_state = "baton"
|
|
item_state = "classic_baton"
|
|
slot_flags = SLOT_BELT
|
|
force = 10
|
|
|
|
/obj/item/weapon/melee/classic_baton/attack(mob/M as mob, mob/living/user as mob)
|
|
if ((CLUMSY in user.mutations) && prob(50))
|
|
user << "<span class='warning'>You club yourself over the head.</span>"
|
|
user.Weaken(3 * force)
|
|
if(ishuman(user))
|
|
var/mob/living/carbon/human/H = user
|
|
H.apply_damage(2*force, BRUTE, BP_HEAD)
|
|
else
|
|
user.take_organ_damage(2*force)
|
|
return
|
|
return ..()
|
|
|
|
//Telescopic baton
|
|
/obj/item/weapon/melee/telebaton
|
|
name = "telescopic baton"
|
|
desc = "A compact yet rebalanced personal defense weapon. Can be concealed when folded."
|
|
icon = 'icons/obj/weapons.dmi'
|
|
icon_state = "telebaton0"
|
|
slot_flags = SLOT_BELT
|
|
w_class = ITEMSIZE_SMALL
|
|
force = 3
|
|
var/on = 0
|
|
|
|
|
|
/obj/item/weapon/melee/telebaton/attack_self(mob/user as mob)
|
|
on = !on
|
|
if(on)
|
|
user.visible_message("<span class='warning'>With a flick of their wrist, [user] extends their telescopic baton.</span>",\
|
|
"<span class='warning'>You extend the baton.</span>",\
|
|
"You hear an ominous click.")
|
|
icon_state = "telebaton1"
|
|
w_class = ITEMSIZE_NORMAL
|
|
force = 15//quite robust
|
|
attack_verb = list("smacked", "struck", "slapped")
|
|
else
|
|
user.visible_message("<span class='notice'>\The [user] collapses their telescopic baton.</span>",\
|
|
"<span class='notice'>You collapse the baton.</span>",\
|
|
"You hear a click.")
|
|
icon_state = "telebaton0"
|
|
w_class = ITEMSIZE_SMALL
|
|
force = 3//not so robust now
|
|
attack_verb = list("hit", "punched")
|
|
|
|
if(istype(user,/mob/living/carbon/human))
|
|
var/mob/living/carbon/human/H = user
|
|
H.update_inv_l_hand()
|
|
H.update_inv_r_hand()
|
|
|
|
playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1)
|
|
add_fingerprint(user)
|
|
|
|
if(blood_overlay && blood_DNA && (blood_DNA.len >= 1)) //updates blood overlay, if any
|
|
overlays.Cut()//this might delete other item overlays as well but eeeeeeeh
|
|
|
|
var/icon/I = new /icon(src.icon, src.icon_state)
|
|
I.Blend(new /icon('icons/effects/blood.dmi', rgb(255,255,255)),ICON_ADD)
|
|
I.Blend(new /icon('icons/effects/blood.dmi', "itemblood"),ICON_MULTIPLY)
|
|
blood_overlay = I
|
|
|
|
overlays += blood_overlay
|
|
|
|
return
|
|
|
|
/obj/item/weapon/melee/telebaton/attack(mob/target as mob, mob/living/user as mob)
|
|
if(on)
|
|
if ((CLUMSY in user.mutations) && prob(50))
|
|
user << "<span class='warning'>You club yourself over the head.</span>"
|
|
user.Weaken(3 * force)
|
|
if(ishuman(user))
|
|
var/mob/living/carbon/human/H = user
|
|
H.apply_damage(2*force, BRUTE, BP_HEAD)
|
|
else
|
|
user.take_organ_damage(2*force)
|
|
return
|
|
if(..())
|
|
//playsound(src.loc, "swing_hit", 50, 1, -1)
|
|
return
|
|
else
|
|
return ..()
|