Merge branch 'master' of https://github.com/Baystation12/Baystation12
Conflicts: code/modules/events/infestation.dm Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
@@ -11,6 +11,7 @@
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Jungle"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Rust"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/ShieldGen"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Supermatter"
|
||||
#define FILE_DIR "code/WorkInProgress/Susan"
|
||||
#define FILE_DIR "html"
|
||||
@@ -38,6 +39,7 @@
|
||||
#define FILE_DIR "sound/AI"
|
||||
#define FILE_DIR "sound/ambience"
|
||||
#define FILE_DIR "sound/effects"
|
||||
#define FILE_DIR "sound/effects/turret"
|
||||
#define FILE_DIR "sound/effects/wind"
|
||||
#define FILE_DIR "sound/hallucinations"
|
||||
#define FILE_DIR "sound/items"
|
||||
@@ -795,6 +797,9 @@
|
||||
#include "code\modules\events\infestation.dm"
|
||||
#include "code\modules\events\ion_storm.dm"
|
||||
#include "code\modules\events\meteors.dm"
|
||||
#include "code\modules\events\money_hacker.dm"
|
||||
#include "code\modules\events\money_lotto.dm"
|
||||
#include "code\modules\events\money_spam.dm"
|
||||
#include "code\modules\events\prison_break.dm"
|
||||
#include "code\modules\events\radiation_storm.dm"
|
||||
#include "code\modules\events\rogue_drones.dm"
|
||||
@@ -1088,6 +1093,7 @@
|
||||
#include "code\modules\reagents\Chemistry-Holder.dm"
|
||||
#include "code\modules\reagents\Chemistry-Machinery.dm"
|
||||
#include "code\modules\reagents\Chemistry-Readme.dm"
|
||||
#include "code\modules\reagents\Chemistry-Reagents-Antidepressants.dm"
|
||||
#include "code\modules\reagents\Chemistry-Reagents.dm"
|
||||
#include "code\modules\reagents\Chemistry-Recipes.dm"
|
||||
#include "code\modules\reagents\grenade_launcher.dm"
|
||||
@@ -1174,6 +1180,7 @@
|
||||
#include "code\modules\surgery\eye.dm"
|
||||
#include "code\modules\surgery\face.dm"
|
||||
#include "code\modules\surgery\generic.dm"
|
||||
#include "code\modules\surgery\implant.dm"
|
||||
#include "code\modules\surgery\other.dm"
|
||||
#include "code\modules\surgery\ribcage.dm"
|
||||
#include "code\modules\surgery\robolimbs.dm"
|
||||
@@ -1181,15 +1188,12 @@
|
||||
#include "code\WorkInProgress\autopsy.dm"
|
||||
#include "code\WorkInProgress\buildmode.dm"
|
||||
#include "code\WorkInProgress\explosion_particles.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\energy_field.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\external_shield_gen.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\meteor_battery.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\sculpture.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\shield_capacitor.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\shield_gen.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Economy\Accounts.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Economy\Economy.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Economy\Economy_Events.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Economy\Economy_Events_Mundane.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Economy\Economy_TradeDestinations.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Economy\EFTPOS.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Jungle\falsewall.dm"
|
||||
@@ -1201,18 +1205,26 @@
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Jungle\jungle_turfs.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Jungle\misc_helpers.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\areas.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\circuits_and_design.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\core_control.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\core_field.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\core_gen.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\core_monitor.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\fuel_assembly.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\fuel_assembly_port.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\fuel_assembly_port_construction.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\fuel_compressor.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\fuel_compressor_construction.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\fuel_control.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\fuel_injector.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\gyrotron.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\gyrotron_controller.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\radiation.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\virtual_particle_catcher.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\ShieldGen\circuits_and_designs.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\ShieldGen\energy_field.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\ShieldGen\shield_capacitor.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\ShieldGen\shield_gen.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\ShieldGen\shield_gen_external.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Supermatter\LaserComputer.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Supermatter\SuperMatter.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Supermatter\ZeroPointLaser.dm"
|
||||
|
||||
@@ -2,6 +2,7 @@ var/global/current_date_string
|
||||
var/global/num_financial_terminals = 1
|
||||
var/global/datum/money_account/station_account
|
||||
var/global/next_account_number = 0
|
||||
var/global/obj/machinery/account_database/centcomm_account_db
|
||||
|
||||
/proc/create_station_account()
|
||||
if(!station_account)
|
||||
@@ -11,13 +12,13 @@ var/global/next_account_number = 0
|
||||
station_account.owner_name = "[station_name()] Station Account"
|
||||
station_account.account_number = rand(111111, 999999)
|
||||
station_account.remote_access_pin = rand(1111, 111111)
|
||||
station_account.money = 10000
|
||||
station_account.money = 75000
|
||||
|
||||
//create an entry in the account transaction log for when it was created
|
||||
var/datum/transaction/T = new()
|
||||
T.target_name = station_account.owner_name
|
||||
T.purpose = "Account creation"
|
||||
T.amount = 10000
|
||||
T.amount = 75000
|
||||
T.date = "2nd April, 2555"
|
||||
T.time = "11:24"
|
||||
T.source_terminal = "Biesel GalaxyNet Terminal #277"
|
||||
@@ -62,6 +63,7 @@ var/global/next_account_number = 0
|
||||
var/access_level = 0
|
||||
var/datum/money_account/detailed_account_view
|
||||
var/creating_new_account = 0
|
||||
var/activated = 1
|
||||
|
||||
/obj/machinery/account_database/New()
|
||||
..()
|
||||
@@ -80,6 +82,7 @@ var/global/next_account_number = 0
|
||||
dat += "Confirm identity: <a href='?src=\ref[src];choice=insert_card'>[held_card ? held_card : "-----"]</a><br>"
|
||||
|
||||
if(access_level > 0)
|
||||
dat += "<a href='?src=\ref[src];toggle_activated=1'>Toggle remote access to this database (warning!)</a>"
|
||||
dat += "You may not edit accounts at this terminal, only create and view them.<br>"
|
||||
if(creating_new_account)
|
||||
dat += "<br>"
|
||||
@@ -150,6 +153,10 @@ var/global/next_account_number = 0
|
||||
..()
|
||||
|
||||
/obj/machinery/account_database/Topic(var/href, var/href_list)
|
||||
|
||||
if(href_list["toggle_activated"])
|
||||
activated = !activated
|
||||
|
||||
if(href_list["choice"])
|
||||
switch(href_list["choice"])
|
||||
if("sync_accounts")
|
||||
@@ -160,7 +167,7 @@ var/global/next_account_number = 0
|
||||
for(var/datum/money_account/M in A.accounts)
|
||||
if(!src.accounts.Find(M))
|
||||
src.accounts.Add(M)
|
||||
usr << "\icon[src] <span class='info'>Accounts synched across all databases in range.</span>"
|
||||
usr << "\icon[src] <span class='info'>Accounts synched across all NanoTrasen financial databases.</span>"
|
||||
|
||||
if("create_account")
|
||||
creating_new_account = 1
|
||||
@@ -214,6 +221,15 @@ var/global/next_account_number = 0
|
||||
|
||||
src.attack_hand(usr)
|
||||
|
||||
/obj/machinery/account_database/proc/add_account_across_all(var/new_owner_name = "Default user", var/starting_funds = 0, var/pre_existing = 0)
|
||||
var/datum/money_account/M = add_account(new_owner_name, starting_funds, pre_existing)
|
||||
for(var/obj/machinery/account_database/D in world)
|
||||
if(D == src)
|
||||
continue
|
||||
D.accounts.Add(M)
|
||||
|
||||
return M
|
||||
|
||||
/obj/machinery/account_database/proc/add_account(var/new_owner_name = "Default user", var/starting_funds = 0, var/pre_existing = 0)
|
||||
|
||||
//create a new account
|
||||
@@ -266,12 +282,15 @@ var/global/next_account_number = 0
|
||||
R.overlays += stampoverlay
|
||||
R.stamps += "<HR><i>This paper has been stamped by the Accounts Database.</i>"
|
||||
|
||||
|
||||
//add the account
|
||||
M.transaction_log.Add(T)
|
||||
accounts.Add(M)
|
||||
|
||||
return M
|
||||
|
||||
/obj/machinery/account_database/proc/charge_to_account(var/attempt_account_number, var/source_name, var/purpose, var/terminal_id, var/amount)
|
||||
if(!activated)
|
||||
return 0
|
||||
for(var/datum/money_account/D in accounts)
|
||||
if(D.account_number == attempt_account_number)
|
||||
D.money += amount
|
||||
@@ -295,6 +314,8 @@ var/global/next_account_number = 0
|
||||
|
||||
//this returns the first account datum that matches the supplied accnum/pin combination, it returns null if the combination did not match any account
|
||||
/obj/machinery/account_database/proc/attempt_account_access(var/attempt_account_number, var/attempt_pin_number, var/security_level_passed = 0)
|
||||
if(!activated)
|
||||
return 0
|
||||
for(var/datum/money_account/D in accounts)
|
||||
if(D.account_number == attempt_account_number)
|
||||
if( D.security_level <= security_level_passed && (!D.security_level || D.remote_access_pin == attempt_pin_number) )
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/obj/item/weapon/eftpos
|
||||
/obj/item/device/eftpos
|
||||
name = "EFTPOS scanner"
|
||||
desc = "Swipe your ID card to pay electronically."
|
||||
icon = 'icons/obj/library.dmi'
|
||||
icon_state = "scanner"
|
||||
desc = "Swipe your ID card to make purchases electronically."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "eftpos"
|
||||
var/machine_id = ""
|
||||
var/eftpos_name = "Default EFTPOS scanner"
|
||||
var/transaction_locked = 0
|
||||
@@ -13,23 +13,24 @@
|
||||
var/obj/machinery/account_database/linked_db
|
||||
var/datum/money_account/linked_account
|
||||
|
||||
/obj/item/weapon/eftpos/New()
|
||||
/obj/item/device/eftpos/New()
|
||||
..()
|
||||
machine_id = "[station_name()] EFTPOS #[num_financial_terminals++]"
|
||||
access_code = rand(1111,111111)
|
||||
reconnect_database()
|
||||
print_reference()
|
||||
spawn(0)
|
||||
print_reference()
|
||||
|
||||
//by default, connect to the station account
|
||||
//the user of the EFTPOS device can change the target account though, and no-one will be the wiser (except whoever's being charged)
|
||||
linked_account = station_account
|
||||
|
||||
/obj/item/weapon/eftpos/proc/print_reference()
|
||||
var/obj/item/weapon/paper/R = new(get_turf(src))
|
||||
/obj/item/device/eftpos/proc/print_reference()
|
||||
var/obj/item/weapon/paper/R = new(src.loc)
|
||||
R.name = "Reference: [eftpos_name]"
|
||||
R.info = "<b>[eftpos_name] reference</b><br><br>"
|
||||
R.info += "Access code: [access_code]<br><br>"
|
||||
R.info += "<b>Do not lose this code, or the device will have to be replaced.</b><br>"
|
||||
R.info += "<b>Do not lose or misplace this code.</b><br>"
|
||||
|
||||
//stamp the paper
|
||||
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
|
||||
@@ -39,14 +40,18 @@
|
||||
R.stamped += /obj/item/weapon/stamp
|
||||
R.overlays += stampoverlay
|
||||
R.stamps += "<HR><i>This paper has been stamped by the EFTPOS device.</i>"
|
||||
var/obj/item/smallDelivery/D = new(R.loc)
|
||||
R.loc = D
|
||||
D.wrapped = R
|
||||
D.name = "small parcel - 'EFTPOS access code'"
|
||||
|
||||
/obj/item/weapon/eftpos/proc/reconnect_database()
|
||||
/obj/item/device/eftpos/proc/reconnect_database()
|
||||
for(var/obj/machinery/account_database/DB in world)
|
||||
if(DB.z == src.z)
|
||||
linked_db = DB
|
||||
break
|
||||
|
||||
/obj/item/weapon/eftpos/attack_self(mob/user as mob)
|
||||
/obj/item/device/eftpos/attack_self(mob/user as mob)
|
||||
if(get_dist(src,user) <= 1)
|
||||
var/dat = "<b>[eftpos_name]</b><br>"
|
||||
dat += "<i>This terminal is</i> [machine_id]. <i>Report this code when contacting NanoTrasen IT Support</i><br>"
|
||||
@@ -67,48 +72,62 @@
|
||||
dat += "Transaction purpose: <a href='?src=\ref[src];choice=trans_purpose'>[transaction_purpose]</a><br>"
|
||||
dat += "Value: <a href='?src=\ref[src];choice=trans_value'>$[transaction_amount]</a><br>"
|
||||
dat += "Linked account: <a href='?src=\ref[src];choice=link_account'>[linked_account ? linked_account.owner_name : "None"]</a><hr>"
|
||||
dat += "<a href='?src=\ref[src];choice=change_code'>Change access code</a>"
|
||||
dat += "<a href='?src=\ref[src];choice=change_code'>Change access code</a><br>"
|
||||
dat += "<a href='?src=\ref[src];choice=change_id'>Change EFTPOS ID</a><br>"
|
||||
dat += "Scan card to reset access code <a href='?src=\ref[src];choice=reset'>\[------\]</a>"
|
||||
user << browse(dat,"window=eftpos")
|
||||
else
|
||||
user << browse(null,"window=eftpos")
|
||||
|
||||
/obj/item/weapon/eftpos/attackby(O as obj, user as mob)
|
||||
/obj/item/device/eftpos/attackby(O as obj, user as mob)
|
||||
if(istype(O, /obj/item/weapon/card))
|
||||
//attempt to connect to a new db, and if that doesn't work then fail
|
||||
if(!linked_db)
|
||||
reconnect_database()
|
||||
if(linked_db && linked_account)
|
||||
var/obj/item/weapon/card/I = O
|
||||
scan_card(I)
|
||||
if(linked_db)
|
||||
if(linked_account)
|
||||
var/obj/item/weapon/card/I = O
|
||||
scan_card(I)
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to connect to linked account.</span>"
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to connect to accounts database.</span>"
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/eftpos/Topic(var/href, var/href_list)
|
||||
/obj/item/device/eftpos/Topic(var/href, var/href_list)
|
||||
if(href_list["choice"])
|
||||
switch(href_list["choice"])
|
||||
if("change_code")
|
||||
var/attempt_code = text2num(input("Re-enter the current EFTPOS access code", "Confirm old EFTPOS code"))
|
||||
var/attempt_code = input("Re-enter the current EFTPOS access code", "Confirm old EFTPOS code") as num
|
||||
if(attempt_code == access_code)
|
||||
access_code = text2num(input("Enter a new access code for this device", "Enter new EFTPOS code"))
|
||||
access_code = input("Enter a new access code for this device", "Enter new EFTPOS code") as num
|
||||
print_reference()
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Incorrect code entered.</span>"
|
||||
if("change_id")
|
||||
var/attempt_code = text2num(input("Re-enter the current EFTPOS access code", "Confirm EFTPOS code"))
|
||||
if(attempt_code == access_code)
|
||||
eftpos_name = input("Enter a new terminal ID for this device", "Enter new EFTPOS ID") + " EFTPOS scanner"
|
||||
print_reference()
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Incorrect code entered.</span>"
|
||||
if("link_account")
|
||||
if(!linked_db)
|
||||
reconnect_database()
|
||||
if(linked_db)
|
||||
var/attempt_account_num = text2num(input("Enter account number to pay EFTPOS charges into", "New account number"))
|
||||
var/attempt_pin = text2num(input("Enter pin code", "Account pin"))
|
||||
var/attempt_account_num = input("Enter account number to pay EFTPOS charges into", "New account number") as num
|
||||
var/attempt_pin = input("Enter pin code", "Account pin") as num
|
||||
linked_account = linked_db.attempt_account_access(attempt_account_num, attempt_pin, 1)
|
||||
else
|
||||
usr << "<span class='warning'>Unable to connect to accounts database.</span>"
|
||||
usr << "\icon[src]<span class='warning'>Unable to connect to accounts database.</span>"
|
||||
if("trans_purpose")
|
||||
transaction_purpose = input("Enter reason for EFTPOS transaction", "Transaction purpose")
|
||||
if("trans_value")
|
||||
transaction_amount = max(text2num(input("Enter amount for EFTPOS transaction", "Transaction amount")),0)
|
||||
transaction_amount = input("Enter amount for EFTPOS transaction", "Transaction amount") as num
|
||||
if("toggle_lock")
|
||||
if(transaction_locked)
|
||||
var/attempt_code = text2num(input("Enter EFTPOS access code", "Reset Transaction"))
|
||||
var/attempt_code = input("Enter EFTPOS access code", "Reset Transaction") as num
|
||||
if(attempt_code == access_code)
|
||||
transaction_locked = 0
|
||||
transaction_paid = 0
|
||||
@@ -126,16 +145,27 @@
|
||||
scan_card(I)
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to link accounts.</span>"
|
||||
if("reset")
|
||||
//reset the access code - requires HoP/captain access
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if (istype(I, /obj/item/weapon/card))
|
||||
var/obj/item/weapon/card/id/C = I
|
||||
if(access_cent_captain in C.access || access_hop in C.access || access_captain in C.access)
|
||||
access_code = 0
|
||||
usr << "\icon[src]<span class='info'>Access code reset to 0.</span>"
|
||||
else if (istype(I, /obj/item/weapon/card/emag))
|
||||
access_code = 0
|
||||
usr << "\icon[src]<span class='info'>Access code reset to 0.</span>"
|
||||
|
||||
src.attack_self(usr)
|
||||
|
||||
/obj/item/weapon/eftpos/proc/scan_card(var/obj/item/weapon/card/I)
|
||||
/obj/item/device/eftpos/proc/scan_card(var/obj/item/weapon/card/I)
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
var/obj/item/weapon/card/id/C = I
|
||||
visible_message("<span class='info'>[usr] swipes a card through [src].</span>")
|
||||
if(transaction_locked && !transaction_paid)
|
||||
if(linked_account)
|
||||
var/attempt_pin = text2num(input("Enter pin code", "EFTPOS transaction"))
|
||||
var/attempt_pin = input("Enter pin code", "EFTPOS transaction") as num
|
||||
var/datum/money_account/D = linked_db.attempt_account_access(C.associated_account_number, attempt_pin, 2)
|
||||
if(D)
|
||||
if(transaction_amount <= D.money)
|
||||
@@ -149,9 +179,12 @@
|
||||
|
||||
//create entries in the two account transaction logs
|
||||
var/datum/transaction/T = new()
|
||||
T.target_name = "[linked_account.owner_name] ([eftpos_name])"
|
||||
T.target_name = "[linked_account.owner_name] (via [eftpos_name])"
|
||||
T.purpose = transaction_purpose
|
||||
T.amount = "([transaction_amount])"
|
||||
if(transaction_amount > 0)
|
||||
T.amount = "([transaction_amount])"
|
||||
else
|
||||
T.amount = "[transaction_amount]"
|
||||
T.source_terminal = machine_id
|
||||
T.date = current_date_string
|
||||
T.time = worldtime2text()
|
||||
@@ -168,9 +201,9 @@
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>You don't have that much money!<span>"
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>EFTPOS is not connected to an account.<span>"
|
||||
usr << "\icon[src]<span class='warning'>Unable to access account. Check security settings and try again.</span>"
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to access account. Check security settings and try again.</span>"
|
||||
usr << "\icon[src]<span class='warning'>EFTPOS is not connected to an account.<span>"
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
@@ -14,6 +14,17 @@
|
||||
#define ANIMAL_RIGHTS_RAID 13
|
||||
#define FESTIVAL 14
|
||||
|
||||
#define RESEARCH_BREAKTHROUGH 15
|
||||
#define BARGAINS 16
|
||||
#define SONG_DEBUT 17
|
||||
#define MOVIE_RELEASE 18
|
||||
#define BIG_GAME_HUNTERS 19
|
||||
#define ELECTION 20
|
||||
#define GOSSIP 21
|
||||
#define TOURISM 22
|
||||
#define CELEBRITY_DEATH 23
|
||||
#define RESIGNATION 24
|
||||
|
||||
#define DEFAULT 1
|
||||
|
||||
#define ADMINISTRATIVE 2
|
||||
@@ -54,10 +65,25 @@
|
||||
|
||||
var/setup_economy = 0
|
||||
/proc/setup_economy()
|
||||
if(setup_economy)
|
||||
return
|
||||
var/datum/feed_channel/newChannel = new /datum/feed_channel
|
||||
newChannel.channel_name = "Tau Ceti Daily"
|
||||
newChannel.author = "CentComm Minister of Information"
|
||||
newChannel.locked = 1
|
||||
newChannel.is_admin_channel = 1
|
||||
news_network.network_channels += newChannel
|
||||
setup_economy = 1
|
||||
|
||||
newChannel = new /datum/feed_channel
|
||||
newChannel.channel_name = "The Gibson Gazette"
|
||||
newChannel.author = "Editor Mike Hammers"
|
||||
newChannel.locked = 1
|
||||
newChannel.is_admin_channel = 1
|
||||
news_network.network_channels += newChannel
|
||||
|
||||
for(var/loc_type in typesof(/datum/trade_destination) - /datum/trade_destination)
|
||||
var/datum/trade_destination/D = new loc_type
|
||||
weighted_randomevent_locations[D] = D.viable_random_events.len
|
||||
weighted_mundaneevent_locations[D] = D.viable_mundane_events.len
|
||||
|
||||
setup_economy = 1
|
||||
@@ -11,11 +11,14 @@
|
||||
if(!setup_economy)
|
||||
setup_economy()
|
||||
|
||||
var/type = pick(tradeable_destinations)
|
||||
affected_dest = new type()
|
||||
affected_dest = pickweight(weighted_randomevent_locations)
|
||||
if(affected_dest.viable_random_events.len)
|
||||
endWhen = rand(60,300)
|
||||
event_type = pick(affected_dest.viable_random_events)
|
||||
|
||||
if(!event_type)
|
||||
return
|
||||
|
||||
switch(event_type)
|
||||
if(RIOTS)
|
||||
dearer_goods = list(SECURITY)
|
||||
@@ -54,39 +57,42 @@
|
||||
/datum/event/economic_event/announce()
|
||||
//copy-pasted from the admin verbs to submit new newscaster messages
|
||||
var/datum/feed_message/newMsg = new /datum/feed_message
|
||||
newMsg.author = "NanoTrasen Editor"
|
||||
newMsg.author = "Tau Ceti Daily"
|
||||
newMsg.is_admin_message = 1
|
||||
|
||||
switch(event_type)
|
||||
if(RIOTS)
|
||||
newMsg.body = "[pick("Riots have","Unrest has")] broken out on planet [affected_dest.name]. Authorities call for calm, as [pick("various parties","rebellious elements","peacekeeping forces","\'REDACTED\'")] begin stockpiling weaponry and armour. Meanwhile, food and mineral prices are dropping as local industries attempt empty their stocks in expectation of looting."
|
||||
if(WILD_ANIMAL_ATTACK)
|
||||
newMsg.body = "Local [pick("wildlife","animal life","fauna")] on planet [affected_dest.name] has been increasing in agression and raiding outlying settlements for food. Big game hunters have been called in to help alleviate the problem, but numerous injuries have already occurred."
|
||||
if(INDUSTRIAL_ACCIDENT)
|
||||
newMsg.body = "[pick("An industrial accident","A smelting accident","A malfunction","A malfunctioning piece of machinery","Negligent maintenance","A cooleant leak","A ruptured conduit")] at a [pick("factory","installation","power plant","dockyards")] on [affected_dest.name] resulted in severe structural damage and numerous injuries. Repairs are ongoing."
|
||||
if(BIOHAZARD_OUTBREAK)
|
||||
newMsg.body = "[pick("A \'REDACTED\'","A biohazard","An outbreak","A virus")] on [affected_dest.name] has resulted in quarantine, stopping much shipping in the area. Although the quarantine is now lifted, authorities are calling for deliveries of medical supplies to treat the infected, and gas to replace contaminated stocks."
|
||||
if(PIRATES)
|
||||
newMsg.body = "[pick("Pirates","Criminal elements","A [pick("Syndicate","Donk Co.","Waffle Co.","\'REDACTED\'")] strike force")] have [pick("raided","blockaded","attempted to blackmail","attacked")] [affected_dest.name] today. Security has been tightened, but many valuable minerals were taken."
|
||||
if(CORPORATE_ATTACK)
|
||||
newMsg.body = "A small [pick("pirate","Cybersun Industries","Gorlex Marauders","Syndicate")] fleet has precise-jumped into proximity with [affected_dest.name], [pick("for a smash-and-grab operation","in a hit and run attack","in an overt display of hostilities")]. Much damage was done, and security has been tightened since the incident."
|
||||
if(ALIEN_RAIDERS)
|
||||
if(prob(20))
|
||||
newMsg.body = "The Tiger Co-operative have raided [affected_dest.name] today, no doubt on orders from their enigmatic masters. Stealing wildlife, farm animals, medical research materials and kidnapping civilians. NanoTrasen authorities are standing by to counter attempts at bio-terrorism."
|
||||
else
|
||||
newMsg.body = "[pick("The alien species designated \'United Exolitics\'","The alien species designated \'REDACTED\'","An unknown alien species")] have raided [affected_dest.name] today, stealing wildlife, farm animals, medical research materials and kidnapping civilians. It seems they desire to learn more about us, so the Navy will be standing by to accomodate them next time they try."
|
||||
if(AI_LIBERATION)
|
||||
newMsg.body = "A [pick("\'REDACTED\' was detected on","S.E.L.F operative infiltrated","malignant computer virus was detected on","rogue [pick("slicer","hacker")] was apprehended on")] [affected_dest.name] today, and managed to infect [pick("\'REDACTED\'","a sentient sub-system","a class one AI","a sentient defence installation")] before it could be stopped. Many lives were lost as it systematically begin murdering civilians, and considerable work must be done to repair the affected areas."
|
||||
if(MOURNING)
|
||||
newMsg.body = "[pick("The popular","The well-liked","The eminent","The well-known")] [pick("professor","entertainer","singer","researcher","public servant","administrator","ship captain","\'REDACTED\'")], [pick( random_name(pick(MALE,FEMALE)), 40; "\'REDACTED\'" )] has [pick("passed away","committed suicide","been murdered","died in a freakish accident")] on [affected_dest.name] today. The entire planet is in mourning, and prices have dropped for industrial goods as worker morale drops."
|
||||
if(CULT_CELL_REVEALED)
|
||||
newMsg.body = "A [pick("dastardly","blood-thirsty","villanous","crazed")] cult of [pick("The Elder Gods","Nar'sie","an apocalyptic sect","\'REDACTED\'")] has [pick("been discovered","been revealed","revealed themselves","gone public")] on [affected_dest.name] earlier today. Public morale has been shaken due to [pick("certain","several","one or two")] [pick("high-profile","well known","popular")] individuals [pick("performing \'REDACTED\' acts","claiming allegiance to the cult","swearing loyalty to the cult leader","promising to aid to the cult")] before those involved could be brought to justice. The editor reminds all personnel that supernatural myths will not be tolerated on NanoTrasen facilities."
|
||||
if(SECURITY_BREACH)
|
||||
newMsg.body = "There was [pick("a security breach in","an unauthorised access in","an attempted theft in","an anarchist attack in","violent sabotage of")] a [pick("high-security","restricted access","classified","\'REDACTED\'")] [pick("\'REDACTED\'","section","zone","area")] this morning. Security was tightened on [affected_dest.name] after the incident, and the editor reassures all NanoTrasen personnel that such lapses are rare."
|
||||
if(ANIMAL_RIGHTS_RAID)
|
||||
newMsg.body = "[pick("Militant animal rights activists","Members of the terrorist group Animal Rights Consortium","Members of the terrorist group \'REDACTED\'")] have [pick("launched a campaign of terror","unleashed a swathe of destruction","raided farms and pastures","forced entry to \'REDACTED\'")] on [affected_dest.name] earlier today, freeing numerous [pick("farm animals","animals","\'REDACTED\'")]. Prices for tame and breeding animals have spiked as a result."
|
||||
if(FESTIVAL)
|
||||
newMsg.body = "A [pick("festival","week long celebration","day of revelry","planet-wide holiday")] has been declared on [affected_dest.name] by [pick("Governor","Commissioner","General","Commandant","Administrator")] [random_name(pick(MALE,FEMALE))] to celebrate [pick("the birth of their [pick("son","daughter")]","coming of age of their [pick("son","daughter")]","the pacification of rogue military cell","the apprehension of a violent criminal who had been terrorising the planet")]. Massive stocks of food and meat have been bought driving up prices across the planet."
|
||||
//see if our location has custom event info for this event
|
||||
newMsg.body = affected_dest.get_custom_eventstring()
|
||||
if(!newMsg.body)
|
||||
switch(event_type)
|
||||
if(RIOTS)
|
||||
newMsg.body = "[pick("Riots have","Unrest has")] broken out on planet [affected_dest.name]. Authorities call for calm, as [pick("various parties","rebellious elements","peacekeeping forces","\'REDACTED\'")] begin stockpiling weaponry and armour. Meanwhile, food and mineral prices are dropping as local industries attempt empty their stocks in expectation of looting."
|
||||
if(WILD_ANIMAL_ATTACK)
|
||||
newMsg.body = "Local [pick("wildlife","animal life","fauna")] on planet [affected_dest.name] has been increasing in agression and raiding outlying settlements for food. Big game hunters have been called in to help alleviate the problem, but numerous injuries have already occurred."
|
||||
if(INDUSTRIAL_ACCIDENT)
|
||||
newMsg.body = "[pick("An industrial accident","A smelting accident","A malfunction","A malfunctioning piece of machinery","Negligent maintenance","A cooleant leak","A ruptured conduit")] at a [pick("factory","installation","power plant","dockyards")] on [affected_dest.name] resulted in severe structural damage and numerous injuries. Repairs are ongoing."
|
||||
if(BIOHAZARD_OUTBREAK)
|
||||
newMsg.body = "[pick("A \'REDACTED\'","A biohazard","An outbreak","A virus")] on [affected_dest.name] has resulted in quarantine, stopping much shipping in the area. Although the quarantine is now lifted, authorities are calling for deliveries of medical supplies to treat the infected, and gas to replace contaminated stocks."
|
||||
if(PIRATES)
|
||||
newMsg.body = "[pick("Pirates","Criminal elements","A [pick("Syndicate","Donk Co.","Waffle Co.","\'REDACTED\'")] strike force")] have [pick("raided","blockaded","attempted to blackmail","attacked")] [affected_dest.name] today. Security has been tightened, but many valuable minerals were taken."
|
||||
if(CORPORATE_ATTACK)
|
||||
newMsg.body = "A small [pick("pirate","Cybersun Industries","Gorlex Marauders","Syndicate")] fleet has precise-jumped into proximity with [affected_dest.name], [pick("for a smash-and-grab operation","in a hit and run attack","in an overt display of hostilities")]. Much damage was done, and security has been tightened since the incident."
|
||||
if(ALIEN_RAIDERS)
|
||||
if(prob(20))
|
||||
newMsg.body = "The Tiger Co-operative have raided [affected_dest.name] today, no doubt on orders from their enigmatic masters. Stealing wildlife, farm animals, medical research materials and kidnapping civilians. NanoTrasen authorities are standing by to counter attempts at bio-terrorism."
|
||||
else
|
||||
newMsg.body = "[pick("The alien species designated \'United Exolitics\'","The alien species designated \'REDACTED\'","An unknown alien species")] have raided [affected_dest.name] today, stealing wildlife, farm animals, medical research materials and kidnapping civilians. It seems they desire to learn more about us, so the Navy will be standing by to accomodate them next time they try."
|
||||
if(AI_LIBERATION)
|
||||
newMsg.body = "A [pick("\'REDACTED\' was detected on","S.E.L.F operative infiltrated","malignant computer virus was detected on","rogue [pick("slicer","hacker")] was apprehended on")] [affected_dest.name] today, and managed to infect [pick("\'REDACTED\'","a sentient sub-system","a class one AI","a sentient defence installation")] before it could be stopped. Many lives were lost as it systematically begin murdering civilians, and considerable work must be done to repair the affected areas."
|
||||
if(MOURNING)
|
||||
newMsg.body = "[pick("The popular","The well-liked","The eminent","The well-known")] [pick("professor","entertainer","singer","researcher","public servant","administrator","ship captain","\'REDACTED\'")], [pick( random_name(pick(MALE,FEMALE)), 40; "\'REDACTED\'" )] has [pick("passed away","committed suicide","been murdered","died in a freakish accident")] on [affected_dest.name] today. The entire planet is in mourning, and prices have dropped for industrial goods as worker morale drops."
|
||||
if(CULT_CELL_REVEALED)
|
||||
newMsg.body = "A [pick("dastardly","blood-thirsty","villanous","crazed")] cult of [pick("The Elder Gods","Nar'sie","an apocalyptic sect","\'REDACTED\'")] has [pick("been discovered","been revealed","revealed themselves","gone public")] on [affected_dest.name] earlier today. Public morale has been shaken due to [pick("certain","several","one or two")] [pick("high-profile","well known","popular")] individuals [pick("performing \'REDACTED\' acts","claiming allegiance to the cult","swearing loyalty to the cult leader","promising to aid to the cult")] before those involved could be brought to justice. The editor reminds all personnel that supernatural myths will not be tolerated on NanoTrasen facilities."
|
||||
if(SECURITY_BREACH)
|
||||
newMsg.body = "There was [pick("a security breach in","an unauthorised access in","an attempted theft in","an anarchist attack in","violent sabotage of")] a [pick("high-security","restricted access","classified","\'REDACTED\'")] [pick("\'REDACTED\'","section","zone","area")] this morning. Security was tightened on [affected_dest.name] after the incident, and the editor reassures all NanoTrasen personnel that such lapses are rare."
|
||||
if(ANIMAL_RIGHTS_RAID)
|
||||
newMsg.body = "[pick("Militant animal rights activists","Members of the terrorist group Animal Rights Consortium","Members of the terrorist group \'REDACTED\'")] have [pick("launched a campaign of terror","unleashed a swathe of destruction","raided farms and pastures","forced entry to \'REDACTED\'")] on [affected_dest.name] earlier today, freeing numerous [pick("farm animals","animals","\'REDACTED\'")]. Prices for tame and breeding animals have spiked as a result."
|
||||
if(FESTIVAL)
|
||||
newMsg.body = "A [pick("festival","week long celebration","day of revelry","planet-wide holiday")] has been declared on [affected_dest.name] by [pick("Governor","Commissioner","General","Commandant","Administrator")] [random_name(pick(MALE,FEMALE))] to celebrate [pick("the birth of their [pick("son","daughter")]","coming of age of their [pick("son","daughter")]","the pacification of rogue military cell","the apprehension of a violent criminal who had been terrorising the planet")]. Massive stocks of food and meat have been bought driving up prices across the planet."
|
||||
|
||||
for(var/datum/feed_channel/FC in news_network.network_channels)
|
||||
if(FC.channel_name == "Tau Ceti Daily")
|
||||
|
||||
@@ -0,0 +1,233 @@
|
||||
|
||||
/datum/event/mundane_news
|
||||
endWhen = 10
|
||||
|
||||
/datum/event/mundane_news/announce()
|
||||
var/datum/trade_destination/affected_dest = pickweight(weighted_mundaneevent_locations)
|
||||
var/event_type = 0
|
||||
if(affected_dest.viable_mundane_events.len)
|
||||
event_type = pick(affected_dest.viable_mundane_events)
|
||||
|
||||
if(!event_type)
|
||||
return
|
||||
|
||||
//copy-pasted from the admin verbs to submit new newscaster messages
|
||||
var/datum/feed_message/newMsg = new /datum/feed_message
|
||||
newMsg.author = "Tau Ceti Daily"
|
||||
newMsg.is_admin_message = 1
|
||||
|
||||
//see if our location has custom event info for this event
|
||||
newMsg.body = affected_dest.get_custom_eventstring()
|
||||
if(!newMsg.body)
|
||||
newMsg.body = ""
|
||||
switch(event_type)
|
||||
if(RESEARCH_BREAKTHROUGH)
|
||||
newMsg.body = "A major breakthough in the field of [pick("plasma research","super-compressed materials","nano-augmentation","bluespace research","volatile power manipulation")] \
|
||||
was announced [pick("yesterday","a few days ago","last week","earlier this month")] by a private firm on [affected_dest.name]. \
|
||||
NanoTrasen declined to comment as to whether this could impinge on profits."
|
||||
|
||||
if(ELECTION)
|
||||
newMsg.body = "The pre-selection of an additional candidates was announced for the upcoming [pick("supervisors council","advisory board","governership","board of inquisitors")] \
|
||||
election on [affected_dest.name] was announced earlier today, \
|
||||
[pick("media mogul","web celebrity", "industry titan", "superstar", "famed chef", "popular gardener", "ex-army officer", "multi-billionaire")] \
|
||||
[random_name(pick(MALE,FEMALE))]. In a statement to the media they said '[pick("My only goal is to help the [pick("sick","poor","children")]",\
|
||||
"I will maintain NanoTrasen's record profits","I believe in our future","We must return to our moral core","Just like... chill out dudes")]'."
|
||||
|
||||
if(RESIGNATION)
|
||||
newMsg.body = "NanoTrasen regretfully announces the resignation of [pick("Sector Admiral","Division Admiral","Ship Admiral","Vice Admiral")] [random_name(pick(MALE,FEMALE))]."
|
||||
if(prob(25))
|
||||
var/locstring = pick("Segunda","Salusa","Cepheus","Andromeda","Gruis","Corona","Aquila","Asellus") + " " + pick("I","II","III","IV","V","VI","VII","VIII")
|
||||
newMsg.body += " In a ceremony on [affected_dest.name] this afternoon, they will be awarded the \
|
||||
[pick("Red Star of Sacrifice","Purple Heart of Heroism","Blue Eagle of Loyalty","Green Lion of Ingenuity")] for "
|
||||
if(prob(33))
|
||||
newMsg.body += "their actions at the Battle of [pick(locstring,"REDACTED")]."
|
||||
else if(prob(50))
|
||||
newMsg.body += "their contribution to the colony of [locstring]."
|
||||
else
|
||||
newMsg.body += "their loyal service over the years."
|
||||
else if(prob(33))
|
||||
newMsg.body += " They are expected to settle down in [affected_dest.name], where they have been granted a handsome pension."
|
||||
else if(prob(50))
|
||||
newMsg.body += " The news was broken on [affected_dest.name] earlier today, where they cited reasons of '[pick("health","family","REDACTED")]'"
|
||||
else
|
||||
newMsg.body += " Administration Aerospace wishes them the best of luck in their retirement ceremony on [affected_dest.name]."
|
||||
|
||||
if(CELEBRITY_DEATH)
|
||||
newMsg.body = "It is with regret today that we announce the sudden passing of the "
|
||||
if(prob(33))
|
||||
newMsg.body += "[pick("distinguished","decorated","veteran","highly respected")] \
|
||||
[pick("Ship's Captain","Vice Admiral","Colonel","Lieutenant Colonel")] "
|
||||
else if(prob(50))
|
||||
newMsg.body += "[pick("award-winning","popular","highly respected","trend-setting")] \
|
||||
[pick("comedian","singer/songwright","artist","playwright","TV personality","model")] "
|
||||
else
|
||||
newMsg.body += "[pick("successful","highly respected","ingenious","esteemed")] \
|
||||
[pick("academic","Professor","Doctor","Scientist")] "
|
||||
|
||||
newMsg.body += "[random_name(pick(MALE,FEMALE))] on [affected_dest.name] [pick("last week","yesterday","this morning","two days ago","three days ago")]\
|
||||
[pick(". Assassination is suspected, but the perpetrators have not yet been brought to justice",\
|
||||
" due to Syndicate infiltrators (since captured)",\
|
||||
" during an industrial accident",\
|
||||
" due to [pick("heart failure","kidney failure","liver failure","brain hemorrhage")]")]"
|
||||
|
||||
if(BARGAINS)
|
||||
newMsg.body += "BARGAINS! BARGAINS! BARGAINS! Commerce Control on [affected_dest.name] wants you to know that everything must go! Across all retail centres, \
|
||||
all goods are being slashed, and all retailors are onboard - so come on over for the \[shopping\] time of your life."
|
||||
|
||||
if(SONG_DEBUT)
|
||||
newMsg.body += "[pick("Singer","Singer/songwriter","Saxophonist","Pianist","Guitarist","TV personality","Star")] [random_name(pick(MALE,FEMALE))] \
|
||||
announced the debut of their new [pick("single","album","EP","label")] '[pick("Everyone's","Look at the","Baby don't eye those","All of those","Dirty nasty")] \
|
||||
[pick("roses","three stars","starships","nanobots","cyborgs","Skrell","Sren'darr")] \
|
||||
[pick("on Venus","on Reade","on Moghes","in my hand","slip through my fingers","die for you","sing your heart out","fly away")]' \
|
||||
with [pick("pre-puchases available","a release tour","cover signings","a launch concert")] on [affected_dest.name]."
|
||||
|
||||
if(MOVIE_RELEASE)
|
||||
newMsg.body += "From the [pick("desk","home town","homeworld","mind")] of [pick("acclaimed","award-winning","popular","stellar")] \
|
||||
[pick("playwright","author","director","actor","TV star")] [random_name(pick(MALE,FEMALE))] comes the latest sensation: '\
|
||||
[pick("Deadly","The last","Lost","Dead")] [pick("Starships","Warriors","outcasts","Tajarans","Unathi","Skrell")] \
|
||||
[pick("of","from","raid","go hunting on","visit","ravage","pillage","destroy")] \
|
||||
[pick("Moghes","Earth","Biesel","Ahdomai","S'randarr","the Void","the Edge of Space")]'.\
|
||||
. Own it on webcast today, or visit the galactic premier on [affected_dest.name]!"
|
||||
|
||||
if(BIG_GAME_HUNTERS)
|
||||
newMsg.body += "Game hunters on [affected_dest.name] "
|
||||
if(prob(33))
|
||||
newMsg.body += "were surprised when an unusual species experts have since identified as \
|
||||
[pick("a subclass of mammal","a divergent abhuman species","an intelligent species of lemur","organic/cyborg hybrids")] turned up. Believed to have been brought in by \
|
||||
[pick("alien smugglers","early colonists","syndicate raiders","unwitting tourists")], this is the first such specimen discovered in the wild."
|
||||
else if(prob(50))
|
||||
newMsg.body += "were attacked by a vicious [pick("nas'r","diyaab","samak","predator which has not yet been identified")]\
|
||||
. Officials urge caution, and locals are advised to stock up on armaments."
|
||||
else
|
||||
newMsg.body += "brought in an unusually [pick("valuable","rare","large","vicious","intelligent")] [pick("mammal","predator","farwa","samak")] for inspection \
|
||||
[pick("today","yesterday","last week")]. Speculators suggest they may be tipped to break several records."
|
||||
|
||||
if(GOSSIP)
|
||||
newMsg.body += "[pick("TV host","Webcast personality","Superstar","Model","Actor","Singer")] [random_name(pick(MALE,FEMALE))] "
|
||||
if(prob(33))
|
||||
newMsg.body += "and their partner announced the birth of their [pick("first","second","third")] child on [affected_dest.name] early this morning. \
|
||||
Doctors say the child is well, and the parents are considering "
|
||||
if(prob(50))
|
||||
newMsg.body += capitalize(pick(first_names_female))
|
||||
else
|
||||
newMsg.body += capitalize(pick(first_names_male))
|
||||
newMsg.body += " for the name."
|
||||
else if(prob(50))
|
||||
newMsg.body += "announced their [pick("split","break up","marriage","engagement")] with [pick("TV host","webcast personality","superstar","model","actor","singer")] \
|
||||
[random_name(pick(MALE,FEMALE))] at [pick("a society ball","a new opening","a launch","a club")] on [affected_dest.name] yesterday, pundits are shocked."
|
||||
else
|
||||
newMsg.body += "is recovering from plastic surgery in a clinic on [affected_dest.name] for the [pick("second","third","fourth")] time, reportedly having made the decision in response to "
|
||||
newMsg.body += "[pick("unkind comments by an ex","rumours started by jealous friends",\
|
||||
"the decision to be dropped by a major sponsor","a disasterous interview on Tau Ceti Tonight")]."
|
||||
if(TOURISM)
|
||||
newMsg.body += "Tourists are flocking to [affected_dest.name] after the surprise announcement of [pick("major shopping bargains by a wily retailer",\
|
||||
"a huge new ARG by a popular entertainment company","a secret tour by popular artiste [random_name(pick(MALE,FEMALE))]")]. \
|
||||
Tau Ceti Daily is offering discount tickets for two to see [random_name(pick(MALE,FEMALE))] live in return for eyewitness reports and up to the minute coverage."
|
||||
|
||||
for(var/datum/feed_channel/FC in news_network.network_channels)
|
||||
if(FC.channel_name == "Tau Ceti Daily")
|
||||
FC.messages += newMsg
|
||||
break
|
||||
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
|
||||
NEWSCASTER.newsAlert("Tau Ceti Daily")
|
||||
|
||||
/datum/event/trivial_news
|
||||
endWhen = 10
|
||||
|
||||
/datum/event/trivial_news/announce()
|
||||
//copy-pasted from the admin verbs to submit new newscaster messages
|
||||
var/datum/feed_message/newMsg = new /datum/feed_message
|
||||
newMsg.author = "Editor Mike Hammers"
|
||||
//newMsg.is_admin_message = 1
|
||||
var/datum/trade_destination/affected_dest = pick(weighted_mundaneevent_locations)
|
||||
newMsg.body = pick(
|
||||
"Tree stuck in tajaran; firefighters baffled.",\
|
||||
"Armadillos want aardvarks removed from dictionary claims 'here first'.",\
|
||||
"Angel found dancing on pinhead ordered to stop; cited for public nuisance.",\
|
||||
"Letters claim they are better than number; 'Always have been'.",\
|
||||
"Pens proclaim pencils obsolete, 'lead is dead'.",\
|
||||
"Rock and paper sues scissors for discrimination.",\
|
||||
"Steak tell-all book reveals he never liked sitting by potato.",\
|
||||
"Woodchuck stops counting how many times he’s chucked 'Never again'.",\
|
||||
"[affected_dest.name] clerk first person able to pronounce '@*$%!'.",\
|
||||
"[affected_dest.name] delis serving boiled paperback dictionaries, 'Adjectives chewy' customers declare.",\
|
||||
"[affected_dest.name] weather deemed 'boring'; meteors and rad storms to be imported.",\
|
||||
"Most [affected_dest.name] security officers prefer cream over sugar.",\
|
||||
"Palindrome speakers conference in [affected_dest.name]; 'Wow!' says Otto.",\
|
||||
"Question mark worshipped as deity by ancient [affected_dest.name] dwellers.",\
|
||||
"Spilled milk causes whole [affected_dest.name] populace to cry.",\
|
||||
"World largest carp patty at display on [affected_dest.name].",\
|
||||
"'Here kitty kitty' no longer preferred tajaran retrieval technique.",\
|
||||
"Man travels 7000 light years to retrieve lost hankie, 'It was my favourite'.",\
|
||||
"New bowling lane that shoots mini-meteors at bowlers very popular.",\
|
||||
"[pick("Unathi","Spacer")] gets tattoo of Tau Ceti on chest '[pick("CentComm","star","starship","asteroid")] tickles most'.",\
|
||||
"Skrell marries computer; wedding attended by 100 modems.",\
|
||||
"Chef reports successfully using harmonica as cheese grater.",\
|
||||
"NanoTrasen invents handkerchief that says 'Bless you' after sneeze.",\
|
||||
"Clone accused of posing for other clones’s school photo.",\
|
||||
"Clone accused of stealing other clones’s employee of the month award.",\
|
||||
"Woman robs station with hair dryer; crewmen love new style.",\
|
||||
"This space for rent.",\
|
||||
"[affected_dest.name] Baker Wins Pickled Crumpet Toss Three Years Running",\
|
||||
"Skrell Scientist Discovers Abacus Can Be Used To Dry Towels",\
|
||||
"Survey: 'Cheese Louise' Voted Best Pizza Restaurant In Tau Ceti",\
|
||||
"I Was Framed, jokes [affected_dest.name] artist",\
|
||||
"Mysterious Loud Rumbling Noises In [affected_dest.name] Found To Be Mysterious Loud Rumblings",\
|
||||
"Alien ambassador becomes lost on [affected_dest.name], refuses to ask for directions",\
|
||||
"Swamp Gas Verified To Be Exhalations Of Stars--Movie Stars--Long Passed",\
|
||||
"Tainted Broccoli Weapon Of Choice For Syndicate Assassins",\
|
||||
"Chefs Find Broccoli Effective Tool For Cutting Cheese",\
|
||||
"Broccoli Found To Cause Grumpiness In Monkeys",\
|
||||
"Survey: 80% Of People on [affected_dest.name] Love Clog-Dancing",\
|
||||
"Giant Hairball Has Perfect Grammar But Rolls rr's Too Much, Linguists Say",\
|
||||
"[affected_dest.name] Phonebooks Print All Wrong Numbers; Results In 15 New Marriages",\
|
||||
"Tajaran Burglar Spotted on [affected_dest.name], Mistaken For Dalmatian",\
|
||||
"Gibson Gazette Updates Frequently Absurd, Poll Indicates",\
|
||||
"Esoteric Verbosity Culminates In Communicative Ennui, [affected_dest.name] Academics Note",\
|
||||
"Taj Demand Longer Breaks, Cleaner Litter, Slower Mice",\
|
||||
"Survey: 3 Out Of 5 Skrell Loathe Modern Art",\
|
||||
"Skrell Scientist Discovers Gravity While Falling Down Stairs",\
|
||||
"Boy Saves Tajaran From Tree on [affected_dest.name], Thousands Cheer",\
|
||||
"Shipment Of Apples Overturns, [affected_dest.name] Diner Offers Applesauce Special",\
|
||||
"Spotted Owl Spotted on [affected_dest.name]",\
|
||||
"Humans Everywhere Agree: Purring Tajarans Are Happy Tajarans",\
|
||||
"From The Desk Of Wise Guy Sammy: One Word In This Gazette Is Sdrawkcab",\
|
||||
"From The Desk Of Wise Guy Sammy: It's Hard To Have Too Much Shelf Space",\
|
||||
"From The Desk Of Wise Guy Sammy: Wine And Friendships Get Better With Age",\
|
||||
"From The Desk Of Wise Guy Sammy: The Insides Of Golf Balls Are Mostly Rubber Bands",\
|
||||
"From The Desk Of Wise Guy Sammy: You Don't Have To Fool All The People, Just The Right Ones",\
|
||||
"From The Desk Of Wise Guy Sammy: If You Made The Mess, You Clean It Up",\
|
||||
"From The Desk Of Wise Guy Sammy: It Is Easier To Get Forgiveness Than Permission",\
|
||||
"From The Desk Of Wise Guy Sammy: Check Your Facts Before Making A Fool Of Yourself",\
|
||||
"From The Desk Of Wise Guy Sammy: You Can't Outwait A Bureaucracy",\
|
||||
"From The Desk Of Wise Guy Sammy: It's Better To Yield Right Of Way Than To Demand It",\
|
||||
"From The Desk Of Wise Guy Sammy: A Person Who Likes Cats Can't Be All Bad",\
|
||||
"From The Desk Of Wise Guy Sammy: Help Is The Sunny Side Of Control",\
|
||||
"From The Desk Of Wise Guy Sammy: Two Points Determine A Straight Line",\
|
||||
"From The Desk Of Wise Guy Sammy: Reading Improves The Mind And Lifts The Spirit",\
|
||||
"From The Desk Of Wise Guy Sammy: Better To Aim High And Miss Then To Aim Low And Hit",\
|
||||
"From The Desk Of Wise Guy Sammy: Meteors Often Strike The Same Place More Than Once",\
|
||||
"Tommy B. Saif Sez: Look Both Ways Before Boarding The Shuttle",\
|
||||
"Tommy B. Saif Sez: Hold On; Sudden Stops Sometimes Necessary",\
|
||||
"Tommy B. Saif Sez: Keep Fingers Away From Moving Panels",\
|
||||
"Tommy B. Saif Sez: No Left Turn, Except Shuttles",\
|
||||
"Tommy B. Saif Sez: Return Seats And Trays To Their Proper Upright Position",\
|
||||
"Tommy B. Saif Sez: Eating And Drinking In Docking Bays Is Prohibited",\
|
||||
"Tommy B. Saif Sez: Accept No Substitutes, And Don't Be Fooled By Imitations",\
|
||||
"Tommy B. Saif Sez: Do Not Remove This Tag Under Penalty Of Law",\
|
||||
"Tommy B. Saif Sez: Always Mix Thoroughly When So Instructed",\
|
||||
"Tommy B. Saif Sez: Try To Keep Six Month's Expenses In Reserve",\
|
||||
"Tommy B. Saif Sez: Change Not Given Without Purchase",\
|
||||
"Tommy B. Saif Sez: If You Break It, You Buy It",\
|
||||
"Tommy B. Saif Sez: Reservations Must Be Cancelled 48 Hours Prior To Event To Obtain Refund",\
|
||||
"Doughnuts: Is There Anything They Can't Do",\
|
||||
"If Tin Whistles Are Made Of Tin, What Do They Make Foghorns Out Of?",\
|
||||
"Broccoli discovered to be colonies of tiny aliens with murder on their minds"\
|
||||
)
|
||||
|
||||
for(var/datum/feed_channel/FC in news_network.network_channels)
|
||||
if(FC.channel_name == "The Gibson Gazette")
|
||||
FC.messages += newMsg
|
||||
break
|
||||
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
|
||||
NEWSCASTER.newsAlert("The Gibson Gazette")
|
||||
@@ -1,4 +1,7 @@
|
||||
|
||||
var/list/weighted_randomevent_locations = list()
|
||||
var/list/weighted_mundaneevent_locations = list()
|
||||
|
||||
/datum/trade_destination
|
||||
var/name = ""
|
||||
var/description = ""
|
||||
@@ -8,6 +11,10 @@
|
||||
var/can_shuttle_here = 0 //one day crew from the exodus will be able to travel to this destination
|
||||
var/list/viable_random_events = list()
|
||||
var/list/temp_price_change[BIOMEDICAL]
|
||||
var/list/viable_mundane_events = list()
|
||||
|
||||
/datum/trade_destination/proc/get_custom_eventstring(var/event_type)
|
||||
return null
|
||||
|
||||
//distance is measured in AU and co-relates to travel time
|
||||
/datum/trade_destination/centcomm
|
||||
@@ -17,6 +24,7 @@
|
||||
willing_to_buy = list()
|
||||
willing_to_sell = list()
|
||||
viable_random_events = list(SECURITY_BREACH, CORPORATE_ATTACK, AI_LIBERATION)
|
||||
viable_mundane_events = list(ELECTION, RESIGNATION, CELEBRITY_DEATH)
|
||||
|
||||
/datum/trade_destination/anansi
|
||||
name = "NSS Anansi"
|
||||
@@ -25,6 +33,13 @@
|
||||
willing_to_buy = list()
|
||||
willing_to_sell = list()
|
||||
viable_random_events = list(SECURITY_BREACH, CULT_CELL_REVEALED, BIOHAZARD_OUTBREAK, PIRATES, ALIEN_RAIDERS)
|
||||
viable_mundane_events = list(RESEARCH_BREAKTHROUGH, RESEARCH_BREAKTHROUGH, BARGAINS, GOSSIP)
|
||||
|
||||
/datum/trade_destination/anansi/get_custom_eventstring(var/event_type)
|
||||
if(event_type == RESEARCH_BREAKTHROUGH)
|
||||
return "Thanks to research conducted on the NSS Anansi, Second Red Cross Society wishes to announce a major breakthough in the field of \
|
||||
[pick("mind-machine interfacing","neuroscience","nano-augmentation","genetics")]. NanoTrasen is expected to announce a co-exploitation deal within the fortnight."
|
||||
return null
|
||||
|
||||
/datum/trade_destination/icarus
|
||||
name = "NMV Icarus"
|
||||
@@ -41,6 +56,13 @@
|
||||
willing_to_buy = list()
|
||||
willing_to_sell = list()
|
||||
viable_random_events = list(INDUSTRIAL_ACCIDENT, PIRATES, CORPORATE_ATTACK)
|
||||
viable_mundane_events = list(RESEARCH_BREAKTHROUGH, RESEARCH_BREAKTHROUGH)
|
||||
|
||||
/datum/trade_destination/redolant/get_custom_eventstring(var/event_type)
|
||||
if(event_type == RESEARCH_BREAKTHROUGH)
|
||||
return "Thanks to research conducted on the OAV Redolant, Osiris Atmospherics wishes to announce a major breakthough in the field of \
|
||||
[pick("plasma research","high energy flux capacitance","super-compressed materials","theoretical particle physics")]. NanoTrasen is expected to announce a co-exploitation deal within the fortnight."
|
||||
return null
|
||||
|
||||
/datum/trade_destination/beltway
|
||||
name = "Beltway mining chain"
|
||||
@@ -49,6 +71,7 @@
|
||||
willing_to_buy = list()
|
||||
willing_to_sell = list()
|
||||
viable_random_events = list(PIRATES, INDUSTRIAL_ACCIDENT)
|
||||
viable_mundane_events = list(TOURISM)
|
||||
|
||||
/datum/trade_destination/biesel
|
||||
name = "Biesel"
|
||||
@@ -57,6 +80,7 @@
|
||||
willing_to_buy = list()
|
||||
willing_to_sell = list()
|
||||
viable_random_events = list(RIOTS, INDUSTRIAL_ACCIDENT, BIOHAZARD_OUTBREAK, CULT_CELL_REVEALED, FESTIVAL, MOURNING)
|
||||
viable_mundane_events = list(BARGAINS, GOSSIP, SONG_DEBUT, MOVIE_RELEASE, ELECTION, TOURISM, RESIGNATION, CELEBRITY_DEATH)
|
||||
|
||||
/datum/trade_destination/new_gibson
|
||||
name = "New Gibson"
|
||||
@@ -65,6 +89,7 @@
|
||||
willing_to_buy = list()
|
||||
willing_to_sell = list()
|
||||
viable_random_events = list(RIOTS, INDUSTRIAL_ACCIDENT, BIOHAZARD_OUTBREAK, CULT_CELL_REVEALED, FESTIVAL, MOURNING)
|
||||
viable_mundane_events = list(ELECTION, TOURISM, RESIGNATION)
|
||||
|
||||
/datum/trade_destination/luthien
|
||||
name = "Luthien"
|
||||
@@ -73,6 +98,7 @@
|
||||
willing_to_buy = list()
|
||||
willing_to_sell = list()
|
||||
viable_random_events = list(WILD_ANIMAL_ATTACK, CULT_CELL_REVEALED, FESTIVAL, MOURNING, ANIMAL_RIGHTS_RAID, ALIEN_RAIDERS)
|
||||
viable_mundane_events = list(ELECTION, TOURISM, BIG_GAME_HUNTERS, RESIGNATION)
|
||||
|
||||
/datum/trade_destination/reade
|
||||
name = "Reade"
|
||||
@@ -81,5 +107,4 @@
|
||||
willing_to_buy = list()
|
||||
willing_to_sell = list()
|
||||
viable_random_events = list(WILD_ANIMAL_ATTACK, CULT_CELL_REVEALED, FESTIVAL, MOURNING, ANIMAL_RIGHTS_RAID, ALIEN_RAIDERS)
|
||||
|
||||
var/list/tradeable_destinations = typesof(/datum/trade_destination) - /datum/trade_destination
|
||||
viable_mundane_events = list(ELECTION, TOURISM, BIG_GAME_HUNTERS, RESIGNATION)
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Core Control computer
|
||||
|
||||
/obj/item/weapon/circuitboard/rust_core_control
|
||||
name = "Circuit board (RUST core controller)"
|
||||
build_path = "/obj/machinery/computer/rust_core_control"
|
||||
origin_tech = "programming=3;engineering=4"
|
||||
|
||||
datum/design/rust_core_control
|
||||
name = "Circuit Design (RUST core controller)"
|
||||
desc = "Allows for the construction of circuit boards used to build a core control console for the RUST fusion engine."
|
||||
id = "rust_core_control"
|
||||
req_tech = list("programming" = 3, "engineering" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/rust_core_control"
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Fuel Control computer
|
||||
|
||||
/obj/item/weapon/circuitboard/rust_fuel_control
|
||||
name = "Circuit board (RUST fuel controller)"
|
||||
build_path = "/obj/machinery/computer/rust_fuel_control"
|
||||
origin_tech = "programming=3;engineering=4"
|
||||
|
||||
datum/design/rust_fuel_control
|
||||
name = "Circuit Design (RUST fuel controller)"
|
||||
desc = "Allows for the construction of circuit boards used to build a fuel injector control console for the RUST fusion engine."
|
||||
id = "rust_fuel_control"
|
||||
req_tech = list("programming" = 3, "engineering" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/rust_fuel_control"
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Fuel Port board
|
||||
|
||||
/obj/item/weapon/module/rust_fuel_port
|
||||
name = "Internal circuitry (RUST fuel port)"
|
||||
icon_state = "card_mod"
|
||||
origin_tech = "engineering=4;materials=5"
|
||||
|
||||
datum/design/rust_fuel_port
|
||||
name = "Internal circuitry (RUST fuel port)"
|
||||
desc = "Allows for the construction of circuit boards used to build a fuel injection port for the RUST fusion engine."
|
||||
id = "rust_fuel_port"
|
||||
req_tech = list("engineering" = 4, "materials" = 5)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$uranium" = 3000)
|
||||
build_path = "/obj/item/weapon/module/rust_fuel_port"
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Fuel Compressor board
|
||||
|
||||
/obj/item/weapon/module/rust_fuel_compressor
|
||||
name = "Internal circuitry (RUST fuel compressor)"
|
||||
icon_state = "card_mod"
|
||||
origin_tech = "materials=7;plasmatech=4"
|
||||
|
||||
datum/design/rust_fuel_compressor
|
||||
name = "Circuit Design (RUST fuel compressor)"
|
||||
desc = "Allows for the construction of circuit boards used to build a fuel compressor of the RUST fusion engine."
|
||||
id = "rust_fuel_compressor"
|
||||
req_tech = list("materials" = 7, "plasmatech" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$diamond" = 1000)
|
||||
build_path = "/obj/item/weapon/module/rust_fuel_compressor"
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Tokamak Core board
|
||||
|
||||
/obj/item/weapon/circuitboard/rust_core
|
||||
name = "Internal circuitry (RUST tokamak core)"
|
||||
build_path = "/obj/machinery/power/rust_core"
|
||||
board_type = "machine"
|
||||
origin_tech = "bluespace=3;plasmatech=4;magnets=5;materials=6;powerstorage=6"
|
||||
frame_desc = "Requires 2 Pico Manipulators, 1 Ultra Micro-Laser, 5 Pieces of Cable, 1 Subspace Crystal and 1 Console Screen."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
|
||||
"/obj/item/weapon/stock_parts/micro_laser/ultra" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/crystal" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/weapon/cable_coil" = 5)
|
||||
|
||||
datum/design/rust_core
|
||||
name = "Internal circuitry (RUST tokamak core)"
|
||||
desc = "The circuit board that for a RUST-pattern tokamak fusion core."
|
||||
id = "pacman"
|
||||
req_tech = list(bluespace = 3, plasmatech = 4, magnets = 5, materials = 6, powerstorage = 6)
|
||||
build_type = IMPRINTER
|
||||
reliability_base = 79
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$diamond" = 2000)
|
||||
build_path = "/obj/item/weapon/circuitboard/rust_core"
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Fuel Injector board
|
||||
|
||||
/obj/item/weapon/circuitboard/rust_injector
|
||||
name = "Internal circuitry (RUST fuel injector)"
|
||||
build_path = "/obj/machinery/power/rust_fuel_injector"
|
||||
board_type = "machine"
|
||||
origin_tech = "powerstorage=3;engineering=4;plasmatech=4;materials=6"
|
||||
frame_desc = "Requires 2 Pico Manipulators, 1 Phasic Scanning Module, 1 Super Matter Bin, 1 Console Screen and 5 Pieces of Cable."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
|
||||
"/obj/item/weapon/stock_parts/scanning_module/phasic" = 1,
|
||||
"/obj/item/weapon/stock_parts/matter_bin/super" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/weapon/cable_coil" = 5)
|
||||
|
||||
datum/design/rust_injector
|
||||
name = "Internal circuitry (RUST tokamak core)"
|
||||
desc = "The circuit board that for a RUST-pattern particle accelerator."
|
||||
id = "pacman"
|
||||
req_tech = list(powerstorage = 3, engineering = 4, plasmatech = 4, materials = 6)
|
||||
build_type = IMPRINTER
|
||||
reliability_base = 79
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$uranium" = 2000)
|
||||
build_path = "/obj/item/weapon/circuitboard/rust_core"
|
||||
|
Before Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1,142 @@
|
||||
|
||||
/obj/machinery/computer/rust_core_control
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "core"
|
||||
var/list/connected_devices = list()
|
||||
var/id_tag = "allan remember to update this before you leave"
|
||||
var/scan_range = 25
|
||||
|
||||
//currently viewed
|
||||
var/obj/machinery/power/rust_core/cur_viewed_device
|
||||
|
||||
/obj/machinery/computer/rust_core_control/process()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
/obj/machinery/computer/rust_core_control/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/rust_core_control/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/computer/rust_core_control/interact(mob/user)
|
||||
if(stat & BROKEN)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=core_control")
|
||||
return
|
||||
if (!istype(user, /mob/living/silicon) && (get_dist(src, user) > 1 ))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=core_control")
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
if(stat & NOPOWER)
|
||||
dat += "<i>The console is dark and nonresponsive.</i>"
|
||||
else
|
||||
dat += "<B>Reactor Core Primary Monitor</B><BR>"
|
||||
if(cur_viewed_device && cur_viewed_device.stat & (BROKEN|NOPOWER))
|
||||
cur_viewed_device = null
|
||||
if(cur_viewed_device && !cur_viewed_device.remote_access_enabled)
|
||||
cur_viewed_device = null
|
||||
|
||||
if(cur_viewed_device)
|
||||
dat += "<b>Device tag:</b> [cur_viewed_device.id_tag ? cur_viewed_device.id_tag : "UNSET"]<br>"
|
||||
dat += "<font color=blue>Device [cur_viewed_device.owned_field ? "activated" : "deactivated"].</font><br>"
|
||||
dat += "<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];toggle_active=1'>\[Bring field [cur_viewed_device.owned_field ? "offline" : "online"]\]</a><br>"
|
||||
dat += "<b>Device [cur_viewed_device.anchored ? "secured" : "unsecured"].</b><br>"
|
||||
dat += "<hr>"
|
||||
dat += "<b>Field encumbrance:</b> [cur_viewed_device.owned_field ? 0 : "NA"]<br>"
|
||||
dat += "<b>Field strength:</b> [cur_viewed_device.field_strength] Wm^3<br>"
|
||||
dat += "<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-1000'>\[----\]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-100'>\[--- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-10'>\[-- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-1'>\[- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=1'>\[+ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=10'>\[++ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=100'>\[+++ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=1000'>\[++++\]</a><br>"
|
||||
dat += "<b>Field frequency:</b> [cur_viewed_device.field_frequency] MHz<br>"
|
||||
dat += "<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-1000'>\[----\]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-100'>\[--- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-10'>\[-- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-1'>\[- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=1'>\[+ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=10'>\[++ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=100'>\[+++ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=1000'>\[++++\]</a><br>"
|
||||
|
||||
var/power_stat = "Good"
|
||||
if(cur_viewed_device.cached_power_avail < cur_viewed_device.active_power_usage)
|
||||
power_stat = "Insufficient"
|
||||
else if(cur_viewed_device.cached_power_avail < cur_viewed_device.active_power_usage * 2)
|
||||
power_stat = "Check"
|
||||
dat += "<b>Power status:</b> [power_stat]<br>"
|
||||
else
|
||||
dat += "<a href='?src=\ref[src];scan=1'>\[Refresh device list\]</a><br><br>"
|
||||
if(connected_devices.len)
|
||||
dat += "<table width='100%' border=1>"
|
||||
dat += "<tr>"
|
||||
dat += "<td><b>Device tag</b></td>"
|
||||
dat += "<td></td>"
|
||||
dat += "</tr>"
|
||||
for(var/obj/machinery/power/rust_core/C in connected_devices)
|
||||
if(!check_core_status(C))
|
||||
connected_devices.Remove(C)
|
||||
continue
|
||||
|
||||
dat += "<tr>"
|
||||
dat += "<td>[C.id_tag]</td>"
|
||||
dat += "<td><a href='?src=\ref[src];manage_individual=\ref[C]'>\[Manage\]</a></td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
else
|
||||
dat += "No devices connected.<br>"
|
||||
|
||||
dat += "<hr>"
|
||||
dat += "<a href='?src=\ref[src];refresh=1'>Refresh</a> "
|
||||
dat += "<a href='?src=\ref[src];close=1'>Close</a>"
|
||||
|
||||
user << browse(dat, "window=core_control;size=500x400")
|
||||
onclose(user, "core_control")
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/computer/rust_core_control/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if( href_list["goto_scanlist"] )
|
||||
cur_viewed_device = null
|
||||
|
||||
if( href_list["manage_individual"] )
|
||||
cur_viewed_device = locate(href_list["manage_individual"])
|
||||
|
||||
if( href_list["scan"] )
|
||||
connected_devices = list()
|
||||
for(var/obj/machinery/power/rust_core/C in range(scan_range, src))
|
||||
if(check_core_status(C))
|
||||
connected_devices.Add(C)
|
||||
|
||||
if( href_list["startup"] )
|
||||
if(cur_viewed_device)
|
||||
cur_viewed_device.Startup()
|
||||
|
||||
if( href_list["shutdown"] )
|
||||
if(cur_viewed_device)
|
||||
cur_viewed_device.Shutdown()
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=core_control")
|
||||
usr.unset_machine()
|
||||
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/computer/rust_core_control/proc/check_core_status(var/obj/machinery/power/rust_core/C)
|
||||
if(!C)
|
||||
return 0
|
||||
|
||||
if(C.stat & (BROKEN|NOPOWER) || !C.remote_access_enabled || !C.id_tag)
|
||||
if(connected_devices.Find(C))
|
||||
connected_devices.Remove(C)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
@@ -40,80 +40,247 @@ max volume of plasma storeable by the field = the total volume of a number of ti
|
||||
|
||||
*/
|
||||
|
||||
/obj/machinery/rust/core
|
||||
name = "Tokamak core"
|
||||
#define MAX_FIELD_FREQ 1000
|
||||
#define MIN_FIELD_FREQ 1
|
||||
#define MAX_FIELD_STR 1000
|
||||
#define MIN_FIELD_STR 1
|
||||
|
||||
/obj/machinery/power/rust_core
|
||||
name = "RUST Tokamak core"
|
||||
desc = "Enormous solenoid for generating extremely high power electromagnetic fields"
|
||||
icon = 'core.dmi'
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "core0"
|
||||
anchored = 1
|
||||
var/on = 0
|
||||
var/obj/machinery/rust/em_field/owned_field
|
||||
var/field_strength = 0.01
|
||||
//
|
||||
density = 1
|
||||
var/obj/effect/rust_em_field/owned_field
|
||||
var/field_strength = 1//0.01
|
||||
var/field_frequency = 1
|
||||
var/id_tag = "allan, don't forget to set the ID of this one too"
|
||||
req_access = list(access_engine)
|
||||
//
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 300
|
||||
idle_power_usage = 50
|
||||
active_power_usage = 500 //multiplied by field strength
|
||||
var/cached_power_avail = 0
|
||||
directwired = 1
|
||||
|
||||
var/state = 0
|
||||
var/locked = 0
|
||||
var/remote_access_enabled = 1
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["startup"] )
|
||||
Startup()
|
||||
return
|
||||
if( href_list["shutdown"] )
|
||||
Shutdown()
|
||||
return
|
||||
if( href_list["modify_field_strength"] )
|
||||
var/new_field_str = text2num(input("Enter new field strength", "Modifying field strength", owned_field.field_strength))
|
||||
if(!new_field_str)
|
||||
usr << "\red That's not a valid number."
|
||||
return
|
||||
field_strength = max(new_field_str,0.1)
|
||||
field_strength = min(new_field_str,50)
|
||||
if(owned_field)
|
||||
owned_field.ChangeFieldStrength(field_strength)
|
||||
return
|
||||
/obj/machinery/power/rust_core/process()
|
||||
if(stat & BROKEN || !powernet)
|
||||
Shutdown()
|
||||
|
||||
proc/Startup()
|
||||
cached_power_avail = avail()
|
||||
//luminosity = round(owned_field.field_strength/10)
|
||||
//luminosity = max(luminosity,1)
|
||||
|
||||
/obj/machinery/power/rust_core/attackby(obj/item/W, mob/user)
|
||||
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(owned_field)
|
||||
user << "Turn off [src] first."
|
||||
return
|
||||
on = 1
|
||||
owned_field = new(src.loc)
|
||||
switch(state)
|
||||
if(0)
|
||||
state = 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] secures [src.name] to the floor.", \
|
||||
"You secure the external reinforcing bolts to the floor.", \
|
||||
"You hear a ratchet")
|
||||
src.anchored = 1
|
||||
if(1)
|
||||
state = 0
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
|
||||
"You undo the external reinforcing bolts.", \
|
||||
"You hear a ratchet")
|
||||
src.anchored = 0
|
||||
if(2)
|
||||
user << "\red The [src.name] needs to be unwelded from the floor."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(owned_field)
|
||||
user << "Turn off the [src] first."
|
||||
return
|
||||
switch(state)
|
||||
if(0)
|
||||
user << "\red The [src.name] needs to be wrenched to the floor."
|
||||
if(1)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
|
||||
"You start to weld the [src] to the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 2
|
||||
user << "You weld the [src] to the floor."
|
||||
connect_to_network()
|
||||
src.directwired = 1
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
if(2)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
|
||||
"You start to cut the [src] free from the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 1
|
||||
user << "You cut the [src] free from the floor."
|
||||
disconnect_from_network()
|
||||
src.directwired = 0
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
|
||||
if(emagged)
|
||||
user << "\red The lock seems to be broken"
|
||||
return
|
||||
if(src.allowed(user))
|
||||
if(owned_field)
|
||||
src.locked = !src.locked
|
||||
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
src.locked = 0 //just in case it somehow gets locked
|
||||
user << "\red The controls can only be locked when the [src] is online"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
locked = 0
|
||||
emagged = 1
|
||||
user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.")
|
||||
return
|
||||
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/power/rust_core/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/power/rust_core/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/power/rust_core/interact(mob/user)
|
||||
if(stat & BROKEN)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=core_gen")
|
||||
return
|
||||
if(!istype(user, /mob/living/silicon) && get_dist(src, user) > 1)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=core_gen")
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
if(!powernet || locked)
|
||||
dat += "<i>The console is dark and nonresponsive.</i>"
|
||||
else
|
||||
dat += "<b>RUST Tokamak pattern Electromagnetic Field Generator</b><br>"
|
||||
dat += "<b>Device ID tag: </b> [id_tag ? id_tag : "UNSET"] <a href='?src=\ref[src];new_id_tag=1'>\[Modify\]</a><br>"
|
||||
dat += "<a href='?src=\ref[src];toggle_active=1'>\[[owned_field ? "Deactivate" : "Activate"]\]</a><br>"
|
||||
dat += "<a href='?src=\ref[src];toggle_remote=1'>\[[remote_access_enabled ? "Disable remote access to this device" : "Enable remote access to this device"]\]</a><br>"
|
||||
dat += "<hr>"
|
||||
dat += "<b>Field strength:</b> [field_strength]Wm^3<br>"
|
||||
dat += "<a href='?src=\ref[src];str=-1000'>\[----\]</a> \
|
||||
<a href='?src=\ref[src];str=-100'>\[--- \]</a> \
|
||||
<a href='?src=\ref[src];str=-10'>\[-- \]</a> \
|
||||
<a href='?src=\ref[src];str=-1'>\[- \]</a> \
|
||||
<a href='?src=\ref[src];str=1'>\[+ \]</a> \
|
||||
<a href='?src=\ref[src];str=10'>\[++ \]</a> \
|
||||
<a href='?src=\ref[src];str=100'>\[+++ \]</a> \
|
||||
<a href='?src=\ref[src];str=1000'>\[++++\]</a><br>"
|
||||
|
||||
dat += "<b>Field frequency:</b> [field_frequency]MHz<br>"
|
||||
dat += "<a href='?src=\ref[src];freq=-1000'>\[----\]</a> \
|
||||
<a href='?src=\ref[src];freq=-100'>\[--- \]</a> \
|
||||
<a href='?src=\ref[src];freq=-10'>\[-- \]</a> \
|
||||
<a href='?src=\ref[src];freq=-1'>\[- \]</a> \
|
||||
<a href='?src=\ref[src];freq=1'>\[+ \]</a> \
|
||||
<a href='?src=\ref[src];freq=10'>\[++ \]</a> \
|
||||
<a href='?src=\ref[src];freq=100'>\[+++ \]</a> \
|
||||
<a href='?src=\ref[src];freq=1000'>\[++++\]</a><br>"
|
||||
|
||||
var/font_colour = "green"
|
||||
if(cached_power_avail < active_power_usage)
|
||||
font_colour = "red"
|
||||
else if(cached_power_avail < active_power_usage * 2)
|
||||
font_colour = "orange"
|
||||
dat += "<b>Power status:</b> <font color=[font_colour]>[active_power_usage]/[cached_power_avail] W</font><br>"
|
||||
|
||||
user << browse(dat, "window=core_gen;size=500x300")
|
||||
onclose(user, "core_gen")
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/power/rust_core/Topic(href, href_list)
|
||||
if(href_list["str"])
|
||||
var/dif = text2num(href_list["str"])
|
||||
field_strength = min(max(field_strength + dif, MIN_FIELD_STR), MAX_FIELD_STR)
|
||||
active_power_usage = 5 * field_strength //change to 500 later
|
||||
if(owned_field)
|
||||
owned_field.ChangeFieldStrength(field_strength)
|
||||
icon_state = "core1"
|
||||
luminosity = 1
|
||||
return 1
|
||||
|
||||
proc/Shutdown()
|
||||
if(href_list["freq"])
|
||||
var/dif = text2num(href_list["freq"])
|
||||
field_frequency = min(max(field_frequency + dif, MIN_FIELD_FREQ), MAX_FIELD_FREQ)
|
||||
if(owned_field)
|
||||
owned_field.ChangeFieldFrequency(field_frequency)
|
||||
|
||||
if(href_list["toggle_active"])
|
||||
if(!Startup())
|
||||
Shutdown()
|
||||
|
||||
if( href_list["toggle_remote"] )
|
||||
remote_access_enabled = !remote_access_enabled
|
||||
|
||||
if(href_list["new_id_tag"])
|
||||
if(usr)
|
||||
id_tag = input("Enter a new ID tag", "Tokamak core ID tag", id_tag) as text|null
|
||||
|
||||
if(href_list["close"])
|
||||
usr << browse(null, "window=core_gen")
|
||||
usr.unset_machine()
|
||||
|
||||
if(href_list["extern_update"])
|
||||
var/obj/machinery/computer/rust_core_control/C = locate(href_list["extern_update"])
|
||||
if(C)
|
||||
C.updateDialog()
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
/obj/machinery/power/rust_core/proc/Startup()
|
||||
if(owned_field)
|
||||
return
|
||||
owned_field = new(src.loc)
|
||||
owned_field.ChangeFieldStrength(field_strength)
|
||||
owned_field.ChangeFieldFrequency(field_frequency)
|
||||
icon_state = "core1"
|
||||
luminosity = 1
|
||||
use_power = 2
|
||||
return 1
|
||||
|
||||
/obj/machinery/power/rust_core/proc/Shutdown()
|
||||
//todo: safety checks for field status
|
||||
if(owned_field)
|
||||
icon_state = "core0"
|
||||
on = 0
|
||||
del(owned_field)
|
||||
luminosity = 0
|
||||
use_power = 1
|
||||
|
||||
proc/AddParticles(var/name, var/quantity = 1)
|
||||
if(owned_field)
|
||||
owned_field.AddParticles(name, quantity)
|
||||
return 1
|
||||
return 0
|
||||
/obj/machinery/power/rust_core/proc/AddParticles(var/name, var/quantity = 1)
|
||||
if(owned_field)
|
||||
owned_field.AddParticles(name, quantity)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
process()
|
||||
..()
|
||||
use_power(100 * field_strength + 500)
|
||||
if(on && !owned_field)
|
||||
Shutdown()
|
||||
return
|
||||
//
|
||||
luminosity = round(owned_field.field_strength/10)
|
||||
luminosity = max(luminosity,1)
|
||||
//
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
Shutdown()
|
||||
|
||||
bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.flag != "bullet" && owned_field)
|
||||
var/obj/item/projectile/beam/laserbeam = Proj
|
||||
owned_field.AddEnergy(0, laserbeam.damage / 5000, laserbeam.frequency)
|
||||
return 0
|
||||
/obj/machinery/power/rust_core/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.flag != "bullet" && owned_field)
|
||||
owned_field.AddEnergy(Proj.damage, 0, 1)
|
||||
return 0
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
|
||||
/obj/machinery/computer/rust_radiation_monitor
|
||||
name = "Radiation Monitor"
|
||||
icon_state = "power"
|
||||
|
||||
/obj/machinery/computer/rust_energy_monitor
|
||||
name = "Core Primary Monitor"
|
||||
icon_state = "power"
|
||||
var/obj/machinery/rust/core/core_generator = null
|
||||
var/updating = 1
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn(0)
|
||||
core_generator = locate() in world
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["shutdown"] )
|
||||
updating = 0
|
||||
core_generator.Topic(href, href_list)
|
||||
updateDialog()
|
||||
updating = 1
|
||||
return
|
||||
if( href_list["startup"] )
|
||||
updating = 0
|
||||
core_generator.Topic(href, href_list)
|
||||
updateDialog()
|
||||
updating = 1
|
||||
return
|
||||
if( href_list["modify_field_strength"] )
|
||||
updating = 0
|
||||
core_generator.Topic(href, href_list)
|
||||
updateDialog()
|
||||
updating = 1
|
||||
return
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=core_monitor")
|
||||
usr.machine = null
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
if(updating)
|
||||
src.updateDialog()
|
||||
|
||||
interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=core_monitor")
|
||||
return
|
||||
var/t = "<B>Reactor Core Primary Monitor</B><BR>"
|
||||
if(core_generator)
|
||||
t += "<font color=blue>[core_generator.on ? "Core Generator connected" : "Core Generator operational"]</font><br>"
|
||||
if(core_generator.owned_field)
|
||||
t += "<font color=green>Core suspension field online</font> <a href='?src=\ref[src];shutdown=1'>\[Bring field offline\]</a><br>"
|
||||
t += "Electromagnetic plasma suspension field status:<br>"
|
||||
t += " <font color=blue>Strength (T): [core_generator.owned_field.field_strength]</font> <a href='?src=\ref[src];modify_field_strength=1'>\[Modify\]</a><br>"
|
||||
t += " <font color=blue>Energy levels (MeV): [core_generator.owned_field.mega_energy]</font><br>"
|
||||
t += " <font color=blue>Core frequency: [core_generator.owned_field.frequency]</font><br>"
|
||||
t += " <font color=blue>Moles of plasma: [core_generator.owned_field.held_plasma.toxins]</font><br>"
|
||||
t += " <font color=blue>Core temperature: [core_generator.owned_field.held_plasma.temperature]</font><br>"
|
||||
t += "<hr>"
|
||||
t += "<b>Core atomic and subatomic constituents:</font></b><br>"
|
||||
if(core_generator.owned_field.dormant_reactant_quantities && core_generator.owned_field.dormant_reactant_quantities.len)
|
||||
for(var/reagent in core_generator.owned_field.dormant_reactant_quantities)
|
||||
t += " <font color=green>[reagent]:</font> [core_generator.owned_field.dormant_reactant_quantities[reagent]]<br>"
|
||||
else
|
||||
t += " <font color=blue>No reactants present.</font><br>"
|
||||
else
|
||||
t += "<font color=red>Core suspension field offline</font> <a href='?src=\ref[src];startup=1'>\[Bring field online\]</a><br>"
|
||||
else
|
||||
t += "<b><font color=red>Core Generator unresponsive</font></b><br>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=core_monitor;size=500x400")
|
||||
user.machine = src
|
||||
|
Before Width: | Height: | Size: 7.8 KiB |
@@ -1,10 +1,10 @@
|
||||
|
||||
/obj/item/weapon/fuel_assembly
|
||||
icon = 'fuel_assembly.dmi'
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "fuel_assembly"
|
||||
name = "Fuel Rod Assembly"
|
||||
var/list/rod_quantities
|
||||
var/percent_depleted = 0
|
||||
var/percent_depleted = 1
|
||||
//
|
||||
New()
|
||||
rod_quantities = new/list
|
||||
|
||||
|
Before Width: | Height: | Size: 251 B |
@@ -1,31 +1,130 @@
|
||||
|
||||
/obj/machinery/rust/fuel_assembly_port
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port
|
||||
name = "Fuel Assembly Port"
|
||||
icon = 'fuel_assembly_port.dmi'
|
||||
icon_state = "port0"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "port2"
|
||||
density = 0
|
||||
var/obj/item/weapon/fuel_assembly/cur_assembly = null
|
||||
var/obj/item/weapon/fuel_assembly/cur_assembly
|
||||
layer = 4
|
||||
var/busy = 0
|
||||
anchored = 1
|
||||
|
||||
attackby(var/obj/item/I, var/mob/user)
|
||||
if(istype(I,/obj/item/weapon/fuel_assembly))
|
||||
if(cur_assembly)
|
||||
del cur_assembly
|
||||
var/opened = 1 //0=closed, 1=opened
|
||||
var/has_electronics = 0 // 0 - none, bit 1 - circuitboard, bit 2 - wires
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/attackby(var/obj/item/I, var/mob/user)
|
||||
if(istype(I,/obj/item/weapon/fuel_assembly) && !opened)
|
||||
if(cur_assembly)
|
||||
user << "\red There is already a fuel rod assembly in there!"
|
||||
else
|
||||
cur_assembly = I
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
icon_state = "port1"
|
||||
|
||||
attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
/*if(stat & (BROKEN|NOPOWER))
|
||||
return*/
|
||||
/obj/machinery/rust_fuel_assembly_port/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER) || opened)
|
||||
return
|
||||
|
||||
if(!busy)
|
||||
busy = 1
|
||||
if(cur_assembly)
|
||||
cur_assembly.loc = src.loc
|
||||
spawn(30)
|
||||
if(!try_insert_assembly())
|
||||
spawn(30)
|
||||
eject_assembly()
|
||||
busy = 0
|
||||
else
|
||||
busy = 0
|
||||
else
|
||||
spawn(30)
|
||||
try_draw_assembly()
|
||||
busy = 0
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/proc/try_insert_assembly()
|
||||
var/success = 0
|
||||
if(cur_assembly)
|
||||
var/turf/check_turf = get_step(get_turf(src), src.dir)
|
||||
check_turf = get_step(check_turf, src.dir)
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in check_turf)
|
||||
if(I.stat & (BROKEN|NOPOWER))
|
||||
break
|
||||
if(I.cur_assembly)
|
||||
break
|
||||
|
||||
I.cur_assembly = cur_assembly
|
||||
cur_assembly.loc = I
|
||||
cur_assembly = null
|
||||
icon_state = "port0"
|
||||
success = 1
|
||||
|
||||
New()
|
||||
//embed the fuel port into a wall
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? 24 : -24)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? 24 : -24) : 0
|
||||
if(success)
|
||||
src.visible_message("\blue \icon[src] a green light flashes on [src] as it inserts it's fuel rod assembly into an injector.")
|
||||
else
|
||||
src.visible_message("\red \icon[src] a red light flashes on [src] as it attempts to insert it's fuel rod assembly into an injector.")
|
||||
return success
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/proc/eject_assembly()
|
||||
if(cur_assembly)
|
||||
var/turf/check_turf = get_step(get_turf(src), src.dir)
|
||||
cur_assembly.loc = check_turf
|
||||
cur_assembly = null
|
||||
icon_state = "port0"
|
||||
return 1
|
||||
else
|
||||
src.visible_message("\red \icon[src] a red light flashes on [src] as it attempts to eject it's fuel rod assembly.")
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/proc/try_draw_assembly()
|
||||
var/success = 0
|
||||
if(cur_assembly)
|
||||
var/turf/check_turf = get_step(get_turf(src), src.dir)
|
||||
check_turf = get_step(check_turf, src.dir)
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in check_turf)
|
||||
if(I.stat & (BROKEN|NOPOWER))
|
||||
break
|
||||
if(!I.cur_assembly)
|
||||
break
|
||||
if(I.injecting)
|
||||
break
|
||||
if(I.stat != 2)
|
||||
break
|
||||
|
||||
cur_assembly = I.cur_assembly
|
||||
cur_assembly.loc = src
|
||||
I.cur_assembly = null
|
||||
icon_state = "port1"
|
||||
success = 1
|
||||
|
||||
if(success)
|
||||
src.visible_message("\icon[src] a blue light flashes on [src] as it draws a fuel rod assembly from an injector.")
|
||||
else
|
||||
src.visible_message("\red \icon[src] a red light flashes on [src] as it attempts to draw a fuel rod assembly from an injector.")
|
||||
return success
|
||||
|
||||
/*
|
||||
/obj/machinery/rust_fuel_assembly_port/verb/try_insert_assembly_verb()
|
||||
set name = "Attempt to insert assembly from port into injector"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(!busy)
|
||||
try_insert_assembly()
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/verb/eject_assembly_verb()
|
||||
set name = "Attempt to eject assembly from port"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(!busy)
|
||||
eject_assembly()
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/verb/try_draw_assembly_verb()
|
||||
set name = "Draw assembly from injector"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(!busy)
|
||||
try_draw_assembly()
|
||||
*/
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,133 @@
|
||||
|
||||
//frame assembly
|
||||
|
||||
/obj/item/rust_fuel_assembly_port_frame
|
||||
name = "Fuel Assembly Port frame"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "port2"
|
||||
w_class = 4
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/rust_fuel_assembly_port_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
new /obj/item/stack/sheet/plasteel( get_turf(src.loc), 12 )
|
||||
del(src)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/rust_fuel_assembly_port_frame/proc/try_build(turf/on_wall)
|
||||
if (get_dist(on_wall,usr)>1)
|
||||
return
|
||||
var/ndir = get_dir(usr,on_wall)
|
||||
if (!(ndir in cardinal))
|
||||
return
|
||||
var/turf/loc = get_turf(usr)
|
||||
var/area/A = loc.loc
|
||||
if (!istype(loc, /turf/simulated/floor))
|
||||
usr << "\red Port cannot be placed on this spot."
|
||||
return
|
||||
if (A.requires_power == 0 || A.name == "Space")
|
||||
usr << "\red Port cannot be placed in this area."
|
||||
return
|
||||
new /obj/machinery/rust_fuel_assembly_port(loc, ndir, 1)
|
||||
del(src)
|
||||
|
||||
//construction steps
|
||||
/obj/machinery/rust_fuel_assembly_port/New(turf/loc, var/ndir, var/building=0)
|
||||
..()
|
||||
|
||||
// offset 24 pixels in direction of dir
|
||||
// this allows the APC to be embedded in a wall, yet still inside an area
|
||||
if (building)
|
||||
dir = ndir
|
||||
else
|
||||
has_electronics = 3
|
||||
opened = 1
|
||||
icon_state = "port0"
|
||||
|
||||
//20% easier to read than apc code
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? 32 : -32)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? 32 : -32) : 0
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/attackby(obj/item/W, mob/user)
|
||||
|
||||
if (istype(user, /mob/living/silicon) && get_dist(src,user)>1)
|
||||
return src.attack_hand(user)
|
||||
if (istype(W, /obj/item/weapon/crowbar))
|
||||
if(opened)
|
||||
if(has_electronics & 1)
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "You begin removing the circuitboard" //lpeters - fixed grammar issues
|
||||
if(do_after(user, 50))
|
||||
user.visible_message(\
|
||||
"\red [user.name] has removed the circuitboard from [src.name]!",\
|
||||
"\blue You remove the circuitboard.")
|
||||
has_electronics = 0
|
||||
new /obj/item/weapon/module/rust_fuel_port(loc)
|
||||
has_electronics &= ~1
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "port0"
|
||||
user << "\blue You close the maintenance cover."
|
||||
else
|
||||
if(cur_assembly)
|
||||
user << "\red You cannot open the cover while there is a fuel assembly inside."
|
||||
else
|
||||
opened = 1
|
||||
user << "\blue You open the maintenance cover."
|
||||
icon_state = "port2"
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/cable_coil) && opened && !(has_electronics & 2))
|
||||
var/obj/item/weapon/cable_coil/C = W
|
||||
if(C.amount < 10)
|
||||
user << "\red You need more wires."
|
||||
return
|
||||
user << "You start adding cables to the frame..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20) && C.amount >= 10)
|
||||
C.use(10)
|
||||
user.visible_message(\
|
||||
"\red [user.name] has added cables to the port frame!",\
|
||||
"You add cables to the port frame.")
|
||||
has_electronics &= 2
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/wirecutters) && opened && (has_electronics & 2))
|
||||
user << "You begin to cut the cables..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 50))
|
||||
new /obj/item/weapon/cable_coil(loc,10)
|
||||
user.visible_message(\
|
||||
"\red [user.name] cut the cabling inside the port.",\
|
||||
"You cut the cabling inside the port.")
|
||||
has_electronics &= ~2
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/module/rust_fuel_port) && opened && !(has_electronics & 1))
|
||||
user << "You trying to insert the port control board into the frame..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 10))
|
||||
has_electronics &= 1
|
||||
user << "You place the port control board inside the frame."
|
||||
del(W)
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/weldingtool) && opened && !has_electronics)
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (WT.get_fuel() < 3)
|
||||
user << "\blue You need more welding fuel to complete this task."
|
||||
return
|
||||
user << "You start welding the port frame..."
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
|
||||
if(do_after(user, 50))
|
||||
if(!src || !WT.remove_fuel(3, user)) return
|
||||
new /obj/item/rust_fuel_assembly_port_frame(loc)
|
||||
user.visible_message(\
|
||||
"\red [src] has been cut away from the wall by [user.name].",\
|
||||
"You detached the port frame.",\
|
||||
"\red You hear welding.")
|
||||
del(src)
|
||||
return
|
||||
|
||||
..()
|
||||
@@ -1,87 +1,113 @@
|
||||
var/const/max_assembly_amount = 300
|
||||
|
||||
/obj/machinery/rust/fuel_compressor
|
||||
icon = 'fuel_compressor.dmi'
|
||||
icon_state = "fuel_compressor"
|
||||
/obj/machinery/rust_fuel_compressor
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "fuel_compressor0"
|
||||
name = "Fuel Compressor"
|
||||
var/list/new_assembly_quantities
|
||||
//
|
||||
New()
|
||||
new_assembly_quantities = new/list
|
||||
spawn(0)
|
||||
new_assembly_quantities["Deuterium"] = 200
|
||||
new_assembly_quantities["Tritium"] = 100
|
||||
//
|
||||
new_assembly_quantities["Helium-3"] = 0
|
||||
new_assembly_quantities["Lithium-6"] = 0
|
||||
new_assembly_quantities["Silver"] = 0
|
||||
var/compressed_matter = 0
|
||||
anchored = 1
|
||||
|
||||
attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
var/opened = 1 //0=closed, 1=opened
|
||||
var/locked = 0
|
||||
var/has_electronics = 0 // 0 - none, bit 1 - circuitboard, bit 2 - wires
|
||||
|
||||
attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
/*if(stat & (BROKEN|NOPOWER))
|
||||
return*/
|
||||
interact(user)
|
||||
|
||||
/*power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
else
|
||||
if( powered() )
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "c_unpowered"
|
||||
stat |= NOPOWER*/
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuelcomp")
|
||||
usr.machine = null
|
||||
return
|
||||
/obj/machinery/rust_fuel_compressor/New()
|
||||
new_assembly_quantities = new/list
|
||||
spawn(0)
|
||||
new_assembly_quantities["Deuterium"] = 200
|
||||
new_assembly_quantities["Tritium"] = 100
|
||||
//
|
||||
for(var/reagent in new_assembly_quantities)
|
||||
if(href_list[reagent])
|
||||
var/new_amount = text2num(input("Enter new rod amount", "Fuel Assembly Rod Composition ([reagent])", new_assembly_quantities[reagent]) as text|null)
|
||||
if(!new_amount)
|
||||
usr << "\red That's not a valid number."
|
||||
return
|
||||
var/sum_reactants = new_amount - new_assembly_quantities[reagent]
|
||||
for(var/rod in new_assembly_quantities)
|
||||
sum_reactants += new_assembly_quantities[rod]
|
||||
if(sum_reactants > max_assembly_amount)
|
||||
usr << "\red You have entered too many rods."
|
||||
else
|
||||
new_assembly_quantities[reagent] = new_amount
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["activate"] )
|
||||
var/obj/item/weapon/fuel_assembly/F = new(src)
|
||||
//world << "\blue New fuel rod assembly"
|
||||
for(var/reagent in new_assembly_quantities)
|
||||
F.rod_quantities[reagent] = new_assembly_quantities[reagent]
|
||||
//world << "\blue [reagent]: new_assembly_quantities[reagent]<br>"
|
||||
F.loc = src.loc
|
||||
new_assembly_quantities["Helium-3"] = 0
|
||||
new_assembly_quantities["Lithium-6"] = 0
|
||||
new_assembly_quantities["Silver"] = 0
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
/*if(stat & (BROKEN|NOPOWER))
|
||||
return*/
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/rcd_ammo))
|
||||
compressed_matter += 10
|
||||
del(W)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuelcomp")
|
||||
return
|
||||
|
||||
interact(mob/user)
|
||||
/*if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=fuelcomp")
|
||||
return*/
|
||||
var/t = "<B>Reactor Fuel Rod Compressor / Assembler</B><BR>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
var/t = "<B>Reactor Fuel Rod Compressor / Assembler</B><BR>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
if(locked)
|
||||
t += "Swipe your ID to unlock this console."
|
||||
else
|
||||
t += "Compressed matter in storage: [compressed_matter] <A href='?src=\ref[src];eject_matter=1'>\[Eject all\]</a>"
|
||||
t += "<A href='?src=\ref[src];activate=1'><b>Activate Fuel Synthesis</b></A><BR> (fuel assemblies require no more than [max_assembly_amount] rods).<br>"
|
||||
t += "<hr>"
|
||||
t += "- New fuel assembly constituents:- <br>"
|
||||
for(var/reagent in new_assembly_quantities)
|
||||
t += " [reagent] rods: [new_assembly_quantities[reagent]] \[<A href='?src=\ref[src];reagent=1'>Modify</A>\]<br>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=fuelcomp;size=500x800")
|
||||
user.machine = src
|
||||
t += " [reagent] rods: [new_assembly_quantities[reagent]] \[<A href='?src=\ref[src];change_reagent=[reagent]'>Modify</A>\]<br>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
|
||||
user << browse(t, "window=fuelcomp;size=500x300")
|
||||
user.set_machine(src)
|
||||
|
||||
//var/locked
|
||||
//var/coverlocked
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuelcomp")
|
||||
usr.machine = null
|
||||
|
||||
if( href_list["eject_matter"] )
|
||||
while(compressed_matter > 10)
|
||||
new /obj/item/weapon/rcd_ammo(src.loc)
|
||||
compressed_matter -= 10
|
||||
src.visible_message("\blue \icon[src] [src] ejects some compressed matter units.")
|
||||
|
||||
if( href_list["activate"] )
|
||||
//world << "\blue New fuel rod assembly"
|
||||
var/obj/item/weapon/fuel_assembly/F = new(src)
|
||||
var/fail = 0
|
||||
var/old_matter = compressed_matter
|
||||
for(var/reagent in new_assembly_quantities)
|
||||
var/req_matter = F.rod_quantities[reagent] / 10
|
||||
if(req_matter <= compressed_matter)
|
||||
F.rod_quantities[reagent] = new_assembly_quantities[reagent]
|
||||
compressed_matter -= req_matter
|
||||
else
|
||||
fail = 1
|
||||
break
|
||||
//world << "\blue [reagent]: new_assembly_quantities[reagent]<br>"
|
||||
if(fail)
|
||||
del(F)
|
||||
compressed_matter = old_matter
|
||||
src.visible_message("\red \icon[src] [src] flashes red: \'Out of matter.\'")
|
||||
else
|
||||
F.loc = src.loc
|
||||
F.percent_depleted = 0
|
||||
|
||||
if( href_list["change_reagent"] )
|
||||
var/cur_reagent = href_list["change_reagent"]
|
||||
var/avail_rods = 300
|
||||
for(var/rod in new_assembly_quantities)
|
||||
avail_rods -= new_assembly_quantities[rod]
|
||||
avail_rods += new_assembly_quantities[cur_reagent]
|
||||
avail_rods = max(avail_rods, 0)
|
||||
|
||||
var/new_amount = min(input("Enter new [cur_reagent] rod amount (max [avail_rods])", "Fuel Assembly Rod Composition ([cur_reagent])") as num, avail_rods)
|
||||
new_assembly_quantities[cur_reagent] = new_amount
|
||||
|
||||
updateDialog()
|
||||
|
||||
|
Before Width: | Height: | Size: 312 B |
@@ -0,0 +1,160 @@
|
||||
|
||||
//frame assembly
|
||||
|
||||
/obj/item/rust_fuel_compressor_frame
|
||||
name = "Fuel Compressor frame"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "fuel_compressor0"
|
||||
w_class = 4
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/rust_fuel_compressor_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
new /obj/item/stack/sheet/plasteel( get_turf(src.loc), 12 )
|
||||
del(src)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/rust_fuel_compressor_frame/proc/try_build(turf/on_wall)
|
||||
if (get_dist(on_wall,usr)>1)
|
||||
return
|
||||
var/ndir = get_dir(usr,on_wall)
|
||||
if (!(ndir in cardinal))
|
||||
return
|
||||
var/turf/loc = get_turf(usr)
|
||||
var/area/A = loc.loc
|
||||
if (!istype(loc, /turf/simulated/floor))
|
||||
usr << "\red Compressor cannot be placed on this spot."
|
||||
return
|
||||
if (A.requires_power == 0 || A.name == "Space")
|
||||
usr << "\red Compressor cannot be placed in this area."
|
||||
return
|
||||
new /obj/machinery/rust_fuel_assembly_port(loc, ndir, 1)
|
||||
del(src)
|
||||
|
||||
//construction steps
|
||||
/obj/machinery/rust_fuel_compressor/New(turf/loc, var/ndir, var/building=0)
|
||||
..()
|
||||
|
||||
// offset 24 pixels in direction of dir
|
||||
// this allows the APC to be embedded in a wall, yet still inside an area
|
||||
if (building)
|
||||
dir = ndir
|
||||
else
|
||||
has_electronics = 3
|
||||
opened = 1
|
||||
locked = 0
|
||||
icon_state = "port0"
|
||||
|
||||
//20% easier to read than apc code
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? 32 : -32)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? 32 : -32) : 0
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/attackby(obj/item/W, mob/user)
|
||||
|
||||
if (istype(user, /mob/living/silicon) && get_dist(src,user)>1)
|
||||
return src.attack_hand(user)
|
||||
if (istype(W, /obj/item/weapon/crowbar))
|
||||
if(opened)
|
||||
if(has_electronics & 1)
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "You begin removing the circuitboard" //lpeters - fixed grammar issues
|
||||
if(do_after(user, 50))
|
||||
user.visible_message(\
|
||||
"\red [user.name] has removed the circuitboard from [src.name]!",\
|
||||
"\blue You remove the circuitboard board.")
|
||||
has_electronics = 0
|
||||
new /obj/item/weapon/module/rust_fuel_compressor(loc)
|
||||
has_electronics &= ~1
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "fuel_compressor0"
|
||||
user << "\blue You close the maintenance cover."
|
||||
else
|
||||
if(compressed_matter > 0)
|
||||
user << "\red You cannot open the cover while there is compressed matter inside."
|
||||
else
|
||||
opened = 1
|
||||
user << "\blue You open the maintenance cover."
|
||||
icon_state = "fuel_compressor1"
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) // trying to unlock the interface with an ID card
|
||||
if(opened)
|
||||
user << "You must close the cover to swipe an ID card."
|
||||
else
|
||||
if(src.allowed(usr))
|
||||
locked = !locked
|
||||
user << "You [ locked ? "lock" : "unlock"] the compressor interface."
|
||||
update_icon()
|
||||
else
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/card/emag) && !emagged) // trying to unlock with an emag card
|
||||
if(opened)
|
||||
user << "You must close the cover to swipe an ID card."
|
||||
else
|
||||
flick("apc-spark", src)
|
||||
if (do_after(user,6))
|
||||
if(prob(50))
|
||||
emagged = 1
|
||||
locked = 0
|
||||
user << "You emag the port interface."
|
||||
else
|
||||
user << "You fail to [ locked ? "unlock" : "lock"] the compressor interface."
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/cable_coil) && opened && !(has_electronics & 2))
|
||||
var/obj/item/weapon/cable_coil/C = W
|
||||
if(C.amount < 10)
|
||||
user << "\red You need more wires."
|
||||
return
|
||||
user << "You start adding cables to the compressor frame..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20) && C.amount >= 10)
|
||||
C.use(10)
|
||||
user.visible_message(\
|
||||
"\red [user.name] has added cables to the compressor frame!",\
|
||||
"You add cables to the port frame.")
|
||||
has_electronics &= 2
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/wirecutters) && opened && (has_electronics & 2))
|
||||
user << "You begin to cut the cables..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 50))
|
||||
new /obj/item/weapon/cable_coil(loc,10)
|
||||
user.visible_message(\
|
||||
"\red [user.name] cut the cabling inside the compressor.",\
|
||||
"You cut the cabling inside the port.")
|
||||
has_electronics &= ~2
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/module/rust_fuel_compressor) && opened && !(has_electronics & 1))
|
||||
user << "You trying to insert the circuitboard into the frame..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 10))
|
||||
has_electronics &= 1
|
||||
user << "You place the circuitboard inside the frame."
|
||||
del(W)
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/weldingtool) && opened && !has_electronics)
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (WT.get_fuel() < 3)
|
||||
user << "\blue You need more welding fuel to complete this task."
|
||||
return
|
||||
user << "You start welding the compressor frame..."
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
|
||||
if(do_after(user, 50))
|
||||
if(!src || !WT.remove_fuel(3, user)) return
|
||||
new /obj/item/rust_fuel_assembly_port_frame(loc)
|
||||
user.visible_message(\
|
||||
"\red [src] has been cut away from the wall by [user.name].",\
|
||||
"You detached the compressor frame.",\
|
||||
"\red You hear welding.")
|
||||
del(src)
|
||||
return
|
||||
|
||||
..()
|
||||
@@ -1,172 +1,192 @@
|
||||
|
||||
/obj/machinery/computer/rust_fuel_control
|
||||
name = "Fuel Injection Control"
|
||||
icon_state = "power"
|
||||
var/list/fuel_injectors
|
||||
var/list/stage_status
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "fuel"
|
||||
var/list/connected_injectors = list()
|
||||
var/list/active_stages = list()
|
||||
var/list/proceeding_stages = list()
|
||||
var/list/stage_times = list()
|
||||
//var/list/stage_status
|
||||
var/announce_fueldepletion = 0
|
||||
var/announce_stageprogression = 0
|
||||
//var/obj/machinery/rust/fuel_injector/Injector = null
|
||||
New()
|
||||
..()
|
||||
//these are the only three stages we can accept
|
||||
//we have another console for SCRAM
|
||||
fuel_injectors = new/list
|
||||
stage_status = new/list
|
||||
var/scan_range = 25
|
||||
var/ticks_this_stage = 0
|
||||
|
||||
fuel_injectors.Add("One")
|
||||
fuel_injectors["One"] = new/list
|
||||
stage_status.Add("One")
|
||||
stage_status["One"] = 0
|
||||
fuel_injectors.Add("Two")
|
||||
fuel_injectors["Two"] = new/list
|
||||
stage_status.Add("Two")
|
||||
stage_status["Two"] = 0
|
||||
fuel_injectors.Add("Three")
|
||||
fuel_injectors["Three"] = new/list
|
||||
stage_status.Add("Three")
|
||||
stage_status["Three"] = 0
|
||||
fuel_injectors.Add("SCRAM")
|
||||
fuel_injectors["SCRAM"] = new/list
|
||||
stage_status.Add("SCRAM")
|
||||
stage_status["SCRAM"] = 0
|
||||
/*/obj/machinery/computer/rust_fuel_control/New()
|
||||
..()
|
||||
//these are the only three stages we can accept
|
||||
//we have another console for SCRAM
|
||||
fuel_injectors = new/list
|
||||
stage_status = new/list
|
||||
|
||||
spawn(0)
|
||||
for(var/obj/machinery/rust/fuel_injector/Injector in world)
|
||||
if(Injector.stage in fuel_injectors)
|
||||
var/list/targetlist = fuel_injectors[Injector.stage]
|
||||
targetlist.Add(Injector)
|
||||
fuel_injectors.Add("One")
|
||||
fuel_injectors["One"] = new/list
|
||||
stage_status.Add("One")
|
||||
stage_status["One"] = 0
|
||||
fuel_injectors.Add("Two")
|
||||
fuel_injectors["Two"] = new/list
|
||||
stage_status.Add("Two")
|
||||
stage_status["Two"] = 0
|
||||
fuel_injectors.Add("Three")
|
||||
fuel_injectors["Three"] = new/list
|
||||
stage_status.Add("Three")
|
||||
stage_status["Three"] = 0
|
||||
fuel_injectors.Add("SCRAM")
|
||||
fuel_injectors["SCRAM"] = new/list
|
||||
stage_status.Add("SCRAM")
|
||||
stage_status["SCRAM"] = 0
|
||||
|
||||
attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
spawn(0)
|
||||
for(var/obj/machinery/power/rust_fuel_injector/Injector in world)
|
||||
if(Injector.stage in fuel_injectors)
|
||||
var/list/targetlist = fuel_injectors[Injector.stage]
|
||||
targetlist.Add(Injector)*/
|
||||
|
||||
attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
/*if(stat & (BROKEN|NOPOWER))
|
||||
return*/
|
||||
interact(user)
|
||||
/obj/machinery/computer/rust_fuel_control/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/*updateDialog()
|
||||
for(var/mob/M in range(1))
|
||||
if(M.machine == src)
|
||||
interact(m)*/
|
||||
/obj/machinery/computer/rust_fuel_control/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuel_monitor")
|
||||
usr.machine = null
|
||||
return
|
||||
if( href_list["beginstage"] )
|
||||
var/stage_name = href_list["beginstage"]
|
||||
if(stage_name in fuel_injectors)
|
||||
var/success = 1
|
||||
for(var/obj/machinery/rust/fuel_injector/Injector in fuel_injectors[stage_name])
|
||||
if(!Injector.BeginInjecting())
|
||||
success = 0
|
||||
if(!success) //may still partially complete
|
||||
usr << "\red Unable to complete command."
|
||||
stage_status[stage_name] = 1
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["begincool"] )
|
||||
var/stage_name = href_list["begincool"]
|
||||
if(stage_name in fuel_injectors)
|
||||
for(var/obj/machinery/rust/fuel_injector/Injector in fuel_injectors[stage_name])
|
||||
Injector.StopInjecting()
|
||||
stage_status[stage_name] = 0
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["restart"] )
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["cooldown"] )
|
||||
for(var/stage_name in fuel_injectors)
|
||||
for(var/obj/machinery/rust/fuel_injector/Injector in fuel_injectors[stage_name])
|
||||
Injector.StopInjecting()
|
||||
stage_status[stage_name] = 0
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["update"] )
|
||||
updateDialog()
|
||||
return
|
||||
//
|
||||
if( href_list["disable_fueldepletion"] )
|
||||
announce_fueldepletion = 0
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["announce_fueldepletion"] )
|
||||
announce_fueldepletion = 1
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["broadcast_fueldepletion"] )
|
||||
announce_fueldepletion = 2
|
||||
updateDialog()
|
||||
return
|
||||
//
|
||||
if( href_list["disable_stageprogression"] )
|
||||
announce_stageprogression = 0
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["announce_stageprogression"] )
|
||||
announce_stageprogression = 1
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["broadcast_stageprogression"] )
|
||||
announce_stageprogression = 2
|
||||
updateDialog()
|
||||
return
|
||||
/obj/machinery/computer/rust_fuel_control/interact(mob/user)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuel_control")
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
src.updateDialog()
|
||||
if (!istype(user, /mob/living/silicon) && get_dist(src, user) > 1)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuel_control")
|
||||
return
|
||||
|
||||
interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=fuel_monitor")
|
||||
return
|
||||
var/t = "<B>Reactor Core Fuel Control</B><BR>"
|
||||
var/cooling = 0
|
||||
for(var/stage in stage_status)
|
||||
if(stage_status[stage])
|
||||
t += "Fuel injection: <font color=blue>Active</font><br>"
|
||||
t += "<a href='?src=\ref[src];cooldown=1;'>Enter cooldown phase</a><br>"
|
||||
cooling = 1
|
||||
break
|
||||
if(!cooling)
|
||||
t += "Fuel injection: <font color=blue>Cooling</font><br>"
|
||||
t += "----<br>"
|
||||
//
|
||||
t += "Fuel depletion announcement: "
|
||||
t += "[announce_fueldepletion ? "<a href='?src=\ref[src];disable_fueldepletion=1'>Disable</a>" : "<b>Disabled</b>"] "
|
||||
t += "[announce_fueldepletion == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_fueldepletion=1'>Announce</a>"] "
|
||||
t += "[announce_fueldepletion == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_fueldepletion=1'>Broadcast</a>"]<br>"
|
||||
t += "Stage progression announcement: "
|
||||
t += "[announce_stageprogression ? "<a href='?src=\ref[src];disable_stageprogression=1'>Disable</a>" : "<b>Disabled</b>"] "
|
||||
t += "[announce_stageprogression == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_stageprogression=1'>Announce</a>"] "
|
||||
t += "[announce_stageprogression == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_stageprogression=1'>Broadcast</a>"] "
|
||||
t += "<hr>"
|
||||
t += "<table border=1><tr>"
|
||||
t += "<td><b>Injector Status</b></td>"
|
||||
t += "<td><b>Injection interval (sec)</b></td>"
|
||||
t += "<td><b>Assembly consumption per injection</b></td>"
|
||||
t += "<td><b>Fuel Assembly Port</b></td>"
|
||||
t += "<td><b>Assembly depletion percentage</b></td>"
|
||||
t += "</tr>"
|
||||
for(var/stage_name in fuel_injectors)
|
||||
var/list/cur_stage = fuel_injectors[stage_name]
|
||||
t += "<tr><td colspan=5><b>Fuel Injection Stage:</b> [stage_name]</font>, [stage_status[stage_name] ? "<font color=green>Active</font> <a href='?src=\ref[src];begincool=[stage_name]'>\[Enter cooldown\]</a>" : "Cooling <a href='?src=\ref[src];beginstage=[stage_name]'>\[Begin injection\]</a>"]</td></tr>"
|
||||
for(var/obj/machinery/rust/fuel_injector/Injector in cur_stage)
|
||||
t += "<tr>"
|
||||
t += "<td>[Injector.on && Injector.remote_enabled ? "<font color=green>Operational</font>" : "<font color=red>Unresponsive</font>"]</td>"
|
||||
t += "<td>[Injector.rate/10] <a href='?src=\ref[Injector];cyclerate=1'>Modify</a></td>"
|
||||
t += "<td>[Injector.fuel_usage*100]% <a href='?src=\ref[Injector];fuel_usage=1'>Modify</a></td>"
|
||||
t += "<td>[Injector.owned_assembly_port ? "[Injector.owned_assembly_port.cur_assembly ? "<font color=green>Loaded</font>": "<font color=blue>Empty</font>"]" : "<font color=red>Disconnected</font>" ]</td>"
|
||||
t += "<td>[Injector.owned_assembly_port && Injector.owned_assembly_port.cur_assembly ? "[Injector.owned_assembly_port.cur_assembly.percent_depleted]%" : ""]</td>"
|
||||
t += "</tr>"
|
||||
t += "</table>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=fuel_monitor;size=500x600")
|
||||
user.machine = src
|
||||
var/dat = "<B>Reactor Core Fuel Control</B><BR>"
|
||||
/*dat += "<b>Fuel depletion announcement:</b> "
|
||||
dat += "[announce_fueldepletion == 0 ? "Disabled" : "<a href='?src=\ref[src];announce_fueldepletion=0'>\[Disable\]</a>"] "
|
||||
dat += "[announce_fueldepletion == 1 ? "Announcing" : "<a href='?src=\ref[src];announce_fueldepletion=1'>\[Announce\]</a>"] "
|
||||
dat += "[announce_fueldepletion == 2 ? "Broadcasting" : "<a href='?src=\ref[src];announce_fueldepletion=2'>\[Broadcast\]</a>"]<br>"
|
||||
dat += "<b>Stage progression announcement:</b> "
|
||||
dat += "[announce_stageprogression == 0 ? "Disabled" : "<a href='?src=\ref[src];announce_stageprogression=0'>\[Disable\]</a>"] "
|
||||
dat += "[announce_stageprogression == 1 ? "Announcing" : "<a href='?src=\ref[src];announce_stageprogression=1'>\[Announce\]</a>"] "
|
||||
dat += "[announce_stageprogression == 2 ? "Broadcasting" : "<a href='?src=\ref[src];announce_stageprogression=2'>\[Broadcast\]</a>"]<br>"*/
|
||||
dat += "<hr>"
|
||||
|
||||
dat += "<b>Detected devices</b> <a href='?src=\ref[src];scan=1'>\[Refresh list\]</a>"
|
||||
dat += "<table border=1 width='100%'>"
|
||||
dat += "<tr>"
|
||||
dat += "<td><b>ID</b></td>"
|
||||
dat += "<td><b>Assembly</b></td>"
|
||||
dat += "<td><b>Consumption</b></td>"
|
||||
dat += "<td><b>Depletion</b></td>"
|
||||
dat += "<td><b>Duration</b></td>"
|
||||
dat += "<td><b>Next stage</b></td>"
|
||||
dat += "<td></td>"
|
||||
dat += "<td></td>"
|
||||
dat += "</tr>"
|
||||
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
|
||||
dat += "<tr>"
|
||||
dat += "<td>[I.id_tag]</td>"
|
||||
if(I.cur_assembly)
|
||||
dat += "<td><a href='?src=\ref[I];toggle_injecting=1;update_extern=\ref[src]'>\[[I.injecting ? "Halt injecting" : "Begin injecting"]\]</a></td>"
|
||||
else
|
||||
dat += "<td>None</td>"
|
||||
dat += "<td>[I.fuel_usage * 100]%</td>"
|
||||
if(I.cur_assembly)
|
||||
dat += "<td>[I.cur_assembly.percent_depleted * 100]%</td>"
|
||||
else
|
||||
dat += "<td>NA</td>"
|
||||
if(stage_times.Find(I.id_tag))
|
||||
dat += "<td>[ticks_this_stage]/[stage_times[I.id_tag]]s <a href='?src=\ref[src];stage_time=[I.id_tag]'>Modify</td>"
|
||||
else
|
||||
dat += "<td>[ticks_this_stage]s <a href='?src=\ref[src];stage_time=[I.id_tag]'>Set</td>"
|
||||
if(proceeding_stages.Find(I.id_tag))
|
||||
dat += "<td><a href='?src=\ref[src];set_next_stage=[I.id_tag]'>[proceeding_stages[I.id_tag]]</a></td>"
|
||||
else
|
||||
dat += "<td>None <a href='?src=\ref[src];set_next_stage=[I.id_tag]'>\[modify\]</a></td>"
|
||||
dat += "<td><a href='?src=\ref[src];toggle_stage=[I.id_tag]'>\[[active_stages.Find(I.id_tag) ? "Deactivate stage" : "Activate stage "] \]</a></td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
|
||||
dat += "<hr>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> "
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(dat, "window=fuel_control;size=800x400")
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/computer/rust_fuel_control/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if( href_list["scan"] )
|
||||
connected_injectors = list()
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in range(scan_range, src))
|
||||
if(check_injector_status(I))
|
||||
connected_injectors.Add(I)
|
||||
|
||||
if( href_list["toggle_stage"] )
|
||||
var/cur_stage = href_list["toggle_stage"]
|
||||
if(active_stages.Find(cur_stage))
|
||||
active_stages.Remove(cur_stage)
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
|
||||
if(I.id_tag == cur_stage && check_injector_status(I))
|
||||
I.StopInjecting()
|
||||
else
|
||||
active_stages.Add(cur_stage)
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
|
||||
if(I.id_tag == cur_stage && check_injector_status(I))
|
||||
I.BeginInjecting()
|
||||
|
||||
if( href_list["cooldown"] )
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
|
||||
if(check_injector_status(I))
|
||||
I.StopInjecting()
|
||||
active_stages = list()
|
||||
|
||||
if( href_list["warmup"] )
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
|
||||
if(check_injector_status(I))
|
||||
I.BeginInjecting()
|
||||
if(!active_stages.Find(I.id_tag))
|
||||
active_stages.Add(I.id_tag)
|
||||
|
||||
if( href_list["stage_time"] )
|
||||
var/cur_stage = href_list["stage_time"]
|
||||
var/new_duration = input("Enter new stage duration in seconds", "Stage duration") as num
|
||||
if(new_duration)
|
||||
stage_times[cur_stage] = new_duration
|
||||
else if(stage_times.Find(cur_stage))
|
||||
stage_times.Remove(cur_stage)
|
||||
|
||||
if( href_list["announce_fueldepletion"] )
|
||||
announce_fueldepletion = text2num(href_list["announce_fueldepletion"])
|
||||
|
||||
if( href_list["announce_stageprogression"] )
|
||||
announce_stageprogression = text2num(href_list["announce_stageprogression"])
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuel_control")
|
||||
usr.unset_machine()
|
||||
|
||||
if( href_list["set_next_stage"] )
|
||||
var/cur_stage = href_list["set_next_stage"]
|
||||
if(!proceeding_stages.Find(cur_stage))
|
||||
proceeding_stages.Add(cur_stage)
|
||||
var/next_stage = input("Enter next stage ID", "Automated stage procession") as text|null
|
||||
if(next_stage)
|
||||
proceeding_stages[cur_stage] = next_stage
|
||||
else
|
||||
proceeding_stages.Remove(cur_stage)
|
||||
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/computer/rust_fuel_control/proc/check_injector_status(var/obj/machinery/power/rust_fuel_injector/I)
|
||||
if(!I)
|
||||
return 0
|
||||
|
||||
if(I.stat & (BROKEN|NOPOWER) || !I.remote_access_enabled || !I.id_tag)
|
||||
if(connected_injectors.Find(I))
|
||||
connected_injectors.Remove(I)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
@@ -1,210 +1,289 @@
|
||||
|
||||
/obj/machinery/rust/fuel_injector
|
||||
/obj/machinery/power/rust_fuel_injector
|
||||
name = "Fuel Injector"
|
||||
icon = 'fuel_injector.dmi'
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "injector0"
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/obj/machinery/rust/fuel_assembly_port/owned_assembly_port
|
||||
//var/list/stageone_assemblyports
|
||||
//var/list/stagetwo_assemblyports
|
||||
//var/list/scram_assemblyports
|
||||
var/obj/machinery/rust/reactor_vessel/Vessel = null
|
||||
var/rate = 10 //microseconds between each cycle
|
||||
var/fuel_usage = 0.0001 //percentage of available fuel to use per cycle
|
||||
var/on = 1
|
||||
var/remote_enabled = 1
|
||||
var/state = 0
|
||||
var/locked = 0
|
||||
var/obj/item/weapon/fuel_assembly/cur_assembly
|
||||
var/fuel_usage = 0.0001 //percentage of available fuel to use per cycle
|
||||
var/id_tag = "One"
|
||||
var/injecting = 0
|
||||
var/stage = "One"
|
||||
var/targetting_field = 0
|
||||
layer = 4
|
||||
var/trying_to_swap_fuel = 0
|
||||
//
|
||||
req_access = list(access_engine)
|
||||
//
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 300
|
||||
active_power_usage = 500
|
||||
var/remote_access_enabled = 1
|
||||
var/cached_power_avail = 0
|
||||
var/emergency_insert_ready = 0
|
||||
|
||||
//fuel assembly should be embedded into the wall behind the injector
|
||||
New()
|
||||
..()
|
||||
name = "Stage [stage] Fuel Injector"
|
||||
//pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
|
||||
//pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
|
||||
/*
|
||||
stageone_assemblyports = new/list()
|
||||
stagetwo_assemblyports = new/list()
|
||||
scram_assemblyports = new/list()
|
||||
spawn(1)
|
||||
Vessel = locate() in range(6,src)
|
||||
for(var/obj/machinery/rust/fuel_assembly_port/S in range(6,src))
|
||||
switch(S.stage)
|
||||
if("One")
|
||||
stageone_assemblyports.Add(S)
|
||||
if("Two")
|
||||
stagetwo_assemblyports.Add(S)
|
||||
if("SCRAM")
|
||||
scram_assemblyports.Add(S)
|
||||
*/
|
||||
spawn(1)
|
||||
var/rev_dir = reverse_direction(dir)
|
||||
var/turf/mid = get_step(src, rev_dir)
|
||||
for(var/obj/machinery/rust/fuel_assembly_port/port in get_step(mid, rev_dir))
|
||||
owned_assembly_port = port
|
||||
//
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuel_injector")
|
||||
usr.machine = null
|
||||
return
|
||||
if( href_list["begin_injecting"] )
|
||||
BeginInjecting()
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["end_injecting"] )
|
||||
/obj/machinery/power/rust_fuel_injector/process()
|
||||
if(injecting)
|
||||
if(stat & BROKEN || !powernet)
|
||||
StopInjecting()
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["cyclerate"] )
|
||||
var/new_rate = text2num(input("Enter new injection rate (0.1 - 10 sec)", "Modifying injection rate", rate/10))
|
||||
if(!new_rate)
|
||||
usr << "\red That's not a valid number."
|
||||
return
|
||||
new_rate = min(new_rate,0.1)
|
||||
new_rate = max(new_rate,10)
|
||||
rate = new_rate * 10
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["fuel_usage"] )
|
||||
var/new_rate = text2num(input("Enter new fuel usage (1 - 100%)", "Modifying fuel usage", rate/10))
|
||||
if(!new_rate)
|
||||
usr << "\red That's not a valid number."
|
||||
return
|
||||
new_rate = min(new_rate,0.1)
|
||||
new_rate = max(new_rate,10)
|
||||
rate = new_rate * 10
|
||||
updateDialog()
|
||||
return
|
||||
|
||||
attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
/*if(stat & (BROKEN|NOPOWER))
|
||||
return*/
|
||||
interact(user)
|
||||
|
||||
interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=fuel_injector")
|
||||
return
|
||||
var/t = "<B>Reactor Core Fuel Injector</B><hr>"
|
||||
t += "<b>Stage:</b> <font color=blue>[stage]</font><br>"
|
||||
t += "<b>Status:</b> [injecting ? "<font color=green>Active</font> <a href='?src=\ref[src];end_injecting=1'>\[Disable\]</a>" : "<font color=blue>Standby</font> <a href='?src=\ref[src];begin_injecting=1'>\[Enable\]</a>"]<br>"
|
||||
t += "<b>Interval (sec):</b> <font color=blue>[rate/10]</font> <a href='?src=\ref[src];cyclerate=1'>\[Modify\]</a><br>"
|
||||
t += "<b>Fuel usage:</b> [fuel_usage*100]% <a href='?src=\ref[src];fuel_usage=1'>\[Modify\]</a><br>"
|
||||
/*
|
||||
var/t = "<B>Reactor Core Fuel Control</B><BR>"
|
||||
t += "Current fuel injection stage: [active_stage]<br>"
|
||||
if(active_stage == "Cooling")
|
||||
//t += "<a href='?src=\ref[src];restart=1;'>Restart injection cycle</a><br>"
|
||||
t += "----<br>"
|
||||
else
|
||||
t += "<a href='?src=\ref[src];cooldown=1;'>Enter cooldown phase</a><br>"
|
||||
t += "Fuel depletion announcement: "
|
||||
t += "[announce_fueldepletion ? "<a href='?src=\ref[src];disable_fueldepletion=1'>Disable</a>" : "<b>Disabled</b>"] "
|
||||
t += "[announce_fueldepletion == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_fueldepletion=1'>Announce</a>"] "
|
||||
t += "[announce_fueldepletion == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_fueldepletion=1'>Broadcast</a>"]<br>"
|
||||
t += "Stage progression announcement: "
|
||||
t += "[announce_stageprogression ? "<a href='?src=\ref[src];disable_stageprogression=1'>Disable</a>" : "<b>Disabled</b>"] "
|
||||
t += "[announce_stageprogression == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_stageprogression=1'>Announce</a>"] "
|
||||
t += "[announce_stageprogression == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_stageprogression=1'>Broadcast</a>"] "
|
||||
t += "<hr>"
|
||||
t += "<table border=1><tr>"
|
||||
t += "<td><b>Injector Status</b></td>"
|
||||
t += "<td><b>Injection interval (sec)</b></td>"
|
||||
t += "<td><b>Assembly consumption per injection</b></td>"
|
||||
t += "<td><b>Fuel Assembly Port</b></td>"
|
||||
t += "<td><b>Assembly depletion percentage</b></td>"
|
||||
t += "</tr>"
|
||||
for(var/stage in fuel_injectors)
|
||||
var/list/cur_stage = fuel_injectors[stage]
|
||||
t += "<tr><td colspan=5><b>Fuel Injection Stage:</b> <font color=blue>[stage]</font> [active_stage == stage ? "<font color=green> (Currently active)</font>" : "<a href='?src=\ref[src];beginstage=[stage]'>Activate</a>"]</td></tr>"
|
||||
for(var/obj/machinery/rust/fuel_injector/Injector in cur_stage)
|
||||
t += "<tr>"
|
||||
t += "<td>[Injector.on && Injector.remote_enabled ? "<font color=green>Operational</font>" : "<font color=red>Unresponsive</font>"]</td>"
|
||||
t += "<td>[Injector.rate/10] <a href='?src=\ref[Injector];cyclerate=1'>Modify</a></td>"
|
||||
t += "<td>[Injector.fuel_usage*100]% <a href='?src=\ref[Injector];fuel_usage=1'>Modify</a></td>"
|
||||
t += "<td>[Injector.owned_assembly_port ? "[Injector.owned_assembly_port.cur_assembly ? "<font color=green>Loaded</font>": "<font color=blue>Empty</font>"]" : "<font color=red>Disconnected</font>" ]</td>"
|
||||
t += "<td>[Injector.owned_assembly_port && Injector.owned_assembly_port.cur_assembly ? "[100 - Injector.owned_assembly_port.cur_assembly.amount_depleted*100]%" : ""]</td>"
|
||||
t += "</tr>"
|
||||
t += "</table>"
|
||||
*/
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=fuel_injector;size=500x800")
|
||||
user.machine = src
|
||||
Inject()
|
||||
|
||||
proc/BeginInjecting()
|
||||
if(!injecting && owned_assembly_port && owned_assembly_port.cur_assembly)
|
||||
icon_state = "injector1"
|
||||
injecting = 1
|
||||
spawn(rate)
|
||||
Inject()
|
||||
return 1
|
||||
return 0
|
||||
cached_power_avail = avail()
|
||||
|
||||
proc/StopInjecting()
|
||||
/obj/machinery/power/rust_fuel_injector/attackby(obj/item/W, mob/user)
|
||||
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(injecting)
|
||||
injecting = 0
|
||||
icon_state = "injector0"
|
||||
return 1
|
||||
return 0
|
||||
|
||||
proc/Inject()
|
||||
if(!injecting)
|
||||
user << "Turn off the [src] first."
|
||||
return
|
||||
if(owned_assembly_port.cur_assembly)
|
||||
var/obj/machinery/rust/em_field/target_field
|
||||
if(targetting_field)
|
||||
for(var/obj/machinery/rust/em_field/field in range(15))
|
||||
target_field = field
|
||||
var/amount_left = 0
|
||||
for(var/reagent in owned_assembly_port.cur_assembly.rod_quantities)
|
||||
//world << "checking [reagent]"
|
||||
if(owned_assembly_port.cur_assembly.rod_quantities[reagent] > 0)
|
||||
//world << " rods left: [owned_assembly_port.cur_assembly.rod_quantities[reagent]]"
|
||||
var/amount = owned_assembly_port.cur_assembly.rod_quantities[reagent] * fuel_usage
|
||||
var/numparticles = round(amount * 1000)
|
||||
if(numparticles < 1)
|
||||
numparticles = 1
|
||||
//world << " amount: [amount]"
|
||||
//world << " numparticles: [numparticles]"
|
||||
//
|
||||
var/obj/effect/accelerated_particle/particle = new/obj/effect/accelerated_particle(src.loc, src.dir)
|
||||
particle.particle_type = reagent
|
||||
particle.energy = 0
|
||||
particle.icon_state = "particle"
|
||||
particle.additional_particles = numparticles - 1
|
||||
particle.target = target_field
|
||||
//
|
||||
owned_assembly_port.cur_assembly.rod_quantities[reagent] -= amount
|
||||
amount_left += owned_assembly_port.cur_assembly.rod_quantities[reagent]
|
||||
owned_assembly_port.cur_assembly.percent_depleted = amount_left / 300
|
||||
flick("injector-emitting",src)
|
||||
use_power(fuel_usage * 10000 + 100) //0.0001
|
||||
if(injecting)
|
||||
spawn(rate)
|
||||
Inject()
|
||||
else
|
||||
injecting = 0
|
||||
switch(state)
|
||||
if(0)
|
||||
state = 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] secures [src.name] to the floor.", \
|
||||
"You secure the external reinforcing bolts to the floor.", \
|
||||
"You hear a ratchet")
|
||||
src.anchored = 1
|
||||
if(1)
|
||||
state = 0
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
|
||||
"You undo the external reinforcing bolts.", \
|
||||
"You hear a ratchet")
|
||||
src.anchored = 0
|
||||
if(2)
|
||||
user << "\red The [src.name] needs to be unwelded from the floor."
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(injecting)
|
||||
user << "Turn off the [src] first."
|
||||
return
|
||||
switch(state)
|
||||
if(0)
|
||||
user << "\red The [src.name] needs to be wrenched to the floor."
|
||||
if(1)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
|
||||
"You start to weld the [src] to the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 2
|
||||
user << "You weld the [src] to the floor."
|
||||
connect_to_network()
|
||||
src.directwired = 1
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
if(2)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
|
||||
"You start to cut the [src] free from the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 1
|
||||
user << "You cut the [src] free from the floor."
|
||||
disconnect_from_network()
|
||||
src.directwired = 0
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
|
||||
if(emagged)
|
||||
user << "\red The lock seems to be broken"
|
||||
return
|
||||
if(src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
locked = 0
|
||||
emagged = 1
|
||||
user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.")
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/fuel_assembly) && !cur_assembly)
|
||||
if(emergency_insert_ready)
|
||||
cur_assembly = W
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
emergency_insert_ready = 0
|
||||
return
|
||||
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/interact(mob/user)
|
||||
if(stat & BROKEN)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuel_injector")
|
||||
return
|
||||
if(get_dist(src, user) > 1 )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuel_injector")
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
if (!powernet || locked || state != 2)
|
||||
dat += "<i>The console is dark and nonresponsive.</i>"
|
||||
else
|
||||
dat += "<B>Reactor Core Fuel Injector</B><hr>"
|
||||
dat += "<b>Device ID tag:</b> [id_tag] <a href='?src=\ref[src];modify_tag=1'>\[Modify\]</a><br>"
|
||||
dat += "<b>Status:</b> [injecting ? "<font color=green>Active</font> <a href='?src=\ref[src];toggle_injecting=1'>\[Disable\]</a>" : "<font color=blue>Standby</font> <a href='?src=\ref[src];toggle_injecting=1'>\[Enable\]</a>"]<br>"
|
||||
dat += "<b>Fuel usage:</b> [fuel_usage*100]% <a href='?src=\ref[src];fuel_usage=1'>\[Modify\]</a><br>"
|
||||
dat += "<b>Fuel assembly port:</b> "
|
||||
dat += "<a href='?src=\ref[src];fuel_assembly=1'>\[[cur_assembly ? "Eject assembly to port" : "Draw assembly from port"]\]</a> "
|
||||
if(cur_assembly)
|
||||
dat += "<a href='?src=\ref[src];emergency_fuel_assembly=1'>\[Emergency eject\]</a><br>"
|
||||
else
|
||||
dat += "<a href='?src=\ref[src];emergency_fuel_assembly=1'>\[[emergency_insert_ready ? "Cancel emergency insertion" : "Emergency insert"]\]</a><br>"
|
||||
var/font_colour = "green"
|
||||
if(cached_power_avail < active_power_usage)
|
||||
font_colour = "red"
|
||||
else if(cached_power_avail < active_power_usage * 2)
|
||||
font_colour = "orange"
|
||||
dat += "<b>Power status:</b> <font color=[font_colour]>[active_power_usage]/[cached_power_avail] W</font><br>"
|
||||
dat += "<a href='?src=\ref[src];toggle_remote=1'>\[[remote_access_enabled ? "Disable remote access" : "Enable remote access"]\]</a><br>"
|
||||
|
||||
dat += "<hr>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> "
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
|
||||
user << browse(dat, "window=fuel_injector;size=500x300")
|
||||
onclose(user, "fuel_injector")
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if( href_list["modify_tag"] )
|
||||
id_tag = input("Enter new ID tag", "Modifying ID tag") as text|null
|
||||
|
||||
if( href_list["fuel_assembly"] )
|
||||
if(!trying_to_swap_fuel)
|
||||
trying_to_swap_fuel = 1
|
||||
spawn(50)
|
||||
attempt_fuel_swap()
|
||||
trying_to_swap_fuel = 0
|
||||
|
||||
if( href_list["emergency_fuel_assembly"] )
|
||||
if(cur_assembly)
|
||||
cur_assembly.loc = src.loc
|
||||
cur_assembly = null
|
||||
//irradiate!
|
||||
else
|
||||
emergency_insert_ready = !emergency_insert_ready
|
||||
|
||||
if( href_list["toggle_injecting"] )
|
||||
if(injecting)
|
||||
StopInjecting()
|
||||
else
|
||||
BeginInjecting()
|
||||
|
||||
if( href_list["toggle_remote"] )
|
||||
remote_access_enabled = !remote_access_enabled
|
||||
|
||||
if( href_list["fuel_usage"] )
|
||||
var/new_usage = text2num(input("Enter new fuel usage (0.01% - 100%)", "Modifying fuel usage", fuel_usage * 100))
|
||||
if(!new_usage)
|
||||
usr << "\red That's not a valid number."
|
||||
return
|
||||
new_usage = max(new_usage, 0.01)
|
||||
new_usage = min(new_usage, 100)
|
||||
fuel_usage = new_usage / 100
|
||||
active_power_usage = 500 + 1000 * fuel_usage
|
||||
|
||||
if( href_list["update_extern"] )
|
||||
var/obj/machinery/computer/rust_fuel_control/C = locate(href_list["update_extern"])
|
||||
if(C)
|
||||
C.updateDialog()
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuel_injector")
|
||||
usr.unset_machine()
|
||||
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/proc/BeginInjecting()
|
||||
if(!injecting && cur_assembly)
|
||||
icon_state = "injector1"
|
||||
injecting = 1
|
||||
use_power = 1
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/proc/StopInjecting()
|
||||
if(injecting)
|
||||
injecting = 0
|
||||
icon_state = "injector0"
|
||||
use_power = 0
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/proc/Inject()
|
||||
if(!injecting)
|
||||
return
|
||||
if(cur_assembly)
|
||||
var/amount_left = 0
|
||||
for(var/reagent in cur_assembly.rod_quantities)
|
||||
//world << "checking [reagent]"
|
||||
if(cur_assembly.rod_quantities[reagent] > 0)
|
||||
//world << " rods left: [cur_assembly.rod_quantities[reagent]]"
|
||||
var/amount = cur_assembly.rod_quantities[reagent] * fuel_usage
|
||||
var/numparticles = round(amount * 1000)
|
||||
if(numparticles < 1)
|
||||
numparticles = 1
|
||||
//world << " amount: [amount]"
|
||||
//world << " numparticles: [numparticles]"
|
||||
//
|
||||
|
||||
var/obj/effect/accelerated_particle/A = new/obj/effect/accelerated_particle(get_turf(src), dir)
|
||||
A.particle_type = reagent
|
||||
A.additional_particles = numparticles - 1
|
||||
//A.target = target_field
|
||||
//
|
||||
cur_assembly.rod_quantities[reagent] -= amount
|
||||
amount_left += cur_assembly.rod_quantities[reagent]
|
||||
cur_assembly.percent_depleted = amount_left / 300
|
||||
flick("injector-emitting",src)
|
||||
else
|
||||
StopInjecting()
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/proc/attempt_fuel_swap()
|
||||
var/rev_dir = reverse_direction(dir)
|
||||
var/turf/mid = get_step(src, rev_dir)
|
||||
var/success = 0
|
||||
for(var/obj/machinery/rust_fuel_assembly_port/check_port in get_step(mid, rev_dir))
|
||||
if(cur_assembly)
|
||||
if(!check_port.cur_assembly)
|
||||
check_port.cur_assembly = cur_assembly
|
||||
cur_assembly.loc = check_port
|
||||
cur_assembly = null
|
||||
check_port.icon_state = "port1"
|
||||
success = 1
|
||||
else
|
||||
if(check_port.cur_assembly)
|
||||
cur_assembly = check_port.cur_assembly
|
||||
cur_assembly.loc = src
|
||||
check_port.cur_assembly = null
|
||||
check_port.icon_state = "port0"
|
||||
success = 1
|
||||
|
||||
break
|
||||
if(success)
|
||||
src.visible_message("\blue \icon[src] a green light flashes on [src].")
|
||||
updateDialog()
|
||||
//
|
||||
else
|
||||
src.visible_message("\red \icon[src] a red light flashes on [src].")
|
||||
|
||||
|
Before Width: | Height: | Size: 3.8 KiB |
@@ -3,7 +3,7 @@
|
||||
/obj/item/projectile/beam/ehf_beam
|
||||
|
||||
/obj/machinery/rust/gyrotron
|
||||
icon = 'gyrotron.dmi'
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "emitter-off"
|
||||
name = "Gyrotron"
|
||||
anchored = 1
|
||||
|
||||
|
Before Width: | Height: | Size: 6.0 KiB |
@@ -1,7 +1,8 @@
|
||||
|
||||
/obj/machinery/computer/rust_gyrotron_controller
|
||||
name = "Gyrotron Remote Controller"
|
||||
icon_state = "power"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "engine"
|
||||
var/updating = 1
|
||||
|
||||
New()
|
||||
|
||||
@@ -67,4 +67,8 @@
|
||||
//particle.invisibility = 2
|
||||
//
|
||||
return particle
|
||||
*/
|
||||
*/
|
||||
|
||||
/obj/machinery/computer/rust_radiation_monitor
|
||||
name = "Radiation Monitor"
|
||||
icon_state = "power"
|
||||
|
||||
|
Before Width: | Height: | Size: 617 B After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 492 B |
@@ -1,49 +1,53 @@
|
||||
|
||||
//gimmicky hack to collect particles and direct them into the field
|
||||
//byond multitiles are basically... shit
|
||||
/obj/machinery/rust/particle_catcher
|
||||
invisibility = 101
|
||||
/obj/effect/rust_particle_catcher
|
||||
icon = 'effects.dmi'
|
||||
icon_state = "energynet"
|
||||
density = 0
|
||||
anchored = 1
|
||||
var/obj/machinery/rust/em_field/parent
|
||||
invisibility = 101
|
||||
layer = 4
|
||||
var/obj/effect/rust_em_field/parent
|
||||
var/mysize = 0
|
||||
|
||||
/*New()
|
||||
for(var/obj/machinery/rust/em_field/field in range(6))
|
||||
parent = field
|
||||
if(!parent)
|
||||
del(src)*/
|
||||
/*/obj/effect/rust_particle_catcher/New()
|
||||
for(var/obj/machinery/rust/em_field/field in range(6))
|
||||
parent = field
|
||||
if(!parent)
|
||||
del(src)*/
|
||||
|
||||
proc/SetSize(var/newsize)
|
||||
name = "collector [newsize]"
|
||||
mysize = newsize
|
||||
UpdateSize()
|
||||
/obj/effect/rust_particle_catcher/process()
|
||||
if(!parent)
|
||||
del(src)
|
||||
|
||||
proc/AddParticles(var/name, var/quantity = 1)
|
||||
if(parent && parent.size >= mysize)
|
||||
parent.AddParticles(name, quantity)
|
||||
return 1
|
||||
return 0
|
||||
/obj/effect/rust_particle_catcher/proc/SetSize(var/newsize)
|
||||
name = "collector [newsize]"
|
||||
mysize = newsize
|
||||
UpdateSize()
|
||||
|
||||
proc/UpdateSize()
|
||||
if(parent.size >= mysize)
|
||||
density = 1
|
||||
//invisibility = 101
|
||||
name = "collector [mysize] ON"
|
||||
else
|
||||
density = 0
|
||||
name = "collector [mysize] OFF"
|
||||
//invisibility = 101
|
||||
/obj/effect/rust_particle_catcher/proc/AddParticles(var/name, var/quantity = 1)
|
||||
if(parent && parent.size >= mysize)
|
||||
parent.AddParticles(name, quantity)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.flag != "bullet" && parent)
|
||||
var/obj/item/projectile/beam/laserbeam = Proj
|
||||
parent.AddEnergy(0, laserbeam.damage / 5000, laserbeam.frequency)
|
||||
return 0
|
||||
/obj/effect/rust_particle_catcher/proc/UpdateSize()
|
||||
if(parent.size >= mysize)
|
||||
density = 1
|
||||
invisibility = 0
|
||||
name = "collector [mysize] ON"
|
||||
else
|
||||
density = 0
|
||||
invisibility = 101
|
||||
name = "collector [mysize] OFF"
|
||||
|
||||
process()
|
||||
..()
|
||||
if(!parent)
|
||||
del(src)
|
||||
/obj/effect/rust_particle_catcher/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.flag != "bullet" && parent)
|
||||
parent.AddEnergy(Proj.damage, 0, 1)
|
||||
update_icon()
|
||||
return 0
|
||||
|
||||
/obj/effect/rust_particle_catcher/Bumped(atom/AM)
|
||||
if(ismob(AM) && density && prob(10))
|
||||
AM << "\red A powerful force pushes you back."
|
||||
..()
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// External Shield Generator
|
||||
|
||||
/obj/item/weapon/circuitboard/shield_gen_ex
|
||||
name = "Circuit board (Experimental hull shield generator)"
|
||||
board_type = "machine"
|
||||
build_path = "/obj/machinery/shield_gen/external"
|
||||
origin_tech = "bluespace=4;plasmatech=3"
|
||||
frame_desc = "Requires 2 Pico Manipulators, 1 Subspace Transmitter, 5 Pieces of cable, 1 Subspace Crystal, 1 Subspace Amplifier and 1 Console Screen."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
|
||||
"/obj/item/weapon/stock_parts/subspace/transmitter" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/crystal" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/amplifier" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/weapon/cable_coil" = 5)
|
||||
|
||||
datum/design/shield_gen_ex
|
||||
name = "Circuit Design (Experimental hull shield generator)"
|
||||
desc = "Allows for the construction of circuit boards used to build an experimental hull shield generator."
|
||||
id = "shield_gen"
|
||||
req_tech = list("bluespace" = 4, "plasmatech" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 10000, "$diamond" = 5000, "$gold" = 10000)
|
||||
build_path = "/obj/machinery/shield_gen/external"
|
||||
|
||||
////////////////////////////////////////
|
||||
// Shield Generator
|
||||
|
||||
/obj/item/weapon/circuitboard/shield_gen
|
||||
name = "Circuit board (Experimental shield generator)"
|
||||
board_type = "machine"
|
||||
build_path = "/obj/machinery/shield_gen/external"
|
||||
origin_tech = "bluespace=4;plasmatech=3"
|
||||
frame_desc = "Requires 2 Pico Manipulators, 1 Subspace Transmitter, 5 Pieces of cable, 1 Subspace Crystal, 1 Subspace Amplifier and 1 Console Screen."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
|
||||
"/obj/item/weapon/stock_parts/subspace/transmitter" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/crystal" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/amplifier" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/weapon/cable_coil" = 5)
|
||||
|
||||
datum/design/shield_gen
|
||||
name = "Circuit Design (Experimental shield generator)"
|
||||
desc = "Allows for the construction of circuit boards used to build an experimental shield generator."
|
||||
id = "shield_gen"
|
||||
req_tech = list("bluespace" = 4, "plasmatech" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 10000, "$diamond" = 5000, "$gold" = 10000)
|
||||
build_path = "/obj/machinery/shield_gen/external"
|
||||
|
||||
////////////////////////////////////////
|
||||
// Shield Capacitor
|
||||
|
||||
/obj/item/weapon/circuitboard/shield_cap
|
||||
name = "Circuit board (Experimental shield capacitor)"
|
||||
board_type = "machine"
|
||||
build_path = "/obj/machinery/shield_capacitor"
|
||||
origin_tech = "magnets=3;powerstorage=4"
|
||||
frame_desc = "Requires 2 Pico Manipulators, 1 Subspace Filter, 5 Pieces of cable, 1 Subspace Treatment disk, 1 Subspace Analyzer and 1 Console Screen."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
|
||||
"/obj/item/weapon/stock_parts/subspace/filter" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/treatment" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/analyzer" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/weapon/cable_coil" = 5)
|
||||
|
||||
datum/design/shield_cap
|
||||
name = "Circuit Design (Experimental shield capacitor)"
|
||||
desc = "Allows for the construction of circuit boards used to build an experimental shielding capacitor."
|
||||
id = "shield_cap"
|
||||
req_tech = list("magnets" = 3, "powerstorage" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 10000, "$diamond" = 5000, "$silver" = 10000)
|
||||
build_path = "/obj/machinery/shield_gen/external"
|
||||
@@ -1,52 +1,55 @@
|
||||
|
||||
//---------- actual energy field
|
||||
|
||||
/obj/effect/energy_field
|
||||
name = "energy field"
|
||||
desc = "Impenetrable field of energy, capable of blocking anything as long as it's active."
|
||||
icon = 'shielding.dmi'
|
||||
icon_state = "shieldsparkles"
|
||||
anchored = 1
|
||||
layer = 2.1
|
||||
density = 0
|
||||
invisibility = 2
|
||||
var/strength = 0
|
||||
var/obj/machinery/shield_gen/parent
|
||||
var/stress = 0
|
||||
|
||||
/obj/effect/energy_field/ex_act(var/severity)
|
||||
Stress(0.5 + severity)
|
||||
|
||||
/obj/effect/energy_field/bullet_act(var/obj/item/projectile/Proj)
|
||||
Stress(1 + 1 * (Proj.damage / 100))
|
||||
|
||||
|
||||
/obj/effect/energy_field/meteorhit(obj/effect/meteor/M as obj)
|
||||
if(M)
|
||||
walk(M,0)
|
||||
|
||||
/obj/effect/energy_field/proc/Stress(var/severity)
|
||||
strength -= severity
|
||||
stress += severity
|
||||
|
||||
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
|
||||
if(strength < 1)
|
||||
invisibility = 2
|
||||
density = 0
|
||||
|
||||
/obj/effect/energy_field/proc/Strengthen(var/severity)
|
||||
strength += severity
|
||||
|
||||
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
|
||||
if(strength > 1)
|
||||
invisibility = 0
|
||||
density = 1
|
||||
|
||||
/obj/effect/energy_field/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
|
||||
//Purpose: Determines if the object (or airflow) can pass this atom.
|
||||
//Called by: Movement, airflow.
|
||||
//Inputs: The moving atom (optional), target turf, "height" and air group
|
||||
//Outputs: Boolean if can pass.
|
||||
|
||||
//return (!density || !height || air_group)
|
||||
return density
|
||||
|
||||
//---------- actual energy field
|
||||
|
||||
/obj/effect/energy_field
|
||||
name = "energy field"
|
||||
desc = "Impenetrable field of energy, capable of blocking anything as long as it's active."
|
||||
icon = 'shielding.dmi'
|
||||
icon_state = "shieldsparkles"
|
||||
anchored = 1
|
||||
layer = 2.1
|
||||
density = 0
|
||||
invisibility = 101
|
||||
var/strength = 0
|
||||
|
||||
/obj/effect/energy_field/ex_act(var/severity)
|
||||
Stress(0.5 + severity)
|
||||
|
||||
/obj/effect/energy_field/bullet_act(var/obj/item/projectile/Proj)
|
||||
Stress(Proj.damage / 10)
|
||||
|
||||
/obj/effect/energy_field/meteorhit(obj/effect/meteor/M as obj)
|
||||
if(M)
|
||||
walk(M,0)
|
||||
Stress(2)
|
||||
|
||||
/obj/effect/energy_field/proc/Stress(var/severity)
|
||||
strength -= severity
|
||||
|
||||
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
|
||||
if(strength < 1)
|
||||
invisibility = 101
|
||||
density = 0
|
||||
else if(strength >= 1)
|
||||
invisibility = 0
|
||||
density = 1
|
||||
|
||||
/obj/effect/energy_field/proc/Strengthen(var/severity)
|
||||
strength += severity
|
||||
|
||||
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
|
||||
if(strength >= 1)
|
||||
invisibility = 0
|
||||
density = 1
|
||||
else if(strength < 1)
|
||||
invisibility = 101
|
||||
density = 0
|
||||
|
||||
/obj/effect/energy_field/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
|
||||
//Purpose: Determines if the object (or airflow) can pass this atom.
|
||||
//Called by: Movement, airflow.
|
||||
//Inputs: The moving atom (optional), target turf, "height" and air group
|
||||
//Outputs: Boolean if can pass.
|
||||
|
||||
//return (!density || !height || air_group)
|
||||
return !density
|
||||
@@ -1,158 +1,171 @@
|
||||
|
||||
//---------- shield capacitor
|
||||
//pulls energy out of a power net and charges an adjacent generator
|
||||
|
||||
/obj/machinery/shield_capacitor
|
||||
name = "shield capacitor"
|
||||
desc = "Machine that charges a shield generator."
|
||||
icon = 'shielding.dmi'
|
||||
icon_state = "capacitor"
|
||||
var/active = 1
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/shield_gen/target_generator
|
||||
var/stored_charge = 0
|
||||
var/time_since_fail = 100
|
||||
var/max_charge = 1000000
|
||||
var/max_charge_rate = 100000
|
||||
var/min_charge_rate = 0
|
||||
var/locked = 0
|
||||
//
|
||||
use_power = 1 //0 use nothing
|
||||
//1 use idle power
|
||||
//2 use active power
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
var/charge_rate = 100
|
||||
|
||||
/obj/machinery/shield_capacitor/New()
|
||||
spawn(10)
|
||||
for(var/obj/machinery/shield_gen/possible_gen in range(1, src))
|
||||
if(get_dir(src, possible_gen) == src.dir)
|
||||
target_generator = possible_gen
|
||||
possible_gen.owned_capacitor = src
|
||||
break
|
||||
..()
|
||||
|
||||
/obj/machinery/shield_capacitor/verb/rotate()
|
||||
set name = "Rotate Clockwise"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if (src.anchored || usr:stat)
|
||||
usr << "It is fastened to the floor!"
|
||||
return 0
|
||||
src.dir = turn(src.dir, 270)
|
||||
target_generator = locate() in get_step(src,dir)
|
||||
if(target_generator && !target_generator.owned_capacitor)
|
||||
target_generator.owned_capacitor = src
|
||||
return 1
|
||||
|
||||
/obj/machinery/shield_capacitor/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broke"
|
||||
else
|
||||
if( powered() )
|
||||
if (src.active)
|
||||
icon_state = "capacitor"
|
||||
else
|
||||
icon_state = "capacitor"
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "capacitor"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/shield_capacitor/process()
|
||||
//
|
||||
if(active)
|
||||
use_power = 2
|
||||
if(stored_charge + charge_rate > max_charge)
|
||||
active_power_usage = max_charge - stored_charge
|
||||
else
|
||||
active_power_usage = charge_rate
|
||||
stored_charge += active_power_usage
|
||||
else
|
||||
use_power = 1
|
||||
|
||||
time_since_fail++
|
||||
if(stored_charge < active_power_usage * 1.5)
|
||||
time_since_fail = 0
|
||||
//
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/shield_capacitor/attackby(obj/item/W, mob/user)
|
||||
/*if(istype(W, /obj/item/weapon/wrench))
|
||||
if(active)
|
||||
user << "Turn off the field generator first."
|
||||
return
|
||||
|
||||
else if(state == 0)
|
||||
state = 1
|
||||
playsound(src.loc, 'Ratchet.ogg', 75, 1)
|
||||
user << "You secure the external reinforcing bolts to the floor."
|
||||
src.anchored = 1
|
||||
return
|
||||
|
||||
else if(state == 1)
|
||||
state = 0
|
||||
playsound(src.loc, 'Ratchet.ogg', 75, 1)
|
||||
user << "You undo the external reinforcing bolts."
|
||||
src.anchored = 0
|
||||
return*/
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
if (src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
src.anchored = !src.anchored
|
||||
src.visible_message("\blue \icon[src] [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].")
|
||||
|
||||
else
|
||||
src.add_fingerprint(user)
|
||||
user << "\red You hit the [src.name] with your [W.name]!"
|
||||
for(var/mob/M in viewers(src))
|
||||
if(M == user) continue
|
||||
M.show_message("\red The [src.name] has been hit with the [W.name] by [user.name]!")
|
||||
|
||||
/obj/machinery/shield_capacitor/Topic(href, href_list[])
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=shield_capacitor")
|
||||
usr.machine = null
|
||||
return
|
||||
if( href_list["toggle"] )
|
||||
active = !active
|
||||
if(active)
|
||||
use_power = 2
|
||||
else
|
||||
use_power = 1
|
||||
if( href_list["charge_rate"] )
|
||||
charge_rate += text2num(href_list["charge_rate"])
|
||||
if(charge_rate > max_charge_rate)
|
||||
charge_rate = max_charge_rate
|
||||
else if(charge_rate < min_charge_rate)
|
||||
charge_rate = min_charge_rate
|
||||
//
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/shield_capacitor/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=shield_capacitor")
|
||||
return
|
||||
var/t = "<B>Shield Capacitor Control Console</B><BR>"
|
||||
t += "[target_generator ? "<font color=green>Shield generator connected.</font>" : "<font color=red>Unable to locate shield generator!</font>"]<br>"
|
||||
t += "This capacitor is: [active ? "<font color=green>Online</font>" : "<font color=red>Offline</font>" ] <a href='?src=\ref[src];toggle=1'>[active ? "\[Deactivate\]" : "\[Activate\]"]</a><br>"
|
||||
t += "[time_since_fail > 2 ? "<font color=green>Charging stable.</font>" : "<font color=red>Warning, low charge!</font>"]<br>"
|
||||
t += "Capacitor charge: [stored_charge] Watts ([100 * stored_charge/max_charge]%)<br>"
|
||||
t += "Capacitor charge rate (approx): <a href='?src=\ref[src];charge_rate=[-max_charge_rate]'>\[min\]</a> <a href='?src=\ref[src];charge_rate=-1000'>\[--\]</a> <a href='?src=\ref[src];charge_rate=-100'>\[-\]</a>[charge_rate] Watts/sec <a href='?src=\ref[src];charge_rate=100'>\[+\]</a> <a href='?src=\ref[src];charge_rate=1000'>\[++\]</a> <a href='?src=\ref[src];charge_rate=[max_charge_rate]'>\[max\]</a><br>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=shield_capacitor;size=500x800")
|
||||
user.machine = src
|
||||
|
||||
//---------- shield capacitor
|
||||
//pulls energy out of a power net and charges an adjacent generator
|
||||
|
||||
/obj/machinery/shield_capacitor
|
||||
name = "shield capacitor"
|
||||
desc = "Machine that charges a shield generator."
|
||||
icon = 'shielding.dmi'
|
||||
icon_state = "capacitor"
|
||||
var/active = 1
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/stored_charge = 0
|
||||
var/time_since_fail = 100
|
||||
var/max_charge = 1000000
|
||||
var/max_charge_rate = 100000
|
||||
var/min_charge_rate = 0
|
||||
var/locked = 0
|
||||
//
|
||||
use_power = 1 //0 use nothing
|
||||
//1 use idle power
|
||||
//2 use active power
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
var/charge_rate = 100
|
||||
|
||||
/obj/machinery/shield_capacitor/New()
|
||||
spawn(10)
|
||||
for(var/obj/machinery/shield_gen/possible_gen in range(1, src))
|
||||
if(get_dir(src, possible_gen) == src.dir)
|
||||
possible_gen.owned_capacitor = src
|
||||
break
|
||||
..()
|
||||
|
||||
/obj/machinery/shield_capacitor/attackby(obj/item/W, mob/user)
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/id))
|
||||
var/obj/item/weapon/card/id/C = W
|
||||
if(access_captain in C.access || access_security in C.access || access_engine in C.access)
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
updateDialog()
|
||||
else
|
||||
user << "\red Access denied."
|
||||
else if(istype(W, /obj/item/weapon/card/emag))
|
||||
if(prob(75))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
updateDialog()
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
src.anchored = !src.anchored
|
||||
src.visible_message("\blue \icon[src] [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].")
|
||||
|
||||
spawn(0)
|
||||
for(var/obj/machinery/shield_gen/gen in range(1, src))
|
||||
if(get_dir(src, gen) == src.dir)
|
||||
if(!src.anchored && gen.owned_capacitor == src)
|
||||
gen.owned_capacitor = null
|
||||
break
|
||||
else if(src.anchored && !gen.owned_capacitor)
|
||||
gen.owned_capacitor = src
|
||||
break
|
||||
gen.updateDialog()
|
||||
updateDialog()
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/shield_capacitor/attack_paw(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/shield_capacitor/attack_ai(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/shield_capacitor/attack_hand(mob/user)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/shield_capacitor/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=shield_capacitor")
|
||||
return
|
||||
var/t = "<B>Shield Capacitor Control Console</B><br><br>"
|
||||
if(locked)
|
||||
t += "<i>Swipe your ID card to begin.</i>"
|
||||
else
|
||||
t += "This capacitor is: [active ? "<font color=green>Online</font>" : "<font color=red>Offline</font>" ] <a href='?src=\ref[src];toggle=1'>[active ? "\[Deactivate\]" : "\[Activate\]"]</a><br>"
|
||||
t += "[time_since_fail > 2 ? "<font color=green>Charging stable.</font>" : "<font color=red>Warning, low charge!</font>"]<br>"
|
||||
t += "Charge: [stored_charge] Watts ([100 * stored_charge/max_charge]%)<br>"
|
||||
t += "Charge rate: \
|
||||
<a href='?src=\ref[src];charge_rate=[-max_charge_rate]'>\[min\]</a> \
|
||||
<a href='?src=\ref[src];charge_rate=-1000'>\[--\]</a> \
|
||||
<a href='?src=\ref[src];charge_rate=-100'>\[-\]</a>[charge_rate] Watts/sec \
|
||||
<a href='?src=\ref[src];charge_rate=100'>\[+\]</a> \
|
||||
<a href='?src=\ref[src];charge_rate=1000'>\[++\]</a> \
|
||||
<a href='?src=\ref[src];charge_rate=[max_charge_rate]'>\[max\]</a><br>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src]'>Refresh</A> "
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
|
||||
user << browse(t, "window=shield_capacitor;size=500x800")
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/shield_capacitor/process()
|
||||
//
|
||||
if(active)
|
||||
use_power = 2
|
||||
if(stored_charge + charge_rate > max_charge)
|
||||
active_power_usage = max_charge - stored_charge
|
||||
else
|
||||
active_power_usage = charge_rate
|
||||
stored_charge += active_power_usage
|
||||
else
|
||||
use_power = 1
|
||||
|
||||
time_since_fail++
|
||||
if(stored_charge < active_power_usage * 1.5)
|
||||
time_since_fail = 0
|
||||
|
||||
/obj/machinery/shield_capacitor/Topic(href, href_list[])
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=shield_capacitor")
|
||||
usr.unset_machine()
|
||||
return
|
||||
if( href_list["toggle"] )
|
||||
active = !active
|
||||
if(active)
|
||||
use_power = 2
|
||||
else
|
||||
use_power = 1
|
||||
if( href_list["charge_rate"] )
|
||||
charge_rate += text2num(href_list["charge_rate"])
|
||||
if(charge_rate > max_charge_rate)
|
||||
charge_rate = max_charge_rate
|
||||
else if(charge_rate < min_charge_rate)
|
||||
charge_rate = min_charge_rate
|
||||
//
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/shield_capacitor/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broke"
|
||||
else
|
||||
if( powered() )
|
||||
if (src.active)
|
||||
icon_state = "capacitor"
|
||||
else
|
||||
icon_state = "capacitor"
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "capacitor"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/shield_capacitor/verb/rotate()
|
||||
set name = "Rotate capacitor clockwise"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if (src.anchored)
|
||||
usr << "It is fastened to the floor!"
|
||||
return
|
||||
src.dir = turn(src.dir, 270)
|
||||
return
|
||||
@@ -25,7 +25,6 @@
|
||||
var/max_field_strength = 10
|
||||
var/time_since_fail = 100
|
||||
var/energy_conversion_rate = 0.01 //how many renwicks per watt?
|
||||
var/flicker_shield_glitch = 1 //shield is slightly faulty and flickers - don't think this is working as intended
|
||||
//
|
||||
use_power = 1 //0 use nothing
|
||||
//1 use idle power
|
||||
@@ -38,14 +37,191 @@
|
||||
for(var/obj/machinery/shield_capacitor/possible_cap in range(1, src))
|
||||
if(get_dir(possible_cap, src) == possible_cap.dir)
|
||||
owned_capacitor = possible_cap
|
||||
possible_cap.target_generator = src
|
||||
break
|
||||
field = new/list()
|
||||
..()
|
||||
|
||||
//copied from a copypaste. DRY, right?
|
||||
/obj/machinery/shield_gen/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/card/id))
|
||||
var/obj/item/weapon/card/id/C = W
|
||||
if(access_captain in C.access || access_security in C.access || access_engine in C.access)
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
updateDialog()
|
||||
else
|
||||
user << "\red Access denied."
|
||||
else if(istype(W, /obj/item/weapon/card/emag))
|
||||
if(prob(75))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
updateDialog()
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
src.anchored = !src.anchored
|
||||
src.visible_message("\blue \icon[src] [src] has been [anchored?"bolted to the floor":"unbolted from the floor"] by [user].")
|
||||
|
||||
spawn(0)
|
||||
for(var/obj/machinery/shield_gen/gen in range(1, src))
|
||||
if(get_dir(src, gen) == src.dir)
|
||||
if(!src.anchored && gen.owned_capacitor == src)
|
||||
gen.owned_capacitor = null
|
||||
break
|
||||
else if(src.anchored && !gen.owned_capacitor)
|
||||
gen.owned_capacitor = src
|
||||
break
|
||||
gen.updateDialog()
|
||||
updateDialog()
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/shield_gen/attack_paw(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/shield_gen/attack_ai(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/shield_gen/attack_hand(mob/user)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/shield_gen/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=shield_generator")
|
||||
return
|
||||
var/t = "<B>Shield Generator Control Console</B><BR><br>"
|
||||
if(locked)
|
||||
t += "<i>Swipe your ID card to begin.</i>"
|
||||
else
|
||||
t += "[owned_capacitor ? "<font color=green>Charge capacitor connected.</font>" : "<font color=red>Unable to locate charge capacitor!</font>"]<br>"
|
||||
t += "This generator is: [active ? "<font color=green>Online</font>" : "<font color=red>Offline</font>" ] <a href='?src=\ref[src];toggle=1'>[active ? "\[Deactivate\]" : "\[Activate\]"]</a><br>"
|
||||
t += "[time_since_fail > 2 ? "<font color=green>Field is stable.</font>" : "<font color=red>Warning, field is unstable!</font>"]<br>"
|
||||
t += "Coverage radius (restart required): \
|
||||
<a href='?src=\ref[src];change_radius=-5'>--</a> \
|
||||
<a href='?src=\ref[src];change_radius=-1'>-</a> \
|
||||
[field_radius * 2]m \
|
||||
<a href='?src=\ref[src];change_radius=1'>+</a> \
|
||||
<a href='?src=\ref[src];change_radius=5'>++</a><br>"
|
||||
t += "Overall field strength: [average_field_strength] Renwicks ([max_field_strength ? 100 * average_field_strength / max_field_strength : "NA"]%)<br>"
|
||||
t += "Charge rate: <a href='?src=\ref[src];strengthen_rate=-0.1'>--</a> \
|
||||
<a href='?src=\ref[src];strengthen_rate=-0.01'>-</a> \
|
||||
[strengthen_rate] Renwicks/sec \
|
||||
<a href='?src=\ref[src];strengthen_rate=0.01'>+</a> \
|
||||
<a href='?src=\ref[src];strengthen_rate=0.1'>++</a><br>"
|
||||
t += "Upkeep energy: [field.len * average_field_strength / energy_conversion_rate] Watts/sec<br>"
|
||||
t += "Additional energy required to charge: [field.len * strengthen_rate / energy_conversion_rate] Watts/sec<br>"
|
||||
t += "Maximum field strength: \
|
||||
<a href='?src=\ref[src];max_field_strength=-100'>\[min\]</a> \
|
||||
<a href='?src=\ref[src];max_field_strength=-10'>--</a> \
|
||||
<a href='?src=\ref[src];max_field_strength=-1'>-</a> \
|
||||
[max_field_strength] Renwicks \
|
||||
<a href='?src=\ref[src];max_field_strength=1'>+</a> \
|
||||
<a href='?src=\ref[src];max_field_strength=10'>++</a> \
|
||||
<a href='?src=\ref[src];max_field_strength=100'>\[max\]</a><br>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src]'>Refresh</A> "
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=shield_generator;size=500x800")
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/shield_gen/process()
|
||||
|
||||
if(active && field.len)
|
||||
var/stored_renwicks = 0
|
||||
var/target_field_strength = min(strengthen_rate + max(average_field_strength, 0), max_field_strength)
|
||||
if(owned_capacitor)
|
||||
var/required_energy = field.len * target_field_strength / energy_conversion_rate
|
||||
var/assumed_charge = min(owned_capacitor.stored_charge, required_energy)
|
||||
stored_renwicks = assumed_charge * energy_conversion_rate
|
||||
owned_capacitor.stored_charge -= assumed_charge
|
||||
|
||||
time_since_fail++
|
||||
|
||||
average_field_strength = 0
|
||||
target_field_strength = stored_renwicks / field.len
|
||||
|
||||
for(var/obj/effect/energy_field/E in field)
|
||||
if(stored_renwicks)
|
||||
var/strength_change = target_field_strength - E.strength
|
||||
if(strength_change > stored_renwicks)
|
||||
strength_change = stored_renwicks
|
||||
if(E.strength >= 1)
|
||||
E.Strengthen(strength_change)
|
||||
else if(E.strength < 0)
|
||||
E.strength = 0
|
||||
E.Strengthen(0.1)
|
||||
|
||||
stored_renwicks -= strength_change
|
||||
|
||||
average_field_strength += E.strength
|
||||
else
|
||||
E.Strengthen(-E.strength)
|
||||
|
||||
average_field_strength /= field.len
|
||||
if(average_field_strength < 0)
|
||||
time_since_fail = 0
|
||||
else
|
||||
average_field_strength = 0
|
||||
|
||||
/obj/machinery/shield_gen/Topic(href, href_list[])
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=shield_generator")
|
||||
usr.unset_machine()
|
||||
return
|
||||
else if( href_list["toggle"] )
|
||||
toggle()
|
||||
else if( href_list["change_radius"] )
|
||||
field_radius += text2num(href_list["change_radius"])
|
||||
if(field_radius > 200)
|
||||
field_radius = 200
|
||||
else if(field_radius < 0)
|
||||
field_radius = 0
|
||||
else if( href_list["strengthen_rate"] )
|
||||
strengthen_rate += text2num(href_list["strengthen_rate"])
|
||||
if(strengthen_rate > 1)
|
||||
strengthen_rate = 1
|
||||
else if(strengthen_rate < 0)
|
||||
strengthen_rate = 0
|
||||
else if( href_list["max_field_strength"] )
|
||||
max_field_strength += text2num(href_list["max_field_strength"])
|
||||
if(max_field_strength > 1000)
|
||||
max_field_strength = 1000
|
||||
else if(max_field_strength < 0)
|
||||
max_field_strength = 0
|
||||
//
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/shield_gen/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broke"
|
||||
else
|
||||
if( powered() )
|
||||
if (src.active)
|
||||
icon_state = "generator1"
|
||||
else
|
||||
icon_state = "generator0"
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "generator0"
|
||||
stat |= NOPOWER
|
||||
if (src.active)
|
||||
toggle()
|
||||
|
||||
/obj/machinery/shield_gen/ex_act(var/severity)
|
||||
|
||||
if(active)
|
||||
toggle()
|
||||
return ..()
|
||||
|
||||
/*
|
||||
/obj/machinery/shield_gen/proc/check_powered()
|
||||
/*
|
||||
check_powered = 1
|
||||
if(!anchored)
|
||||
powered = 0
|
||||
@@ -76,122 +252,14 @@
|
||||
PN.newload += shieldload //uses powernet power.
|
||||
*/
|
||||
|
||||
/obj/machinery/shield_gen/process()
|
||||
|
||||
if(active && field.len)
|
||||
var/stored_renwicks = 0
|
||||
var/target_field_strength = min(average_field_strength + strengthen_rate, max_field_strength)
|
||||
if(owned_capacitor)
|
||||
var/assumed_charge = min(owned_capacitor.stored_charge, (target_field_strength / energy_conversion_rate) * field.len)
|
||||
stored_renwicks = assumed_charge * energy_conversion_rate
|
||||
owned_capacitor.stored_charge -= assumed_charge
|
||||
|
||||
time_since_fail++
|
||||
|
||||
average_field_strength = 0
|
||||
target_field_strength = stored_renwicks / field.len
|
||||
|
||||
if(!flicker_shield_glitch)
|
||||
for(var/obj/effect/energy_field/E in field)
|
||||
//check to see if the shield is strengthening or failing
|
||||
if(E.strength > target_field_strength)
|
||||
E.strength = target_field_strength
|
||||
else if(E.strength + strengthen_rate > target_field_strength)
|
||||
E.strength = target_field_strength
|
||||
else
|
||||
E.strength += strengthen_rate
|
||||
|
||||
if(stored_renwicks - E.strength < 0)
|
||||
E.strength = stored_renwicks
|
||||
stored_renwicks -= E.strength
|
||||
|
||||
average_field_strength += E.strength
|
||||
//check if the current shield tile has enough energy to maintain itself
|
||||
if(E.strength >= 1)
|
||||
E.density = 1
|
||||
E.invisibility = 0
|
||||
else
|
||||
E.density = 0
|
||||
E.invisibility = 2
|
||||
else
|
||||
//the flicker shield glitch is an intersting quirk in 'older' and/or faulty shielding models
|
||||
//basically, it strengthens the shields continuously until it can no longer sustain them... then it drops out for a few seconds and starts again
|
||||
//this makes the shield 'flicker' every now and then until it stabilises
|
||||
//when this glitch is fixed, shields will only be charged as much as is sustainable
|
||||
for(var/obj/effect/energy_field/E in field)
|
||||
//check to see if the shield is strengthening or failing
|
||||
if(E.strength < target_field_strength)
|
||||
E.strength += strengthen_rate
|
||||
|
||||
if(stored_renwicks - E.strength < 0)
|
||||
E.strength = stored_renwicks
|
||||
stored_renwicks -= E.strength
|
||||
|
||||
average_field_strength += E.strength
|
||||
//check if the current shield tile has enough energy to maintain itself
|
||||
if(E.strength >= 1)
|
||||
E.density = 1
|
||||
E.invisibility = 0
|
||||
else
|
||||
E.density = 0
|
||||
E.invisibility = 2
|
||||
|
||||
//add any leftover charge back to the capacitor
|
||||
if(owned_capacitor && stored_renwicks >= 0)
|
||||
owned_capacitor.stored_charge += stored_renwicks / energy_conversion_rate
|
||||
|
||||
average_field_strength /= field.len
|
||||
if(average_field_strength < 0)
|
||||
time_since_fail = 0
|
||||
else
|
||||
average_field_strength = 0
|
||||
//
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/shield_gen/attackby(obj/item/W, mob/user)
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
if (src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
src.anchored = !src.anchored
|
||||
src.visible_message("\blue \icon[src] [src] has been [anchored?"bolted to the floor":"unbolted from the floor"] by [user].")
|
||||
|
||||
else
|
||||
src.add_fingerprint(user)
|
||||
user << "\red You hit the [src.name] with your [W.name]!"
|
||||
for(var/mob/M in viewers(src))
|
||||
if(M == user) continue
|
||||
M.show_message("\red The [src.name] has been hit with the [W.name] by [user.name]!")
|
||||
|
||||
/obj/machinery/shield_gen/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broke"
|
||||
else
|
||||
if( powered() )
|
||||
if (src.active)
|
||||
icon_state = "generator1"
|
||||
else
|
||||
icon_state = "generator0"
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "generator0"
|
||||
stat |= NOPOWER
|
||||
if (src.active)
|
||||
toggle()
|
||||
|
||||
/obj/machinery/shield_gen/proc/toggle()
|
||||
active = !active
|
||||
power_change()
|
||||
if(active)
|
||||
var/list/covered_turfs = get_shielded_turfs()
|
||||
if(get_turf(src) in covered_turfs)
|
||||
covered_turfs.Remove(get_turf(src))
|
||||
var/turf/T = get_turf(src)
|
||||
if(T in covered_turfs)
|
||||
covered_turfs.Remove(T)
|
||||
for(var/turf/O in covered_turfs)
|
||||
var/obj/effect/energy_field/E = new(O)
|
||||
field.Add(E)
|
||||
@@ -207,60 +275,10 @@
|
||||
for(var/mob/M in view(5,src))
|
||||
M << "\icon[src] You hear heavy droning fade out."
|
||||
|
||||
/obj/machinery/shield_gen/Topic(href, href_list[])
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=shield_generator")
|
||||
usr.machine = null
|
||||
return
|
||||
else if( href_list["toggle"] )
|
||||
toggle()
|
||||
else if( href_list["change_radius"] )
|
||||
field_radius += text2num(href_list["change_radius"])
|
||||
if(field_radius > 200)
|
||||
field_radius = 200
|
||||
else if(field_radius < 0)
|
||||
field_radius = 0
|
||||
else if( href_list["strengthen_rate"] )
|
||||
strengthen_rate += text2num(href_list["strengthen_rate"])
|
||||
if(strengthen_rate > 0.2)
|
||||
strengthen_rate = 0.2
|
||||
else if(strengthen_rate < 0)
|
||||
strengthen_rate = 0
|
||||
else if( href_list["max_field_strength"] )
|
||||
max_field_strength += text2num(href_list["max_field_strength"])
|
||||
if(max_field_strength > 1000)
|
||||
max_field_strength = 1000
|
||||
else if(max_field_strength < 0)
|
||||
max_field_strength = 0
|
||||
//
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/shield_gen/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=shield_generator")
|
||||
return
|
||||
var/t = "<B>Shield Generator Control Console</B><BR>"
|
||||
t += "[owned_capacitor ? "<font color=green>Charge capacitor connected.</font>" : "<font color=red>Unable to locate charge capacitor!</font>"]<br>"
|
||||
t += "This generator is: [active ? "<font color=green>Online</font>" : "<font color=red>Offline</font>" ] <a href='?src=\ref[src];toggle=1'>[active ? "\[Deactivate\]" : "\[Activate\]"]</a><br>"
|
||||
t += "[time_since_fail > 2 ? "<font color=green>Field is stable.</font>" : "<font color=red>Warning, field is unstable!</font>"]<br>"
|
||||
t += "Coverage radius (generator will need a restart to take effect): <a href='?src=\ref[src];change_radius=-5'>--</a> <a href='?src=\ref[src];change_radius=-1'>-</a> [field_radius * 2]m <a href='?src=\ref[src];change_radius=1'>+</a> <a href='?src=\ref[src];change_radius=5'>++</a><br>"
|
||||
t += "Overall field strength: [average_field_strength] Renwicks ([100 * average_field_strength / max_field_strength]%)<br>"
|
||||
t += "Charge consumption: [( (min(average_field_strength + strengthen_rate, max_field_strength)) / energy_conversion_rate) * field.len] Watts/sec<br>"
|
||||
t += "Field charge rate (approx): <a href='?src=\ref[src];strengthen_rate=-0.1'>--</a> <a href='?src=\ref[src];strengthen_rate=-0.01'>-</a>[strengthen_rate] Renwicks/sec <a href='?src=\ref[src];strengthen_rate=0.01'>+</a> <a href='?src=\ref[src];strengthen_rate=0.1'>++</a><br>"
|
||||
t += "Maximum field strength (avg across field): <a href='?src=\ref[src];max_field_strength=-100'>\[min\]</a> <a href='?src=\ref[src];max_field_strength=-10'>--</a> <a href='?src=\ref[src];max_field_strength=-1'>-</a>[max_field_strength] Renwicks <a href='?src=\ref[src];max_field_strength=1'>+</a> <a href='?src=\ref[src];max_field_strength=10'>++</a> <a href='?src=\ref[src];max_field_strength=100'>\[max\]</a><br>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=shield_generator;size=500x800")
|
||||
user.machine = src
|
||||
|
||||
//grab the border tiles in a circle around this machine
|
||||
/obj/machinery/shield_gen/proc/get_shielded_turfs()
|
||||
return list()
|
||||
|
||||
/obj/machinery/shield_gen/ex_act(var/severity)
|
||||
|
||||
if(active)
|
||||
toggle()
|
||||
return ..()
|
||||
var/list/out = list()
|
||||
for(var/turf/T in range(field_radius, src))
|
||||
if(get_dist(src,T) == field_radius)
|
||||
out.Add(T)
|
||||
return out
|
||||
@@ -1,36 +1,42 @@
|
||||
|
||||
//---------- external shield generator
|
||||
//generates an energy field that loops around any built up area in space (is useless inside) halts movement and airflow, is blocked by walls, windows, airlocks etc
|
||||
|
||||
/obj/machinery/shield_gen/external/New()
|
||||
..()
|
||||
|
||||
/obj/machinery/shield_gen/external/get_shielded_turfs()
|
||||
var
|
||||
list
|
||||
open = list(get_turf(src))
|
||||
closed = list()
|
||||
|
||||
while(open.len)
|
||||
for(var/turf/T in open)
|
||||
for(var/turf/O in orange(1, T))
|
||||
if(get_dist(O,src) > field_radius)
|
||||
continue
|
||||
var/add_this_turf = 0
|
||||
if(istype(O,/turf/space))
|
||||
for(var/turf/simulated/G in orange(1, O))
|
||||
add_this_turf = 1
|
||||
break
|
||||
for(var/obj/structure/S in orange(1, O))
|
||||
add_this_turf = 1
|
||||
break
|
||||
for(var/obj/structure/S in O)
|
||||
add_this_turf = 0
|
||||
break
|
||||
|
||||
if(add_this_turf && !(O in open) && !(O in closed))
|
||||
open += O
|
||||
open -= T
|
||||
closed += T
|
||||
|
||||
return closed
|
||||
|
||||
//---------- external shield generator
|
||||
//generates an energy field that loops around any built up area in space (is useless inside) halts movement and airflow, is blocked by walls, windows, airlocks etc
|
||||
|
||||
/obj/machinery/shield_gen/external/New()
|
||||
..()
|
||||
|
||||
/obj/machinery/shield_gen/external/get_shielded_turfs()
|
||||
var
|
||||
list
|
||||
open = list(get_turf(src))
|
||||
closed = list()
|
||||
|
||||
while(open.len)
|
||||
for(var/turf/T in open)
|
||||
for(var/turf/O in orange(1, T))
|
||||
if(get_dist(O,src) > field_radius)
|
||||
continue
|
||||
var/add_this_turf = 0
|
||||
if(istype(O,/turf/space))
|
||||
for(var/turf/simulated/G in orange(1, O))
|
||||
add_this_turf = 1
|
||||
break
|
||||
|
||||
//uncomment this for structures (but not lattices) to be surrounded by shield as well
|
||||
/*if(!add_this_turf)
|
||||
for(var/obj/structure/S in orange(1, O))
|
||||
if(!istype(S, /obj/structure/lattice))
|
||||
add_this_turf = 1
|
||||
break
|
||||
if(add_this_turf)
|
||||
for(var/obj/structure/S in O)
|
||||
if(!istype(S, /obj/structure/lattice))
|
||||
add_this_turf = 0
|
||||
break*/
|
||||
|
||||
if(add_this_turf && !(O in open) && !(O in closed))
|
||||
open += O
|
||||
open -= T
|
||||
closed += T
|
||||
|
||||
return closed
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
@@ -24,13 +24,18 @@
|
||||
side_effects += M
|
||||
|
||||
/mob/living/carbon/human/proc/handle_medical_side_effects()
|
||||
if(src.reagents.has_reagent("bicaridine") && prob(40) || src.reagents.has_reagent("tricordrazine") && prob(10) || src.reagents.has_reagent("cryoxadone") && prob(20))
|
||||
if(src.reagents.has_reagent("cryoxadone") || src.reagents.get_reagent_amount("bicaridine") >= 15 || src.reagents.get_reagent_amount("tricordrazine") >= 15)
|
||||
src.add_side_effect("Headache")
|
||||
|
||||
|
||||
if(src.reagents.has_reagent("kelotane") && prob(20) || src.reagents.has_reagent("dermaline") && prob(40))
|
||||
if(src.reagents.get_reagent_amount("kelotane") >= 30 || src.reagents.get_reagent_amount("dermaline") >= 15)
|
||||
src.add_side_effect("Bad Stomach")
|
||||
|
||||
if(src.reagents.get_reagent_amount("tramadol") >= 16 || src.reagents.get_reagent_amount("anti_toxin") >= 30)
|
||||
src.add_side_effect("Cramps")
|
||||
|
||||
if(src.reagents.get_reagent_amount("space_drugs") >= 10)
|
||||
src.add_side_effect("Itch")
|
||||
|
||||
// One full cycle(in terms of strength) every 10 minutes
|
||||
var/strength_percent = sin(life_tick / 2)
|
||||
|
||||
@@ -46,29 +51,6 @@
|
||||
// Effect slowly growing stronger
|
||||
M.strength+=0.08
|
||||
|
||||
// HEADACHE
|
||||
// ========
|
||||
/datum/medical_effect/headache/name = "Headache"
|
||||
/datum/medical_effect/headache/on_life(mob/living/carbon/human/H, strength)
|
||||
switch(strength)
|
||||
if(1 to 10)
|
||||
H.custom_pain("You feel a light pain in your head.",0)
|
||||
if(11 to 30)
|
||||
H.custom_pain("You feel a throbbing pain in your head!",1)
|
||||
if(31 to 99)
|
||||
H.custom_pain("You feel an excrutiating pain in your head!",1)
|
||||
H.adjustBrainLoss(1)
|
||||
if(99 to INFINITY)
|
||||
H.custom_pain("It feels like your head is about to split open!",1)
|
||||
H.adjustBrainLoss(3)
|
||||
var/datum/organ/external/O = H.organs_by_name["head"]
|
||||
O.take_damage(0, 1, 0, "Headache")
|
||||
|
||||
/datum/medical_effect/headache/cure(mob/living/carbon/human/H)
|
||||
if(H.reagents.has_reagent("alkysine"))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
// HEADACHE
|
||||
// ========
|
||||
/datum/medical_effect/headache/name = "Headache"
|
||||
|
||||
@@ -40,12 +40,23 @@ log transactions
|
||||
machine_id = "[station_name()] RT #[num_financial_terminals++]"
|
||||
|
||||
/obj/machinery/atm/process()
|
||||
if(stat & NOPOWER)
|
||||
return
|
||||
|
||||
if(linked_db && linked_db.stat & NOPOWER)
|
||||
linked_db = null
|
||||
authenticated_account = null
|
||||
src.visible_message("\red \icon[src] [src] buzzes rudely, \"Connection to remote database lost.\"")
|
||||
updateDialog()
|
||||
|
||||
if(ticks_left_timeout > 0)
|
||||
ticks_left_timeout--
|
||||
if(ticks_left_timeout <= 0)
|
||||
authenticated_account = null
|
||||
if(ticks_left_locked_down > 0)
|
||||
ticks_left_locked_down--
|
||||
if(ticks_left_locked_down <= 0)
|
||||
number_incorrect_tries = 0
|
||||
|
||||
for(var/obj/item/weapon/spacecash/S in src)
|
||||
S.loc = src.loc
|
||||
@@ -57,7 +68,7 @@ log transactions
|
||||
|
||||
/obj/machinery/atm/proc/reconnect_database()
|
||||
for(var/obj/machinery/account_database/DB in world)
|
||||
if(DB.z == src.z)
|
||||
if(DB.z == src.z && !DB.stat & NOPOWER)
|
||||
linked_db = DB
|
||||
break
|
||||
|
||||
@@ -68,7 +79,8 @@ log transactions
|
||||
usr.drop_item()
|
||||
idcard.loc = src
|
||||
held_card = idcard
|
||||
authenticated_account = null
|
||||
if(authenticated_account && held_card.associated_account_number != authenticated_account.account_number)
|
||||
authenticated_account = null
|
||||
else if(authenticated_account)
|
||||
if(istype(I,/obj/item/weapon/spacecash))
|
||||
//consume the money
|
||||
@@ -114,11 +126,11 @@ log transactions
|
||||
switch(view_screen)
|
||||
if(CHANGE_SECURITY_LEVEL)
|
||||
dat += "Select a new security level for this account:<br><hr>"
|
||||
var/text = "Zero - Only account number or card is required to access this account. EFTPOS transactions will require a card and ask for a pin, but not verify the pin is correct."
|
||||
var/text = "Zero - Either the account number or card is required to access this account. EFTPOS transactions will require a card and ask for a pin, but not verify the pin is correct."
|
||||
if(authenticated_account.security_level != 0)
|
||||
text = "<A href='?src=\ref[src];choice=change_security_level;new_security_level=0'>[text]</a>"
|
||||
dat += "[text]<hr>"
|
||||
text = "One - Both an account number and pin is required to access this account and process transactions."
|
||||
text = "One - An account number and pin must be manually entered to access this account and process transactions."
|
||||
if(authenticated_account.security_level != 1)
|
||||
text = "<A href='?src=\ref[src];choice=change_security_level;new_security_level=1'>[text]</a>"
|
||||
dat += "[text]<hr>"
|
||||
@@ -185,7 +197,7 @@ log transactions
|
||||
dat += "<span class='warning'>Unable to connect to accounts database, please retry and if the issue persists contact NanoTrasen IT support.</span>"
|
||||
reconnect_database()
|
||||
|
||||
user << browse(dat,"window=atm;size=500x650")
|
||||
user << browse(dat,"window=atm;size=550x650")
|
||||
else
|
||||
user << browse(null,"window=atm")
|
||||
|
||||
@@ -223,7 +235,7 @@ log transactions
|
||||
var/new_sec_level = max( min(text2num(href_list["new_security_level"]), 2), 0)
|
||||
authenticated_account.security_level = new_sec_level
|
||||
if("attempt_auth")
|
||||
if(linked_db)
|
||||
if(linked_db && !ticks_left_locked_down)
|
||||
var/tried_account_num = text2num(href_list["account_num"])
|
||||
if(!tried_account_num)
|
||||
tried_account_num = held_card.associated_account_number
|
||||
@@ -231,11 +243,11 @@ log transactions
|
||||
|
||||
authenticated_account = linked_db.attempt_account_access(tried_account_num, tried_pin, held_card && held_card.associated_account_number == tried_account_num ? 2 : 1)
|
||||
if(!authenticated_account)
|
||||
number_incorrect_tries++
|
||||
if(previous_account_number == tried_account_num)
|
||||
if(++number_incorrect_tries > max_pin_attempts)
|
||||
if(number_incorrect_tries > max_pin_attempts)
|
||||
//lock down the atm
|
||||
number_incorrect_tries = 0
|
||||
ticks_left_locked_down = 10
|
||||
ticks_left_locked_down = 30
|
||||
playsound(src, 'buzz-two.ogg', 50, 1)
|
||||
|
||||
//create an entry in the account transaction log
|
||||
@@ -247,9 +259,12 @@ log transactions
|
||||
T.time = worldtime2text()
|
||||
authenticated_account.transaction_log.Add(T)
|
||||
else
|
||||
usr << "\red \icon[src] incorrect pin/account combination entered, [max_pin_attempts - number_incorrect_tries] attempts remaining."
|
||||
previous_account_number = tried_account_num
|
||||
number_incorrect_tries = 1
|
||||
playsound(src, 'buzz-sigh.ogg', 50, 1)
|
||||
else
|
||||
usr << "\red \icon[src] incorrect pin/account combination entered."
|
||||
number_incorrect_tries = 0
|
||||
else
|
||||
playsound(src, 'twobeep.ogg', 50, 1)
|
||||
ticks_left_timeout = 120
|
||||
@@ -263,6 +278,8 @@ log transactions
|
||||
T.date = current_date_string
|
||||
T.time = worldtime2text()
|
||||
authenticated_account.transaction_log.Add(T)
|
||||
|
||||
previous_account_number = tried_account_num
|
||||
if("withdrawal")
|
||||
var/amount = max(text2num(href_list["funds_amount"]),0)
|
||||
if(authenticated_account && amount > 0)
|
||||
|
||||
@@ -66,6 +66,7 @@ var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Al
|
||||
for(var/T in paths)
|
||||
var/datum/surgery_step/S = new T
|
||||
surgery_steps += S
|
||||
sort_surgeries()
|
||||
/* // Uncomment to debug chemical reaction list.
|
||||
/client/verb/debug_chemical_list()
|
||||
|
||||
|
||||
@@ -63,8 +63,8 @@
|
||||
|
||||
var/server
|
||||
var/banappeals
|
||||
var/wikiurl
|
||||
var/forumurl
|
||||
var/wikiurl = "http://baystation12.net/wiki/index.php?title=Main_Page"
|
||||
var/forumurl = "http://baystation12.net/forums/"
|
||||
|
||||
//Alert level description
|
||||
var/alert_desc_green = "All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced."
|
||||
|
||||
@@ -61,6 +61,8 @@ datum/mind
|
||||
New(var/key)
|
||||
src.key = key
|
||||
|
||||
//put this here for easier tracking ingame
|
||||
var/datum/money_account/initial_account
|
||||
|
||||
proc/transfer_to(mob/living/new_character)
|
||||
if(!istype(new_character))
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
var/status = 0
|
||||
var/open = 0
|
||||
var/stage = 0
|
||||
var/cavity = 0
|
||||
|
||||
var/obj/item/hidden = null
|
||||
var/list/implants = list()
|
||||
@@ -239,25 +240,65 @@
|
||||
// process wounds, doing healing etc., only do this every 4 ticks to save processing power
|
||||
if(owner.life_tick % wound_update_accuracy == 0)
|
||||
update_wounds()
|
||||
|
||||
//Dismemberment
|
||||
if(status & ORGAN_DESTROYED)
|
||||
if(!destspawn && config.limbs_can_break)
|
||||
droplimb()
|
||||
return
|
||||
if(!(status & ORGAN_BROKEN))
|
||||
perma_injury = 0
|
||||
if(parent)
|
||||
if(parent.status & ORGAN_DESTROYED)
|
||||
status |= ORGAN_DESTROYED
|
||||
owner.update_body(1)
|
||||
return
|
||||
|
||||
//Bone fracurtes
|
||||
if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT))
|
||||
src.fracture()
|
||||
if(germ_level > 0)
|
||||
for(var/datum/wound/W in wounds) if(!W.bandaged && !W.salved)
|
||||
W.germ_level = max(W.germ_level, germ_level)
|
||||
if(!(status & ORGAN_BROKEN))
|
||||
perma_injury = 0
|
||||
|
||||
update_germs()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
//Updating germ levels. Handles organ germ levels and necrosis.
|
||||
#define GANGREN_LEVEL_ONE 100
|
||||
#define GANGREN_LEVEL_TWO 1000
|
||||
#define GANGREN_LEVEL_TERMINAL 2500
|
||||
#define GERM_TRANSFER_AMOUNT germ_level/500
|
||||
/datum/organ/external/proc/update_germs()
|
||||
if(germ_level > 0 && owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs
|
||||
//Syncing germ levels with external wounds
|
||||
for(var/datum/wound/W in wounds)
|
||||
if(!W.bandaged && !W.salved)
|
||||
W.germ_level = max(W.germ_level, germ_level) //Wounds get all the germs
|
||||
if (W.germ_level > germ_level) //Badly infected wounds raise internal germ levels
|
||||
germ_level++
|
||||
|
||||
if(germ_level > GANGREN_LEVEL_ONE && prob(round(germ_level/100)))
|
||||
germ_level++
|
||||
owner.adjustToxLoss(1)
|
||||
|
||||
if(germ_level > GANGREN_LEVEL_TWO)
|
||||
germ_level++
|
||||
owner.adjustToxLoss(1)
|
||||
/*
|
||||
if(germ_level > GANGREN_LEVEL_TERMINAL)
|
||||
if (!(status & ORGAN_DEAD))
|
||||
status |= ORGAN_DEAD
|
||||
owner << "<span class='notice'>You can't feel your [display_name] anymore...</span>"
|
||||
owner.update_body(1)
|
||||
if (prob(10)) //Spreading the fun
|
||||
if (children) //To child organs
|
||||
for (var/datum/organ/external/child in children)
|
||||
if (!(child.status & (ORGAN_DEAD|ORGAN_DESTROYED|ORGAN_ROBOT)))
|
||||
child.germ_level += round(GERM_TRANSFER_AMOUNT)
|
||||
if (parent)
|
||||
if (!(parent.status & (ORGAN_DEAD|ORGAN_DESTROYED|ORGAN_ROBOT)))
|
||||
parent.germ_level += round(GERM_TRANSFER_AMOUNT)
|
||||
*/
|
||||
|
||||
//Updating wounds. Handles wound natural healing, internal bleedings and infections
|
||||
/datum/organ/external/proc/update_wounds()
|
||||
for(var/datum/wound/W in wounds)
|
||||
@@ -281,14 +322,12 @@
|
||||
// amount of healing is spread over all the wounds
|
||||
W.heal_damage((wound_update_accuracy * amount * W.amount * config.organ_regeneration_multiplier) / (20*owner.number_wounds+1))
|
||||
|
||||
if(W.germ_level > 100 && prob(10))
|
||||
owner.adjustToxLoss(1 * wound_update_accuracy)
|
||||
if(W.germ_level > 1000)
|
||||
owner.adjustToxLoss(1 * wound_update_accuracy)
|
||||
|
||||
// Salving also helps against infection
|
||||
if(W.germ_level > 0 && W.salved && prob(2))
|
||||
W.germ_level = 0
|
||||
W.disinfected = 1
|
||||
|
||||
|
||||
|
||||
// sync the organ's damage with its wounds
|
||||
src.update_damages()
|
||||
|
||||
@@ -96,6 +96,23 @@
|
||||
else if(damage_type == BURN)
|
||||
return salved
|
||||
|
||||
// checks if wound is considered open for external infections
|
||||
// untreated cuts (and bleeding bruises) and burns are possibly infectable, chance higher if wound is bigger
|
||||
proc/can_infect()
|
||||
if (is_treated() && damage < 10)
|
||||
return 0
|
||||
if (disinfected)
|
||||
return 0
|
||||
var/dam_coef = round(damage/10)
|
||||
switch (damage_type)
|
||||
if (BRUISE)
|
||||
return prob(dam_coef*5) && bleeding() //bruises only infectable if bleeding
|
||||
if (BURN)
|
||||
return prob(dam_coef*10)
|
||||
if (CUT)
|
||||
return prob(dam_coef*20)
|
||||
|
||||
return 0
|
||||
// heal the given amount of damage, and if the given amount of damage was more
|
||||
// than what needed to be healed, return how much heal was left
|
||||
// set @heals_internal to also heal internal organ damage
|
||||
|
||||
@@ -849,3 +849,56 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
containertype = /obj/structure/closet
|
||||
containername = "Formalwear for the best occasions."
|
||||
group = "Operations"
|
||||
|
||||
/datum/supply_packs/rust_injector
|
||||
contains = list(/obj/machinery/power/rust_fuel_injector)
|
||||
name = "RUST fuel injector"
|
||||
cost = 50
|
||||
containertype = /obj/structure/largecrate
|
||||
containername = "RUST injector crate"
|
||||
group = "Engineering"
|
||||
access = access_engine
|
||||
|
||||
/datum/supply_packs/rust_compressor
|
||||
contains = list(/obj/item/weapon/module/rust_fuel_compressor)
|
||||
name = "RUST fuel compressor circuitry"
|
||||
cost = 60
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "RUST fuel compressor circuitry"
|
||||
group = "Engineering"
|
||||
access = access_engine
|
||||
|
||||
/datum/supply_packs/rust_core
|
||||
contains = list(/obj/machinery/power/rust_core)
|
||||
name = "RUST Tokamak Core"
|
||||
cost = 75
|
||||
containertype = /obj/structure/largecrate
|
||||
containername = "RUST tokamak crate"
|
||||
group = "Engineering"
|
||||
access = access_engine
|
||||
|
||||
/datum/supply_packs/shield_gen
|
||||
contains = list(/obj/item/weapon/circuitboard/shield_gen)
|
||||
name = "Experimental shield generator circuitry"
|
||||
cost = 50
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "Experimental shield generator"
|
||||
group = "Engineering"
|
||||
access = access_ce
|
||||
|
||||
/datum/supply_packs/shield_cap
|
||||
contains = list(/obj/item/weapon/circuitboard/shield_cap)
|
||||
name = "Experimental shield capacitor circuitry"
|
||||
cost = 50
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "Experimental shield capacitor"
|
||||
group = "Engineering"
|
||||
access = access_ce
|
||||
|
||||
/datum/supply_packs/eftpos
|
||||
contains = list(/obj/item/device/eftpos)
|
||||
name = "EFTPOS scanner"
|
||||
cost = 10
|
||||
containertype = /obj/structure/closet/crate
|
||||
containername = "EFTPOS crate"
|
||||
group = "Operations"
|
||||
|
||||
@@ -269,17 +269,17 @@
|
||||
if(prob(35))
|
||||
|
||||
if(istype(src, /area/chapel))
|
||||
sound = pick('sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg')
|
||||
sound = pick('sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg','sound/music/traitor.ogg')
|
||||
else if(istype(src, /area/medical/morgue))
|
||||
sound = pick('sound/ambience/ambimo1.ogg','sound/ambience/ambimo2.ogg','sound/ambience/title2.ogg')
|
||||
sound = pick('sound/ambience/ambimo1.ogg','sound/ambience/ambimo2.ogg','sound/music/main.ogg')
|
||||
else if(type == /area)
|
||||
sound = pick('sound/ambience/ambispace.ogg','sound/ambience/title2.ogg',)
|
||||
sound = pick('sound/ambience/ambispace.ogg','sound/music/title2.ogg','sound/music/space.ogg','sound/music/main.ogg','sound/music/traitor.ogg')
|
||||
else if(istype(src, /area/engine))
|
||||
sound = pick('sound/ambience/ambisin1.ogg','sound/ambience/ambisin2.ogg','sound/ambience/ambisin3.ogg','sound/ambience/ambisin4.ogg')
|
||||
else if(istype(src, /area/AIsattele) || istype(src, /area/turret_protected/ai) || istype(src, /area/turret_protected/ai_upload) || istype(src, /area/turret_protected/ai_upload_foyer))
|
||||
sound = pick('sound/ambience/ambimalf.ogg')
|
||||
else if(istype(src, /area/mine/explored) || istype(src, /area/mine/unexplored))
|
||||
sound = pick('sound/ambience/ambimine.ogg')
|
||||
sound = pick('sound/ambience/ambimine.ogg', 'sound/ambience/song_game.ogg')
|
||||
musVolume = 25
|
||||
else if(istype(src, /area/tcommsat) || istype(src, /area/turret_protected/tcomwest) || istype(src, /area/turret_protected/tcomeast) || istype(src, /area/turret_protected/tcomfoyer) || istype(src, /area/turret_protected/tcomsat))
|
||||
sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg')
|
||||
|
||||
@@ -37,9 +37,9 @@ var/global/datum/controller/gameticker/ticker
|
||||
var/triai = 0//Global holder for Triumvirate
|
||||
|
||||
/datum/controller/gameticker/proc/pregame()
|
||||
login_music = pick('sound/ambience/title2.ogg','sound/ambience/title1.ogg','sound/ambience/b12_combined_start.ogg') // choose title music!
|
||||
for(var/mob/new_player/M in mob_list)
|
||||
if(M.client) M.client.playtitlemusic()
|
||||
login_music = pick(\
|
||||
'sound/music/title1.ogg',\
|
||||
'sound/music/b12_combined_start.ogg')
|
||||
do
|
||||
pregame_timeleft = 180
|
||||
world << "<B><FONT color='blue'>Welcome to the pre-game lobby!</FONT></B>"
|
||||
@@ -105,12 +105,22 @@ var/global/datum/controller/gameticker/ticker
|
||||
else
|
||||
src.mode.announce()
|
||||
|
||||
//setup the money accounts
|
||||
if(!centcomm_account_db)
|
||||
for(var/obj/machinery/account_database/check_db in world)
|
||||
if(check_db.z == 2)
|
||||
centcomm_account_db = check_db
|
||||
break
|
||||
|
||||
create_characters() //Create player characters and transfer them
|
||||
collect_minds()
|
||||
equip_characters()
|
||||
data_core.manifest()
|
||||
current_state = GAME_STATE_PLAYING
|
||||
|
||||
//here to initialize the random events nicely at round start
|
||||
setup_economy()
|
||||
|
||||
spawn(0)//Forking here so we dont have to wait for this to finish
|
||||
mode.post_setup()
|
||||
//Cleanup some stuff
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
/var/const/access_tcomsat = 61 // has access to the entire telecomms satellite / machinery
|
||||
/var/const/access_gateway = 62
|
||||
/var/const/access_sec_doors = 63 // Security front doors
|
||||
/var/const/access_psychiatrist = 64 // Psychiatrist's office
|
||||
|
||||
//BEGIN CENTCOM ACCESS
|
||||
/*Should leave plenty of room if we need to add more access levels.
|
||||
@@ -205,7 +206,7 @@
|
||||
access_teleporter, access_eva, access_heads, access_captain, access_all_personal_lockers,
|
||||
access_tech_storage, access_chapel_office, access_atmospherics, access_kitchen,
|
||||
access_bar, access_janitor, access_crematorium, access_robotics, access_cargo, access_construction,
|
||||
access_hydroponics, access_library, access_lawyer, access_virology, access_cmo, access_qm, access_clown, access_mime, access_surgery,
|
||||
access_hydroponics, access_library, access_lawyer, access_virology, access_psychiatrist, access_cmo, access_qm, access_clown, access_mime, access_surgery,
|
||||
access_theatre, access_research, access_mining, access_mailsorting,
|
||||
access_heads_vault, access_mining_station, access_xenobiology, access_ce, access_hop, access_hos, access_RC_announce,
|
||||
access_keycard_auth, access_tcomsat, access_gateway)
|
||||
@@ -223,7 +224,7 @@
|
||||
if(1) //security
|
||||
return list(access_sec_doors, access_security, access_brig, access_armory, access_forensics_lockers, access_court, access_hos)
|
||||
if(2) //medbay
|
||||
return list(access_medical, access_genetics, access_morgue, access_chemistry, access_virology, access_surgery, access_cmo)
|
||||
return list(access_medical, access_genetics, access_morgue, access_chemistry, access_psychiatrist, access_virology, access_surgery, access_cmo)
|
||||
if(3) //research
|
||||
return list(access_research, access_tox, access_tox_storage, access_robotics, access_xenobiology, access_rd)
|
||||
if(4) //engineering and maintenance
|
||||
@@ -335,6 +336,8 @@
|
||||
return "Robotics"
|
||||
if(access_virology)
|
||||
return "Virology"
|
||||
if(access_psychiatrist)
|
||||
return "Psychiatrist's Office"
|
||||
if(access_cmo)
|
||||
return "Chief Medical Officer"
|
||||
if(access_qm)
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
req_admin_notify = 1
|
||||
access = list(access_medical, access_morgue, access_genetics, access_heads,
|
||||
access_chemistry, access_virology, access_cmo, access_surgery, access_RC_announce,
|
||||
access_keycard_auth, access_sec_doors)
|
||||
access_keycard_auth, access_sec_doors, access_psychiatrist)
|
||||
minimal_access = list(access_medical, access_morgue, access_genetics, access_heads,
|
||||
access_chemistry, access_virology, access_cmo, access_surgery, access_RC_announce,
|
||||
access_keycard_auth, access_sec_doors)
|
||||
access_keycard_auth, access_sec_doors, access_psychiatrist)
|
||||
minimal_player_age = 7
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
@@ -184,3 +184,35 @@
|
||||
else
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
return 1*/
|
||||
|
||||
/datum/job/psychiatrist
|
||||
title = "Psychiatrist"
|
||||
flag = PSYCHIATRIST
|
||||
department_flag = MEDSCI
|
||||
faction = "Station"
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
supervisors = "the chief medical officer"
|
||||
selection_color = "#ffeef0"
|
||||
access = list(access_medical, access_morgue, access_surgery, access_chemistry, access_virology, access_genetics, access_psychiatrist)
|
||||
minimal_access = list(access_medical, access_psychiatrist)
|
||||
alt_titles = list("Psychologist")
|
||||
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_med(H), slot_ears)
|
||||
switch(H.backbag)
|
||||
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/medic(H), slot_back)
|
||||
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back)
|
||||
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/medical(H), slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat(H), slot_wear_suit)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store)
|
||||
if(H.backbag == 1)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
|
||||
else
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
return 1
|
||||
@@ -324,6 +324,25 @@ var/global/datum/controller/occupations/job_master
|
||||
if(istype(S, /obj/effect/landmark/start) && istype(S.loc, /turf))
|
||||
H.loc = S.loc
|
||||
|
||||
//give them an account in the station database
|
||||
if(centcomm_account_db)
|
||||
var/datum/money_account/M = centcomm_account_db.add_account_across_all(H.real_name, starting_funds = rand(50,500)*10, pre_existing = 1)
|
||||
if(H.mind)
|
||||
var/remembered_info = ""
|
||||
remembered_info += "<b>Your account number is:</b> #[M.account_number]<br>"
|
||||
remembered_info += "<b>Your account pin is:</b> [M.remote_access_pin]<br>"
|
||||
remembered_info += "<b>Your account funds are:</b> $[M.money]<br>"
|
||||
|
||||
if(M.transaction_log.len)
|
||||
var/datum/transaction/T = M.transaction_log[1]
|
||||
remembered_info += "<b>Your account was created:</b> [T.time], [T.date] at [T.source_terminal]<br>"
|
||||
H.mind.store_memory(remembered_info)
|
||||
|
||||
H.mind.initial_account = M
|
||||
|
||||
spawn(0)
|
||||
H << "\blue<b>Your account number is: [M.account_number], your account pin is: [M.remote_access_pin]</b>"
|
||||
|
||||
var/alt_title = null
|
||||
if(H.mind)
|
||||
H.mind.assigned_role = rank
|
||||
@@ -385,13 +404,20 @@ var/global/datum/controller/occupations/job_master
|
||||
C.rank = rank
|
||||
C.assignment = title ? title : rank
|
||||
C.name = "[C.registered_name]'s ID Card ([C.assignment])"
|
||||
|
||||
//put the player's account number onto the ID
|
||||
if(H.mind && H.mind.initial_account)
|
||||
C.associated_account_number = H.mind.initial_account.account_number
|
||||
|
||||
H.equip_to_slot_or_del(C, slot_wear_id)
|
||||
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda(H), slot_belt)
|
||||
if(locate(/obj/item/device/pda,H))
|
||||
var/obj/item/device/pda/pda = locate(/obj/item/device/pda,H)
|
||||
pda.owner = H.real_name
|
||||
pda.ownjob = C.assignment
|
||||
pda.name = "PDA-[H.real_name] ([pda.ownjob])"
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ var/const/CMO =(1<<3)
|
||||
var/const/DOCTOR =(1<<4)
|
||||
var/const/GENETICIST =(1<<5)
|
||||
var/const/VIROLOGIST =(1<<6)
|
||||
var/const/PSYCHIATRIST =(1<<7)
|
||||
|
||||
|
||||
var/const/CIVILIAN =(1<<2)
|
||||
@@ -75,7 +76,7 @@ var/list/medical_positions = list(
|
||||
"Chief Medical Officer",
|
||||
"Medical Doctor",
|
||||
"Geneticist",
|
||||
"Virologist",
|
||||
"Psychiatrist",
|
||||
"Chemist"
|
||||
)
|
||||
|
||||
|
||||
@@ -124,6 +124,14 @@
|
||||
var nameField = document.getElementById('namefield');
|
||||
nameField.style.backgroundColor = "#DDFFDD";
|
||||
}
|
||||
function markAccountGreen(){
|
||||
var nameField = document.getElementById('accountfield');
|
||||
nameField.style.backgroundColor = "#DDFFDD";
|
||||
}
|
||||
function markAccountRed(){
|
||||
var nameField = document.getElementById('accountfield');
|
||||
nameField.style.backgroundColor = "#FFDDDD";
|
||||
}
|
||||
function showAll(){
|
||||
var allJobsSlot = document.getElementById('alljobsslot');
|
||||
allJobsSlot.innerHTML = "<a href='#' onclick='hideAll()'>hide</a><br>"+ "[jobs_all]";
|
||||
@@ -139,10 +147,16 @@
|
||||
carddesc += "<b>registered_name:</b> <input type='text' id='namefield' name='reg' value='[target_owner]' style='width:250px; background-color:white;' onchange='markRed()'>"
|
||||
carddesc += "<input type='submit' value='Rename' onclick='markGreen()'>"
|
||||
carddesc += "</form>"
|
||||
|
||||
carddesc += "<form name='accountnum' action='?src=\ref[src]' method='get'>"
|
||||
carddesc += "<input type='hidden' name='src' value='\ref[src]'>"
|
||||
carddesc += "<input type='hidden' name='choice' value='account'>"
|
||||
carddesc += "<b>Stored account number:</b> <input type='text' id='accountfield' name='account' value='[modify.associated_account_number]' style='width:250px; background-color:white;' onchange='markAccountRed()'>"
|
||||
carddesc += "<input type='submit' value='Rename' onclick='markAccountGreen()'>"
|
||||
carddesc += "</form>"
|
||||
|
||||
carddesc += "<b>Assignment:</b> "
|
||||
|
||||
var/jobs = "<span id='alljobsslot'><a href='#' onclick='showAll()'>[target_rank]</a></span>" //CHECK THIS
|
||||
|
||||
var/accesses = ""
|
||||
if(istype(src,/obj/machinery/computer/card/centcom))
|
||||
accesses += "<h5>Central Command:</h5>"
|
||||
@@ -270,6 +284,13 @@
|
||||
modify.registered_name = temp_name
|
||||
else
|
||||
src.visible_message("<span class='notice'>[src] buzzes rudely.</span>")
|
||||
if ("account")
|
||||
if (authenticated)
|
||||
var/t2 = modify
|
||||
//var/t1 = input(usr, "What name?", "ID computer", null) as text
|
||||
if ((authenticated && modify == t2 && (in_range(src, usr) || (istype(usr, /mob/living/silicon))) && istype(loc, /turf)))
|
||||
var/account_num = text2num(href_list["account"])
|
||||
modify.associated_account_number = account_num
|
||||
if ("mode")
|
||||
mode = text2num(href_list["mode_target"])
|
||||
if ("print")
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
var/temperature_archived
|
||||
var/mob/living/carbon/occupant = null
|
||||
var/beaker = null
|
||||
var/next_trans = 0
|
||||
|
||||
var/current_heat_capacity = 50
|
||||
|
||||
@@ -164,12 +163,12 @@
|
||||
var/heal_brute = occupant.getBruteLoss() ? min(1, 20/occupant.getBruteLoss()) : 0
|
||||
var/heal_fire = occupant.getFireLoss() ? min(1, 20/occupant.getFireLoss()) : 0
|
||||
occupant.heal_organ_damage(heal_brute,heal_fire)
|
||||
if(beaker && (next_trans == 0))
|
||||
var/has_cryo = occupant.reagents.get_reagent_amount("cryoxadone") >= 1
|
||||
var/has_clonexa = occupant.reagents.get_reagent_amount("clonexadone") >= 1
|
||||
var/has_cryo_medicine = has_cryo || has_clonexa
|
||||
if(beaker && !has_cryo_medicine)
|
||||
beaker:reagents.trans_to(occupant, 1, 10)
|
||||
beaker:reagents.reaction(occupant)
|
||||
next_trans++
|
||||
if(next_trans == 10)
|
||||
next_trans = 0
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/proc/heat_gas_contents()
|
||||
if(air_contents.total_moles() < 1)
|
||||
|
||||
@@ -190,6 +190,12 @@
|
||||
targeting_active = 1
|
||||
target()
|
||||
targeting_active = 0
|
||||
|
||||
if(prob(15))
|
||||
if(prob(50))
|
||||
playsound(src.loc, 'sound/effects/turret/move1.wav', 60, 1)
|
||||
else
|
||||
playsound(src.loc, 'sound/effects/turret/move2.wav', 60, 1)
|
||||
else if(!isPopping())//else, pop down
|
||||
if(!isDown())
|
||||
popDown()
|
||||
@@ -244,6 +250,7 @@
|
||||
if ((!isPopping()) || src.popping==-1)
|
||||
invisibility = 0
|
||||
popping = 1
|
||||
playsound(src.loc, 'sound/effects/turret/open.wav', 60, 1)
|
||||
if (src.cover!=null)
|
||||
flick("popup", src.cover)
|
||||
src.cover.icon_state = "openTurretCover"
|
||||
@@ -253,6 +260,7 @@
|
||||
/obj/machinery/turret/proc/popDown()
|
||||
if ((!isPopping()) || src.popping==1)
|
||||
popping = -1
|
||||
playsound(src.loc, 'sound/effects/turret/open.wav', 60, 1)
|
||||
if (src.cover!=null)
|
||||
flick("popdown", src.cover)
|
||||
src.cover.icon_state = "turretCover"
|
||||
|
||||
@@ -126,6 +126,6 @@ var/list/uristrune_cache = list()
|
||||
result.Insert(I3, "", frame = 7, delay = 2)
|
||||
result.Insert(I2, "", frame = 8, delay = 2)
|
||||
|
||||
uristrune_cache[lookup] = result
|
||||
uristrune_cache[lookup] = result
|
||||
|
||||
return result
|
||||
|
||||
@@ -73,6 +73,8 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \
|
||||
var/global/list/datum/stack_recipe/plasteel_recipes = list ( \
|
||||
new/datum/stack_recipe("AI core", /obj/structure/AIcore, 4, time = 50, one_per_turf = 1), \
|
||||
new/datum/stack_recipe("Metal crate", /obj/structure/closet/crate, 10, time = 50, one_per_turf = 1), \
|
||||
new/datum/stack_recipe("RUST fuel assembly port frame", /obj/item/rust_fuel_assembly_port_frame, 12, time = 50, one_per_turf = 1), \
|
||||
new/datum/stack_recipe("RUST fuel compressor frame", /obj/item/rust_fuel_compressor_frame, 12, time = 50, one_per_turf = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/plasteel
|
||||
|
||||
@@ -180,33 +180,39 @@ Implant Specifics:<BR>"}
|
||||
switch (severity)
|
||||
if (2.0) //Weak EMP will make implant tear limbs off.
|
||||
if (prob(50))
|
||||
if (ishuman(imp_in) && part)
|
||||
imp_in.visible_message("\red Something beeps inside [imp_in][part ? "'s [part.display_name]" : ""]!")
|
||||
playsound(loc, 'sound/items/countdown.ogg', 75, 1, -3)
|
||||
spawn(25)
|
||||
if (ishuman(imp_in) && part)
|
||||
//No tearing off these parts since it's pretty much killing
|
||||
//and you can't replace groins
|
||||
if (istype(part,/datum/organ/external/chest) || \
|
||||
istype(part,/datum/organ/external/groin) || \
|
||||
istype(part,/datum/organ/external/head))
|
||||
part.createwound(BRUISE, 60) //mangle them instead
|
||||
else
|
||||
part.droplimb(1)
|
||||
explosion(get_turf(imp_in), -1, -1, 2, 3, 3)
|
||||
del(src)
|
||||
|
||||
small_boom()
|
||||
if (1.0) //strong EMP will melt implant either making it go off, or disarming it
|
||||
if (prob(50))
|
||||
activate() //50% chance of bye bye
|
||||
else
|
||||
meltdown() //50% chance of implant disarming
|
||||
if (prob(70))
|
||||
if (prob(50))
|
||||
small_boom()
|
||||
else
|
||||
if (prob(50))
|
||||
activate() //50% chance of bye bye
|
||||
else
|
||||
meltdown() //50% chance of implant disarming
|
||||
spawn (20)
|
||||
malfunction--
|
||||
|
||||
islegal()
|
||||
return 0
|
||||
|
||||
proc/small_boom()
|
||||
if (ishuman(imp_in) && part)
|
||||
imp_in.visible_message("\red Something beeps inside [imp_in][part ? "'s [part.display_name]" : ""]!")
|
||||
playsound(loc, 'sound/items/countdown.ogg', 75, 1, -3)
|
||||
spawn(25)
|
||||
if (ishuman(imp_in) && part)
|
||||
//No tearing off these parts since it's pretty much killing
|
||||
//and you can't replace groins
|
||||
if (istype(part,/datum/organ/external/chest) || \
|
||||
istype(part,/datum/organ/external/groin) || \
|
||||
istype(part,/datum/organ/external/head))
|
||||
part.createwound(BRUISE, 60) //mangle them instead
|
||||
else
|
||||
part.droplimb(1)
|
||||
explosion(get_turf(imp_in), -1, -1, 2, 3, 3)
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/implant/chem
|
||||
name = "chem"
|
||||
desc = "Injects things."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/obj/item/weapon/storage/wallet
|
||||
name = "wallet"
|
||||
desc = "It can hold a few small and personal things."
|
||||
storage_slots = 4
|
||||
storage_slots = 10
|
||||
icon_state = "wallet"
|
||||
w_class = 2
|
||||
can_hold = list(
|
||||
|
||||
@@ -265,6 +265,16 @@
|
||||
AH.try_build(src)
|
||||
return
|
||||
|
||||
else if(istype(W,/obj/item/rust_fuel_compressor_frame))
|
||||
var/obj/item/rust_fuel_compressor_frame/AH = W
|
||||
AH.try_build(src)
|
||||
return
|
||||
|
||||
else if(istype(W,/obj/item/rust_fuel_assembly_port_frame))
|
||||
var/obj/item/rust_fuel_assembly_port_frame/AH = W
|
||||
AH.try_build(src)
|
||||
return
|
||||
|
||||
//Poster stuff
|
||||
else if(istype(W,/obj/item/weapon/contraband/poster))
|
||||
place_poster(W,user)
|
||||
|
||||
@@ -41,22 +41,26 @@ var/global/normal_ooc_colour = "#002eb8"
|
||||
|
||||
log_ooc("[mob.name]/[key] : [msg]")
|
||||
|
||||
var/display_colour = normal_ooc_colour
|
||||
if(holder && !holder.fakekey)
|
||||
display_colour = "#0099cc" //light blue
|
||||
if(holder.rights & R_MOD && !(holder.rights & R_ADMIN))
|
||||
display_colour = "#184880" //dark blue
|
||||
else if(holder.rights & R_ADMIN)
|
||||
if(config.allow_admin_ooccolor)
|
||||
display_colour = src.prefs.ooccolor
|
||||
else
|
||||
display_colour = "#b82e00" //orange
|
||||
|
||||
for(var/client/C in clients)
|
||||
if(C.prefs.toggles & CHAT_OOC)
|
||||
var/display_name = src.key
|
||||
var/display_colour = normal_ooc_colour
|
||||
|
||||
if(holder)
|
||||
if(holder.fakekey)
|
||||
if(C.holder)
|
||||
display_name = "[holder.fakekey]/([src.key])"
|
||||
else
|
||||
display_name = holder.fakekey
|
||||
else if(config.allow_admin_ooccolor)
|
||||
display_colour = src.prefs.ooccolor
|
||||
else
|
||||
display_colour = "#b82e00"
|
||||
|
||||
C << "<font color='[display_colour]'><span class='ooc'><span class='prefix'>OOC:</span> <EM>[display_name]:</EM> <span class='message'>[msg]</span></span></font>"
|
||||
|
||||
/*
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
if(!msg) return
|
||||
|
||||
var/recieve_color = "purple"
|
||||
var/send_pm_type = ""
|
||||
var/send_pm_type = " "
|
||||
var/recieve_pm_type = "Player"
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
recieve_color = "maroon"
|
||||
else
|
||||
recieve_color = "red"
|
||||
send_pm_type = holder.rank
|
||||
send_pm_type = holder.rank + " "
|
||||
recieve_pm_type = holder.rank
|
||||
|
||||
else if(!C.holder)
|
||||
@@ -111,7 +111,7 @@
|
||||
|
||||
recieve_message = "<font color='[recieve_color]'>[recieve_pm_type] PM from-<b>[key_name(src, C, C.holder ? 1 : 0)]</b>: [msg]</font>"
|
||||
C << recieve_message
|
||||
src << "<font color='blue'>[send_pm_type] PM to-<b>[key_name(C, src, holder ? 1 : 0)]</b>: [msg]</font>"
|
||||
src << "<font color='blue'>[send_pm_type]PM to-<b>[key_name(C, src, holder ? 1 : 0)]</b>: [msg]</font>"
|
||||
|
||||
/*if(holder && !C.holder)
|
||||
C.last_pm_recieved = world.time
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
oneShot = 1
|
||||
|
||||
var/list/obj/machinery/vending/vendingMachines = list()
|
||||
var/list/obj/machinery/vending/infectedVendingMachines = list()
|
||||
var/obj/machinery/vending/originMachine
|
||||
|
||||
|
||||
@@ -28,20 +29,29 @@
|
||||
|
||||
/datum/event/brand_intelligence/tick()
|
||||
if(!vendingMachines.len || !originMachine || originMachine.shut_up) //if every machine is infected, or if the original vending machine is missing or has it's voice switch flipped
|
||||
end()
|
||||
kill()
|
||||
return
|
||||
|
||||
if(IsMultiple(activeFor, 3))
|
||||
var/obj/machinery/vending/infectedMachine = pick(vendingMachines)
|
||||
vendingMachines.Remove(infectedMachine)
|
||||
infectedMachine.shut_up = 0
|
||||
infectedMachine.shoot_inventory = 1
|
||||
if(IsMultiple(activeFor, 5))
|
||||
if(prob(25))
|
||||
var/obj/machinery/vending/infectedMachine = pick(vendingMachines)
|
||||
vendingMachines.Remove(infectedMachine)
|
||||
infectedVendingMachines.Add(infectedMachine)
|
||||
infectedMachine.shut_up = 0
|
||||
infectedMachine.shoot_inventory = 1
|
||||
|
||||
if(IsMultiple(activeFor, 12))
|
||||
originMachine.speak(pick("Try our aggressive new marketing strategies!", \
|
||||
"You should buy products to feed your lifestyle obession!", \
|
||||
"Consume!", \
|
||||
"Your money can buy happiness!", \
|
||||
"Engage direct marketing!", \
|
||||
"Advertising is legalized lying! But don't let that put you off our great deals!", \
|
||||
"You don't want to buy anything? Yeah, well I didn't want to buy your mom either."))
|
||||
if(IsMultiple(activeFor, 12))
|
||||
originMachine.speak(pick("Try our aggressive new marketing strategies!", \
|
||||
"You should buy products to feed your lifestyle obession!", \
|
||||
"Consume!", \
|
||||
"Your money can buy happiness!", \
|
||||
"Engage direct marketing!", \
|
||||
"Advertising is legalized lying! But don't let that put you off our great deals!", \
|
||||
"You don't want to buy anything? Yeah, well I didn't want to buy your mom either."))
|
||||
|
||||
/datum/event/brand_intelligence/end()
|
||||
for(var/obj/machinery/vending/infectedMachine in infectedVendingMachines)
|
||||
if(prob(90))
|
||||
infectedMachine.shut_up = 1
|
||||
infectedMachine.shoot_inventory = 0
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
/datum/event/carp_migration/end()
|
||||
for(var/mob/living/simple_animal/hostile/carp/C in spawned_carp)
|
||||
var/turf/T = get_turf(C)
|
||||
if(istype(T, /turf/space))
|
||||
del(C)
|
||||
if(!C.stat)
|
||||
var/turf/T = get_turf(C)
|
||||
if(istype(T, /turf/space))
|
||||
del(C)
|
||||
|
||||
@@ -36,14 +36,25 @@
|
||||
|
||||
// Maps event names to event chances
|
||||
// For each chance, 100 represents "normal likelihood", anything below 100 is "reduced likelihood", anything above 100 is "increased likelihood"
|
||||
// Events have to be manually added to this proc to happen
|
||||
var/list/possibleEvents = list()
|
||||
|
||||
// Check for additional possible events
|
||||
possibleEvents[/datum/event/economic_event] = 100 //see Code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events.dm
|
||||
//see:
|
||||
// Code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events.dm
|
||||
// Code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events_Mundane.dm
|
||||
possibleEvents[/datum/event/economic_event] = 200
|
||||
possibleEvents[/datum/event/trivial_news] = 300
|
||||
possibleEvents[/datum/event/mundane_news] = 200
|
||||
|
||||
possibleEvents[/datum/event/pda_spam] = max(min(25, player_list.len) * 4, 200)
|
||||
possibleEvents[/datum/event/money_lotto] = max(min(5, player_list.len), 50)
|
||||
if(account_hack_attempted)
|
||||
possibleEvents[/datum/event/money_hacker] = max(min(25, player_list.len) * 4, 200)
|
||||
|
||||
possibleEvents[/datum/event/carp_migration] = 50 + 50 * active_with_role["Engineer"]
|
||||
possibleEvents[/datum/event/brand_intelligence] = 50 + 25 * active_with_role["Janitor"]
|
||||
|
||||
possibleEvents[/datum/event/rogue_drone] = 50 + 25 * active_with_role["Engineer"] + 25 * active_with_role["Security"]
|
||||
possibleEvents[/datum/event/rogue_drone] = 25 + 25 * active_with_role["Engineer"] + 25 * active_with_role["Security"]
|
||||
possibleEvents[/datum/event/infestation] = 50 + 25 * active_with_role["Janitor"]
|
||||
|
||||
possibleEvents[/datum/event/communications_blackout] = 50 + 25 * active_with_role["AI"] + active_with_role["Scientist"] * 25
|
||||
@@ -73,6 +84,15 @@
|
||||
if(!sent_ninja_to_station && toggle_space_ninja)
|
||||
possibleEvents[/datum/event/space_ninja] = max(active_with_role["Security"], 5)
|
||||
|
||||
// Debug code below here, very useful for testing so don't delete please.
|
||||
/*var/debug_message = "Firing random event. "
|
||||
for(var/V in active_with_role)
|
||||
debug_message += "#[V]:[active_with_role[V]] "
|
||||
debug_message += "||| "
|
||||
for(var/V in possibleEvents)
|
||||
debug_message += "[V]:[possibleEvents[V]]"
|
||||
message_admins(debug_message)*/
|
||||
|
||||
var/picked_event = pickweight(possibleEvents)
|
||||
if(!picked_event)
|
||||
return
|
||||
@@ -158,34 +178,34 @@
|
||||
active_with_role["Janitor"] = 0
|
||||
|
||||
for(var/mob/M in player_list)
|
||||
if(!M.client || M.client.inactivity > 10 * 10 * 60) // longer than 10 minutes AFK counts them as inactive
|
||||
if(!M.mind || !M.client || M.client.inactivity > 10 * 10 * 60) // longer than 10 minutes AFK counts them as inactive
|
||||
continue
|
||||
switch(role)
|
||||
if("Engineer")
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "engineering robot module")
|
||||
active_with_role["Engineer"]++
|
||||
if(M.mind.assigned_role in list("Chief Engineer", "Station Engineer"))
|
||||
active_with_role["Engineer"]++
|
||||
if("Medical")
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "medical robot module")
|
||||
active_with_role["Medical"]++
|
||||
if(M.mind.assigned_role in list("Chief Medical Officer", "Medical Doctor"))
|
||||
active_with_role["Medical"]++
|
||||
if("Security")
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "security robot module")
|
||||
active_with_role["Security"]++
|
||||
if(M.mind.assigned_role in security_positions)
|
||||
active_with_role["Security"]++
|
||||
if("Scientist")
|
||||
if(M.mind.assigned_role in list("Research Director", "Scientist"))
|
||||
active_with_role["Scientist"]++
|
||||
if("AI")
|
||||
if(M.mind.assigned_role == "AI")
|
||||
active_with_role["AI"]++
|
||||
if("Cyborg")
|
||||
if(M.mind.assigned_role == "Cyborg")
|
||||
active_with_role["Cyborg"]++
|
||||
if("Janitor")
|
||||
if(M.mind.assigned_role == "Janitor")
|
||||
active_with_role["Janitor"]++
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "engineering robot module")
|
||||
active_with_role["Engineer"]++
|
||||
if(M.mind.assigned_role in list("Chief Engineer", "Station Engineer"))
|
||||
active_with_role["Engineer"]++
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "medical robot module")
|
||||
active_with_role["Medical"]++
|
||||
if(M.mind.assigned_role in list("Chief Medical Officer", "Medical Doctor"))
|
||||
active_with_role["Medical"]++
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "security robot module")
|
||||
active_with_role["Security"]++
|
||||
if(M.mind.assigned_role in security_positions)
|
||||
active_with_role["Security"]++
|
||||
|
||||
if(M.mind.assigned_role in list("Research Director", "Scientist"))
|
||||
active_with_role["Scientist"]++
|
||||
|
||||
if(M.mind.assigned_role == "AI")
|
||||
active_with_role["AI"]++
|
||||
|
||||
if(M.mind.assigned_role == "Cyborg")
|
||||
active_with_role["Cyborg"]++
|
||||
|
||||
if(M.mind.assigned_role == "Janitor")
|
||||
active_with_role["Janitor"]++
|
||||
|
||||
return active_with_role
|
||||
|
||||
@@ -2,9 +2,8 @@ var/list/allEvents = typesof(/datum/event) - /datum/event
|
||||
var/list/potentialRandomEvents = typesof(/datum/event) - /datum/event
|
||||
//var/list/potentialRandomEvents = typesof(/datum/event) - /datum/event - /datum/event/spider_infestation - /datum/event/alien_infestation
|
||||
|
||||
var/eventTimeLower = 20000 //20 minutes
|
||||
var/eventTimeUpper = 45000 //45 minutes
|
||||
|
||||
var/eventTimeLower = 10000 //15 minutes
|
||||
var/eventTimeUpper = 25000 //30 minutes
|
||||
var/scheduledEvent = null
|
||||
|
||||
|
||||
@@ -19,7 +18,7 @@ var/scheduledEvent = null
|
||||
/proc/checkEvent()
|
||||
if(!scheduledEvent)
|
||||
//more players = more time between events, less players = less time between events
|
||||
var/playercount_modifier = 0.5
|
||||
var/playercount_modifier = 1
|
||||
switch(player_list.len)
|
||||
if(0 to 10)
|
||||
playercount_modifier = 1.2
|
||||
@@ -63,4 +62,4 @@ var/scheduledEvent = null
|
||||
|
||||
if(ispath(type))
|
||||
new type
|
||||
message_admins("[key_name_admin(usr)] has triggered an event. ([type])", 1)
|
||||
message_admins("[key_name_admin(usr)] has triggered an event. ([type])", 1)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#define VERM_MICE 0
|
||||
#define VERM_LIZARDS 1
|
||||
#define VERM_SLIMES 2
|
||||
#define VERM_SPIDERS 2
|
||||
|
||||
/datum/event/infestation
|
||||
announceWhen = 10
|
||||
@@ -81,20 +81,25 @@
|
||||
spawn_types = list(/mob/living/simple_animal/lizard)
|
||||
max_number = 6
|
||||
vermstring = "lizards"
|
||||
if(VERM_SLIMES)
|
||||
spawn_types = list(/mob/living/carbon/slime)
|
||||
max_number = 3
|
||||
vermstring = "slimes"
|
||||
if(VERM_SPIDERS)
|
||||
spawn_types = list(/obj/effect/spider/spiderling)
|
||||
vermstring = "spiders"
|
||||
|
||||
spawn(0)
|
||||
var/num = rand(2,max_number)
|
||||
while(turfs.len > 0 && num > 0)
|
||||
var/turf/simulated/floor/T = pick(turfs)
|
||||
turfs.Remove(T)
|
||||
var/spawn_type = pick(spawn_types)
|
||||
new spawn_type(T)
|
||||
num--
|
||||
//world << "[vermstring] spawned in [spawn_area_type]"
|
||||
|
||||
|
||||
if(vermin == VERM_SPIDERS)
|
||||
var/obj/effect/spider/spiderling/S = new(T)
|
||||
S.amount_grown = -1
|
||||
else
|
||||
var/spawn_type = pick(spawn_types)
|
||||
new spawn_type(T)
|
||||
|
||||
|
||||
/datum/event/infestation/announce()
|
||||
command_alert("Bioscans indicate that [vermstring] have been breeding in [locstring]. Clear them out, before this starts to affect productivity.", "Vermin infestation")
|
||||
@@ -111,4 +116,4 @@
|
||||
|
||||
#undef VERM_MICE
|
||||
#undef VERM_LIZARDS
|
||||
#undef VERM_SLIMES
|
||||
#undef VERM_SPIDERS
|
||||
@@ -0,0 +1,120 @@
|
||||
/var/global/account_hack_attempted = 0
|
||||
|
||||
/datum/event/money_hacker
|
||||
endWhen = 10000
|
||||
var/time_duration = 0
|
||||
var/time_start = 0
|
||||
var/datum/money_account/affected_account
|
||||
var/obj/machinery/account_database/affected_db
|
||||
|
||||
/datum/event/money_hacker/setup()
|
||||
for(var/obj/machinery/account_database/DB in world)
|
||||
if( DB.z == 1 && !(DB.stat&NOPOWER) && DB.activated && DB.accounts.len)
|
||||
affected_db = DB
|
||||
break
|
||||
if(affected_db)
|
||||
affected_account = pick(affected_db.accounts)
|
||||
else
|
||||
kill()
|
||||
return
|
||||
|
||||
time_start = world.time
|
||||
time_duration = rand(3000, 18000)
|
||||
endWhen = time_duration * 10 //a big enough buffer so that we should timeout before we run out of ticks
|
||||
account_hack_attempted = 1
|
||||
|
||||
/datum/event/money_hacker/start()
|
||||
return
|
||||
|
||||
/datum/event/money_hacker/announce()
|
||||
var/message = "A brute force hack has been detected (in progress since [worldtime2text()]). The target of the attack is: Financial account #[affected_account.account_number], \
|
||||
without intervention this attack will succeed in [time_duration / 600] minutes. Required intervention: complete shutdown of affected accounts databases until the attack has ceased. \
|
||||
Notifications will be sent as updates occur.<br>"
|
||||
var/my_department = "[station_name()] firewall subroutines"
|
||||
var/sending = message + "<font color='blue'><b>Message dispatched by [my_department].</b></font>"
|
||||
|
||||
var/pass = 0
|
||||
for(var/obj/machinery/message_server/MS in world)
|
||||
if(!MS.active) continue
|
||||
// /obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1)
|
||||
MS.send_rc_message("Engineering/Security/Bridge", my_department, message, "", "", 2)
|
||||
pass = 1
|
||||
|
||||
if(pass)
|
||||
var/keyed_dpt1 = ckey("Engineering")
|
||||
var/keyed_dpt2 = ckey("Security")
|
||||
var/keyed_dpt3 = ckey("Bridge")
|
||||
for (var/obj/machinery/requests_console/Console in allConsoles)
|
||||
var/keyed_department = ckey(Console.department)
|
||||
if(keyed_department == keyed_dpt1 || keyed_department == keyed_dpt2 || keyed_department == keyed_dpt3)
|
||||
if(Console.newmessagepriority < 2)
|
||||
Console.newmessagepriority = 2
|
||||
Console.icon_state = "req_comp2"
|
||||
if(!Console.silent)
|
||||
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(5, Console.loc))
|
||||
O.show_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [my_department]'"))
|
||||
Console.messages += "<B><FONT color='red'>High Priority message from [my_department]</FONT></B><BR>[sending]"
|
||||
|
||||
/datum/event/money_hacker/tick()
|
||||
if(world.time > time_start + time_duration)
|
||||
var/message
|
||||
if(affected_account && affected_db && affected_db.activated && !(affected_db.stat & (NOPOWER|BROKEN)) )
|
||||
//hacker wins
|
||||
message = "The hack attempt has succeeded."
|
||||
|
||||
//subtract the money
|
||||
var/lost = affected_account.money * 0.8 + (rand(2,4) - 2) / 10
|
||||
affected_account.money -= lost
|
||||
|
||||
//create a taunting log entry
|
||||
var/datum/transaction/T = new()
|
||||
T.target_name = pick("","yo brotha from anotha motha","el Presidente","chieF smackDowN")
|
||||
T.purpose = pick("Ne$ ---ount fu%ds init*&lisat@*n","PAY BACK YOUR MUM","Funds withdrawal","pWnAgE","l33t hax","liberationez")
|
||||
T.amount = pick("","([rand(0,99999)])","alla money","9001$","HOLLA HOLLA GET DOLLA","([lost])")
|
||||
var/date1 = "31 December, 1999"
|
||||
var/date2 = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], [rand(1000,3000)]"
|
||||
T.date = pick("", current_date_string, date1, date2)
|
||||
var/time1 = rand(0, 99999999)
|
||||
var/time2 = "[round(time1 / 36000)+12]:[(time1 / 600 % 60) < 10 ? add_zero(time1 / 600 % 60, 1) : time1 / 600 % 60]"
|
||||
T.time = pick("", worldtime2text(), time2)
|
||||
T.source_terminal = pick("","[pick("Biesel","New Gibson")] GalaxyNet Terminal #[rand(111,999)]","your mums place","nantrasen high CommanD")
|
||||
|
||||
affected_account.transaction_log.Add(T)
|
||||
|
||||
else
|
||||
//crew wins
|
||||
message = "The attack has ceased, the affected databases can now be brought online."
|
||||
|
||||
var/my_department = "[station_name()] firewall subroutines"
|
||||
var/sending = message + "<font color='blue'><b>Message dispatched by [my_department].</b></font>"
|
||||
|
||||
var/pass = 0
|
||||
for(var/obj/machinery/message_server/MS in world)
|
||||
if(!MS.active) continue
|
||||
// /obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1)
|
||||
MS.send_rc_message("Engineering/Security/Bridge", my_department, message, "", "", 2)
|
||||
pass = 1
|
||||
|
||||
if(pass)
|
||||
var/keyed_dpt1 = ckey("Engineering")
|
||||
var/keyed_dpt2 = ckey("Security")
|
||||
var/keyed_dpt3 = ckey("Bridge")
|
||||
for (var/obj/machinery/requests_console/Console in allConsoles)
|
||||
var/keyed_department = ckey(Console.department)
|
||||
if(keyed_department == keyed_dpt1 || keyed_department == keyed_dpt2 || keyed_department == keyed_dpt3)
|
||||
if(Console.newmessagepriority < 2)
|
||||
Console.newmessagepriority = 2
|
||||
Console.icon_state = "req_comp2"
|
||||
if(!Console.silent)
|
||||
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(5, Console.loc))
|
||||
O.show_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [my_department]'"))
|
||||
Console.messages += "<B><FONT color='red'>High Priority message from [my_department]</FONT></B><BR>[sending]"
|
||||
|
||||
kill()
|
||||
|
||||
//shouldn't ever hit this, but this is here just in case
|
||||
/datum/event/money_hacker/end()
|
||||
if(affected_account && affected_db)
|
||||
endWhen += time_duration
|
||||
@@ -0,0 +1,40 @@
|
||||
/datum/event/money_lotto
|
||||
endWhen = 301
|
||||
announceWhen = 300
|
||||
var/winner_name = "John Smith"
|
||||
var/winner_sum = 0
|
||||
var/deposit_success = 0
|
||||
|
||||
/datum/event/money_lotto/start()
|
||||
winner_sum = pick(5000, 10000, 50000, 100000, 500000, 1000000, 1500000)
|
||||
if(centcomm_account_db.accounts.len)
|
||||
var/datum/money_account/D = pick(centcomm_account_db.accounts)
|
||||
D.money += winner_sum
|
||||
|
||||
var/datum/transaction/T = new()
|
||||
T.target_name = "Tau Ceti Daily Grand Slam -Stellar- Lottery"
|
||||
T.purpose = "Winner!"
|
||||
T.amount = winner_sum
|
||||
T.date = current_date_string
|
||||
T.time = worldtime2text()
|
||||
T.source_terminal = "Biesel TCD Terminal #[rand(111,333)]"
|
||||
D.transaction_log.Add(T)
|
||||
else
|
||||
kill()
|
||||
|
||||
/datum/event/money_lotto/announce()
|
||||
var/datum/feed_message/newMsg = new /datum/feed_message
|
||||
newMsg.author = "NanoTrasen Editor"
|
||||
newMsg.is_admin_message = 1
|
||||
|
||||
newMsg.body = "TC Daily wishes to congratulate <b>[winner_name]</b> for recieving the Tau Ceti Stellar Slam Lottery, and receiving the out of this world sum of [winner_sum] credits!"
|
||||
if(!deposit_success)
|
||||
newMsg.body += "<br>Unfortunately, we were unable to verify the account details provided, so we were unable to transfer the money. Send a cheque containing the sum of $500 to TCD 'Stellar Slam' office on Biesel Prime containing updated details, and it'll be resent within the month."
|
||||
|
||||
for(var/datum/feed_channel/FC in news_network.network_channels)
|
||||
if(FC.channel_name == "Tau Ceti Daily")
|
||||
FC.messages += newMsg
|
||||
break
|
||||
|
||||
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
|
||||
NEWSCASTER.newsAlert("Tau Ceti Daily")
|
||||
@@ -0,0 +1,102 @@
|
||||
/datum/event/pda_spam
|
||||
endWhen = 6000
|
||||
var/time_failed = 0
|
||||
var/obj/machinery/message_server/useMS
|
||||
|
||||
/datum/event/pda_spam/setup()
|
||||
time_failed = world.time
|
||||
for (var/obj/machinery/message_server/MS in message_servers)
|
||||
if(MS.active)
|
||||
useMS = MS
|
||||
break
|
||||
|
||||
/datum/event/pda_spam/tick()
|
||||
if(!useMS.active)
|
||||
useMS = null
|
||||
if(!useMS && message_servers)
|
||||
for (var/obj/machinery/message_server/MS in message_servers)
|
||||
if(MS.active)
|
||||
useMS = MS
|
||||
break
|
||||
if(useMS)
|
||||
time_failed = world.time
|
||||
if(prob(2))
|
||||
// /obj/machinery/message_server/proc/send_pda_message(var/recipient = "",var/sender = "",var/message = "")
|
||||
var/obj/item/device/pda/P
|
||||
var/list/viables = list()
|
||||
for(var/obj/item/device/pda/check_pda in sortAtom(PDAs))
|
||||
if (!check_pda.owner||check_pda.toff||check_pda == src||check_pda.hidden)
|
||||
continue
|
||||
viables.Add(check_pda)
|
||||
|
||||
if(!viables.len)
|
||||
return
|
||||
P = pick(viables)
|
||||
|
||||
var/sender
|
||||
var/message
|
||||
switch(pick(1,2,3,4,5))
|
||||
if(1)
|
||||
sender = pick("MaxBet","MaxBet Online Casino","There is no better time to register","I'm excited for you to join us")
|
||||
message = pick("Triple deposits are waiting for you at MaxBet Online when you register to play with us.",\
|
||||
"You can qualify for a 200% Welcome Bonus at MaxBet Online when you sign up today.",\
|
||||
"Once you are a player with MaxBet, you will also receive lucrative weekly and monthly promotions.",\
|
||||
"You will be able to enjoy over 450 top-flight casino games at MaxBet.")
|
||||
if(2)
|
||||
sender = pick(300;"QuickDatingSystem",200;"Find your russian bride",50;"Tajaran beauties are waiting",50;"Find your secret skrell crush",50;"Beautiful unathi brides")
|
||||
message = pick("Your profile caught my attention and I wanted to write and say hello (QuickDating).",\
|
||||
"If you will write to me on my email [pick(first_names_female)]@[pick(last_names)].[pick("ru","ck","tj","ur","nt")] I shall necessarily send you a photo (QuickDating).",\
|
||||
"I want that we write each other and I hope, that you will like my profile and you will answer me (QuickDating).",\
|
||||
"You have (1) new message!",\
|
||||
"You have (2) new profile views!")
|
||||
if(3)
|
||||
sender = pick("Galactic Payments Association","Better Business Bureau","Tau Ceti E-Payments","NAnoTransen Finance Deparmtent","Luxury Replicas")
|
||||
message = pick("Luxury watches for Blowout sale prices!",\
|
||||
"Watches, Jewelry & Accessories, Bags & Wallets !",\
|
||||
"Deposit 100$ and get 300$ totally free!",\
|
||||
" 100K NT.|WOWGOLD õnly $89 <HOT>",\
|
||||
"We have been filed with a complaint from one of your customers in respect of their business relations with you.",\
|
||||
"We kindly ask you to open the COMPLAINT REPORT (attached) to reply on this complaint..")
|
||||
if(4)
|
||||
sender = pick("Buy Dr. Maxman","Having dysfuctional troubles?")
|
||||
message = pick("DR MAXMAN: REAL Doctors, REAL Science, REAL Results!",\
|
||||
"Dr. Maxman was created by George Acuilar, M.D, a CentComm Certified Urologist who has treated over 70,000 patients sector wide with 'male problems'.",\
|
||||
"After seven years of research, Dr Acuilar and his team came up with this simple breakthrough male enhancement formula.",\
|
||||
"Men of all species report AMAZING increases in length, width and stamina.")
|
||||
if(5)
|
||||
sender = pick("Dr","Crown prince","King Regent","Professor","Captain")
|
||||
sender += " " + pick("Robert","Alfred","Josephat","Kingsley","Sehi","Zbahi")
|
||||
sender += " " + pick("Mugawe","Nkem","Gbatokwia","Nchekwube","Ndim","Ndubisi")
|
||||
message = pick("YOUR FUND HAS BEEN MOVED TO [pick("Salusa","Segunda","Cepheus","Andromeda","Gruis","Corona","Aquila","Asellus")] DEVELOPMENTARY BANK FOR ONWARD REMITTANCE.",\
|
||||
"We are happy to inform you that due to the delay, we have been instructed to IMMEDIATELY deposit all funds into your account",\
|
||||
"Dear fund beneficiary, We have please to inform you that overdue funds payment has finally been approved and released for payment",\
|
||||
"Due to my lack of agents I require an off-world financial account to immediately deposit the sum of 1 POINT FIVE MILLION credits.",\
|
||||
"Greetings sir, I regretfully to inform you that as I lay dying here due to my lack ofheirs I have chosen you to recieve the full sum of my lifetime savings of 1.5 billion credits")
|
||||
|
||||
useMS.send_pda_message("[P.owner]", sender, message)
|
||||
|
||||
if (prob(50)) //Give the AI an increased chance to intercept the message
|
||||
for(var/mob/living/silicon/ai/ai in mob_list)
|
||||
// Allows other AIs to intercept the message but the AI won't intercept their own message.
|
||||
if(ai.aiPDA != P && ai.aiPDA != src)
|
||||
ai.show_message("<i>Intercepted message from <b>[sender]</b></i> (Unknown / spam?) <i>to <b>[P:owner]</b>: [message]</i>")
|
||||
|
||||
P.tnote += "<i><b>← From [sender] (Unknown / spam?):</b></i><br>[message]<br>"
|
||||
|
||||
if (!P.silent)
|
||||
playsound(P.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(3, P.loc))
|
||||
if(!P.silent) O.show_message(text("\icon[P] *[P.ttone]*"))
|
||||
//Search for holder of the PDA.
|
||||
var/mob/living/L = null
|
||||
if(P.loc && isliving(P.loc))
|
||||
L = P.loc
|
||||
//Maybe they are a pAI!
|
||||
else
|
||||
L = get(P, /mob/living/silicon)
|
||||
|
||||
if(L)
|
||||
L << "\icon[P] <b>Message from [sender] (Unknown / spam?), </b>\"[message]\" (Unable to Reply)"
|
||||
else if(world.time > time_failed + 1200)
|
||||
//if there's no server active for two minutes, give up
|
||||
kill()
|
||||
@@ -919,4 +919,33 @@
|
||||
src.custom_pain("You feel a stabbing pain in your chest!", 1)
|
||||
|
||||
E.ruptured_lungs = 1
|
||||
/*
|
||||
/mob/living/carbon/human/verb/simulate()
|
||||
set name = "sim"
|
||||
set background = 1
|
||||
|
||||
var/damage = input("Wound damage","Wound damage") as num
|
||||
|
||||
var/germs = 0
|
||||
var/tdamage = 0
|
||||
var/ticks = 0
|
||||
while (germs < 2501 && ticks < 100000 && round(damage/10)*20)
|
||||
diary << "VIRUS TESTING: [ticks] : germs [germs] tdamage [tdamage] prob [round(damage/10)*20]"
|
||||
ticks++
|
||||
if (prob(round(damage/10)*20))
|
||||
germs++
|
||||
if (germs == 100)
|
||||
world << "Reached stage 1 in [ticks] ticks"
|
||||
if (germs > 100)
|
||||
if (prob(10))
|
||||
damage++
|
||||
germs++
|
||||
if (germs == 1000)
|
||||
world << "Reached stage 2 in [ticks] ticks"
|
||||
if (germs > 1000)
|
||||
damage++
|
||||
germs++
|
||||
if (germs == 2500)
|
||||
world << "Reached stage 3 in [ticks] ticks"
|
||||
world << "Mob took [tdamage] tox damage"
|
||||
*/
|
||||
@@ -222,6 +222,7 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
var/husk_color_mod = rgb(96,88,80)
|
||||
var/hulk_color_mod = rgb(48,224,40)
|
||||
var/plant_color_mod = rgb(144,224,144)
|
||||
var/necrosis_color_mod = rgb(10,50,0)
|
||||
|
||||
var/husk = (HUSK in src.mutations) //100% unnecessary -Agouri //nope, do you really want to iterate through src.mutations repeatedly? -Pete
|
||||
var/fat = (FAT in src.mutations)
|
||||
@@ -283,6 +284,9 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
temp = new /icon(icobase, "[part.icon_name]")
|
||||
if(part.status & ORGAN_ROBOT)
|
||||
temp.GrayScale()
|
||||
if(part.status & ORGAN_DEAD)
|
||||
temp.ColorTone(necrosis_color_mod)
|
||||
temp.SetIntensity(0.7)
|
||||
else if(!skeleton)
|
||||
if(husk)
|
||||
temp.ColorTone(husk_color_mod)
|
||||
|
||||
@@ -34,6 +34,20 @@
|
||||
for(var/mob/M in view())
|
||||
M << 'sound/effects/mousesqueek.ogg'
|
||||
|
||||
if(!ckey && stat == CONSCIOUS && prob(0.5))
|
||||
stat = UNCONSCIOUS
|
||||
icon_state = "mouse_[color]_sleep"
|
||||
wander = 0
|
||||
speak_chance = 0
|
||||
//snuffles
|
||||
else if(stat == UNCONSCIOUS)
|
||||
if(ckey || prob(1))
|
||||
stat = CONSCIOUS
|
||||
icon_state = "mouse_[color]"
|
||||
wander = 1
|
||||
else if(prob(5))
|
||||
emote("snuffles")
|
||||
|
||||
/mob/living/simple_animal/mouse/New()
|
||||
..()
|
||||
if(!color)
|
||||
|
||||
@@ -196,15 +196,11 @@
|
||||
new_player_panel()
|
||||
|
||||
if(href_list["showpoll"])
|
||||
usr << "\red DB usage has been disabled and that option should not have been available."
|
||||
return
|
||||
|
||||
handle_player_polling()
|
||||
return
|
||||
|
||||
if(href_list["pollid"])
|
||||
usr << "\red DB usage has been disabled and that option should not have been available."
|
||||
return
|
||||
|
||||
var/pollid = href_list["pollid"]
|
||||
if(istext(pollid))
|
||||
|
||||
@@ -382,11 +382,30 @@
|
||||
*/
|
||||
|
||||
/datum/sprite_accessory/hair
|
||||
tentacle_m
|
||||
name = "Skrell Male Tentacles"
|
||||
icon_state = "skrell_hair_m"
|
||||
species_allowed = list("Skrell")
|
||||
gender = MALE
|
||||
spines_long
|
||||
name = "Long Unathi Spines"
|
||||
icon_state = "soghun_longspines"
|
||||
species_allowed = list("Unathi")
|
||||
|
||||
spines_short
|
||||
name = "Short Unathi Spines"
|
||||
icon_state = "soghun_shortspines"
|
||||
species_allowed = list("Unathi")
|
||||
|
||||
frills_long
|
||||
name = "Long Unathi Frills"
|
||||
icon_state = "soghun_longfrills"
|
||||
species_allowed = list("Unathi")
|
||||
|
||||
frills_short
|
||||
name = "Short Unathi Frills"
|
||||
icon_state = "soghun_shortfrill"
|
||||
species_allowed = list("Unathi")
|
||||
|
||||
horns
|
||||
name = "Unathi Horns"
|
||||
icon_state = "soghun_horns"
|
||||
species_allowed = list("Unathi")
|
||||
|
||||
tentacle_f
|
||||
name = "Skrell Female Tentacles"
|
||||
@@ -499,6 +518,7 @@
|
||||
name = "Smallsatche"
|
||||
icon_state = "facial_smallstache"
|
||||
species_allowed = list("Tajaran")
|
||||
|
||||
//skin styles - WIP
|
||||
//going to have to re-integrate this with surgery
|
||||
//let the icon_state hold an icon preview for now
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
for(var/mob/M in player_list)
|
||||
if(istype(M, /mob/new_player))
|
||||
continue
|
||||
if(M.client && M.client.holder && (M.client.prefs.toggles & CHAT_DEAD)) //admins can toggle deadchat on and off. This is a proc in admin.dm and is only give to Administrators and above
|
||||
if(M.client && M.client.holder && M.client.holder.rights & R_ADMIN && (M.client.prefs.toggles & CHAT_DEAD)) //admins can toggle deadchat on and off. This is a proc in admin.dm and is only give to Administrators and above
|
||||
M << rendered //Admins can hear deadchat, if they choose to, no matter if they're blind/deaf or not.
|
||||
else if(M.stat == DEAD)
|
||||
M.show_message(rendered, 2) //Takes into account blindness and such.
|
||||
|
||||
@@ -186,6 +186,9 @@
|
||||
M.powernet = PN
|
||||
P = M.get_connections()
|
||||
|
||||
else
|
||||
return
|
||||
|
||||
if(P.len == 0) return
|
||||
|
||||
O = P[1]
|
||||
|
||||
@@ -43,14 +43,14 @@
|
||||
toxmob(A)
|
||||
if((istype(A,/obj/machinery/the_singularitygen))||(istype(A,/obj/machinery/singularity/)))
|
||||
A:energy += energy
|
||||
else if( istype(A,/obj/machinery/rust/particle_catcher) )
|
||||
var/obj/machinery/rust/particle_catcher/collided_catcher = A
|
||||
else if( istype(A,/obj/effect/rust_particle_catcher) )
|
||||
var/obj/effect/rust_particle_catcher/collided_catcher = A
|
||||
if(particle_type && particle_type != "neutron")
|
||||
if(collided_catcher.AddParticles(particle_type, 1 + additional_particles))
|
||||
collided_catcher.parent.AddEnergy(energy,mega_energy)
|
||||
del (src)
|
||||
else if( istype(A,/obj/machinery/rust/core) )
|
||||
var/obj/machinery/rust/core/collided_core = A
|
||||
else if( istype(A,/obj/machinery/power/rust_core) )
|
||||
var/obj/machinery/power/rust_core/collided_core = A
|
||||
if(particle_type && particle_type != "neutron")
|
||||
if(collided_core.AddParticles(particle_type, 1 + additional_particles))
|
||||
var/energy_loss_ratio = abs(collided_core.owned_field.frequency - frequency) / 1e9
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
Methylphenidate
|
||||
|
||||
#define ANTIDEPRESSANT_MESSAGE_DELAY 5*60*10
|
||||
|
||||
/datum/reagent/antidepressant/methylphenidate
|
||||
name = "Methylphenidate"
|
||||
id = "methylphenidate"
|
||||
description = "Improves the ability to concentrate."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC"
|
||||
custom_metabolism = 0.01
|
||||
data = 0
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
if(src.volume <= 0.1) if(data != -1)
|
||||
data = -1
|
||||
M << "\red You lose focus.."
|
||||
else
|
||||
if(world.time > data + ANTIDEPRESSANT_MESSAGE_DELAY)
|
||||
data = world.time
|
||||
M << "\blue Your mind feels focused and undivided."
|
||||
..()
|
||||
return
|
||||
|
||||
/datum/chemical_reaction/methylphenidate
|
||||
name = "Methylphenidate"
|
||||
id = "methylphenidate"
|
||||
result = "methylphenidate"
|
||||
required_reagents = list("mindbreaker" = 1, "hydrogen" = 1)
|
||||
result_amount = 3
|
||||
|
||||
/datum/reagent/antidepressant/citalopram
|
||||
name = "Citalopram"
|
||||
id = "citalopram"
|
||||
description = "Stabilizes the mind a little."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC"
|
||||
custom_metabolism = 0.01
|
||||
data = 0
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
if(src.volume <= 0.1) if(data != -1)
|
||||
data = -1
|
||||
M << "\red Your mind feels a little less stable.."
|
||||
else
|
||||
if(world.time > data + ANTIDEPRESSANT_MESSAGE_DELAY)
|
||||
data = world.time
|
||||
M << "\blue Your mind feels stable.. a little stable."
|
||||
..()
|
||||
return
|
||||
|
||||
/datum/chemical_reaction/citalopram
|
||||
name = "Citalopram"
|
||||
id = "citalopram"
|
||||
result = "citalopram"
|
||||
required_reagents = list("mindbreaker" = 1, "carbon" = 1)
|
||||
result_amount = 3
|
||||
|
||||
|
||||
/datum/reagent/antidepressant/paroxetine
|
||||
name = "Paroxetine"
|
||||
id = "paroxetine"
|
||||
description = "Stabilizes the mind greatly, but has a chance of adverse effects."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC"
|
||||
custom_metabolism = 0.01
|
||||
data = 0
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
if(src.volume <= 0.1) if(data != -1)
|
||||
data = -1
|
||||
M << "\red Your mind feels much less stable.."
|
||||
else
|
||||
if(world.time > data + ANTIDEPRESSANT_MESSAGE_DELAY)
|
||||
data = world.time
|
||||
if(prob(90))
|
||||
M << "\blue Your mind feels much more stable."
|
||||
else
|
||||
M << "\red Your mind breaks apart.."
|
||||
M.hallucination += 200
|
||||
..()
|
||||
return
|
||||
|
||||
/datum/chemical_reaction/paroxetine
|
||||
name = "Paroxetine"
|
||||
id = "paroxetine"
|
||||
result = "paroxetine"
|
||||
required_reagents = list("mindbreaker" = 1, "oxygen" = 1, "inaprovaline" = 1)
|
||||
result_amount = 3
|
||||
@@ -19,6 +19,8 @@ datum
|
||||
var/list/data = null
|
||||
var/volume = 0
|
||||
var/nutriment_factor = 0
|
||||
var/custom_metabolism = REAGENTS_METABOLISM
|
||||
var/mildly_toxic = 0
|
||||
//var/list/viruses = list()
|
||||
var/color = "#000000" // rgb: 0, 0, 0 (does not support alpha channels - yet!)
|
||||
|
||||
@@ -68,7 +70,14 @@ datum
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!istype(M, /mob/living))
|
||||
return //Noticed runtime errors from pacid trying to damage ghosts, this should fix. --NEO
|
||||
holder.remove_reagent(src.id, REAGENTS_METABOLISM) //By default it slowly disappears.
|
||||
// Certain elements in too large amounts cause side-effects
|
||||
|
||||
if(mildly_toxic && istype(M, /mob/living/carbon/human/))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.side_effects.len == 0)
|
||||
M.add_side_effect(pick("Headache", "Bad Stomach", "Itch"))
|
||||
|
||||
holder.remove_reagent(src.id, custom_metabolism) //By default it slowly disappears.
|
||||
return
|
||||
|
||||
on_move(var/mob/M)
|
||||
@@ -199,6 +208,7 @@ datum
|
||||
description = "A ubiquitous chemical substance that is composed of hydrogen and oxygen."
|
||||
reagent_state = LIQUID
|
||||
color = "#0064C8" // rgb: 0, 100, 200
|
||||
custom_metabolism = 0.01
|
||||
|
||||
reaction_turf(var/turf/simulated/T, var/volume)
|
||||
if (!istype(T)) return
|
||||
@@ -309,24 +319,28 @@ datum
|
||||
description = "A Toxic chemical."
|
||||
reagent_state = LIQUID
|
||||
color = "#CF3600" // rgb: 207, 54, 0
|
||||
custom_metabolism = 0.01
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
M.adjustToxLoss(1.5*REM)
|
||||
// Toxins are really weak, but without being treated, last very long.
|
||||
M.adjustToxLoss(0.2)
|
||||
..()
|
||||
return
|
||||
|
||||
cyanide
|
||||
// Fast and lethal
|
||||
name = "Cyanide"
|
||||
id = "cyanide"
|
||||
description = "A highly toxic chemical."
|
||||
reagent_state = LIQUID
|
||||
color = "#CF3600" // rgb: 207, 54, 0
|
||||
custom_metabolism = 0.4
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
M.adjustToxLoss(3*REM)
|
||||
M.adjustOxyLoss(3*REM)
|
||||
M.adjustToxLoss(4)
|
||||
M.adjustOxyLoss(4)
|
||||
M.sleeping += 1
|
||||
..()
|
||||
return
|
||||
@@ -405,6 +419,8 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#E895CC" // rgb: 232, 149, 204
|
||||
|
||||
custom_metabolism = 0.1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
if(!data) data = 1
|
||||
@@ -540,12 +556,17 @@ datum
|
||||
reagent_state = GAS
|
||||
color = "#808080" // rgb: 128, 128, 128
|
||||
|
||||
custom_metabolism = 0.01
|
||||
|
||||
copper
|
||||
name = "Copper"
|
||||
id = "copper"
|
||||
description = "A highly ductile metal."
|
||||
color = "#6E3B08" // rgb: 110, 59, 8
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
nitrogen
|
||||
name = "Nitrogen"
|
||||
id = "nitrogen"
|
||||
@@ -553,6 +574,9 @@ datum
|
||||
reagent_state = GAS
|
||||
color = "#808080" // rgb: 128, 128, 128
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
hydrogen
|
||||
name = "Hydrogen"
|
||||
id = "hydrogen"
|
||||
@@ -560,6 +584,9 @@ datum
|
||||
reagent_state = GAS
|
||||
color = "#808080" // rgb: 128, 128, 128
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
potassium
|
||||
name = "Potassium"
|
||||
id = "potassium"
|
||||
@@ -567,6 +594,10 @@ datum
|
||||
reagent_state = SOLID
|
||||
color = "#A0A0A0" // rgb: 160, 160, 160
|
||||
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
mercury
|
||||
name = "Mercury"
|
||||
id = "mercury"
|
||||
@@ -589,6 +620,9 @@ datum
|
||||
reagent_state = SOLID
|
||||
color = "#BF8C00" // rgb: 191, 140, 0
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
carbon
|
||||
name = "Carbon"
|
||||
id = "carbon"
|
||||
@@ -596,6 +630,9 @@ datum
|
||||
reagent_state = SOLID
|
||||
color = "#1C1300" // rgb: 30, 20, 0
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
reaction_turf(var/turf/T, var/volume)
|
||||
src = null
|
||||
if(!istype(T, /turf/space))
|
||||
@@ -634,6 +671,9 @@ datum
|
||||
reagent_state = SOLID
|
||||
color = "#808080" // rgb: 128, 128, 128
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
phosphorus
|
||||
name = "Phosphorus"
|
||||
id = "phosphorus"
|
||||
@@ -641,6 +681,9 @@ datum
|
||||
reagent_state = SOLID
|
||||
color = "#832828" // rgb: 131, 40, 40
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
lithium
|
||||
name = "Lithium"
|
||||
id = "lithium"
|
||||
@@ -826,6 +869,9 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#808080" // rgb: 128, 128, 128
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
nitroglycerin
|
||||
name = "Nitroglycerin"
|
||||
id = "nitroglycerin"
|
||||
@@ -833,6 +879,9 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#808080" // rgb: 128, 128, 128
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
radium
|
||||
name = "Radium"
|
||||
id = "radium"
|
||||
@@ -1403,6 +1452,7 @@ datum
|
||||
description = "Synaptizine is used to treat various diseases."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.01
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1440,6 +1490,7 @@ datum
|
||||
description = "Hyronalin is a medicinal drug used to counter the effect of radiation poisoning."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.05
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1453,6 +1504,7 @@ datum
|
||||
description = "Arithrazine is an unstable medication used for the most extreme cases of radiation poisoning."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.05
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(M.stat == 2.0)
|
||||
@@ -1471,6 +1523,7 @@ datum
|
||||
description = "Alkysine is a drug used to lessen the damage to neurological tissue after a catastrophic injury. Can heal brain tissue."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.05
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1516,11 +1569,11 @@ datum
|
||||
description = "Hyperzine is a highly effective, long lasting, muscle stimulant."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.03
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
if(prob(5)) M.emote(pick("twitch","blink_r","shiver"))
|
||||
holder.remove_reagent(src.id, 0.5 * REAGENTS_METABOLISM)
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -1535,9 +1588,9 @@ datum
|
||||
if(!M) M = holder.my_atom
|
||||
if(M.bodytemperature < 170)
|
||||
M.adjustCloneLoss(-1)
|
||||
M.adjustOxyLoss(-3)
|
||||
M.heal_organ_damage(3,3)
|
||||
M.adjustToxLoss(-3)
|
||||
M.adjustOxyLoss(-1)
|
||||
M.heal_organ_damage(1,1)
|
||||
M.adjustToxLoss(-1)
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -1564,9 +1617,9 @@ datum
|
||||
description = "An all-purpose antiviral agent."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.01
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)//no more mr. panacea
|
||||
holder.remove_reagent(src.id, 0.2)
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -1612,6 +1665,7 @@ datum
|
||||
description = "A powerful hallucinogen. Not a thing to be messed with."
|
||||
reagent_state = LIQUID
|
||||
color = "#B31008" // rgb: 139, 166, 233
|
||||
custom_metabolism = 0.05
|
||||
|
||||
on_mob_life(var/mob/living/M)
|
||||
if(!M) M = holder.my_atom
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
icon_state = "pill17"
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("anti_toxin", 50)
|
||||
reagents.add_reagent("anti_toxin", 25)
|
||||
|
||||
/obj/item/weapon/reagent_containers/pill/tox
|
||||
name = "Toxins pill"
|
||||
@@ -134,6 +134,24 @@
|
||||
..()
|
||||
reagents.add_reagent("tramadol", 15)
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/pill/methylphenidate
|
||||
name = "Methylphenidate pill"
|
||||
desc = "Improves the ability to concentrate."
|
||||
icon_state = "pill8"
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("methylphenidate", 15)
|
||||
|
||||
/obj/item/weapon/reagent_containers/pill/citalopram
|
||||
name = "Citalopram pill"
|
||||
desc = "Mild anti-depressant."
|
||||
icon_state = "pill8"
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("citalopram", 15)
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/pill/inaprovaline
|
||||
name = "Inaprovaline pill"
|
||||
desc = "Used to stabilize patients."
|
||||
@@ -175,4 +193,4 @@
|
||||
..()
|
||||
reagents.add_reagent("impedrezene", 10)
|
||||
reagents.add_reagent("synaptizine", 5)
|
||||
reagents.add_reagent("hyperzine", 5)
|
||||
reagents.add_reagent("hyperzine", 5)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/appendectomy/
|
||||
priority = 2
|
||||
can_infect = 1
|
||||
blood_level = 1
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/glue_bone
|
||||
priority = 2
|
||||
required_tool = /obj/item/weapon/bonegel
|
||||
allowed_tools = list(/obj/item/weapon/screwdriver)
|
||||
can_infect = 1
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/brain/
|
||||
priority = 2
|
||||
blood_level = 1
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return target_zone == "head" && hasorgans(target)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/eye
|
||||
priority = 2
|
||||
can_infect = 1
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if (!hasorgans(target))
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/face
|
||||
priority = 2
|
||||
can_infect = 0
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if (!hasorgans(target))
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\blue [user] cuts off [target]'s [affected.display_name] with \the [tool].", \
|
||||
"\blue You cut off [target]'s [affected.display_name] with \the [tool].")
|
||||
affected.droplimb(1)
|
||||
affected.droplimb(1,1)
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
//Procedures in this file: Putting items in body cavity. Implant removal. Items removal.
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// ITEM PLACEMENT SURGERY //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/cavity
|
||||
priority = 1
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected.open == 2 && !(affected.status & ORGAN_BLEEDING) && (target_zone != "chest" || target.op_stage.ribcage == 2)
|
||||
|
||||
proc/get_max_wclass(datum/organ/external/affected)
|
||||
switch (affected.name)
|
||||
if ("head")
|
||||
return 1
|
||||
if ("chest")
|
||||
return 3
|
||||
if ("groin")
|
||||
return 2
|
||||
return 0
|
||||
|
||||
proc/get_cavity(datum/organ/external/affected)
|
||||
switch (affected.name)
|
||||
if ("head")
|
||||
return "cranial"
|
||||
if ("chest")
|
||||
return "thoracic"
|
||||
if ("groin")
|
||||
return "abdominal"
|
||||
return ""
|
||||
|
||||
/datum/surgery_step/cavity/make_space
|
||||
required_tool = /obj/item/weapon/surgicaldrill
|
||||
allowed_tools = list(/obj/item/weapon/pen,/obj/item/stack/rods)
|
||||
|
||||
min_duration = 60
|
||||
max_duration = 80
|
||||
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
return ..() && !affected.cavity && !affected.hidden
|
||||
|
||||
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts making some space inside [target]'s [get_cavity(affected)] cavity with \the [tool].", \
|
||||
"You start making some space inside [target]'s [get_cavity(affected)] cavity with \the [tool]." )
|
||||
target.custom_pain("The pain in your chest is living hell!",1)
|
||||
affected.cavity = 1
|
||||
..()
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\blue [user] makes some space inside [target]'s [get_cavity(affected)] cavity with \the [tool].", \
|
||||
"\blue You make some space inside [target]'s [get_cavity(affected)] cavity with \the [tool]." )
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \
|
||||
"\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!")
|
||||
affected.createwound(CUT, 20)
|
||||
|
||||
/datum/surgery_step/cavity/close_space
|
||||
priority = 2
|
||||
required_tool = /obj/item/weapon/cautery
|
||||
allowed_tools = list(/obj/item/weapon/weldingtool, /obj/item/clothing/mask/cigarette, /obj/item/weapon/lighter)
|
||||
|
||||
min_duration = 60
|
||||
max_duration = 80
|
||||
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
return ..() && affected.cavity
|
||||
|
||||
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts mending [target]'s [get_cavity(affected)] cavity wall with \the [tool].", \
|
||||
"You start mending [target]'s [get_cavity(affected)] cavity wall with \the [tool]." )
|
||||
target.custom_pain("The pain in your chest is living hell!",1)
|
||||
affected.cavity = 0
|
||||
..()
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\blue [user] mends [target]'s [get_cavity(affected)] cavity walls with \the [tool].", \
|
||||
"\blue You mend [target]'s [get_cavity(affected)] cavity walls with \the [tool]." )
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \
|
||||
"\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!")
|
||||
affected.createwound(CUT, 20)
|
||||
|
||||
/datum/surgery_step/cavity/place_item
|
||||
priority = 0
|
||||
required_tool = /obj/item
|
||||
|
||||
min_duration = 80
|
||||
max_duration = 100
|
||||
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
var/can_fit = !affected.hidden && affected.cavity && tool.w_class <= get_max_wclass(affected)
|
||||
return ..() && can_fit
|
||||
|
||||
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts putting \the [tool] inside [target]'s [get_cavity(affected)] cavity.", \
|
||||
"You start putting \the [tool] inside [target]'s [get_cavity(affected)] cavity." )
|
||||
target.custom_pain("The pain in your chest is living hell!",1)
|
||||
..()
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
|
||||
user.visible_message("\blue [user] puts \the [tool] inside [target]'s [get_cavity(affected)] cavity.", \
|
||||
"\blue You put \the [tool] inside [target]'s [get_cavity(affected)] cavity." )
|
||||
if (tool.w_class > get_max_wclass(affected)/2 && prob(50))
|
||||
user << "\red You tear some vessels trying to fit such big object in this cavity."
|
||||
var/datum/wound/internal_bleeding/I = new (15)
|
||||
affected.wounds += I
|
||||
affected.owner.custom_pain("You feel something rip in your [affected.display_name]!", 1)
|
||||
user.drop_item()
|
||||
affected.hidden = tool
|
||||
tool.loc = target
|
||||
affected.cavity = 0
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \
|
||||
"\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!")
|
||||
affected.createwound(CUT, 20)
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// IMPLANT/ITEM REMOVAL SURGERY //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/cavity/implant_removal
|
||||
required_tool = /obj/item/weapon/hemostat
|
||||
allowed_tools = list(/obj/item/weapon/wirecutters, /obj/item/weapon/kitchen/utensil/fork)
|
||||
|
||||
min_duration = 80
|
||||
max_duration = 100
|
||||
|
||||
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts poking around inside the incision on [target]'s [affected.display_name] with \the [tool].", \
|
||||
"You start poking around inside the incision on [target]'s [affected.display_name] with \the [tool]" )
|
||||
target.custom_pain("The pain in your chest is living hell!",1)
|
||||
..()
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
|
||||
var/find_prob = 0
|
||||
if (affected.implants.len)
|
||||
var/obj/item/weapon/implant/imp = affected.implants[1]
|
||||
if (imp.islegal())
|
||||
find_prob +=60
|
||||
else
|
||||
find_prob +=40
|
||||
if (isright(tool))
|
||||
find_prob +=20
|
||||
if (prob(find_prob))
|
||||
user.visible_message("\blue [user] takes something out of incision on [target]'s [affected.display_name] with \the [tool].", \
|
||||
"\blue You take something out of incision on [target]'s [affected.display_name]s with \the [tool]." )
|
||||
affected.implants -= imp
|
||||
imp.loc = get_turf(target)
|
||||
imp.imp_in = null
|
||||
imp.implanted = 0
|
||||
else if (affected.hidden)
|
||||
user.visible_message("\blue [user] takes something out of incision on [target]'s [affected.display_name] with \the [tool].", \
|
||||
"\blue You take something out of incision on [target]'s [affected.display_name]s with \the [tool]." )
|
||||
affected.hidden.loc = get_turf(target)
|
||||
if(!affected.hidden.blood_DNA)
|
||||
affected.hidden.blood_DNA = list()
|
||||
affected.hidden.blood_DNA[target.dna.unique_enzymes] = target.dna.b_type
|
||||
affected.hidden.update_icon()
|
||||
affected.hidden = null
|
||||
|
||||
else
|
||||
user.visible_message("\blue [user] could not find anything inside [target]'s [affected.display_name], and pulls \the [tool] out.", \
|
||||
"\blue You could not find anything inside [target]'s [affected.display_name]." )
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \
|
||||
"\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!")
|
||||
affected.createwound(CUT, 20)
|
||||
if (affected.implants.len)
|
||||
var/fail_prob = 10
|
||||
if (!isright(tool))
|
||||
fail_prob += 30
|
||||
if (prob(fail_prob))
|
||||
var/obj/item/weapon/implant/imp = affected.implants[1]
|
||||
user.visible_message("\red Something beeps inside [target]'s [affected.display_name]!")
|
||||
playsound(imp.loc, 'sound/items/countdown.ogg', 75, 1, -3)
|
||||
spawn(25)
|
||||
imp.activate()
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
|
||||
/datum/surgery_step/fix_vein
|
||||
priority = 2
|
||||
required_tool = /obj/item/weapon/FixOVein
|
||||
allowed_tools = list(/obj/item/weapon/cable_coil)
|
||||
can_infect = 1
|
||||
@@ -45,120 +46,3 @@
|
||||
user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!" , \
|
||||
"\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!")
|
||||
affected.take_damage(5, 0)
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// IMPLANT REMOVAL SURGERY //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/implant_removal
|
||||
required_tool = /obj/item/weapon/hemostat
|
||||
allowed_tools = list(/obj/item/weapon/wirecutters, /obj/item/weapon/kitchen/utensil/fork)
|
||||
|
||||
min_duration = 80
|
||||
max_duration = 100
|
||||
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected.open == 2 && !(affected.status & ORGAN_BLEEDING)
|
||||
|
||||
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts poking around inside the incision on [target]'s [affected.display_name] with \the [tool].", \
|
||||
"You start poking around inside the incision on [target]'s [affected.display_name] with \the [tool]" )
|
||||
target.custom_pain("The pain in your chest is living hell!",1)
|
||||
..()
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
|
||||
var/find_prob = 0
|
||||
if (affected.implants.len)
|
||||
var/obj/item/weapon/implant/imp = affected.implants[1]
|
||||
if (imp.islegal())
|
||||
find_prob +=60
|
||||
else
|
||||
find_prob +=40
|
||||
if (isright(tool))
|
||||
find_prob +=20
|
||||
if (prob(find_prob))
|
||||
user.visible_message("\blue [user] takes something out of incision on [target]'s [affected.display_name] with \the [tool].", \
|
||||
"\blue You take something out of incision on [target]'s [affected.display_name]s with \the [tool]." )
|
||||
affected.implants -= imp
|
||||
imp.loc = get_turf(target)
|
||||
imp.imp_in = null
|
||||
imp.implanted = 0
|
||||
else if (affected.hidden)
|
||||
user.visible_message("\blue [user] takes something out of incision on [target]'s [affected.display_name] with \the [tool].", \
|
||||
"\blue You take something out of incision on [target]'s [affected.display_name]s with \the [tool]." )
|
||||
affected.hidden.loc = get_turf(target)
|
||||
if(!affected.hidden.blood_DNA)
|
||||
affected.hidden.blood_DNA = list()
|
||||
affected.hidden.blood_DNA[target.dna.unique_enzymes] = target.dna.b_type
|
||||
affected.hidden.update_icon()
|
||||
affected.hidden = null
|
||||
|
||||
else
|
||||
user.visible_message("\blue [user] could not find anything inside [target]'s [affected.display_name], and pulls \the [tool] out.", \
|
||||
"\blue You could not find anything inside [target]'s [affected.display_name]." )
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \
|
||||
"\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!")
|
||||
affected.createwound(CUT, 20)
|
||||
if (affected.implants.len)
|
||||
var/fail_prob = 10
|
||||
if (!isright(tool))
|
||||
fail_prob += 30
|
||||
if (prob(fail_prob))
|
||||
var/obj/item/weapon/implant/imp = affected.implants[1]
|
||||
user.visible_message("\red Something beeps inside [target]'s [affected.display_name]!")
|
||||
playsound(imp.loc, 'sound/items/countdown.ogg', 75, 1, -3)
|
||||
spawn(25)
|
||||
imp.activate()
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// ITEM PLACEMENT SURGERY //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/item_place
|
||||
required_tool = /obj/item
|
||||
|
||||
min_duration = 80
|
||||
max_duration = 100
|
||||
var/max_size = 2 //maximum w_class of item that fits.
|
||||
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
if (affected.name in list("chest","groin","head"))
|
||||
max_size = 3
|
||||
else
|
||||
max_size = 2
|
||||
return affected.open == 2 && !(affected.status & ORGAN_BLEEDING) && tool.w_class <= max_size && !affected.hidden
|
||||
|
||||
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts putting [tool] inside the incision on [target]'s [affected.display_name].", \
|
||||
"You start putting [tool] inside the incision on [target]'s [affected.display_name]." )
|
||||
target.custom_pain("The pain in your chest is living hell!",1)
|
||||
..()
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
|
||||
user.visible_message("\blue [user] puts [tool] inside [target]'s [affected.display_name].", \
|
||||
"\blue You put [tool] inside [target]'s [affected.display_name]." )
|
||||
if (tool.w_class > max_size/2 && prob(50))
|
||||
user << "\red You tear some vessels trying to fit such big object in this cavity."
|
||||
var/datum/wound/internal_bleeding/I = new (15)
|
||||
affected.wounds += I
|
||||
affected.owner.custom_pain("You feel something rip in your [affected.display_name]!", 1)
|
||||
user.drop_item()
|
||||
affected.hidden = tool
|
||||
tool.loc = target
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \
|
||||
"\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!")
|
||||
affected.createwound(CUT, 20)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// GENERIC RIBCAGE SURGERY //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
/datum/surgery_step/ribcage
|
||||
priority = 2
|
||||
can_infect = 1
|
||||
blood_level = 1
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
@@ -195,4 +196,4 @@
|
||||
var/datum/organ/external/chest/affected = target.get_organ("chest")
|
||||
user.visible_message("\red [user]'s hand slips, slicing an artery inside [target]'s chest with \the [tool]!", \
|
||||
"\red Your hand slips, slicing an artery inside [target]'s chest with \the [tool]!")
|
||||
affected.createwound(CUT, 20)
|
||||
affected.createwound(CUT, 20)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SURGERY STEPS */
|
||||
|
||||
/datum/surgery_step
|
||||
var/priority = 0 //steps with higher priority would be attempted first
|
||||
// type path referencing the required tool for this step
|
||||
var/required_tool = null
|
||||
|
||||
@@ -78,6 +79,22 @@ proc/do_surgery(mob/living/M, mob/living/user, obj/item/tool)
|
||||
return 1 //don't want to do weapony things after surgery
|
||||
return 0
|
||||
|
||||
proc/sort_surgeries()
|
||||
var/gap = surgery_steps.len
|
||||
var/swapped = 1
|
||||
while (gap > 1 || swapped)
|
||||
swapped = 0
|
||||
if(gap > 1)
|
||||
gap = round(gap / 1.247330950103979)
|
||||
if(gap < 1)
|
||||
gap = 1
|
||||
for(var/i = 1; gap + i <= surgery_steps.len; i++)
|
||||
var/datum/surgery_step/l = surgery_steps[i] //Fucking hate
|
||||
var/datum/surgery_step/r = surgery_steps[gap+i] //how lists work here
|
||||
if(l.priority < r.priority)
|
||||
surgery_steps.Swap(i, gap + i)
|
||||
swapped = 1
|
||||
|
||||
/datum/surgery_status/
|
||||
var/eyes = 0
|
||||
var/face = 0
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
#define HUNGER_FACTOR 0.05
|
||||
|
||||
// How many units of reagent are consumed per tick, by default.
|
||||
#define REAGENTS_METABOLISM 0.4
|
||||
#define REAGENTS_METABOLISM 0.2
|
||||
|
||||
// By defining the effect multiplier this way, it'll exactly adjust
|
||||
// all effects according to how they originally were with the 0.4 metabolism
|
||||
@@ -580,6 +580,7 @@ var/list/TAGGERLOCATIONS = list("Disposals",
|
||||
#define ORGAN_ROBOT 128
|
||||
#define ORGAN_SPLINTED 256
|
||||
#define SALVED 512
|
||||
#define ORGAN_DEAD 1024
|
||||
|
||||
#define ROUNDSTART_LOGOUT_REPORT_TIME 6000 //Amount of time (in deciseconds) after the rounds starts, that the player disconnect report is issued.
|
||||
|
||||
|
||||
@@ -58,6 +58,55 @@ Stuff which is in development and not yet visible to players or just code relate
|
||||
should be listed in the changelog upon commit though. Thanks. -->
|
||||
|
||||
<!-- To take advantage of the pretty new format (well it was new when I wrote this anyway), open the "add-to-changelog.html" file in any browser and add the stuff and then generate the html code and paste it here -->
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">February 25th 2013</h2>
|
||||
<h3 class="author">Cael Aislinn updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class="rscadd">As well as building hull shield generators, normal shield gens can now be built (see <a href="http://baystation12.net/forums/viewtopic.php?f=1&t=6993">http://baystation12.net/forums/viewtopic.php?f=1&t=6993</a>).</li>
|
||||
<li class="rscadd">New random events: multiple new system wide-events have been have been added to the newscaster feeds, some not quite as respectable as others.</li>
|
||||
<li class="rscadd">New random event: some lucky winners will win the TC Daily Grand Slam Lotto, while others may be the target of malicious hackers.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">February 23rd 2013</h2>
|
||||
<h3 class="author">Cael Aislinn updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class="rscadd">Finances! Players spawn with an account, and money can be transferred between accounts, withdrawn/deposited at ATMs and charged to accounts via EFTPOS scanners.<br><br>
|
||||
All players start with 500-5000 credits, credits can no longer be merged and only credits can be deposited into ATMs - so shelter your illegitimately gotten gains in physical assets and remember that fraud is frowned upon!</li>
|
||||
<li class="rscadd">Turrets are no longer noiseless as the grave. Listen for the sound of machinery in their proximity.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">22/02/2013</h2>
|
||||
<h3 class="author">Chinsky updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class="tweak">Change to body cavity surgery. Can only put items in chest, groind and head. Max size for item - 3 (chest), 2 (groin), 1 (head). For chest surgery ribs should be bent open, (lung surgery until second scalpel step). Surgery step needs preparation step, with drill. After that you can place item inside, or seal it with cautery to do other step instead.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">February 23rd 2013</h2>
|
||||
<h3 class="author">Cael Aislinn updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class="wip">RUST machinery components should now be researchable (with high requirements) and orderable through QM (with high cost).</li>
|
||||
<li class="wip">Shield machinery should now be researchable (with high requirements) and orderable through QM (with high cost). This one is reportedly buggy.</li>
|
||||
<li class="tweak">Rogue vending machines should revert back to normal at the end of the event.</li>
|
||||
<li class="rscadd">New Unathi hair styles.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">February 18th 2013</h2>
|
||||
<h3 class="author">Cael Aislinn updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class="rscadd">All RUST components are now buildable/orderable, with very high requirements (except for the TEGs). Emitters have replaced gyrotrons, for now.</li>
|
||||
<li class="rscadd">Fixed up shield generators and made them buildable, with circuits obtainable through RnD. Hull shield gens project along space tiles adjacent to the hull (must be adjacent to a space tile to work).</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">20/02/2013</h2>
|
||||
<h3 class="author">Chinsky updated:</h3>
|
||||
@@ -77,6 +126,8 @@ should be listed in the changelog upon commit though. Thanks. -->
|
||||
<h3 class="author">Cael Aislinn updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class="rscadd">Security bots will now target hostile mobs, and vice versa.</li>
|
||||
<li class="tweak">Carp should actually emigrate now, instead of just immigrating then squatting around the outer hull.</li>
|
||||
<li class="tweak">Admins and moderators have been split up into separate 'who' verbs (adminwho and modwho respectively).</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 181 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |