h. Updates NTOS, and axes p2p filetransfer!
This commit is contained in:
@@ -9,8 +9,6 @@
|
||||
transfer_access = ACCESS_HEADS
|
||||
available_on_ntnet = TRUE
|
||||
tgui_id = "NtosAiRestorer"
|
||||
ui_x = 370
|
||||
ui_y = 400
|
||||
/// Variable dictating if we are in the process of restoring the AI in the inserted intellicard
|
||||
var/restoring = FALSE
|
||||
|
||||
@@ -74,8 +72,8 @@
|
||||
restoring = FALSE
|
||||
return
|
||||
ai_slot.locked =TRUE
|
||||
A.adjustOxyLoss(-5, 0)
|
||||
A.adjustFireLoss(-5, 0)
|
||||
A.adjustOxyLoss(-5, 0)//, FALSE)
|
||||
A.adjustFireLoss(-5, 0)//, FALSE)
|
||||
A.adjustToxLoss(-5, 0)
|
||||
A.adjustBruteLoss(-5, 0)
|
||||
A.updatehealth()
|
||||
@@ -113,7 +111,7 @@
|
||||
data["restoring"] = restoring
|
||||
data["health"] = (AI.health + 100) / 2
|
||||
data["isDead"] = AI.stat == DEAD
|
||||
data["laws"] = AI.laws.get_law_list(include_zeroth = 1)
|
||||
data["laws"] = AI.laws.get_law_list(include_zeroth = TRUE, render_html = FALSE)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
network_destination = "alarm monitoring network"
|
||||
size = 5
|
||||
tgui_id = "NtosStationAlertConsole"
|
||||
ui_x = 315
|
||||
ui_y = 500
|
||||
|
||||
var/has_alert = 0
|
||||
var/alarms = list("Fire" = list(), "Atmosphere" = list(), "Power" = list())
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/datum/computer_file/program/contract_uplink
|
||||
filename = "contractor uplink"
|
||||
filedesc = "Syndicate Contract Uplink"
|
||||
filedesc = "Syndicate Contractor Uplink"
|
||||
program_icon_state = "assign"
|
||||
extended_desc = "A standard, Syndicate issued system for handling important contracts while on the field."
|
||||
size = 10
|
||||
@@ -9,8 +9,6 @@
|
||||
unsendable = 1
|
||||
undeletable = 1
|
||||
tgui_id = "SyndContractor"
|
||||
ui_x = 500
|
||||
ui_y = 600
|
||||
var/error = ""
|
||||
var/info_screen = TRUE
|
||||
var/assigned = FALSE
|
||||
@@ -22,14 +20,18 @@
|
||||
/datum/computer_file/program/contract_uplink/ui_act(action, params)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
var/mob/living/user = usr
|
||||
var/obj/item/computer_hardware/hard_drive/small/syndicate/hard_drive = computer.all_components[MC_HDD]
|
||||
|
||||
switch(action)
|
||||
if("PRG_contract-accept")
|
||||
var/contract_id = text2num(params["contract_id"])
|
||||
|
||||
// Set as the active contract
|
||||
hard_drive.traitor_data.contractor_hub.assigned_contracts[contract_id].status = CONTRACT_STATUS_ACTIVE
|
||||
hard_drive.traitor_data.contractor_hub.current_contract = hard_drive.traitor_data.contractor_hub.assigned_contracts[contract_id]
|
||||
|
||||
program_icon_state = "single_contract"
|
||||
return TRUE
|
||||
if("PRG_login")
|
||||
@@ -38,26 +40,30 @@
|
||||
// Bake their data right into the hard drive, or we don't allow non-antags gaining access to an unused
|
||||
// contract system.
|
||||
// We also create their contracts at this point.
|
||||
if(traitor_data)
|
||||
if (traitor_data)
|
||||
// Only play greet sound, and handle contractor hub when assigning for the first time.
|
||||
if(!traitor_data.contractor_hub)
|
||||
if (!traitor_data.contractor_hub)
|
||||
user.playsound_local(user, 'sound/effects/contractstartup.ogg', 100, FALSE)
|
||||
traitor_data.contractor_hub = new
|
||||
traitor_data.contractor_hub.create_hub_items()
|
||||
|
||||
// Stops any topic exploits such as logging in multiple times on a single system.
|
||||
if(!assigned)
|
||||
if (!assigned)
|
||||
traitor_data.contractor_hub.create_contracts(traitor_data.owner)
|
||||
|
||||
hard_drive.traitor_data = traitor_data
|
||||
|
||||
program_icon_state = "contracts"
|
||||
assigned = TRUE
|
||||
else
|
||||
error = "UNAUTHORIZED USER"
|
||||
return TRUE
|
||||
if("PRG_call_extraction")
|
||||
if(hard_drive.traitor_data.contractor_hub.current_contract.status != CONTRACT_STATUS_EXTRACTING)
|
||||
if(hard_drive.traitor_data.contractor_hub.current_contract.handle_extraction(user))
|
||||
if (hard_drive.traitor_data.contractor_hub.current_contract.status != CONTRACT_STATUS_EXTRACTING)
|
||||
if (hard_drive.traitor_data.contractor_hub.current_contract.handle_extraction(user))
|
||||
user.playsound_local(user, 'sound/effects/confirmdropoff.ogg', 100, TRUE)
|
||||
hard_drive.traitor_data.contractor_hub.current_contract.status = CONTRACT_STATUS_EXTRACTING
|
||||
|
||||
program_icon_state = "extracted"
|
||||
else
|
||||
user.playsound_local(user, 'sound/machines/uplinkerror.ogg', 50)
|
||||
@@ -65,15 +71,19 @@
|
||||
else
|
||||
user.playsound_local(user, 'sound/machines/uplinkerror.ogg', 50)
|
||||
error = "Already extracting... Place the target into the pod. If the pod was destroyed, this contract is no longer possible."
|
||||
|
||||
return TRUE
|
||||
if("PRG_contract_abort")
|
||||
var/contract_id = hard_drive.traitor_data.contractor_hub.current_contract.id
|
||||
|
||||
hard_drive.traitor_data.contractor_hub.current_contract = null
|
||||
hard_drive.traitor_data.contractor_hub.assigned_contracts[contract_id].status = CONTRACT_STATUS_ABORTED
|
||||
|
||||
program_icon_state = "contracts"
|
||||
|
||||
return TRUE
|
||||
if("PRG_redeem_TC")
|
||||
if(hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem)
|
||||
if (hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem)
|
||||
var/obj/item/stack/telecrystal/crystals = new /obj/item/stack/telecrystal(get_turf(user),
|
||||
hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem)
|
||||
if(ishuman(user))
|
||||
@@ -82,13 +92,14 @@
|
||||
to_chat(H, "<span class='notice'>Your payment materializes into your hands!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>Your payment materializes onto the floor.</span>")
|
||||
|
||||
hard_drive.traitor_data.contractor_hub.contract_TC_payed_out += hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem
|
||||
hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem = 0
|
||||
return TRUE
|
||||
else
|
||||
user.playsound_local(user, 'sound/machines/uplinkerror.ogg', 50)
|
||||
return TRUE
|
||||
if("PRG_clear_error")
|
||||
if ("PRG_clear_error")
|
||||
error = ""
|
||||
return TRUE
|
||||
if("PRG_set_first_load_finished")
|
||||
@@ -97,10 +108,11 @@
|
||||
if("PRG_toggle_info")
|
||||
info_screen = !info_screen
|
||||
return TRUE
|
||||
if("buy_hub")
|
||||
if(hard_drive.traitor_data.owner.current == user)
|
||||
if ("buy_hub")
|
||||
if (hard_drive.traitor_data.owner.current == user)
|
||||
var/item = params["item"]
|
||||
for(var/datum/contractor_item/hub_item in hard_drive.traitor_data.contractor_hub.hub_items)
|
||||
|
||||
for (var/datum/contractor_item/hub_item in hard_drive.traitor_data.contractor_hub.hub_items)
|
||||
if (hub_item.name == item)
|
||||
hub_item.handle_purchase(hard_drive.traitor_data.contractor_hub, user)
|
||||
else
|
||||
@@ -112,13 +124,15 @@
|
||||
var/screen_to_be = null
|
||||
|
||||
data["first_load"] = first_load
|
||||
if(hard_drive && hard_drive.traitor_data != null)
|
||||
|
||||
if (hard_drive && hard_drive.traitor_data != null)
|
||||
var/datum/antagonist/traitor/traitor_data = hard_drive.traitor_data
|
||||
data += get_header_data()
|
||||
if(traitor_data.contractor_hub.current_contract)
|
||||
|
||||
if (traitor_data.contractor_hub.current_contract)
|
||||
data["ongoing_contract"] = TRUE
|
||||
screen_to_be = "single_contract"
|
||||
if(traitor_data.contractor_hub.current_contract.status == CONTRACT_STATUS_EXTRACTING)
|
||||
if (traitor_data.contractor_hub.current_contract.status == CONTRACT_STATUS_EXTRACTING)
|
||||
data["extraction_enroute"] = TRUE
|
||||
screen_to_be = "extracted"
|
||||
else
|
||||
@@ -126,15 +140,19 @@
|
||||
else
|
||||
data["ongoing_contract"] = FALSE
|
||||
data["extraction_enroute"] = FALSE
|
||||
|
||||
data["logged_in"] = TRUE
|
||||
data["station_name"] = GLOB.station_name
|
||||
data["redeemable_tc"] = traitor_data.contractor_hub.contract_TC_to_redeem
|
||||
data["earned_tc"] = traitor_data.contractor_hub.contract_TC_payed_out
|
||||
data["contracts_completed"] = traitor_data.contractor_hub.contracts_completed
|
||||
data["contract_rep"] = traitor_data.contractor_hub.contract_rep
|
||||
|
||||
data["info_screen"] = info_screen
|
||||
|
||||
data["error"] = error
|
||||
for(var/datum/contractor_item/hub_item in traitor_data.contractor_hub.hub_items)
|
||||
|
||||
for (var/datum/contractor_item/hub_item in traitor_data.contractor_hub.hub_items)
|
||||
data["contractor_hub_items"] += list(list(
|
||||
"name" = hub_item.name,
|
||||
"desc" = hub_item.desc,
|
||||
@@ -142,7 +160,8 @@
|
||||
"limited" = hub_item.limited,
|
||||
"item_icon" = hub_item.item_icon
|
||||
))
|
||||
for(var/datum/syndicate_contract/contract in traitor_data.contractor_hub.assigned_contracts)
|
||||
|
||||
for (var/datum/syndicate_contract/contract in traitor_data.contractor_hub.assigned_contracts)
|
||||
data["contracts"] += list(list(
|
||||
"target" = contract.contract.target,
|
||||
"target_rank" = contract.target_rank,
|
||||
@@ -155,23 +174,28 @@
|
||||
))
|
||||
|
||||
var/direction
|
||||
if(traitor_data.contractor_hub.current_contract)
|
||||
if (traitor_data.contractor_hub.current_contract)
|
||||
var/turf/curr = get_turf(user)
|
||||
var/turf/dropoff_turf
|
||||
data["current_location"] = "[get_area_name(curr, TRUE)]"
|
||||
for(var/turf/content in traitor_data.contractor_hub.current_contract.contract.dropoff.contents)
|
||||
if(isturf(content))
|
||||
|
||||
for (var/turf/content in traitor_data.contractor_hub.current_contract.contract.dropoff.contents)
|
||||
if (isturf(content))
|
||||
dropoff_turf = content
|
||||
break
|
||||
|
||||
if(curr.z == dropoff_turf.z) //Direction calculations for same z-level only
|
||||
direction = uppertext(dir2text(get_dir(curr, dropoff_turf))) //Direction text (East, etc). Not as precise, but still helpful.
|
||||
if(get_area(user) == traitor_data.contractor_hub.current_contract.contract.dropoff)
|
||||
direction = "LOCATION CONFIRMED"
|
||||
else
|
||||
direction = "???"
|
||||
|
||||
data["dropoff_direction"] = direction
|
||||
|
||||
else
|
||||
data["logged_in"] = FALSE
|
||||
|
||||
program_icon_state = screen_to_be
|
||||
update_computer_icon()
|
||||
return data
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
available_on_ntnet = FALSE
|
||||
available_on_syndinet = TRUE
|
||||
tgui_id = "NtosNetDos"
|
||||
ui_x = 400
|
||||
ui_y = 250
|
||||
|
||||
var/obj/machinery/ntnet_relay/target = null
|
||||
var/dos_speed = 0
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
available_on_ntnet = FALSE
|
||||
available_on_syndinet = TRUE
|
||||
tgui_id = "NtosRevelation"
|
||||
ui_x = 400
|
||||
ui_y = 250
|
||||
|
||||
var/armed = 0
|
||||
|
||||
/datum/computer_file/program/revelation/run_program(var/mob/living/user)
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
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
|
||||
@@ -27,6 +25,7 @@
|
||||
|
||||
/datum/computer_file/program/arcade/proc/game_check(mob/user)
|
||||
sleep(5)
|
||||
//user?.mind?.adjust_experience(/datum/skill/gaming, 1) No gaming(TM) Yet
|
||||
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)
|
||||
@@ -35,6 +34,7 @@
|
||||
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?"
|
||||
@@ -43,6 +43,7 @@
|
||||
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)
|
||||
@@ -73,14 +74,13 @@
|
||||
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_assets(mob/user)
|
||||
return list(
|
||||
get_asset_datum(/datum/asset/simple/arcade),
|
||||
)
|
||||
|
||||
/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
|
||||
@@ -98,11 +98,13 @@
|
||||
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)
|
||||
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)
|
||||
@@ -115,8 +117,10 @@
|
||||
var/healamt = 0 //More Spam Prevention.
|
||||
var/healcost = 0
|
||||
if(pause_state == FALSE)
|
||||
healamt = rand(6,8)
|
||||
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."
|
||||
@@ -130,7 +134,7 @@
|
||||
if("Recharge_Power")
|
||||
var/rechargeamt = 0 //As above.
|
||||
if(pause_state == FALSE)
|
||||
rechargeamt = rand(4, 7)
|
||||
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)
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
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()
|
||||
|
||||
@@ -9,21 +9,17 @@
|
||||
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())
|
||||
if(checkID())
|
||||
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)
|
||||
if(!evaluate_borg(R))
|
||||
continue
|
||||
|
||||
var/list/upgrade
|
||||
@@ -36,7 +32,7 @@
|
||||
|
||||
var/list/cyborg_data = list(
|
||||
name = R.name,
|
||||
locked_down = R.locked_down,
|
||||
locked_down = R.lockcharge,
|
||||
status = R.stat,
|
||||
shell_discon = shell,
|
||||
charge = R.cell ? round(R.cell.percent()) : null,
|
||||
@@ -56,14 +52,53 @@
|
||||
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()
|
||||
var/ID = checkID()
|
||||
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>")
|
||||
to_chat(R, "<br><br><span class='notice'>Message from [ID] -- \"[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>")
|
||||
to_chat(R.connected_ai, "<br><br><span class='notice'>Message from [ID] to [R] -- \"[message]\"</span><br>")
|
||||
SEND_SOUND(R.connected_ai, 'sound/machines/twobeep_high.ogg')
|
||||
usr.log_talk(message, LOG_PDA, tag="Cyborg Monitor Program: ID name \"[ID]\" to [R]")
|
||||
|
||||
///This proc is used to determin if a borg should be shown in the list (based on the borg's scrambledcodes var). Syndicate version overrides this to show only syndicate borgs.
|
||||
/datum/computer_file/program/borg_monitor/proc/evaluate_borg(mob/living/silicon/robot/R)
|
||||
if((get_turf(computer)).z != (get_turf(R)).z)
|
||||
return FALSE
|
||||
if(R.scrambledcodes)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
///Gets the ID's name, if one is inserted into the device. This is a seperate proc solely to be overridden by the syndicate version of the app.
|
||||
/datum/computer_file/program/borg_monitor/proc/checkID()
|
||||
var/obj/item/card/id/ID = computer.GetID()
|
||||
if(!ID)
|
||||
return FALSE
|
||||
return ID.registered_name
|
||||
|
||||
/datum/computer_file/program/borg_monitor/syndicate
|
||||
filename = "scyborgmonitor"
|
||||
filedesc = "Mission-Specific Cyborg Remote Monitoring"
|
||||
ui_header = "borg_mon.gif"
|
||||
program_icon_state = "generic"
|
||||
extended_desc = "This program allows for remote monitoring of mission-assigned cyborgs."
|
||||
requires_ntnet = FALSE
|
||||
available_on_ntnet = FALSE
|
||||
available_on_syndinet = TRUE
|
||||
transfer_access = null
|
||||
network_destination = "cyborg remote monitoring"
|
||||
tgui_id = "NtosCyborgRemoteMonitorSyndicate"
|
||||
|
||||
/datum/computer_file/program/borg_monitor/syndicate/evaluate_borg(mob/living/silicon/robot/R)
|
||||
if((get_turf(computer)).z != (get_turf(R)).z)
|
||||
return FALSE
|
||||
if(!R.scrambledcodes)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/computer_file/program/borg_monitor/syndicate/checkID()
|
||||
return "\[CLASSIFIED\]" //no ID is needed for the syndicate version's message function, and the borg will see "[CLASSIFIED]" as the message sender.
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
/datum/computer_file/program/bounty_board
|
||||
filename = "bountyboard"
|
||||
filedesc = "Bounty Board Request Network"
|
||||
program_icon_state = "bountyboard"
|
||||
extended_desc = "A multi-platform network for placing requests across the station, with payment across the network being possible.."
|
||||
requires_ntnet = TRUE
|
||||
network_destination = "bounty board interface"
|
||||
size = 10
|
||||
tgui_id = "NtosRequestKiosk"
|
||||
///Reference to the currently logged in user.
|
||||
var/datum/bank_account/current_user
|
||||
///The station request datum being affected by UI actions.
|
||||
var/datum/station_request/active_request
|
||||
///Value of the currently bounty input
|
||||
var/bounty_value = 1
|
||||
///Text of the currently written bounty
|
||||
var/bounty_text = ""
|
||||
///Has the app been added to the network yet?
|
||||
var/networked = FALSE
|
||||
|
||||
/datum/computer_file/program/bounty_board/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
var/list/formatted_requests = list()
|
||||
var/list/formatted_applicants = list()
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = computer.all_components[MC_CARD]
|
||||
if(!networked)
|
||||
GLOB.allbountyboards += computer
|
||||
networked = TRUE
|
||||
if(card_slot && card_slot.stored_card && card_slot.stored_card.registered_account)
|
||||
current_user = card_slot.stored_card.registered_account
|
||||
for(var/i in GLOB.request_list)
|
||||
if(!i)
|
||||
continue
|
||||
var/datum/station_request/request = i
|
||||
formatted_requests += list(list("owner" = request.owner, "value" = request.value, "description" = request.description, "acc_number" = request.req_number))
|
||||
if(request.applicants)
|
||||
for(var/datum/bank_account/j in request.applicants)
|
||||
formatted_applicants += list(list("name" = j.account_holder, "request_id" = request.owner_account.account_id, "requestee_id" = j.account_id))
|
||||
if(current_user)
|
||||
data["accountName"] = current_user.account_holder
|
||||
data["requests"] = formatted_requests
|
||||
data["applicants"] = formatted_applicants
|
||||
data["bountyValue"] = bounty_value
|
||||
data["bountyText"] = bounty_text
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/bounty_board/ui_act(action, list/params)
|
||||
if(..())
|
||||
return
|
||||
var/current_ref_num = params["request"]
|
||||
var/current_app_num = params["applicant"]
|
||||
var/datum/bank_account/request_target
|
||||
if(current_ref_num)
|
||||
for(var/datum/station_request/i in GLOB.request_list)
|
||||
if("[i.req_number]" == "[current_ref_num]")
|
||||
active_request = i
|
||||
break
|
||||
if(active_request)
|
||||
for(var/datum/bank_account/j in active_request.applicants)
|
||||
if("[j.account_id]" == "[current_app_num]")
|
||||
request_target = j
|
||||
break
|
||||
switch(action)
|
||||
if("createBounty")
|
||||
if(!current_user || !bounty_text)
|
||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 20, TRUE)
|
||||
return TRUE
|
||||
for(var/datum/station_request/i in GLOB.request_list)
|
||||
if("[i.req_number]" == "[current_user.account_id]")
|
||||
computer.say("Account already has active bounty.")
|
||||
return
|
||||
var/datum/station_request/curr_request = new /datum/station_request(current_user.account_holder, bounty_value,bounty_text,current_user.account_id, current_user)
|
||||
GLOB.request_list += list(curr_request)
|
||||
for(var/obj/i in GLOB.allbountyboards)
|
||||
i.say("New bounty has been added!")
|
||||
playsound(i.loc, 'sound/effects/cashregister.ogg', 30, TRUE)
|
||||
return TRUE
|
||||
if("apply")
|
||||
if(!current_user)
|
||||
computer.say("Please swipe a valid ID first.")
|
||||
return TRUE
|
||||
if(current_user.account_holder == active_request.owner)
|
||||
playsound(computer, 'sound/machines/buzz-sigh.ogg', 20, TRUE)
|
||||
return TRUE
|
||||
active_request.applicants += list(current_user)
|
||||
if("payApplicant")
|
||||
if(!current_user)
|
||||
return
|
||||
if(!current_user.has_money(active_request.value) || (current_user.account_holder != active_request.owner))
|
||||
playsound(computer, 'sound/machines/buzz-sigh.ogg', 30, TRUE)
|
||||
return
|
||||
request_target.transfer_money(current_user, active_request.value)
|
||||
computer.say("Paid out [active_request.value] credits.")
|
||||
return TRUE
|
||||
if("clear")
|
||||
if(current_user)
|
||||
current_user = null
|
||||
computer.say("Account Reset.")
|
||||
return TRUE
|
||||
if("deleteRequest")
|
||||
if(!current_user)
|
||||
playsound(computer, 'sound/machines/buzz-sigh.ogg', 20, TRUE)
|
||||
return TRUE
|
||||
if(active_request.owner != current_user.account_holder)
|
||||
playsound(computer, 'sound/machines/buzz-sigh.ogg', 20, TRUE)
|
||||
return TRUE
|
||||
computer.say("Deleted current request.")
|
||||
GLOB.request_list.Remove(active_request)
|
||||
return TRUE
|
||||
if("bountyVal")
|
||||
bounty_value = text2num(params["bountyval"])
|
||||
if(!bounty_value)
|
||||
bounty_value = 1
|
||||
if("bountyText")
|
||||
bounty_text = (params["bountytext"])
|
||||
. = TRUE
|
||||
|
||||
/datum/computer_file/program/bounty_board/Destroy()
|
||||
GLOB.allbountyboards -= computer
|
||||
. = ..()
|
||||
@@ -15,8 +15,6 @@
|
||||
requires_ntnet = 0
|
||||
size = 8
|
||||
tgui_id = "NtosCard"
|
||||
ui_x = 450
|
||||
ui_y = 520
|
||||
|
||||
var/is_centcom = FALSE
|
||||
var/minor = FALSE
|
||||
@@ -275,7 +273,7 @@
|
||||
departments = list("CentCom" = get_all_centcom_jobs())
|
||||
else if(isnull(departments))
|
||||
departments = list(
|
||||
CARDCON_DEPARTMENT_COMMAND = list("Captain"),
|
||||
CARDCON_DEPARTMENT_COMMAND = list("Captain"),//lol
|
||||
CARDCON_DEPARTMENT_ENGINEERING = GLOB.engineering_positions,
|
||||
CARDCON_DEPARTMENT_MEDICAL = GLOB.medical_positions,
|
||||
CARDCON_DEPARTMENT_SCIENCE = GLOB.science_positions,
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/datum/computer_file/program/bounty
|
||||
filename = "bounty"
|
||||
filedesc = "Nanotrasen Bounty Hunter"
|
||||
program_icon_state = "bounty"
|
||||
extended_desc = "A basic interface for supply personnel to check and claim bounties."
|
||||
requires_ntnet = TRUE
|
||||
transfer_access = ACCESS_CARGO
|
||||
network_destination = "cargo claims interface"
|
||||
size = 10
|
||||
tgui_id = "NtosBountyConsole"
|
||||
///cooldown var for printing paper sheets.
|
||||
var/printer_ready = 0
|
||||
///The cargo account for grabbing the cargo account's credits.
|
||||
var/static/datum/bank_account/cargocash
|
||||
|
||||
/datum/computer_file/program/bounty/proc/print_paper()
|
||||
new /obj/item/paper/bounty_printout(get_turf(computer))
|
||||
|
||||
/datum/computer_file/program/bounty/ui_interact(mob/user, datum/tgui/ui)
|
||||
if(!GLOB.bounties_list.len)
|
||||
setup_bounties()
|
||||
printer_ready = world.time + PRINTER_TIMEOUT
|
||||
cargocash = SSeconomy.get_dep_account(ACCOUNT_CAR)
|
||||
. = ..()
|
||||
|
||||
/datum/computer_file/program/bounty/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
var/list/bountyinfo = list()
|
||||
for(var/datum/bounty/B in GLOB.bounties_list)
|
||||
bountyinfo += list(list("name" = B.name, "description" = B.description, "reward_string" = B.reward_string(), "completion_string" = B.completion_string() , "claimed" = B.claimed, "can_claim" = B.can_claim(), "priority" = B.high_priority, "bounty_ref" = REF(B)))
|
||||
data["stored_cash"] = cargocash.account_balance
|
||||
data["bountydata"] = bountyinfo
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/bounty/ui_act(action,params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("ClaimBounty")
|
||||
var/datum/bounty/cashmoney = locate(params["bounty"]) in GLOB.bounties_list
|
||||
if(cashmoney)
|
||||
cashmoney.claim()
|
||||
return TRUE
|
||||
if("Print")
|
||||
if(printer_ready < world.time)
|
||||
printer_ready = world.time + PRINTER_TIMEOUT
|
||||
print_paper()
|
||||
return
|
||||
@@ -6,11 +6,9 @@
|
||||
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.
|
||||
///The amount which the tagger will receive for the sale.
|
||||
var/percent_cut = 20
|
||||
|
||||
/datum/computer_file/program/shipping/ui_data(mob/user)
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
unsendable = 1
|
||||
undeletable = 1
|
||||
size = 4
|
||||
ui_x = 420
|
||||
ui_y = 630
|
||||
available_on_ntnet = 0
|
||||
requires_ntnet = 0
|
||||
tgui_id = "NtosConfiguration"
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
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()
|
||||
@@ -41,9 +39,9 @@
|
||||
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) : ""]
|
||||
[GLOB.data_core ? GLOB.data_core.get_manifest() : ""]
|
||||
"}
|
||||
if(!printer.print_text(contents,text("crew manifest ([])", station_time_timestamp())))
|
||||
if(!printer.print_text(contents,text("crew manifest ([])", STATION_TIME_TIMESTAMP("hh:mm:ss", world.time))))
|
||||
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
|
||||
return
|
||||
else
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
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
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
available_on_ntnet = 0
|
||||
ui_header = "downloader_finished.gif"
|
||||
tgui_id = "NtosNetDownloader"
|
||||
ui_x = 480
|
||||
ui_y = 735
|
||||
|
||||
var/datum/computer_file/program/downloaded_file = null
|
||||
var/hacked_download = 0
|
||||
@@ -20,6 +18,21 @@
|
||||
var/download_netspeed = 0
|
||||
var/downloaderror = ""
|
||||
var/obj/item/modular_computer/my_computer = null
|
||||
var/emagged = FALSE
|
||||
var/list/main_repo
|
||||
var/list/antag_repo
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/run_program()
|
||||
. = ..()
|
||||
main_repo = SSnetworks.station_network.available_station_software
|
||||
antag_repo = SSnetworks.station_network.available_antag_software
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/run_emag()
|
||||
if(emagged)
|
||||
return FALSE
|
||||
emagged = TRUE
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/proc/begin_file_download(filename)
|
||||
if(downloaded_file)
|
||||
@@ -30,8 +43,8 @@
|
||||
if(!PRG || !istype(PRG))
|
||||
return 0
|
||||
|
||||
// Attempting to download antag only program, but without having emagged computer. No.
|
||||
if(PRG.available_on_syndinet && !(computer.obj_flags & EMAGGED))
|
||||
// Attempting to download antag only program, but without having emagged/syndicate computer. No.
|
||||
if(PRG.available_on_syndinet && !emagged)
|
||||
return 0
|
||||
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
|
||||
@@ -41,10 +54,10 @@
|
||||
|
||||
ui_header = "downloader_running.gif"
|
||||
|
||||
if(PRG in SSnetworks.station_network.available_station_software)
|
||||
if(PRG in main_repo)
|
||||
generate_network_log("Began downloading file [PRG.filename].[PRG.filetype] from NTNet Software Repository.")
|
||||
hacked_download = 0
|
||||
else if(PRG in SSnetworks.station_network.available_antag_software)
|
||||
else if(PRG in antag_repo)
|
||||
generate_network_log("Began downloading file **ENCRYPTED**.[PRG.filetype] from unspecified server.")
|
||||
hacked_download = 1
|
||||
else
|
||||
@@ -130,7 +143,7 @@
|
||||
data["disk_size"] = hard_drive.max_capacity
|
||||
data["disk_used"] = hard_drive.used_capacity
|
||||
var/list/all_entries[0]
|
||||
for(var/A in SSnetworks.station_network.available_station_software)
|
||||
for(var/A in main_repo)
|
||||
var/datum/computer_file/program/P = A
|
||||
// Only those programs our user can run will show in the list
|
||||
if(!P.can_run(user,transfer = 1) || hard_drive.find_file_by_name(P.filename))
|
||||
@@ -143,9 +156,9 @@
|
||||
"size" = P.size,
|
||||
)))
|
||||
data["hackedavailable"] = FALSE
|
||||
if(computer.obj_flags & EMAGGED) // If we are running on emagged computer we have access to some "bonus" software
|
||||
if(emagged) // If we are running on emagged computer we have access to some "bonus" software
|
||||
var/list/hacked_programs[0]
|
||||
for(var/S in SSnetworks.station_network.available_antag_software)
|
||||
for(var/S in antag_repo)
|
||||
var/datum/computer_file/program/P = S
|
||||
if(hard_drive.find_file_by_name(P.filename))
|
||||
continue
|
||||
@@ -172,3 +185,24 @@
|
||||
/datum/computer_file/program/ntnetdownload/kill_program(forced)
|
||||
abort_file_download()
|
||||
return ..(forced)
|
||||
|
||||
////////////////////////
|
||||
//Syndicate Downloader//
|
||||
////////////////////////
|
||||
|
||||
/// This app only lists programs normally found in the emagged section of the normal downloader app
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/syndicate
|
||||
filename = "syndownloader"
|
||||
filedesc = "Software Download Tool"
|
||||
program_icon_state = "generic"
|
||||
extended_desc = "This program allows downloads of software from shared Syndicate repositories"
|
||||
requires_ntnet = 0
|
||||
ui_header = "downloader_finished.gif"
|
||||
tgui_id = "NtosNetDownloader"
|
||||
emagged = TRUE
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/syndicate/run_program()
|
||||
. = ..()
|
||||
main_repo = SSnetworks.station_network.available_antag_software
|
||||
antag_repo = null
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
ui_header = "ntnrc_idle.gif"
|
||||
available_on_ntnet = 1
|
||||
tgui_id = "NtosNetChat"
|
||||
ui_x = 900
|
||||
ui_y = 675
|
||||
|
||||
var/last_message // Used to generate the toolbar icon
|
||||
var/username
|
||||
var/active_channel
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
/datum/computer_file/program/nttransfer
|
||||
filename = "nttransfer"
|
||||
filedesc = "P2P Transfer Client"
|
||||
extended_desc = "This program allows for simple file transfer via direct peer to peer connection."
|
||||
program_icon_state = "comm_logs"
|
||||
size = 7
|
||||
requires_ntnet = 1
|
||||
requires_ntnet_feature = NTNET_PEERTOPEER
|
||||
network_destination = "other device via P2P tunnel"
|
||||
available_on_ntnet = 1
|
||||
tgui_id = "ntos_net_transfer"
|
||||
|
||||
var/error = "" // Error screen
|
||||
var/server_password = "" // Optional password to download the file.
|
||||
var/datum/computer_file/provided_file = null // File which is provided to clients.
|
||||
var/datum/computer_file/downloaded_file = null // File which is being downloaded
|
||||
var/list/connected_clients = list() // List of connected clients.
|
||||
var/datum/computer_file/program/nttransfer/remote // Client var, specifies who are we downloading from.
|
||||
var/download_completion = 0 // Download progress in GQ
|
||||
var/download_netspeed = 0 // Our connectivity speed in GQ/s
|
||||
var/actual_netspeed = 0 // Displayed in the UI, this is the actual transfer speed.
|
||||
var/unique_token // UID of this program
|
||||
var/upload_menu = 0 // Whether we show the program list and upload menu
|
||||
var/static/nttransfer_uid = 0
|
||||
|
||||
/datum/computer_file/program/nttransfer/New()
|
||||
unique_token = nttransfer_uid++
|
||||
..()
|
||||
|
||||
/datum/computer_file/program/nttransfer/process_tick()
|
||||
// Server mode
|
||||
update_netspeed()
|
||||
if(provided_file)
|
||||
for(var/datum/computer_file/program/nttransfer/C in connected_clients)
|
||||
// Transfer speed is limited by device which uses slower connectivity.
|
||||
// We can have multiple clients downloading at same time, but let's assume we use some sort of multicast transfer
|
||||
// so they can all run on same speed.
|
||||
C.actual_netspeed = min(C.download_netspeed, download_netspeed)
|
||||
C.download_completion += C.actual_netspeed
|
||||
if(C.download_completion >= provided_file.size)
|
||||
C.finish_download()
|
||||
else if(downloaded_file) // Client mode
|
||||
if(!remote)
|
||||
crash_download("Connection to remote server lost")
|
||||
|
||||
/datum/computer_file/program/nttransfer/kill_program(forced = FALSE)
|
||||
if(downloaded_file) // Client mode, clean up variables for next use
|
||||
finalize_download()
|
||||
|
||||
if(provided_file) // Server mode, disconnect all clients
|
||||
for(var/datum/computer_file/program/nttransfer/P in connected_clients)
|
||||
P.crash_download("Connection terminated by remote server")
|
||||
downloaded_file = null
|
||||
..(forced)
|
||||
|
||||
/datum/computer_file/program/nttransfer/proc/update_netspeed()
|
||||
download_netspeed = 0
|
||||
switch(ntnet_status)
|
||||
if(1)
|
||||
download_netspeed = NTNETSPEED_LOWSIGNAL
|
||||
if(2)
|
||||
download_netspeed = NTNETSPEED_HIGHSIGNAL
|
||||
if(3)
|
||||
download_netspeed = NTNETSPEED_ETHERNET
|
||||
|
||||
// Finishes download and attempts to store the file on HDD
|
||||
/datum/computer_file/program/nttransfer/proc/finish_download()
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
|
||||
if(!computer || !hard_drive || !hard_drive.store_file(downloaded_file))
|
||||
error = "I/O Error: Unable to save file. Check your hard drive and try again."
|
||||
finalize_download()
|
||||
|
||||
// Crashes the download and displays specific error message
|
||||
/datum/computer_file/program/nttransfer/proc/crash_download(var/message)
|
||||
error = message ? message : "An unknown error has occurred during download"
|
||||
finalize_download()
|
||||
|
||||
// Cleans up variables for next use
|
||||
/datum/computer_file/program/nttransfer/proc/finalize_download()
|
||||
if(remote)
|
||||
remote.connected_clients.Remove(src)
|
||||
downloaded_file = null
|
||||
remote = null
|
||||
download_completion = 0
|
||||
|
||||
/datum/computer_file/program/nttransfer/ui_act(action, params)
|
||||
if(..())
|
||||
return 1
|
||||
switch(action)
|
||||
if("PRG_downloadfile")
|
||||
for(var/datum/computer_file/program/nttransfer/P in SSnetworks.station_network.fileservers)
|
||||
if("[P.unique_token]" == params["id"])
|
||||
remote = P
|
||||
break
|
||||
if(!remote || !remote.provided_file)
|
||||
return
|
||||
if(remote.server_password)
|
||||
var/pass = reject_bad_text(input(usr, "Code 401 Unauthorized. Please enter password:", "Password required"))
|
||||
if(pass != remote.server_password)
|
||||
error = "Incorrect Password"
|
||||
return
|
||||
downloaded_file = remote.provided_file.clone()
|
||||
remote.connected_clients.Add(src)
|
||||
return 1
|
||||
if("PRG_reset")
|
||||
error = ""
|
||||
upload_menu = 0
|
||||
finalize_download()
|
||||
if(src in SSnetworks.station_network.fileservers)
|
||||
SSnetworks.station_network.fileservers.Remove(src)
|
||||
for(var/datum/computer_file/program/nttransfer/T in connected_clients)
|
||||
T.crash_download("Remote server has forcibly closed the connection")
|
||||
provided_file = null
|
||||
return 1
|
||||
if("PRG_setpassword")
|
||||
var/pass = reject_bad_text(input(usr, "Enter new server password. Leave blank to cancel, input 'none' to disable password.", "Server security", "none"))
|
||||
if(!pass)
|
||||
return
|
||||
if(pass == "none")
|
||||
server_password = ""
|
||||
return
|
||||
server_password = pass
|
||||
return 1
|
||||
if("PRG_uploadfile")
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
|
||||
for(var/datum/computer_file/F in hard_drive.stored_files)
|
||||
if("[F.uid]" == params["id"])
|
||||
if(F.unsendable)
|
||||
error = "I/O Error: File locked."
|
||||
return
|
||||
if(istype(F, /datum/computer_file/program))
|
||||
var/datum/computer_file/program/P = F
|
||||
if(!P.can_run(usr,transfer = 1))
|
||||
error = "Access Error: Insufficient rights to upload file."
|
||||
provided_file = F
|
||||
SSnetworks.station_network.fileservers.Add(src)
|
||||
return
|
||||
error = "I/O Error: Unable to locate file on hard drive."
|
||||
return 1
|
||||
if("PRG_uploadmenu")
|
||||
upload_menu = 1
|
||||
|
||||
|
||||
/datum/computer_file/program/nttransfer/ui_data(mob/user)
|
||||
|
||||
var/list/data = get_header_data()
|
||||
|
||||
if(error)
|
||||
data["error"] = error
|
||||
else if(downloaded_file)
|
||||
data["downloading"] = 1
|
||||
data["download_size"] = downloaded_file.size
|
||||
data["download_progress"] = download_completion
|
||||
data["download_netspeed"] = actual_netspeed
|
||||
data["download_name"] = "[downloaded_file.filename].[downloaded_file.filetype]"
|
||||
else if (provided_file)
|
||||
data["uploading"] = 1
|
||||
data["upload_uid"] = unique_token
|
||||
data["upload_clients"] = connected_clients.len
|
||||
data["upload_haspassword"] = server_password ? 1 : 0
|
||||
data["upload_filename"] = "[provided_file.filename].[provided_file.filetype]"
|
||||
else if (upload_menu)
|
||||
var/list/all_files[0]
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
|
||||
for(var/datum/computer_file/F in hard_drive.stored_files)
|
||||
all_files.Add(list(list(
|
||||
"uid" = F.uid,
|
||||
"filename" = "[F.filename].[F.filetype]",
|
||||
"size" = F.size
|
||||
)))
|
||||
data["upload_filelist"] = all_files
|
||||
else
|
||||
var/list/all_servers[0]
|
||||
for(var/datum/computer_file/program/nttransfer/P in SSnetworks.station_network.fileservers)
|
||||
all_servers.Add(list(list(
|
||||
"uid" = P.unique_token,
|
||||
"filename" = "[P.provided_file.filename].[P.provided_file.filetype]",
|
||||
"size" = P.provided_file.size,
|
||||
"haspassword" = P.server_password ? 1 : 0
|
||||
)))
|
||||
data["servers"] = all_servers
|
||||
|
||||
return data
|
||||
@@ -12,8 +12,6 @@
|
||||
network_destination = "power monitoring system"
|
||||
size = 9
|
||||
tgui_id = "NtosPowerMonitor"
|
||||
ui_x = 550
|
||||
ui_y = 700
|
||||
|
||||
var/has_alert = 0
|
||||
var/obj/structure/cable/attached_wire
|
||||
|
||||
@@ -2,31 +2,49 @@
|
||||
filename = "genericfinder"
|
||||
filedesc = "debug_finder"
|
||||
ui_header = "borg_mon.gif" //DEBUG -- new icon before PR
|
||||
program_icon_state = "generic"
|
||||
extended_desc = "generic"
|
||||
program_icon_state = "radarntos"
|
||||
requires_ntnet = TRUE
|
||||
transfer_access = null
|
||||
available_on_ntnet = FALSE
|
||||
usage_flags = PROGRAM_LAPTOP | PROGRAM_TABLET
|
||||
network_destination = "tracking program"
|
||||
size = 5
|
||||
tgui_id = "NtosRadar"
|
||||
ui_x = 800
|
||||
ui_y = 600
|
||||
special_assets = list(
|
||||
/datum/asset/simple/radar_assets,
|
||||
)
|
||||
///List of trackable entities. Updated by the scan() proc.
|
||||
var/list/objects
|
||||
///Ref of the last trackable object selected by the user in the tgui window. Updated in the ui_act() proc.
|
||||
var/atom/selected
|
||||
///Used to store when the next scan is available. Updated by the scan() proc.
|
||||
var/next_scan = 0
|
||||
///Used to keep track of the last value program_icon_state was set to, to prevent constant unnecessary update_icon() calls
|
||||
var/last_icon_state = ""
|
||||
///Used by the tgui interface, themed NT or Syndicate.
|
||||
var/arrowstyle = "ntosradarpointer.png"
|
||||
///Used by the tgui interface, themed for NT or Syndicate colors.
|
||||
var/pointercolor = "green"
|
||||
|
||||
/datum/computer_file/program/radar/run_program(mob/living/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
return
|
||||
return FALSE
|
||||
|
||||
/datum/computer_file/program/radar/kill_program(forced = FALSE)
|
||||
objects = list()
|
||||
selected = null
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
return ..()
|
||||
|
||||
/datum/computer_file/program/radar/Destroy()
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
return ..()
|
||||
|
||||
/datum/computer_file/program/radar/ui_assets(mob/user)
|
||||
return list(
|
||||
get_asset_datum(/datum/asset/simple/radar_assets),
|
||||
)
|
||||
|
||||
/datum/computer_file/program/radar/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
data["selected"] = selected
|
||||
@@ -65,7 +83,37 @@
|
||||
*
|
||||
*/
|
||||
/datum/computer_file/program/radar/proc/track()
|
||||
return
|
||||
var/atom/movable/signal = find_atom()
|
||||
if(!trackable(signal))
|
||||
return
|
||||
|
||||
var/turf/here_turf = (get_turf(computer))
|
||||
var/turf/target_turf = (get_turf(signal))
|
||||
var/userot = FALSE
|
||||
var/rot = 0
|
||||
var/pointer="crosshairs"
|
||||
var/locx = (target_turf.x - here_turf.x) + 24
|
||||
var/locy = (here_turf.y - target_turf.y) + 24
|
||||
|
||||
if(get_dist_euclidian(here_turf, target_turf) > 24)
|
||||
userot = TRUE
|
||||
rot = round(Get_Angle(here_turf, target_turf))
|
||||
else
|
||||
if(target_turf.z > here_turf.z)
|
||||
pointer="caret-up"
|
||||
else if(target_turf.z < here_turf.z)
|
||||
pointer="caret-down"
|
||||
|
||||
var/list/trackinfo = list(
|
||||
"locx" = locx,
|
||||
"locy" = locy,
|
||||
"userot" = userot,
|
||||
"rot" = rot,
|
||||
"arrowstyle" = arrowstyle,
|
||||
"color" = pointercolor,
|
||||
"pointer" = pointer,
|
||||
)
|
||||
return trackinfo
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -77,10 +125,12 @@
|
||||
**arg1 is the atom being evaluated.
|
||||
*/
|
||||
/datum/computer_file/program/radar/proc/trackable(atom/movable/signal)
|
||||
if(!signal)
|
||||
if(!signal || !computer)
|
||||
return FALSE
|
||||
var/turf/here = get_turf(computer)
|
||||
var/turf/there = get_turf(signal)
|
||||
if(!here || !there)
|
||||
return FALSE //I was still getting a runtime even after the above check while scanning, so fuck it
|
||||
return (there.z == here.z) || (is_station_level(here.z) && is_station_level(there.z))
|
||||
|
||||
/**
|
||||
@@ -98,6 +148,59 @@
|
||||
/datum/computer_file/program/radar/proc/scan()
|
||||
return
|
||||
|
||||
/**
|
||||
*
|
||||
*Finds the atom in the appropriate list that the `selected` var indicates
|
||||
*
|
||||
*The `selected` var holds a REF, which is a string. A mob REF may be
|
||||
*something like "mob_209". In order to find the actual atom, we need
|
||||
*to search the appropriate list for the REF string. This is dependant
|
||||
*on the program (Lifeline uses GLOB.human_list, while Fission360 uses
|
||||
*GLOB.poi_list), but the result will be the same; evaluate the string and
|
||||
*return an atom reference.
|
||||
*/
|
||||
/datum/computer_file/program/radar/proc/find_atom()
|
||||
return
|
||||
|
||||
//We use SSfastprocess for the program icon state because it runs faster than process_tick() does.
|
||||
/datum/computer_file/program/radar/process()
|
||||
if(computer.active_program != src)
|
||||
STOP_PROCESSING(SSfastprocess, src) //We're not the active program, it's time to stop.
|
||||
return
|
||||
if(!selected)
|
||||
return
|
||||
|
||||
var/atom/movable/signal = find_atom()
|
||||
if(!trackable(signal))
|
||||
program_icon_state = "[initial(program_icon_state)]lost"
|
||||
if(last_icon_state != program_icon_state)
|
||||
computer.update_icon()
|
||||
last_icon_state = program_icon_state
|
||||
return
|
||||
|
||||
var/here_turf = get_turf(computer)
|
||||
var/target_turf = get_turf(signal)
|
||||
var/trackdistance = get_dist_euclidian(here_turf, target_turf)
|
||||
switch(trackdistance)
|
||||
if(0)
|
||||
program_icon_state = "[initial(program_icon_state)]direct"
|
||||
if(1 to 12)
|
||||
program_icon_state = "[initial(program_icon_state)]close"
|
||||
if(13 to 24)
|
||||
program_icon_state = "[initial(program_icon_state)]medium"
|
||||
if(25 to INFINITY)
|
||||
program_icon_state = "[initial(program_icon_state)]far"
|
||||
|
||||
if(last_icon_state != program_icon_state)
|
||||
computer.update_icon()
|
||||
last_icon_state = program_icon_state
|
||||
computer.setDir(get_dir(here_turf, target_turf))
|
||||
|
||||
//We can use process_tick to restart fast processing, since the computer will be running this constantly either way.
|
||||
/datum/computer_file/program/radar/process_tick()
|
||||
if(computer.active_program == src)
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
///////////////////
|
||||
//Suit Sensor App//
|
||||
///////////////////
|
||||
@@ -106,44 +209,13 @@
|
||||
/datum/computer_file/program/radar/lifeline
|
||||
filename = "Lifeline"
|
||||
filedesc = "Lifeline"
|
||||
program_icon_state = "generic"
|
||||
extended_desc = "This program allows for tracking of crew members via their suit sensors."
|
||||
requires_ntnet = TRUE
|
||||
transfer_access = ACCESS_MEDICAL
|
||||
available_on_ntnet = TRUE
|
||||
|
||||
/datum/computer_file/program/radar/lifeline/track()
|
||||
var/mob/living/carbon/human/humanoid = locate(selected) in GLOB.human_list
|
||||
if(!istype(humanoid) || !trackable(humanoid))
|
||||
return
|
||||
|
||||
var/turf/here_turf = (get_turf(computer))
|
||||
var/turf/target_turf = (get_turf(humanoid))
|
||||
var/userot = FALSE
|
||||
var/rot = 0
|
||||
var/pointer="crosshairs"
|
||||
var/locx = (target_turf.x - here_turf.x)
|
||||
var/locy = (here_turf.y - target_turf.y)
|
||||
if(get_dist_euclidian(here_turf, target_turf) > 24) //If they're too far away, we need the angle for the arrow along the edge of the radar display
|
||||
userot = TRUE
|
||||
rot = round(Get_Angle(here_turf, target_turf))
|
||||
else
|
||||
locx = locx + 24
|
||||
locy = locy + 24
|
||||
if(target_turf.z > here_turf.z)
|
||||
pointer="caret-up"
|
||||
else if(target_turf.z < here_turf.z)
|
||||
pointer="caret-down"
|
||||
var/list/trackinfo = list(
|
||||
locx = locx,
|
||||
locy = locy,
|
||||
userot = userot,
|
||||
rot = rot,
|
||||
arrowstyle = "ntosradarpointer.png", //For the rotation arrow, it's stupid I know
|
||||
color = "green",
|
||||
pointer = pointer,
|
||||
)
|
||||
return trackinfo
|
||||
/datum/computer_file/program/radar/lifeline/find_atom()
|
||||
return locate(selected) in GLOB.human_list
|
||||
|
||||
/datum/computer_file/program/radar/lifeline/scan()
|
||||
if(world.time < next_scan)
|
||||
@@ -184,46 +256,18 @@
|
||||
/datum/computer_file/program/radar/fission360
|
||||
filename = "Fission360"
|
||||
filedesc = "Fission360"
|
||||
program_icon_state = "generic"
|
||||
program_icon_state = "radarsyndicate"
|
||||
extended_desc = "This program allows for tracking of nuclear authorization disks and warheads."
|
||||
requires_ntnet = FALSE
|
||||
transfer_access = null
|
||||
available_on_ntnet = FALSE
|
||||
available_on_syndinet = TRUE
|
||||
tgui_id = "NtosRadarSyndicate"
|
||||
arrowstyle = "ntosradarpointerS.png"
|
||||
pointercolor = "red"
|
||||
|
||||
/datum/computer_file/program/radar/fission360/track()
|
||||
var/obj/nuke = locate(selected) in GLOB.poi_list
|
||||
if(!trackable(nuke))
|
||||
return
|
||||
|
||||
var/turf/here_turf = (get_turf(computer))
|
||||
var/turf/target_turf = (get_turf(nuke))
|
||||
var/userot = FALSE
|
||||
var/rot = 0
|
||||
var/pointer="crosshairs"
|
||||
var/locx = (target_turf.x - here_turf.x)
|
||||
var/locy = (here_turf.y - target_turf.y)
|
||||
if(get_dist_euclidian(here_turf, target_turf) > 24) //If they're too far away, we need the angle for the arrow along the edge of the radar display
|
||||
userot = TRUE
|
||||
rot = round(Get_Angle(here_turf, target_turf))
|
||||
else
|
||||
locx = locx + 24
|
||||
locy = locy + 24
|
||||
if(target_turf.z > here_turf.z)
|
||||
pointer="caret-up"
|
||||
else if(target_turf.z < here_turf.z)
|
||||
pointer="caret-down"
|
||||
var/list/trackinfo = list(
|
||||
locx = locx,
|
||||
locy = locy,
|
||||
userot = userot,
|
||||
rot = rot,
|
||||
arrowstyle = "ntosradarpointerS.png",
|
||||
color = "red",
|
||||
pointer = pointer,
|
||||
)
|
||||
return trackinfo
|
||||
/datum/computer_file/program/radar/fission360/find_atom()
|
||||
return locate(selected) in GLOB.poi_list
|
||||
|
||||
/datum/computer_file/program/radar/fission360/scan()
|
||||
if(world.time < next_scan)
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
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.
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
network_destination = "supermatter monitoring system"
|
||||
size = 5
|
||||
tgui_id = "NtosSupermatterMonitor"
|
||||
ui_x = 600
|
||||
ui_y = 350
|
||||
var/last_status = SUPERMATTER_INACTIVE
|
||||
var/list/supermatters
|
||||
var/obj/machinery/power/supermatter_crystal/active // Currently selected supermatter crystal.
|
||||
|
||||
Reference in New Issue
Block a user