Revert "12/21 modernizations from TG live"

This commit is contained in:
LetterJay
2016-12-22 22:35:44 -06:00
committed by GitHub
parent cf59ac1c3d
commit ae40d4134e
2215 changed files with 86928 additions and 707332 deletions
+20 -45
View File
@@ -10,18 +10,18 @@
recommended_enemies = 5
antag_flag = ROLE_OPERATIVE
enemy_minimum_age = 14
announce_span = "danger"
announce_text = "Syndicate forces are approaching the station in an attempt to destroy it!\n\
<span class='danger'>Operatives</span>: Secure the nuclear authentication disk and use your nuke to destroy the station.\n\
<span class='notice'>Crew</span>: Defend the nuclear authentication disk and ensure that it leaves with you on the emergency shuttle."
var/const/agents_possible = 5 //If we ever need more syndicate agents.
var/nukes_left = 1 // Call 3714-PRAY right now and order more nukes! Limited offer!
var/nuke_off_station = 0 //Used for tracking if the syndies actually haul the nuke to the station
var/syndies_didnt_escape = 0 //Used for tracking if the syndies got the shuttle off of the z-level
/datum/game_mode/nuclear/announce()
world << "<B>The current game mode is - Nuclear Emergency!</B>"
world << "<B>A [syndicate_name()] Strike Force is approaching [station_name()]!</B>"
world << "A nuclear explosive was being transported by Nanotrasen to a military base. The transport ship mysteriously lost contact with Space Traffic Control (STC). About that time a strange disk was discovered around [station_name()]. It was identified by Nanotrasen as a nuclear auth. disk and now Syndicate Operatives have arrived to retake the disk and detonate SS13! Also, most likely Syndicate star ships are in the vicinity so take care not to lose the disk!\n<B>Syndicate</B>: Reclaim the disk and detonate the nuclear bomb anywhere on SS13.\n<B>Personnel</B>: Hold the disk and <B>escape with the disk</B> on the shuttle!"
/datum/game_mode/nuclear/pre_setup()
var/n_players = num_players()
var/n_agents = min(round(n_players / 10, 1), agents_possible)
@@ -67,7 +67,7 @@
synd_spawn += get_turf(A)
continue
var/nuke_code = random_nukecode()
var/nuke_code = "[rand(10000, 99999)]"
var/leader_selected = 0
var/agent_number = 1
var/spawnpos = 1
@@ -110,7 +110,7 @@
synd_mind.current << "<B>In your hand you will find a special item capable of triggering a greater challenge for your team. Examine it carefully and consult with your fellow operatives before activating it.</B>"
var/obj/item/device/nuclear_challenge/challenge = new /obj/item/device/nuclear_challenge
synd_mind.current.put_in_hands_or_del(challenge)
synd_mind.current.equip_to_slot_or_del(challenge, slot_r_hand)
var/list/foundIDs = synd_mind.current.search_contents_for(/obj/item/weapon/card/id)
if(foundIDs.len)
@@ -130,7 +130,7 @@
P.name = "nuclear bomb code"
var/mob/living/carbon/human/H = synd_mind.current
P.loc = H.loc
H.put_in_hands_or_del(P)
H.equip_to_slot_or_del(P, slot_r_hand, 0)
H.update_icons()
else
nuke_code = "code will be provided later"
@@ -147,7 +147,11 @@
/datum/game_mode/proc/greet_syndicate(datum/mind/syndicate, you_are=1)
if(you_are)
syndicate.current << "<span class='notice'>You are a [syndicate_name()] agent!</span>"
syndicate.announce_objectives()
var/obj_count = 1
for(var/datum/objective/objective in syndicate.objectives)
syndicate.current << "<B>Objective #[obj_count]</B>: [objective.explanation_text]"
obj_count++
return
/datum/game_mode/proc/equip_syndicate(mob/living/carbon/human/synd_mob, telecrystals = TRUE)
synd_mob.set_species(/datum/species/human) //Plasamen burn up otherwise, and lizards are vulnerable to asimov AIs
@@ -166,7 +170,7 @@
/datum/game_mode/proc/are_operatives_dead()
for(var/datum/mind/operative_mind in syndicates)
if(ishuman(operative_mind.current) && (operative_mind.current.stat!=2))
if (istype(operative_mind.current,/mob/living/carbon/human) && (operative_mind.current.stat!=2))
return 0
return 1
@@ -195,77 +199,51 @@
//derp //Used for tracking if the syndies actually haul the nuke to the station //no
//herp //Used for tracking if the syndies got the shuttle off of the z-level //NO, DON'T FUCKING NAME VARS LIKE THIS
if(nuke_off_station == NUKE_SYNDICATE_BASE)
feedback_set_details("round_end_result","loss - syndicate nuked - disk secured")
world << "<FONT size = 3><B>Humiliating Syndicate Defeat</B></FONT>"
world << "<B>The crew of [station_name()] gave [syndicate_name()] operatives back their bomb! The syndicate base was destroyed!</B> Next time, don't lose the nuke!"
ticker.news_report = NUKE_SYNDICATE_BASE
else if(!disk_rescued && station_was_nuked && !syndies_didnt_escape)
if (!disk_rescued && station_was_nuked && !syndies_didnt_escape)
feedback_set_details("round_end_result","win - syndicate nuke")
world << "<FONT size = 3><B>Syndicate Major Victory!</B></FONT>"
world << "<B>[syndicate_name()] operatives have destroyed [station_name()]!</B>"
ticker.news_report = STATION_NUKED
else if (!disk_rescued && station_was_nuked && syndies_didnt_escape)
feedback_set_details("round_end_result","halfwin - syndicate nuke - did not evacuate in time")
world << "<FONT size = 3><B>Total Annihilation</B></FONT>"
world << "<B>[syndicate_name()] operatives destroyed [station_name()] but did not leave the area in time and got caught in the explosion.</B> Next time, don't lose the disk!"
ticker.news_report = STATION_NUKED
else if (!disk_rescued && !station_was_nuked && nuke_off_station && !syndies_didnt_escape)
feedback_set_details("round_end_result","halfwin - blew wrong station")
world << "<FONT size = 3><B>Crew Minor Victory</B></FONT>"
world << "<B>[syndicate_name()] operatives secured the authentication disk but blew up something that wasn't [station_name()].</B> Next time, don't lose the disk!"
ticker.news_report = NUKE_MISS
else if (!disk_rescued && !station_was_nuked && nuke_off_station && syndies_didnt_escape)
feedback_set_details("round_end_result","halfwin - blew wrong station - did not evacuate in time")
world << "<FONT size = 3><B>[syndicate_name()] operatives have earned Darwin Award!</B></FONT>"
world << "<B>[syndicate_name()] operatives blew up something that wasn't [station_name()] and got caught in the explosion.</B> Next time, don't lose the disk!"
ticker.news_report = NUKE_MISS
else if ((disk_rescued || SSshuttle.emergency.mode != SHUTTLE_ENDGAME) && are_operatives_dead())
feedback_set_details("round_end_result","loss - evacuation - disk secured - syndi team dead")
world << "<FONT size = 3><B>Crew Major Victory!</B></FONT>"
world << "<B>The Research Staff has saved the disc and killed the [syndicate_name()] Operatives</B>"
ticker.news_report = OPERATIVES_KILLED
else if (disk_rescued)
feedback_set_details("round_end_result","loss - evacuation - disk secured")
world << "<FONT size = 3><B>Crew Major Victory</B></FONT>"
world << "<B>The Research Staff has saved the disc and stopped the [syndicate_name()] Operatives!</B>"
ticker.news_report = OPERATIVES_KILLED
else if (!disk_rescued && are_operatives_dead())
feedback_set_details("round_end_result","halfwin - evacuation - disk not secured")
world << "<FONT size = 3><B>Neutral Victory!</B></FONT>"
world << "<B>The Research Staff failed to secure the authentication disk but did manage to kill most of the [syndicate_name()] Operatives!</B>"
ticker.news_report = OPERATIVE_SKIRMISH
else if (!disk_rescued && crew_evacuated)
feedback_set_details("round_end_result","halfwin - detonation averted")
world << "<FONT size = 3><B>Syndicate Minor Victory!</B></FONT>"
world << "<B>[syndicate_name()] operatives recovered the abandoned authentication disk but detonation of [station_name()] was averted.</B> Next time, don't lose the disk!"
ticker.news_report = OPERATIVE_SKIRMISH
else if (!disk_rescued && !crew_evacuated)
feedback_set_details("round_end_result","halfwin - interrupted")
world << "<FONT size = 3><B>Neutral Victory</B></FONT>"
world << "<B>Round was mysteriously interrupted!</B>"
ticker.news_report = OPERATIVE_SKIRMISH
..()
return
@@ -310,9 +288,6 @@
synd_mind.current.real_name = synd_mind.name
return
/proc/is_nuclear_operative(mob/M)
return M && istype(M) && M.mind && ticker && ticker.mode && M.mind in ticker.mode.syndicates
/datum/outfit/syndicate
name = "Syndicate Operative - Basic"
@@ -321,9 +296,9 @@
gloves = /obj/item/clothing/gloves/combat
back = /obj/item/weapon/storage/backpack
ears = /obj/item/device/radio/headset/syndicate/alt
l_pocket = /obj/item/weapon/pinpointer/syndicate
l_pocket = /obj/item/weapon/pinpointer/nukeop
id = /obj/item/weapon/card/id/syndicate
belt = /obj/item/weapon/gun/ballistic/automatic/pistol
belt = /obj/item/weapon/gun/projectile/automatic/pistol
backpack_contents = list(/obj/item/weapon/storage/box/syndie=1)
var/tc = 25
@@ -358,10 +333,10 @@
suit = /obj/item/clothing/suit/space/hardsuit/syndi
r_pocket = /obj/item/weapon/tank/internals/emergency_oxygen/engi
belt = /obj/item/weapon/storage/belt/military
r_hand = /obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog
r_hand = /obj/item/weapon/gun/projectile/automatic/shotgun/bulldog
backpack_contents = list(/obj/item/weapon/storage/box/syndie=1,\
/obj/item/weapon/tank/jetpack/oxygen/harness=1,\
/obj/item/weapon/gun/ballistic/automatic/pistol=1)
/obj/item/weapon/gun/projectile/automatic/pistol=1)
/datum/outfit/syndicate/full/post_equip(mob/living/carbon/human/H)
..()
@@ -10,42 +10,24 @@
desc = "Use to send a declaration of hostilities to the target, delaying your shuttle departure for 20 minutes while they prepare for your assault. \
Such a brazen move will attract the attention of powerful benefactors within the Syndicate, who will supply your team with a massive amount of bonus telecrystals. \
Must be used within five minutes, or your benefactors will lose interest."
var/declaring_war = FALSE
var/declaring_war = 0
/obj/item/device/nuclear_challenge/attack_self(mob/living/user)
if(!check_allowed(user))
return
declaring_war = TRUE
var/are_you_sure = alert(user, "Consult your team carefully before you declare war on [station_name()]]. Are you sure you want to alert the enemy crew? You have [-round((world.time-round_start_time - CHALLENGE_TIME_LIMIT)/10)] seconds to decide", "Declare war?", "Yes", "No")
declaring_war = FALSE
if(!check_allowed(user))
return
declaring_war = 1
var/are_you_sure = alert(user, "Consult your team carefully before you declare war on [station_name()]]. Are you sure you want to alert the enemy crew?", "Declare war?", "Yes", "No")
declaring_war = 0
if(are_you_sure == "No")
user << "On second thought, the element of surprise isn't so bad after all."
return
var/war_declaration = "[user.real_name] has declared his intent to utterly destroy [station_name()] with a nuclear device, and dares the crew to try and stop them."
declaring_war = TRUE
var/custom_threat = alert(user, "Do you want to customize your declaration?", "Customize?", "Yes", "No")
declaring_war = FALSE
if(!check_allowed(user))
return
if(custom_threat == "Yes")
declaring_war = TRUE
war_declaration = stripped_input(user, "Insert your custom declaration", "Declaration")
declaring_war = FALSE
if(!check_allowed(user) || !war_declaration)
return
declaring_war = 1
var/war_declaration = "[user.real_name] has declared his intent to utterly destroy [station_name()] with a nuclear device, and dares the crew to try and stop them."
priority_announce(war_declaration, title = "Declaration of War", sound = 'sound/machines/Alarm.ogg')
user << "You've attracted the attention of powerful forces within the syndicate. A bonus bundle of telecrystals has been granted to your team. Great things await you if you complete the mission."
for(var/V in syndicate_shuttle_boards)
@@ -61,7 +43,6 @@
/obj/item/device/nuclear_challenge/proc/check_allowed(mob/living/user)
if(declaring_war)
user << "You are already in the process of declaring war! Make your mind up."
return 0
if(player_list.len < CHALLENGE_MIN_PLAYERS)
user << "The enemy crew is too small to be worth declaring war on."
+130 -226
View File
@@ -18,24 +18,17 @@ var/bomb_set
icon = 'icons/obj/machines/nuke.dmi'
icon_state = "nuclearbomb_base"
density = 1
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
var/timer_set = 60
var/default_timer_set = 60
var/minimum_timer_set = 60
var/maximum_timer_set = 3600
var/ui_style = "nanotrasen"
var/numeric_input = ""
var/timing = FALSE
var/exploding = FALSE
var/detonation_timer = null
var/timeleft = 60
var/timing = 0
var/r_code = "ADMIN"
var/yes_code = FALSE
var/safety = TRUE
var/code = ""
var/yes_code = 0
var/safety = 1
var/obj/item/weapon/disk/nuclear/auth = null
use_power = 0
var/previous_level = ""
var/lastentered = ""
var/obj/item/nuke_core/core = null
var/deconstruction_state = NUKESTATE_INTACT
var/image/lights = null
@@ -55,29 +48,19 @@ var/bomb_set
/obj/machinery/nuclearbomb/Destroy()
poi_list -= src
nuke_list -= src
if(countdown)
qdel(countdown)
qdel(countdown)
countdown = null
. = ..()
/obj/machinery/nuclearbomb/examine(mob/user)
. = ..()
if(exploding)
user << "It is in the process of exploding. Perhaps reviewing your \
affairs is in order."
if(timing)
user << "There are [get_time_left()] seconds until \
detonation."
/obj/machinery/nuclearbomb/selfdestruct
name = "station self-destruct terminal"
desc = "For when it all gets too much to bear. Do not taunt."
icon = 'icons/obj/machines/nuke_terminal.dmi'
icon_state = "nuclearbomb_base"
anchored = TRUE //stops it being moved
anchored = 1 //stops it being moved
layer = MOB_LAYER
/obj/machinery/nuclearbomb/syndicate
//ui_style = "syndicate" // actually the nuke op bomb is a stole nt bomb
/obj/machinery/nuclearbomb/syndicate/New()
var/obj/machinery/nuclearbomb/existing = locate("syndienuke")
@@ -92,7 +75,7 @@ var/bomb_set
if (istype(I, /obj/item/weapon/disk/nuclear))
if(!user.drop_item())
return
I.forceMove(src)
I.loc = src
auth = I
add_fingerprint(user)
return
@@ -102,7 +85,7 @@ var/bomb_set
if(istype(I, /obj/item/weapon/screwdriver/nuke))
playsound(loc, I.usesound, 100, 1)
user << "<span class='notice'>You start removing [src]'s front panel's screws...</span>"
if(do_after(user, 60*I.toolspeed,target=src))
if(do_after(user, 60/I.toolspeed,target=src))
deconstruction_state = NUKESTATE_UNSCREWED
user << "<span class='notice'>You remove the screws from [src]'s front panel.</span>"
update_icon()
@@ -111,7 +94,7 @@ var/bomb_set
if(istype(I, /obj/item/weapon/crowbar))
user << "<span class='notice'>You start removing [src]'s front panel...</span>"
playsound(loc, I.usesound, 100, 1)
if(do_after(user,30*I.toolspeed,target=src))
if(do_after(user,30/I.toolspeed,target=src))
user << "<span class='notice'>You remove [src]'s front panel.</span>"
deconstruction_state = NUKESTATE_PANEL_REMOVED
update_icon()
@@ -122,7 +105,7 @@ var/bomb_set
playsound(loc, I.usesound, 100, 1)
user << "<span class='notice'>You start cutting [src]'s inner plate...</span>"
if(welder.remove_fuel(1,user))
if(do_after(user,80*I.toolspeed,target=src))
if(do_after(user,80/I.toolspeed,target=src))
user << "<span class='notice'>You cut [src]'s inner plate.</span>"
deconstruction_state = NUKESTATE_WELDED
update_icon()
@@ -131,7 +114,7 @@ var/bomb_set
if(istype(I, /obj/item/weapon/crowbar))
user << "<span class='notice'>You start prying off [src]'s inner plate...</span>"
playsound(loc, I.usesound, 100, 1)
if(do_after(user,50*I.toolspeed,target=src))
if(do_after(user,50/I.toolspeed,target=src))
user << "<span class='notice'>You pry off [src]'s inner plate. You can see the core's green glow!</span>"
deconstruction_state = NUKESTATE_CORE_EXPOSED
update_icon()
@@ -165,12 +148,12 @@ var/bomb_set
else
user << "<span class='warning'>You need more metal to do that!</span>"
return
. = ..()
return ..()
/obj/machinery/nuclearbomb/proc/get_nuke_state()
if(exploding)
if(timing < 0)
return NUKE_ON_EXPLODING
if(timing)
if(timing > 0)
return NUKE_ON_TIMING
if(safety)
return NUKE_OFF_LOCKED
@@ -226,127 +209,102 @@ var/bomb_set
add_overlay(lights)
/obj/machinery/nuclearbomb/process()
if(timing && !exploding)
bomb_set = TRUE
if(detonation_timer < world.time)
if (timing > 0)
countdown.start()
bomb_set = 1 //So long as there is one nuke timing, it means one nuke is armed.
timeleft--
if (timeleft <= 0)
explode()
else
var/volume = (get_time_left() <= 20 ? 30 : 5)
var/volume = (timeleft <= 20 ? 30 : 5)
playsound(loc, 'sound/items/timer.ogg', volume, 0)
for(var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
attack_hand(M)
else
countdown.stop()
/obj/machinery/nuclearbomb/attack_paw(mob/user)
return attack_hand(user)
/obj/machinery/nuclearbomb/ui_interact(mob/user, ui_key="main", datum/tgui/ui=null, force_open=0, datum/tgui/master_ui=null, datum/ui_state/state=default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "nuclear_bomb", name, 500, 600, master_ui, state)
ui.set_style(ui_style)
ui.open()
/obj/machinery/nuclearbomb/attack_ai(mob/user)
return
/obj/machinery/nuclearbomb/ui_data(mob/user)
var/list/data = list()
data["disk_present"] = auth
data["code_approved"] = yes_code
var/first_status
if(auth)
if(yes_code)
first_status = timing ? "Func/Set" : "Functional"
/obj/machinery/nuclearbomb/attack_hand(mob/user)
user.set_machine(src)
var/dat = text("<TT>\nAuth. Disk: <A href='?src=\ref[];auth=1'>[]</A><HR>", src, (auth ? "++++++++++" : "----------"))
if (auth)
if (yes_code)
dat += text("\n<B>Status</B>: []-[]<BR>\n<B>Timer</B>: []<BR>\n<BR>\nTimer: [] <A href='?src=\ref[];timer=1'>Toggle</A><BR>\nTime: <A href='?src=\ref[];time=-10'>-</A> <A href='?src=\ref[];time=-1'>-</A> [] <A href='?src=\ref[];time=1'>+</A> <A href='?src=\ref[];time=10'>+</A><BR>\n<BR>\nSafety: [] <A href='?src=\ref[];safety=1'>Toggle</A><BR>\nAnchor: [] <A href='?src=\ref[];anchor=1'>Toggle</A><BR>\n", (timing ? "Func/Set" : "Functional"), (safety ? "Safe" : "Engaged"), timeleft, (timing ? "On" : "Off"), src, src, src, timeleft, src, src, (safety ? "On" : "Off"), src, (anchored ? "Engaged" : "Off"), src)
else
first_status = "Auth S2."
dat += text("\n<B>Status</B>: Auth. S2-[]<BR>\n<B>Timer</B>: []<BR>\n<BR>\nTimer: [] Toggle<BR>\nTime: - - [] + +<BR>\n<BR>\n[] Safety: Toggle<BR>\nAnchor: [] Toggle<BR>\n", (safety ? "Safe" : "Engaged"), timeleft, (timing ? "On" : "Off"), timeleft, (safety ? "On" : "Off"), (anchored ? "Engaged" : "Off"))
else
if(timing)
first_status = "Set"
if (timing)
dat += text("\n<B>Status</B>: Set-[]<BR>\n<B>Timer</B>: []<BR>\n<BR>\nTimer: [] Toggle<BR>\nTime: - - [] + +<BR>\n<BR>\nSafety: [] Toggle<BR>\nAnchor: [] Toggle<BR>\n", (safety ? "Safe" : "Engaged"), timeleft, (timing ? "On" : "Off"), timeleft, (safety ? "On" : "Off"), (anchored ? "Engaged" : "Off"))
else
first_status = "Auth S1."
var/second_status = safety ? "Safe" : "Engaged"
data["status1"] = first_status
data["status2"] = second_status
data["anchored"] = anchored
data["safety"] = safety
data["timing"] = timing
data["time_left"] = get_time_left()
data["timer_set"] = timer_set
data["timer_is_not_default"] = timer_set != default_timer_set
data["timer_is_not_min"] = timer_set != minimum_timer_set
data["timer_is_not_max"] = timer_set != maximum_timer_set
dat += text("\n<B>Status</B>: Auth. S1-[]<BR>\n<B>Timer</B>: []<BR>\n<BR>\nTimer: [] Toggle<BR>\nTime: - - [] + +<BR>\n<BR>\nSafety: [] Toggle<BR>\nAnchor: [] Toggle<BR>\n", (safety ? "Safe" : "Engaged"), timeleft, (timing ? "On" : "Off"), timeleft, (safety ? "On" : "Off"), (anchored ? "Engaged" : "Off"))
var/message = "AUTH"
if(auth)
message = "[numeric_input]"
if(yes_code)
if (auth)
message = text("[]", code)
if (yes_code)
message = "*****"
data["message"] = message
dat += text("<HR>\n>[]<BR>\n<A href='?src=\ref[];type=1'>1</A><A href='?src=\ref[];type=2'>2</A><A href='?src=\ref[];type=3'>3</A><BR>\n<A href='?src=\ref[];type=4'>4</A><A href='?src=\ref[];type=5'>5</A><A href='?src=\ref[];type=6'>6</A><BR>\n<A href='?src=\ref[];type=7'>7</A><A href='?src=\ref[];type=8'>8</A><A href='?src=\ref[];type=9'>9</A><BR>\n<A href='?src=\ref[];type=R'>R</A><A href='?src=\ref[];type=0'>0</A><A href='?src=\ref[];type=E'>E</A><BR>\n</TT>", message, src, src, src, src, src, src, src, src, src, src, src, src)
var/datum/browser/popup = new(user, "nuclearbomb", name, 300, 400)
popup.set_content(dat)
popup.open()
return data
/obj/machinery/nuclearbomb/ui_act(action, params)
/obj/machinery/nuclearbomb/Topic(href, href_list)
if(..())
return
switch(action)
if("eject_disk")
if(auth && auth.loc == src)
auth.forceMove(get_turf(src))
auth = null
. = TRUE
if("insert_disk")
if(!auth)
var/obj/item/I = usr.get_active_held_item()
if(istype(I, /obj/item/weapon/disk/nuclear))
usr.drop_item()
I.forceMove(src)
auth = I
. = TRUE
if("keypad")
if(auth)
var/digit = params["digit"]
switch(digit)
if("R")
numeric_input = ""
yes_code = FALSE
. = TRUE
if("E")
if(numeric_input == r_code)
numeric_input = ""
yes_code = TRUE
. = TRUE
else
numeric_input = "ERROR"
if("0","1","2","3","4","5","6","7","8","9")
if(numeric_input != "ERROR")
numeric_input += digit
if(length(numeric_input) > 5)
numeric_input = "ERROR"
. = TRUE
if("timer")
if(auth && yes_code)
var/change = params["change"]
if(change == "reset")
timer_set = default_timer_set
else if(change == "decrease")
timer_set = max(minimum_timer_set, timer_set - 10)
else if(change == "increase")
timer_set = min(maximum_timer_set, timer_set + 10)
else if(change == "input")
var/user_input = input(usr, "Set time to detonation.", name) as null|num
if(!user_input)
return
var/N = text2num(user_input)
if(!N)
return
timer_set = Clamp(N,minimum_timer_set,maximum_timer_set)
. = TRUE
if("safety")
if(auth && yes_code)
set_safety()
if("anchor")
if(auth && yes_code)
set_anchor()
if("toggle_timer")
if(auth && yes_code && !safety)
usr.set_machine(src)
if (href_list["auth"])
if (auth)
auth.loc = loc
yes_code = 0
auth = null
else
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/disk/nuclear))
usr.drop_item()
I.loc = src
auth = I
if (auth)
if (href_list["type"])
if (href_list["type"] == "E")
if (code == r_code)
yes_code = 1
code = null
else
code = "ERROR"
else
if (href_list["type"] == "R")
yes_code = 0
code = null
else
lastentered = text("[]", href_list["type"])
if (text2num(lastentered) == null)
var/turf/LOC = get_turf(usr)
message_admins("[key_name_admin(usr)] (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[usr]'>FLW</A>) tried to exploit a nuclear bomb by entering non-numerical codes: <a href='?_src_=vars;Vars=\ref[src]'>[lastentered]</a> ! ([LOC ? "<a href='?_src_=holder;adminplayerobservecoodjump=1;X=[LOC.x];Y=[LOC.y];Z=[LOC.z]'>JMP</a>" : "null"])", 0)
log_admin("EXPLOIT : [key_name(usr)] tried to exploit a nuclear bomb by entering non-numerical codes: [lastentered] !")
else
code += lastentered
if (length(code) > 5)
code = "ERROR"
if (yes_code)
if (href_list["time"])
var/time = text2num(href_list["time"])
timeleft += time
timeleft = min(max(round(timeleft), 60), 600)
if (href_list["timer"])
set_active()
if (href_list["safety"])
set_safety()
if (href_list["anchor"])
set_anchor()
add_fingerprint(usr)
for(var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
attack_hand(M)
/obj/machinery/nuclearbomb/proc/set_anchor()
if(!isinspace())
@@ -359,13 +317,8 @@ var/bomb_set
if(safety)
if(timing)
set_security_level(previous_level)
for(var/obj/item/weapon/pinpointer/syndicate/S in pinpointer_list)
S.switch_mode_to(initial(S.mode))
S.nuke_warning = FALSE
timing = FALSE
bomb_set = TRUE
detonation_timer = null
countdown.stop()
timing = 0
bomb_set = 0
update_icon()
/obj/machinery/nuclearbomb/proc/set_active()
@@ -375,51 +328,36 @@ var/bomb_set
timing = !timing
if(timing)
previous_level = get_security_level()
bomb_set = TRUE
bomb_set = 1
set_security_level("delta")
detonation_timer = world.time + (timer_set * 10)
for(var/obj/item/weapon/pinpointer/syndicate/S in pinpointer_list)
S.switch_mode_to(TRACK_INFILTRATOR)
countdown.start()
else
bomb_set = FALSE
detonation_timer = null
bomb_set = 0
set_security_level(previous_level)
for(var/obj/item/weapon/pinpointer/syndicate/S in pinpointer_list)
S.switch_mode_to(initial(S.mode))
S.nuke_warning = FALSE
countdown.stop()
update_icon()
/obj/machinery/nuclearbomb/proc/get_time_left()
if(timing)
. = round(max(0, detonation_timer - world.time) / 10, 1)
else
. = timer_set
/obj/machinery/nuclearbomb/ex_act(severity, target)
return
/obj/machinery/nuclearbomb/blob_act(obj/structure/blob/B)
if(exploding)
/obj/machinery/nuclearbomb/blob_act(obj/effect/blob/B)
if (timing == -1)
return
qdel(src)
else
return ..()
/obj/machinery/nuclearbomb/tesla_act(power, explosive)
..()
if(explosive)
qdel(src)//like the singulo, tesla deletes it. stops it from exploding over and over
#define NUKERANGE 127
/obj/machinery/nuclearbomb/proc/explode()
if(safety)
timing = FALSE
if (safety)
timing = 0
return
exploding = TRUE
yes_code = FALSE
safety = TRUE
timing = -1
yes_code = 0
safety = 1
update_icon()
for(var/mob/M in player_list)
M << 'sound/machines/Alarm.ogg'
if(ticker && ticker.mode)
if (ticker && ticker.mode)
ticker.mode.explosion_in_progress = 1
sleep(100)
@@ -432,16 +370,14 @@ var/bomb_set
var/off_station = 0
var/turf/bomb_location = get_turf(src)
var/area/A = get_area(bomb_location)
if(bomb_location && (bomb_location.z == ZLEVEL_STATION))
var/area/A = get_area(bomb_location)
if(istype(A, /area/space))
off_station = NUKE_MISS_STATION
off_station = 1
if((bomb_location.x < (128-NUKERANGE)) || (bomb_location.x > (128+NUKERANGE)) || (bomb_location.y < (128-NUKERANGE)) || (bomb_location.y > (128+NUKERANGE)))
off_station = NUKE_MISS_STATION
else if(istype(A, /area/syndicate_mothership) || (istype(A,/area/shuttle/syndicate) && bomb_location.z == ZLEVEL_CENTCOM))
off_station = NUKE_SYNDICATE_BASE
off_station = 1
else
off_station = NUKE_NEAR_MISS
off_station = 2
if(ticker.mode && ticker.mode.name == "nuclear emergency")
var/obj/docking_port/mobile/Shuttle = SSshuttle.getShuttle("syndicate")
@@ -485,7 +421,7 @@ This is here to make the tiles around the station mininuke change when it's arme
//==========DAT FUKKEN DISK===============
/obj/item/weapon/disk
icon = 'icons/obj/module.dmi'
w_class = WEIGHT_CLASS_TINY
w_class = 1
item_state = "card-id"
icon_state = "datadisk0"
@@ -493,47 +429,26 @@ This is here to make the tiles around the station mininuke change when it's arme
name = "nuclear authentication disk"
desc = "Better keep this safe."
icon_state = "nucleardisk"
persistence_replacement = /obj/item/weapon/disk/fakenucleardisk
obj_integrity = 250
max_integrity = 250
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 30, bio = 0, rad = 0, fire = 100, acid = 100)
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
/obj/item/weapon/disk/nuclear/New()
..()
poi_list |= src
START_PROCESSING(SSobj, src)
/obj/item/weapon/disk/nuclear/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/weapon/claymore/highlander))
var/obj/item/weapon/claymore/highlander/H = I
if(H.nuke_disk)
user << "<span class='notice'>Wait... what?</span>"
qdel(H.nuke_disk)
H.nuke_disk = null
return
user.visible_message("<span class='warning'>[user] captures [src]!</span>", "<span class='userdanger'>You've got the disk! Defend it with your life!</span>")
loc = H
H.nuke_disk = src
return 1
return ..()
/obj/item/weapon/disk/nuclear/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is going delta! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message("<span class='suicide'>[user] is \
going delta! It looks like they're comitting suicide.</span>")
playsound(user.loc, 'sound/machines/Alarm.ogg', 50, -1, 1)
var/end_time = world.time + 100
var/newcolor = "#00FF00"
var/orig_color = user.color
while(world.time < end_time)
if(!user)
return
if(newcolor == "#FF0000")
newcolor = "#00FF00"
else
newcolor = "#FF0000"
user.add_atom_colour(newcolor, ADMIN_COLOUR_PRIORITY)
user.color = RANDOM_COLOUR
sleep(1)
user.remove_atom_colour(ADMIN_COLOUR_PRIORITY)
user.visible_message("<span class='suicide'>[user] was destroyed by the nuclear blast!</span>")
user.color = orig_color
user.visible_message("<span class='suicide'>[user] was destroyed \
by the nuclear blast!</span>")
return OXYLOSS
/obj/item/weapon/disk/nuclear/process()
@@ -543,11 +458,8 @@ This is here to make the tiles around the station mininuke change when it's arme
else
get(src, /mob) << "<span class='danger'>You can't help but feel that you just lost something back there...</span>"
var/turf/targetturf = relocate()
message_admins("[src] has been moved out of bounds in \
[ADMIN_COORDJMP(diskturf)]. Moving it to \
[ADMIN_COORDJMP(targetturf)].")
log_game("[src] has been moved out of bounds in [COORD(diskturf)]. \
Moving it to [COORD(targetturf)].")
message_admins("[src] has been moved out of bounds in ([diskturf ? "[diskturf.x], [diskturf.y] ,[diskturf.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[diskturf.x];Y=[diskturf.y];Z=[diskturf.z]'>JMP</a>":"nonexistent location"]). Moving it to ([targetturf.x], [targetturf.y], [targetturf.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[targetturf.x];Y=[targetturf.y];Z=[targetturf.z]'>JMP</a>).")
log_game("[src] has been moved out of bounds in ([diskturf ? "[diskturf.x], [diskturf.y] ,[diskturf.z]":"nonexistent location"]). Moving it to ([targetturf.x], [targetturf.y], [targetturf.z]).")
/obj/item/weapon/disk/nuclear/proc/relocate()
var/targetturf = find_safe_turf(ZLEVEL_STATION)
@@ -571,21 +483,13 @@ This is here to make the tiles around the station mininuke change when it's arme
var/turf/diskturf = get_turf(src)
if(force)
message_admins("[src] has been !!force deleted!! in \
[ADMIN_COORDJMP(diskturf)].")
log_game("[src] has been !!force deleted!! in [COORD(diskturf)].")
message_admins("[src] has been !!force deleted!! in ([diskturf ? "[diskturf.x], [diskturf.y] ,[diskturf.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[diskturf.x];Y=[diskturf.y];Z=[diskturf.z]'>JMP</a>":"nonexistent location"]).")
log_game("[src] has been !!force deleted!! in ([diskturf ? "[diskturf.x], [diskturf.y] ,[diskturf.z]":"nonexistent location"]).")
poi_list -= src
STOP_PROCESSING(SSobj, src)
return ..()
var/turf/targetturf = relocate()
message_admins("[src] has been destroyed in [ADMIN_COORDJMP(diskturf)]. \
Moving it to [ADMIN_COORDJMP(targetturf)].")
log_game("[src] has been destroyed in [COORD(diskturf)]. Moving it to \
[COORD(targetturf)].")
message_admins("[src] has been destroyed in ([diskturf ? "[diskturf.x], [diskturf.y] ,[diskturf.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[diskturf.x];Y=[diskturf.y];Z=[diskturf.z]'>JMP</a>":"nonexistent location"]). Moving it to ([targetturf.x], [targetturf.y], [targetturf.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[targetturf.x];Y=[targetturf.y];Z=[targetturf.z]'>JMP</a>).")
log_game("[src] has been destroyed in ([diskturf ? "[diskturf.x], [diskturf.y] ,[diskturf.z]":"nonexistent location"]). Moving it to ([targetturf.x], [targetturf.y], [targetturf.z]).")
return QDEL_HINT_LETMELIVE //Cancel destruction unless forced
/obj/item/weapon/disk/fakenucleardisk
name = "cheap plastic imitation of the nuclear authentication disk"
desc = "Broken dreams and a faint oder of cheese."
icon_state = "nucleardisk"
+262 -137
View File
@@ -1,172 +1,297 @@
//Pinpointers are used to track atoms from a distance as long as they're on the same z-level. The captain and nuke ops have ones that track the nuclear authentication disk.
/obj/item/weapon/pinpointer
name = "pinpointer"
desc = "A handheld tracking device that locks onto certain signals."
icon = 'icons/obj/device.dmi'
icon_state = "pinoff"
flags = CONDUCT
slot_flags = SLOT_BELT
w_class = WEIGHT_CLASS_SMALL
w_class = 2
item_state = "electronic"
throw_speed = 3
throw_range = 7
materials = list(MAT_METAL = 500, MAT_GLASS = 250)
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
var/active = FALSE
var/atom/movable/target = null //The thing we're searching for
var/atom/movable/constant_target = null //The thing we're always focused on, if we're in the right mode
var/target_x = 0 //The target coordinates if we're tracking those
var/target_y = 0
var/nuke_warning = FALSE // If we've set off a miniature alarm about an armed nuke
var/mode = TRACK_NUKE_DISK //What are we looking for?
materials = list(MAT_METAL=500)
var/obj/item/weapon/disk/nuclear/the_disk = null
var/active = 0
/obj/item/weapon/pinpointer/New()
..()
pinpointer_list += src
/obj/item/weapon/pinpointer/Destroy()
STOP_PROCESSING(SSfastprocess, src)
active = 0
pinpointer_list -= src
return ..()
/obj/item/weapon/pinpointer/attack_self(mob/living/user)
active = !active
user.visible_message("<span class='notice'>[user] [active ? "" : "de"]activates their pinpointer.</span>", "<span class='notice'>You [active ? "" : "de"]activate your pinpointer.</span>")
playsound(user, 'sound/items/Screwdriver2.ogg', 50, 1)
icon_state = "pin[active ? "onnull" : "off"]"
if(active)
START_PROCESSING(SSfastprocess, src)
/obj/item/weapon/pinpointer/attack_self()
if(!active)
active = 1
workdisk()
usr << "<span class='notice'>You activate the pinpointer.</span>"
else
target = null //Restarting the pinpointer forces a target reset
STOP_PROCESSING(SSfastprocess, src)
active = 0
icon_state = "pinoff"
usr << "<span class='notice'>You deactivate the pinpointer.</span>"
/obj/item/weapon/pinpointer/attackby(obj/item/I, mob/living/user, params)
if(mode != TRACK_ATOM)
return ..()
user.visible_message("<span class='notice'>[user] tunes [src] to [I].</span>", "<span class='notice'>You fine-tune [src]'s tracking to track [I].</span>")
playsound(src, 'sound/machines/click.ogg', 50, 1)
constant_target = I
/obj/item/weapon/pinpointer/proc/scandisk()
if(!the_disk)
the_disk = locate()
/obj/item/weapon/pinpointer/proc/point_at(atom/target, spawnself = 1)
if(!active)
return
if(!target)
icon_state = "pinonnull"
return
var/turf/T = get_turf(target)
var/turf/L = get_turf(src)
if(T.z != L.z)
icon_state = "pinonnull"
else
setDir(get_dir(L, T))
switch(get_dist(L, T))
if(-1)
icon_state = "pinondirect"
if(1 to 8)
icon_state = "pinonclose"
if(9 to 16)
icon_state = "pinonmedium"
if(16 to INFINITY)
icon_state = "pinonfar"
if(spawnself)
spawn(5)
.()
/obj/item/weapon/pinpointer/proc/workdisk()
scandisk()
point_at(the_disk, 0)
spawn(5)
.()
/obj/item/weapon/pinpointer/examine(mob/user)
..()
var/msg = "Its tracking indicator reads "
switch(mode)
if(TRACK_NUKE_DISK)
msg += "\"nuclear_disk\"."
if(TRACK_MALF_AI)
msg += "\"01000001 01001001\"."
if(TRACK_INFILTRATOR)
msg += "\"vasvygengbefuvc\"."
if(TRACK_OPERATIVES)
msg += "\"[target ? "Operative [target]" : "friends"]\"."
if(TRACK_ATOM)
msg += "\"[initial(constant_target.name)]\"."
if(TRACK_COORDINATES)
msg += "\"([target_x], [target_y])\"."
else
msg = "Its tracking indicator is blank."
user << msg
for(var/obj/machinery/nuclearbomb/bomb in machines)
if(bomb.timing)
user << "Extreme danger. Arming signal detected. Time remaining: [bomb.get_time_left()]"
user << "Extreme danger. Arming signal detected. Time remaining: [bomb.timeleft]"
/obj/item/weapon/pinpointer/process()
/obj/item/weapon/pinpointer/advpinpointer
name = "advanced pinpointer"
icon = 'icons/obj/device.dmi'
desc = "A larger version of the normal pinpointer, this unit features a helpful quantum entanglement detection system to locate various objects that do not broadcast a locator signal."
var/mode = 0 // Mode 0 locates disk, mode 1 locates coordinates.
var/turf/location = null
var/obj/target = null
/obj/item/weapon/pinpointer/advpinpointer/attack_self()
if(!active)
STOP_PROCESSING(SSfastprocess, src)
return
scan_for_target()
point_to_target()
my_god_jc_a_bomb()
addtimer(src, "refresh_target", 50, TIMER_UNIQUE)
/obj/item/weapon/pinpointer/proc/scan_for_target() //Looks for whatever it's tracking
if(target)
if(isliving(target))
var/mob/living/L = target
if(L.stat == DEAD)
target = null
return
switch(mode)
if(TRACK_NUKE_DISK)
var/obj/item/weapon/disk/nuclear/N = locate()
target = N
if(TRACK_MALF_AI)
for(var/V in ai_list)
var/mob/living/silicon/ai/A = V
if(A.nuking)
target = A
for(var/V in apcs_list)
var/obj/machinery/power/apc/A = V
if(A.malfhack && A.occupier)
target = A
if(TRACK_INFILTRATOR)
target = SSshuttle.getShuttle("syndicate")
if(TRACK_OPERATIVES)
var/list/possible_targets = list()
var/turf/here = get_turf(src)
for(var/V in ticker.mode.syndicates)
var/datum/mind/M = V
if(M.current && M.current.stat != DEAD)
possible_targets |= M.current
var/mob/living/closest_operative = get_closest_atom(/mob/living/carbon/human, possible_targets, here)
if(closest_operative)
target = closest_operative
if(TRACK_ATOM)
if(constant_target)
target = constant_target
if(TRACK_COORDINATES)
var/turf/T = get_turf(src)
target = locate(target_x, target_y, T.z)
/obj/item/weapon/pinpointer/proc/point_to_target() //If we found what we're looking for, show the distance and direction
if(!active)
return
if(!target || (mode == TRACK_ATOM && !constant_target))
icon_state = "pinon[nuke_warning ? "alert" : ""]null"
return
var/turf/here = get_turf(src)
var/turf/there = get_turf(target)
if(here.z != there.z)
icon_state = "pinon[nuke_warning ? "alert" : ""]null"
return
if(here == there)
icon_state = "pinon[nuke_warning ? "alert" : ""]direct"
active = 1
if(mode == 0)
workdisk()
if(mode == 1)
point_at(location)
if(mode == 2)
point_at(target)
usr << "<span class='notice'>You activate the pinpointer.</span>"
else
setDir(get_dir(here, there))
switch(get_dist(here, there))
active = 0
icon_state = "pinoff"
usr << "<span class='notice'>You deactivate the pinpointer.</span>"
/obj/item/weapon/pinpointer/advpinpointer/verb/toggle_mode()
set category = "Object"
set name = "Toggle Pinpointer Mode"
set src in view(1)
if(usr.stat || usr.restrained() || !usr.canmove)
return
active = 0
icon_state = "pinoff"
target=null
location = null
switch(alert("Please select the mode you want to put the pinpointer in.", "Pinpointer Mode Select", "Location", "Disk Recovery", "Other Signature"))
if("Location")
mode = 1
var/locationx = input(usr, "Please input the x coordinate to search for.", "Location?" , "") as num
if(!locationx || !(usr in view(1,src)))
return
var/locationy = input(usr, "Please input the y coordinate to search for.", "Location?" , "") as num
if(!locationy || !(usr in view(1,src)))
return
var/turf/Z = get_turf(src)
location = locate(locationx,locationy,Z.z)
usr << "<span class='notice'>You set the pinpointer to locate [locationx],[locationy]</span>"
return attack_self()
if("Disk Recovery")
mode = 0
return attack_self()
if("Other Signature")
mode = 2
switch(alert("Search for item signature or DNA fragment?" , "Signature Mode Select" , "" , "Item" , "DNA"))
if("Item")
var/targetitem = input("Select item to search for.", "Item Mode Select","") as null|anything in possible_items
if(!targetitem)
return
target=locate(possible_items[targetitem])
if(!target)
usr << "<span class='warning'>Failed to locate [targetitem]!</span>"
return
usr << "<span class='notice'>You set the pinpointer to locate [targetitem].</span>"
if("DNA")
var/DNAstring = input("Input DNA string to search for." , "Please Enter String." , "")
if(!DNAstring)
return
for(var/mob/living/carbon/C in mob_list)
if(!C.dna)
continue
if(C.dna.unique_enzymes == DNAstring)
target = C
break
return attack_self()
///////////////////////
//nuke op pinpointers//
///////////////////////
/obj/item/weapon/pinpointer/nukeop
var/mode = 0 //Mode 0 locates disk, mode 1 locates the shuttle
var/obj/docking_port/mobile/home
/obj/item/weapon/pinpointer/nukeop/attack_self(mob/user)
if(!active)
active = 1
var/mode_text = "Authentication Disk Locator mode"
if(!mode)
workdisk()
else
mode_text = "Shuttle Locator mode"
worklocation()
user << "<span class='notice'>You activate the pinpointer([mode_text]).</span>"
else
active = 0
icon_state = "pinoff"
user << "<span class='notice'>You deactivate the pinpointer.</span>"
/obj/item/weapon/pinpointer/nukeop/workdisk()
if(!active) return
if(mode) //Check in case the mode changes while operating
worklocation()
return
if(bomb_set) //If the bomb is set, lead to the shuttle
mode = 1 //Ensures worklocation() continues to work
worklocation()
playsound(loc, 'sound/machines/twobeep.ogg', 50, 1) //Plays a beep
visible_message("Shuttle Locator mode actived.") //Lets the mob holding it know that the mode has changed
return //Get outta here
scandisk()
if(!the_disk)
icon_state = "pinonnull"
return
setDir(get_dir(src, the_disk))
switch(get_dist(src, the_disk))
if(0)
icon_state = "pinondirect"
if(1 to 8)
icon_state = "pinonclose"
if(9 to 16)
icon_state = "pinonmedium"
if(16 to INFINITY)
icon_state = "pinonfar"
spawn(5) .()
/obj/item/weapon/pinpointer/nukeop/proc/worklocation()
if(!active)
return
if(!mode)
workdisk()
return
if(!bomb_set)
mode = 0
workdisk()
playsound(loc, 'sound/machines/twobeep.ogg', 50, 1)
visible_message("<span class='notice'>Authentication Disk Locator mode actived.</span>")
return
if(!home)
home = SSshuttle.getShuttle("syndicate")
if(!home)
icon_state = "pinonnull"
return
if(loc.z != home.z) //If you are on a different z-level from the shuttle
icon_state = "pinonnull"
else
setDir(get_dir(src, home))
switch(get_dist(src, home))
if(0)
icon_state = "pinondirect"
if(1 to 8)
icon_state = "pinon[nuke_warning ? "alert" : "close"]"
icon_state = "pinonclose"
if(9 to 16)
icon_state = "pinon[nuke_warning ? "alert" : "medium"]"
icon_state = "pinonmedium"
if(16 to INFINITY)
icon_state = "pinon[nuke_warning ? "alert" : "far"]"
icon_state = "pinonfar"
/obj/item/weapon/pinpointer/proc/my_god_jc_a_bomb() //If we should get the hell back to the ship
for(var/obj/machinery/nuclearbomb/bomb in nuke_list)
if(bomb.timing)
if(!nuke_warning)
nuke_warning = TRUE
playsound(src, 'sound/items/Nuke_toy_lowpower.ogg', 50, 0)
if(isliving(loc))
var/mob/living/L = loc
L << "<span class='userdanger'>Your [name] vibrates and lets out a tinny alarm. Uh oh.</span>"
spawn(5)
.()
/obj/item/weapon/pinpointer/proc/switch_mode_to(new_mode) //If we shouldn't be tracking what we are
if(isliving(loc))
var/mob/living/L = loc
L << "<span class='userdanger'>Your [name] beeps as it reconfigures its tracking algorithms.</span>"
playsound(L, 'sound/machines/triple_beep.ogg', 50, 1)
mode = new_mode
target = null //Switch modes so we can find the new target
/obj/item/weapon/pinpointer/operative
name = "operative pinpointer"
icon = 'icons/obj/device.dmi'
desc = "A pinpointer that leads to the first Syndicate operative detected."
var/mob/living/carbon/nearest_op = null
/obj/item/weapon/pinpointer/proc/refresh_target() //Periodically removes the target to allow the pinpointer to update (i.e. malf AI shunts, an operative dies)
target = null
/obj/item/weapon/pinpointer/operative/attack_self()
if(!usr.mind || !(usr.mind in ticker.mode.syndicates))
usr << "<span class='danger'>AUTHENTICATION FAILURE. ACCESS DENIED.</span>"
return 0
if(!active)
active = 1
workop()
usr << "<span class='notice'>You activate the pinpointer.</span>"
else
active = 0
icon_state = "pinoff"
usr << "<span class='notice'>You deactivate the pinpointer.</span>"
/obj/item/weapon/pinpointer/syndicate //Syndicate pinpointers automatically point towards the infiltrator once the nuke is active.
name = "syndicate pinpointer"
desc = "A handheld tracking device that locks onto certain signals. It's configured to switch tracking modes once it detects the activation signal of a nuclear device."
/obj/item/weapon/pinpointer/operative/proc/scan_for_ops()
if(active)
nearest_op = null //Resets nearest_op every time it scans
var/closest_distance = 1000
for(var/mob/living/carbon/M in mob_list)
if(M.mind && (M.mind in ticker.mode.syndicates))
if(get_dist(M, get_turf(src)) < closest_distance) //Actually points toward the nearest op, instead of a random one like it used to
nearest_op = M
/obj/item/weapon/pinpointer/syndicate/cyborg //Cyborg pinpointers just look for a random operative.
name = "cyborg syndicate pinpointer"
desc = "An integrated tracking device, jury-rigged to search for living Syndicate operatives."
mode = TRACK_OPERATIVES
flags = NODROP
/obj/item/weapon/pinpointer/operative/proc/workop()
if(active)
scan_for_ops()
point_at(nearest_op, 0)
spawn(5)
.()
else
return 0
/obj/item/weapon/pinpointer/operative/examine(mob/user)
..()
if(active)
if(nearest_op)
user << "Nearest operative detected is <i>[nearest_op.real_name].</i>"
else
user << "No operatives detected within scanning range."