Merge branch 'tool_behavior-replacing' of https://github.com/SandPoot/Citadel-Station-13 into tool_behavior-replacing

This commit is contained in:
SandPoot
2021-02-18 15:04:22 -03:00
223 changed files with 1458 additions and 737 deletions
@@ -43,14 +43,13 @@
// This exists so Hardened/Silver Stake can't have a welding torch used on them.
/obj/item/stake/basic/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weldingtool))
if(W.tool_behaviour == TOOL_WELDER)
//if (amWelded)
// to_chat(user, "<span class='warning'>This stake has already been treated with fire.</span>")
// return
//amWelded = TRUE
// Weld it
var/obj/item/weldingtool/WT = W
if(WT.use(0))//remove_fuel(0,user))
if(W.use(0))//remove_fuel(0,user))
user.visible_message("[user.name] scorched the pointy end of [src] with the welding tool.", \
"<span class='notice'>You scorch the pointy end of [src] with the welding tool.</span>", \
"<span class='italics'>You hear welding.</span>")
@@ -164,11 +164,11 @@
if(istype(W, cutting_tool))
to_chat(user, "<span class='notice'>This is a much more complex mechanical structure than you thought. You don't know where to begin cutting [src].</span>")
return
else if(anchored && istype(W, /obj/item/wrench)) // Can't unanchor unless owner.
else if(anchored && W.tool_behaviour == TOOL_WRENCH) // Can't unanchor unless owner.
to_chat(user, "<span class='danger'>The coffin won't come unanchored from the floor.</span>")
return
if(locked && istype(W, /obj/item/crowbar))
if(locked && W.tool_behaviour == TOOL_CROWBAR)
var/pry_time = pryLidTimer * W.toolspeed // Pry speed must be affected by the speed of the tool.
user.visible_message("<span class='notice'>[user] tries to pry the lid off of [src] with [W].</span>", \
"<span class='notice'>You begin prying the lid off of [src] with [W]. This should take about [DisplayTimeText(pry_time)].</span>")
@@ -95,7 +95,7 @@
return ..()
/obj/structure/destructible/clockwork/attackby(obj/item/I, mob/user, params)
if(is_servant_of_ratvar(user) && istype(I, /obj/item/wrench) && unanchored_icon)
if(is_servant_of_ratvar(user) && I.tool_behaviour == TOOL_WRENCH && unanchored_icon)
if(default_unfasten_wrench(user, I, 50) == SUCCESSFUL_UNFASTEN)
update_anchored(user)
return 1
@@ -23,10 +23,10 @@
return
/obj/structure/destructible/clockwork/wall_gear/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench))
if(I.tool_behaviour == TOOL_WRENCH)
default_unfasten_wrench(user, I, 10)
return 1
else if(istype(I, /obj/item/screwdriver))
else if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(anchored)
to_chat(user, "<span class='warning'>[src] needs to be unsecured to disassemble it!</span>")
else
@@ -104,7 +104,7 @@
switch(deconstruction_state)
if(NUKESTATE_INTACT)
if(istype(I, /obj/item/screwdriver/nuke))
if(istype(I, /obj/item/screwdriver/nuke)) //Special case, cannot replace with tool_behavior
to_chat(user, "<span class='notice'>You start removing [src]'s front panel's screws...</span>")
if(I.use_tool(src, user, 60, volume=100))
deconstruction_state = NUKESTATE_UNSCREWED
+1 -1
View File
@@ -43,7 +43,7 @@
to_chat(user, "<span class='notice'>Picking up the swarmer may cause it to activate. You should be careful about this.</span>")
/obj/effect/mob_spawn/swarmer/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/screwdriver) && user.a_intent != INTENT_HARM)
if(W.tool_behaviour == TOOL_SCREWDRIVER && user.a_intent != INTENT_HARM)
user.visible_message("<span class='warning'>[usr.name] deactivates [src].</span>",
"<span class='notice'>After some fiddling, you find a way to disable [src]'s power source.</span>",
"<span class='italics'>You hear clicking.</span>")
@@ -354,9 +354,14 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
var/obj/effect/countdown/doomsday/countdown
var/detonation_timer
var/next_announce
var/mob/living/silicon/ai/owner
/obj/machinery/doomsday_device/Initialize()
. = ..()
owner = loc
if(!istype(owner))
stack_trace("Doomsday created outside an AI somehow, shit's fucking broke. Anyway, we're just gonna qdel now. Go make a github issue report.")
qdel(src)
countdown = new(src)
/obj/machinery/doomsday_device/Destroy()
@@ -364,6 +369,9 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
STOP_PROCESSING(SSfastprocess, src)
SSshuttle.clearHostileEnvironment(src)
SSmapping.remove_nuke_threat(src)
for(var/mob/living/silicon/robot/borg in owner.connected_robots)
borg.lamp_doom = FALSE
borg.toggle_headlamp(FALSE, TRUE) //forces borg lamp to update
for(var/A in GLOB.ai_list)
var/mob/living/silicon/ai/AI = A
if(AI.doomsday_device == src)
@@ -378,6 +386,9 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
START_PROCESSING(SSfastprocess, src)
SSshuttle.registerHostileEnvironment(src)
SSmapping.add_nuke_threat(src) //This causes all blue "circuit" tiles on the map to change to animated red icon state.
for(var/mob/living/silicon/robot/borg in owner.connected_robots)
borg.lamp_doom = TRUE
borg.toggle_headlamp(FALSE, TRUE) //forces borg lamp to update
/obj/machinery/doomsday_device/proc/seconds_remaining()
. = max(0, (round((detonation_timer - world.time) / 10)))