mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Makes the armblade handle more like the fireaxe with opening doors (#20313)
* armblade tweaks * mistaken regression * farie's review * early return * Update code/game/machinery/doors/airlock.dm Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> --------- Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
This commit is contained in:
@@ -206,6 +206,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
|
||||
//***** ITEM TRAITS *****//
|
||||
#define TRAIT_BUTCHERS_HUMANS "butchers_humans"
|
||||
#define TRAIT_CMAGGED "cmagged"
|
||||
/// Forces open doors after a delay specific to the item
|
||||
#define TRAIT_FORCES_OPEN_DOORS_ITEM "forces_open_doors_item_varient"
|
||||
|
||||
/// A surgical tool; when in hand in help intent (and with a surgery in progress) won't attack the user
|
||||
#define TRAIT_SURGICAL "surgical_tool"
|
||||
|
||||
@@ -70,12 +70,14 @@ GLOBAL_LIST_INIT(traits_by_type, list(
|
||||
"TRAIT_ELITE_CHALLENGER" = TRAIT_ELITE_CHALLENGER,
|
||||
"TRAIT_SOAPY_MOUTH" = TRAIT_SOAPY_MOUTH,
|
||||
"TRAIT_UNREVIVABLE" = TRAIT_UNREVIVABLE,
|
||||
"TRAIT_SHOW_WIRE_INFO" = TRAIT_SHOW_WIRE_INFO
|
||||
"TRAIT_SHOW_WIRE_INFO" = TRAIT_SHOW_WIRE_INFO,
|
||||
"TRAIT_CAN_BE_EATEN_BY_LIZARDS" = TRAIT_EDIBLE_BUG
|
||||
),
|
||||
/obj/item = list(
|
||||
"TRAIT_SHOW_WIRE_INFO" = TRAIT_SHOW_WIRE_INFO,
|
||||
"TRAIT_BUTCHER_HUMANS" = TRAIT_BUTCHERS_HUMANS,
|
||||
"TRAIT_CMAGGED" = TRAIT_CMAGGED
|
||||
"TRAIT_CMAGGED" = TRAIT_CMAGGED,
|
||||
"TRAIT_FORCES_OPEN_DOORS" = TRAIT_FORCES_OPEN_DOORS_ITEM
|
||||
)
|
||||
))
|
||||
|
||||
|
||||
@@ -1161,20 +1161,8 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
|
||||
/obj/machinery/door/airlock/try_to_crowbar(mob/living/user, obj/item/I)
|
||||
if(operating)
|
||||
return
|
||||
if(istype(I, /obj/item/twohanded/fireaxe)) //let's make this more specific //FUCK YOU
|
||||
var/obj/item/twohanded/fireaxe/F = I
|
||||
if(F.wielded)
|
||||
if(density && !prying_so_hard)
|
||||
playsound(src, 'sound/machines/airlock_alien_prying.ogg', 100, 1) //is it aliens or just the CE being a dick?
|
||||
prying_so_hard = TRUE //so you dont pry the door when you are already trying to pry it
|
||||
var/result = do_after(user, 5 SECONDS, target = src)
|
||||
prying_so_hard = FALSE
|
||||
if(result)
|
||||
open(TRUE)
|
||||
if(density && !open(TRUE))
|
||||
to_chat(user, "<span class='warning'>Despite your attempts, [src] refuses to open.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need to be wielding the fire axe to do that!</span>")
|
||||
if(HAS_TRAIT(I, TRAIT_FORCES_OPEN_DOORS_ITEM))
|
||||
force_open_with_item(user, I)
|
||||
return
|
||||
var/beingcrowbarred = FALSE
|
||||
if(I.tool_behaviour == TOOL_CROWBAR && I.tool_use_check(user, 0))
|
||||
@@ -1220,6 +1208,33 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
|
||||
if(density && !open(1))
|
||||
to_chat(user, "<span class='warning'>Despite your attempts, [src] refuses to open.</span>")
|
||||
|
||||
/obj/machinery/door/airlock/proc/force_open_with_item(mob/living/user, obj/item/I)
|
||||
/// Used with an istype check to find out if it's a wielded item or not
|
||||
var/obj/item/twohanded/twohanded_item = I
|
||||
/// Time it takes to open an airlock with an item with the TRAIT_FORCES_OPEN_DOORS_ITEM trait, 5 seconds for wielded items, 10 seconds for nonwielded items
|
||||
var/time_to_open_airlock = 10 SECONDS
|
||||
/// Can we open the airlock while unpowered? Wielded item's can't, but unwielded items can
|
||||
var/can_force_open_while_unpowered = TRUE
|
||||
if(istype(twohanded_item))
|
||||
can_force_open_while_unpowered = FALSE
|
||||
time_to_open_airlock = 5 SECONDS
|
||||
if(!twohanded_item.wielded)
|
||||
to_chat(user, "<span class='warning'>You need to be wielding [I] to do that!</span>")
|
||||
return
|
||||
if(!density || prying_so_hard)
|
||||
return
|
||||
playsound(src, 'sound/machines/airlock_alien_prying.ogg', 100, 1) //is it aliens or just the CE being a dick?
|
||||
if(!arePowerSystemsOn() && can_force_open_while_unpowered)
|
||||
open(TRUE)
|
||||
return
|
||||
prying_so_hard = TRUE //so you dont pry the door when you are already trying to pry it
|
||||
var/result = do_after(user, time_to_open_airlock, target = src)
|
||||
prying_so_hard = FALSE
|
||||
if(result)
|
||||
open(TRUE)
|
||||
if(density && !open(TRUE))
|
||||
to_chat(user, "<span class='warning'>Despite your attempts, [src] refuses to open.</span>")
|
||||
|
||||
/obj/machinery/door/airlock/open(forced=0)
|
||||
if(operating || welded || locked || emagged)
|
||||
return 0
|
||||
|
||||
@@ -256,12 +256,12 @@
|
||||
if(HAS_TRAIT(src, TRAIT_CMAGGED) && I.can_clean()) //If the cmagged door is being hit with cleaning supplies, don't open it, it's being cleaned!
|
||||
return
|
||||
|
||||
if(user.a_intent != INTENT_HARM && istype(I, /obj/item/twohanded/fireaxe))
|
||||
if(user.a_intent != INTENT_HARM && HAS_TRAIT(I, TRAIT_FORCES_OPEN_DOORS_ITEM))
|
||||
try_to_crowbar(user, I)
|
||||
return 1
|
||||
return TRUE
|
||||
else if(!(I.flags & NOBLUDGEON) && user.a_intent != INTENT_HARM)
|
||||
try_to_activate_door(user)
|
||||
return 1
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/obj/machinery/door/crowbar_act(mob/user, obj/item/I)
|
||||
|
||||
@@ -204,6 +204,10 @@
|
||||
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 100, ACID = 30)
|
||||
resistance_flags = FIRE_PROOF
|
||||
|
||||
/obj/item/twohanded/fireaxe/Initialize(mapload)
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_FORCES_OPEN_DOORS_ITEM, ROUNDSTART_TRAIT)
|
||||
|
||||
/obj/item/twohanded/fireaxe/update_icon_state() //Currently only here to fuck with the on-mob icons.
|
||||
icon_state = "fireaxe[wielded]"
|
||||
|
||||
|
||||
@@ -123,37 +123,22 @@
|
||||
throw_range = 0
|
||||
throw_speed = 0
|
||||
|
||||
/obj/item/melee/arm_blade/Initialize(mapload)
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_FORCES_OPEN_DOORS_ITEM, ROUNDSTART_TRAIT)
|
||||
|
||||
/obj/item/melee/arm_blade/afterattack(atom/target, mob/user, proximity)
|
||||
if(!proximity)
|
||||
return
|
||||
if(istype(target, /obj/structure/table))
|
||||
var/obj/structure/table/T = target
|
||||
T.deconstruct(FALSE)
|
||||
return
|
||||
|
||||
else if(istype(target, /obj/machinery/computer))
|
||||
if(istype(target, /obj/machinery/computer))
|
||||
var/obj/machinery/computer/C = target
|
||||
C.attack_alien(user) //muh copypasta
|
||||
|
||||
else if(istype(target, /obj/machinery/door/airlock))
|
||||
var/obj/machinery/door/airlock/A = target
|
||||
|
||||
if(!A.requiresID() || A.allowed(user)) //This is to prevent stupid shit like hitting a door with an arm blade, the door opening because you have acces and still getting a "the airlocks motors resist our efforts to force it" message.
|
||||
return
|
||||
|
||||
if(A.locked)
|
||||
to_chat(user, "<span class='notice'>The airlock's bolts prevent it from being forced.</span>")
|
||||
return
|
||||
|
||||
if(A.arePowerSystemsOn())
|
||||
user.visible_message("<span class='warning'>[user] jams [src] into the airlock and starts prying it open!</span>", "<span class='warning'>We start forcing the airlock open.</span>", \
|
||||
"<span class='italics'>You hear a metal screeching sound.</span>")
|
||||
playsound(A, 'sound/machines/airlock_alien_prying.ogg', 150, 1)
|
||||
if(!do_after(user, 100, target = A))
|
||||
return
|
||||
|
||||
//user.say("Heeeeeeeeeerrre's Johnny!")
|
||||
user.visible_message("<span class='warning'>[user] forces the airlock to open with [user.p_their()] [name]!</span>", "<span class='warning'>We force the airlock to open.</span>", "<span class='warning'>You hear a metal screeching sound.</span>")
|
||||
A.open(2)
|
||||
|
||||
/***************************************\
|
||||
|***********COMBAT TENTACLES*************|
|
||||
|
||||
Reference in New Issue
Block a user