Converts two-handedness/wielding to a component (#21619)

* initial checkin

* Add everything but maps

* update paths

* Patches some minor bugs across twohanded things

* remove a stowaway

* Update code/__DEFINES/dcs/signals.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* Contra review

* Fix kc

* hopefully fix file perms

* Fix file perms

* revert line-endings

* uh?

* Trying once again to fix file formats

* henri review 1

* henri review 2

* update from master

* Removes override that breaks modsuits

* re-add reference

---------

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
This commit is contained in:
Luc
2023-09-01 22:06:59 +01:00
committed by GitHub
co-authored by Contrabang
parent b678937acc
commit 327add6348
94 changed files with 1615 additions and 1286 deletions
+2 -2
View File
@@ -559,14 +559,14 @@ INITIALIZE_IMMEDIATE(/obj/effect/landmark/awaystart) //Without this away mission
. = ..()
new /obj/item/clothing/under/dress/sundress(src.loc)
new /obj/item/clothing/head/witchwig(src.loc)
new /obj/item/twohanded/staff/broom(src.loc)
new /obj/item/staff/broom(src.loc)
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/costume/fakewizard/Initialize(mapload)
. = ..()
new /obj/item/clothing/suit/wizrobe/fake(src.loc)
new /obj/item/clothing/head/wizard/fake(src.loc)
new /obj/item/twohanded/staff/(src.loc)
new /obj/item/staff/(src.loc)
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/costume/sexyclown/Initialize(mapload)
+1 -2
View File
@@ -134,13 +134,12 @@
new /obj/effect/hallucination/delusion(get_turf(victim), victim, 'icons/mob/mob.dmi', "daemon")
var/obj/item/twohanded/required/chainsaw/doomslayer/chainsaw = new(victim.loc)
var/obj/item/chainsaw/doomslayer/chainsaw = new(victim.loc)
chainsaw.flags |= NODROP | DROPDEL
victim.drop_l_hand()
victim.drop_r_hand()
victim.put_in_hands(chainsaw)
chainsaw.attack_self(victim)
chainsaw.wield(victim)
victim.reagents.add_reagent("adminordrazine", 25)
victim.flash_screen_color(red_splash, 10)
@@ -347,9 +347,9 @@
/obj/item/gun/energy/kinetic_accelerator/crossbow = 1,
/obj/item/gun/projectile/revolver = 1,
/obj/item/clothing/gloves/color/yellow/power = 1,
/obj/item/twohanded/chainsaw = 1,
/obj/item/butcher_chainsaw = 1,
/obj/item/bee_briefcase = 1,
/obj/item/twohanded/fireaxe/energized = 1,
/obj/item/fireaxe/energized = 1,
/obj/item/clothing/glasses/thermal = 1,
/obj/item/chameleon = 1,
/obj/item/reagent_containers/hypospray/autoinjector/stimulants = 1,
+18 -15
View File
@@ -216,7 +216,7 @@
to_chat(user, "<span class='notice'>\the [flags & NODROP ? src : W] is stuck to your hand, you can't attach it to \the [flags & NODROP ? W : src]!</span>")
else
to_chat(user, "<span class='notice'>You attach the ends of the two plastic swords, making a single double-bladed toy! You're fake-cool.</span>")
new /obj/item/twohanded/dualsaber/toy(user.loc)
new /obj/item/dualsaber/toy(user.loc)
user.unEquip(W)
user.unEquip(src)
qdel(W)
@@ -225,26 +225,27 @@
/*
* Subtype of Double-Bladed Energy Swords
*/
/obj/item/twohanded/dualsaber/toy
/obj/item/dualsaber/toy
name = "double-bladed toy sword"
desc = "A cheap, plastic replica of TWO energy swords. Double the fun!"
force = 0
throwforce = 0
throw_speed = 3
throw_range = 5
force_unwielded = 0
force_wielded = 0
origin_tech = null
attack_verb = list("attacked", "struck", "hit")
brightness_on = 0
sharp_when_wielded = FALSE // It's a toy
needs_permit = FALSE
/obj/item/twohanded/dualsaber/toy/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
/obj/item/dualsaber/toy/Initialize(mapload)
. = ..()
AddComponent(/datum/component/two_handed, only_sharp_when_wielded = FALSE, force_wielded = 0, force_unwielded = 0)
/obj/item/dualsaber/toy/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
return 0
/obj/item/twohanded/dualsaber/toy/IsReflect()
if(wielded)
/obj/item/dualsaber/toy/IsReflect()
if(HAS_TRAIT(src, TRAIT_WIELDED))
return 2
/obj/item/toy/katana
@@ -1237,22 +1238,24 @@
/*
* Rubber Chainsaw
*/
/obj/item/twohanded/toy/chainsaw
/obj/item/toy/chainsaw
name = "Toy Chainsaw"
desc = "A toy chainsaw with a rubber edge. Ages 8 and up"
icon_state = "chainsaw0"
base_icon_state = "chainsaw"
force = 0
throwforce = 0
throw_speed = 4
throw_range = 20
wieldsound = 'sound/weapons/chainsawstart.ogg'
attack_verb = list("sawed", "cut", "hacked", "carved", "cleaved", "butchered", "felled", "timbered")
/obj/item/twohanded/toy/chainsaw/update_icon_state()
if(wielded)
icon_state = "chainsaw[wielded]"
else
icon_state = "chainsaw0"
/obj/item/toy/chainsaw/Initialize(mapload)
. = ..()
AddComponent(/datum/component/two_handed, wieldsound = 'sound/weapons/chainsawstart.ogg', icon_wielded = "[base_icon_state]1")
/obj/item/toy/chainsaw/update_icon_state()
icon_state = "[base_icon_state]0"
/*
* Cat Toy
+19 -17
View File
@@ -1,4 +1,4 @@
/obj/item/twohanded/rcl
/obj/item/rcl
name = "rapid cable layer (RCL)"
desc = "A device used to rapidly deploy cables. It has screws on the side which can be removed to slide off the cables."
icon = 'icons/obj/tools.dmi'
@@ -16,7 +16,11 @@
var/obj/structure/cable/last = null
var/obj/item/stack/cable_coil/loaded = null
/obj/item/twohanded/rcl/attackby(obj/item/W, mob/user)
/obj/item/rcl/Initialize(mapload)
. = ..()
AddComponent(/datum/component/two_handed)
/obj/item/rcl/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
if(!loaded)
@@ -39,7 +43,7 @@
else
..()
/obj/item/twohanded/rcl/screwdriver_act(mob/user, obj/item/I)
/obj/item/rcl/screwdriver_act(mob/user, obj/item/I)
if(!loaded)
return
. = TRUE
@@ -60,18 +64,18 @@
loaded = null
update_icon(UPDATE_ICON_STATE)
/obj/item/twohanded/rcl/examine(mob/user)
/obj/item/rcl/examine(mob/user)
. = ..()
if(loaded)
. += "<span class='info'>It contains [loaded.amount]/[max_amount] cables.</span>"
/obj/item/twohanded/rcl/Destroy()
/obj/item/rcl/Destroy()
QDEL_NULL(loaded)
last = null
active = FALSE
return ..()
/obj/item/twohanded/rcl/update_icon_state()
/obj/item/rcl/update_icon_state()
if(!loaded)
icon_state = "rcl-0"
item_state = "rcl-0"
@@ -90,7 +94,7 @@
icon_state = "rcl-0"
item_state = "rcl-0"
/obj/item/twohanded/rcl/proc/is_empty(mob/user, loud = 1)
/obj/item/rcl/proc/is_empty(mob/user, loud = 1)
update_icon(UPDATE_ICON_STATE)
if(!loaded || !loaded.amount)
if(loud)
@@ -98,19 +102,17 @@
if(loaded)
qdel(loaded)
loaded = null
unwield(user)
active = wielded
return 1
return 0
return TRUE
return FALSE
/obj/item/twohanded/rcl/dropped(mob/wearer)
/obj/item/rcl/dropped(mob/wearer)
..()
active = FALSE
last = null
/obj/item/twohanded/rcl/attack_self(mob/user)
/obj/item/rcl/attack_self(mob/user)
..()
active = wielded
active = HAS_TRAIT(src, TRAIT_WIELDED)
if(!active)
last = null
else if(!last)
@@ -119,11 +121,11 @@
last = C
break
/obj/item/twohanded/rcl/on_mob_move(direct, mob/user)
/obj/item/rcl/on_mob_move(direct, mob/user)
if(active)
trigger(user)
/obj/item/twohanded/rcl/proc/trigger(mob/user)
/obj/item/rcl/proc/trigger(mob/user)
if(is_empty(user, 0))
to_chat(user, "<span class='warning'>\The [src] is empty!</span>")
return
@@ -145,7 +147,7 @@
last = loaded.place_turf(get_turf(loc), user, turn(user.dir, 180))
is_empty(user) //If we've run out, display message
/obj/item/twohanded/rcl/pre_loaded/New() //Comes preloaded with cable, for testing stuff
/obj/item/rcl/pre_loaded/New() //Comes preloaded with cable, for testing stuff
..()
loaded = new()
loaded.max_amount = max_amount
+5 -1
View File
@@ -78,5 +78,9 @@
/obj/item/stack/spacecash/c10000
amount = 10000
/obj/item/twohanded/required/cash_pile
/obj/item/cash_pile
name = "Pile of Cash"
/obj/item/cash_pile/Initialize(mapload)
. = ..()
AddComponent(/datum/component/two_handed, require_twohands = TRUE)
+26 -25
View File
@@ -22,7 +22,7 @@
/// if there's a cell in the defib with enough power for a revive; blocks paddles from reviving otherwise
var/powered = FALSE
/// Ref to attached paddles
var/obj/item/twohanded/shockpaddles/paddles
var/obj/item/shockpaddles/paddles
/// Ref to internal power cell.
var/obj/item/stock_parts/cell/high/cell = null
/// If false, using harm intent will let you zap people. Note that any updates to this after init will only impact icons.
@@ -38,7 +38,7 @@
base_icon_state = "defibpaddles"
/// Type of paddles that should be attached to this defib.
var/obj/item/twohanded/shockpaddles/paddle_type = /obj/item/twohanded/shockpaddles
var/obj/item/shockpaddles/paddle_type = /obj/item/shockpaddles
/obj/item/defibrillator/get_cell()
return cell
@@ -225,7 +225,7 @@
desc = "A belt-mounted blood-red defibrillator that can be rapidly deployed. Does not have the restrictions or safeties of conventional defibrillators and can revive through space suits."
icon_state = "defibcombat"
item_state = "defibcombat"
paddle_type = /obj/item/twohanded/shockpaddles/syndicate
paddle_type = /obj/item/shockpaddles/syndicate
combat = TRUE
safety = FALSE
heart_attack_probability = 100
@@ -240,7 +240,7 @@
desc = "A belt-mounted state-of-the-art defibrillator that can be rapidly deployed in all environments. Uses an experimental self-charging cell, meaning that it will (probably) never stop working. Can be used to defibrillate through space suits. It is impossible to damage."
icon_state = "defibnt"
item_state = "defibnt"
paddle_type = /obj/item/twohanded/shockpaddles/advanced
paddle_type = /obj/item/shockpaddles/advanced
combat = TRUE
safety = TRUE
hardened = TRUE // emp-proof (on the component), but not emag-proof.
@@ -254,7 +254,6 @@
/obj/item/defibrillator/compact/advanced/attackby(obj/item/W, mob/user, params)
if(W == paddles)
paddles.unwield()
toggle_paddles()
update_icon(UPDATE_OVERLAYS)
@@ -272,7 +271,7 @@
//paddles
/obj/item/twohanded/shockpaddles
/obj/item/shockpaddles
name = "defibrillator paddles"
desc = "A pair of plastic-gripped paddles with flat metal surfaces that are used to deliver powerful electric shocks."
icon = 'icons/obj/defib.dmi'
@@ -291,9 +290,11 @@
/// Whether or not the paddles are on cooldown. Used for tracking icon states.
var/on_cooldown = FALSE
/obj/item/twohanded/shockpaddles/New(mainunit)
/obj/item/shockpaddles/New(mainunit)
. = ..()
if(check_defib_exists(mainunit, src))
if(check_defib_exists(mainunit, null, src))
defib = mainunit
loc = defib
update_icon(UPDATE_ICON_STATE)
@@ -303,22 +304,25 @@
RegisterSignal(src, COMSIG_DEFIB_READY, PROC_REF(on_cooldown_expire))
RegisterSignal(src, COMSIG_DEFIB_SHOCK_APPLIED, PROC_REF(after_shock))
RegisterSignal(src, COMSIG_DEFIB_PADDLES_APPLIED, PROC_REF(on_application))
AddComponent(/datum/component/two_handed)
/obj/item/twohanded/shockpaddles/Destroy()
/obj/item/shockpaddles/Destroy()
defib = null
return ..()
/// Check to see if we should abort this before we've even gotten started
/obj/item/twohanded/shockpaddles/proc/on_application(obj/item/paddles, mob/living/user, mob/living/carbon/human/target, should_cause_harm)
/obj/item/shockpaddles/proc/on_application(obj/item/paddles, mob/living/user, mob/living/carbon/human/target, should_cause_harm)
SIGNAL_HANDLER // COMSIG_DEFIB_PADDLES_APPLIED
if(!wielded)
if(!HAS_TRAIT(src, TRAIT_WIELDED))
to_chat(user, "<span class='boldnotice'>You need to wield the paddles in both hands before you can use them on someone!</span>")
return COMPONENT_BLOCK_DEFIB_MISC
if(!defib.powered)
return COMPONENT_BLOCK_DEFIB_DEAD
/obj/item/twohanded/shockpaddles/proc/on_cooldown_expire(obj/item/paddles)
return
/obj/item/shockpaddles/proc/on_cooldown_expire(obj/item/paddles)
SIGNAL_HANDLER // COMSIG_DEFIB_READY
on_cooldown = FALSE
if(defib.cell)
@@ -331,46 +335,43 @@
update_icon(UPDATE_ICON_STATE)
defib.update_icon(UPDATE_ICON_STATE)
/obj/item/twohanded/shockpaddles/proc/after_shock()
/obj/item/shockpaddles/proc/after_shock()
SIGNAL_HANDLER // COMSIG_DEFIB_SHOCK_APPLIED
on_cooldown = TRUE
defib.deductcharge(revivecost)
update_icon(UPDATE_ICON_STATE)
/obj/item/twohanded/shockpaddles/update_icon_state()
/obj/item/shockpaddles/update_icon_state()
var/wielded = HAS_TRAIT(src, TRAIT_WIELDED)
icon_state = "[base_icon_state][wielded]"
item_state = "[base_icon_state][wielded]"
if(on_cooldown)
icon_state = "[base_icon_state][wielded]_cooldown"
/obj/item/twohanded/shockpaddles/suicide_act(mob/user)
/obj/item/shockpaddles/suicide_act(mob/user)
user.visible_message("<span class='danger'>[user] is putting the live paddles on [user.p_their()] chest! It looks like [user.p_theyre()] trying to commit suicide.</span>")
defib.deductcharge(revivecost)
playsound(get_turf(src), 'sound/machines/defib_zap.ogg', 50, 1, -1)
return OXYLOSS
/obj/item/twohanded/shockpaddles/dropped(mob/user)
/obj/item/shockpaddles/dropped(mob/user)
..()
if(user)
var/obj/item/twohanded/offhand/O = user.get_inactive_hand()
if(istype(O))
O.unwield()
to_chat(user, "<span class='notice'>The paddles snap back into the main unit.</span>")
defib.paddles_on_defib = TRUE
loc = defib
defib.update_icon(UPDATE_OVERLAYS)
update_icon(UPDATE_ICON_STATE)
unwield(user)
/obj/item/twohanded/shockpaddles/on_mob_move(dir, mob/user)
/obj/item/shockpaddles/on_mob_move(dir, mob/user)
if(defib)
var/turf/t = get_turf(defib)
if(!t.Adjacent(user))
defib.remove_paddles(user)
/obj/item/twohanded/shockpaddles/proc/check_defib_exists(mainunit, mob/living/carbon/human/M, obj/O)
/obj/item/shockpaddles/proc/check_defib_exists(mainunit, mob/living/carbon/human/M, obj/O)
if(!mainunit || !istype(mainunit, /obj/item/defibrillator)) //To avoid weird issues from admin spawns
M.unEquip(O)
M?.unEquip(O)
qdel(O)
return FALSE
else
@@ -409,14 +410,14 @@
playsound(get_turf(src), 'sound/machines/defib_ready.ogg', 50, 0)
update_icon(UPDATE_ICON_STATE)
/obj/item/twohanded/shockpaddles/syndicate
/obj/item/shockpaddles/syndicate
name = "combat defibrillator paddles"
desc = "A pair of high-tech paddles with flat plasteel surfaces to revive deceased operatives (unless they exploded). They possess both the ability to penetrate armor and to deliver powerful or disabling shocks offensively."
icon_state = "syndiepaddles0"
item_state = "syndiepaddles0"
base_icon_state = "syndiepaddles"
/obj/item/twohanded/shockpaddles/advanced
/obj/item/shockpaddles/advanced
name = "advanced defibrillator paddles"
desc = "A pair of high-tech paddles with flat plasteel surfaces that are used to deliver powerful electric shocks. They possess the ability to penetrate armor to deliver shock."
icon_state = "ntpaddles0"
+27 -19
View File
@@ -4,7 +4,7 @@
* Improvised garrotes
*/
/obj/item/twohanded/garrote // 12TC traitor item
/obj/item/garrote // 12TC traitor item
name = "fiber wire"
desc = "A length of razor-thin wire with an elegant wooden handle on either end.<br>You suspect you'd have to be behind the target to use this weapon effectively."
icon_state = "garrot_wrap"
@@ -13,35 +13,43 @@
var/improvised = FALSE
var/garrote_time
/obj/item/twohanded/garrote/Destroy()
/obj/item/garrote/Initialize(mapload)
. = ..()
AddComponent(/datum/component/two_handed)
/obj/item/garrote/Destroy()
strangling = null
return ..()
/obj/item/twohanded/garrote/update_icon_state()
/obj/item/garrote/update_icon_state()
if(strangling) // If we're strangling someone we want our icon to stay wielded
icon_state = "garrot_[improvised ? "I_" : ""]unwrap"
else
icon_state = "garrot_[improvised ? "I_" : ""][wielded ? "un" : ""]wrap"
icon_state = "garrot_[improvised ? "I_" : ""][HAS_TRAIT(src, TRAIT_WIELDED) ? "un" : ""]wrap"
/obj/item/twohanded/garrote/improvised // Made via tablecrafting
/obj/item/garrote/improvised // Made via tablecrafting
name = "garrote"
desc = "A length of cable with a shoddily-carved wooden handle tied to either end.<br>You suspect you'd have to be behind the target to use this weapon effectively."
icon_state = "garrot_I_wrap"
improvised = TRUE
/obj/item/twohanded/garrote/wield(mob/living/carbon/user)
if(strangling)
user.visible_message("<span class='notice'>[user] removes [src] from [strangling]'s neck.</span>",
"<span class='warning'>You remove [src] from [strangling]'s neck.</span>")
/obj/item/garrote/improvised/Initialize(mapload)
. = ..()
AddComponent(/datum/component/two_handed, wield_callback = CALLBACK(src, PROC_REF(wield)))
strangling = null
update_icon(UPDATE_ICON_STATE)
STOP_PROCESSING(SSobj, src)
else
..()
/obj/item/garrote/proc/wield(obj/item/source, mob/living/carbon/user)
if(!strangling)
return
user.visible_message("<span class='notice'>[user] removes [src] from [strangling]'s neck.</span>",
"<span class='warning'>You remove [src] from [strangling]'s neck.</span>")
/obj/item/twohanded/garrote/attack(mob/living/carbon/M as mob, mob/user as mob)
strangling = null
update_icon(UPDATE_ICON_STATE)
STOP_PROCESSING(SSobj, src)
/obj/item/garrote/attack(mob/living/carbon/M as mob, mob/user as mob)
if(garrote_time > world.time) // Cooldown
return
@@ -50,7 +58,7 @@
var/mob/living/carbon/human/U = user
if(!wielded)
if(!HAS_TRAIT(src, TRAIT_WIELDED))
to_chat(user, "<span class = 'warning'>You must use both hands to garrote [M]!</span>")
return
@@ -73,7 +81,7 @@
to_chat(user, "<span class = 'warning'>You cannot use [src] on two people at once!</span>")
return
unwield(U)
attack_self(user)
U.swap_hand() // For whatever reason the grab will not properly work if we don't have the free hand active.
var/obj/item/grab/G = M.grabbedby(U, 1)
@@ -101,7 +109,7 @@
return
/obj/item/twohanded/garrote/process()
/obj/item/garrote/process()
if(!strangling)
// Our mark got gibbed or similar
update_icon(UPDATE_ICON_STATE)
@@ -160,7 +168,7 @@
strangling.apply_damage(4, OXY, "head")
/obj/item/twohanded/garrote/suicide_act(mob/user)
/obj/item/garrote/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is wrapping [src] around [user.p_their()] neck and pulling the handles! It looks like [user.p_theyre()] trying to commit suicide.</span>")
playsound(loc, 'sound/weapons/cablecuff.ogg', 15, 1, -10, ignore_walls = FALSE)
return OXYLOSS
@@ -201,7 +201,7 @@
user.adjustBrainLoss(10)
else
to_chat(user, "<span class='notice'>You attach the ends of the two energy swords, making a single double-bladed weapon! You're cool.</span>")
var/obj/item/twohanded/dualsaber/newSaber = new /obj/item/twohanded/dualsaber(user.loc)
var/obj/item/dualsaber/newSaber = new /obj/item/dualsaber(user.loc)
if(src.hacked) // That's right, we'll only check the "original" esword.
newSaber.hacked = TRUE
newSaber.item_color = "rainbow"
+35 -30
View File
@@ -1,4 +1,4 @@
/obj/item/twohanded/staff
/obj/item/staff
name = "wizards staff"
desc = "Apparently a staff used by the wizard."
icon = 'icons/obj/wizard.dmi'
@@ -12,61 +12,66 @@
attack_verb = list("bludgeoned", "whacked", "disciplined")
resistance_flags = FLAMMABLE
/obj/item/twohanded/staff/broom
/obj/item/staff/Initialize(mapload)
. = ..()
AddComponent(/datum/component/two_handed)
/obj/item/staff/broom
name = "broom"
desc = "Used for sweeping, and flying into the night while cackling. Black cat not included."
icon = 'icons/obj/wizard.dmi'
icon_state = "broom"
item_state = "broom0"
/obj/item/twohanded/staff/broom/attack_self(mob/user as mob)
..()
item_state = "broom[wielded ? 1 : 0]"
force = wielded ? 5 : 3
attack_verb = wielded ? list("rammed into", "charged at") : list("bludgeoned", "whacked", "cleaned")
if(user)
user.update_inv_l_hand()
user.update_inv_r_hand()
if(user.mind in SSticker.mode.wizards)
user.flying = wielded ? 1 : 0
if(wielded)
to_chat(user, "<span class='notice'>You hold \the [src] between your legs.</span>")
user.say("QUID 'ITCH")
animate(user, pixel_y = pixel_y + 10 , time = 10, loop = 1, easing = SINE_EASING)
else
animate(user, pixel_y = pixel_y + 10 , time = 1, loop = 1)
animate(user, pixel_y = pixel_y, time = 10, loop = 1, easing = SINE_EASING)
animate(user)
else
if(wielded)
to_chat(user, "<span class='notice'>You hold \the [src] between your legs.</span>")
/obj/item/staff/broom/Initialize(mapload)
. = ..()
AddComponent(/datum/component/two_handed, force_wielded = 5, force_unwielded = 3, wield_callback = CALLBACK(src, PROC_REF(wield)), unwield_callback = CALLBACK(src, PROC_REF(unwield)))
/obj/item/twohanded/staff/broom/attackby(obj/O, mob/user)
/obj/item/staff/broom/proc/wield(obj/item/source, mob/user)
attack_verb = list("rammed into", "charged at")
user.update_inv_l_hand()
user.update_inv_r_hand()
if(iswizard(user))
user.flying = TRUE
user.say("QUID 'ITCH")
animate(user, pixel_y = pixel_y + 10 , time = 10, loop = 1, easing = SINE_EASING)
to_chat(user, "<span class='notice'>You hold [src] between your legs.</span>")
/obj/item/staff/broom/proc/unwield(obj/item/source, mob/user)
attack_verb = list("bludgeoned", "whacked", "cleaned")
user.update_inv_l_hand()
user.update_inv_r_hand()
if(iswizard(user))
animate(user, pixel_y = pixel_y + 10 , time = 1, loop = 1)
animate(user, pixel_y = pixel_y, time = 10, loop = 1, easing = SINE_EASING)
animate(user)
/obj/item/staff/broom/attackby(obj/O, mob/user)
if(istype(O, /obj/item/clothing/mask/horsehead))
new/obj/item/twohanded/staff/broom/horsebroom(get_turf(src))
new/obj/item/staff/broom/horsebroom(get_turf(src))
user.unEquip(O)
qdel(O)
qdel(src)
return
..()
/obj/item/twohanded/staff/broom/dropped(mob/user)
/obj/item/staff/broom/dropped(mob/user)
if((user.mind in SSticker.mode.wizards) && user.flying)
user.flying = FALSE
..()
/obj/item/twohanded/staff/broom/horsebroom
/obj/item/staff/broom/horsebroom
name = "broomstick horse"
desc = "Saddle up!"
icon = 'icons/obj/wizard.dmi'
icon_state = "horsebroom"
item_state = "horsebroom0"
/obj/item/twohanded/staff/broom/horsebroom/attack_self(mob/user as mob)
/obj/item/staff/broom/horsebroom/attack_self(mob/user as mob)
..()
item_state = "horsebroom[wielded ? 1 : 0]"
item_state = "horsebroom[HAS_TRAIT(src, TRAIT_WIELDED) ? 1 : 0]"
/obj/item/twohanded/staff/stick
/obj/item/staff/stick
name = "stick"
desc = "A great tool to drag someone else's drinks across the bar."
icon_state = "stick"
@@ -636,10 +636,10 @@
new /obj/item/organ/internal/cyberimp/arm/katana(src)
value += 1
if(3)
new /obj/item/twohanded/mjollnir(src)
new /obj/item/mjollnir(src)
value += 2
if(4)
new /obj/item/twohanded/singularityhammer(src)
new /obj/item/singularityhammer(src)
value += 2
if(5)
new /obj/item/katana(src)
@@ -648,13 +648,13 @@
new /obj/item/claymore(src)
value += 2 //force 40 this is value 2
if(7)
new /obj/item/twohanded/spear/grey_tide(src)
new /obj/item/spear/grey_tide(src)
value += 2 //Value 2, clones are strong
if(8)
if(prob(50))
new /obj/item/sord(src)
value -= 1 //Useless joke, might as well give them a value point back.
new /obj/item/twohanded/bostaff(src) //Funky item, not really worth a point, but good to balance sord's free point out
new /obj/item/bostaff(src) //Funky item, not really worth a point, but good to balance sord's free point out
//Wands
var/wands = 0
while(wands < 2)
@@ -515,7 +515,7 @@
/obj/item/holosign_creator/janitor,
/obj/item/melee/flyswatter,
/obj/item/storage/bag/trash,
/obj/item/twohanded/push_broom,
/obj/item/push_broom,
/obj/item/door_remote/janikeyring
)
@@ -25,7 +25,7 @@
/obj/item/suppressor, // 1TC
/obj/item/ammo_box/magazine/m10mm, // 1TC
/obj/item/ammo_box/magazine/m10mm/hp, // 2TC
/obj/item/twohanded/garrote, // 6TC
/obj/item/garrote, // 6TC
/obj/item/door_remote/omni/access_tuner, // 6TC
/obj/item/clothing/glasses/chameleon/thermal, // 6TC
/obj/item/implanter/freedom, // 5TC
File diff suppressed because it is too large Load Diff
+2 -5
View File
@@ -125,12 +125,9 @@
/obj/item/wirerod/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/shard))
var/obj/item/twohanded/spear/S = new /obj/item/twohanded/spear
var/obj/item/spear/S = new /obj/item/spear
if(istype(I, /obj/item/shard/plasma))
S.force_wielded = 19
S.force_unwielded = 11
S.throwforce = 21
S.icon_prefix = "spearplasma"
S.add_plasmaglass()
S.update_icon()
if(!remove_item_from_storage(user))
user.unEquip(src)
+12 -14
View File
@@ -17,20 +17,22 @@
if(used)
to_chat(user, "<span class='warning'>The whetstone is too worn to use again!</span>")
return
if(I.force >= max || I.throwforce >= max)//no esword sharpening
to_chat(user, "<span class='warning'>[I] is much too powerful to sharpen further!</span>")
return
if(requires_sharpness && !I.sharp)
to_chat(user, "<span class='warning'>You can only sharpen items that are already sharp, such as knives!</span>")
return
if(istype(I, /obj/item/twohanded))//some twohanded items should still be sharpenable, but handle force differently. therefore i need this stuff
var/obj/item/twohanded/TH = I
if(TH.force_wielded >= max || TH.force_wielded > initial(TH.force_wielded))
to_chat(user, "<span class='warning'>[TH] is much too powerful to sharpen further!</span>")
return
TH.force_wielded = clamp(TH.force_wielded + increment, 0, max)//wieldforce is increased since normal force wont stay
TH.force_unwielded = clamp(TH.force_unwielded + increment, 0, max)
var/signal_out = SEND_SIGNAL(I, COMSIG_ITEM_SHARPEN_ACT, increment, max)
if((signal_out & COMPONENT_BLOCK_SHARPEN_MAXED) || I.force >= max || I.throwforce >= max) //If the item's components enforce more limits on maximum power from sharpening, we fail
to_chat(user, "<span class='warning'>[I] is much too powerful to sharpen further!</span>")
return
if(signal_out & COMPONENT_BLOCK_SHARPEN_BLOCKED)
to_chat(user, "<span class='warning'>[I] is not able to be sharpened right now!</span>")
return
if((signal_out & COMPONENT_BLOCK_SHARPEN_ALREADY) || (I.force > initial(I.force) && !(signal_out & COMPONENT_SHARPEN_APPLIED))) //No sharpening stuff twice
to_chat(user, "<span class='warning'>[I] has already been refined before. It cannot be sharpened further!</span>")
return
if(!(signal_out & COMPONENT_SHARPEN_APPLIED)) //If the item has a relevant component and COMPONENT_BLOCK_SHARPEN_APPLIED is returned, the item only gets the throw force increase
I.force = clamp(I.force + increment, 0, max)
if(istype(I, /obj/item/melee/energy))
var/obj/item/melee/energy/E = I
if(E.force_on > initial(E.force_on) || (E.force > initial(E.force)))
@@ -41,13 +43,9 @@
E.force_on = clamp(E.force_on + increment, 0, max)
E.force_off = clamp(E.force_off + increment, 0, max)
if(I.force > initial(I.force))
to_chat(user, "<span class='warning'>[I] has already been refined before. It cannot be sharpened further!</span>")
return
user.visible_message("<span class='notice'>[user] sharpens [I] with [src]!</span>", "<span class='notice'>You sharpen [I], making it much more deadly than before.</span>")
if(!requires_sharpness)
set_sharpness(TRUE)
I.force = clamp(I.force + increment, 0, max)
I.throwforce = clamp(I.throwforce + increment, 0, max)
I.name = "[prefix] [I.name]"
playsound(get_turf(src), usesound, 50, 1)
@@ -2,7 +2,7 @@
/obj/structure/closet/fireaxecabinet
name = "fire axe cabinet"
desc = "There is small label that reads \"For Emergency use only\" along with details for safe use of the axe. As if."
var/obj/item/twohanded/fireaxe/fireaxe
var/obj/item/fireaxe/fireaxe
icon_state = "fireaxe_full_0hits"
icon_closed = "fireaxe_full_0hits"
icon_opened = "fireaxe_full_open"
@@ -18,7 +18,7 @@
var/has_axe = null // Use a string over a boolean value to make the sprite names more readable
/obj/structure/closet/fireaxecabinet/populate_contents()
fireaxe = new/obj/item/twohanded/fireaxe(src)
fireaxe = new/obj/item/fireaxe(src)
has_axe = "full"
update_icon(UPDATE_ICON_STATE) // So its initial icon doesn't show it without the fireaxe
@@ -60,10 +60,10 @@
localopened = TRUE
update_icon(UPDATE_ICON_STATE)
return
if(istype(O, /obj/item/twohanded/fireaxe) && localopened)
if(istype(O, /obj/item/fireaxe) && localopened)
if(!fireaxe)
var/obj/item/twohanded/fireaxe/F = O
if(F.wielded)
var/obj/item/fireaxe/F = O
if(HAS_TRAIT(F, TRAIT_WIELDED))
to_chat(user, "<span class='warning'>Unwield \the [F] first.</span>")
return
if(!user.unEquip(F, FALSE))
@@ -83,8 +83,8 @@
new /obj/item/caution(src)
new /obj/item/caution(src)
new /obj/item/caution(src)
new /obj/item/twohanded/push_broom(src)
new /obj/item/twohanded/push_broom(src)
new /obj/item/push_broom(src)
new /obj/item/push_broom(src)
new /obj/item/storage/bag/trash(src)
new /obj/item/storage/bag/trash(src)
new /obj/item/lightreplacer(src)
+1 -1
View File
@@ -116,7 +116,7 @@
to_chat(user, "<span class='warning'>You must wait until the door has stopped moving.</span>")
return
if(istype(W, /obj/item/gun/energy/plasmacutter) || istype(W, /obj/item/pickaxe/drill/diamonddrill) || istype(W, /obj/item/pickaxe/drill/jackhammer) || istype(W, /obj/item/melee/energy/blade) || istype(W, /obj/item/twohanded/required/pyro_claws))
if(istype(W, /obj/item/gun/energy/plasmacutter) || istype(W, /obj/item/pickaxe/drill/diamonddrill) || istype(W, /obj/item/pickaxe/drill/jackhammer) || istype(W, /obj/item/melee/energy/blade) || istype(W, /obj/item/pyro_claws))
dismantle(user, TRUE)
/obj/structure/falsewall/attack_animal(mob/living/simple_animal/M)
+11 -11
View File
@@ -254,7 +254,7 @@
icon_state = "fullgrass_[rand(1, 3)]"
/obj/item/twohanded/required/kirbyplants
/obj/item/kirbyplants
name = "potted plant"
icon = 'icons/obj/flora/plants.dmi'
icon_state = "plant-1"
@@ -262,59 +262,59 @@
layer = ABOVE_MOB_LAYER
w_class = WEIGHT_CLASS_HUGE
force = 10
force_wielded = 10
throwforce = 13
throw_speed = 2
throw_range = 4
/// Method to track plant overlay on mob for later removal
var/mutable_appearance/mob_overlay
/obj/item/twohanded/required/kirbyplants/Initialize(mapload)
/obj/item/kirbyplants/Initialize(mapload)
. = ..()
icon_state = "plant-[rand(1,35)]"
if(prob(1))
icon_state = "plant-36"
AddComponent(/datum/component/two_handed, require_twohands = TRUE)
/obj/item/twohanded/required/kirbyplants/Destroy()
/obj/item/kirbyplants/Destroy()
if(iscarbon(loc))
unhide_user(loc)
QDEL_NULL(mob_overlay)
return ..()
/obj/item/twohanded/required/kirbyplants/equipped(mob/living/carbon/user)
/obj/item/kirbyplants/equipped(mob/living/carbon/user)
. = ..()
if(wielded)
if(HAS_TRAIT(src, TRAIT_WIELDED))
hide_user(user)
return
unhide_user(user)
/// User has decided to hold a plant, apply stealth.
/obj/item/twohanded/required/kirbyplants/proc/hide_user(mob/living/carbon/user)
/obj/item/kirbyplants/proc/hide_user(mob/living/carbon/user)
RegisterSignal(user, COMSIG_CARBON_REGENERATE_ICONS, PROC_REF(reapply_hide))
mob_overlay = mutable_appearance(icon, icon_state, user.layer, user.plane, 255, appearance_flags = RESET_COLOR | RESET_TRANSFORM | RESET_ALPHA | KEEP_APART)
user.add_overlay(mob_overlay)
user.alpha = 0
/// User has either dropped the plant, or plant is being destroyed, restore user to normal.
/obj/item/twohanded/required/kirbyplants/proc/unhide_user(mob/living/carbon/user)
/obj/item/kirbyplants/proc/unhide_user(mob/living/carbon/user)
UnregisterSignal(user, COMSIG_CARBON_REGENERATE_ICONS)
user.cut_overlay(mob_overlay)
user.alpha = initial(user.alpha)
QDEL_NULL(mob_overlay)
/// Icon operation has occured, time to make sure we're showing a plant again if we need to be.
/obj/item/twohanded/required/kirbyplants/proc/reapply_hide(mob/living/carbon/user)
/obj/item/kirbyplants/proc/reapply_hide(mob/living/carbon/user)
SIGNAL_HANDLER
// Reset the state of the user
unhide_user(user)
hide_user(user)
/obj/item/twohanded/required/kirbyplants/dropped(mob/living/carbon/user)
/obj/item/kirbyplants/dropped(mob/living/carbon/user)
..()
unhide_user(user)
/obj/item/twohanded/required/kirbyplants/dead
/obj/item/kirbyplants/dead
name = "\improper RD's potted plant"
desc = "A gift from the botanical staff, presented after the RD's reassignment. There's a tag on it that says \"Y'all come back now, y'hear?\"\nIt doesn't look very healthy..."
icon_state = "plant-dead"
+1 -1
View File
@@ -64,7 +64,7 @@
refundMetal(metalUsed)
qdel(src)
else if(istype(W, /obj/item/twohanded/required/pyro_claws))
else if(istype(W, /obj/item/pyro_claws))
playsound(loc, W.usesound, 100, 1)
to_chat(user, "<span class='notice'>You melt the girder!</span>")
refundMetal(metalUsed)
+3 -3
View File
@@ -15,7 +15,7 @@
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
var/obj/item/storage/bag/trash/mybag = null
var/obj/item/mop/mymop = null
var/obj/item/twohanded/push_broom/mybroom = null
var/obj/item/push_broom/mybroom = null
var/obj/item/reagent_containers/spray/cleaner/myspray = null
var/obj/item/lightreplacer/myreplacer = null
var/signs = 0
@@ -59,9 +59,9 @@
m.janicart_insert(user, src)
else
to_chat(user, fail_msg)
else if(istype(I, /obj/item/twohanded/push_broom))
else if(istype(I, /obj/item/push_broom))
if(!mybroom)
var/obj/item/twohanded/push_broom/B = I
var/obj/item/push_broom/B = I
B.janicart_insert(user, src)
else
to_chat(user, fail_msg)