Electrostaff Custom Item

This is the code for the stunstaff as was approved here

https://forum.vore-station.net/viewtopic.php?f=27&t=1204
This commit is contained in:
blazerules
2018-01-03 09:28:43 +02:00
parent 2bcee3d20a
commit 2d434c40d5
6 changed files with 139 additions and 0 deletions
@@ -1668,3 +1668,136 @@
return
else
..()
//jacknoir413:Areax Third
/obj/item/weapon/melee/baton/stunstaff
name = "Electrostaff"
desc = "Six-foot long staff from dull, rugged metal, with two thin spikes protruding from each end. Small etching near to the middle of it reads 'Children Of Nyx Facilities: Product No. 12'."
icon = 'icons/vore/custom_items_vr.dmi'
item_icons = list(slot_l_hand_str = 'icons/vore/custom_items_left_hand_vr.dmi', slot_r_hand_str = 'icons/vore/custom_items_right_hand_vr.dmi')
icon_state = "stunstaff00"
var/base_icon = "stunstaff"
force = 5
sharp = 0
edge = 0
throwforce = 7
w_class = ITEMSIZE_HUGE
origin_tech = list(TECH_COMBAT = 2)
attack_verb = list("beaten")
lightcolor = "#CC33FF"
//Two Handed
var/wielded = 0
var/base_name = "stunstaff"
/obj/item/weapon/melee/baton/stunstaff/New()
..()
bcell = new/obj/item/weapon/cell/device/weapon(src)
update_icon()
return
/obj/item/weapon/melee/baton/stunstaff/update_held_icon()
var/mob/living/M = loc
if(istype(M) && !issmall(M) && M.item_is_in_hands(src) && !M.hands_are_full())
wielded = 1
force = 15
name = "[base_name] (wielded)"
update_icon()
else
wielded = 0
force = 8
name = "[base_name]"
update_icon()
..()
/obj/item/weapon/melee/baton/stunstaff/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
if(wielded && default_parry_check(user, attacker, damage_source) && prob(30))
user.visible_message("<span class='danger'>\The [user] parries [attack_text] with \the [src]!</span>")
playsound(user.loc, 'sound/weapons/punchmiss.ogg', 50, 1)
return 1
return 0
/obj/item/weapon/melee/baton/stunstaff/update_icon()
icon_state = "[base_icon][wielded][status]"
item_state = icon_state
if(status==1)
set_light(2, 2, lightcolor)
else
set_light(0)
/obj/item/weapon/melee/baton/stunstaff/dropped()
..()
if(wielded)
wielded = 0
spawn(0)
update_held_icon()
/obj/item/weapon/melee/baton/stunstaff/apply_hit_effect(mob/living/target, mob/living/user, var/hit_zone)
if(isrobot(target))
return ..()
var/agony = agonyforce
var/stun = stunforce
var/obj/item/organ/external/affecting = null
if(ishuman(target))
var/mob/living/carbon/human/H = target
affecting = H.get_organ(hit_zone)
if(user.a_intent == I_HURT || user.a_intent == I_DISARM)
. = ..()
agony *= 0.5
stun *= 0.5
else if(!status)
if(affecting)
target.visible_message("<span class='warning'>[target] has been prodded in the [affecting.name] with [src] by [user]. Luckily it was off.</span>")
else
target.visible_message("<span class='warning'>[target] has been prodded with [src] by [user]. Luckily it was off.</span>")
else
if(affecting)
target.visible_message("<span class='danger'>[target] has been prodded in the [affecting.name] with [src] by [user]!</span>")
else
target.visible_message("<span class='danger'>[target] has been prodded with [src] by [user]!</span>")
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
//stun effects
if(status)
target.stun_effect_act(stun, agony, hit_zone, src)
msg_admin_attack("[key_name(user)] stunned [key_name(target)] with the [src].")
if(ishuman(target))
var/mob/living/carbon/human/H = target
H.forcesay(hit_appends)
powercheck(hitcost)
/obj/item/weapon/melee/baton/stunstaff/attack_self(mob/user)
if(bcell && bcell.charge > hitcost)
status = !status
user << "<span class='notice'>[src] is now [status ? "on" : "off"].</span>"
if(status == 0)
playsound(user, 'sound/weapons/saberoff.ogg', 50, 1)
else
playsound(user, 'sound/weapons/saberon.ogg', 50, 1)
else
status = 0
user << "<span class='warning'>[src] is out of charge.</span>"
update_held_icon()
add_fingerprint(user)
/obj/item/weapon/storage/box/stunstaff
name = "Electrostaff sheath"
icon = 'icons/vore/custom_items_vr.dmi'
icon_state = "holster_stunstaff"
desc = "A sturdy synthetic leather sheath with matching belt and rubberized interior."
slot_flags = SLOT_BACK
item_icons = list(slot_back_str = 'icons/vore/custom_onmob_vr.dmi')
can_hold = list(/obj/item/weapon/melee/baton/stunstaff)
w_class = ITEMSIZE_HUGE
max_w_class = ITEMSIZE_HUGE
max_storage_space = 16
/obj/item/weapon/storage/box/stunstaff/New()
..()
new /obj/item/weapon/melee/baton/stunstaff(src)
+6
View File
@@ -890,3 +890,9 @@ ckey: zodiacshadow
character_name: Nehi Maximus
item_path: /obj/item/device/radio/headset/fluff/zodiacshadow
}
{
ckey: jacknoir413
character_name: Areax Third
item_path: /obj/item/weapon/storage/box/stunstaff
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 831 B

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 823 B

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB