Files
Bubberstation/code/game/objects/items/melee/misc.dm
SkyratBot c6ee89d898 [MIRROR] contractor baton cyborg stunning now uses left/right clicks, not combat mode (#6427)
* contractor baton cyborg stunning now uses left/right clicks, not combat mode

* Update misc.dm

* Update misc.dm

Co-authored-by: ATH1909 <42606352+ATH1909@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-06-22 01:02:29 +01:00

717 lines
26 KiB
Plaintext

/obj/item/melee
item_flags = NEEDS_PERMIT
/obj/item/melee/proc/check_martial_counter(mob/living/carbon/human/target, mob/living/carbon/human/user)
if(target.check_block())
target.visible_message(span_danger("[target.name] blocks [src] and twists [user]'s arm behind [user.p_their()] back!"),
span_userdanger("You block the attack!"))
user.Stun(40)
return TRUE
/obj/item/melee/chainofcommand
name = "chain of command"
desc = "A tool used by great men to placate the frothing masses."
icon_state = "chain"
inhand_icon_state = "chain"
worn_icon_state = "whip"
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
force = 10
throwforce = 7
wound_bonus = 15
bare_wound_bonus = 10
w_class = WEIGHT_CLASS_NORMAL
attack_verb_continuous = list("flogs", "whips", "lashes", "disciplines")
attack_verb_simple = list("flog", "whip", "lash", "discipline")
hitsound = 'sound/weapons/chainhit.ogg'
custom_materials = list(/datum/material/iron = 1000)
/obj/item/melee/chainofcommand/suicide_act(mob/user)
user.visible_message(span_suicide("[user] is strangling [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return (OXYLOSS)
/obj/item/melee/synthetic_arm_blade
name = "synthetic arm blade"
desc = "A grotesque blade that on closer inspection seems to be made out of synthetic flesh, it still feels like it would hurt very badly as a weapon."
icon = 'icons/obj/changeling_items.dmi'
icon_state = "arm_blade"
inhand_icon_state = "arm_blade"
lefthand_file = 'icons/mob/inhands/antag/changeling_lefthand.dmi'
righthand_file = 'icons/mob/inhands/antag/changeling_righthand.dmi'
w_class = WEIGHT_CLASS_HUGE
force = 20
throwforce = 10
hitsound = 'sound/weapons/bladeslice.ogg'
attack_verb_continuous = list("attacks", "slashes", "stabs", "slices", "tears", "lacerates", "rips", "dices", "cuts")
attack_verb_simple = list("attack", "slash", "stab", "slice", "tear", "lacerate", "rip", "dice", "cut")
sharpness = SHARP_EDGED
/obj/item/melee/synthetic_arm_blade/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 60, 80) //very imprecise
/obj/item/melee/sabre
name = "officer's sabre"
desc = "An elegant weapon, its monomolecular edge is capable of cutting through flesh and bone with ease."
icon_state = "sabre"
inhand_icon_state = "sabre"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
flags_1 = CONDUCT_1
obj_flags = UNIQUE_RENAME
force = 15
throwforce = 10
w_class = WEIGHT_CLASS_BULKY
block_chance = 50
armour_penetration = 75
sharpness = SHARP_EDGED
attack_verb_continuous = list("slashes", "cuts")
attack_verb_simple = list("slash", "cut")
hitsound = 'sound/weapons/rapierhit.ogg'
custom_materials = list(/datum/material/iron = 1000)
wound_bonus = 10
bare_wound_bonus = 25
/obj/item/melee/sabre/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 30, 95, 5) //fast and effective, but as a sword, it might damage the results.
/obj/item/melee/sabre/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(attack_type == PROJECTILE_ATTACK)
final_block_chance = 0 //Don't bring a sword to a gunfight
return ..()
/obj/item/melee/sabre/on_exit_storage(datum/component/storage/concrete/S)
var/obj/item/storage/belt/sabre/B = S.real_location()
if(istype(B))
playsound(B, 'sound/items/unsheath.ogg', 25, TRUE)
/obj/item/melee/sabre/on_enter_storage(datum/component/storage/concrete/S)
var/obj/item/storage/belt/sabre/B = S.real_location()
if(istype(B))
playsound(B, 'sound/items/sheath.ogg', 25, TRUE)
/obj/item/melee/sabre/suicide_act(mob/living/user)
user.visible_message(span_suicide("[user] is trying to cut off all [user.p_their()] limbs with [src]! it looks like [user.p_theyre()] trying to commit suicide!"))
var/i = 0
ADD_TRAIT(src, TRAIT_NODROP, SABRE_SUICIDE_TRAIT)
if(iscarbon(user))
var/mob/living/carbon/Cuser = user
var/obj/item/bodypart/holding_bodypart = Cuser.get_holding_bodypart_of_item(src)
var/list/limbs_to_dismember
var/list/arms = list()
var/list/legs = list()
var/obj/item/bodypart/bodypart
for(bodypart in Cuser.bodyparts)
if(bodypart == holding_bodypart)
continue
if(bodypart.body_part & ARMS)
arms += bodypart
else if (bodypart.body_part & LEGS)
legs += bodypart
limbs_to_dismember = arms + legs
if(holding_bodypart)
limbs_to_dismember += holding_bodypart
var/speedbase = abs((4 SECONDS) / limbs_to_dismember.len)
for(bodypart in limbs_to_dismember)
i++
addtimer(CALLBACK(src, .proc/suicide_dismember, user, bodypart), speedbase * i)
addtimer(CALLBACK(src, .proc/manual_suicide, user), (5 SECONDS) * i)
return MANUAL_SUICIDE
/obj/item/melee/sabre/proc/suicide_dismember(mob/living/user, obj/item/bodypart/affecting)
if(!QDELETED(affecting) && affecting.dismemberable && affecting.owner == user && !QDELETED(user))
playsound(user, hitsound, 25, TRUE)
affecting.dismember(BRUTE)
user.adjustBruteLoss(20)
/obj/item/melee/sabre/proc/manual_suicide(mob/living/user, originally_nodropped)
if(!QDELETED(user))
user.adjustBruteLoss(200)
user.death(FALSE)
REMOVE_TRAIT(src, TRAIT_NODROP, SABRE_SUICIDE_TRAIT)
/obj/item/melee/beesword
name = "The Stinger"
desc = "Taken from a giant bee and folded over one thousand times in pure honey. Can sting through anything."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "beesword"
inhand_icon_state = "stinger"
worn_icon_state = "stinger"
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
slot_flags = ITEM_SLOT_BELT
force = 5
w_class = WEIGHT_CLASS_BULKY
sharpness = SHARP_EDGED
throwforce = 10
block_chance = 20
armour_penetration = 65
attack_verb_continuous = list("slashes", "stings", "prickles", "pokes")
attack_verb_simple = list("slash", "sting", "prickle", "poke")
hitsound = 'sound/weapons/rapierhit.ogg'
/obj/item/melee/beesword/afterattack(atom/target, mob/user, proximity)
. = ..()
if(!proximity)
return
user.changeNext_move(CLICK_CD_RAPID)
if(iscarbon(target))
var/mob/living/carbon/H = target
H.reagents.add_reagent(/datum/reagent/toxin, 4)
/obj/item/melee/beesword/suicide_act(mob/living/user)
user.visible_message(span_suicide("[user] is stabbing [user.p_them()]self in the throat with [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
playsound(get_turf(src), hitsound, 75, TRUE, -1)
return TOXLOSS
/obj/item/melee/classic_baton
name = "police baton"
desc = "A wooden truncheon for beating criminal scum. Left click to stun, right click to harm."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "classic_baton"
inhand_icon_state = "classic_baton"
worn_icon_state = "classic_baton"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
slot_flags = ITEM_SLOT_BELT
force = 12 //9 hit crit
w_class = WEIGHT_CLASS_NORMAL
var/cooldown_check = 0 // Used interally, you don't want to modify
/// Default wait time until can stun again.
var/cooldown = (4 SECONDS)
/// The length of the knockdown applied to a struck living, non-cyborg mob.
var/knockdown_time = (1.5 SECONDS)
/// If affect_cyborg is TRUE, this is how long we stun cyborgs for on a hit.
var/stun_time_cyborg = (5 SECONDS)
/// How much stamina damage we deal on a successful hit against a living, non-cyborg mob.
var/stamina_damage = 55
/// Can we stun cyborgs?
var/affect_cyborg = FALSE
/// "On" sound, played when switching between able to stun or not.
var/on_sound
/// The path of the default sound to play when we stun something.
var/on_stun_sound = 'sound/effects/woodhit.ogg'
/// Do we animate the "hit" when stunning something?
var/stun_animation = TRUE
/// Are we on or off?
var/on = TRUE
var/on_icon_state // What is our sprite when turned on
var/off_icon_state // What is our sprite when turned off
var/on_inhand_icon_state // What is our in-hand sprite when turned on
var/force_on // Damage when on - not stunning
var/force_off // Damage when off - not stunning
var/weight_class_on // What is the new size class when turned on
wound_bonus = 15
/obj/item/melee/classic_baton/Initialize()
. = ..()
// Adding an extra break for the sake of presentation
if(stamina_damage != 0)
offensive_notes = "\nVarious interviewed security forces report being able to beat criminals into exhaustion with only [span_warning("[round(100 / stamina_damage, 0.1)] hit\s!")]"
/// Description for trying to stun when still on cooldown.
/obj/item/melee/classic_baton/proc/get_wait_description()
return
/// Description for when turning the baton "on".
/obj/item/melee/classic_baton/proc/get_on_description()
. = list()
.["local_on"] = "<span class ='warning'>You extend the baton.</span>"
.["local_off"] = "<span class ='notice'>You collapse the baton.</span>"
return .
/// Default message for stunning a living, non-cyborg mob.
/obj/item/melee/classic_baton/proc/get_stun_description(mob/living/target, mob/living/user)
. = list()
.["visible"] = "<span class ='danger'>[user] knocks [target] down with [src]!</span>"
.["local"] = "<span class ='userdanger'>[user] knocks you down with [src]!</span>"
return .
/// Default message for stunning a cyborg.
/obj/item/melee/classic_baton/proc/get_cyborg_stun_description(mob/living/target, mob/living/user)
. = list()
.["visible"] = span_danger("[user] pulses [target]'s sensors with the baton!")
.["local"] = span_danger("You pulse [target]'s sensors with the baton!")
return .
/// Default message for trying to stun a cyborg with a baton that can't stun cyborgs.
/obj/item/melee/classic_baton/proc/get_unga_dunga_cyborg_stun_description(mob/living/target, mob/living/user)
. = list()
.["visible"] = "<span class='danger'>[user] tries to knock down [target] with [src], and predictably fails!</span>" //look at this duuuuuude
.["local"] = "<span class='userdanger'>[target] tries to... knock you down with [src]?</span>" //look at the top of his head!
return .
/// Contains any special effects that we apply to living, non-cyborg mobs we stun. Does not include applying a knockdown, dealing stamina damage, etc.
/obj/item/melee/classic_baton/proc/additional_effects_non_cyborg(mob/living/target, mob/living/user)
return
/// Contains any special effects that we apply to cyborgs we stun. Does not include flashing the cyborg's screen, hardstunning them, etc.
/obj/item/melee/classic_baton/proc/additional_effects_cyborg(mob/living/target, mob/living/user)
return
/obj/item/melee/classic_baton/attack(mob/living/target, mob/living/user, params)
if(!on)
return ..()
add_fingerprint(user)
if((HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50))
user.visible_message("<span class ='userdanger'>You accidentally hit yourself over the head with [src]!</span>", "<span class='danger'>[user] accidentally hits [user.p_them()]self over the head with [src]! What a doofus!</span>")
if(iscyborg(user))
if(affect_cyborg)
user.flash_act(affect_silicon = TRUE)
user.Paralyze(stun_time_cyborg * force)
additional_effects_cyborg(user, user) // user is the target here
playsound(get_turf(src), on_stun_sound, 100, TRUE, -1)
else
playsound(get_turf(src), 'sound/effects/bang.ogg', 10, TRUE)
else
//user.Paralyze(knockdown_time * force)
user.StaminaKnockdown(knockdown_time * force) //SKYRAT EDIT CHANGE
user.apply_damage(stamina_damage, STAMINA, BODY_ZONE_HEAD)
additional_effects_non_cyborg(user, user) // user is the target here
playsound(get_turf(src), on_stun_sound, 75, TRUE, -1)
user.apply_damage(2*force, BRUTE, BODY_ZONE_HEAD)
log_combat(user, target, "accidentally stun attacked [user.p_them()]self due to their clumsiness", src)
if(stun_animation)
user.do_attack_animation(user)
return
if(!isliving(target))
return
var/list/modifiers = params2list(params)
if(LAZYACCESS(modifiers, RIGHT_CLICK))
..()
return
if(cooldown_check > world.time)
var/wait_desc = get_wait_description()
if (wait_desc)
to_chat(user, wait_desc)
return
if(ishuman(target))
var/mob/living/carbon/human/H = target
if (H.check_shields(src, 0, "[user]'s [name]", MELEE_ATTACK))
return
if(check_martial_counter(H, user))
return
var/list/desc = get_stun_description(target, user)
if(iscyborg(target))
if(affect_cyborg)
desc = get_cyborg_stun_description(target, user)
target.flash_act(affect_silicon = TRUE)
target.Paralyze(stun_time_cyborg)
additional_effects_cyborg(target, user)
playsound(get_turf(src), on_stun_sound, 75, TRUE, -1)
else
desc = get_unga_dunga_cyborg_stun_description(target, user)
playsound(get_turf(src), 'sound/effects/bang.ogg', 10, TRUE) //bonk
else
target.Knockdown(knockdown_time)
target.apply_damage(stamina_damage, STAMINA, BODY_ZONE_CHEST)
additional_effects_non_cyborg(target, user)
playsound(get_turf(src), on_stun_sound, 75, TRUE, -1)
target.visible_message(desc["visible"], desc["local"])
log_combat(user, target, "stun attacked", src)
if(stun_animation)
user.do_attack_animation(target)
if(!iscarbon(user))
target.LAssailant = null
else
target.LAssailant = WEAKREF(user)
cooldown_check = world.time + cooldown
return
/obj/item/conversion_kit
name = "conversion kit"
desc = "A strange box containing wood working tools and an instruction paper to turn stun batons into something else."
icon = 'icons/obj/storage.dmi'
icon_state = "uk"
custom_price = PAYCHECK_HARD * 4.5
/obj/item/melee/classic_baton/telescopic
name = "telescopic baton"
desc = "A compact yet robust personal defense weapon. Can be concealed when folded."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "telebaton_0"
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
inhand_icon_state = null
worn_icon_state = "tele_baton"
slot_flags = ITEM_SLOT_BELT
w_class = WEIGHT_CLASS_SMALL
item_flags = NONE
force = 0
on = FALSE
on_sound = 'sound/weapons/batonextend.ogg'
on_icon_state = "telebaton_1"
off_icon_state = "telebaton_0"
on_inhand_icon_state = "nullrod"
force_on = 10
force_off = 0
weight_class_on = WEIGHT_CLASS_BULKY
bare_wound_bonus = 5
/obj/item/melee/classic_baton/telescopic/suicide_act(mob/user)
var/mob/living/carbon/human/H = user
var/obj/item/organ/brain/B = H.getorgan(/obj/item/organ/brain)
user.visible_message(span_suicide("[user] stuffs [src] up [user.p_their()] nose and presses the 'extend' button! It looks like [user.p_theyre()] trying to clear [user.p_their()] mind."))
if(!on)
src.attack_self(user)
else
playsound(src, on_sound, 50, TRUE)
add_fingerprint(user)
sleep(3)
if (!QDELETED(H))
if(!QDELETED(B))
H.internal_organs -= B
qdel(B)
new /obj/effect/gibspawner/generic(H.drop_location(), H)
return (BRUTELOSS)
/obj/item/melee/classic_baton/telescopic/attack_self(mob/user)
on = !on
var/list/desc = get_on_description()
if(on)
to_chat(user, desc["local_on"])
icon_state = on_icon_state
inhand_icon_state = on_inhand_icon_state
w_class = weight_class_on
force = force_on
attack_verb_continuous = list("smacks", "strikes", "cracks", "beats")
attack_verb_simple = list("smack", "strike", "crack", "beat")
else
to_chat(user, desc["local_off"])
icon_state = off_icon_state
inhand_icon_state = null //no sprite for concealment even when in hand
slot_flags = ITEM_SLOT_BELT
w_class = WEIGHT_CLASS_SMALL
force = force_off
attack_verb_continuous = list("hits", "pokes")
attack_verb_simple = list("hit", "poke")
playsound(src.loc, on_sound, 50, TRUE)
add_fingerprint(user)
/obj/item/melee/classic_baton/telescopic/contractor_baton
name = "contractor baton"
desc = "A compact, specialised baton assigned to Syndicate contractors. Applies light electrical shocks to targets."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "contractor_baton_0"
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
inhand_icon_state = null
slot_flags = ITEM_SLOT_BELT
w_class = WEIGHT_CLASS_SMALL
item_flags = NONE
force = 5
cooldown = 25
stamina_damage = 85
affect_cyborg = TRUE
on_sound = 'sound/weapons/contractorbatonextend.ogg'
on_stun_sound = 'sound/effects/contractorbatonhit.ogg'
on_icon_state = "contractor_baton_1"
off_icon_state = "contractor_baton_0"
on_inhand_icon_state = "contractor_baton"
force_on = 16
force_off = 5
weight_class_on = WEIGHT_CLASS_NORMAL
/obj/item/melee/classic_baton/telescopic/contractor_baton/get_wait_description()
return span_danger("The baton is still charging!")
/obj/item/melee/classic_baton/telescopic/contractor_baton/additional_effects_non_cyborg(mob/living/target, mob/living/user)
target.Jitter(20)
target.stuttering += 20
/obj/item/melee/supermatter_sword
name = "supermatter sword"
desc = "In a station full of bad ideas, this might just be the worst."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "supermatter_sword"
inhand_icon_state = "supermatter_sword"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
slot_flags = null
w_class = WEIGHT_CLASS_BULKY
force = 0.001
armour_penetration = 1000
var/obj/machinery/power/supermatter_crystal/shard
var/balanced = 1
force_string = "INFINITE"
/obj/item/melee/supermatter_sword/Initialize()
. = ..()
shard = new /obj/machinery/power/supermatter_crystal(src)
qdel(shard.countdown)
shard.countdown = null
START_PROCESSING(SSobj, src)
visible_message(span_warning("[src] appears, balanced ever so perfectly on its hilt. This isn't ominous at all."))
/obj/item/melee/supermatter_sword/process()
if(balanced || throwing || ismob(src.loc) || isnull(src.loc))
return
if(!isturf(src.loc))
var/atom/target = src.loc
forceMove(target.loc)
consume_everything(target)
else
var/turf/T = get_turf(src)
if(!isspaceturf(T))
consume_turf(T)
/obj/item/melee/supermatter_sword/afterattack(target, mob/user, proximity_flag)
. = ..()
if(user && target == user)
user.dropItemToGround(src)
if(proximity_flag)
consume_everything(target)
/obj/item/melee/supermatter_sword/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
..()
if(ismob(hit_atom))
var/mob/M = hit_atom
if(src.loc == M)
M.dropItemToGround(src)
consume_everything(hit_atom)
/obj/item/melee/supermatter_sword/pickup(user)
..()
balanced = 0
/obj/item/melee/supermatter_sword/ex_act(severity, target)
visible_message(
span_danger("The blast wave smacks into [src] and rapidly flashes to ash."),
span_hear("You hear a loud crack as you are washed with a wave of heat.")
)
consume_everything()
/obj/item/melee/supermatter_sword/acid_act()
visible_message(span_danger("The acid smacks into [src] and rapidly flashes to ash."),\
span_hear("You hear a loud crack as you are washed with a wave of heat."))
consume_everything()
return TRUE
/obj/item/melee/supermatter_sword/bullet_act(obj/projectile/P)
visible_message(span_danger("[P] smacks into [src] and rapidly flashes to ash."),\
span_hear("You hear a loud crack as you are washed with a wave of heat."))
consume_everything(P)
return BULLET_ACT_HIT
/obj/item/melee/supermatter_sword/suicide_act(mob/user)
user.visible_message(span_suicide("[user] touches [src]'s blade. It looks like [user.p_theyre()] tired of waiting for the radiation to kill [user.p_them()]!"))
user.dropItemToGround(src, TRUE)
shard.Bumped(user)
/obj/item/melee/supermatter_sword/proc/consume_everything(target)
if(isnull(target))
shard.Consume()
else if(!isturf(target))
shard.Bumped(target)
else
consume_turf(target)
/obj/item/melee/supermatter_sword/proc/consume_turf(turf/T)
var/oldtype = T.type
var/turf/newT = T.ScrapeAway(flags = CHANGETURF_INHERIT_AIR)
if(newT.type == oldtype)
return
playsound(T, 'sound/effects/supermatter.ogg', 50, TRUE)
T.visible_message(span_danger("[T] smacks into [src] and rapidly flashes to ash."),\
span_hear("You hear a loud crack as you are washed with a wave of heat."))
shard.Consume()
/obj/item/melee/supermatter_sword/add_blood_DNA(list/blood_dna)
return FALSE
/obj/item/melee/curator_whip
name = "curator's whip"
desc = "Somewhat eccentric and outdated, it still stings like hell to be hit by."
icon_state = "whip"
inhand_icon_state = "chain"
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
worn_icon_state = "whip"
slot_flags = ITEM_SLOT_BELT
force = 15
w_class = WEIGHT_CLASS_NORMAL
attack_verb_continuous = list("flogs", "whips", "lashes", "disciplines")
attack_verb_simple = list("flog", "whip", "lash", "discipline")
hitsound = 'sound/weapons/whip.ogg'
/obj/item/melee/curator_whip/afterattack(target, mob/user, proximity_flag)
. = ..()
if(ishuman(target) && proximity_flag)
var/mob/living/carbon/human/H = target
H.drop_all_held_items()
H.visible_message(span_danger("[user] disarms [H]!"), span_userdanger("[user] disarmed you!"))
/obj/item/melee/roastingstick
name = "advanced roasting stick"
desc = "A telescopic roasting stick with a miniature shield generator designed to ensure entry into various high-tech shielded cooking ovens and firepits."
icon_state = "roastingstick_0"
inhand_icon_state = "null"
worn_icon_state = "tele_baton"
slot_flags = ITEM_SLOT_BELT
w_class = WEIGHT_CLASS_SMALL
item_flags = NONE
force = 0
attack_verb_continuous = list("hits", "pokes")
attack_verb_simple = list("hit", "poke")
var/obj/item/food/sausage/held_sausage
var/static/list/ovens
var/on = FALSE
var/datum/beam/beam
/obj/item/melee/roastingstick/Initialize()
. = ..()
if (!ovens)
ovens = typecacheof(list(/obj/singularity, /obj/energy_ball, /obj/machinery/power/supermatter_crystal, /obj/structure/bonfire))
/obj/item/melee/roastingstick/attack_self(mob/user)
on = !on
if(on)
extend(user)
else
if (held_sausage)
to_chat(user, span_warning("You can't retract [src] while [held_sausage] is attached!"))
return
retract(user)
playsound(src.loc, 'sound/weapons/batonextend.ogg', 50, TRUE)
add_fingerprint(user)
/obj/item/melee/roastingstick/attackby(atom/target, mob/user)
..()
if (istype(target, /obj/item/food/sausage))
if (!on)
to_chat(user, span_warning("You must extend [src] to attach anything to it!"))
return
if (held_sausage)
to_chat(user, span_warning("[held_sausage] is already attached to [src]!"))
return
if (user.transferItemToLoc(target, src))
held_sausage = target
else
to_chat(user, span_warning("[target] doesn't seem to want to get on [src]!"))
update_appearance()
/obj/item/melee/roastingstick/attack_hand(mob/user, list/modifiers)
..()
if (held_sausage)
user.put_in_hands(held_sausage)
held_sausage = null
update_appearance()
/obj/item/melee/roastingstick/update_overlays()
. = ..()
if(held_sausage)
. += mutable_appearance(icon, "roastingstick_sausage")
/obj/item/melee/roastingstick/proc/extend(user)
to_chat(user, span_warning("You extend [src]."))
icon_state = "roastingstick_1"
inhand_icon_state = "nullrod"
w_class = WEIGHT_CLASS_BULKY
/obj/item/melee/roastingstick/proc/retract(user)
to_chat(user, span_notice("You collapse [src]."))
icon_state = "roastingstick_0"
inhand_icon_state = null
w_class = WEIGHT_CLASS_SMALL
/obj/item/melee/roastingstick/handle_atom_del(atom/target)
if (target == held_sausage)
held_sausage = null
update_appearance()
/obj/item/melee/roastingstick/afterattack(atom/target, mob/user, proximity)
. = ..()
if (!on)
return
if (is_type_in_typecache(target, ovens))
if (held_sausage?.roasted)
to_chat(span_warning("Your [held_sausage] has already been cooked!"))
return
if (istype(target, /obj/singularity) && get_dist(user, target) < 10)
to_chat(user, span_notice("You send [held_sausage] towards [target]."))
playsound(src, 'sound/items/rped.ogg', 50, TRUE)
beam = user.Beam(target,icon_state="rped_upgrade", time = 10 SECONDS)
else if (user.Adjacent(target))
to_chat(user, span_notice("You extend [src] towards [target]."))
playsound(src.loc, 'sound/weapons/batonextend.ogg', 50, TRUE)
else
return
if(do_after(user, 100, target = user))
finish_roasting(user, target)
else
QDEL_NULL(beam)
playsound(src, 'sound/weapons/batonextend.ogg', 50, TRUE)
/obj/item/melee/roastingstick/proc/finish_roasting(user, atom/target)
to_chat(user, span_notice("You finish roasting [held_sausage]."))
playsound(src,'sound/items/welder2.ogg',50,TRUE)
held_sausage.add_atom_colour(rgb(103,63,24), FIXED_COLOUR_PRIORITY)
held_sausage.name = "[target.name]-roasted [held_sausage.name]"
held_sausage.desc = "[held_sausage.desc] It has been cooked to perfection on \a [target]."
update_appearance()
/obj/item/melee/cleric_mace
name = "cleric mace"
desc = "The grandson of the club, yet the grandfather of the baseball bat. Most notably used by holy orders in days past."
icon = 'icons/obj/items/cleric_mace.dmi'
icon_state = "default"
inhand_icon_state = "default"
worn_icon_state = "default_worn"
greyscale_config = /datum/greyscale_config/cleric_mace
greyscale_config_inhand_left = /datum/greyscale_config/cleric_mace_lefthand
greyscale_config_inhand_right = /datum/greyscale_config/cleric_mace_righthand
greyscale_config_worn = /datum/greyscale_config/cleric_mace
greyscale_colors = "#FFFFFF"
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_GREYSCALE | MATERIAL_AFFECT_STATISTICS //Material type changes the prefix as well as the color.
custom_materials = list(/datum/material/iron = 12000) //Defaults to an Iron Mace.
slot_flags = ITEM_SLOT_BELT
force = 14
w_class = WEIGHT_CLASS_BULKY
throwforce = 8
block_chance = 10
armour_penetration = 50
attack_verb_continuous = list("smacks", "strikes", "cracks", "beats")
attack_verb_simple = list("smack", "strike", "crack", "beat")