Skip to content

Commit

Permalink
New Traitor Item: Low-Orbit Ion Cannon Remote (#19889)
Browse files Browse the repository at this point in the history
* final

* time

* how did device.dmi even get changed
  • Loading branch information
Runian authored Aug 12, 2023
1 parent f8b2893 commit 0f22028
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
56 changes: 56 additions & 0 deletions code/game/objects/items/devices/ioncannon_remote.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/obj/item/device/loic_remote
name = "low-orbit ion cannon remote"
desc = "A remote control capable of sending a signal to the Syndicate's nearest remote satellite that has an ion cannon."
icon = 'icons/obj/device.dmi'
icon_state = "batterer"
w_class = WEIGHT_CLASS_SMALL
/// How long until this can be used again?
var/recharge_time = 20 MINUTES
COOLDOWN_DECLARE(ion_cooldown)

/obj/item/device/loic_remote/New()
..()
START_PROCESSING(SSobj, src)

/obj/item/device/loic_remote/Destroy()
STOP_PROCESSING(SSobj, src)
..()

/obj/item/device/loic_remote/process()
update_appearance(UPDATE_ICON)

/obj/item/device/loic_remote/update_icon(updates=ALL)
. = ..()
if(COOLDOWN_FINISHED(src, ion_cooldown))
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)]burnt"

/obj/item/device/loic_remote/examine(mob/user)
. = ..()
if(COOLDOWN_FINISHED(src, ion_cooldown))
. += "It is ready to fire."
else
var/seconds_left = COOLDOWN_TIMELEFT(src, ion_cooldown)/10
var/minutes_left_rounded = round(seconds_left/60, 0.1) // Don't want to deal with "1 minutes".
if(minutes_left_rounded > 1)
. += "It will be ready to fire in [minutes_left_rounded] minutes."
else
. += "It will be ready to fire in [seconds_left] seconds."

/obj/item/device/loic_remote/attack_self(mob/user)
if(!COOLDOWN_FINISHED(src, ion_cooldown))
to_chat(user, span_notice("It is not ready to be used yet."))
return
if(!is_type_in_list(get_area(src), GLOB.the_station_areas))
to_chat(user, span_notice("The remote can't establish a connection. You need to be on the station."))
return

COOLDOWN_START(src, ion_cooldown, recharge_time)
to_chat(user, span_notice("[src]'s screen flashes green for a moment."))

var/datum/round_event/ion_storm/malicious/ion = new()
ion.location_name = get_area_name(src, TRUE)

message_admins("[key_name_admin(user)] generated an ion law using a LOIC remote.")
log_admin("[key_name(user)] generated an ion law using a LOIC remote.")
11 changes: 11 additions & 0 deletions code/modules/events/ion_storm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@
if(prob(botEmagChance))
bot.emag_act()

/datum/round_event/ion_storm/malicious
var/location_name

/datum/round_event/ion_storm/malicious/announce(fake)
// Unlike normal ion storm, this always announces.
priority_announce("Abnormal ion activity detected. Please check all AI-controlled equipment for errors. Additional data has been downloaded and printed out at all communications consoles.", "Anomaly Alert", ANNOUNCER_IONSTORM)

var/message = "Malicious Interference with standard AI-Subsystems detected. Investigation recommended.<br><br>"
message += (location_name ? "Signal traced to <B>[location_name]</B>.<br>" : "Signal untracable.<br>")
print_command_report(message, null, FALSE)

/*/proc/generate_ion_law() //yogs - start mirrored in the yogs folder
//Threats are generally bad things, silly or otherwise. Plural.
var/ionthreats = pick_list(ION_FILE, "ionthreats")
Expand Down
11 changes: 11 additions & 0 deletions code/modules/uplink/uplink_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,17 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
item = /obj/item/book/granter/mechpiloting
cost = 5 //this is genuinely a REALLY strong effect, don't sleep on it

/datum/uplink_item/device_tools/loic_remote
name = "Low Orbit Ion Cannon Remote"
desc = "The Syndicate has recently installed a remote satellite nearby capable of generating a localized ion storm every 20 minutes. \
However, your local authorities will be informed of your general location when it is activated."
item = /obj/item/device/loic_remote
// TODO: When /datum/corporation/self is pickable for non-AI traitors, add it here.
limited_stock = 1 // Might be too annoying if someone had mulitple.
cost = 5 // Lacks the precision that a hacked law board (at 4 TCs) would give, but can be used on the go.
exclude_modes = list(/datum/game_mode/nuclear, /datum/game_mode/nuclear/clown_ops)


// Implants
/datum/uplink_item/implants
category = "Implants"
Expand Down
1 change: 1 addition & 0 deletions yogstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@
#include "code\game\objects\items\devices\forcefieldprojector.dm"
#include "code\game\objects\items\devices\geiger_counter.dm"
#include "code\game\objects\items\devices\gps.dm"
#include "code\game\objects\items\devices\ioncannon_remote.dm"
#include "code\game\objects\items\devices\laserpointer.dm"
#include "code\game\objects\items\devices\lightreplacer.dm"
#include "code\game\objects\items\devices\megaphone.dm"
Expand Down

0 comments on commit 0f22028

Please sign in to comment.