mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-11 10:22:13 +00:00
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
requires_ntnet = 0
|
||||
usage_flags = PROGRAM_CONSOLE
|
||||
transfer_access = ACCESS_HEADS
|
||||
available_on_ntnet = 1
|
||||
tgui_id = "ntos_ai_restorer"
|
||||
ui_x = 600
|
||||
available_on_ntnet = TRUE
|
||||
tgui_id = "NtosAiRestorer"
|
||||
ui_x = 370
|
||||
ui_y = 400
|
||||
|
||||
var/restoring = FALSE
|
||||
@@ -118,4 +118,4 @@
|
||||
|
||||
/datum/computer_file/program/aidiag/kill_program(forced)
|
||||
restoring = FALSE
|
||||
return ..(forced)
|
||||
return ..(forced)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
requires_ntnet = 1
|
||||
network_destination = "alarm monitoring network"
|
||||
size = 5
|
||||
tgui_id = "ntos_station_alert"
|
||||
tgui_id = "NtosStationAlertConsole"
|
||||
ui_x = 315
|
||||
ui_y = 500
|
||||
|
||||
|
||||
@@ -8,9 +8,8 @@
|
||||
available_on_ntnet = 0
|
||||
unsendable = 1
|
||||
undeletable = 1
|
||||
tgui_id = "synd_contract"
|
||||
ui_style = "syndicate"
|
||||
ui_x = 600
|
||||
tgui_id = "SyndContractor"
|
||||
ui_x = 500
|
||||
ui_y = 600
|
||||
var/error = ""
|
||||
var/page = CONTRACT_UPLINK_PAGE_CONTRACTS
|
||||
@@ -165,4 +164,4 @@
|
||||
screen_to_be = "assign"
|
||||
program_icon_state = screen_to_be
|
||||
update_computer_icon()
|
||||
return data
|
||||
return data
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
program_icon_state = "hostile"
|
||||
extended_desc = "This advanced script can perform denial of service attacks against NTNet quantum relays. The system administrator will probably notice this. Multiple devices can run this program together against same relay for increased effect"
|
||||
size = 20
|
||||
requires_ntnet = 1
|
||||
available_on_ntnet = 0
|
||||
available_on_syndinet = 1
|
||||
tgui_id = "ntos_net_dos"
|
||||
ui_style = "syndicate"
|
||||
requires_ntnet = TRUE
|
||||
available_on_ntnet = FALSE
|
||||
available_on_syndinet = TRUE
|
||||
tgui_id = "NtosNetDos"
|
||||
ui_x = 400
|
||||
ui_y = 250
|
||||
|
||||
@@ -97,4 +96,4 @@
|
||||
data["relays"] += list(list("id" = R.uid))
|
||||
data["focus"] = target ? target.uid : null
|
||||
|
||||
return data
|
||||
return data
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
program_icon_state = "hostile"
|
||||
extended_desc = "This virus can destroy hard drive of system it is executed on. It may be obfuscated to look like another non-malicious program. Once armed, it will destroy the system upon next execution."
|
||||
size = 13
|
||||
requires_ntnet = 0
|
||||
available_on_ntnet = 0
|
||||
available_on_syndinet = 1
|
||||
tgui_id = "ntos_revelation"
|
||||
ui_style = "syndicate"
|
||||
requires_ntnet = FALSE
|
||||
available_on_ntnet = FALSE
|
||||
available_on_syndinet = TRUE
|
||||
tgui_id = "NtosRevelation"
|
||||
ui_x = 400
|
||||
ui_y = 250
|
||||
|
||||
@@ -68,4 +67,4 @@
|
||||
|
||||
data["armed"] = armed
|
||||
|
||||
return data
|
||||
return data
|
||||
|
||||
176
code/modules/modular_computers/file_system/programs/arcade.dm
Normal file
176
code/modules/modular_computers/file_system/programs/arcade.dm
Normal file
@@ -0,0 +1,176 @@
|
||||
/datum/computer_file/program/arcade
|
||||
filename = "arcade"
|
||||
filedesc = "Nanotrasen Micro Arcade"
|
||||
program_icon_state = "arcade"
|
||||
extended_desc = "This port of the classic game 'Outbomb Cuban Pete', redesigned to run on tablets, with thrilling graphics and chilling storytelling."
|
||||
requires_ntnet = FALSE
|
||||
network_destination = "arcade network"
|
||||
size = 6
|
||||
tgui_id = "NtosArcade"
|
||||
ui_x = 450
|
||||
ui_y = 350
|
||||
|
||||
///Returns TRUE if the game is being played.
|
||||
var/game_active = TRUE
|
||||
///This disables buttom actions from having any impact if TRUE. Resets to FALSE when the player is allowed to make an action again.
|
||||
var/pause_state = FALSE
|
||||
var/boss_hp = 45
|
||||
var/boss_mp = 15
|
||||
var/player_hp = 30
|
||||
var/player_mp = 10
|
||||
var/ticket_count = 0
|
||||
///Shows what text is shown on the app, usually showing the log of combat actions taken by the player.
|
||||
var/heads_up = "Nanotrasen says, winners make us money."
|
||||
var/boss_name = "Cuban Pete's Minion"
|
||||
///Determines which boss image to use on the UI.
|
||||
var/boss_id = 1
|
||||
|
||||
/datum/computer_file/program/arcade/proc/game_check(mob/user)
|
||||
sleep(5)
|
||||
user?.mind?.adjust_experience(/datum/skill/gaming, 1)
|
||||
if(boss_hp <= 0)
|
||||
heads_up = "You have crushed [boss_name]! Rejoice!"
|
||||
playsound(computer.loc, 'sound/arcade/win.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
game_active = FALSE
|
||||
program_icon_state = "arcade_off"
|
||||
if(istype(computer))
|
||||
computer.update_icon()
|
||||
ticket_count += 1
|
||||
user?.mind?.adjust_experience(/datum/skill/gaming, 50)
|
||||
sleep(10)
|
||||
else if(player_hp <= 0 || player_mp <= 0)
|
||||
heads_up = "You have been defeated... how will the station survive?"
|
||||
playsound(computer.loc, 'sound/arcade/lose.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
game_active = FALSE
|
||||
program_icon_state = "arcade_off"
|
||||
if(istype(computer))
|
||||
computer.update_icon()
|
||||
user?.mind?.adjust_experience(/datum/skill/gaming, 10)
|
||||
sleep(10)
|
||||
|
||||
/datum/computer_file/program/arcade/proc/enemy_check(mob/user)
|
||||
var/boss_attackamt = 0 //Spam protection from boss attacks as well.
|
||||
var/boss_mpamt = 0
|
||||
var/bossheal = 0
|
||||
if(pause_state == TRUE)
|
||||
boss_attackamt = rand(3,6)
|
||||
boss_mpamt = rand (2,4)
|
||||
bossheal = rand (4,6)
|
||||
if(game_active == FALSE)
|
||||
return
|
||||
if (boss_mp <= 5)
|
||||
heads_up = "[boss_mpamt] magic power has been stolen from you!"
|
||||
playsound(computer.loc, 'sound/arcade/steal.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
player_mp -= boss_mpamt
|
||||
boss_mp += boss_mpamt
|
||||
else if(boss_mp > 5 && boss_hp <12)
|
||||
heads_up = "[boss_name] heals for [bossheal] health!"
|
||||
playsound(computer.loc, 'sound/arcade/heal.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
boss_hp += bossheal
|
||||
boss_mp -= boss_mpamt
|
||||
else
|
||||
heads_up = "[boss_name] attacks you for [boss_attackamt] damage!"
|
||||
playsound(computer.loc, 'sound/arcade/hit.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
player_hp -= boss_attackamt
|
||||
|
||||
pause_state = FALSE
|
||||
game_check()
|
||||
|
||||
/datum/computer_file/program/arcade/ui_interact(mob/user, ui_key, datum/tgui/ui, force_open, datum/tgui/master_ui, datum/ui_state/state)
|
||||
. = ..()
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/simple/arcade)
|
||||
assets.send(user)
|
||||
|
||||
/datum/computer_file/program/arcade/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
|
||||
data["Hitpoints"] = boss_hp
|
||||
data["PlayerHitpoints"] = player_hp
|
||||
data["PlayerMP"] = player_mp
|
||||
data["TicketCount"] = ticket_count
|
||||
data["GameActive"] = game_active
|
||||
data["PauseState"] = pause_state
|
||||
data["Status"] = heads_up
|
||||
data["BossID"] = "boss[boss_id].gif"
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/arcade/ui_act(action, list/params)
|
||||
if(..())
|
||||
return TRUE
|
||||
var/obj/item/computer_hardware/printer/printer
|
||||
if(computer)
|
||||
printer = computer.all_components[MC_PRINT]
|
||||
|
||||
var/gamerSkillLevel = usr.mind?.get_skill_level(/datum/skill/gaming)
|
||||
var/gamerSkill = usr.mind?.get_skill_modifier(/datum/skill/gaming, SKILL_RANDS_MODIFIER)
|
||||
switch(action)
|
||||
if("Attack")
|
||||
var/attackamt = 0 //Spam prevention.
|
||||
if(pause_state == FALSE)
|
||||
attackamt = rand(2,6) + rand(0, gamerSkill)
|
||||
pause_state = TRUE
|
||||
heads_up = "You attack for [attackamt] damage."
|
||||
playsound(computer.loc, 'sound/arcade/hit.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
boss_hp -= attackamt
|
||||
sleep(10)
|
||||
game_check()
|
||||
enemy_check()
|
||||
return TRUE
|
||||
if("Heal")
|
||||
var/healamt = 0 //More Spam Prevention.
|
||||
var/healcost = 0
|
||||
if(pause_state == FALSE)
|
||||
healamt = rand(6,8) + rand(0, gamerSkill)
|
||||
var/maxPointCost = 3
|
||||
if(gamerSkillLevel >= SKILL_LEVEL_JOURNEYMAN)
|
||||
maxPointCost = 2
|
||||
healcost = rand(1, maxPointCost)
|
||||
pause_state = TRUE
|
||||
heads_up = "You heal for [healamt] damage."
|
||||
playsound(computer.loc, 'sound/arcade/heal.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
player_hp += healamt
|
||||
player_mp -= healcost
|
||||
sleep(10)
|
||||
game_check()
|
||||
enemy_check()
|
||||
return TRUE
|
||||
if("Recharge_Power")
|
||||
var/rechargeamt = 0 //As above.
|
||||
if(pause_state == FALSE)
|
||||
rechargeamt = rand(4,7) + rand(0, gamerSkill)
|
||||
pause_state = TRUE
|
||||
heads_up = "You regain [rechargeamt] magic power."
|
||||
playsound(computer.loc, 'sound/arcade/mana.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
player_mp += rechargeamt
|
||||
sleep(10)
|
||||
game_check()
|
||||
enemy_check()
|
||||
return TRUE
|
||||
if("Dispense_Tickets")
|
||||
if(!printer)
|
||||
to_chat(usr, "<span class='notice'>Hardware error: A printer is required to redeem tickets.</span>")
|
||||
return
|
||||
if(printer.stored_paper <= 0)
|
||||
to_chat(usr, "<span class='notice'>Hardware error: Printer is out of paper.</span>")
|
||||
return
|
||||
else
|
||||
computer.visible_message("<span class='notice'>\The [computer] prints out paper.</span>")
|
||||
if(ticket_count >= 1)
|
||||
new /obj/item/stack/arcadeticket((get_turf(computer)), 1)
|
||||
to_chat(usr, "<span class='notice'>[src] dispenses a ticket!</span>")
|
||||
ticket_count -= 1
|
||||
printer.stored_paper -= 1
|
||||
else
|
||||
to_chat(usr, "<span class='notice'>You don't have any stored tickets!</span>")
|
||||
return TRUE
|
||||
if("Start_Game")
|
||||
game_active = TRUE
|
||||
boss_hp = 45
|
||||
player_hp = 30
|
||||
player_mp = 10
|
||||
heads_up = "You stand before [boss_name]! Prepare for battle!"
|
||||
program_icon_state = "arcade"
|
||||
boss_id = rand(1,6)
|
||||
pause_state = FALSE
|
||||
if(istype(computer))
|
||||
computer.update_icon()
|
||||
@@ -0,0 +1,33 @@
|
||||
/datum/computer_file/program/atmosscan
|
||||
filename = "atmosscan"
|
||||
filedesc = "Atmospheric Scanner"
|
||||
program_icon_state = "air"
|
||||
extended_desc = "A small built-in sensor reads out the atmospheric conditions around the device."
|
||||
network_destination = "atmos scan"
|
||||
size = 4
|
||||
tgui_id = "NtosAtmos"
|
||||
ui_x = 300
|
||||
ui_y = 350
|
||||
|
||||
/datum/computer_file/program/atmosscan/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
var/list/airlist = list()
|
||||
var/turf/T = get_turf(ui_host())
|
||||
if(T)
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
var/list/env_gases = environment.gases
|
||||
var/pressure = environment.return_pressure()
|
||||
var/total_moles = environment.total_moles()
|
||||
data["AirPressure"] = round(pressure,0.1)
|
||||
data["AirTemp"] = round(environment.temperature-T0C)
|
||||
if (total_moles)
|
||||
for(var/id in env_gases)
|
||||
var/gas_level = env_gases[id][MOLES]/total_moles
|
||||
if(gas_level > 0)
|
||||
airlist += list(list("name" = "[env_gases[id][GAS_META][META_GAS_NAME]]", "percentage" = round(gas_level*100, 0.01)))
|
||||
data["AirData"] = airlist
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/atmosscan/ui_act(action, list/params)
|
||||
if(..())
|
||||
return TRUE
|
||||
@@ -0,0 +1,69 @@
|
||||
/datum/computer_file/program/borg_monitor
|
||||
filename = "cyborgmonitor"
|
||||
filedesc = "Cyborg Remote Monitoring"
|
||||
ui_header = "borg_mon.gif"
|
||||
program_icon_state = "generic"
|
||||
extended_desc = "This program allows for remote monitoring of station cyborgs."
|
||||
requires_ntnet = TRUE
|
||||
transfer_access = ACCESS_ROBOTICS
|
||||
network_destination = "cyborg remote monitoring"
|
||||
size = 5
|
||||
tgui_id = "NtosCyborgRemoteMonitor"
|
||||
ui_x = 600
|
||||
ui_y = 800
|
||||
|
||||
/datum/computer_file/program/borg_monitor/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
|
||||
data["card"] = FALSE
|
||||
if(computer.GetID())
|
||||
data["card"] = TRUE
|
||||
|
||||
data["cyborgs"] = list()
|
||||
for(var/mob/living/silicon/robot/R in GLOB.silicon_mobs)
|
||||
if((get_turf(computer)).z != (get_turf(R)).z)
|
||||
continue
|
||||
if(R.scrambledcodes)
|
||||
continue
|
||||
|
||||
var/list/upgrade
|
||||
for(var/obj/item/borg/upgrade/I in R.upgrades)
|
||||
upgrade += "\[[I.name]\] "
|
||||
|
||||
var/shell = FALSE
|
||||
if(R.shell && !R.ckey)
|
||||
shell = TRUE
|
||||
|
||||
var/list/cyborg_data = list(
|
||||
name = R.name,
|
||||
locked_down = R.lockcharge,
|
||||
status = R.stat,
|
||||
shell_discon = shell,
|
||||
charge = R.cell ? round(R.cell.percent()) : null,
|
||||
module = R.module ? "[R.module.name] Module" : "No Module Detected",
|
||||
upgrades = upgrade,
|
||||
ref = REF(R)
|
||||
)
|
||||
data["cyborgs"] += list(cyborg_data)
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/borg_monitor/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
switch(action)
|
||||
if("messagebot")
|
||||
var/mob/living/silicon/robot/R = locate(params["ref"]) in GLOB.silicon_mobs
|
||||
if(!istype(R))
|
||||
return
|
||||
var/obj/item/card/id/ID = computer.GetID()
|
||||
if(!ID)
|
||||
return
|
||||
var/message = stripped_input(usr, message = "Enter message to be sent to remote cyborg.", title = "Send Message")
|
||||
if(!message)
|
||||
return
|
||||
to_chat(R, "<br><br><span class='notice'>Message from [ID.registered_name] -- \"[message]\"</span><br>")
|
||||
SEND_SOUND(R, 'sound/machines/twobeep_high.ogg')
|
||||
if(R.connected_ai)
|
||||
to_chat(R.connected_ai, "<br><br><span class='notice'>Message from [ID.registered_name] to [R] -- \"[message]\"</span><br>")
|
||||
SEND_SOUND(R.connected_ai, 'sound/machines/twobeep_high.ogg')
|
||||
@@ -6,91 +6,84 @@
|
||||
transfer_access = ACCESS_HEADS
|
||||
requires_ntnet = 0
|
||||
size = 8
|
||||
tgui_id = "ntos_card"
|
||||
ui_x = 600
|
||||
ui_y = 700
|
||||
tgui_id = "NtosCard"
|
||||
ui_x = 450
|
||||
ui_y = 520
|
||||
|
||||
var/mod_mode = 1
|
||||
var/is_centcom = 0
|
||||
var/show_assignments = 0
|
||||
var/minor = 0
|
||||
var/authenticated = 0
|
||||
var/list/reg_ids = list()
|
||||
var/list/region_access = null
|
||||
var/list/head_subordinates = null
|
||||
var/target_dept = 0 //Which department this computer has access to. 0=all departments
|
||||
var/change_position_cooldown = 30
|
||||
//Jobs you cannot open new positions for
|
||||
var/list/blacklisted = list(
|
||||
"AI",
|
||||
"Assistant",
|
||||
"Cyborg",
|
||||
"Captain",
|
||||
"Head of Personnel",
|
||||
"Head of Security",
|
||||
"Chief Engineer",
|
||||
"Research Director",
|
||||
"Chief Medical Officer")
|
||||
var/is_centcom = FALSE
|
||||
var/minor = FALSE
|
||||
var/authenticated = FALSE
|
||||
var/list/region_access
|
||||
var/list/head_subordinates
|
||||
///Which departments this computer has access to. Defined as access regions. null = all departments
|
||||
var/target_dept
|
||||
|
||||
//The scaling factor of max total positions in relation to the total amount of people on board the station in %
|
||||
var/max_relative_positions = 30 //30%: Seems reasonable, limit of 6 @ 20 players
|
||||
//For some reason everything was exploding if this was static.
|
||||
var/list/sub_managers
|
||||
|
||||
//This is used to keep track of opened positions for jobs to allow instant closing
|
||||
//Assoc array: "JobName" = (int)<Opened Positions>
|
||||
var/list/opened_positions = list();
|
||||
/datum/computer_file/program/card_mod/New(obj/item/modular_computer/comp)
|
||||
. = ..()
|
||||
sub_managers = list(
|
||||
"[ACCESS_HOP]" = list(
|
||||
"department" = list(CARDCON_DEPARTMENT_SERVICE, CARDCON_DEPARTMENT_COMMAND),
|
||||
"region" = 1,
|
||||
"head" = "Head of Personnel"
|
||||
),
|
||||
"[ACCESS_HOS]" = list(
|
||||
"department" = CARDCON_DEPARTMENT_SECURITY,
|
||||
"region" = 2,
|
||||
"head" = "Head of Security"
|
||||
),
|
||||
"[ACCESS_CMO]" = list(
|
||||
"department" = CARDCON_DEPARTMENT_MEDICAL,
|
||||
"region" = 3,
|
||||
"head" = "Chief Medical Officer"
|
||||
),
|
||||
"[ACCESS_RD]" = list(
|
||||
"department" = CARDCON_DEPARTMENT_SCIENCE,
|
||||
"region" = 4,
|
||||
"head" = "Research Director"
|
||||
),
|
||||
"[ACCESS_CE]" = list(
|
||||
"department" = CARDCON_DEPARTMENT_ENGINEERING,
|
||||
"region" = 5,
|
||||
"head" = "Chief Engineer"
|
||||
)
|
||||
)
|
||||
|
||||
/datum/computer_file/program/card_mod/New()
|
||||
..()
|
||||
addtimer(CALLBACK(src, .proc/SetConfigCooldown), 0)
|
||||
/datum/computer_file/program/card_mod/proc/authenticate(mob/user, obj/item/card/id/id_card)
|
||||
if(!id_card)
|
||||
return
|
||||
|
||||
/datum/computer_file/program/card_mod/proc/SetConfigCooldown()
|
||||
change_position_cooldown = CONFIG_GET(number/id_console_jobslot_delay)
|
||||
region_access = list()
|
||||
if(!target_dept && (ACCESS_CHANGE_IDS in id_card.access))
|
||||
minor = FALSE
|
||||
authenticated = TRUE
|
||||
update_static_data(user)
|
||||
return TRUE
|
||||
|
||||
/datum/computer_file/program/card_mod/event_idremoved(background, slot)
|
||||
if(!slot || slot == 2)// slot being false means both are removed
|
||||
minor = 0
|
||||
authenticated = 0
|
||||
head_subordinates = null
|
||||
region_access = null
|
||||
var/list/head_types = list()
|
||||
for(var/access_text in sub_managers)
|
||||
var/list/info = sub_managers[access_text]
|
||||
var/access = text2num(access_text)
|
||||
if((access in id_card.access) && ((info["region"] in target_dept) || !length(target_dept)))
|
||||
region_access += info["region"]
|
||||
//I don't even know what I'm doing anymore
|
||||
head_types += info["head"]
|
||||
|
||||
head_subordinates = list()
|
||||
if(length(head_types))
|
||||
for(var/j in SSjob.occupations)
|
||||
var/datum/job/job = j
|
||||
for(var/head in head_types)//god why
|
||||
if(head in job.department_head)
|
||||
head_subordinates += job.title
|
||||
|
||||
/datum/computer_file/program/card_mod/proc/job_blacklisted(jobtitle)
|
||||
return (jobtitle in blacklisted)
|
||||
|
||||
|
||||
//Logic check for if you can open the job
|
||||
/datum/computer_file/program/card_mod/proc/can_open_job(datum/job/job)
|
||||
if(job)
|
||||
if(!job_blacklisted(job.title))
|
||||
if((job.total_positions <= GLOB.player_list.len * (max_relative_positions / 100)))
|
||||
var/delta = (world.time / 10) - GLOB.time_last_changed_position
|
||||
if((change_position_cooldown < delta) || (opened_positions[job.title] < 0))
|
||||
return 1
|
||||
return -2
|
||||
return 0
|
||||
return 0
|
||||
|
||||
//Logic check for if you can close the job
|
||||
/datum/computer_file/program/card_mod/proc/can_close_job(datum/job/job)
|
||||
if(job)
|
||||
if(!job_blacklisted(job.title))
|
||||
if(job.total_positions > job.current_positions)
|
||||
var/delta = (world.time / 10) - GLOB.time_last_changed_position
|
||||
if((change_position_cooldown < delta) || (opened_positions[job.title] > 0))
|
||||
return 1
|
||||
return -2
|
||||
return 0
|
||||
return 0
|
||||
|
||||
/datum/computer_file/program/card_mod/proc/format_jobs(list/jobs)
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = computer.all_components[MC_CARD]
|
||||
var/obj/item/card/id/id_card = card_slot.stored_card
|
||||
var/list/formatted = list()
|
||||
for(var/job in jobs)
|
||||
formatted.Add(list(list(
|
||||
"display_name" = replacetext(job, " ", " "),
|
||||
"target_rank" = id_card && id_card.assignment ? id_card.assignment : "Unassigned",
|
||||
"job" = job)))
|
||||
if(length(region_access))
|
||||
minor = TRUE
|
||||
authenticated = TRUE
|
||||
update_static_data(user)
|
||||
return TRUE
|
||||
|
||||
return formatted
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/datum/computer_file/program/shipping
|
||||
filename = "shipping"
|
||||
filedesc = "Nanotrasen Shipping Scanner"
|
||||
program_icon_state = "shipping"
|
||||
extended_desc = "A combination printer/scanner app that enables modular computers to print barcodes for easy scanning and shipping."
|
||||
network_destination = "ship scanner"
|
||||
size = 6
|
||||
tgui_id = "NtosShipping"
|
||||
ui_x = 450
|
||||
ui_y = 350
|
||||
///Account used for creating barcodes.
|
||||
var/datum/bank_account/payments_acc
|
||||
///The amount which the tagger will recieve for the sale.
|
||||
var/percent_cut = 20
|
||||
|
||||
/datum/computer_file/program/shipping/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = computer.all_components[MC_CARD]
|
||||
var/obj/item/computer_hardware/printer/printer = computer.all_components[MC_PRINT]
|
||||
var/obj/item/card/id/id_card = card_slot ? card_slot.stored_card : null
|
||||
data["has_id_slot"] = !!card_slot
|
||||
data["has_printer"] = !!printer
|
||||
data["paperamt"] = printer ? "[printer.stored_paper] / [printer.max_paper]" : null
|
||||
data["card_owner"] = card_slot && card_slot.stored_card ? id_card.registered_name : "No Card Inserted."
|
||||
data["current_user"] = payments_acc ? payments_acc.account_holder : null
|
||||
data["barcode_split"] = percent_cut
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/shipping/ui_act(action, list/params)
|
||||
if(..())
|
||||
return TRUE
|
||||
if(!computer)
|
||||
return
|
||||
|
||||
// Get components
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = computer.all_components[MC_CARD]
|
||||
var/obj/item/computer_hardware/printer/printer = computer.all_components[MC_PRINT]
|
||||
var/obj/item/card/id/id_card = card_slot ? card_slot.stored_card : null
|
||||
if(!card_slot || !printer) //We need both to successfully use this app.
|
||||
return
|
||||
|
||||
switch(action)
|
||||
if("ejectid")
|
||||
if(id_card)
|
||||
card_slot.try_eject(TRUE, usr)
|
||||
if("selectid")
|
||||
if(!id_card)
|
||||
return
|
||||
if(!id_card.registered_account)
|
||||
playsound(get_turf(ui_host()), 'sound/machines/buzz-sigh.ogg', 50, TRUE, -1)
|
||||
return
|
||||
payments_acc = id_card.registered_account
|
||||
playsound(get_turf(ui_host()), 'sound/machines/ping.ogg', 50, TRUE, -1)
|
||||
if("resetid")
|
||||
payments_acc = null
|
||||
if("setsplit")
|
||||
var/potential_cut = input("How much would you like to payout to the registered card?","Percentage Profit") as num|null
|
||||
percent_cut = potential_cut ? clamp(round(potential_cut, 1), 1, 50) : 20
|
||||
if("print")
|
||||
if(!printer)
|
||||
to_chat(usr, "<span class='notice'>Hardware error: A printer is required to print barcodes.</span>")
|
||||
return
|
||||
if(printer.stored_paper <= 0)
|
||||
to_chat(usr, "<span class='notice'>Hardware error: Printer is out of paper.</span>")
|
||||
return
|
||||
if(!payments_acc)
|
||||
to_chat(usr, "<span class='notice'>Software error: Please set a current user first.</span>")
|
||||
return
|
||||
var/obj/item/barcode/barcode = new /obj/item/barcode(get_turf(ui_host()))
|
||||
barcode.payments_acc = payments_acc
|
||||
barcode.percent_cut = percent_cut
|
||||
printer.stored_paper--
|
||||
to_chat(usr, "<span class='notice'>The computer prints out a barcode.</span>")
|
||||
@@ -14,7 +14,7 @@
|
||||
ui_y = 630
|
||||
available_on_ntnet = 0
|
||||
requires_ntnet = 0
|
||||
tgui_id = "ntos_configuration"
|
||||
tgui_id = "NtosConfiguration"
|
||||
|
||||
var/obj/item/modular_computer/movable = null
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/datum/computer_file/program/crew_manifest
|
||||
filename = "crewmani"
|
||||
filedesc = "Crew Manifest"
|
||||
program_icon_state = "id"
|
||||
extended_desc = "Program for viewing and printing the current crew manifest"
|
||||
transfer_access = ACCESS_HEADS
|
||||
requires_ntnet = FALSE
|
||||
size = 4
|
||||
tgui_id = "NtosCrewManifest"
|
||||
ui_x = 400
|
||||
ui_y = 480
|
||||
|
||||
/datum/computer_file/program/crew_manifest/ui_static_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["manifest"] = GLOB.data_core.get_manifest()
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/crew_manifest/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
|
||||
var/obj/item/computer_hardware/printer/printer
|
||||
if(computer)
|
||||
printer = computer.all_components[MC_PRINT]
|
||||
|
||||
if(computer)
|
||||
data["have_printer"] = !!printer
|
||||
else
|
||||
data["have_printer"] = FALSE
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/crew_manifest/ui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/obj/item/computer_hardware/printer/printer
|
||||
if(computer)
|
||||
printer = computer.all_components[MC_PRINT]
|
||||
|
||||
switch(action)
|
||||
if("PRG_print")
|
||||
if(computer && printer) //This option should never be called if there is no printer
|
||||
var/contents = {"<h4>Crew Manifest</h4>
|
||||
<br>
|
||||
[GLOB.data_core ? GLOB.data_core.get_manifest_html(0) : ""]
|
||||
"}
|
||||
if(!printer.print_text(contents,text("crew manifest ([])", station_time_timestamp())))
|
||||
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
|
||||
return
|
||||
else
|
||||
computer.visible_message("<span class='notice'>\The [computer] prints out a paper.</span>")
|
||||
@@ -4,10 +4,10 @@
|
||||
extended_desc = "This program allows management of files."
|
||||
program_icon_state = "generic"
|
||||
size = 8
|
||||
requires_ntnet = 0
|
||||
available_on_ntnet = 0
|
||||
undeletable = 1
|
||||
tgui_id = "ntos_file_manager"
|
||||
requires_ntnet = FALSE
|
||||
available_on_ntnet = FALSE
|
||||
undeletable = TRUE
|
||||
tgui_id = "NtosFileManager"
|
||||
|
||||
var/open_file
|
||||
var/error
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
/datum/computer_file/program/job_management
|
||||
filename = "job_manage"
|
||||
filedesc = "Job Manager"
|
||||
program_icon_state = "id"
|
||||
extended_desc = "Program for viewing and changing job slot avalibility."
|
||||
transfer_access = ACCESS_HEADS
|
||||
requires_ntnet = 0
|
||||
size = 4
|
||||
tgui_id = "NtosJobManager"
|
||||
ui_x = 400
|
||||
ui_y = 620
|
||||
|
||||
var/change_position_cooldown = 30
|
||||
//Jobs you cannot open new positions for
|
||||
var/list/blacklisted = list(
|
||||
"AI",
|
||||
"Assistant",
|
||||
"Cyborg",
|
||||
"Captain",
|
||||
"Head of Personnel",
|
||||
"Head of Security",
|
||||
"Chief Engineer",
|
||||
"Research Director",
|
||||
"Chief Medical Officer")
|
||||
|
||||
//The scaling factor of max total positions in relation to the total amount of people on board the station in %
|
||||
var/max_relative_positions = 30 //30%: Seems reasonable, limit of 6 @ 20 players
|
||||
|
||||
//This is used to keep track of opened positions for jobs to allow instant closing
|
||||
//Assoc array: "JobName" = (int)<Opened Positions>
|
||||
var/list/opened_positions = list()
|
||||
|
||||
/datum/computer_file/program/job_management/New()
|
||||
..()
|
||||
change_position_cooldown = CONFIG_GET(number/id_console_jobslot_delay)
|
||||
|
||||
/datum/computer_file/program/job_management/proc/can_open_job(datum/job/job)
|
||||
if(!(job?.title in blacklisted))
|
||||
if((job.total_positions <= length(GLOB.player_list) * (max_relative_positions / 100)))
|
||||
var/delta = (world.time / 10) - GLOB.time_last_changed_position
|
||||
if((change_position_cooldown < delta) || (opened_positions[job.title] < 0))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/computer_file/program/job_management/proc/can_close_job(datum/job/job)
|
||||
if(!(job?.title in blacklisted))
|
||||
if(job.total_positions > length(GLOB.player_list) * (max_relative_positions / 100))
|
||||
var/delta = (world.time / 10) - GLOB.time_last_changed_position
|
||||
if((change_position_cooldown < delta) || (opened_positions[job.title] > 0))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/computer_file/program/job_management/ui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/authed = FALSE
|
||||
var/mob/user = usr
|
||||
var/obj/item/card/id/user_id = user.get_idcard()
|
||||
if(user_id)
|
||||
if(ACCESS_CHANGE_IDS in user_id.access)
|
||||
authed = TRUE
|
||||
|
||||
if(!authed)
|
||||
return
|
||||
|
||||
switch(action)
|
||||
if("PRG_open_job")
|
||||
var/edit_job_target = params["target"]
|
||||
var/datum/job/j = SSjob.GetJob(edit_job_target)
|
||||
if(!j || !can_open_job(j))
|
||||
return
|
||||
if(opened_positions[edit_job_target] >= 0)
|
||||
GLOB.time_last_changed_position = world.time / 10
|
||||
j.total_positions++
|
||||
opened_positions[edit_job_target]++
|
||||
playsound(computer, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
|
||||
return TRUE
|
||||
if("PRG_close_job")
|
||||
var/edit_job_target = params["target"]
|
||||
var/datum/job/j = SSjob.GetJob(edit_job_target)
|
||||
if(!j || !can_close_job(j))
|
||||
return
|
||||
//Allow instant closing without cooldown if a position has been opened before
|
||||
if(opened_positions[edit_job_target] <= 0)
|
||||
GLOB.time_last_changed_position = world.time / 10
|
||||
j.total_positions--
|
||||
opened_positions[edit_job_target]--
|
||||
playsound(computer, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
|
||||
return TRUE
|
||||
if("PRG_priority")
|
||||
if(length(SSjob.prioritized_jobs) >= 5)
|
||||
return
|
||||
var/priority_target = params["target"]
|
||||
var/datum/job/j = SSjob.GetJob(priority_target)
|
||||
if(!j)
|
||||
return
|
||||
if(j.total_positions <= j.current_positions)
|
||||
return
|
||||
if(j in SSjob.prioritized_jobs)
|
||||
SSjob.prioritized_jobs -= j
|
||||
else
|
||||
SSjob.prioritized_jobs += j
|
||||
playsound(computer, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/computer_file/program/job_management/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
|
||||
var/authed = FALSE
|
||||
var/obj/item/card/id/user_id = user.get_idcard(FALSE)
|
||||
if(user_id)
|
||||
if(ACCESS_CHANGE_IDS in user_id.access)
|
||||
authed = TRUE
|
||||
|
||||
data["authed"] = authed
|
||||
|
||||
var/list/pos = list()
|
||||
for(var/j in SSjob.occupations)
|
||||
var/datum/job/job = j
|
||||
if(job.title in blacklisted)
|
||||
continue
|
||||
|
||||
pos += list(list(
|
||||
"title" = job.title,
|
||||
"current" = job.current_positions,
|
||||
"total" = job.total_positions,
|
||||
"status_open" = authed ? can_open_job(job) : FALSE,
|
||||
"status_close" = authed ? can_close_job(job) : FALSE,
|
||||
))
|
||||
data["slots"] = pos
|
||||
var/delta = round(change_position_cooldown - ((world.time / 10) - GLOB.time_last_changed_position), 1)
|
||||
data["cooldown"] = delta < 0 ? 0 : delta
|
||||
var/list/priority = list()
|
||||
for(var/j in SSjob.prioritized_jobs)
|
||||
var/datum/job/job = j
|
||||
priority += job.title
|
||||
data["prioritized"] = priority
|
||||
return data
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
requires_ntnet_feature = NTNET_SOFTWAREDOWNLOAD
|
||||
available_on_ntnet = 0
|
||||
ui_header = "downloader_finished.gif"
|
||||
tgui_id = "ntos_net_downloader"
|
||||
tgui_id = "NtosNetDownloader"
|
||||
ui_x = 480
|
||||
ui_y = 735
|
||||
|
||||
var/datum/computer_file/program/downloaded_file = null
|
||||
var/hacked_download = 0
|
||||
@@ -168,4 +170,4 @@
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/kill_program(forced)
|
||||
abort_file_download()
|
||||
return ..(forced)
|
||||
return ..(forced)
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
size = 12
|
||||
requires_ntnet = 1
|
||||
required_access = ACCESS_NETWORK //NETWORK CONTROL IS A MORE SECURE PROGRAM.
|
||||
available_on_ntnet = 1
|
||||
tgui_id = "ntos_net_monitor"
|
||||
available_on_ntnet = TRUE
|
||||
tgui_id = "NtosNetMonitor"
|
||||
|
||||
/datum/computer_file/program/ntnetmonitor/ui_act(action, params)
|
||||
if(..())
|
||||
@@ -78,4 +78,4 @@
|
||||
data["ntnetlogs"] += list(list("entry" = i))
|
||||
data["ntnetmaxlogs"] = SSnetworks.station_network.setting_maxlogcount
|
||||
|
||||
return data
|
||||
return data
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
network_destination = "NTNRC server"
|
||||
ui_header = "ntnrc_idle.gif"
|
||||
available_on_ntnet = 1
|
||||
tgui_id = "ntos_net_chat"
|
||||
tgui_id = "NtosNetChat"
|
||||
ui_x = 900
|
||||
ui_y = 675
|
||||
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
requires_ntnet = 0
|
||||
network_destination = "power monitoring system"
|
||||
size = 9
|
||||
tgui_id = "ntos_power_monitor"
|
||||
ui_style = "ntos"
|
||||
tgui_id = "NtosPowerMonitor"
|
||||
ui_x = 550
|
||||
ui_y = 700
|
||||
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
|
||||
/datum/computer_file/program/robocontrol
|
||||
filename = "robocontrol"
|
||||
filedesc = "Bot Remote Controller"
|
||||
program_icon_state = "robot"
|
||||
extended_desc = "A remote controller used for giving basic commands to non-sentient robots."
|
||||
transfer_access = ACCESS_ROBOTICS
|
||||
requires_ntnet = TRUE
|
||||
network_destination = "robotics control network"
|
||||
size = 12
|
||||
tgui_id = "NtosRoboControl"
|
||||
ui_x = 550
|
||||
ui_y = 550
|
||||
///Number of simple robots on-station.
|
||||
var/botcount = 0
|
||||
///Used to find the location of the user for the purposes of summoning robots.
|
||||
var/mob/current_user
|
||||
///Access granted by the used to summon robots.
|
||||
var/list/current_access = list()
|
||||
|
||||
/datum/computer_file/program/robocontrol/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
var/turf/current_turf = get_turf(ui_host())
|
||||
var/zlevel = current_turf.z
|
||||
var/list/botlist = list()
|
||||
var/list/mulelist = list()
|
||||
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = computer ? computer.all_components[MC_CARD] : null
|
||||
data["have_id_slot"] = !!card_slot
|
||||
if(computer)
|
||||
var/obj/item/card/id/id_card = card_slot ? card_slot.stored_card : null
|
||||
data["has_id"] = !!id_card
|
||||
data["id_owner"] = id_card ? id_card.registered_name : "No Card Inserted."
|
||||
data["access_on_card"] = id_card ? id_card.access : null
|
||||
|
||||
botcount = 0
|
||||
current_user = user
|
||||
|
||||
for(var/B in GLOB.bots_list)
|
||||
var/mob/living/simple_animal/bot/Bot = B
|
||||
if(!Bot.on || Bot.z != zlevel || Bot.remote_disabled) //Only non-emagged bots on the same Z-level are detected!
|
||||
continue //Also, the PDA must have access to the bot type.
|
||||
var/list/newbot = list("name" = Bot.name, "mode" = Bot.get_mode_ui(), "model" = Bot.model, "locat" = get_area(Bot), "bot_ref" = REF(Bot), "mule_check" = FALSE)
|
||||
if(Bot.bot_type == MULE_BOT)
|
||||
var/mob/living/simple_animal/bot/mulebot/MULE = Bot
|
||||
mulelist += list(list("name" = MULE.name, "dest" = MULE.destination, "power" = MULE.cell ? MULE.cell.percent() : 0, "home" = MULE.home_destination, "autoReturn" = MULE.auto_return, "autoPickup" = MULE.auto_pickup, "reportDelivery" = MULE.report_delivery, "mule_ref" = REF(MULE)))
|
||||
if(MULE.load)
|
||||
data["load"] = MULE.load.name
|
||||
newbot["mule_check"] = TRUE
|
||||
botlist += list(newbot)
|
||||
|
||||
data["bots"] = botlist
|
||||
data["mules"] = mulelist
|
||||
data["botcount"] = botlist.len
|
||||
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/robocontrol/ui_act(action, list/params)
|
||||
if(..())
|
||||
return TRUE
|
||||
var/obj/item/computer_hardware/card_slot/card_slot
|
||||
var/obj/item/card/id/id_card
|
||||
if(computer)
|
||||
card_slot = computer.all_components[MC_CARD]
|
||||
if(card_slot)
|
||||
id_card = card_slot.stored_card
|
||||
|
||||
var/list/standard_actions = list("patroloff", "patrolon", "ejectpai")
|
||||
var/list/MULE_actions = list("stop", "go", "home", "destination", "setid", "sethome", "unload", "autoret", "autopick", "report", "ejectpai")
|
||||
var/mob/living/simple_animal/bot/Bot = locate(params["robot"]) in GLOB.bots_list
|
||||
if (action in standard_actions)
|
||||
Bot.bot_control(action, current_user, current_access)
|
||||
if (action in MULE_actions)
|
||||
Bot.bot_control(action, current_user, current_access, TRUE)
|
||||
switch(action)
|
||||
if("summon")
|
||||
Bot.bot_control(action, current_user, id_card ? id_card.access : current_access)
|
||||
if("ejectcard")
|
||||
if(!computer || !card_slot)
|
||||
return
|
||||
if(id_card)
|
||||
GLOB.data_core.manifest_modify(id_card.registered_name, id_card.assignment)
|
||||
card_slot.try_eject(TRUE, current_user)
|
||||
else
|
||||
playsound(get_turf(ui_host()) , 'sound/machines/buzz-sigh.ogg', 25, FALSE)
|
||||
return
|
||||
@@ -8,8 +8,7 @@
|
||||
transfer_access = ACCESS_CONSTRUCTION
|
||||
network_destination = "supermatter monitoring system"
|
||||
size = 5
|
||||
tgui_id = "ntos_supermatter_monitor"
|
||||
ui_style = "ntos"
|
||||
tgui_id = "NtosSupermatterMonitor"
|
||||
ui_x = 600
|
||||
ui_y = 350
|
||||
var/last_status = SUPERMATTER_INACTIVE
|
||||
@@ -124,4 +123,4 @@
|
||||
for(var/obj/machinery/power/supermatter_crystal/S in supermatters)
|
||||
if(S.uid == newuid)
|
||||
active = S
|
||||
return TRUE
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user