mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-22 04:36:53 +01:00
Clones merc simple_animal mobs into the simple_mob format (#5363)
* Planet controller startup delay * Fix the New() on this interfering with my work! * Creates SSplanets subsystem For SPEEDYNESS It probably works. I mean it's hard to sit there for 8 hours and test it. But it seems to work okay. At worst if it doesn't you'll have weather that doesn't make sense. ;v * Reworks weather to fit the faster weather ticker * Allows AIs to produce and control maint/construction/mining drones. (#5282) * Allows AIs to control maint/construction drones. * Radio control online. * Things Not Saving * Drone control respects intellicores. * Config control, AI drones are disableable if the AI isn't an antag. * There's a diff so it must have saved. Right? * No un/wrenching of the core. * Complies to Replies. * Folders props, and adds the laser prism, receptor, and sealed doors. (#5337) * Re-bases props, and adds the laser prism. * Ver 1 of Puzzle Lock and Doors * Doors * Fix door hiccup I made, modify Prism * Converts merc simple_animal to simple_mob
This commit is contained in:
@@ -248,6 +248,6 @@ var/global/list/image/splatter_cache=list()
|
||||
|
||||
//This version should be used for admin spawns and pre-mapped virus vectors (e.g. in PoIs), this version does not dry
|
||||
/obj/effect/decal/cleanable/mucus/mapped/New()
|
||||
...()
|
||||
..()
|
||||
virus2 = new /datum/disease2/disease
|
||||
virus2.makerandom()
|
||||
|
||||
@@ -64,20 +64,24 @@
|
||||
add_attack_logs(user,carded_ai,"Purged from AI Card")
|
||||
flush = 1
|
||||
carded_ai.suiciding = 1
|
||||
carded_ai << "Your power has been disabled!"
|
||||
to_chat(carded_ai, "Your power has been disabled!")
|
||||
while (carded_ai && carded_ai.stat != 2)
|
||||
if(carded_ai.controlling_drone && prob(carded_ai.oxyloss)) //You feel it creeping? Eventually will reach 100, resulting in the second half of the AI's remaining life being lonely.
|
||||
carded_ai.controlling_drone.release_ai_control("Unit lost. Integrity too low to maintain connection.")
|
||||
carded_ai.adjustOxyLoss(2)
|
||||
carded_ai.updatehealth()
|
||||
sleep(10)
|
||||
flush = 0
|
||||
if (href_list["radio"])
|
||||
carded_ai.aiRadio.disabledAi = text2num(href_list["radio"])
|
||||
carded_ai << "<span class='warning'>Your Subspace Transceiver has been [carded_ai.aiRadio.disabledAi ? "disabled" : "enabled"]!</span>"
|
||||
user << "<span class='notice'>You [carded_ai.aiRadio.disabledAi ? "disable" : "enable"] the AI's Subspace Transceiver.</span>"
|
||||
to_chat(carded_ai, "<span class='warning'>Your Subspace Transceiver has been [carded_ai.aiRadio.disabledAi ? "disabled" : "enabled"]!</span>")
|
||||
to_chat(user, "<span class='notice'>You [carded_ai.aiRadio.disabledAi ? "disable" : "enable"] the AI's Subspace Transceiver.</span>")
|
||||
if (href_list["wireless"])
|
||||
carded_ai.control_disabled = text2num(href_list["wireless"])
|
||||
carded_ai << "<span class='warning'>Your wireless interface has been [carded_ai.control_disabled ? "disabled" : "enabled"]!</span>"
|
||||
user << "<span class='notice'>You [carded_ai.control_disabled ? "disable" : "enable"] the AI's wireless interface.</span>"
|
||||
to_chat(carded_ai, "<span class='warning'>Your wireless interface has been [carded_ai.control_disabled ? "disabled" : "enabled"]!</span>")
|
||||
to_chat(user, "<span class='notice'>You [carded_ai.control_disabled ? "disable" : "enable"] the AI's wireless interface.</span>")
|
||||
if(carded_ai.control_disabled && carded_ai.controlling_drone)
|
||||
carded_ai.controlling_drone.release_ai_control("Unit control terminated at intellicore port.")
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
@@ -94,12 +98,12 @@
|
||||
icon_state = "aicard"
|
||||
|
||||
/obj/item/device/aicard/proc/grab_ai(var/mob/living/silicon/ai/ai, var/mob/living/user)
|
||||
if(!ai.client)
|
||||
user << "<span class='danger'>ERROR:</span> AI [ai.name] is offline. Unable to transfer."
|
||||
if(!ai.client && !ai.controlling_drone)
|
||||
to_chat(user, "<span class='danger'>ERROR:</span> AI [ai.name] is offline. Unable to transfer.")
|
||||
return 0
|
||||
|
||||
if(carded_ai)
|
||||
user << "<span class='danger'>Transfer failed:</span> Existing AI found on remote device. Remove existing AI to install a new one."
|
||||
to_chat(user, "<span class='danger'>Transfer failed:</span> Existing AI found on remote device. Remove existing AI to install a new one.")
|
||||
return 0
|
||||
|
||||
if(!user.IsAdvancedToolUser() && isanimal(user))
|
||||
@@ -108,7 +112,9 @@
|
||||
return 0
|
||||
|
||||
user.visible_message("\The [user] starts transferring \the [ai] into \the [src]...", "You start transferring \the [ai] into \the [src]...")
|
||||
ai << "<span class='danger'>\The [user] is transferring you into \the [src]!</span>"
|
||||
to_chat(ai, "<span class='danger'>\The [user] is transferring you into \the [src]!</span>")
|
||||
if(ai.controlling_drone)
|
||||
to_chat(ai.controlling_drone, "<span class='danger'>\The [user] is transferring you into \the [src]!</span>")
|
||||
|
||||
if(do_after(user, 100))
|
||||
if(istype(ai.loc, /turf/))
|
||||
@@ -124,11 +130,13 @@
|
||||
ai.control_disabled = 1
|
||||
ai.aiRestorePowerRoutine = 0
|
||||
carded_ai = ai
|
||||
if(ai.controlling_drone)
|
||||
ai.controlling_drone.release_ai_control("Unit control lost.")
|
||||
|
||||
if(ai.client)
|
||||
ai << "You have been transferred into a mobile core. Remote access lost."
|
||||
to_chat(ai, "You have been transferred into a mobile core. Remote access lost.")
|
||||
if(user.client)
|
||||
user << "<span class='notice'><b>Transfer successful:</b></span> [ai.name] extracted from current device and placed within mobile core."
|
||||
to_chat(ai, "<span class='notice'><b>Transfer successful:</b></span> [ai.name] extracted from current device and placed within mobile core.")
|
||||
|
||||
ai.canmove = 1
|
||||
update_icon()
|
||||
|
||||
@@ -69,17 +69,16 @@
|
||||
im_list_ui[++im_list_ui.len] = list("address" = I["address"], "to_address" = I["to_address"], "im" = I["im"])
|
||||
|
||||
//Weather reports.
|
||||
if(planet_controller)
|
||||
for(var/datum/planet/planet in planet_controller.planets)
|
||||
if(planet.weather_holder && planet.weather_holder.current_weather)
|
||||
var/list/W = list(
|
||||
"Planet" = planet.name,
|
||||
"Time" = planet.current_time.show_time("hh:mm"),
|
||||
"Weather" = planet.weather_holder.current_weather.name,
|
||||
"Temperature" = planet.weather_holder.temperature - T0C,
|
||||
"High" = planet.weather_holder.current_weather.temp_high - T0C,
|
||||
"Low" = planet.weather_holder.current_weather.temp_low - T0C)
|
||||
weather[++weather.len] = W
|
||||
for(var/datum/planet/planet in SSplanets.planets)
|
||||
if(planet.weather_holder && planet.weather_holder.current_weather)
|
||||
var/list/W = list(
|
||||
"Planet" = planet.name,
|
||||
"Time" = planet.current_time.show_time("hh:mm"),
|
||||
"Weather" = planet.weather_holder.current_weather.name,
|
||||
"Temperature" = planet.weather_holder.temperature - T0C,
|
||||
"High" = planet.weather_holder.current_weather.temp_high - T0C,
|
||||
"Low" = planet.weather_holder.current_weather.temp_low - T0C)
|
||||
weather[++weather.len] = W
|
||||
|
||||
injection = "<div>Test</div>"
|
||||
|
||||
|
||||
@@ -53,7 +53,8 @@
|
||||
|
||||
if(explosion_size)
|
||||
on_explosion(O)
|
||||
src.fragmentate(O, num_fragments, spread_range, fragment_types)
|
||||
if(num_fragments)
|
||||
fragmentate(O, num_fragments, spread_range, fragment_types)
|
||||
qdel(src)
|
||||
|
||||
|
||||
@@ -98,3 +99,9 @@
|
||||
num_fragments = 200 //total number of fragments produced by the grenade
|
||||
|
||||
//The radius of the circle used to launch projectiles. Lower values mean less projectiles are used but if set too low gaps may appear in the spread pattern
|
||||
|
||||
// This thing literally just explodes
|
||||
/obj/item/weapon/grenade/explosive/concussion
|
||||
name = "concussion grenade"
|
||||
desc = "A small explosive grenade"
|
||||
num_fragments = 0
|
||||
-9
@@ -6,15 +6,6 @@
|
||||
icon = 'icons/obj/abductor.dmi'
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
var/interaction_message = null
|
||||
|
||||
/obj/structure/prop/alien/attack_hand(mob/living/user) // Used to tell the player that this isn't useful for anything.
|
||||
if(!istype(user))
|
||||
return FALSE
|
||||
if(!interaction_message)
|
||||
return ..()
|
||||
else
|
||||
to_chat(user, interaction_message)
|
||||
|
||||
/obj/structure/prop/alien/computer
|
||||
name = "alien console"
|
||||
@@ -0,0 +1,215 @@
|
||||
//A series(?) of prisms for PoIs. The base one only works for beams.
|
||||
|
||||
/obj/structure/prop/prism
|
||||
name = "prismatic turret"
|
||||
desc = "A raised, externally powered 'turret'. It seems to have a massive crystal ring around its base."
|
||||
description_info = "This device is capable of redirecting any beam projectile."
|
||||
icon = 'icons/obj/props/prism.dmi'
|
||||
icon_state = "prism"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
|
||||
layer = 3.1 //Layer over projectiles.
|
||||
plane = -10 //Layer over projectiles.
|
||||
|
||||
var/rotation_lock = 0 // Can you rotate the prism at all?
|
||||
var/free_rotate = 1 // Does the prism rotate in any direction, or only in the eight standard compass directions?
|
||||
var/external_control_lock = 0 // Does the prism only rotate from the controls of an external switch?
|
||||
var/degrees_from_north = 0 // How far is it rotated clockwise?
|
||||
var/compass_directions = list("North" = 0, "South" = 180, "East" = 90, "West" = 270, "Northwest" = 315, "Northeast" = 45, "Southeast" = 135, "Southwest" = 225)
|
||||
var/interaction_sound = 'sound/mecha/mechmove04.ogg'
|
||||
|
||||
var/redirect_type = /obj/item/projectile/beam
|
||||
|
||||
var/dialID = null
|
||||
var/obj/structure/prop/prismcontrol/remote_dial = null
|
||||
|
||||
interaction_message = "<span class='notice'>The prismatic turret seems to be able to rotate.</span>"
|
||||
|
||||
/obj/structure/prop/prism/initialize()
|
||||
if(degrees_from_north)
|
||||
animate(src, transform = turn(NORTH, degrees_from_north), time = 3)
|
||||
|
||||
/obj/structure/prop/prism/Destroy()
|
||||
if(remote_dial)
|
||||
remote_dial.my_turrets -= src
|
||||
remote_dial = null
|
||||
..()
|
||||
|
||||
/obj/structure/prop/prism/proc/reset_rotation()
|
||||
var/degrees_to_rotate = -1 * degrees_from_north
|
||||
animate(src, transform = turn(src.transform, degrees_to_rotate), time = 2)
|
||||
|
||||
/obj/structure/prop/prism/attack_hand(mob/living/user)
|
||||
..()
|
||||
|
||||
if(rotation_lock)
|
||||
to_chat(user, "<span class='warning'>\The [src] is locked at its current bearing.</span>")
|
||||
return
|
||||
if(external_control_lock)
|
||||
to_chat(user, "<span class='warning'>\The [src]'s motors resist your efforts to rotate it. You may need to find some form of controller.</span>")
|
||||
return
|
||||
|
||||
var/confirm = input("Do you want to try to rotate \the [src]?", "[name]") in list("Yes", "No")
|
||||
if(confirm == "No")
|
||||
visible_message(\
|
||||
"<span class='notice'>[user.name] decides not to try turning \the [src].</span>",\
|
||||
"<span class='notice'>You decide not to try turning \the [src].</span>")
|
||||
return
|
||||
|
||||
var/new_bearing
|
||||
if(free_rotate)
|
||||
new_bearing = input("What bearing do you want to rotate \the [src] to?", "[name]") as num
|
||||
new_bearing = round(new_bearing)
|
||||
if(new_bearing <= -1 || new_bearing > 360)
|
||||
to_chat(user, "<span class='warning'>Rotating \the [src] [new_bearing] degrees would be a waste of time.</span>")
|
||||
return
|
||||
else
|
||||
var/choice = input("What point do you want to set \the [src] to?", "[name]") as null|anything in compass_directions
|
||||
new_bearing = round(compass_directions[choice])
|
||||
|
||||
var/rotate_degrees = new_bearing - degrees_from_north
|
||||
|
||||
if(new_bearing == 360) // Weird artifact.
|
||||
new_bearing = 0
|
||||
degrees_from_north = new_bearing
|
||||
|
||||
var/two_stage = 0
|
||||
if(rotate_degrees == 180 || rotate_degrees == -180)
|
||||
two_stage = 1
|
||||
var/multiplier = pick(-1, 1)
|
||||
rotate_degrees = multiplier * (rotate_degrees / 2)
|
||||
|
||||
playsound(src, interaction_sound, 50, 1)
|
||||
if(two_stage)
|
||||
animate(src, transform = turn(src.transform, rotate_degrees), time = 3)
|
||||
spawn(3)
|
||||
animate(src, transform = turn(src.transform, rotate_degrees), time = 3)
|
||||
else
|
||||
animate(src, transform = turn(src.transform, rotate_degrees), time = 6) //Can't update transform because it will reset the angle.
|
||||
|
||||
/obj/structure/prop/prism/proc/rotate_auto(var/new_bearing)
|
||||
if(rotation_lock)
|
||||
visible_message("<span class='notice'>\The [src] shudders.</span>")
|
||||
playsound(src, 'sound/effects/clang.ogg', 50, 1)
|
||||
return
|
||||
|
||||
visible_message("<span class='notice'>\The [src] rotates to a bearing of [new_bearing].</span>")
|
||||
|
||||
var/rotate_degrees = new_bearing - degrees_from_north
|
||||
|
||||
if(new_bearing == 360)
|
||||
new_bearing = 0
|
||||
degrees_from_north = new_bearing
|
||||
|
||||
var/two_stage = 0
|
||||
if(rotate_degrees == 180 || rotate_degrees == -180)
|
||||
two_stage = 1
|
||||
var/multiplier = pick(-1, 1)
|
||||
rotate_degrees = multiplier * (rotate_degrees / 2)
|
||||
|
||||
playsound(src, interaction_sound, 50, 1)
|
||||
if(two_stage)
|
||||
animate(src, transform = turn(src.transform, rotate_degrees), time = 3)
|
||||
spawn(3)
|
||||
animate(src, transform = turn(src.transform, rotate_degrees), time = 3)
|
||||
else
|
||||
animate(src, transform = turn(src.transform, rotate_degrees), time = 6)
|
||||
|
||||
/obj/structure/prop/prism/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(istype(Proj, redirect_type))
|
||||
visible_message("<span class='danger'>\The [src] redirects \the [Proj]!</span>")
|
||||
flick("[initial(icon_state)]+glow", src)
|
||||
|
||||
var/new_x = (1 * round(10 * cos(degrees_from_north - 90))) + x //Vectors vectors vectors.
|
||||
var/new_y = (-1 * round(10 * sin(degrees_from_north - 90))) + y
|
||||
var/turf/curloc = get_turf(src)
|
||||
|
||||
Proj.penetrating += 1 // Needed for the beam to get out of the turret.
|
||||
|
||||
Proj.redirect(new_x, new_y, curloc, null)
|
||||
|
||||
/obj/structure/prop/prism/incremental
|
||||
free_rotate = 0
|
||||
description_info = "This device is capable of redirecting any beam projectile, but only locks to specific positions in rotation."
|
||||
|
||||
/obj/structure/prop/prism/incremental/externalcont
|
||||
external_control_lock = 1
|
||||
description_info = "This device is capable of redirecting any beam projectile, but can only be rotated by a control dial to specific positions."
|
||||
|
||||
/obj/structure/prop/prism/externalcont
|
||||
external_control_lock = 1
|
||||
description_info = "This device is capable of redirecting any beam projectile, but can only be rotated by an external control dial."
|
||||
|
||||
/obj/structure/prop/prismcontrol
|
||||
name = "prismatic dial"
|
||||
desc = "A large dial with a crystalline ring."
|
||||
icon = 'icons/obj/props/prism.dmi'
|
||||
icon_state = "dial"
|
||||
density = FALSE
|
||||
anchored = TRUE
|
||||
|
||||
interaction_message = "<span class='notice'>The dial pulses as your hand nears it.</span>"
|
||||
var/list/my_turrets = list()
|
||||
var/dialID = null
|
||||
|
||||
/obj/structure/prop/prismcontrol/attack_hand(mob/living/user)
|
||||
..()
|
||||
|
||||
var/confirm = input("Do you want to try to rotate \the [src]?", "[name]") in list("Yes", "No")
|
||||
if(confirm == "No")
|
||||
visible_message(\
|
||||
"<span class='notice'>[user.name] decides not to try turning \the [src].</span>",\
|
||||
"<span class='notice'>You decide not to try turning \the [src].</span>")
|
||||
return
|
||||
|
||||
if(!my_turrets || !my_turrets.len)
|
||||
to_chat(user, "<span class='notice'>\The [src] doesn't seem to do anything.</span>")
|
||||
return
|
||||
|
||||
var/free_rotate = 1
|
||||
var/list/compass_directions = list()
|
||||
for(var/obj/structure/prop/prism/P in my_turrets)
|
||||
if(!P.free_rotate) //Doesn't use bearing, it uses compass points.
|
||||
free_rotate = 0
|
||||
compass_directions |= P.compass_directions
|
||||
|
||||
var/new_bearing
|
||||
if(free_rotate)
|
||||
new_bearing = input("What bearing do you want to rotate \the [src] to?", "[name]") as num
|
||||
new_bearing = round(new_bearing)
|
||||
if(new_bearing <= -1 || new_bearing > 360)
|
||||
to_chat(user, "<span class='warning'>Rotating \the [src] [new_bearing] degrees would be a waste of time.</span>")
|
||||
return
|
||||
else
|
||||
var/choice = input("What point do you want to set \the [src] to?", "[name]") as null|anything in compass_directions
|
||||
new_bearing = round(compass_directions[choice])
|
||||
|
||||
confirm = input("Are you certain you want to rotate \the [src]?", "[name]") in list("Yes", "No")
|
||||
if(confirm == "No")
|
||||
visible_message(\
|
||||
"<span class='notice'>[user.name] decides not to try turning \the [src].</span>",\
|
||||
"<span class='notice'>You decide not to try turning \the [src].</span>")
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>\The [src] clicks into place.</span>")
|
||||
for(var/obj/structure/prop/prism/P in my_turrets)
|
||||
P.rotate_auto(new_bearing)
|
||||
|
||||
/obj/structure/prop/prismcontrol/initialize()
|
||||
..()
|
||||
if(my_turrets.len) //Preset controls.
|
||||
for(var/obj/structure/prop/prism/P in my_turrets)
|
||||
P.remote_dial = src
|
||||
return
|
||||
spawn()
|
||||
for(var/obj/structure/prop/prism/P in orange(src, world.view)) //Don't search a huge area.
|
||||
if(P.dialID == dialID && !P.remote_dial && P.external_control_lock)
|
||||
my_turrets |= P
|
||||
P.remote_dial = src
|
||||
|
||||
/obj/structure/prop/prismcontrol/Destroy()
|
||||
for(var/obj/structure/prop/prism/P in my_turrets)
|
||||
P.remote_dial = null
|
||||
my_turrets = list()
|
||||
..()
|
||||
@@ -0,0 +1,53 @@
|
||||
//A locking mechanism that pulses when hit by a projectile. The base one responds to high-power lasers.
|
||||
|
||||
/obj/structure/prop/lock
|
||||
name = "weird lock"
|
||||
desc = "An esoteric object that responds to.. something."
|
||||
icon = 'icons/obj/props/prism.dmi'
|
||||
icon_state = "lock"
|
||||
|
||||
var/enabled = 0
|
||||
var/lockID = null
|
||||
|
||||
var/list/linked_objects = list()
|
||||
|
||||
/obj/structure/prop/lock/Destroy()
|
||||
if(linked_objects.len)
|
||||
for(var/obj/O in linked_objects)
|
||||
if(istype(O, /obj/machinery/door/blast/puzzle))
|
||||
var/obj/machinery/door/blast/puzzle/P = O
|
||||
P.locks -= src
|
||||
linked_objects -= P
|
||||
..()
|
||||
|
||||
/obj/structure/prop/lock/proc/toggle_lock()
|
||||
enabled = !enabled
|
||||
|
||||
if(enabled)
|
||||
icon_state = "[initial(icon_state)]-active"
|
||||
else
|
||||
icon_state = "[initial(icon_state)]"
|
||||
|
||||
/obj/structure/prop/lock/projectile
|
||||
name = "beam lock"
|
||||
desc = "An esoteric object that responds to high intensity light."
|
||||
|
||||
var/projectile_key = /obj/item/projectile/beam
|
||||
var/timed = 0
|
||||
var/timing = 0
|
||||
var/time_limit = 1500 // In ticks. Ten is one second.
|
||||
|
||||
interaction_message = "<span class='notice'>The object remains inert to your touch.</span>"
|
||||
|
||||
/obj/structure/prop/lock/projectile/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(!istype(Proj, projectile_key) || timing)
|
||||
return
|
||||
|
||||
if(istype(Proj, /obj/item/projectile/beam/heavylaser/cannon) || istype(Proj, /obj/item/projectile/beam/emitter) || (Proj.damage >= 80 && Proj.damtype == BURN))
|
||||
toggle_lock()
|
||||
visible_message("<span class='notice'>\The [src] [enabled ? "disengages" : "engages"] its locking mechanism.</span>")
|
||||
|
||||
if(timed)
|
||||
timing = 1
|
||||
spawn(time_limit)
|
||||
toggle_lock()
|
||||
@@ -0,0 +1,18 @@
|
||||
//The base 'prop' for PoIs or other large junk.
|
||||
|
||||
/obj/structure/prop
|
||||
name = "something"
|
||||
desc = "My description is broken, bug a developer."
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
icon_state = "safe"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
var/interaction_message = null
|
||||
|
||||
/obj/structure/prop/attack_hand(mob/living/user) // Used to tell the player that this isn't useful for anything.
|
||||
if(!istype(user))
|
||||
return FALSE
|
||||
if(!interaction_message)
|
||||
return ..()
|
||||
else
|
||||
to_chat(user, interaction_message)
|
||||
@@ -0,0 +1,92 @@
|
||||
// An indestructible blast door that can only be opened once its puzzle requirements are completed.
|
||||
|
||||
/obj/machinery/door/blast/puzzle
|
||||
name = "puzzle door"
|
||||
desc = "A large, virtually indestructible door that will not open unless certain requirements are met."
|
||||
icon_state_open = "pdoor0"
|
||||
icon_state_opening = "pdoorc0"
|
||||
icon_state_closed = "pdoor1"
|
||||
icon_state_closing = "pdoorc1"
|
||||
icon_state = "pdoor1"
|
||||
|
||||
explosion_resistance = 100
|
||||
|
||||
maxhealth = 9999999 //No.
|
||||
|
||||
var/list/locks = list()
|
||||
var/lockID = null
|
||||
var/checkrange_mult = 1
|
||||
|
||||
/obj/machinery/door/blast/puzzle/proc/check_locks()
|
||||
for(var/obj/structure/prop/lock/L in locks)
|
||||
if(!L.enabled)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/machinery/door/blast/puzzle/bullet_act(var/obj/item/projectile/Proj)
|
||||
visible_message("<span class='cult'>\The [src] is completely unaffected by \the [Proj].</span>")
|
||||
qdel(Proj) //No piercing. No.
|
||||
|
||||
/obj/machinery/door/blast/puzzle/ex_act(severity)
|
||||
visible_message("<span class='cult'>\The [src] is completely unaffected by the blast.</span>")
|
||||
return
|
||||
|
||||
/obj/machinery/door/blast/puzzle/initialize()
|
||||
. = ..()
|
||||
implicit_material = get_material_by_name("dungeonium")
|
||||
if(locks.len)
|
||||
return
|
||||
var/check_range = world.view * checkrange_mult
|
||||
for(var/obj/structure/prop/lock/L in orange(src, check_range))
|
||||
if(L.lockID == lockID)
|
||||
L.linked_objects |= src
|
||||
locks |= L
|
||||
|
||||
/obj/machinery/door/blast/puzzle/Destroy()
|
||||
if(locks.len)
|
||||
for(var/obj/structure/prop/lock/L in locks)
|
||||
L.linked_objects -= src
|
||||
locks -= L
|
||||
..()
|
||||
|
||||
/obj/machinery/door/blast/puzzle/attack_hand(mob/user as mob)
|
||||
if(check_locks())
|
||||
force_toggle(1, user)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>\The [src] does not respond to your touch.</span>")
|
||||
|
||||
/obj/machinery/door/blast/puzzle/attackby(obj/item/weapon/C as obj, mob/user as mob)
|
||||
if(istype(C, /obj/item/weapon))
|
||||
if(C.pry == 1 && (user.a_intent != I_HURT || (stat & BROKEN)))
|
||||
if(istype(C,/obj/item/weapon/material/twohanded/fireaxe))
|
||||
var/obj/item/weapon/material/twohanded/fireaxe/F = C
|
||||
if(!F.wielded)
|
||||
to_chat(user, "<span class='warning'>You need to be wielding \the [F] to do that.</span>")
|
||||
return
|
||||
|
||||
if(check_locks())
|
||||
force_toggle(1, user)
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[src]'s arcane workings resist your effort.</span>")
|
||||
return
|
||||
|
||||
else if(src.density && (user.a_intent == I_HURT))
|
||||
var/obj/item/weapon/W = C
|
||||
user.setClickCooldown(user.get_attack_speed(W))
|
||||
if(W.damtype == BRUTE || W.damtype == BURN)
|
||||
user.do_attack_animation(src)
|
||||
user.visible_message("<span class='danger'>\The [user] hits \the [src] with \the [W] with no visible effect.</span>")
|
||||
|
||||
else if(istype(C, /obj/item/weapon/plastique))
|
||||
to_chat(user, "<span class='danger'>On contacting \the [src], a flash of light envelops \the [C] as it is turned to ash. Oh.</span>")
|
||||
qdel(C)
|
||||
return 0
|
||||
|
||||
/obj/machinery/door/blast/puzzle/attack_generic(var/mob/user, var/damage)
|
||||
if(check_locks())
|
||||
force_toggle(1, user)
|
||||
|
||||
/obj/machinery/door/blast/puzzle/attack_alien(var/mob/user)
|
||||
if(check_locks())
|
||||
force_toggle(1, user)
|
||||
Reference in New Issue
Block a user