Files
Bubberstation/code/game/objects/items/chainsaw.dm
SkyratBot 72b1a979ff [MIRROR] Improves the RPG loot wizard event. [MDB IGNORE] (#22800)
* Improves the RPG loot wizard event. (#77218)

## About The Pull Request
As the title says. Adds a bunch more stat changes to various different
items and a somewhat simple way of modifying them whilst minimizing
side-effects as much as possible.
Added a new negative curse of polymorph suffix that can randomly
polymorph you once you pick up the item.
Curse of hunger items won't start on items that are not on a turf.
Curse of polymorph will only activate when equipped.

Bodyparts, two-handed melees, bags, guns and grenades, to name a few,
have a bunch of type-specific stat changes depending on their quality.

Some items won't gain fantasy suffixes during the RPG loot event, like
stacks, chairs and paper, to make gamifying the stats a bit harder.
I'm sure there'll still be other ways to game the event, but it's not
that big of a deal since these are the easiest ways to game it.
High level items also have a cool unusual effect aura

## Why It's Good For The Game
Makes the RPG item event cooler. Right now, it's a bit lame since
everything only gains force value and wound bonus on attack. This makes
the statistic increases more type-based and make it interesting to use

It's okay for some items to be powerful since this is a wizard event and
a very impactful one too. By making the curse of hunger items not spawn
on people, it'll also make it a less painful event too.

## Changelog
🆑
add: Expanded the RPG loot wizard event by giving various different
items their own statistic boost.
/🆑

---------

Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>

* Improves the RPG loot wizard event.

---------

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
2023-07-31 20:02:03 -04:00

146 lines
4.9 KiB
Plaintext

// CHAINSAW
/obj/item/chainsaw
name = "chainsaw"
desc = "A versatile power tool. Useful for limbing trees and delimbing humans."
icon = 'icons/obj/weapons/chainsaw.dmi'
icon_state = "chainsaw_off"
lefthand_file = 'icons/mob/inhands/weapons/chainsaw_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/chainsaw_righthand.dmi'
flags_1 = CONDUCT_1
force = 13
var/force_on = 24
w_class = WEIGHT_CLASS_HUGE
throwforce = 13
throw_speed = 2
throw_range = 4
demolition_mod = 1.5
custom_materials = list(/datum/material/iron= SHEET_MATERIAL_AMOUNT * 6.5)
attack_verb_continuous = list("saws", "tears", "lacerates", "cuts", "chops", "dices")
attack_verb_simple = list("saw", "tear", "lacerate", "cut", "chop", "dice")
hitsound = SFX_SWING_HIT
sharpness = SHARP_EDGED
actions_types = list(/datum/action/item_action/startchainsaw)
tool_behaviour = TOOL_SAW
toolspeed = 1.5 //Turn it on first you dork
var/on = FALSE
///The looping sound for our chainsaw when running
var/datum/looping_sound/chainsaw/chainsaw_loop
/obj/item/chainsaw/apply_fantasy_bonuses(bonus)
. = ..()
force_on = modify_fantasy_variable("force_on", force_on, bonus)
if(on)
force = force_on
/obj/item/chainsaw/remove_fantasy_bonuses(bonus)
force_on = reset_fantasy_variable("force_on", force_on)
if(on)
force = force_on
return ..()
/obj/item/chainsaw/Initialize(mapload)
. = ..()
chainsaw_loop = new(src)
apply_components()
/obj/item/chainsaw/suicide_act(mob/living/carbon/user)
if(on)
user.visible_message(span_suicide("[user] begins to tear [user.p_their()] head off with [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
playsound(src, 'sound/weapons/chainsawhit.ogg', 100, TRUE)
var/obj/item/bodypart/head/myhead = user.get_bodypart(BODY_ZONE_HEAD)
if(myhead)
myhead.dismember()
else
user.visible_message(span_suicide("[user] smashes [src] into [user.p_their()] neck, destroying [user.p_their()] esophagus! It looks like [user.p_theyre()] trying to commit suicide!"))
playsound(src, 'sound/weapons/genhit1.ogg', 100, TRUE)
return BRUTELOSS
/obj/item/chainsaw/attack_self(mob/user)
on = !on
to_chat(user, "As you pull the starting cord dangling from [src], [on ? "it begins to whirr." : "the chain stops moving."]")
force = on ? force_on : initial(force)
throwforce = on ? force_on : initial(force)
icon_state = "chainsaw_[on ? "on" : "off"]"
var/datum/component/butchering/butchering = src.GetComponent(/datum/component/butchering)
butchering.butchering_enabled = on
if(on)
hitsound = 'sound/weapons/chainsawhit.ogg'
chainsaw_loop.start()
else
hitsound = SFX_SWING_HIT
chainsaw_loop.stop()
toolspeed = on ? 0.5 : initial(toolspeed) //Turning it on halves the speed
if(src == user.get_active_held_item()) //update inhands
user.update_held_items()
update_item_action_buttons()
/**
* Handles adding components to the chainsaw. Added in Initialize()
*
* Applies components to the chainsaw. Added as a seperate proc to allow for
* variance between subtypes
*/
/obj/item/chainsaw/proc/apply_components()
AddComponent(/datum/component/butchering, \
speed = 3 SECONDS, \
effectiveness = 100, \
bonus_modifier = 0, \
butcher_sound = 'sound/weapons/chainsawhit.ogg', \
disabled = TRUE, \
)
AddComponent(/datum/component/two_handed, require_twohands=TRUE)
/obj/item/chainsaw/doomslayer
name = "THE GREAT COMMUNICATOR"
desc = "<span class='warning'>VRRRRRRR!!!</span>"
armour_penetration = 100
force_on = 30
/obj/item/chainsaw/doomslayer/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE)
if(attack_type == PROJECTILE_ATTACK)
owner.visible_message(span_danger("Ranged attacks just make [owner] angrier!"))
playsound(src, pick('sound/weapons/bulletflyby.ogg', 'sound/weapons/bulletflyby2.ogg', 'sound/weapons/bulletflyby3.ogg'), 75, TRUE)
return TRUE
return FALSE
/obj/item/chainsaw/mounted_chainsaw
name = "mounted chainsaw"
desc = "A chainsaw that has replaced your arm."
inhand_icon_state = "mounted_chainsaw"
item_flags = ABSTRACT | DROPDEL
throwforce = 0
throw_range = 0
throw_speed = 0
toolspeed = 1
/obj/item/chainsaw/mounted_chainsaw/Initialize(mapload)
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, HAND_REPLACEMENT_TRAIT)
/obj/item/chainsaw/mounted_chainsaw/Destroy()
var/obj/item/bodypart/part
new /obj/item/chainsaw(get_turf(src))
if(iscarbon(loc))
var/mob/living/carbon/holder = loc
var/index = holder.get_held_index_of_item(src)
if(index)
part = holder.hand_bodyparts[index]
. = ..()
if(part)
part.drop_limb()
/obj/item/chainsaw/mounted_chainsaw/apply_components()
AddComponent(/datum/component/butchering, \
speed = 3 SECONDS, \
effectiveness = 100, \
bonus_modifier = 0, \
butcher_sound = 'sound/weapons/chainsawhit.ogg', \
disabled = TRUE, \
)
/datum/action/item_action/startchainsaw
name = "Pull The Starting Cord"