Merge branch 'bleeding-edge-freeze' of https://github.com/Baystation12/Baystation12 into guntest

Conflicts:
	code/WorkInProgress/Cib/amorph/amorph_hud.dm
	code/game/objects/structures/window.dm
	code/modules/mob/living/blob/blob.dm
	code/modules/mob/living/simple_animal/friendly/corgi.dm
	code/modules/mob/mob_defines.dm
	code/modules/mob/screen.dm
	code/modules/projectiles/gun.dm
	code/modules/projectiles/guns/projectile/automatic.dm
	maps/tgstation.2.0.9.1.dmm
This commit is contained in:
Whitellama
2013-01-31 14:26:58 -08:00
1200 changed files with 106969 additions and 76361 deletions
@@ -0,0 +1,298 @@
var/global/current_date_string
var/global/num_financial_terminals = 1
var/global/datum/money_account/station_account
var/global/next_account_number = 0
/proc/create_station_account()
if(!station_account)
next_account_number = rand(111111, 999999)
station_account = new()
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
//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.date = "2nd April, 2555"
T.time = "11:24"
T.source_terminal = "Biesel GalaxyNet Terminal #277"
//add the account
station_account.transaction_log.Add(T)
for(var/obj/machinery/account_database/A in world)
A.accounts.Add(station_account)
//the current ingame time (hh:mm) can be obtained by calling:
//worldtime2text()
/datum/money_account
var/owner_name = ""
var/account_number = 0
var/remote_access_pin = 0
var/money = 0
var/list/transaction_log = list()
var/security_level = 1 //0 - auto-identify from worn ID, require only account number
//1 - require manual login / account number and pin
//2 - require card and manual login
/datum/transaction
var/target_name = ""
var/purpose = ""
var/amount = 0
var/date = ""
var/time = ""
var/source_terminal = ""
/obj/machinery/account_database
name = "Accounts database"
desc = "Holds transaction logs, account data and all kinds of other financial records."
icon = 'virology.dmi'
icon_state = "analyser"
density = 1
var/list/accounts = list()
req_one_access = list(access_hop, access_captain)
var/receipt_num
var/machine_id = ""
var/obj/item/weapon/card/id/held_card
var/access_level = 0
var/datum/money_account/detailed_account_view
var/creating_new_account = 0
/obj/machinery/account_database/New()
..()
if(!station_account)
create_station_account()
if(!current_date_string)
current_date_string = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], 2557"
machine_id = "[station_name()] Acc. DB #[num_financial_terminals++]"
/obj/machinery/account_database/attack_hand(mob/user as mob)
if(get_dist(src,user) <= 1)
var/dat = "<b>Accounts Database</b><br>"
dat += "<i>[machine_id]</i><br>"
dat += "Confirm identity: <a href='?src=\ref[src];choice=insert_card'>[held_card ? held_card : "-----"]</a><br>"
if(access_level > 0)
dat += "You may not edit accounts at this terminal, only create and view them.<br>"
if(creating_new_account)
dat += "<br>"
dat += "<a href='?src=\ref[src];choice=view_accounts_list;'>Return to accounts list</a>"
dat += "<form name='create_account' action='?src=\ref[src]' method='get'>"
dat += "<input type='hidden' name='src' value='\ref[src]'>"
dat += "<input type='hidden' name='choice' value='finalise_create_account'>"
dat += "<b>Holder name:</b> <input type='text' id='holder_name' name='holder_name' style='width:250px; background-color:white;'><br>"
dat += "<b>Initial funds:</b> <input type='text' id='starting_funds' name='starting_funds' style='width:250px; background-color:white;'> (subtracted from station account)<br>"
dat += "<i>New accounts are automatically assigned a secret number and pin, which are printed separately in a sealed package.</i><br>"
dat += "<input type='submit' value='Create'><br>"
dat += "</form>"
else
if(detailed_account_view)
dat += "<br>"
dat += "<a href='?src=\ref[src];choice=view_accounts_list;'>Return to accounts list</a><hr>"
dat += "<b>Account number:</b> #[detailed_account_view.account_number]<br>"
dat += "<b>Account holder:</b> [detailed_account_view.owner_name]<br>"
dat += "<b>Account balance:</b> $[detailed_account_view.money]<br>"
dat += "<table border=1 style='width:100%'>"
dat += "<tr>"
dat += "<td><b>Date</b></td>"
dat += "<td><b>Time</b></td>"
dat += "<td><b>Target</b></td>"
dat += "<td><b>Purpose</b></td>"
dat += "<td><b>Value</b></td>"
dat += "<td><b>Source terminal ID</b></td>"
dat += "</tr>"
for(var/datum/transaction/T in detailed_account_view.transaction_log)
dat += "<tr>"
dat += "<td>[T.date]</td>"
dat += "<td>[T.time]</td>"
dat += "<td>[T.target_name]</td>"
dat += "<td>[T.purpose]</td>"
dat += "<td>$[T.amount]</td>"
dat += "<td>[T.source_terminal]</td>"
dat += "</tr>"
dat += "</table>"
else
dat += "<a href='?src=\ref[src];choice=create_account;'>Create new account</a> <a href='?src=\ref[src];choice=sync_accounts;'>Sync accounts across databases</a><br><br>"
dat += "<table border=1 style='width:100%'>"
for(var/i=1, i<=accounts.len, i++)
var/datum/money_account/D = accounts[i]
dat += "<tr>"
dat += "<td>#[D.account_number]</td>"
dat += "<td>[D.owner_name]</td>"
dat += "<td><a href='?src=\ref[src];choice=view_account_detail;account_index=[i]'>View in detail</a></td>"
dat += "</tr>"
dat += "</table>"
user << browse(dat,"window=account_db;size=700x650")
else
user << browse(null,"window=account_db")
/obj/machinery/account_database/attackby(O as obj, user as mob)//TODO:SANITY
if(istype(O, /obj/item/weapon/card))
var/obj/item/weapon/card/id/idcard = O
if(!held_card)
usr.drop_item()
idcard.loc = src
held_card = idcard
if(access_cent_captain in idcard.access)
access_level = 2
else if(access_hop in idcard.access || access_captain in idcard.access)
access_level = 1
else
..()
/obj/machinery/account_database/Topic(var/href, var/href_list)
if(href_list["choice"])
switch(href_list["choice"])
if("sync_accounts")
for(var/obj/machinery/account_database/A in world)
for(var/datum/money_account/M in src.accounts)
if(!A.accounts.Find(M))
A.accounts.Add(M)
usr << "\icon[src] <span class='info'>Accounts synched across all databases in range.</span>"
if("create_account")
creating_new_account = 1
if("finalise_create_account")
var/account_name = href_list["holder_name"]
var/starting_funds = max(text2num(href_list["starting_funds"]), 0)
add_account(account_name, starting_funds)
if(starting_funds > 0)
//subtract the money
station_account.money -= starting_funds
//create a transaction log entry
var/datum/transaction/T = new()
T.target_name = account_name
T.purpose = "New account funds initialisation"
T.amount = "([starting_funds])"
T.date = current_date_string
T.time = worldtime2text()
T.source_terminal = machine_id
station_account.transaction_log.Add(T)
creating_new_account = 0
if("insert_card")
if(held_card)
held_card.loc = src.loc
if(ishuman(usr) && !usr.get_active_hand())
usr.put_in_hands(held_card)
held_card = null
access_level = 0
else
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
usr.drop_item()
C.loc = src
held_card = C
if(access_cent_captain in C.access)
access_level = 2
else if(access_hop in C.access || access_captain in C.access)
access_level = 1
if("view_account_detail")
var/index = text2num(href_list["account_index"])
if(index && index <= accounts.len)
detailed_account_view = accounts[index]
if("view_accounts_list")
detailed_account_view = null
creating_new_account = 0
src.attack_hand(usr)
/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
var/datum/money_account/M = new()
M.owner_name = new_owner_name
M.remote_access_pin = rand(1111, 111111)
M.money = starting_funds
//create an entry in the account transaction log for when it was created
var/datum/transaction/T = new()
T.target_name = new_owner_name
T.purpose = "Account creation"
T.amount = starting_funds
if(pre_existing)
//set a random date, time and location some time over the past few decades
T.date = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], 25[rand(10,56)]"
T.time = "[rand(0,24)]:[rand(11,59)]"
T.source_terminal = "NTGalaxyNet Terminal #[rand(111,1111)]"
M.account_number = rand(111111, 999999)
else
T.date = current_date_string
T.time = worldtime2text()
T.source_terminal = machine_id
M.account_number = next_account_number
next_account_number += rand(1,25)
//create a sealed package containing the account details
var/obj/item/smallDelivery/P = new(src.loc)
var/obj/item/weapon/paper/R = new(P)
P.wrapped = R
R.name = "Account information: [M.owner_name]"
R.info = "<b>Account details (confidential)</b><br><hr><br>"
R.info += "<i>Account holder:</i> [M.owner_name]<br>"
R.info += "<i>Account number:</i> [M.account_number]<br>"
R.info += "<i>Account pin:</i> [M.remote_access_pin]<br>"
R.info += "<i>Starting balance:</i> $[M.money]<br>"
R.info += "<i>Date and time:</i> [worldtime2text()], [current_date_string]<br><br>"
R.info += "<i>Creation terminal ID:</i> [machine_id]<br>"
R.info += "<i>Authorised NT officer overseeing creation:</i> [held_card.registered_name]<br>"
//stamp the paper
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
stampoverlay.icon_state = "paper_stamp-cent"
if(!R.stamped)
R.stamped = new
R.stamped += /obj/item/weapon/stamp
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)
/obj/machinery/account_database/proc/charge_to_account(var/attempt_account_number, var/source_name, var/purpose, var/terminal_id, var/amount)
for(var/datum/money_account/D in accounts)
if(D.account_number == attempt_account_number)
D.money += amount
//create a transaction log entry
var/datum/transaction/T = new()
T.target_name = source_name
T.purpose = purpose
if(amount < 0)
T.amount = "([amount])"
else
T.amount = "[amount]"
T.date = current_date_string
T.time = worldtime2text()
T.source_terminal = terminal_id
D.transaction_log.Add(T)
return 1
return 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)
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) )
return D
@@ -0,0 +1,177 @@
/obj/item/weapon/eftpos
name = "EFTPOS scanner"
desc = "Swipe your ID card to pay electronically."
icon = 'icons/obj/library.dmi'
icon_state = "scanner"
var/machine_id = ""
var/eftpos_name = "Default EFTPOS scanner"
var/transaction_locked = 0
var/transaction_paid = 0
var/transaction_amount = 0
var/transaction_purpose = "Default charge"
var/access_code = 0
var/obj/machinery/account_database/linked_db
var/datum/money_account/linked_account
/obj/item/weapon/eftpos/New()
..()
machine_id = "[station_name()] EFTPOS #[num_financial_terminals++]"
access_code = rand(1111,111111)
reconnect_database()
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))
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>"
//stamp the paper
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
stampoverlay.icon_state = "paper_stamp-cent"
if(!R.stamped)
R.stamped = new
R.stamped += /obj/item/weapon/stamp
R.overlays += stampoverlay
R.stamps += "<HR><i>This paper has been stamped by the EFTPOS device.</i>"
/obj/item/weapon/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)
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>"
if(transaction_locked)
dat += "<a href='?src=\ref[src];choice=toggle_lock'>Reset[transaction_paid ? "" : " (authentication required)"]</a><br><br>"
dat += "Transaction purpose: <b>[transaction_purpose]</b><br>"
dat += "Value: <b>$[transaction_amount]</b><br>"
dat += "Linked account: <b>[linked_account ? linked_account.owner_name : "None"]</b><hr>"
if(transaction_paid)
dat += "<i>This transaction has been processed successfully.</i><hr>"
else
dat += "<i>Swipe your card below the line to finish this transaction.</i><hr>"
dat += "<a href='?src=\ref[src];choice=scan_card'>\[------\]</a>"
else
dat += "<a href='?src=\ref[src];choice=toggle_lock'>Lock in new transaction</a><br><br>"
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>"
user << browse(dat,"window=eftpos")
else
user << browse(null,"window=eftpos")
/obj/item/weapon/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)
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)
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"))
if(attempt_code == access_code)
access_code = text2num(input("Enter a new access code for this device", "Enter new EFTPOS code"))
print_reference()
else
usr << "\icon[src]<span class='warning'>Incorrect code entered.</span>"
if("link_account")
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"))
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>"
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)
if("toggle_lock")
if(transaction_locked)
var/attempt_code = text2num(input("Enter EFTPOS access code", "Reset Transaction"))
if(attempt_code == access_code)
transaction_locked = 0
transaction_paid = 0
else if(linked_account)
transaction_locked = 1
else
usr << "\icon[src] <span class='warning'>No account connected to send transactions to.</span>"
if("scan_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/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card))
scan_card(I)
else
usr << "\icon[src]<span class='warning'>Unable to link accounts.</span>"
src.attack_self(usr)
/obj/item/weapon/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/datum/money_account/D = linked_db.attempt_account_access(C.associated_account_number, attempt_pin, 2)
if(D)
if(transaction_amount <= D.money)
playsound(src, 'chime.ogg', 50, 1)
src.visible_message("\icon[src] The [src] chimes.")
transaction_paid = 1
//transfer the money
D.money -= transaction_amount
linked_account.money += transaction_amount
//create entries in the two account transaction logs
var/datum/transaction/T = new()
T.target_name = "[linked_account.owner_name] ([eftpos_name])"
T.purpose = transaction_purpose
T.amount = "([transaction_amount])"
T.source_terminal = machine_id
T.date = current_date_string
T.time = worldtime2text()
D.transaction_log.Add(T)
//
T = new()
T.target_name = D.owner_name
T.purpose = transaction_purpose
T.amount = "[transaction_amount]"
T.source_terminal = machine_id
T.date = current_date_string
T.time = worldtime2text()
linked_account.transaction_log.Add(T)
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>"
else
usr << "\icon[src]<span class='warning'>Unable to access account. Check security settings and try again.</span>"
else
..()
//emag?
@@ -0,0 +1,63 @@
#define RIOTS 1
#define WILD_ANIMAL_ATTACK 2
#define INDUSTRIAL_ACCIDENT 3
#define BIOHAZARD_OUTBREAK 4
#define WARSHIPS_ARRIVE 5
#define PIRATES 6
#define CORPORATE_ATTACK 7
#define ALIEN_RAIDERS 8
#define AI_LIBERATION 9
#define MOURNING 10
#define CULT_CELL_REVEALED 11
#define SECURITY_BREACH 12
#define ANIMAL_RIGHTS_RAID 13
#define FESTIVAL 14
#define DEFAULT 1
#define ADMINISTRATIVE 2
#define CLOTHING 3
#define SECURITY 4
#define SPECIAL_SECURITY 5
#define FOOD 6
#define ANIMALS 7
#define MINERALS 8
#define EMERGENCY 9
#define GAS 10
#define MAINTENANCE 11
#define ELECTRICAL 12
#define ROBOTICS 13
#define BIOMEDICAL 14
#define EVA 15
//---- The following corporations are friendly with NanoTrasen and loosely enable trade and travel:
//Corporation NanoTrasen - Generalised / high tech research and plasma exploitation.
//Corporation Vessel Contracting - Ship and station construction, materials research.
//Corporation Osiris Atmospherics - Atmospherics machinery construction and chemical research.
//Corporation Second Red Cross Society - 26th century Red Cross reborn as a dominating economic force in biomedical science (research and materials).
//Corporation Blue Industries - High tech and high energy research, in particular into the mysteries of bluespace manipulation and power generation.
//Corporation Kusanagi Robotics - Founded by robotics legend Kaito Kusanagi in the 2070s, they have been on the forefront of mechanical augmentation and robotics development ever since.
//Corporation Free traders - Not so much a corporation as a loose coalition of spacers, Free Traders are a roving band of smugglers, traders and fringe elements following a rigid (if informal) code of loyalty and honour. Mistrusted by most corporations, they are tolerated because of their uncanny ability to smell out a profit.
//---- Descriptions of destination types
//Space stations can be purpose built for a number of different things, but generally require regular shipments of essential supplies.
//Corvettes are small, fast warships generally assigned to border patrol or chasing down smugglers.
//Battleships are large, heavy cruisers designed for slugging it out with other heavies or razing planets.
//Yachts are fast civilian craft, often used for pleasure or smuggling.
//Destroyers are medium sized vessels, often used for escorting larger ships but able to go toe-to-toe with them if need be.
//Frigates are medium sized vessels, often used for escorting larger ships. They will rapidly find themselves outclassed if forced to face heavy warships head on.
var/setup_economy = 0
/proc/setup_economy()
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
@@ -0,0 +1,102 @@
/datum/event/economic_event
endWhen = 50 //this will be set randomly, later
announceWhen = 15
var/event_type = 0
var/list/cheaper_goods = list()
var/list/dearer_goods = list()
var/datum/trade_destination/affected_dest
/datum/event/economic_event/start()
if(!setup_economy)
setup_economy()
var/type = pick(tradeable_destinations)
affected_dest = new type()
if(affected_dest.viable_random_events.len)
endWhen = rand(60,300)
event_type = pick(affected_dest.viable_random_events)
switch(event_type)
if(RIOTS)
dearer_goods = list(SECURITY)
cheaper_goods = list(MINERALS, FOOD)
if(WILD_ANIMAL_ATTACK)
cheaper_goods = list(ANIMALS)
dearer_goods = list(FOOD, BIOMEDICAL)
if(INDUSTRIAL_ACCIDENT)
dearer_goods = list(EMERGENCY, BIOMEDICAL, ROBOTICS)
if(BIOHAZARD_OUTBREAK)
dearer_goods = list(BIOMEDICAL, GAS)
if(PIRATES)
dearer_goods = list(SECURITY, MINERALS)
if(CORPORATE_ATTACK)
dearer_goods = list(SECURITY, MAINTENANCE)
if(ALIEN_RAIDERS)
dearer_goods = list(BIOMEDICAL, ANIMALS)
cheaper_goods = list(GAS, MINERALS)
if(AI_LIBERATION)
dearer_goods = list(EMERGENCY, GAS, MAINTENANCE)
if(MOURNING)
cheaper_goods = list(MINERALS, MAINTENANCE)
if(CULT_CELL_REVEALED)
dearer_goods = list(SECURITY, BIOMEDICAL, MAINTENANCE)
if(SECURITY_BREACH)
dearer_goods = list(SECURITY)
if(ANIMAL_RIGHTS_RAID)
dearer_goods = list(ANIMALS)
if(FESTIVAL)
dearer_goods = list(FOOD, ANIMALS)
for(var/good_type in dearer_goods)
affected_dest.temp_price_change[good_type] = rand(1,100)
for(var/good_type in cheaper_goods)
affected_dest.temp_price_change[good_type] = rand(1,100) / 100
/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.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\'","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 delcared 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")
FC.messages += newMsg
break
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
NEWSCASTER.newsAlert("Tau Ceti Daily")
/datum/event/economic_event/end()
for(var/good_type in dearer_goods)
affected_dest.temp_price_change[good_type] = 1
for(var/good_type in cheaper_goods)
affected_dest.temp_price_change[good_type] = 1
@@ -0,0 +1,85 @@
/datum/trade_destination
var/name = ""
var/description = ""
var/distance = 0
var/list/willing_to_buy = list()
var/list/willing_to_sell = list()
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]
//distance is measured in AU and co-relates to travel time
/datum/trade_destination/centcomm
name = "CentComm"
description = "NanoTrasen's administrative centre for Tau Ceti."
distance = 1.2
willing_to_buy = list()
willing_to_sell = list()
viable_random_events = list(SECURITY_BREACH, CORPORATE_ATTACK, AI_LIBERATION)
/datum/trade_destination/anansi
name = "NSS Anansi"
description = "Medical station ran by Second Red Cross (but owned by NT) for handling emergency cases from nearby colonies."
distance = 1.7
willing_to_buy = list()
willing_to_sell = list()
viable_random_events = list(SECURITY_BREACH, CULT_CELL_REVEALED, BIOHAZARD_OUTBREAK, PIRATES, ALIEN_RAIDERS)
/datum/trade_destination/icarus
name = "NMV Icarus"
description = "Corvette assigned to patrol NSS Exodus local space."
distance = 0.1
willing_to_buy = list()
willing_to_sell = list()
viable_random_events = list(SECURITY_BREACH, AI_LIBERATION, PIRATES)
/datum/trade_destination/redolant
name = "OAV Redolant"
description = "Osiris Atmospherics station in orbit around the only gas giant insystem. They retain tight control over shipping rights, and Osiris warships protecting their prize are not an uncommon sight in Tau Ceti."
distance = 0.6
willing_to_buy = list()
willing_to_sell = list()
viable_random_events = list(INDUSTRIAL_ACCIDENT, PIRATES, CORPORATE_ATTACK)
/datum/trade_destination/beltway
name = "Beltway mining chain"
description = "A co-operative effort between Beltway and NanoTrasen to exploit the rich outer asteroid belt of the Tau Ceti system."
distance = 7.5
willing_to_buy = list()
willing_to_sell = list()
viable_random_events = list(PIRATES, INDUSTRIAL_ACCIDENT)
/datum/trade_destination/biesel
name = "Biesel"
description = "Large ship yards, strong economy and a stable, well-educated populace, Biesel largely owes allegiance to Sol / Vessel Contracting and begrudgingly tolerates NT. Capital is Lowell City."
distance = 2.3
willing_to_buy = list()
willing_to_sell = list()
viable_random_events = list(RIOTS, INDUSTRIAL_ACCIDENT, BIOHAZARD_OUTBREAK, CULT_CELL_REVEALED, FESTIVAL, MOURNING)
/datum/trade_destination/new_gibson
name = "New Gibson"
description = "Heavily industrialised rocky planet containing the majority of the planet-bound resources in the system, New Gibson is torn by unrest and has very little wealth to call it's own except in the hands of the corporations who jostle with NT for control."
distance = 6.6
willing_to_buy = list()
willing_to_sell = list()
viable_random_events = list(RIOTS, INDUSTRIAL_ACCIDENT, BIOHAZARD_OUTBREAK, CULT_CELL_REVEALED, FESTIVAL, MOURNING)
/datum/trade_destination/luthien
name = "Luthien"
description = "A small colony established on a feral, untamed world (largely jungle). Savages and wild beasts attack the outpost regularly, although NT maintains tight military control."
distance = 8.9
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)
/datum/trade_destination/reade
name = "Reade"
description = "A cold, metal-deficient world, NT maintains large pastures in whatever available space in an attempt to salvage something from this profitless colony."
distance = 7.5
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
@@ -0,0 +1,59 @@
//simplified copy of /obj/structure/falsewall
/obj/effect/landmark/falsewall_spawner
name = "falsewall spawner"
/obj/structure/temple_falsewall
name = "wall"
anchored = 1
icon = 'icons/turf/walls.dmi'
icon_state = "plasma0"
opacity = 1
var/closed_wall_dir = 0
var/opening = 0
var/mineral = "plasma"
var/is_metal = 0
/obj/structure/temple_falsewall/New()
..()
spawn(10)
if(prob(95))
desc = pick("Something seems slightly off about it.","")
var/junction = 0 //will be used to determine from which side the wall is connected to other walls
for(var/turf/unsimulated/wall/W in orange(src,1))
if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
junction |= get_dir(src,W)
closed_wall_dir = junction
density = 1
icon_state = "[mineral][closed_wall_dir]"
/obj/structure/temple_falsewall/attack_hand(mob/user as mob)
if(opening)
return
if(density)
opening = 1
if(is_metal)
icon_state = "metalfwall_open"
flick("metalfwall_opening", src)
else
icon_state = "[mineral]fwall_open"
flick("[mineral]fwall_opening", src)
sleep(15)
src.density = 0
SetOpacity(0)
opening = 0
else
opening = 1
icon_state = "[mineral][closed_wall_dir]"
if(is_metal)
flick("metalfwall_closing", src)
else
flick("[mineral]fwall_closing", src)
density = 1
sleep(15)
SetOpacity(1)
opening = 0
@@ -0,0 +1,347 @@
//some testin stuff
#define PATH_SPREAD_CHANCE_START 90
#define PATH_SPREAD_CHANCE_LOSS_UPPER 80
#define PATH_SPREAD_CHANCE_LOSS_LOWER 50
#define RIVER_SPREAD_CHANCE_START 100
#define RIVER_SPREAD_CHANCE_LOSS_UPPER 65
#define RIVER_SPREAD_CHANCE_LOSS_LOWER 50
#define RANDOM_UPPER_X 100
#define RANDOM_UPPER_Y 100
#define RANDOM_LOWER_X 18
#define RANDOM_LOWER_Y 18
/area/jungle
name = "jungle"
icon = 'code/workinprogress/cael_aislinn/jungle/jungle.dmi'
icon_state = "area"
lighting_use_dynamic = 0
luminosity = 1
//randomly spawns, will create paths around the map
/obj/effect/landmark/path_waypoint
name = "path waypoint"
icon_state = "x2"
var/connected = 0
/obj/effect/landmark/temple
name = "temple entrance"
icon_state = "x2"
var/obj/structure/ladder/my_ladder
New()
//pick a random temple to link to
var/list/waypoints = list()
for(var/obj/effect/landmark/temple/destination/T in world)
waypoints.Add(T)
var/obj/effect/landmark/temple/destination/dest_temple = pick(waypoints)
dest_temple.init()
//connect this landmark to the other
my_ladder = new /obj/structure/ladder(src.loc)
my_ladder.id = dest_temple.my_ladder.id
dest_temple.my_ladder.up = my_ladder
//delete the landmarks now that we're finished
del(dest_temple)
del(src)
/obj/effect/landmark/temple/destination/New()
//nothing
/obj/effect/landmark/temple/destination/proc/init()
my_ladder = new /obj/structure/ladder(src.loc)
my_ladder.id = rand(999)
my_ladder.height = -1
//loop over the walls in the temple and make them a random pre-chosen mineral (null is a stand in for plasma, which the walls already are)
//treat plasma slightly differently because it's the default wall type
var/mineral = pick("uranium","sandstone","gold","iron","silver","diamond","clown","plasma")
//world << "init [mineral]"
var/area/my_area = get_area(src)
var/list/temple_turfs = get_area_turfs(my_area.type)
for(var/turf/simulated/floor/T in temple_turfs)
for(var/obj/effect/landmark/falsewall_spawner/F in T.contents)
var/obj/structure/temple_falsewall/fwall = new(F.loc)
fwall.mineral = mineral
if(mineral == "iron")
fwall.is_metal = 1
del(F)
for(var/obj/effect/landmark/door_spawner/D in T.contents)
var/spawn_type
if(mineral == "iron")
spawn_type = text2path("/obj/machinery/door/airlock/vault")
else
spawn_type = text2path("/obj/machinery/door/airlock/[mineral]")
new spawn_type(D.loc)
del(D)
for(var/turf/unsimulated/wall/T in temple_turfs)
if(mineral != "plasma")
T.icon_state = replacetext(T.icon_state, "plasma", mineral)
/*for(var/obj/effect/landmark/falsewall_spawner/F in T.contents)
//world << "falsewall_spawner found in wall"
var/obj/structure/temple_falsewall/fwall = new(F.loc)
fwall.mineral = mineral
del(F)
for(var/obj/effect/landmark/door_spawner/D in T.contents)
//world << "door_spawner found in wall"
T = new /turf/unsimulated/floor(T.loc)
T.icon_state = "dark"
var/spawn_type = text2path("/obj/machinery/door/airlock/[door_mineral]")
new spawn_type(T)
del(D)*/
//a shuttle has crashed somewhere on the map, it should have a power cell to let the adventurers get home
/area/jungle/crash_ship_source
icon_state = "crash"
/area/jungle/crash_ship_clean
icon_state = "crash"
/area/jungle/crash_ship_one
icon_state = "crash"
/area/jungle/crash_ship_two
icon_state = "crash"
/area/jungle/crash_ship_three
icon_state = "crash"
/area/jungle/crash_ship_four
icon_state = "crash"
//randomly spawns, will create rivers around the map
//uses the same logic as jungle paths
/obj/effect/landmark/river_waypoint
name = "river source waypoint"
var/connected = 0
/obj/machinery/jungle_controller
name = "jungle controller"
desc = "a mysterious and ancient piece of machinery"
var/list/animal_spawners = list()
New()
..()
Initialise()
/obj/machinery/jungle_controller/proc/Initialise()
set background = 1
spawn(0)
world << "\red \b Setting up jungle, this may take a moment..."
//crash dat shuttle
var/area/start_location = locate(/area/jungle/crash_ship_source)
var/area/clean_location = locate(/area/jungle/crash_ship_clean)
var/list/ship_locations = list(/area/jungle/crash_ship_one, /area/jungle/crash_ship_two, /area/jungle/crash_ship_three, /area/jungle/crash_ship_four)
var/area/end_location = locate( pick(ship_locations) )
ship_locations -= end_location.type
start_location.move_contents_to(end_location)
for(var/area_type in ship_locations)
var/area/cur_location = locate(area_type)
clean_location.copy_turfs_to(cur_location)
//drop some random river nodes
var/list/river_nodes = list()
var/max = rand(1,3)
var/num_spawned = 0
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!istype(J))
continue
if(!J.bushes_spawn)
continue
river_nodes.Add(new /obj/effect/landmark/river_waypoint(J))
num_spawned++
//make some randomly pathing rivers
for(var/obj/effect/landmark/river_waypoint/W in world)
if (W.z != src.z || W.connected)
continue
W.connected = 1
var/turf/cur_turf = new /turf/unsimulated/jungle/water(get_turf(W))
var/turf/target_turf = get_turf(pick(river_nodes))
var/detouring = 0
var/cur_dir = get_dir(cur_turf, target_turf)
//
while(cur_turf != target_turf)
//randomly snake around a bit
if(detouring)
if(prob(20))
detouring = 0
cur_dir = get_dir(cur_turf, target_turf)
else if(prob(20))
detouring = 1
if(prob(50))
cur_dir = turn(cur_dir, 45)
else
cur_dir = turn(cur_dir, -45)
else
cur_dir = get_dir(cur_turf, target_turf)
cur_turf = get_step(cur_turf, cur_dir)
var/skip = 0
if(!istype(cur_turf, /turf/unsimulated/jungle) || istype(cur_turf, /turf/unsimulated/jungle/rock))
detouring = 0
cur_dir = get_dir(cur_turf, target_turf)
cur_turf = get_step(cur_turf, cur_dir)
continue
if(!skip)
var/turf/unsimulated/jungle/water/water_turf = new(cur_turf)
water_turf.Spread(75, rand(65, 25))
var/list/path_nodes = list()
//place some ladders leading down to pre-generated temples
max = rand(2,5)
num_spawned = 0
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
continue
new /obj/effect/landmark/temple(J)
path_nodes.Add(new /obj/effect/landmark/path_waypoint(J))
num_spawned++
//put a native tribe somewhere
num_spawned = 0
while(num_spawned < 1)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
continue
new /obj/effect/jungle_tribe_spawn(J)
path_nodes.Add(new /obj/effect/landmark/path_waypoint(J))
num_spawned++
//place some random path waypoints to confuse players
max = rand(1,3)
num_spawned = 0
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
continue
path_nodes.Add(new /obj/effect/landmark/path_waypoint(J))
num_spawned++
//get any path nodes placed on the map
for(var/obj/effect/landmark/path_waypoint/W in world)
if (W.z == src.z)
path_nodes.Add(W)
//make random, connecting paths
for(var/obj/effect/landmark/path_waypoint/W in path_nodes)
if (W.connected)
continue
W.connected = 1
var/turf/cur_turf = get_turf(W)
path_nodes.Remove(W)
var/turf/target_turf = get_turf(pick(path_nodes))
path_nodes.Add(W)
//
cur_turf = new /turf/unsimulated/jungle/path(cur_turf)
var/detouring = 0
var/cur_dir = get_dir(cur_turf, target_turf)
//
while(cur_turf != target_turf)
//randomly snake around a bit
if(detouring)
if(prob(20) || get_dist(cur_turf, target_turf) < 5)
detouring = 0
cur_dir = get_dir(cur_turf, target_turf)
else if(prob(20) && get_dist(cur_turf, target_turf) > 5)
detouring = 1
if(prob(50))
cur_dir = turn(cur_dir, 45)
else
cur_dir = turn(cur_dir, -45)
else
cur_dir = get_dir(cur_turf, target_turf)
//move a step forward
cur_turf = get_step(cur_turf, cur_dir)
//if we're not a jungle turf, get back to what we were doing
if(!istype(cur_turf, /turf/unsimulated/jungle/))
cur_dir = get_dir(cur_turf, target_turf)
cur_turf = get_step(cur_turf, cur_dir)
continue
var/turf/unsimulated/jungle/J = cur_turf
if(istype(J, /turf/unsimulated/jungle/impenetrable) || istype(J, /turf/unsimulated/jungle/water/deep))
cur_dir = get_dir(cur_turf, target_turf)
cur_turf = get_step(cur_turf, cur_dir)
continue
if(!istype(J, /turf/unsimulated/jungle/water))
J = new /turf/unsimulated/jungle/path(cur_turf)
J.Spread(PATH_SPREAD_CHANCE_START, rand(PATH_SPREAD_CHANCE_LOSS_UPPER, PATH_SPREAD_CHANCE_LOSS_LOWER))
//create monkey spawners
num_spawned = 0
max = rand(3,6)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/monkey(J))
num_spawned++
//create panther spawners
num_spawned = 0
max = rand(6,12)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !istype(J) || !J.bushes_spawn)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/panther(J))
num_spawned++
//create snake spawners
num_spawned = 0
max = rand(6,12)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !istype(J) || !J.bushes_spawn)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/snake(J))
num_spawned++
//create parrot spawners
num_spawned = 0
max = rand(3,6)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !istype(J) || !J.bushes_spawn)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/parrot(J))
num_spawned++
#undef PATH_SPREAD_CHANCE_START
#undef PATH_SPREAD_CHANCE_LOSS_UPPER
#undef PATH_SPREAD_CHANCE_LOSS_LOWER
#undef RIVER_SPREAD_CHANCE_START
#undef RIVER_SPREAD_CHANCE_LOSS_UPPER
#undef RIVER_SPREAD_CHANCE_LOSS_LOWER
#undef RANDOM_UPPER_X
#undef RANDOM_UPPER_Y
#undef RANDOM_LOWER_X
#undef RANDOM_LOWER_Y
Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

@@ -0,0 +1,158 @@
//spawns one of the specified animal type
/obj/effect/landmark/animal_spawner
icon_state = "x3"
var/spawn_type
var/mob/living/spawned_animal
invisibility = 101
/obj/effect/landmark/animal_spawner/New()
if(!spawn_type)
var/new_type = pick(typesof(/obj/effect/landmark/animal_spawner) - /obj/effect/landmark/animal_spawner)
new new_type(get_turf(src))
del(src)
processing_objects.Add(src)
spawned_animal = new spawn_type(get_turf(src))
/obj/effect/landmark/animal_spawner/process()
//if any of our animals are killed, spawn new ones
if(!spawned_animal || spawned_animal.stat == DEAD)
spawned_animal = new spawn_type(src)
//after a random timeout, and in a random position (6-30 seconds)
spawn(rand(1200,2400))
spawned_animal.loc = locate(src.x + rand(-12,12), src.y + rand(-12,12), src.z)
/obj/effect/landmark/animal_spawner/Del()
processing_objects.Remove(src)
/obj/effect/landmark/animal_spawner/panther
name = "panther spawner"
spawn_type = /mob/living/simple_animal/hostile/panther
/obj/effect/landmark/animal_spawner/parrot
name = "parrot spawner"
spawn_type = /mob/living/simple_animal/parrot
/obj/effect/landmark/animal_spawner/monkey
name = "monkey spawner"
spawn_type = /mob/living/carbon/monkey
/obj/effect/landmark/animal_spawner/snake
name = "snake spawner"
spawn_type = /mob/living/simple_animal/hostile/snake
//*********//
// Panther //
//*********//
/mob/living/simple_animal/hostile/panther
name = "panther"
desc = "A long sleek, black cat with sharp teeth and claws."
icon = 'jungle.dmi'
icon_state = "panther"
icon_living = "panther"
icon_dead = "panther_dead"
icon_gib = "panther_dead"
speak_chance = 0
turns_per_move = 3
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
response_help = "pets the"
response_disarm = "gently pushes aside the"
response_harm = "hits the"
stop_automated_movement_when_pulled = 0
maxHealth = 50
health = 50
harm_intent_damage = 8
melee_damage_lower = 15
melee_damage_upper = 15
attacktext = "slashes"
attack_sound = 'sound/weapons/bite.ogg'
layer = 3.1 //so they can stay hidde under the /obj/structure/bush
var/stalk_tick_delay = 3
/mob/living/simple_animal/hostile/panther/ListTargets()
var/list/targets = list()
for(var/mob/living/carbon/human/H in view(src, 10))
targets += H
return targets
/mob/living/simple_animal/hostile/panther/FindTarget()
. = ..()
if(.)
emote("nashes at [.]")
/mob/living/simple_animal/hostile/panther/AttackingTarget()
. =..()
var/mob/living/L = .
if(istype(L))
if(prob(15))
L.Weaken(3)
L.visible_message("<span class='danger'>\the [src] knocks down \the [L]!</span>")
/mob/living/simple_animal/hostile/panther/AttackTarget()
..()
if(stance == HOSTILE_STANCE_ATTACKING && get_dist(src, target_mob))
stalk_tick_delay -= 1
if(stalk_tick_delay <= 0)
src.loc = get_step_towards(src, target_mob)
stalk_tick_delay = 3
//*******//
// Snake //
//*******//
/mob/living/simple_animal/hostile/snake
name = "snake"
desc = "A sinuously coiled, venomous looking reptile."
icon = 'jungle.dmi'
icon_state = "snake"
icon_living = "snake"
icon_dead = "snake_dead"
icon_gib = "snake_dead"
speak_chance = 0
turns_per_move = 1
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
response_help = "pets the"
response_disarm = "gently pushes aside the"
response_harm = "hits the"
stop_automated_movement_when_pulled = 0
maxHealth = 25
health = 25
harm_intent_damage = 2
melee_damage_lower = 3
melee_damage_upper = 10
attacktext = "bites"
attack_sound = 'sound/weapons/bite.ogg'
layer = 3.1 //so they can stay hidde under the /obj/structure/bush
var/stalk_tick_delay = 3
/mob/living/simple_animal/hostile/snake/ListTargets()
var/list/targets = list()
for(var/mob/living/carbon/human/H in view(src, 10))
targets += H
return targets
/mob/living/simple_animal/hostile/snake/FindTarget()
. = ..()
if(.)
emote("hisses wickedly")
/mob/living/simple_animal/hostile/snake/AttackingTarget()
. =..()
var/mob/living/L = .
if(istype(L))
L.apply_damage(rand(3,12), TOX)
/mob/living/simple_animal/hostile/snake/AttackTarget()
..()
if(stance == HOSTILE_STANCE_ATTACKING && get_dist(src, target_mob))
stalk_tick_delay -= 1
if(stalk_tick_delay <= 0)
src.loc = get_step_towards(src, target_mob)
stalk_tick_delay = 3
@@ -0,0 +1,120 @@
//*********************//
// Generic undergrowth //
//*********************//
/obj/structure/bush
name = "foliage"
desc = "Pretty thick scrub, it'll take something sharp and a lot of determination to clear away."
icon = 'jungle.dmi'
icon_state = "bush1"
density = 1
anchored = 1
layer = 3.2
var/indestructable = 0
var/stump = 0
/obj/structure/bush/New()
if(prob(20))
opacity = 1
/obj/structure/bush/Bumped(M as mob)
if (istype(M, /mob/living/simple_animal))
var/mob/living/simple_animal/A = M
A.loc = get_turf(src)
else if (istype(M, /mob/living/carbon/monkey))
var/mob/living/carbon/monkey/A = M
A.loc = get_turf(src)
/obj/structure/bush/attackby(var/obj/I as obj, var/mob/user as mob)
//hatchets can clear away undergrowth
if(istype(I, /obj/item/weapon/hatchet) && !stump)
if(indestructable)
//this bush marks the edge of the map, you can't destroy it
user << "\red You flail away at the undergrowth, but it's too thick here."
else
user.visible_message("\red <b>[user] begins clearing away [src].</b>","\red <b>You begin clearing away [src].</b>")
spawn(rand(15,30))
if(get_dist(user,src) < 2)
user << "\blue You clear away [src]."
var/obj/item/stack/sheet/wood/W = new(src.loc)
W.amount = rand(3,15)
if(prob(50))
icon_state = "stump[rand(1,2)]"
name = "cleared foliage"
desc = "There used to be dense undergrowth here."
density = 0
stump = 1
pixel_x = rand(-6,6)
pixel_y = rand(-6,6)
else
del(src)
else
return ..()
//*******************************//
// Strange, fruit-bearing plants //
//*******************************//
var/list/fruit_icon_states = list("badrecipe","kudzupod","reishi","lime","grapes","boiledrorocore","chocolateegg")
var/list/reagent_effects = list("toxin","anti_toxin","stoxin","space_drugs","mindbreaker","zombiepowder","impedrezene")
var/jungle_plants_init = 0
/proc/init_jungle_plants()
jungle_plants_init = 1
fruit_icon_states = shuffle(fruit_icon_states)
reagent_effects = shuffle(reagent_effects)
/obj/item/weapon/reagent_containers/food/snacks/grown/jungle_fruit
seed = ""
name = "jungle fruit"
desc = "It smells weird and looks off."
icon = 'jungle.dmi'
icon_state = "orange"
potency = 1
/obj/structure/jungle_plant
icon = 'jungle.dmi'
icon_state = "plant1"
desc = "Looks like some of that fruit might be edible."
var/fruits_left = 3
var/fruit_type = -1
var/icon/fruit_overlay
var/plant_strength = 1
var/fruit_r
var/fruit_g
var/fruit_b
/obj/structure/jungle_plant/New()
if(!jungle_plants_init)
init_jungle_plants()
fruit_type = rand(1,7)
icon_state = "plant[fruit_type]"
fruits_left = rand(1,5)
fruit_overlay = icon('jungle.dmi',"fruit[fruits_left]")
fruit_r = 255 - fruit_type * 36
fruit_g = rand(1,255)
fruit_b = fruit_type * 36
fruit_overlay.Blend(rgb(fruit_r, fruit_g, fruit_b), ICON_ADD)
overlays += fruit_overlay
plant_strength = rand(20,200)
/obj/structure/jungle_plant/attack_hand(var/mob/user as mob)
if(fruits_left > 0)
fruits_left--
user << "\blue You pick a fruit off [src]."
var/obj/item/weapon/reagent_containers/food/snacks/grown/jungle_fruit/J = new (src.loc)
J.potency = plant_strength
J.icon_state = fruit_icon_states[fruit_type]
J.reagents.add_reagent(reagent_effects[fruit_type], 1+round((plant_strength / 20), 1))
J.bitesize = 1+round(J.reagents.total_volume / 2, 1)
J.attack_hand(user)
overlays -= fruit_overlay
fruit_overlay = icon('jungle.dmi',"fruit[fruits_left]")
fruit_overlay.Blend(rgb(fruit_r, fruit_g, fruit_b), ICON_ADD)
overlays += fruit_overlay
else
user << "\red There are no fruit left on [src]."
@@ -0,0 +1,401 @@
//randomly generated temples, indiana jones style (minus the cultists, probably)
/area/jungle/temple_one
name = "temple"
lighting_use_dynamic = 1
icon = 'jungle.dmi'
icon_state = "temple1"
/area/jungle/temple_two
name = "temple"
lighting_use_dynamic = 1
icon = 'jungle.dmi'
icon_state = "temple2"
/area/jungle/temple_three
name = "temple"
lighting_use_dynamic = 1
icon = 'jungle.dmi'
icon_state = "temple3"
/area/jungle/temple_four
name = "temple"
lighting_use_dynamic = 1
icon = 'jungle.dmi'
icon_state = "temple4"
/area/jungle/temple_five
name = "temple"
lighting_use_dynamic = 1
icon = 'jungle.dmi'
icon_state = "temple5"
/area/jungle/temple_six
name = "temple"
lighting_use_dynamic = 1
icon = 'jungle.dmi'
icon_state = "temple6"
/obj/effect/landmark/door_spawner
name = "door spawner"
//******//
// Loot //
//******//
/obj/effect/landmark/glowshroom_spawn
icon_state = "x3"
invisibility = 101
New()
if(prob(10))
new /obj/effect/glowshroom(src.loc)
del(src)
/obj/effect/landmark/loot_spawn
name = "loot spawner"
icon_state = "grabbed1"
var/low_probability = 0
New()
switch(pick( \
low_probability * 1000;"nothing", \
200 - low_probability * 175;"treasure", \
25 + low_probability * 75;"remains", \
25 + low_probability * 75;"plants", \
5; "blob", \
50 + low_probability * 50;"clothes", \
"glasses", \
100 - low_probability * 50;"weapons", \
100 - low_probability * 50;"spacesuit", \
"health", \
25 + low_probability * 75;"snacks", \
25;"alien", \
"lights", \
25 - low_probability * 25;"engineering", \
25 - low_probability * 25;"coffin", \
25;"mimic", \
25;"viscerator", \
))
if("treasure")
var/obj/structure/closet/crate/C = new(src.loc)
if(prob(33))
//coins
var/amount = rand(2,6)
var/list/possible_spawns = list()
for(var/coin_type in typesof(/obj/item/weapon/coin))
possible_spawns += coin_type
//no icon_state for mythril coins
possible_spawns -= /obj/item/weapon/coin/mythril
var/coin_type = pick(possible_spawns)
for(var/i=0,i<amount,i++)
new coin_type(C)
else if(prob(50))
//bars
var/amount = rand(2,6)
var/quantity = rand(10,50)
var/list/possible_spawns = list()
for(var/bar_type in typesof(/obj/item/stack/sheet/mineral) - /obj/item/stack/sheet/mineral - /obj/item/stack/sheet/mineral/enruranium)
possible_spawns += bar_type
var/bar_type = pick(possible_spawns)
for(var/i=0,i<amount,i++)
var/obj/item/stack/sheet/mineral/M = new bar_type(C)
M.amount = quantity
else
//credits
var/amount = rand(2,6)
var/list/possible_spawns = list()
for(var/cash_type in typesof(/obj/item/stack/sheet/mineral))
possible_spawns += cash_type
var/cash_type = pick(possible_spawns)
for(var/i=0,i<amount,i++)
new cash_type(C)
if("remains")
if(prob(50))
new /obj/effect/decal/remains/human(src.loc)
else
new /obj/effect/decal/remains/xeno(src.loc)
if("plants")
if(prob(25))
new /obj/effect/glowshroom(src.loc)
else if(prob(33))
new /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap(src.loc)
else if(prob(50))
new /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris(src.loc)
if("blob")
new /obj/effect/blob/core(src.loc)
if("clothes")
var/obj/structure/closet/C = new(src.loc)
C.icon_state = "blue"
C.icon_closed = "blue"
if(prob(33))
new /obj/item/clothing/under/rainbow(C)
new /obj/item/clothing/shoes/rainbow(C)
new /obj/item/clothing/head/soft/rainbow(C)
new /obj/item/clothing/gloves/rainbow(C)
else if(prob(50))
new /obj/item/clothing/under/psyche(C)
else
new /obj/item/clothing/under/syndicate/combat(C)
new /obj/item/clothing/shoes/swat(C)
new /obj/item/clothing/gloves/swat(C)
new /obj/item/clothing/mask/balaclava(C)
if("glasses")
var/obj/structure/closet/C = new(src.loc)
var/new_type = pick(
/obj/item/clothing/glasses/material, \
/obj/item/clothing/glasses/thermal, \
/obj/item/clothing/glasses/meson, \
/obj/item/clothing/glasses/night, \
/obj/item/clothing/glasses/hud/health, \
/obj/item/clothing/glasses/hud/health \
)
new new_type(C)
if("weapons")
var/obj/structure/closet/crate/secure/weapon/C = new(src.loc)
var/new_type = pick(
200; /obj/item/weapon/hatchet, \
/obj/item/weapon/gun/projectile/pistol, \
/obj/item/weapon/gun/projectile/deagle, \
/obj/item/weapon/gun/projectile/russian, \
)
new new_type(C)
if("spacesuit")
var/obj/structure/closet/syndicate/C = new(src.loc)
if(prob(25))
new /obj/item/clothing/suit/space/syndicate/black(C)
new /obj/item/clothing/head/helmet/space/syndicate/black(C)
new /obj/item/weapon/tank/oxygen/red(C)
new /obj/item/clothing/mask/breath(C)
else if(prob(33))
new /obj/item/clothing/suit/space/syndicate/blue(C)
new /obj/item/clothing/head/helmet/space/syndicate/blue(C)
new /obj/item/weapon/tank/oxygen/red(C)
new /obj/item/clothing/mask/breath(C)
else if(prob(50))
new /obj/item/clothing/suit/space/syndicate/green(C)
new /obj/item/clothing/head/helmet/space/syndicate/green(C)
new /obj/item/weapon/tank/oxygen/red(C)
new /obj/item/clothing/mask/breath(C)
else
new /obj/item/clothing/suit/space/syndicate/orange(C)
new /obj/item/clothing/head/helmet/space/syndicate/orange(C)
new /obj/item/weapon/tank/oxygen/red(C)
new /obj/item/clothing/mask/breath(C)
if("health")
//hopefully won't be necessary, but there were an awful lot of traps to get through...
var/obj/structure/closet/crate/medical/C = new(src.loc)
if(prob(50))
new /obj/item/weapon/storage/firstaid/regular(C)
if(prob(50))
new /obj/item/weapon/storage/firstaid/fire(C)
if(prob(50))
new /obj/item/weapon/storage/firstaid/o2(C)
if(prob(50))
new /obj/item/weapon/storage/firstaid/toxin(C)
if("snacks")
//you're come so far, you must be in need of refreshment
var/obj/structure/closet/crate/freezer/C = new(src.loc)
var/num = rand(2,6)
var/new_type = pick(
/obj/item/weapon/reagent_containers/food/drinks/beer, \
/obj/item/weapon/reagent_containers/food/drinks/tea, \
/obj/item/weapon/reagent_containers/food/drinks/dry_ramen, \
/obj/item/weapon/reagent_containers/food/snacks/candiedapple, \
/obj/item/weapon/reagent_containers/food/snacks/chocolatebar, \
/obj/item/weapon/reagent_containers/food/snacks/cookie, \
/obj/item/weapon/reagent_containers/food/snacks/faggot, \
/obj/item/weapon/reagent_containers/food/snacks/plump_pie, \
)
for(var/i=0,i<num,i++)
new new_type(C)
if("alien")
//ancient aliens
var/obj/structure/closet/acloset/C = new(src.loc)
if(prob(33))
//facehuggers
var/num = rand(1,3)
for(var/i=0,i<num,i++)
new /obj/item/clothing/mask/facehugger(C)
/*else if(prob(50))
//something else very much alive and angry
var/spawn_type = pick(/mob/living/simple_animal/hostile/alien, /mob/living/simple_animal/hostile/alien/drone, /mob/living/simple_animal/hostile/alien/sentinel)
new spawn_type(C)*/
//33% chance of nothing
if("lights")
//flares, candles, matches
var/obj/structure/closet/crate/secure/gear/C = new(src.loc)
var/num = rand(2,6)
for(var/i=0,i<num,i++)
var/spawn_type = pick(/obj/item/device/flashlight/flare, /obj/item/trash/candle, /obj/item/candle/, /obj/item/weapon/storage/box/matches)
new spawn_type(C)
if("engineering")
var/obj/structure/closet/crate/secure/gear/C = new(src.loc)
//chance to have any combination of up to two electrical/mechanical toolboxes and one cell
if(prob(33))
new /obj/item/weapon/storage/toolbox/electrical(C)
else if(prob(50))
new /obj/item/weapon/storage/toolbox/mechanical(C)
if(prob(33))
new /obj/item/weapon/storage/toolbox/mechanical(C)
else if(prob(50))
new /obj/item/weapon/storage/toolbox/electrical(C)
if(prob(25))
new /obj/item/weapon/cell(C)
if("coffin")
new /obj/structure/closet/coffin(src.loc)
if(prob(33))
new /obj/effect/decal/remains/human(src)
else if(prob(50))
new /obj/effect/decal/remains/xeno(src)
/*if("mimic")
//a guardian of the tomb!
new /mob/living/simple_animal/hostile/mimic/crate(src.loc)*/
if("viscerator")
//more tomb guardians!
var/num = rand(1,3)
var/obj/structure/closet/crate/secure/gear/C = new(src.loc)
for(var/i=0,i<num,i++)
new /mob/living/simple_animal/hostile/viscerator(C)
del(src)
/obj/effect/landmark/loot_spawn/low
name = "low prob loot spawner"
icon_state = "grabbed"
low_probability = 1
//********//
// Traps! //
//********//
/obj/effect/step_trigger/trap
name = "trap"
icon = 'code/workinprogress/cael_aislinn/jungle/jungle.dmi'
icon = 'jungle.dmi'
icon_state = "trap"
var/trap_type
New()
trap_type = pick(50;"thrower","sawburst","poison_dart","flame_burst",10;"plasma_gas",5;"n2_gas")
if( (trap_type == "plasma_gas" || trap_type == "n2_gas") && prob(10))
new /obj/effect/glowshroom(src.loc)
//hint that this tile is dangerous
if(prob(90))
var/turf/T = get_turf(src)
T.desc = pick("There is a faint sheen of moisture over the top.","It looks a little unstable.","Something doesn't seem right.")
/obj/effect/step_trigger/trap/Trigger(var/atom/A)
var/mob/living/M = A
if(!istype(M))
return
switch(trap_type)
if("sawburst")
M << "\red <b>A sawblade shoots out of the ground and strikes you!</b>"
M.apply_damage(rand(5,10), BRUTE)
var/atom/myloc = src.loc
var/image/flicker = image('jungle.dmi',"sawblade")
myloc.overlays += flicker
spawn(8)
myloc.overlays -= flicker
del(flicker)
//flick("sawblade",src)
if("poison_dart")
M << "\red <b>You feel something small and sharp strike you!</b>"
M.apply_damage(rand(5,10), TOX)
var/atom/myloc = src.loc
var/image/flicker = image('jungle.dmi',"dart[rand(1,3)]")
myloc.overlays += flicker
spawn(8)
myloc.overlays -= flicker
del(flicker)
//flick("dart[rand(1,3)]",src)
if("flame_burst")
M << "\red <b>A jet of fire comes out of nowhere!</b>"
M.apply_damage(rand(5,10), BURN)
var/atom/myloc = src.loc
var/image/flicker = image('jungle.dmi',"flameburst")
myloc.overlays += flicker
spawn(8)
myloc.overlays -= flicker
del flicker
//flick("flameburst",src)
if("plasma_gas")
//spawn a bunch of plasma
if("n2_gas")
//spawn a bunch of sleeping gas
if("thrower")
//edited version of obj/effect/step_trigger/thrower
var/throw_dir = pick(1,2,4,8)
M.visible_message("\red <b>The floor under [M] suddenly tips upward!</b>","\red <b>The floor tips upward under you!</b>")
var/atom/myloc = src.loc
var/image/flicker = image('jungle.dmi',"throw[throw_dir]")
myloc.overlays += flicker
var/turf/my_turf = get_turf(loc)
if(!my_turf.density)
my_turf.density = 1
spawn(8)
my_turf.density = 0
spawn(8)
myloc.overlays -= flicker
del(flicker)
var/dist = rand(1,5)
var/curtiles = 0
while(M)
if(curtiles >= dist)
break
if(M.z != src.z)
break
curtiles++
sleep(1)
var/predir = M.dir
step(M, throw_dir)
M.dir = predir
//gives turf a different description, to try and trick players
/obj/effect/step_trigger/trap/fake
icon_state = "faketrap"
name = "fake trap"
New()
if(prob(10))
new /obj/effect/glowshroom(src.loc)
if(prob(90))
var/turf/T = get_turf(src)
T.desc = pick("It looks a little dustier than the surrounding tiles.","It is somewhat ornate.","It looks a little darker than the surrounding tiles.")
del(src)
//50% chance of being a trap
/obj/effect/step_trigger/trap/fifty
icon_state = "trap"
name = "fifty fifty trap"
icon_state = "fiftytrap"
New()
if(prob(50))
..()
else
if(prob(10))
new /obj/effect/glowshroom(src.loc)
del(src)
@@ -0,0 +1,91 @@
/obj/item/projectile/jungle_spear
damage = 10
damage_type = TOX
icon_state = "bullet"
/obj/effect/jungle_tribe_spawn
name = "campfire"
desc = "Looks cosy, in an alien sort of way."
icon = 'jungle.dmi'
icon_state = "campfire"
anchored = 1
var/list/tribesmen = list()
var/list/enemy_players = list()
var/tribe_type = 1
/obj/effect/jungle_tribe_spawn/New()
processing_objects.Add(src)
tribe_type = rand(1,5)
var/num_tribesmen = rand(3,6)
for(var/i=0,i<num_tribesmen,i++)
var/mob/living/simple_animal/hostile/tribesman/T = new(src.loc)
T.my_type = tribe_type
T.x += rand(-6,6)
T.y += rand(-6,6)
tribesmen += T
/obj/effect/jungle_tribe_spawn/Del()
processing_objects.Remove(src)
/obj/effect/jungle_tribe_spawn/process()
set background = 1
for(var/mob/living/simple_animal/hostile/tribesman/T in tribesmen)
if(T.stat == DEAD)
tribesmen.Remove(T)
spawn(rand(50,300))
var/mob/living/simple_animal/hostile/tribesman/B = new(src.loc)
B.my_type = tribe_type
B.x += rand(-4,4)
B.y += rand(-4,4)
tribesmen += B
/mob/living/simple_animal/hostile/tribesman
name = "tribesman"
desc = "A noble savage, doesn't seem to know what to make of you."
icon = 'jungle.dmi'
icon_state = "native1"
icon_living = "native1"
icon_dead = "native1_dead"
speak_chance = 25
speak = list("Rong a'hu dong'a sik?","Ahi set mep'a teth.","Ohen nek'ti ep esi.")
speak_emote = list("chatters")
emote_hear = list("chatters to themselves","chatters away at something","whistles")
emote_see = list("bends down to examine something")
melee_damage_lower = 5
melee_damage_upper = 15
turns_per_move = 1
stop_automated_movement_when_pulled = 0
var/my_type = 1
/mob/living/simple_animal/hostile/tribesman/New()
if(prob(33))
ranged = 1
spawn(8)
icon_state = "native[my_type]"
icon_living = "native[my_type]"
icon_dead = "native[my_type]_dead"
/mob/living/simple_animal/hostile/tribesman/ListTargets()
var/list/targets = list()
for(var/mob/living/simple_animal/hostile/H in view(src, 10))
if(istype(H, /mob/living/simple_animal/hostile/tribesman))
continue
targets += H
return targets
/mob/living/simple_animal/hostile/tribesman/FindTarget()
. = ..()
if(.)
emote("waves a spear at [.]")
/mob/living/simple_animal/hostile/tribesman/OpenFire(target_mob)
visible_message("\red <b>[src]</b> throws a spear at [target_mob]!", 1)
flick(src, "native[my_type]_act")
var/tturf = get_turf(target_mob)
Shoot(tturf, src.loc, src)
@@ -0,0 +1,178 @@
/turf/unsimulated/jungle
var/bushes_spawn = 1
var/plants_spawn = 1
name = "wet grass"
desc = "Thick, long wet grass"
icon = 'jungle.dmi'
icon_state = "grass1"
var/icon_spawn_state = "grass1"
luminosity = 3
New()
icon_state = icon_spawn_state
if(plants_spawn && prob(40))
if(prob(90))
var/image/I
if(prob(35))
I = image('jungle.dmi',"plant[rand(1,7)]")
else
if(prob(30))
I = image('icons/obj/flora/ausflora.dmi',"reedbush_[rand(1,4)]")
else if(prob(33))
I = image('icons/obj/flora/ausflora.dmi',"leafybush_[rand(1,3)]")
else if(prob(50))
I = image('icons/obj/flora/ausflora.dmi',"fernybush_[rand(1,3)]")
else
I = image('icons/obj/flora/ausflora.dmi',"stalkybush_[rand(1,3)]")
I.pixel_x = rand(-6,6)
I.pixel_y = rand(-6,6)
overlays += I
else
var/obj/structure/jungle_plant/J = new(src)
J.pixel_x = rand(-6,6)
J.pixel_y = rand(-6,6)
if(bushes_spawn && prob(90))
new /obj/structure/bush(src)
/turf/unsimulated/jungle/clear
bushes_spawn = 0
plants_spawn = 0
icon_state = "grass_clear"
icon_spawn_state = "grass3"
/turf/unsimulated/jungle/path
bushes_spawn = 0
name = "wet grass"
desc = "thick, long wet grass"
icon = 'jungle.dmi'
icon_state = "grass_path"
icon_spawn_state = "grass2"
New()
..()
for(var/obj/structure/bush/B in src)
del B
/turf/unsimulated/jungle/proc/Spread(var/probability, var/prob_loss = 50)
if(probability <= 0)
return
//world << "\blue Spread([probability])"
for(var/turf/unsimulated/jungle/J in orange(1, src))
if(!J.bushes_spawn)
continue
var/turf/unsimulated/jungle/P = null
if(J.type == src.type)
P = J
else
P = new src.type(J)
if(P && prob(probability))
P.Spread(probability - prob_loss)
/turf/unsimulated/jungle/impenetrable
bushes_spawn = 0
icon_state = "grass_impenetrable"
icon_spawn_state = "grass1"
New()
..()
var/obj/structure/bush/B = new(src)
B.indestructable = 1
//copy paste from asteroid mineral turfs
/turf/unsimulated/jungle/rock
bushes_spawn = 0
plants_spawn = 0
density = 1
name = "rock wall"
icon = 'icons/turf/walls.dmi'
icon_state = "rock"
icon_spawn_state = "rock"
/turf/unsimulated/jungle/rock/New()
spawn(1)
var/turf/T
if(!istype(get_step(src, NORTH), /turf/unsimulated/jungle/rock) && !istype(get_step(src, NORTH), /turf/unsimulated/wall))
T = get_step(src, NORTH)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_s")
if(!istype(get_step(src, SOUTH), /turf/unsimulated/jungle/rock) && !istype(get_step(src, SOUTH), /turf/unsimulated/wall))
T = get_step(src, SOUTH)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_n", layer=6)
if(!istype(get_step(src, EAST), /turf/unsimulated/jungle/rock) && !istype(get_step(src, EAST), /turf/unsimulated/wall))
T = get_step(src, EAST)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_w", layer=6)
if(!istype(get_step(src, WEST), /turf/unsimulated/jungle/rock) && !istype(get_step(src, WEST), /turf/unsimulated/wall))
T = get_step(src, WEST)
if (T)
T.overlays += image('icons/turf/walls.dmi', "rock_side_e", layer=6)
/turf/unsimulated/jungle/water
bushes_spawn = 0
name = "murky water"
desc = "thick, murky water"
icon = 'icons/misc/beach.dmi'
icon_state = "water"
icon_spawn_state = "water"
/turf/unsimulated/jungle/water/New()
..()
for(var/obj/structure/bush/B in src)
del(B)
/turf/unsimulated/jungle/water/Entered(atom/movable/O)
..()
if(istype(O, /mob/living/))
var/mob/living/M = O
//slip in the murky water if we try to run through it
if(prob(10 + (M.m_intent == "run" ? 40 : 0)))
M << pick("\blue You slip on something slimy.","\blue You fall over into the murk.")
M.Stun(2)
M.Weaken(1)
//piranhas - 25% chance to be an omnipresent risk, although they do practically no damage
if(prob(25))
M << "\blue You feel something slithering around your legs."
if(prob(50))
spawn(rand(25,50))
var/turf/T = get_turf(M)
if(istype(T, /turf/unsimulated/jungle/water))
M << pick("\red Something sharp bites you!","\red Sharp teeth grab hold of you!","\red You feel something take a chunk out of your leg!")
M.apply_damage(rand(0,1), BRUTE)
if(prob(50))
spawn(rand(25,50))
var/turf/T = get_turf(M)
if(istype(T, /turf/unsimulated/jungle/water))
M << pick("\red Something sharp bites you!","\red Sharp teeth grab hold of you!","\red You feel something take a chunk out of your leg!")
M.apply_damage(rand(0,1), BRUTE)
if(prob(50))
spawn(rand(25,50))
var/turf/T = get_turf(M)
if(istype(T, /turf/unsimulated/jungle/water))
M << pick("\red Something sharp bites you!","\red Sharp teeth grab hold of you!","\red You feel something take a chunk out of your leg!")
M.apply_damage(rand(0,1), BRUTE)
if(prob(50))
spawn(rand(25,50))
var/turf/T = get_turf(M)
if(istype(T, /turf/unsimulated/jungle/water))
M << pick("\red Something sharp bites you!","\red Sharp teeth grab hold of you!","\red You feel something take a chunk out of your leg!")
M.apply_damage(rand(0,1), BRUTE)
/turf/unsimulated/jungle/water/deep
plants_spawn = 0
density = 1
icon_state = "water2"
icon_spawn_state = "water2"
/turf/unsimulated/jungle/temple_wall
name = "temple wall"
desc = ""
density = 1
icon = 'icons/turf/walls.dmi'
icon_state = "plasma0"
var/mineral = "plasma"
@@ -0,0 +1,122 @@
//put this here because i needed specific functionality, and i wanted to avoid the hassle of getting it onto svn
/area/proc/copy_turfs_to(var/area/A , var/platingRequired = 0 )
//Takes: Area. Optional: If it should copy to areas that don't have plating
//Returns: Nothing.
//Notes: Attempts to move the contents of one area to another area.
// Movement based on lower left corner. Tiles that do not fit
// into the new area will not be moved.
if(!A || !src) return 0
var/list/turfs_src = get_area_turfs(src.type)
var/list/turfs_trg = get_area_turfs(A.type)
var/src_min_x = 0
var/src_min_y = 0
for (var/turf/T in turfs_src)
if(T.x < src_min_x || !src_min_x) src_min_x = T.x
if(T.y < src_min_y || !src_min_y) src_min_y = T.y
var/trg_min_x = 0
var/trg_min_y = 0
for (var/turf/T in turfs_trg)
if(T.x < trg_min_x || !trg_min_x) trg_min_x = T.x
if(T.y < trg_min_y || !trg_min_y) trg_min_y = T.y
var/list/refined_src = new/list()
for(var/turf/T in turfs_src)
refined_src += T
refined_src[T] = new/datum/coords
var/datum/coords/C = refined_src[T]
C.x_pos = (T.x - src_min_x)
C.y_pos = (T.y - src_min_y)
var/list/refined_trg = new/list()
for(var/turf/T in turfs_trg)
refined_trg += T
refined_trg[T] = new/datum/coords
var/datum/coords/C = refined_trg[T]
C.x_pos = (T.x - trg_min_x)
C.y_pos = (T.y - trg_min_y)
var/list/toupdate = new/list()
var/copiedobjs = list()
moving:
for (var/turf/T in refined_src)
var/datum/coords/C_src = refined_src[T]
for (var/turf/B in refined_trg)
var/datum/coords/C_trg = refined_trg[B]
if(C_src.x_pos == C_trg.x_pos && C_src.y_pos == C_trg.y_pos)
var/old_dir1 = T.dir
var/old_icon_state1 = T.icon_state
var/old_icon1 = T.icon
if(platingRequired)
if(istype(B, /turf/space))
continue moving
var/turf/X = new T.type(B)
X.dir = old_dir1
X.icon_state = old_icon_state1
X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi
var/list/mobs = new/list()
var/list/newmobs = new/list()
for(var/mob/M in T)
if(!istype(M,/mob) || istype(M, /mob/aiEye)) continue // If we need to check for more mobs, I'll add a variable
mobs += M
for(var/mob/M in mobs)
newmobs += DuplicateObject(M , 1)
for(var/mob/M in newmobs)
M.loc = X
for(var/V in T.vars)
if(!(V in list("type","loc","locs","vars", "parent", "parent_type","verbs","ckey","key","x","y","z","contents", "luminosity")))
X.vars[V] = T.vars[V]
// var/area/AR = X.loc
// if(AR.lighting_use_dynamic)
// X.opacity = !X.opacity
// X.sd_SetOpacity(!X.opacity) //TODO: rewrite this code so it's not messed by lighting ~Carn
toupdate += X
refined_src -= T
refined_trg -= B
continue moving
/*var/list/doors = new/list()
if(toupdate.len)
for(var/turf/simulated/T1 in toupdate)
for(var/obj/machinery/door/D2 in T1)
doors += D2
if(T1.parent)
air_master.groups_to_rebuild += T1.parent
else
air_master.tiles_to_update += T1
for(var/obj/O in doors)
O:update_nearby_tiles(1)*/
return copiedobjs
+54 -7
View File
@@ -1,14 +1,61 @@
/area/engine/cooling
//reactor areas
/area/engine/port_gyro_bay
/area/engine
fore
name = "\improper Fore"
/area/engine/starboard_gyro_bay
construction_storage
name = "\improper Construction storage"
/area/engine/generators
locker
name = "\improper Locker room"
/area/engine/turbine_control
atmos_storage
name = "\improper Atmos storage"
/area/engine/reactor_core
control
name = "\improper Control"
/area/engine/aux_control
electrical_storage
name = "\improper Electrical storage"
reactor_core
name = "\improper Reactor Core"
icon_state = "engine_core"
reactor_gas
name = "Reactor Gas Storage"
icon_state = "engine_atmos"
aux_control
name = "Reactor Auxiliary Control"
icon_state = "engine_aux"
turbine_control
name = "Turbine Control"
icon_state = "engine_turbine"
reactor_airlock
name = "\improper Reactor Primary Entrance"
icon_state = "engine_airlock"
reactor_fuel_storage
name = "Reactor Fuel Storage"
icon_state = "engine_fuel"
reactor_fuel_ports
name = "\improper Reactor Fuel Ports"
icon_state = "engine_port"
generators
name = "\improper Generator Room"
icon_state = "engine_generators"
port_gyro_bay
name = "\improper Port Gyrotron Bay"
icon_state = "engine_starboardgyro"
starboard_gyro_bay
name = "\improper Starboard Gyrotron Bay"
icon_state = "engine_portgyro"
@@ -13,15 +13,6 @@
spawn(0)
core_generator = locate() in world
attack_ai(mob/user)
attack_hand(user)
attack_hand(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
interact(user)
Topic(href, href_list)
..()
if( href_list["shutdown"] )
@@ -52,36 +43,35 @@
if(updating)
src.updateDialog()
proc
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>"
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=red>Core suspension field offline</font> <a href='?src=\ref[src];startup=1'>\[Bring field online\]</a><br>"
t += " <font color=blue>No reactants present.</font><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
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
@@ -68,21 +68,20 @@ var/const/max_assembly_amount = 300
F.loc = src.loc
return
proc
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>"
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
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>"
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
@@ -121,53 +121,52 @@
..()
src.updateDialog()
proc
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
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
@@ -97,59 +97,58 @@
return*/
interact(user)
proc
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
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
proc/BeginInjecting()
if(!injecting && owned_assembly_port && owned_assembly_port.cur_assembly)
@@ -163,36 +163,26 @@
pixel_x = -pixel_x
pixel_y = -pixel_y
attack_ai(mob/user)
attack_hand(user)
attack_hand(mob/user)
add_fingerprint(user)
/*if(stat & (BROKEN|NOPOWER))
return*/
interact(user)
proc
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=gyro_monitor")
return
var/t = "<B>Free electron MASER (Gyrotron) Control Panel</B><BR>"
if(owned_gyrotron && owned_gyrotron.on)
t += "<font color=green>Gyrotron operational</font><br>"
t += "Operational mode: <font color=blue>"
if(owned_gyrotron.emitting)
t += "Emitting</font> <a href='?src=\ref[owned_gyrotron];deactivate=1'>\[Deactivate\]</a><br>"
else
t += "Not emitting</font> <a href='?src=\ref[owned_gyrotron];activate=1'>\[Activate\]</a><br>"
t += "Emission rate: [owned_gyrotron.rate] <a href='?src=\ref[owned_gyrotron];modifyrate=1'>\[Modify\]</a><br>"
t += "Beam frequency: [owned_gyrotron.frequency] <a href='?src=\ref[owned_gyrotron];modifyfreq=1'>\[Modify\]</a><br>"
t += "Beam power: [owned_gyrotron.mega_energy] <a href='?src=\ref[owned_gyrotron];modifypower=1'>\[Modify\]</a><br>"
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=gyro_monitor")
return
var/t = "<B>Free electron MASER (Gyrotron) Control Panel</B><BR>"
if(owned_gyrotron && owned_gyrotron.on)
t += "<font color=green>Gyrotron operational</font><br>"
t += "Operational mode: <font color=blue>"
if(owned_gyrotron.emitting)
t += "Emitting</font> <a href='?src=\ref[owned_gyrotron];deactivate=1'>\[Deactivate\]</a><br>"
else
t += "<b><font color=red>Gyrotron unresponsive</font></b>"
t += "<hr>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=gyro_monitor;size=500x800")
user.machine = src
t += "Not emitting</font> <a href='?src=\ref[owned_gyrotron];activate=1'>\[Activate\]</a><br>"
t += "Emission rate: [owned_gyrotron.rate] <a href='?src=\ref[owned_gyrotron];modifyrate=1'>\[Modify\]</a><br>"
t += "Beam frequency: [owned_gyrotron.frequency] <a href='?src=\ref[owned_gyrotron];modifyfreq=1'>\[Modify\]</a><br>"
t += "Beam power: [owned_gyrotron.mega_energy] <a href='?src=\ref[owned_gyrotron];modifypower=1'>\[Modify\]</a><br>"
else
t += "<b><font color=red>Gyrotron unresponsive</font></b>"
t += "<hr>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=gyro_monitor;size=500x800")
user.machine = src
@@ -7,20 +7,6 @@
New()
..()
attack_ai(mob/user)
attack_hand(user)
attack_hand(mob/user)
add_fingerprint(user)
/*if(stat & (BROKEN|NOPOWER))
return*/
interact(user)
/*updateDialog()
for(var/mob/M in range(1))
if(M.machine == src)
interact(m)*/
Topic(href, href_list)
..()
if( href_list["close"] )
@@ -37,66 +23,65 @@
if(updating)
src.updateDialog()
proc
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=gyrotron_controller")
return
var/t = "<B>Gyrotron Remote Control Console</B><BR>"
t += "<hr>"
for(var/obj/machinery/rust/gyrotron/gyro in world)
if(gyro.remoteenabled && gyro.on)
t += "<font color=green>Gyrotron operational</font><br>"
t += "Operational mode: <font color=blue>"
if(gyro.emitting)
t += "Emitting</font> <a href='?src=\ref[gyro];deactivate=1'>\[Deactivate\]</a><br>"
else
t += "Not emitting</font> <a href='?src=\ref[gyro];activate=1'>\[Activate\]</a><br>"
t += "Emission rate: [gyro.rate] <a href='?src=\ref[gyro];modifyrate=1'>\[Modify\]</a><br>"
t += "Beam frequency: [gyro.frequency] <a href='?src=\ref[gyro];modifyfreq=1'>\[Modify\]</a><br>"
t += "Beam power: [gyro.mega_energy] <a href='?src=\ref[gyro];modifypower=1'>\[Modify\]</a><br>"
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=gyrotron_controller")
return
var/t = "<B>Gyrotron Remote Control Console</B><BR>"
t += "<hr>"
for(var/obj/machinery/rust/gyrotron/gyro in world)
if(gyro.remoteenabled && gyro.on)
t += "<font color=green>Gyrotron operational</font><br>"
t += "Operational mode: <font color=blue>"
if(gyro.emitting)
t += "Emitting</font> <a href='?src=\ref[gyro];deactivate=1'>\[Deactivate\]</a><br>"
else
t += "<b><font color=red>Gyrotron unresponsive</font></b>"
t += "<hr>"
/*
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>"
t += "Not emitting</font> <a href='?src=\ref[gyro];activate=1'>\[Activate\]</a><br>"
t += "Emission rate: [gyro.rate] <a href='?src=\ref[gyro];modifyrate=1'>\[Modify\]</a><br>"
t += "Beam frequency: [gyro.frequency] <a href='?src=\ref[gyro];modifyfreq=1'>\[Modify\]</a><br>"
t += "Beam power: [gyro.mega_energy] <a href='?src=\ref[gyro];modifypower=1'>\[Modify\]</a><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 += "<b><font color=red>Gyrotron unresponsive</font></b>"
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 ? "[Injector.owned_assembly_port.cur_assembly.amount_depleted*100]%" : ""]</td>"
t += "</tr>"
t += "</table>"
*/
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=gyrotron_controller;size=500x400")
user.machine = src
/*
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 ? "[Injector.owned_assembly_port.cur_assembly.amount_depleted*100]%" : ""]</td>"
t += "</tr>"
t += "</table>"
*/
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=gyrotron_controller;size=500x400")
user.machine = src
@@ -14,36 +14,26 @@
if(las.id == src.id)
lasers += las
attack_hand(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
interact(user)
attack_ai(mob/user)
attack_hand(user)
process()
..()
updateDialog()
proc
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=laser_control")
return
var/t = "<TT><B>Laser status monitor</B><HR>"
for(var/obj/machinery/zero_point_emitter/laser in lasers)
t += "Zero Point Laser<br>"
t += "Power level: <A href = '?src=\ref[laser];input=-0.005'>-</A> <A href = '?src=\ref[laser];input=-0.001'>-</A> <A href = '?src=\ref[laser];input=-0.0005'>-</A> <A href = '?src=\ref[laser];input=-0.0001'>-</A> [laser.energy]MeV <A href = '?src=\ref[laser];input=0.0001'>+</A> <A href = '?src=\ref[laser];input=0.0005'>+</A> <A href = '?src=\ref[laser];input=0.001'>+</A> <A href = '?src=\ref[laser];input=0.005'>+</A><BR>"
t += "Frequency: <A href = '?src=\ref[laser];freq=-10000'>-</A> <A href = '?src=\ref[laser];freq=-1000'>-</A> [laser.freq] <A href = '?src=\ref[laser];freq=1000'>+</A> <A href = '?src=\ref[laser];freq=10000'>+</A><BR>"
t += "Output: [laser.active ? "<B>Online</B> <A href = '?src=\ref[laser];online=1'>Offline</A>" : "<A href = '?src=\ref[laser];online=1'>Online</A> <B>Offline</B> "]<BR>"
t += "<hr>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=laser_control;size=500x800")
user.machine = src
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=laser_control")
return
var/t = "<TT><B>Laser status monitor</B><HR>"
for(var/obj/machinery/zero_point_emitter/laser in lasers)
t += "Zero Point Laser<br>"
t += "Power level: <A href = '?src=\ref[laser];input=-0.005'>-</A> <A href = '?src=\ref[laser];input=-0.001'>-</A> <A href = '?src=\ref[laser];input=-0.0005'>-</A> <A href = '?src=\ref[laser];input=-0.0001'>-</A> [laser.energy]MeV <A href = '?src=\ref[laser];input=0.0001'>+</A> <A href = '?src=\ref[laser];input=0.0005'>+</A> <A href = '?src=\ref[laser];input=0.001'>+</A> <A href = '?src=\ref[laser];input=0.005'>+</A><BR>"
t += "Frequency: <A href = '?src=\ref[laser];freq=-10000'>-</A> <A href = '?src=\ref[laser];freq=-1000'>-</A> [laser.freq] <A href = '?src=\ref[laser];freq=1000'>+</A> <A href = '?src=\ref[laser];freq=10000'>+</A><BR>"
t += "Output: [laser.active ? "<B>Online</B> <A href = '?src=\ref[laser];online=1'>Offline</A>" : "<A href = '?src=\ref[laser];online=1'>Online</A> <B>Offline</B> "]<BR>"
t += "<hr>"
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=laser_control;size=500x800")
user.machine = src
/*
/obj/machinery/computer/lasercon/proc/interact(mob/user)
@@ -119,10 +119,6 @@
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/attack_hand(mob/user as mob)
interact(user)
src.add_fingerprint(user)
/obj/machinery/shield_capacitor/Topic(href, href_list[])
..()
if( href_list["close"] )
@@ -144,7 +140,7 @@
//
updateDialog()
/obj/machinery/shield_capacitor/proc/interact(mob/user)
/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
@@ -148,11 +148,6 @@
//
updateDialog()
/obj/machinery/shield_gen/attack_hand(mob/user as mob)
interact(user)
src.add_fingerprint(user)
/obj/machinery/shield_gen/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
@@ -241,7 +236,7 @@
//
updateDialog()
/obj/machinery/shield_gen/proc/interact(mob/user)
/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
+1 -1
View File
@@ -29,7 +29,7 @@
var/obj/item/clothing/mask/cigarette/cig = W
if (cig.lit == 1)
src.visible_message("[user] crushes [cig] in [src], putting it out.")
cig.put_out()
cig.smoketime = 0
else if (cig.lit == 0)
if(istype(cig, /obj/item/weapon/match))
user << "You place [cig] in [src] without even lighting it. Why would you do that?"
+590
View File
@@ -0,0 +1,590 @@
/mob/living/carbon/amorph
name = "amorph"
real_name = "amorph"
voice_name = "amorph"
icon = 'icons/mob/amorph.dmi'
icon_state = ""
var/species = "Amorph"
age = 30.0
var/used_skillpoints = 0
var/skill_specialization = null
var/list/skills = null
var/obj/item/l_ear = null
// might use this later to recolor armorphs with icon.SwapColor
var/slime_color = null
var/examine_text = ""
/mob/living/carbon/amorph/New()
..()
// Amorphs don't have a blood vessel, but they can have reagents in their body
var/datum/reagents/R = new/datum/reagents(1000)
reagents = R
R.my_atom = src
// Amorphs have no DNA(they're more like carbon-based machines)
// Amorphs don't have organs
..()
/mob/living/carbon/amorph/Bump(atom/movable/AM as mob|obj, yes)
if ((!( yes ) || now_pushing))
return
now_pushing = 1
if (ismob(AM))
var/mob/tmob = AM
//BubbleWrap - Should stop you pushing a restrained person out of the way
if(istype(tmob, /mob/living/carbon/human))
for(var/mob/M in range(tmob, 1))
if( ((M.pulling == tmob && ( tmob.restrained() && !( M.restrained() ) && M.stat == 0)) || locate(/obj/item/weapon/grab, tmob.grabbed_by.len)) )
if ( !(world.time % 5) )
src << "\red [tmob] is restrained, you cannot push past"
now_pushing = 0
return
if( tmob.pulling == M && ( M.restrained() && !( tmob.restrained() ) && tmob.stat == 0) )
if ( !(world.time % 5) )
src << "\red [tmob] is restraining [M], you cannot push past"
now_pushing = 0
return
//BubbleWrap: people in handcuffs are always switched around as if they were on 'help' intent to prevent a person being pulled from being seperated from their puller
if((tmob.a_intent == "help" || tmob.restrained()) && (a_intent == "help" || src.restrained()) && tmob.canmove && canmove) // mutual brohugs all around!
var/turf/oldloc = loc
loc = tmob.loc
tmob.loc = oldloc
now_pushing = 0
for(var/mob/living/carbon/metroid/Metroid in view(1,tmob))
if(Metroid.Victim == tmob)
Metroid.UpdateFeed()
return
if(tmob.r_hand && istype(tmob.r_hand, /obj/item/weapon/shield/riot))
if(prob(99))
now_pushing = 0
return
if(tmob.l_hand && istype(tmob.l_hand, /obj/item/weapon/shield/riot))
if(prob(99))
now_pushing = 0
return
if(tmob.nopush)
now_pushing = 0
return
tmob.LAssailant = src
now_pushing = 0
spawn(0)
..()
if (!istype(AM, /atom/movable))
return
if (!now_pushing)
now_pushing = 1
if (!AM.anchored)
var/t = get_dir(src, AM)
if (istype(AM, /obj/structure/window))
if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
for(var/obj/structure/window/win in get_step(AM,t))
now_pushing = 0
return
step(AM, t)
now_pushing = 0
return
return
/mob/living/carbon/amorph/movement_delay()
var/tally = 2 // amorphs are a bit slower than humans
var/mob/M = pulling
if(reagents.has_reagent("hyperzine")) return -1
if(reagents.has_reagent("nuka_cola")) return -1
if(analgesic) return -1
if (istype(loc, /turf/space)) return -1 // It's hard to be slowed down in space by... anything
var/health_deficiency = traumatic_shock
if(health_deficiency >= 40) tally += (health_deficiency / 25)
var/hungry = (500 - nutrition)/5 // So overeat would be 100 and default level would be 80
if (hungry >= 70) tally += hungry/300
if (bodytemperature < 283.222)
tally += (283.222 - bodytemperature) / 10 * 1.75
if (stuttering < 10)
stuttering = 10
if(shock_stage >= 10) tally += 3
if(tally < 0)
tally = 0
if(istype(M) && M.lying) //Pulling lying down people is slower
tally += 3
if(mRun in mutations)
tally = 0
return tally
/mob/living/carbon/amorph/Stat()
..()
statpanel("Status")
stat(null, "Intent: [a_intent]")
stat(null, "Move Mode: [m_intent]")
if(ticker && ticker.mode && ticker.mode.name == "AI malfunction")
if(ticker.mode:malf_mode_declared)
stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]")
if(emergency_shuttle)
if(emergency_shuttle.online && emergency_shuttle.location < 2)
var/timeleft = emergency_shuttle.timeleft()
if (timeleft)
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
if (client.statpanel == "Status")
if (internal)
if (!internal.air_contents)
del(internal)
else
stat("Internal Atmosphere Info", internal.name)
stat("Tank Pressure", internal.air_contents.return_pressure())
stat("Distribution Pressure", internal.distribute_pressure)
if (mind)
if (mind.special_role == "Changeling" && changeling)
stat("Chemical Storage", changeling.chem_charges)
stat("Genetic Damage Time", changeling.geneticdamage)
/mob/living/carbon/amorph/ex_act(severity)
flick("flash", flash)
var/shielded = 0
var/b_loss = null
var/f_loss = null
switch (severity)
if (1.0)
b_loss += 500
if (!prob(getarmor(null, "bomb")))
gib()
return
else
var/atom/target = get_edge_target_turf(src, get_dir(src, get_step_away(src, src)))
throw_at(target, 200, 4)
if (2.0)
if (!shielded)
b_loss += 60
f_loss += 60
if (!prob(getarmor(null, "bomb")))
b_loss = b_loss/1.5
f_loss = f_loss/1.5
if(3.0)
b_loss += 30
if (!prob(getarmor(null, "bomb")))
b_loss = b_loss/2
if (prob(50) && !shielded)
Paralyse(10)
src.bruteloss += b_loss
src.fireloss += f_loss
UpdateDamageIcon()
/mob/living/carbon/amorph/blob_act()
if(stat == 2) return
show_message("\red The blob attacks you!")
src.bruteloss += rand(30,40)
UpdateDamageIcon()
return
/mob/living/carbon/amorph/u_equip(obj/item/W as obj)
// These are the only slots an amorph has
if (W == l_ear)
l_ear = null
else if (W == r_hand)
r_hand = null
update_clothing()
/mob/living/carbon/amorph/db_click(text, t1)
var/obj/item/W = equipped()
var/emptyHand = (W == null)
if ((!emptyHand) && (!istype(W, /obj/item)))
return
if (emptyHand)
usr.next_move = usr.prev_move
usr:lastDblClick -= 3 //permit the double-click redirection to proceed.
switch(text)
if("l_ear")
if (l_ear)
if (emptyHand)
l_ear.DblClick()
return
else if(emptyHand)
return
if (!( istype(W, /obj/item/clothing/ears) ) && !( istype(W, /obj/item/device/radio/headset) ) && W.w_class != 1)
return
u_equip(W)
l_ear = W
W.equipped(src, text)
update_clothing()
return
/mob/living/carbon/amorph/meteorhit(O as obj)
for(var/mob/M in viewers(src, null))
if ((M.client && !( M.blinded )))
M.show_message(text("\red [] has been hit by []", src, O), 1)
if (health > 0)
if (istype(O, /obj/effect/immovablerod))
src.bruteloss += 101
else
src.bruteloss += 25
UpdateDamageIcon()
updatehealth()
return
/mob/living/carbon/amorph/Move(a, b, flag)
if (buckled)
return
if (restrained())
pulling = null
var/t7 = 1
if (restrained())
for(var/mob/M in range(src, 1))
if ((M.pulling == src && M.stat == 0 && !( M.restrained() )))
t7 = null
if ((t7 && (pulling && ((get_dist(src, pulling) <= 1 || pulling.loc == loc) && (client && client.moving)))))
var/turf/T = loc
. = ..()
if (pulling && pulling.loc)
if(!( isturf(pulling.loc) ))
pulling = null
return
else
if(Debug)
diary <<"pulling disappeared? at [__LINE__] in mob.dm - pulling = [pulling]"
diary <<"REPORT THIS"
/////
if(pulling && pulling.anchored)
pulling = null
return
if (!restrained())
var/diag = get_dir(src, pulling)
if ((diag - 1) & diag)
else
diag = null
if ((get_dist(src, pulling) > 1 || diag))
if (ismob(pulling))
var/mob/M = pulling
var/ok = 1
if (locate(/obj/item/weapon/grab, M.grabbed_by))
if (prob(75))
var/obj/item/weapon/grab/G = pick(M.grabbed_by)
if (istype(G, /obj/item/weapon/grab))
for(var/mob/O in viewers(M, null))
O.show_message(text("\red [] has been pulled from []'s grip by []", G.affecting, G.assailant, src), 1)
//G = null
del(G)
else
ok = 0
if (locate(/obj/item/weapon/grab, M.grabbed_by.len))
ok = 0
if (ok)
var/t = M.pulling
M.pulling = null
//this is the gay blood on floor shit -- Added back -- Skie
if (M.lying && (prob(M.getBruteLoss() / 6)))
var/turf/location = M.loc
if (istype(location, /turf/simulated))
location.add_blood(M)
if(ishuman(M))
var/mob/living/carbon/H = M
var/blood_volume = round(H:vessel.get_reagent_amount("blood"))
if(blood_volume > 0)
H:vessel.remove_reagent("blood",1)
if(prob(5))
M.adjustBruteLoss(1)
visible_message("\red \The [M]'s wounds open more from being dragged!")
if(M.pull_damage())
if(prob(25))
M.adjustBruteLoss(2)
visible_message("\red \The [M]'s wounds worsen terribly from being dragged!")
var/turf/location = M.loc
if (istype(location, /turf/simulated))
location.add_blood(M)
if(ishuman(M))
var/mob/living/carbon/H = M
var/blood_volume = round(H:vessel.get_reagent_amount("blood"))
if(blood_volume > 0)
H:vessel.remove_reagent("blood",1)
step(pulling, get_dir(pulling.loc, T))
M.pulling = t
else
if (pulling)
if (istype(pulling, /obj/structure/window))
if(pulling:ini_dir == NORTHWEST || pulling:ini_dir == NORTHEAST || pulling:ini_dir == SOUTHWEST || pulling:ini_dir == SOUTHEAST)
for(var/obj/structure/window/win in get_step(pulling,get_dir(pulling.loc, T)))
pulling = null
if (pulling)
step(pulling, get_dir(pulling.loc, T))
else
pulling = null
. = ..()
if ((s_active && !( s_active in contents ) ))
s_active.close(src)
for(var/mob/living/carbon/metroid/M in view(1,src))
M.UpdateFeed(src)
return
/mob/living/carbon/amorph/proc/misc_clothing_updates()
// Temporary proc to shove stuff in that was put into update_clothing()
// for questionable reasons
if (client)
if (i_select)
if (intent)
client.screen += hud_used.intents
var/list/L = dd_text2list(intent, ",")
L[1] += ":-11"
i_select.screen_loc = dd_list2text(L,",") //ICONS4
else
i_select.screen_loc = null
if (m_select)
if (m_int)
client.screen += hud_used.mov_int
var/list/L = dd_text2list(m_int, ",")
L[1] += ":-11"
m_select.screen_loc = dd_list2text(L,",") //ICONS4
else
m_select.screen_loc = null
// Probably a lazy way to make sure all items are on the screen exactly once
if (client)
client.screen -= contents
client.screen += contents
/mob/living/carbon/amorph/rebuild_appearance()
// Lazy method: Just rebuild everything.
// This can be called when the mob is created, but on other occasions, rebuild_body_overlays(),
// rebuild_clothing_overlays() etc. should be called individually.
misc_clothing_updates() // silly stuff
/mob/living/carbon/amorph/update_body_appearance()
// Should be called whenever something about the body appearance itself changes.
misc_clothing_updates() // silly stuff
if(lying)
icon_state = "lying"
else
icon_state = "standing"
/mob/living/carbon/amorph/update_lying()
// Should be called whenever something about the lying status of the mob might have changed.
if(lying)
icon_state = "lying"
else
icon_state = "standing"
/mob/living/carbon/amorph/hand_p(mob/M as mob)
// not even sure what this is meant to do
return
/mob/living/carbon/amorph/restrained()
if (handcuffed)
return 0 // handcuffs don't work on amorphs
return 0
/mob/living/carbon/amorph/var/co2overloadtime = null
/mob/living/carbon/amorph/var/temperature_resistance = T0C+75
/mob/living/carbon/amorph/show_inv(mob/user as mob)
// TODO: add a window for extracting stuff from an amorph's mouth
// called when something steps onto an amorph
// this could be made more general, but for now just handle mulebot
/mob/living/carbon/amorph/HasEntered(var/atom/movable/AM)
var/obj/machinery/bot/mulebot/MB = AM
if(istype(MB))
MB.RunOver(src)
//gets assignment from ID or ID inside PDA or PDA itself
//Useful when player do something with computers
/mob/living/carbon/amorph/proc/get_assignment(var/if_no_id = "No id", var/if_no_job = "No job")
// TODO: get the ID from the amorph's contents
return
//gets name from ID or ID inside PDA or PDA itself
//Useful when player do something with computers
/mob/living/carbon/amorph/proc/get_authentification_name(var/if_no_id = "Unknown")
// TODO: get the ID from the amorph's contents
return
//repurposed proc. Now it combines get_id_name() and get_face_name() to determine a mob's name variable. Made into a seperate proc as it'll be useful elsewhere
/mob/living/carbon/amorph/proc/get_visible_name()
// amorphs can't wear clothes or anything, so always return face_name
return get_face_name()
//Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable
/mob/living/carbon/amorph/proc/get_face_name()
// there might later be ways for amorphs to change the appearance of their face
return "[real_name]"
//gets ID card object from special clothes slot or null.
/mob/living/carbon/amorph/proc/get_idcard()
// TODO: get the ID from the amorph's contents
// heal the amorph
/mob/living/carbon/amorph/heal_overall_damage(var/brute, var/burn)
bruteloss -= brute
fireloss -= burn
bruteloss = max(bruteloss, 0)
fireloss = max(fireloss, 0)
updatehealth()
UpdateDamageIcon()
// damage MANY external organs, in random order
/mob/living/carbon/amorph/take_overall_damage(var/brute, var/burn, var/used_weapon = null)
bruteloss += brute
fireloss += burn
updatehealth()
UpdateDamageIcon()
/mob/living/carbon/amorph/Topic(href, href_list)
if (href_list["refresh"])
if((machine)&&(in_range(src, usr)))
show_inv(machine)
if (href_list["mach_close"])
var/t1 = text("window=[]", href_list["mach_close"])
machine = null
src << browse(null, t1)
if ((href_list["item"] && !( usr.stat ) && usr.canmove && !( usr.restrained() ) && in_range(src, usr) && ticker)) //if game hasn't started, can't make an equip_e
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( )
O.source = usr
O.target = src
O.item = usr.equipped()
O.s_loc = usr.loc
O.t_loc = loc
O.place = href_list["item"]
if(href_list["loc"])
O.internalloc = href_list["loc"]
requests += O
spawn( 0 )
O.process()
return
if (href_list["criminal"])
if(istype(usr, /mob/living/carbon/human))
var/mob/living/carbon/human/H = usr
if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud))
var/perpname = "wot"
var/modified = 0
/*if(wear_id)
if(istype(wear_id,/obj/item/weapon/card/id))
perpname = wear_id:registered_name
else if(istype(wear_id,/obj/item/device/pda))
var/obj/item/device/pda/tempPda = wear_id
perpname = tempPda.owner
else*/
perpname = src.name
for (var/datum/data/record/E in data_core.general)
if (E.fields["name"] == perpname)
for (var/datum/data/record/R in data_core.security)
if (R.fields["id"] == E.fields["id"])
var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", R.fields["criminal"]) in list("None", "*Arrest*", "Incarcerated", "Parolled", "Released", "Cancel")
if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud))
if(setcriminal != "Cancel")
R.fields["criminal"] = setcriminal
modified = 1
spawn()
H.handle_regular_hud_updates()
if(!modified)
usr << "\red Unable to locate a data core entry for this person."
..()
return
///eyecheck()
///Returns a number between -1 to 2
/mob/living/carbon/amorph/eyecheck()
return 1
/mob/living/carbon/amorph/IsAdvancedToolUser()
return 1//Amorphs can use guns and such
/mob/living/carbon/amorph/updatehealth()
if(src.nodamage)
src.health = 100
src.stat = 0
return
src.health = 100 - src.getOxyLoss() - src.getToxLoss() - src.getFireLoss() - src.getBruteLoss() - src.getCloneLoss() -src.halloss
return
/mob/living/carbon/amorph/abiotic(var/full_body = 0)
return 0
/mob/living/carbon/amorph/abiotic2(var/full_body2 = 0)
return 0
/mob/living/carbon/amorph/getBruteLoss()
return src.bruteloss
/mob/living/carbon/amorph/adjustBruteLoss(var/amount, var/used_weapon = null)
src.bruteloss += amount
if(bruteloss < 0) bruteloss = 0
/mob/living/carbon/amorph/getFireLoss()
return src.fireloss
/mob/living/carbon/amorph/adjustFireLoss(var/amount,var/used_weapon = null)
src.fireloss += amount
if(fireloss < 0) fireloss = 0
/mob/living/carbon/amorph/get_visible_gender()
return gender
@@ -0,0 +1,248 @@
/mob/living/carbon/amorph/attack_paw(mob/living/carbon/monkey/M as mob)
if (!ticker)
M << "You cannot attack people before the game has started."
return
..()
switch(M.a_intent)
if ("help")
help_shake_act(M)
else
if (istype(wear_mask, /obj/item/clothing/mask/muzzle))
return
if (health > 0)
attacked += 10
playsound(loc, 'bite.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[M.name] has bit [src]!</B>"), 1)
adjustBruteLoss(rand(0, 1))
updatehealth()
return
/mob/living/carbon/amorph/attack_hand(mob/living/carbon/human/M as mob)
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
var/obj/item/clothing/gloves/G = M.gloves
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
Weaken(5)
if (stuttering < 5)
stuttering = 5
Stun(5)
for(var/mob/O in viewers(src, null))
if (O.client)
O.show_message("\red <B>[src] has been touched with the stun gloves by [M]!</B>", 1, "\red You hear someone fall", 2)
return
else
M << "\red Not enough charge! "
return
if (M.a_intent == "help")
help_shake_act(M)
else
if (M.a_intent == "hurt")
var/attack_verb
switch(M.mutantrace)
if("lizard")
attack_verb = "scratch"
if("plant")
attack_verb = "slash"
else
attack_verb = "punch"
if(M.type == /mob/living/carbon/human/tajaran)
attack_verb = "slash"
if ((prob(75) && health > 0))
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has [attack_verb]ed [name]!</B>", M), 1)
var/damage = rand(5, 10)
if(M.type != /mob/living/carbon/human/tajaran)
playsound(loc, "punch", 25, 1, -1)
else if(M.type == /mob/living/carbon/human/tajaran)
damage += 10
playsound(loc, 'slice.ogg', 25, 1, -1)
adjustBruteLoss(damage/10)
updatehealth()
else
if(M.type != /mob/living/carbon/human/tajaran)
playsound(loc, 'punchmiss.ogg', 25, 1, -1)
else if(M.type == /mob/living/carbon/human/tajaran)
playsound(loc, 'slashmiss.ogg', 25, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has attempted to [attack_verb] [name]!</B>", M), 1)
else
if (M.a_intent == "grab")
if (M == src)
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
G.assailant = M
if (M.hand)
M.l_hand = G
else
M.r_hand = G
G.layer = 20
G.affecting = src
grabbed_by += G
G.synch()
LAssailant = M
playsound(loc, 'thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
O.show_message(text("\red [] has grabbed [name] passively!", M), 1)
else
if (!( paralysis ))
drop_item()
playsound(loc, 'thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has disarmed [name]!</B>", M), 1)
return
/mob/living/carbon/amorph/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
switch(M.a_intent)
if ("help")
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\blue [M] caresses [src] with its scythe like arm."), 1)
if ("hurt")
if ((prob(95) && health > 0))
playsound(loc, 'slice.ogg', 25, 1, -1)
var/damage = rand(15, 30)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has slashed [name]!</B>", M), 1)
adjustBruteLoss(damage/10)
updatehealth()
react_to_attack(M)
else
playsound(loc, 'slashmiss.ogg', 25, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has attempted to lunge at [name]!</B>", M), 1)
if ("grab")
if (M == src)
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
G.assailant = M
if (M.hand)
M.l_hand = G
else
M.r_hand = G
G.layer = 20
G.affecting = src
grabbed_by += G
G.synch()
LAssailant = M
playsound(loc, 'thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
O.show_message(text("\red [] has grabbed [name] passively!", M), 1)
if ("disarm")
playsound(loc, 'pierce.ogg', 25, 1, -1)
var/damage = 5
if(prob(95))
Weaken(rand(10,15))
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has tackled down [name]!</B>", M), 1)
else
drop_item()
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has disarmed [name]!</B>", M), 1)
adjustBruteLoss(damage)
react_to_attack(M)
updatehealth()
return
/mob/living/carbon/amorph/attack_animal(mob/living/simple_animal/M as mob)
if(M.melee_damage_upper == 0)
M.emote("[M.friendly] [src]")
else
for(var/mob/O in viewers(src, null))
O.show_message("\red <B>[M]</B> [M.attacktext] [src]!", 1)
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
bruteloss += damage
/mob/living/carbon/amorph/attack_metroid(mob/living/carbon/metroid/M as mob)
if(M.Victim) return // can't attack while eating!
if (health > -100)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>The [M.name] has [pick("bit","slashed")] []!</B>", src), 1)
var/damage = rand(1, 3)
if(istype(M, /mob/living/carbon/metroid/adult))
damage = rand(10, 35)
else
damage = rand(5, 25)
src.cloneloss += damage
UpdateDamageIcon()
if(M.powerlevel > 0)
var/stunprob = 10
var/power = M.powerlevel + rand(0,3)
switch(M.powerlevel)
if(1 to 2) stunprob = 20
if(3 to 4) stunprob = 30
if(5 to 6) stunprob = 40
if(7 to 8) stunprob = 60
if(9) stunprob = 70
if(10) stunprob = 95
if(prob(stunprob))
M.powerlevel -= 3
if(M.powerlevel < 0)
M.powerlevel = 0
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>The [M.name] has shocked []!</B>", src), 1)
Weaken(power)
if (stuttering < power)
stuttering = power
Stun(power)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
if (prob(stunprob) && M.powerlevel >= 8)
adjustFireLoss(M.powerlevel * rand(6,10))
updatehealth()
return
@@ -0,0 +1,12 @@
/mob/living/carbon/amorph/proc/HealDamage(zone, brute, burn)
return heal_overall_damage(brute, burn)
/mob/living/carbon/amorph/UpdateDamageIcon()
// no damage sprites for amorphs yet
return
/mob/living/carbon/amorph/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/sharp = 0, var/used_weapon = null)
if(damagetype == BRUTE)
take_overall_damage(damage, 0)
else
take_overall_damage(0, damage)
@@ -0,0 +1,318 @@
/obj/hud/proc/amorph_hud(var/ui_style='screen1_old.dmi')
src.adding = list( )
src.other = list( )
src.intents = list( )
src.mon_blo = list( )
src.m_ints = list( )
src.mov_int = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.intent_small_hud_objects = list( )
src.g_dither = new /obj/screen( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.g_dither.name = "Mask"
src.g_dither.icon = ui_style
src.g_dither.icon_state = "dither12g"
src.g_dither.layer = 18
src.g_dither.mouse_opacity = 0
src.alien_view = new /obj/screen(src)
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.alien_view.name = "Alien"
src.alien_view.icon = ui_style
src.alien_view.icon_state = "alien"
src.alien_view.layer = 18
src.alien_view.mouse_opacity = 0
src.blurry = new /obj/screen( src )
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.blurry.name = "Blurry"
src.blurry.icon = ui_style
src.blurry.icon_state = "blurry"
src.blurry.layer = 17
src.blurry.mouse_opacity = 0
src.druggy = new /obj/screen( src )
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.druggy.name = "Druggy"
src.druggy.icon = ui_style
src.druggy.icon_state = "druggy"
src.druggy.layer = 17
src.druggy.mouse_opacity = 0
var/obj/screen/using
using = new /obj/screen( src )
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = ui_style
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
//intent small hud objects
var/icon/ico
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
using = new /obj/screen( src )
using.name = "help"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
help_intent = using
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
using = new /obj/screen( src )
using.name = "disarm"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
disarm_intent = using
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
using = new /obj/screen( src )
using.name = "grab"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
grab_intent = using
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
using = new /obj/screen( src )
using.name = "harm"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new /obj/screen( src )
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = ui_style
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
move_intent = using
using = new /obj/screen( src )
using.name = "drop"
using.icon = ui_style
using.icon_state = "act_drop"
using.screen_loc = ui_dropbutton
using.layer = 19
src.adding += using
using = new /obj/screen( src )
using.name = "r_hand"
using.dir = WEST
using.icon = ui_style
using.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
using.icon_state = "hand_active"
using.screen_loc = ui_rhand
using.layer = 19
src.r_hand_hud_object = using
src.adding += using
using = new /obj/screen( src )
using.name = "l_hand"
using.dir = EAST
using.icon = ui_style
using.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
using.icon_state = "hand_active"
using.screen_loc = ui_lhand
using.layer = 19
src.l_hand_hud_object = using
src.adding += using
using = new /obj/screen( src )
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
using.layer = 19
src.adding += using
using = new /obj/screen( src )
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
using.layer = 19
src.adding += using
using = new /obj/screen( src )
using.name = "mask"
using.dir = NORTH
using.icon = ui_style
using.icon_state = "equip"
using.screen_loc = ui_monkey_mask
using.layer = 19
src.adding += using
using = new /obj/screen( src )
using.name = "back"
using.dir = NORTHEAST
using.icon = ui_style
using.icon_state = "equip"
using.screen_loc = ui_back
using.layer = 19
src.adding += using
using = new /obj/screen( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "1,1 to 5,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new /obj/screen( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "5,1 to 10,5"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new /obj/screen( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "6,11 to 10,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new /obj/screen( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "11,1 to 15,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
mymob.throw_icon = new /obj/screen(null)
mymob.throw_icon.icon = ui_style
mymob.throw_icon.icon_state = "act_throw_off"
mymob.throw_icon.name = "throw"
mymob.throw_icon.screen_loc = ui_throw
mymob.oxygen = new /obj/screen( null )
mymob.oxygen.icon = ui_style
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_oxygen
mymob.pressure = new /obj/screen( null )
mymob.pressure.icon = ui_style
mymob.pressure.icon_state = "pressure0"
mymob.pressure.name = "pressure"
mymob.pressure.screen_loc = ui_pressure
mymob.toxin = new /obj/screen( null )
mymob.toxin.icon = ui_style
mymob.toxin.icon_state = "tox0"
mymob.toxin.name = "toxin"
mymob.toxin.screen_loc = ui_toxin
mymob.internals = new /obj/screen( null )
mymob.internals.icon = ui_style
mymob.internals.icon_state = "internal0"
mymob.internals.name = "internal"
mymob.internals.screen_loc = ui_internal
mymob.fire = new /obj/screen( null )
mymob.fire.icon = ui_style
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
mymob.bodytemp = new /obj/screen( null )
mymob.bodytemp.icon = ui_style
mymob.bodytemp.icon_state = "temp1"
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
mymob.healths = new /obj/screen( null )
mymob.healths.icon = ui_style
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_health
mymob.pullin = new /obj/screen( null )
mymob.pullin.icon = ui_style
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull
mymob.blind = new /obj/screen( null )
mymob.blind.icon = ui_style
mymob.blind.icon_state = "blackanimate"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0
mymob.blind.mouse_opacity = 0
mymob.flash = new /obj/screen( null )
mymob.flash.icon = ui_style
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
mymob.zone_sel = new /obj/screen/zone_sel( null )
mymob.zone_sel.overlays = null
mymob.zone_sel.overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
mymob.gun_setting_icon.dir = 2
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
if (G.target)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
mymob.item_use_icon.dir = 1
src.adding += mymob.item_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
mymob.gun_move_icon.dir = 1
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
mymob.gun_run_icon.dir = 1
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
mymob.client.screen = null
//, mymob.i_select, mymob.m_select
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach, mymob.hands, )
mymob.client.screen += src.adding + src.other
//if(istype(mymob,/mob/living/carbon/monkey)) mymob.client.screen += src.mon_blo
return
+516
View File
@@ -0,0 +1,516 @@
/mob/living/carbon/amorph
var/obj/item/weapon/card/id/wear_id = null // Fix for station bounced radios -- Skie
var/oxygen_alert = 0
var/toxins_alert = 0
var/fire_alert = 0
var/temperature_alert = 0
/mob/living/carbon/amorph/Life()
set invisibility = 0
set background = 1
if (src.monkeyizing)
return
..()
var/datum/gas_mixture/environment // Added to prevent null location errors-- TLE
if(src.loc)
environment = loc.return_air()
if (src.stat != 2) //still breathing
//First, resolve location and get a breath
if(air_master.current_cycle%4==2)
//Only try to take a breath every 4 seconds, unless suffocating
breathe()
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
//Apparently, the person who wrote this code designed it so that
//blinded get reset each cycle and then get activated later in the
//code. Very ugly. I dont care. Moving this stuff here so its easy
//to find it.
src.blinded = null
//Disease Check
handle_virus_updates()
//Handle temperature/pressure differences between body and environment
if(environment) // More error checking -- TLE
handle_environment(environment)
//Mutations and radiation
handle_mutations_and_radiation()
//Chemicals in the body
handle_chemicals_in_body()
//Disabilities
handle_disabilities()
//Status updates, death etc.
// UpdateLuminosity()
handle_regular_status_updates()
if(client)
handle_regular_hud_updates()
//Being buckled to a chair or bed
check_if_buckled()
// Yup.
update_canmove()
clamp_values()
// Grabbing
for(var/obj/item/weapon/grab/G in src)
G.process()
/mob/living/carbon/amorph
proc
clamp_values()
AdjustStunned(0)
AdjustParalysis(0)
AdjustWeakened(0)
handle_disabilities()
if (src.disabilities & 4)
if ((prob(5) && src.paralysis <= 1 && src.r_ch_cou < 1))
src.drop_item()
spawn( 0 )
emote("cough")
return
if (src.disabilities & 8)
if ((prob(10) && src.paralysis <= 1 && src.r_Tourette < 1))
Stun(10)
spawn( 0 )
emote("twitch")
return
if (src.disabilities & 16)
if (prob(10))
src.stuttering = max(10, src.stuttering)
update_mind()
if(!mind && client)
mind = new
mind.current = src
mind.key = key
handle_mutations_and_radiation()
// amorphs are immune to this stuff
breathe()
if(src.reagents)
if(src.reagents.has_reagent("lexorin")) return
if(!loc) return //probably ought to make a proper fix for this, but :effort: --NeoFite
var/datum/gas_mixture/environment = loc.return_air()
var/datum/gas_mixture/breath
if(losebreath>0) //Suffocating so do not take a breath
src.losebreath--
if (prob(75)) //High chance of gasping for air
spawn emote("gasp")
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
else
//First, check for air from internal atmosphere (using an air tank and mask generally)
breath = get_breath_from_internal(BREATH_VOLUME)
//No breath from internal atmosphere so get breath from location
if(!breath)
if(istype(loc, /obj/))
var/obj/location_as_object = loc
breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME)
else if(istype(loc, /turf/))
var/breath_moles = environment.total_moles()*BREATH_PERCENTAGE
breath = loc.remove_air(breath_moles)
// Handle chem smoke effect -- Doohl
var/block = 0
if(wear_mask)
if(istype(wear_mask, /obj/item/clothing/mask/gas))
block = 1
if(!block)
for(var/obj/effect/effect/chem_smoke/smoke in view(1, src))
if(smoke.reagents.total_volume)
smoke.reagents.reaction(src, INGEST)
spawn(5)
if(smoke)
smoke.reagents.copy_to(src, 10) // I dunno, maybe the reagents enter the blood stream through the lungs?
break // If they breathe in the nasty stuff once, no need to continue checking
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
handle_breath(breath)
if(breath)
loc.assume_air(breath)
get_breath_from_internal(volume_needed)
if(internal)
if (!contents.Find(src.internal))
internal = null
if (!wear_mask || !(wear_mask.flags|MASKINTERNALS) )
internal = null
if(internal)
if (src.internals)
src.internals.icon_state = "internal1"
return internal.remove_air_volume(volume_needed)
else
if (src.internals)
src.internals.icon_state = "internal0"
return null
update_canmove()
if(paralysis || stunned || weakened || buckled || (changeling && changeling.changeling_fakedeath)) canmove = 0
else canmove = 1
handle_breath(datum/gas_mixture/breath)
if(src.nodamage)
return
if(!breath || (breath.total_moles == 0))
adjustOxyLoss(7)
oxygen_alert = max(oxygen_alert, 1)
return 0
var/safe_oxygen_min = 8 // Minimum safe partial pressure of O2, in kPa
//var/safe_oxygen_max = 140 // Maximum safe partial pressure of O2, in kPa (Not used for now)
var/SA_para_min = 0.5
var/SA_sleep_min = 5
var/oxygen_used = 0
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
//Partial pressure of the O2 in our breath
var/O2_pp = (breath.oxygen/breath.total_moles())*breath_pressure
if(O2_pp < safe_oxygen_min) // Too little oxygen
if(prob(20))
spawn(0) emote("gasp")
if (O2_pp == 0)
O2_pp = 0.01
var/ratio = safe_oxygen_min/O2_pp
adjustOxyLoss(min(5*ratio, 7)) // Don't fuck them up too fast (space only does 7 after all!)
oxygen_used = breath.oxygen*ratio/6
oxygen_alert = max(oxygen_alert, 1)
else // We're in safe limits
adjustOxyLoss(-5)
oxygen_used = breath.oxygen/6
oxygen_alert = 0
breath.oxygen -= oxygen_used
breath.carbon_dioxide += oxygen_used
if(breath.trace_gases.len) // If there's some other shit in the air lets deal with it here.
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
var/SA_pp = (SA.moles/breath.total_moles())*breath_pressure
if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit
Paralyse(3) // 3 gives them one second to wake up and run away a bit!
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
src.sleeping = max(src.sleeping+2, 10)
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
if(prob(20))
spawn(0) emote(pick("giggle", "laugh"))
return 1
handle_environment(datum/gas_mixture/environment)
if(!environment)
return
var/environment_heat_capacity = environment.heat_capacity()
if(istype(loc, /turf/space))
environment_heat_capacity = loc:heat_capacity
if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10)))
var/transfer_coefficient
transfer_coefficient = 1
if(wear_mask && (wear_mask.body_parts_covered & HEAD) && (environment.temperature < wear_mask.protective_temperature))
transfer_coefficient *= wear_mask.heat_transfer_coefficient
handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient)
if(stat==2)
bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000)
//Account for massive pressure differences
var/pressure = environment.return_pressure()
// if(!wear_suit) Monkies cannot into space.
// if(!istype(wear_suit, /obj/item/clothing/suit/space))
/*if(pressure < 20)
if(prob(25))
src << "You feel the splittle on your lips and the fluid on your eyes boiling away, the capillteries in your skin breaking."
adjustBruteLoss(5)
*/
if(pressure > HAZARD_HIGH_PRESSURE)
adjustBruteLoss(min((10+(round(pressure/(HIGH_STEP_PRESSURE)-2)*5)),MAX_PRESSURE_DAMAGE))
return //TODO: DEFERRED
handle_temperature_damage(body_part, exposed_temperature, exposed_intensity)
if(src.nodamage) return
var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0)
if(exposed_temperature > bodytemperature)
adjustFireLoss(20.0*discomfort)
else
adjustFireLoss(5.0*discomfort)
handle_chemicals_in_body()
// most chemicals will have no effect on amorphs
//if(reagents) reagents.metabolize(src)
if (src.drowsyness)
src.drowsyness--
src.eye_blurry = max(2, src.eye_blurry)
if (prob(5))
src.sleeping += 1
Paralyse(5)
confused = max(0, confused - 1)
// decrement dizziness counter, clamped to 0
if(resting)
dizziness = max(0, dizziness - 5)
else
dizziness = max(0, dizziness - 1)
src.updatehealth()
return //TODO: DEFERRED
handle_regular_status_updates()
health = 100 - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss())
if(getOxyLoss() > 25) Paralyse(3)
if(src.sleeping)
Paralyse(5)
if (prob(1) && health) spawn(0) emote("snore")
if(src.resting)
Weaken(5)
if(health < config.health_threshold_dead && stat != 2)
death()
else if(src.health < config.health_threshold_crit)
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
// shuffle around the chemical effects for amorphs a little ;)
if(!src.reagents.has_reagent("antitoxin") && src.stat != 2) src.adjustOxyLoss(2)
if(src.stat != 2) src.stat = 1
Paralyse(5)
if (src.stat != 2) //Alive.
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
if (src.stunned > 0)
AdjustStunned(-1)
src.stat = 0
if (src.weakened > 0)
AdjustWeakened(-1)
src.lying = 1
src.stat = 0
if (src.paralysis > 0)
AdjustParalysis(-1)
src.blinded = 1
src.lying = 1
src.stat = 1
var/h = src.hand
src.hand = 0
drop_item()
src.hand = 1
drop_item()
src.hand = h
else //Not stunned.
src.lying = 0
src.stat = 0
else //Dead.
src.lying = 1
src.blinded = 1
src.stat = 2
if (src.stuttering) src.stuttering--
if (src.slurring) src.slurring--
if (src.eye_blind)
src.eye_blind--
src.blinded = 1
if (src.ear_deaf > 0) src.ear_deaf--
if (src.ear_damage < 25)
src.ear_damage -= 0.05
src.ear_damage = max(src.ear_damage, 0)
src.density = !( src.lying )
if (src.disabilities & 128)
src.blinded = 1
if (src.disabilities & 32)
src.ear_deaf = 1
if (src.eye_blurry > 0)
src.eye_blurry--
src.eye_blurry = max(0, src.eye_blurry)
if (src.druggy > 0)
src.druggy--
src.druggy = max(0, src.druggy)
return 1
handle_regular_hud_updates()
if (src.stat == 2 || (XRAY in mutations))
src.sight |= SEE_TURFS
src.sight |= SEE_MOBS
src.sight |= SEE_OBJS
src.see_in_dark = 8
src.see_invisible = 2
else if (src.stat != 2)
src.sight &= ~SEE_TURFS
src.sight &= ~SEE_MOBS
src.sight &= ~SEE_OBJS
src.see_in_dark = 2
src.see_invisible = 0
if (src.sleep)
src.sleep.icon_state = text("sleep[]", src.sleeping > 0 ? 1 : 0)
src.sleep.overlays = null
if(src.sleeping_willingly)
src.sleep.overlays += icon(src.sleep.icon, "sleep_willing")
if (src.rest) src.rest.icon_state = text("rest[]", src.resting)
if (src.healths)
if (src.stat != 2)
switch(health)
if(100 to INFINITY)
src.healths.icon_state = "health0"
if(80 to 100)
src.healths.icon_state = "health1"
if(60 to 80)
src.healths.icon_state = "health2"
if(40 to 60)
src.healths.icon_state = "health3"
if(20 to 40)
src.healths.icon_state = "health4"
if(0 to 20)
src.healths.icon_state = "health5"
else
src.healths.icon_state = "health6"
else
src.healths.icon_state = "health7"
if (pressure)
var/datum/gas_mixture/environment = loc.return_air()
if(environment)
switch(environment.return_pressure())
if(HAZARD_HIGH_PRESSURE to INFINITY)
pressure.icon_state = "pressure2"
if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE)
pressure.icon_state = "pressure1"
if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE)
pressure.icon_state = "pressure0"
if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE)
pressure.icon_state = "pressure-1"
else
pressure.icon_state = "pressure-2"
if(src.pullin) src.pullin.icon_state = "pull[src.pulling ? 1 : 0]"
if (src.toxin) src.toxin.icon_state = "tox[src.toxins_alert ? 1 : 0]"
if (src.oxygen) src.oxygen.icon_state = "oxy[src.oxygen_alert ? 1 : 0]"
if (src.fire) src.fire.icon_state = "fire[src.fire_alert ? 1 : 0]"
//NOTE: the alerts dont reset when youre out of danger. dont blame me,
//blame the person who coded them. Temporary fix added.
if(bodytemp)
switch(src.bodytemperature) //310.055 optimal body temp
if(345 to INFINITY)
src.bodytemp.icon_state = "temp4"
if(335 to 345)
src.bodytemp.icon_state = "temp3"
if(327 to 335)
src.bodytemp.icon_state = "temp2"
if(316 to 327)
src.bodytemp.icon_state = "temp1"
if(300 to 316)
src.bodytemp.icon_state = "temp0"
if(295 to 300)
src.bodytemp.icon_state = "temp-1"
if(280 to 295)
src.bodytemp.icon_state = "temp-2"
if(260 to 280)
src.bodytemp.icon_state = "temp-3"
else
src.bodytemp.icon_state = "temp-4"
src.client.screen -= src.hud_used.blurry
src.client.screen -= src.hud_used.druggy
src.client.screen -= src.hud_used.vimpaired
if ((src.blind && src.stat != 2))
if ((src.blinded))
src.blind.layer = 18
else
src.blind.layer = 0
if (src.disabilities & 1)
src.client.screen += src.hud_used.vimpaired
if (src.eye_blurry)
src.client.screen += src.hud_used.blurry
if (src.druggy)
src.client.screen += src.hud_used.druggy
if (src.stat != 2)
if (src.machine)
if (!( src.machine.check_eye(src) ))
src.reset_view(null)
else
if(!client.adminobs)
reset_view(null)
return 1
handle_virus_updates()
// amorphs can't come down with human diseases
return
+6
View File
@@ -0,0 +1,6 @@
/mob/living/carbon/amorph/emote(var/act,var/m_type=1,var/message = null)
if(act == "me")
return custom_emote(m_type, message)
/mob/living/carbon/amorph/say_quote(var/text)
return "[src.say_message], \"[text]\"";
+596
View File
@@ -0,0 +1,596 @@
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05
// === MEMETIC ANOMALY ===
// =======================
/**
This life form is a form of parasite that can gain a certain level of control
over its host. Its player will share vision and hearing with the host, and it'll
be able to influence the host through various commands.
**/
// The maximum amount of points a meme can gather.
var/global/const/MAXIMUM_MEME_POINTS = 750
// === PARASITE ===
// ================
// a list of all the parasites in the mob
mob/living/carbon/var/list/parasites = list()
mob/living/parasite
var/mob/living/carbon/host // the host that this parasite occupies
Login()
..()
// make the client see through the host instead
client.eye = host
client.perspective = EYE_PERSPECTIVE
mob/living/parasite/proc/enter_host(mob/living/carbon/host)
// by default, parasites can't share a body with other life forms
if(host.parasites.len > 0)
return 0
src.host = host
src.loc = host
host.parasites.Add(src)
if(client) client.eye = host
return 1
mob/living/parasite/proc/exit_host()
src.host.parasites.Remove(src)
src.host = null
src.loc = null
return 1
// === MEME ===
// ============
// Memes use points for many actions
mob/living/parasite/meme/var/meme_points = 100
mob/living/parasite/meme/var/dormant = 0
// Memes have a list of indoctrinated hosts
mob/living/parasite/meme/var/list/indoctrinated = list()
mob/living/parasite/meme/Life()
..()
if(client)
if(blinded) client.eye = null
else client.eye = host
if(!host) return
// recover meme points slowly
var/gain = 3
if(dormant) gain = 9 // dormant recovers points faster
meme_points = min(meme_points + gain, MAXIMUM_MEME_POINTS)
// if there are sleep toxins in the host's body, that's bad
if(host.reagents.has_reagent("stoxin"))
src << "\red <b>Something in your host's blood makes you lose consciousness.. you fade away..</b>"
src.death()
return
// a host without brain is no good
if(!host.mind)
src << "\red <b>Your host has no mind.. you fade away..</b>"
src.death()
return
if(host.stat == 2)
src << "\red <b>Your host has died.. you fade away..</b>"
src.death()
return
if(host.blinded && host.stat != 1) src.blinded = 1
else src.blinded = 0
mob/living/parasite/meme/death()
// make sure the mob is on the actual map before gibbing
if(host) src.loc = host.loc
src.stat = 2
..()
del src
// When a meme speaks, it speaks through its host
mob/living/parasite/meme/say(message as text)
if(dormant)
usr << "\red You're dormant!"
return
if(!host)
usr << "\red You can't speak without host!"
return
return host.say(message)
// Same as speak, just with whisper
mob/living/parasite/meme/whisper(message as text)
if(dormant)
usr << "\red You're dormant!"
return
if(!host)
usr << "\red You can't speak without host!"
return
return host.whisper(message)
// Make the host do things
mob/living/parasite/meme/me_verb(message as text)
set name = "Me"
if(dormant)
usr << "\red You're dormant!"
return
if(!host)
usr << "\red You can't emote without host!"
return
return host.me_verb(message)
// A meme understands everything their host understands
mob/living/parasite/meme/say_understands(mob/other)
if(!host) return 0
return host.say_understands(other)
// Try to use amount points, return 1 if successful
mob/living/parasite/meme/proc/use_points(amount)
if(dormant)
usr << "\red You're dormant!"
return
if(src.meme_points < amount)
src << "<b>* You don't have enough meme points(need [amount]).</b>"
return 0
src.meme_points -= round(amount)
return 1
// Let the meme choose one of his indoctrinated mobs as target
mob/living/parasite/meme/proc/select_indoctrinated(var/title, var/message)
var/list/candidates
// Can only affect other mobs thant he host if not blinded
if(blinded)
candidates = list()
src << "\red You are blinded, so you can not affect mobs other than your host."
else
candidates = indoctrinated.Copy()
candidates.Add(src.host)
var/mob/target = null
if(candidates.len == 1)
target = candidates[1]
else
var/selected
var/list/text_candidates = list()
var/list/map_text_to_mob = list()
for(var/mob/living/carbon/human/M in candidates)
text_candidates += M.real_name
map_text_to_mob[M.real_name] = M
selected = input(message,title) as null|anything in text_candidates
if(!selected) return null
target = map_text_to_mob[selected]
return target
// A meme can make people hear things with the thought ability
mob/living/parasite/meme/verb/Thought()
set category = "Meme"
set name = "Thought(50)"
set desc = "Implants a thought into the target, making them think they heard someone talk."
if(meme_points < 50)
// just call use_points() to give the standard failure message
use_points(50)
return
var/list/candidates = indoctrinated.Copy()
if(!(src.host in candidates))
candidates.Add(src.host)
var/mob/target = select_indoctrinated("Thought", "Select a target which will hear your thought.")
if(!target) return
var/speaker = input("Select the voice in which you would like to make yourself heard.", "Voice") as null|text
if(!speaker) return
var/message = input("What would you like to say?", "Message") as null
if(!message) return
// Use the points at the end rather than the beginning, because the user might cancel
if(!use_points(50)) return
message = say_quote(message)
var/rendered = "<span class='game say'><span class='name'>[speaker]</span> <span class='message'>[message]</span></span>"
target.show_message(rendered)
usr << "<i>You make [target] hear:</i> [rendered]"
// Mutes the host
mob/living/parasite/meme/verb/Mute()
set category = "Meme"
set name = "Mute(250)"
set desc = "Prevents your host from talking for a while."
if(!src.host) return
if(!host.speech_allowed)
usr << "\red Your host already can't speak.."
return
if(!use_points(250)) return
spawn
// backup the host incase we switch hosts after using the verb
var/mob/host = src.host
host << "\red Your tongue feels numb.. You lose your ability to speak."
usr << "\red Your host can't speak anymore."
host.speech_allowed = 0
sleep(1200)
host.speech_allowed = 1
host << "\red Your tongue has feeling again.."
usr << "\red [host] can speak again."
// Makes the host unable to emote
mob/living/parasite/meme/verb/Paralyze()
set category = "Meme"
set name = "Paralyze(250)"
set desc = "Prevents your host from using emote for a while."
if(!src.host) return
if(!host.use_me)
usr << "\red Your host already can't use body language.."
return
if(!use_points(250)) return
spawn
// backup the host incase we switch hosts after using the verb
var/mob/host = src.host
host << "\red Your body feels numb.. You lose your ability to use body language."
usr << "\red Your host can't use body language anymore."
host.use_me = 0
sleep(1200)
host.use_me = 1
host << "\red Your body has feeling again.."
usr << "\red [host] can use body language again."
// Cause great agony with the host, used for conditioning the host
mob/living/parasite/meme/verb/Agony()
set category = "Meme"
set name = "Agony(200)"
set desc = "Causes significant pain in your host."
if(!src.host) return
if(!use_points(200)) return
spawn
// backup the host incase we switch hosts after using the verb
var/mob/host = src.host
host.paralysis = max(host.paralysis, 2)
host.flash_weak_pain()
host << "\red <font size=5>You feel excrutiating pain all over your body! It is so bad you can't think or articulate yourself properly..</font>"
usr << "<b>You send a jolt of agonizing pain through [host], they should be unable to concentrate on anything else for half a minute.</b>"
host.emote("scream")
for(var/i=0, i<10, i++)
host.stuttering = 2
sleep(50)
if(prob(80)) host.flash_weak_pain()
if(prob(10)) host.paralysis = max(host.paralysis, 2)
if(prob(15)) host.emote("twitch")
else if(prob(15)) host.emote("scream")
else if(prob(10)) host.emote("collapse")
if(i == 10)
host << "\red THE PAIN! AGHH, THE PAIN! MAKE IT STOP! ANYTHING TO MAKE IT STOP!"
host << "\red The pain subsides.."
// Cause great joy with the host, used for conditioning the host
mob/living/parasite/meme/verb/Joy()
set category = "Meme"
set name = "Joy(200)"
set desc = "Causes significant joy in your host."
if(!src.host) return
if(!use_points(200)) return
spawn
var/mob/host = src.host
host.druggy = max(host.druggy, 50)
host.slurring = max(host.slurring, 10)
usr << "<b>You stimulate [host.name]'s brain, injecting waves of endorphines and dopamine into the tissue. They should now forget all their worries, particularly relating to you, for around a minute."
host << "\red You are feeling wonderful! Your head is numb and drowsy, and you can't help forgetting all the worries in the world."
while(host.druggy > 0)
sleep(10)
host << "\red You are feeling clear-headed again.."
// Cause the target to hallucinate.
mob/living/parasite/meme/verb/Hallucinate()
set category = "Meme"
set name = "Hallucinate(300)"
set desc = "Makes your host hallucinate, has a short delay."
var/mob/target = select_indoctrinated("Hallucination", "Who should hallucinate?")
if(!target) return
if(!use_points(300)) return
target.hallucination += 100
usr << "<b>You make [target] hallucinate.</b>"
// Jump to a closeby target through a whisper
mob/living/parasite/meme/verb/SubtleJump(mob/living/carbon/human/target as mob in world)
set category = "Meme"
set name = "Subtle Jump(350)"
set desc = "Move to a closeby human through a whisper."
if(!istype(target, /mob/living/carbon/human) || !target.mind)
src << "<b>You can't jump to this creature..</b>"
return
if(!(target in view(1, host)+src))
src << "<b>The target is not close enough.</b>"
return
// Find out whether we can speak
if (host.silent || (host.disabilities & 64))
src << "<b>Your host can't speak..</b>"
return
if(!use_points(350)) return
for(var/mob/M in view(1, host))
M.show_message("<B>[host]</B> whispers something incoherent.",2) // 2 stands for hearable message
// Find out whether the target can hear
if(target.disabilities & 32 || target.ear_deaf)
src << "<b>Your target doesn't seem to hear you..</b>"
return
if(target.parasites.len > 0)
src << "<b>Your target already is possessed by something..</b>"
return
src.exit_host()
src.enter_host(target)
usr << "<b>You successfully jumped to [target]."
log_admin("[src.key] has jumped to [target]")
message_admins("[src.key] has jumped to [target]")
// Jump to a distant target through a shout
mob/living/parasite/meme/verb/ObviousJump(mob/living/carbon/human/target as mob in world)
set category = "Meme"
set name = "Obvious Jump(750)"
set desc = "Move to any mob in view through a shout."
if(!istype(target, /mob/living/carbon/human) || !target.mind)
src << "<b>You can't jump to this creature..</b>"
return
if(!(target in view(host)))
src << "<b>The target is not close enough.</b>"
return
// Find out whether we can speak
if (host.silent || (host.disabilities & 64))
src << "<b>Your host can't speak..</b>"
return
if(!use_points(750)) return
for(var/mob/M in view(host)+src)
M.show_message("<B>[host]</B> screams something incoherent!",2) // 2 stands for hearable message
// Find out whether the target can hear
if(target.disabilities & 32 || target.ear_deaf)
src << "<b>Your target doesn't seem to hear you..</b>"
return
if(target.parasites.len > 0)
src << "<b>Your target already is possessed by something..</b>"
return
src.exit_host()
src.enter_host(target)
usr << "<b>You successfully jumped to [target]."
log_admin("[src.key] has jumped to [target]")
message_admins("[src.key] has jumped to [target]")
// Jump to an attuned mob for free
mob/living/parasite/meme/verb/AttunedJump(mob/living/carbon/human/target as mob in world)
set category = "Meme"
set name = "Attuned Jump(0)"
set desc = "Move to a mob in sight that you have already attuned."
if(!istype(target, /mob/living/carbon/human) || !target.mind)
src << "<b>You can't jump to this creature..</b>"
return
if(!(target in view(host)))
src << "<b>You need to make eye-contact with the target.</b>"
return
if(!(target in indoctrinated))
src << "<b>You need to attune the target first.</b>"
return
src.exit_host()
src.enter_host(target)
usr << "<b>You successfully jumped to [target]."
log_admin("[src.key] has jumped to [target]")
message_admins("[src.key] has jumped to [target]")
// ATTUNE a mob, adding it to the indoctrinated list
mob/living/parasite/meme/verb/Attune()
set category = "Meme"
set name = "Attune(400)"
set desc = "Change the host's brain structure, making it easier for you to manipulate him."
if(host in src.indoctrinated)
usr << "<b>You have already attuned this host.</b>"
return
if(!host) return
if(!use_points(400)) return
src.indoctrinated.Add(host)
usr << "<b>You successfully indoctrinated [host]."
host << "\red Your head feels a bit roomier.."
log_admin("[src.key] has attuned [host]")
message_admins("[src.key] has attuned [host]")
// Enables the mob to take a lot more damage
mob/living/parasite/meme/verb/Analgesic()
set category = "Meme"
set name = "Analgesic(500)"
set desc = "Combat drug that the host to move normally, even under life-threatening pain."
if(!host) return
if(!(host in indoctrinated))
usr << "\red You need to attune the host first."
return
if(!use_points(500)) return
usr << "<b>You inject drugs into [host]."
host << "\red You feel your body strengthen and your pain subside.."
host.analgesic = 60
while(host.analgesic > 0)
sleep(10)
host << "\red The dizziness wears off, and you can feel pain again.."
mob/proc/clearHUD()
if(client) client.screen.Cut()
// Take control of the mob
mob/living/parasite/meme/verb/Possession()
set category = "Meme"
set name = "Possession(500)"
set desc = "Take direct control of the host for a while."
if(!host) return
if(!(host in indoctrinated))
usr << "\red You need to attune the host first."
return
if(!use_points(500)) return
usr << "<b>You take control of [host]!</b>"
host << "\red Everything goes black.."
spawn
var/mob/dummy = new()
dummy.loc = 0
dummy.sight = BLIND
var/datum/mind/host_mind = host.mind
var/datum/mind/meme_mind = src.mind
host_mind.transfer_to(dummy)
meme_mind.transfer_to(host)
host_mind.current.clearHUD()
host.update_clothing()
dummy << "\blue You feel very drowsy.. Your eyelids become heavy..."
log_admin("[meme_mind.key] has taken possession of [host]([host_mind.key])")
message_admins("[meme_mind.key] has taken possession of [host]([host_mind.key])")
sleep(600)
log_admin("[meme_mind.key] has lost possession of [host]([host_mind.key])")
message_admins("[meme_mind.key] has lost possession of [host]([host_mind.key])")
meme_mind.transfer_to(src)
host_mind.transfer_to(host)
meme_mind.current.clearHUD()
host.update_clothing()
src << "\red You lose control.."
del dummy
// Enter dormant mode, increases meme point gain
mob/living/parasite/meme/verb/Dormant()
set category = "Meme"
set name = "Dormant(100)"
set desc = "Speed up point recharging, will force you to cease all actions until all points are recharged."
if(!host) return
if(!use_points(100)) return
usr << "<b>You enter dormant mode.. You won't be able to take action until all your points have recharged.</b>"
dormant = 1
while(meme_points < MAXIMUM_MEME_POINTS)
sleep(10)
dormant = 0
usr << "\red You have regained all points and exited dormant mode!"
mob/living/parasite/meme/verb/Show_Points()
set category = "Meme"
usr << "<b>Meme Points: [src.meme_points]/[MAXIMUM_MEME_POINTS]</b>"
// Stat panel to show meme points, copypasted from alien
/mob/living/parasite/meme/Stat()
..()
statpanel("Status")
if (client && client.holder)
stat(null, "([x], [y], [z])")
if (client && client.statpanel == "Status")
stat(null, "Meme Points: [src.meme_points]")
// Game mode helpers, used for theft objectives
// --------------------------------------------
mob/living/parasite/check_contents_for(t)
if(!host) return 0
return host.check_contents_for(t)
mob/living/parasite/check_contents_for_reagent(t)
if(!host) return 0
return host.check_contents_for_reagent(t)
+332 -53
View File
@@ -7,6 +7,11 @@ log transactions
*/
#define NO_SCREEN 0
#define CHANGE_SECURITY_LEVEL 1
#define TRANSFER_FUNDS 2
#define VIEW_TRANSACTION_LOGS 3
/obj/item/weapon/card/id/var/money = 2000
/obj/machinery/atm
@@ -17,72 +22,346 @@ log transactions
anchored = 1
use_power = 1
idle_power_usage = 10
var/obj/machinery/account_database/linked_db
var/datum/money_account/authenticated_account
var/number_incorrect_tries = 0
var/previous_account_number = 0
var/max_pin_attempts = 3
var/ticks_left_locked_down = 0
var/ticks_left_timeout = 0
var/machine_id = ""
var/obj/item/weapon/card/held_card
var/editing_security_level = 0
var/view_screen = NO_SCREEN
/obj/machinery/atm/New()
..()
reconnect_database()
machine_id = "[station_name()] RT #[num_financial_terminals++]"
/obj/machinery/atm/process()
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--
for(var/obj/item/weapon/spacecash/S in src)
S.loc = src.loc
if(prob(50))
playsound(loc, 'sound/items/polaroid1.ogg', 50, 1)
else
playsound(loc, 'sound/items/polaroid2.ogg', 50, 1)
break
/obj/machinery/atm/proc/reconnect_database()
for(var/obj/machinery/account_database/DB in world)
if(DB.z == src.z)
linked_db = DB
break
/obj/machinery/atm/attackby(obj/item/I as obj, mob/user as mob)
if(ishuman(user))
var/obj/item/weapon/card/id/user_id = src.scan_user(user)
if(istype(I, /obj/item/weapon/card))
var/obj/item/weapon/card/id/idcard = I
if(!held_card)
usr.drop_item()
idcard.loc = src
held_card = idcard
authenticated_account = null
else if(authenticated_account)
if(istype(I,/obj/item/weapon/spacecash))
user_id.money += I:worth
//consume the money
authenticated_account.money += I:worth
if(prob(50))
playsound(loc, 'sound/items/polaroid1.ogg', 50, 1)
else
playsound(loc, 'sound/items/polaroid2.ogg', 50, 1)
//create a transaction log entry
var/datum/transaction/T = new()
T.target_name = authenticated_account.owner_name
T.purpose = "Credit deposit"
T.amount = I:worth
T.source_terminal = machine_id
T.date = current_date_string
T.time = worldtime2text()
authenticated_account.transaction_log.Add(T)
user << "<span class='info'>You insert [I] into [src].</span>"
src.attack_hand(user)
del I
else ..()
/obj/machinery/atm/attack_hand(mob/user as mob)
if(istype(user, /mob/living/silicon))
user << "\red Artificial unit recognized. Artificial units do not currently receive monetary compensation, as per NanoTrasen regulation #1005."
return
if(get_dist(src,user) <= 1)
//check to see if the user has low security enabled
scan_user(user)
var/obj/item/weapon/card/id/user_id = src.scan_user(user)
if(..())
return
var/dat = ""
dat += "<h1>NanoTrasen Automatic Teller Machine</h1><br/>"
dat += "For all your monetary needs!<br/><br/>"
dat += "Welcome, [user_id.registered_name].<br/>"
dat += "You have $[user_id.money] in your account.<br/>"
dat += "<a href=\"?src=\ref[src]&withdraw=1&id=\ref[user_id]\">Withdraw</a><br/>"
user << browse(dat,"window=atm")
//js replicated from obj/machinery/computer/card
var/dat = "<h1>NanoTrasen Automatic Teller Machine</h1>"
dat += "For all your monetary needs!<br>"
dat += "<i>This terminal is</i> [machine_id]. <i>Report this code when contacting NanoTrasen IT Support</i><br/>"
dat += "Card: <a href='?src=\ref[src];choice=insert_card'>[held_card ? held_card.name : "------"]</a><br><br>"
if(ticks_left_locked_down > 0)
dat += "<span class='alert'>Maximum number of pin attempts exceeded! Access to this ATM has been temporarily disabled.</span>"
else if(authenticated_account)
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."
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."
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>"
text = "Two - In addition to account number and pin, a card is required to access this account and process transactions."
if(authenticated_account.security_level != 2)
text = "<A href='?src=\ref[src];choice=change_security_level;new_security_level=2'>[text]</a>"
dat += "[text]<hr><br>"
dat += "<A href='?src=\ref[src];choice=view_screen;view_screen=0'>Back</a>"
if(VIEW_TRANSACTION_LOGS)
dat += "<b>Transaction logs</b><br>"
dat += "<A href='?src=\ref[src];choice=view_screen;view_screen=0'>Back</a>"
dat += "<table border=1 style='width:100%'>"
dat += "<tr>"
dat += "<td><b>Date</b></td>"
dat += "<td><b>Time</b></td>"
dat += "<td><b>Target</b></td>"
dat += "<td><b>Purpose</b></td>"
dat += "<td><b>Value</b></td>"
dat += "<td><b>Source terminal ID</b></td>"
dat += "</tr>"
for(var/datum/transaction/T in authenticated_account.transaction_log)
dat += "<tr>"
dat += "<td>[T.date]</td>"
dat += "<td>[T.time]</td>"
dat += "<td>[T.target_name]</td>"
dat += "<td>[T.purpose]</td>"
dat += "<td>$[T.amount]</td>"
dat += "<td>[T.source_terminal]</td>"
dat += "</tr>"
dat += "</table>"
if(TRANSFER_FUNDS)
dat += "<b>Account balance:</b> $[authenticated_account.money]<br>"
dat += "<A href='?src=\ref[src];choice=view_screen;view_screen=0'>Back</a><br><br>"
dat += "<form name='transfer' action='?src=\ref[src]' method='get'>"
dat += "<input type='hidden' name='src' value='\ref[src]'>"
dat += "<input type='hidden' name='choice' value='transfer'>"
dat += "Target account number: <input type='text' name='target_acc_number' value='' style='width:200px; background-color:white;'><br>"
dat += "Funds to transfer: <input type='text' name='funds_amount' value='' style='width:200px; background-color:white;'><br>"
dat += "Transaction purpose: <input type='text' name='purpose' value='Funds transfer' style='width:200px; background-color:white;'><br>"
dat += "<input type='submit' value='Transfer funds'><br>"
dat += "</form>"
else
dat += "Welcome, <b>[authenticated_account.owner_name].</b><br/>"
dat += "<b>Account balance:</b> $[authenticated_account.money]"
dat += "<form name='withdrawal' action='?src=\ref[src]' method='get'>"
dat += "<input type='hidden' name='src' value='\ref[src]'>"
dat += "<input type='hidden' name='choice' value='withdrawal'>"
dat += "<input type='text' name='funds_amount' value='' style='width:200px; background-color:white;'><input type='submit' value='Withdraw funds'><br>"
dat += "</form>"
dat += "<A href='?src=\ref[src];choice=view_screen;view_screen=1'>Change account security level</a><br>"
dat += "<A href='?src=\ref[src];choice=view_screen;view_screen=2'>Make transfer</a><br>"
dat += "<A href='?src=\ref[src];choice=view_screen;view_screen=3'>View transaction log</a><br>"
dat += "<A href='?src=\ref[src];choice=balance_statement'>Print balance statement</a><br>"
dat += "<A href='?src=\ref[src];choice=logout'>Logout</a><br>"
else if(linked_db)
dat += "<form name='atm_auth' action='?src=\ref[src]' method='get'>"
dat += "<input type='hidden' name='src' value='\ref[src]'>"
dat += "<input type='hidden' name='choice' value='attempt_auth'>"
dat += "<b>Account:</b> <input type='text' id='account_num' name='account_num' style='width:250px; background-color:white;'><br>"
dat += "<b>PIN:</b> <input type='text' id='account_pin' name='account_pin' style='width:250px; background-color:white;'><br>"
dat += "<input type='submit' value='Submit'><br>"
dat += "</form>"
else
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")
else
user << browse(null,"window=atm")
/obj/machinery/atm/Topic(var/href, var/href_list)
if(href_list["withdraw"] && href_list["id"])
var/amount = input("How much would you like to withdraw?", "Amount", 0) in list(1,10,20,50,100,200,500,1000, 0)
var/obj/item/weapon/card/id/user_id = locate(href_list["id"])
if(amount != 0 && user_id)
if(amount <= user_id.money)
user_id.money -= amount
//hueg switch for giving moneh out
switch(amount)
if(1)
new /obj/item/weapon/spacecash(loc)
if(10)
new /obj/item/weapon/spacecash/c10(loc)
if(20)
new /obj/item/weapon/spacecash/c20(loc)
if(50)
new /obj/item/weapon/spacecash/c50(loc)
if(100)
new /obj/item/weapon/spacecash/c100(loc)
if(200)
new /obj/item/weapon/spacecash/c200(loc)
if(500)
new /obj/item/weapon/spacecash/c500(loc)
if(1000)
new /obj/item/weapon/spacecash/c1000(loc)
else
usr << browse("You don't have that much money!<br/><a href=\"?src=\ref[src]\">Back</a>","window=atm")
return
if(href_list["choice"])
switch(href_list["choice"])
if("transfer")
if(authenticated_account && linked_db)
var/target_account_number = text2num(href_list["target_acc_number"])
var/transfer_amount = text2num(href_list["funds_amount"])
var/transfer_purpose = href_list["purpose"]
if(transfer_amount <= authenticated_account.money)
if(linked_db.charge_to_account(target_account_number, authenticated_account.owner_name, transfer_purpose, machine_id, transfer_amount))
usr << "\icon[src]<span class='info'>Funds transfer successful.</span>"
authenticated_account.money -= transfer_amount
//create an entry in the account transaction log
var/datum/transaction/T = new()
T.target_name = "Account #[target_account_number]"
T.purpose = transfer_purpose
T.source_terminal = machine_id
T.date = current_date_string
T.time = worldtime2text()
T.amount = "([transfer_amount])"
authenticated_account.transaction_log.Add(T)
else
usr << "\icon[src]<span class='warning'>Funds transfer failed.</span>"
else
usr << "\icon[src]<span class='warning'>You don't have enough funds to do that!</span>"
if("view_screen")
view_screen = text2num(href_list["view_screen"])
if("change_security_level")
if(authenticated_account)
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)
var/tried_account_num = text2num(href_list["account_num"])
if(!tried_account_num)
tried_account_num = held_card.associated_account_number
var/tried_pin = text2num(href_list["account_pin"])
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)
if(previous_account_number == tried_account_num)
if(++number_incorrect_tries > max_pin_attempts)
//lock down the atm
number_incorrect_tries = 0
ticks_left_locked_down = 10
playsound(src, 'buzz-two.ogg', 50, 1)
//create an entry in the account transaction log
var/datum/transaction/T = new()
T.target_name = authenticated_account.owner_name
T.purpose = "Unauthorised login attempt"
T.source_terminal = machine_id
T.date = current_date_string
T.time = worldtime2text()
authenticated_account.transaction_log.Add(T)
else
previous_account_number = tried_account_num
number_incorrect_tries = 1
playsound(src, 'buzz-sigh.ogg', 50, 1)
else
playsound(src, 'twobeep.ogg', 50, 1)
ticks_left_timeout = 120
view_screen = NO_SCREEN
//create a transaction log entry
var/datum/transaction/T = new()
T.target_name = authenticated_account.owner_name
T.purpose = "Remote terminal access"
T.source_terminal = machine_id
T.date = current_date_string
T.time = worldtime2text()
authenticated_account.transaction_log.Add(T)
if("withdrawal")
var/amount = max(text2num(href_list["funds_amount"]),0)
if(authenticated_account && amount > 0)
if(amount <= authenticated_account.money)
playsound(src, 'chime.ogg', 50, 1)
//remove the money
authenticated_account.money -= amount
withdraw_arbitrary_sum(amount)
//create an entry in the account transaction log
var/datum/transaction/T = new()
T.target_name = authenticated_account.owner_name
T.purpose = "Credit withdrawal"
T.amount = "([amount])"
T.source_terminal = machine_id
T.date = current_date_string
T.time = worldtime2text()
authenticated_account.transaction_log.Add(T)
else
usr << "\icon[src]<span class='warning'>You don't have enough funds to do that!</span>"
if("balance_statement")
if(authenticated_account)
var/obj/item/weapon/paper/R = new(src.loc)
R.name = "Account balance: [authenticated_account.owner_name]"
R.info = "<b>NT Automated Teller Account Statement</b><br><br>"
R.info += "<i>Account holder:</i> [authenticated_account.owner_name]<br>"
R.info += "<i>Account number:</i> [authenticated_account.account_number]<br>"
R.info += "<i>Balance:</i> $[authenticated_account.money]<br>"
R.info += "<i>Date and time:</i> [worldtime2text()], [current_date_string]<br><br>"
R.info += "<i>Service terminal ID:</i> [machine_id]<br>"
//stamp the paper
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
stampoverlay.icon_state = "paper_stamp-cent"
if(!R.stamped)
R.stamped = new
R.stamped += /obj/item/weapon/stamp
R.overlays += stampoverlay
R.stamps += "<HR><i>This paper has been stamped by the Automatic Teller Machine.</i>"
if(prob(50))
playsound(loc, 'sound/items/polaroid1.ogg', 50, 1)
else
playsound(loc, 'sound/items/polaroid2.ogg', 50, 1)
if("insert_card")
if(held_card)
held_card.loc = src.loc
authenticated_account = null
if(ishuman(usr) && !usr.get_active_hand())
usr.put_in_hands(held_card)
held_card = null
else
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card/id))
usr.drop_item()
I.loc = src
held_card = I
if("logout")
authenticated_account = null
src.attack_hand(usr)
//create the most effective combination of notes to make up the requested amount
/obj/machinery/atm/proc/withdraw_arbitrary_sum(var/arbitrary_sum)
while(arbitrary_sum >= 1000)
arbitrary_sum -= 1000
new /obj/item/weapon/spacecash/c1000(src)
while(arbitrary_sum >= 500)
arbitrary_sum -= 500
new /obj/item/weapon/spacecash/c500(src)
while(arbitrary_sum >= 200)
arbitrary_sum -= 200
new /obj/item/weapon/spacecash/c200(src)
while(arbitrary_sum >= 100)
arbitrary_sum -= 100
new /obj/item/weapon/spacecash/c100(src)
while(arbitrary_sum >= 50)
arbitrary_sum -= 50
new /obj/item/weapon/spacecash/c50(src)
while(arbitrary_sum >= 20)
arbitrary_sum -= 20
new /obj/item/weapon/spacecash/c20(src)
while(arbitrary_sum >= 10)
arbitrary_sum -= 10
new /obj/item/weapon/spacecash/c10(src)
while(arbitrary_sum >= 1)
arbitrary_sum -= 1
new /obj/item/weapon/spacecash(src)
//stolen wholesale and then edited a bit from newscasters, which are awesome and by Agouri
/obj/machinery/atm/proc/scan_user(mob/living/carbon/human/human_user as mob)
if(human_user.wear_id)
if(istype(human_user.wear_id, /obj/item/device/pda) )
var/obj/item/device/pda/P = human_user.wear_id
if(P.id)
return P.id
else
return null
else if(istype(human_user.wear_id, /obj/item/weapon/card/id) )
return human_user.wear_id
else
return null
else
return null
if(!authenticated_account && linked_db)
if(human_user.wear_id)
var/obj/item/weapon/card/id/I
if(istype(human_user.wear_id, /obj/item/weapon/card/id) )
I = human_user.wear_id
else if(istype(human_user.wear_id, /obj/item/device/pda) )
var/obj/item/device/pda/P = human_user.wear_id
I = P.id
if(I)
authenticated_account = linked_db.attempt_account_access(I.associated_account_number)
+9 -1
View File
@@ -16,7 +16,7 @@
/obj/machinery/computer/atmoscontrol/attack_hand(mob/user)
if(..())
return
user.machine = src
user.set_machine(src)
if(allowed(user))
overridden = 1
else if(!emagged)
@@ -139,6 +139,12 @@
src.updateUsrDialog()
return
if(href_list["atmos_unlock"])
switch(href_list["atmos_unlock"])
if("0")
current.air_doors_close(1)
if("1")
current.air_doors_open(1)
if(href_list["atmos_alarm"])
if (current.alarm_area.atmosalert(2))
@@ -187,6 +193,8 @@
output += "<font color='red'><B>PANIC SYPHON ACTIVE</B></font><br><A href='?src=\ref[src];alarm=\ref[current];mode=[AALARM_MODE_SCRUBBING]'>turn syphoning off</A>"
else
output += "<A href='?src=\ref[src];alarm=\ref[current];mode=[AALARM_MODE_PANIC]'><font color='red'><B>ACTIVATE PANIC SYPHON IN AREA</B></font></A>"
output += "<br><br>Atmospheric Lockdown: <a href='?src=\ref[src];alarm=\ref[current];atmos_unlock=[current.alarm_area.air_doors_activated]'>[current.alarm_area.air_doors_activated ? "<b>ENABLED</b>" : "Disabled"]</a>"
if (AALARM_SCREEN_VENT)
var/sensor_data = ""
if(current.alarm_area.air_vent_names.len)
+1 -1
View File
@@ -31,7 +31,7 @@ A list of items and costs is stored under the datum of every game mode, alongsid
if(!uplink_data)
uplink_data = ticker.mode.uplink_items
items = dd_replacetext(uplink_data, "\n", "") // Getting the text string of items
items = replacetext(uplink_data, "\n", "") // Getting the text string of items
ItemList = dd_text2list(src.items, ";") // Parsing the items text string
uses = ticker.mode.uplink_uses
+1 -1
View File
@@ -40,7 +40,7 @@
/obj/item/tape/engineering
name = "engineering tape"
desc = "A length of engineering tape. Better not cross it."
req_access = list(access_engine,access_atmospherics)
req_one_access = list(access_engine,access_atmospherics)
icon_base = "engineering"
/obj/item/taperoll/attack_self(mob/user as mob)
@@ -0,0 +1,8 @@
/*
Hey you!
You only need to untick maps/tgstation.2.0.9.dmm for this if you download the modified map from:
http://tgstation13.googlecode.com/files/tgstation.2.1.0_deptsec.zip
Everything else can just be ticked on top of the original stuff.
*/
@@ -0,0 +1,126 @@
var/list/sec_departments = list("engineering", "supply", "medical", "science")
proc/assign_sec_to_department(var/mob/living/carbon/human/H)
if(sec_departments.len)
var/department = pick(sec_departments)
sec_departments -= department
var/access = null
var/destination = null
switch(department)
if("supply")
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/cargo(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/supply(H), slot_ears)
access = list(access_mailsorting, access_mining)
destination = /area/security/checkpoint/supply
if("engineering")
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/engine(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/engi(H), slot_ears)
access = list(access_construction, access_engine)
destination = /area/security/checkpoint/engineering
if("medical")
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/med(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/med(H), slot_ears)
access = list(access_medical)
destination = /area/security/checkpoint/medical
if("science")
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/science(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/sci(H), slot_ears)
access = list(access_research)
destination = /area/security/checkpoint/science
else
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears)
if(destination)
var/teleport = 0
if(!ticker || ticker.current_state <= GAME_STATE_SETTING_UP)
teleport = 1
spawn(15)
if(H)
if(teleport)
var/turf/T
var/safety = 0
while(safety < 25)
T = pick(get_area_turfs(destination))
if(!H.Move(T))
safety += 1
continue
else
break
H << "<b>You have been assigned to [department]!</b>"
if(locate(/obj/item/weapon/card/id, H))
var/obj/item/weapon/card/id/I = locate(/obj/item/weapon/card/id, H)
if(I)
I.access |= access
/datum/job/officer
title = "Security Officer"
flag = OFFICER
department_flag = ENGSEC
faction = "Station"
total_positions = 5
spawn_positions = 5
supervisors = "the head of security, and the head of your assigned department (if applicable)"
selection_color = "#ffeeee"
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(H), slot_back)
if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
assign_sec_to_department(H)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/jackboots(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/security(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(H), slot_wear_suit)
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet(H), slot_head)
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_s_store)
H.equip_to_slot_or_del(new /obj/item/device/flash(H), slot_l_store)
if(H.backbag == 1)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_l_hand)
else
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
return 1
/obj/item/device/radio/headset/headset_sec/department/New()
if(radio_controller)
initialize()
recalculateChannels()
/obj/item/device/radio/headset/headset_sec/department/engi
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
keyslot2 = new /obj/item/device/encryptionkey/headset_eng
/obj/item/device/radio/headset/headset_sec/department/supply
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
keyslot2 = new /obj/item/device/encryptionkey/headset_cargo
/obj/item/device/radio/headset/headset_sec/department/med
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
keyslot2 = new /obj/item/device/encryptionkey/headset_med
/obj/item/device/radio/headset/headset_sec/department/sci
keyslot1 = new /obj/item/device/encryptionkey/headset_sec
keyslot2 = new /obj/item/device/encryptionkey/headset_sci
/obj/item/clothing/under/rank/security/cargo/New()
var/obj/item/clothing/tie/armband/cargo/A = new /obj/item/clothing/tie/armband/cargo
hastie = A
/obj/item/clothing/under/rank/security/engine/New()
var/obj/item/clothing/tie/armband/engine/A = new /obj/item/clothing/tie/armband/engine
hastie = A
/obj/item/clothing/under/rank/security/science/New()
var/obj/item/clothing/tie/armband/science/A = new /obj/item/clothing/tie/armband/science
hastie = A
/obj/item/clothing/under/rank/security/med/New()
var/obj/item/clothing/tie/armband/medgreen/A = new /obj/item/clothing/tie/armband/medgreen
hastie = A
@@ -0,0 +1,10 @@
/*
Hey you!
You'll need to untick code/game/jobs/access.dm for this to all work correctly!
Everything else can just be ticked on top of the original stuff.
You'll also need to download a modified map from http://tgstation13.googlecode.com/files/tgstation.2.0.9_Softcurity.zip.
Make sure to untick the original map!
*/
@@ -0,0 +1,522 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
/var/const/access_security = 1 // Security equipment
/var/const/access_brig = 2 // Brig timers and permabrig
/var/const/access_armory = 3
/var/const/access_forensics_lockers= 4
/var/const/access_medical = 5
/var/const/access_morgue = 6
/var/const/access_tox = 7
/var/const/access_tox_storage = 8
/var/const/access_genetics = 9
/var/const/access_engine = 10
/var/const/access_engine_equip= 11
/var/const/access_maint_tunnels = 12
/var/const/access_external_airlocks = 13
/var/const/access_emergency_storage = 14
/var/const/access_change_ids = 15
/var/const/access_ai_upload = 16
/var/const/access_teleporter = 17
/var/const/access_eva = 18
/var/const/access_heads = 19
/var/const/access_captain = 20
/var/const/access_all_personal_lockers = 21
/var/const/access_chapel_office = 22
/var/const/access_tech_storage = 23
/var/const/access_atmospherics = 24
/var/const/access_bar = 25
/var/const/access_janitor = 26
/var/const/access_crematorium = 27
/var/const/access_kitchen = 28
/var/const/access_robotics = 29
/var/const/access_rd = 30
/var/const/access_cargo = 31
/var/const/access_construction = 32
/var/const/access_chemistry = 33
/var/const/access_cargo_bot = 34
/var/const/access_hydroponics = 35
/var/const/access_manufacturing = 36
/var/const/access_library = 37
/var/const/access_lawyer = 38
/var/const/access_virology = 39
/var/const/access_cmo = 40
/var/const/access_qm = 41
/var/const/access_court = 42
/var/const/access_clown = 43
/var/const/access_mime = 44
/var/const/access_surgery = 45
/var/const/access_theatre = 46
/var/const/access_research = 47
/var/const/access_mining = 48
/var/const/access_mining_office = 49 //not in use
/var/const/access_mailsorting = 50
/var/const/access_mint = 51
/var/const/access_mint_vault = 52
/var/const/access_heads_vault = 53
/var/const/access_mining_station = 54
/var/const/access_xenobiology = 55
/var/const/access_ce = 56
/var/const/access_hop = 57
/var/const/access_hos = 58
/var/const/access_RC_announce = 59 //Request console announcements
/var/const/access_keycard_auth = 60 //Used for events which require at least two people to confirm them
/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
//BEGIN CENTCOM ACCESS
/*Should leave plenty of room if we need to add more access levels.
/var/const/Mostly for admin fun times.*/
/var/const/access_cent_general = 101//General facilities.
/var/const/access_cent_thunder = 102//Thunderdome.
/var/const/access_cent_specops = 103//Special Ops.
/var/const/access_cent_medical = 104//Medical/Research
/var/const/access_cent_living = 105//Living quarters.
/var/const/access_cent_storage = 106//Generic storage areas.
/var/const/access_cent_teleporter = 107//Teleporter.
/var/const/access_cent_creed = 108//Creed's office.
/var/const/access_cent_captain = 109//Captain's office/ID comp/AI.
//The Syndicate
/var/const/access_syndicate = 150//General Syndicate Access
//MONEY
/var/const/access_crate_cash = 200
/obj/var/list/req_access = null
/obj/var/req_access_txt = "0"
/obj/var/list/req_one_access = null
/obj/var/req_one_access_txt = "0"
/obj/New()
..()
//NOTE: If a room requires more than one access (IE: Morgue + medbay) set the req_acesss_txt to "5;6" if it requires 5 and 6
if(src.req_access_txt)
var/list/req_access_str = text2list(req_access_txt,";")
if(!req_access)
req_access = list()
for(var/x in req_access_str)
var/n = text2num(x)
if(n)
req_access += n
if(src.req_one_access_txt)
var/list/req_one_access_str = text2list(req_one_access_txt,";")
if(!req_one_access)
req_one_access = list()
for(var/x in req_one_access_str)
var/n = text2num(x)
if(n)
req_one_access += n
//returns 1 if this mob has sufficient access to use this object
/obj/proc/allowed(mob/M)
//check if it doesn't require any access at all
if(src.check_access(null))
return 1
if(istype(M, /mob/living/silicon))
//AI can do whatever he wants
return 1
else if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
//if they are holding or wearing a card that has access, that works
if(src.check_access(H.get_active_hand()) || src.check_access(H.wear_id))
return 1
else if(istype(M, /mob/living/carbon/monkey) || istype(M, /mob/living/carbon/alien/humanoid))
var/mob/living/carbon/george = M
//they can only hold things :(
if(george.get_active_hand() && (istype(george.get_active_hand(), /obj/item/weapon/card/id) || istype(george.get_active_hand(), /obj/item/device/pda)) && src.check_access(george.get_active_hand()))
return 1
return 0
/obj/item/proc/GetAccess()
return list()
/obj/item/proc/GetID()
return null
/obj/proc/check_access(obj/item/weapon/card/id/I)
if (istype(I, /obj/item/device/pda))
var/obj/item/device/pda/pda = I
I = pda.id
if(!src.req_access && !src.req_one_access) //no requirements
return 1
if(!istype(src.req_access, /list)) //something's very wrong
return 1
var/list/L = src.req_access
if(!L.len && (!src.req_one_access || !src.req_one_access.len)) //no requirements
return 1
if(!I || !istype(I, /obj/item/weapon/card/id) || !I.access) //not ID or no access
return 0
for(var/req in src.req_access)
if(!(req in I.access)) //doesn't have this access
return 0
if(src.req_one_access && src.req_one_access.len)
for(var/req in src.req_one_access)
if(req in I.access) //has an access from the single access list
return 1
return 0
return 1
/obj/proc/check_access_list(var/list/L)
if(!src.req_access && !src.req_one_access) return 1
if(!istype(src.req_access, /list)) return 1
if(!src.req_access.len && (!src.req_one_access || !src.req_one_access.len)) return 1
if(!L) return 0
if(!istype(L, /list)) return 0
for(var/req in src.req_access)
if(!(req in L)) //doesn't have this access
return 0
if(src.req_one_access && src.req_one_access.len)
for(var/req in src.req_one_access)
if(req in L) //has an access from the single access list
return 1
return 0
return 1
/proc/get_access(job)
switch(job)
if("Geneticist")
return list(access_medical, access_morgue, access_genetics)
if("Station Engineer")
return list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, access_external_airlocks, access_construction)
if("Assistant")
if(config.assistant_maint)
return list(access_maint_tunnels)
else
return list()
if("Chaplain")
return list(access_morgue, access_chapel_office, access_crematorium)
if("Detective")
return list(access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_court)
if("Medical Doctor")
return list(access_medical, access_morgue, access_surgery)
if("Botanist") // -- TLE
return list(access_hydroponics, access_morgue) // Removed tox and chem access because STOP PISSING OFF THE CHEMIST GUYS // //Removed medical access because WHAT THE FUCK YOU AREN'T A DOCTOR YOU GROW WHEAT //Given Morgue access because they have a viable means of cloning.
if("Librarian") // -- TLE
return list(access_library)
if("Lawyer") //Muskets 160910
return list(access_lawyer, access_court, access_sec_doors)
if("Captain")
return get_all_accesses()
if("Crew Supervisor")
return list(access_security, access_sec_doors, access_brig, access_court)
if("Correctional Advisor")
return list(access_security, access_sec_doors, access_brig, access_armory, access_court)
if("Scientist")
return list(access_tox, access_tox_storage, access_research, access_xenobiology)
if("Safety Administrator")
return list(access_medical, access_morgue, access_tox, access_tox_storage, access_chemistry, access_genetics, access_court,
access_teleporter, access_heads, access_tech_storage, access_security, access_sec_doors, access_brig, access_atmospherics,
access_maint_tunnels, access_bar, access_janitor, access_kitchen, access_robotics, access_armory, access_hydroponics,
access_theatre, access_research, access_hos, access_RC_announce, access_forensics_lockers, access_keycard_auth, access_gateway)
if("Head of Personnel")
return list(access_security, access_sec_doors, access_brig, access_court, access_forensics_lockers,
access_tox, access_tox_storage, access_chemistry, access_medical, access_genetics, access_engine,
access_emergency_storage, access_change_ids, access_ai_upload, access_eva, access_heads,
access_all_personal_lockers, access_tech_storage, access_maint_tunnels, access_bar, access_janitor,
access_crematorium, access_kitchen, access_robotics, access_cargo, access_cargo_bot, access_mailsorting, access_qm, access_hydroponics, access_lawyer,
access_theatre, access_chapel_office, access_library, access_research, access_mining, access_heads_vault, access_mining_station,
access_clown, access_mime, access_hop, access_RC_announce, access_keycard_auth, access_gateway)
if("Atmospheric Technician")
return list(access_atmospherics, access_maint_tunnels, access_emergency_storage, access_construction)
if("Bartender")
return list(access_bar)
if("Chemist")
return list(access_medical, access_chemistry)
if("Janitor")
return list(access_janitor, access_maint_tunnels)
if("Clown")
return list(access_clown, access_theatre)
if("Mime")
return list(access_mime, access_theatre)
if("Chef")
return list(access_kitchen, access_morgue)
if("Roboticist")
return list(access_robotics, access_tech_storage, access_morgue) //As a job that handles so many corpses, it makes sense for them to have morgue access.
if("Cargo Technician")
return list(access_maint_tunnels, access_cargo, access_cargo_bot, access_mailsorting)
if("Shaft Miner")
return list(access_mining, access_mint, access_mining_station)
if("Quartermaster")
return list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station)
if("Chief Engineer")
return list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels,
access_teleporter, access_external_airlocks, access_atmospherics, access_emergency_storage, access_eva,
access_heads, access_ai_upload, access_construction, access_robotics,
access_mint, access_ce, access_RC_announce, access_keycard_auth, access_tcomsat, access_sec_doors)
if("Research Director")
return list(access_rd, access_heads, access_tox, access_genetics,
access_tox_storage, access_teleporter,
access_research, access_robotics, access_xenobiology,
access_RC_announce, access_keycard_auth, access_tcomsat, access_gateway, access_sec_doors)
if("Virologist")
return list(access_medical, access_virology)
if("Chief Medical Officer")
return 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)
else
return list()
/proc/get_centcom_access(job)
switch(job)
if("VIP Guest")
return list(access_cent_general)
if("Custodian")
return list(access_cent_general, access_cent_living, access_cent_storage)
if("Thunderdome Overseer")
return list(access_cent_general, access_cent_thunder)
if("Intel Officer")
return list(access_cent_general, access_cent_living)
if("Medical Officer")
return list(access_cent_general, access_cent_living, access_cent_medical)
if("Death Commando")
return list(access_cent_general, access_cent_specops, access_cent_living, access_cent_storage)
if("Research Officer")
return list(access_cent_general, access_cent_specops, access_cent_medical, access_cent_teleporter, access_cent_storage)
if("BlackOps Commander")
return list(access_cent_general, access_cent_thunder, access_cent_specops, access_cent_living, access_cent_storage, access_cent_creed)
if("Supreme Commander")
return get_all_centcom_access()
/proc/get_all_accesses()
return list(access_security, access_sec_doors, access_brig, access_armory, access_forensics_lockers, access_court,
access_medical, access_genetics, access_morgue, access_rd,
access_tox, access_tox_storage, access_chemistry, access_engine, access_engine_equip, access_maint_tunnels,
access_external_airlocks, access_emergency_storage, access_change_ids, access_ai_upload,
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_cargo_bot, access_construction,
access_hydroponics, access_library, access_manufacturing, access_lawyer, access_virology, access_cmo, access_qm, access_clown, access_mime, access_surgery,
access_theatre, access_research, access_mining, access_mailsorting, access_mint_vault, access_mint,
access_heads_vault, access_mining_station, access_xenobiology, access_ce, access_hop, access_hos, access_RC_announce,
access_keycard_auth, access_tcomsat, access_gateway)
/proc/get_all_centcom_access()
return list(access_cent_general, access_cent_thunder, access_cent_specops, access_cent_medical, access_cent_living, access_cent_storage, access_cent_teleporter, access_cent_creed, access_cent_captain)
/proc/get_all_syndicate_access()
return list(access_syndicate)
/proc/get_region_accesses(var/code)
switch(code)
if(0)
return get_all_accesses()
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)
if(3) //research
return list(access_research, access_tox, access_tox_storage, access_xenobiology, access_rd)
if(4) //engineering and maintenance
return list(access_maint_tunnels, access_engine, access_engine_equip, access_external_airlocks, access_tech_storage, access_atmospherics, access_construction, access_robotics, access_ce)
if(5) //command
return list(access_heads, access_change_ids, access_ai_upload, access_teleporter, access_eva, access_all_personal_lockers, access_heads_vault, access_RC_announce, access_keycard_auth, access_tcomsat, access_gateway, access_hop, access_captain)
if(6) //station general
return list(access_kitchen,access_bar, access_hydroponics, access_janitor, access_chapel_office, access_crematorium, access_library, access_theatre, access_lawyer, access_clown, access_mime)
if(7) //supply
return list(access_cargo, access_cargo_bot, access_mailsorting, access_qm, access_mining, access_mining_station)
/proc/get_region_accesses_name(var/code)
switch(code)
if(0)
return "All"
if(1) //security
return "Security"
if(2) //medbay
return "Medbay"
if(3) //research
return "Research"
if(4) //engineering and maintenance
return "Engineering"
if(5) //command
return "Command"
if(6) //station general
return "Station General"
if(7) //supply
return "Supply"
/proc/get_access_desc(A)
switch(A)
if(access_cargo)
return "Cargo Bay"
if(access_cargo_bot)
return "Cargo Bot Delivery"
if(access_security)
return "Security"
if(access_brig)
return "Holding Cells"
if(access_court)
return "Courtroom"
if(access_forensics_lockers)
return "Detective's Office"
if(access_medical)
return "Medical"
if(access_genetics)
return "Genetics Lab"
if(access_morgue)
return "Morgue"
if(access_tox)
return "Research Lab"
if(access_tox_storage)
return "Toxins Storage"
if(access_chemistry)
return "Chemistry Lab"
if(access_rd)
return "RD Private"
if(access_bar)
return "Bar"
if(access_janitor)
return "Custodial Closet"
if(access_engine)
return "Engineering"
if(access_engine_equip)
return "APCs"
if(access_maint_tunnels)
return "Maintenance"
if(access_external_airlocks)
return "External Airlocks"
if(access_emergency_storage)
return "Emergency Storage"
if(access_change_ids)
return "ID Computer"
if(access_ai_upload)
return "AI Upload"
if(access_teleporter)
return "Teleporter"
if(access_eva)
return "EVA"
if(access_heads)
return "Bridge"
if(access_captain)
return "Captain Private"
if(access_all_personal_lockers)
return "Personal Lockers"
if(access_chapel_office)
return "Chapel Office"
if(access_tech_storage)
return "Technical Storage"
if(access_atmospherics)
return "Atmospherics"
if(access_crematorium)
return "Crematorium"
if(access_armory)
return "Armory"
if(access_construction)
return "Construction Areas"
if(access_kitchen)
return "Kitchen"
if(access_hydroponics)
return "Hydroponics"
if(access_library)
return "Library"
if(access_lawyer)
return "Law Office"
if(access_robotics)
return "Robotics"
if(access_virology)
return "Virology"
if(access_cmo)
return "CMO Private"
if(access_qm)
return "Quartermaster's Office"
if(access_clown)
return "HONK! Access"
if(access_mime)
return "Silent Access"
if(access_surgery)
return "Surgery"
if(access_theatre)
return "Theatre"
if(access_manufacturing)
return "Manufacturing"
if(access_research)
return "Science"
if(access_mining)
return "Mining"
if(access_mining_office)
return "Mining Office"
if(access_mailsorting)
return "Delivery Office"
if(access_mint)
return "Mint"
if(access_mint_vault)
return "Mint Vault"
if(access_heads_vault)
return "Main Vault"
if(access_mining_station)
return "Mining Station EVA"
if(access_xenobiology)
return "Xenobiology Lab"
if(access_hop)
return "HoP Private"
if(access_hos)
return "HoS Private"
if(access_ce)
return "CE Private"
if(access_RC_announce)
return "RC Announcements"
if(access_keycard_auth)
return "Keycode Auth. Device"
if(access_tcomsat)
return "Telecommunications"
if(access_gateway)
return "Gateway"
if(access_sec_doors)
return "Brig"
/proc/get_centcom_access_desc(A)
switch(A)
if(access_cent_general)
return "Code Grey"
if(access_cent_thunder)
return "Code Yellow"
if(access_cent_storage)
return "Code Orange"
if(access_cent_living)
return "Code Green"
if(access_cent_medical)
return "Code White"
if(access_cent_teleporter)
return "Code Blue"
if(access_cent_specops)
return "Code Black"
if(access_cent_creed)
return "Code Silver"
if(access_cent_captain)
return "Code Gold"
/proc/get_all_jobs()
return list("Assistant", "Captain", "Head of Personnel", "Bartender", "Chef", "Botanist", "Quartermaster", "Cargo Technician",
"Shaft Miner", "Clown", "Mime", "Janitor", "Librarian", "Lawyer", "Chaplain", "Chief Engineer", "Station Engineer",
"Atmospheric Technician", "Roboticist", "Chief Medical Officer", "Medical Doctor", "Chemist", "Geneticist", "Virologist",
"Research Director", "Scientist", "Head of Security", "Warden", "Detective", "Security Officer")
/proc/get_all_centcom_jobs()
return list("VIP Guest","Custodian","Thunderdome Overseer","Intel Officer","Medical Officer","Death Commando","Research Officer","BlackOps Commander","Supreme Commander")
/obj/proc/GetJobName()
if (!istype(src, /obj/item/device/pda) && !istype(src,/obj/item/weapon/card/id))
return
var/jobName
if(istype(src, /obj/item/device/pda))
if(src:id)
jobName = src:id:assignment
if(istype(src, /obj/item/weapon/card/id))
jobName = src:assignment
if(jobName in get_all_jobs())
return jobName
else
return "Unknown"
@@ -0,0 +1,33 @@
/obj/item/clothing/under/rank/administrator
name = "safety administrator's jumpsuit"
desc = "It's a jumpsuit worn by those few with the dedication to achieve the position of \"Safety Administrator\"."
icon_state = "hosblueclothes"
item_state = "ba_suit"
color = "hosblueclothes"
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
flags = FPRINT | TABLEPASS | ONESIZEFITSALL
/obj/item/clothing/under/rank/advisor
name = "correctional advisor's jumpsuit"
desc = "It's made of a slightly sturdier material than standard jumpsuits, to allow for more robust protection. It has the words \"Correctional Advisor\" written on the shoulders."
icon_state = "wardenblueclothes"
item_state = "ba_suit"
color = "wardenblueclothes"
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
flags = FPRINT | TABLEPASS | ONESIZEFITSALL
/obj/item/clothing/under/rank/supervisor
name = "crew supervisor's jumpsuit"
desc = "It's made of a slightly sturdier material than standard jumpsuits, to allow for robust protection."
icon_state = "officerblueclothes"
item_state = "ba_suit"
color = "officerblueclothes"
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
flags = FPRINT | TABLEPASS | ONESIZEFITSALL
/obj/item/clothing/shoes/boots
name = "boots"
desc = "Nanotrasen-issue hard-toe safety boots."
icon_state = "secshoes"
item_state = "secshoes"
color = "hosred"
@@ -0,0 +1,152 @@
/datum/job/hos
title = "Safety Administrator"
flag = HOS
department_flag = ENGSEC
faction = "Station"
total_positions = 1
spawn_positions = 1
supervisors = "the captain"
selection_color = "#ffdddd"
idtype = /obj/item/weapon/card/id/silver
req_admin_notify = 1
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hos(H), slot_ears)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/administrator(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/boots(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/heads/hos(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(H), slot_glasses)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(H), slot_wear_suit)
H.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/taser(H), slot_s_store)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
return 1
/datum/job/warden
title = "Correctional Advisor"
flag = WARDEN
department_flag = ENGSEC
faction = "Station"
total_positions = 1
spawn_positions = 1
supervisors = "the safety administrator"
selection_color = "#ffeeee"
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/advisor(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/boots(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/warden(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(H), slot_glasses)
H.equip_to_slot_or_del(new /obj/item/device/flash(H), slot_l_store)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
return 1
/datum/job/detective
title = "Detective"
flag = DETECTIVE
department_flag = ENGSEC
faction = "Station"
total_positions = 1
spawn_positions = 1
supervisors = "the safety administrator"
selection_color = "#ffeeee"
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/under/det(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/detective(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/clothing/head/det_hat(H), slot_head)
var/obj/item/clothing/mask/cigarette/CIG = new /obj/item/clothing/mask/cigarette(H)
CIG.light("")
H.equip_to_slot_or_del(CIG, slot_wear_mask)
H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/det_suit(H), slot_wear_suit)
H.equip_to_slot_or_del(new /obj/item/weapon/lighter/zippo(H), slot_l_store)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/evidence(H), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/device/detective_scanner(H), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
return 1
/datum/job/officer
title = "Crew Supervisor"
flag = OFFICER
department_flag = ENGSEC
faction = "Station"
total_positions = 5
spawn_positions = 5
supervisors = "the safety administrator"
selection_color = "#ffeeee"
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/supervisor(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/boots(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/security(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_r_store)
H.equip_to_slot_or_del(new /obj/item/device/flash(H), slot_l_store)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
return 1
/datum/job/hop
title = "Head of Personnel"
flag = HOP
department_flag = CIVILIAN
faction = "Station"
total_positions = 1
spawn_positions = 1
supervisors = "the captain"
selection_color = "#ddddff"
idtype = /obj/item/weapon/card/id/silver
req_admin_notify = 1
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hop(H), slot_ears)
if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/head_of_personnel(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/heads/hop(H), slot_belt)
if(H.backbag == 1)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/id_kit(H), slot_r_hand)
else
H.equip_to_slot_or_del(new /obj/item/weapon/storage/id_kit(H.back), slot_in_backpack)
return 1
@@ -0,0 +1,235 @@
/obj/structure/closet/secure_closet/captains
name = "Captain's Locker"
req_access = list(access_captain)
icon_state = "capsecure1"
icon_closed = "capsecure"
icon_locked = "capsecure1"
icon_opened = "capsecureopen"
icon_broken = "capsecurebroken"
icon_off = "capsecureoff"
New()
sleep(2)
if(prob(50))
new /obj/item/weapon/storage/backpack/captain(src)
else
new /obj/item/weapon/storage/backpack/satchel_cap(src)
new /obj/item/clothing/suit/captunic(src)
new /obj/item/clothing/head/helmet/cap(src)
new /obj/item/clothing/under/rank/captain(src)
new /obj/item/clothing/suit/armor/vest(src)
new /obj/item/weapon/cartridge/captain(src)
new /obj/item/clothing/head/helmet/swat(src)
new /obj/item/clothing/shoes/brown(src)
new /obj/item/device/radio/headset/heads/captain(src)
new /obj/item/weapon/reagent_containers/food/drinks/flask(src)
new /obj/item/clothing/gloves/captain(src)
new /obj/item/weapon/gun/energy/gun(src)
return
/obj/structure/closet/secure_closet/hop
name = "Head of Personnel's Locker"
req_access = list(access_hop)
icon_state = "hopsecure1"
icon_closed = "hopsecure"
icon_locked = "hopsecure1"
icon_opened = "hopsecureopen"
icon_broken = "hopsecurebroken"
icon_off = "hopsecureoff"
New()
sleep(2)
new /obj/item/clothing/under/rank/head_of_personnel(src)
new /obj/item/clothing/suit/armor/vest(src)
new /obj/item/clothing/head/helmet(src)
new /obj/item/weapon/cartridge/hop(src)
new /obj/item/device/radio/headset/heads/hop(src)
new /obj/item/clothing/shoes/brown(src)
new /obj/item/weapon/storage/id_kit(src)
new /obj/item/weapon/storage/id_kit( src )
new /obj/item/device/flash(src)
new /obj/item/clothing/glasses/sunglasses(src)
return
/obj/structure/closet/secure_closet/hos
name = "Safety Administrator's Locker"
req_access = list(access_hos)
icon_state = "hossecure1"
icon_closed = "hossecure"
icon_locked = "hossecure1"
icon_opened = "hossecureopen"
icon_broken = "hossecurebroken"
icon_off = "hossecureoff"
New()
sleep(2)
new /obj/item/weapon/storage/backpack/satchel_sec(src)
new /obj/item/weapon/cartridge/hos(src)
new /obj/item/device/radio/headset/heads/hos(src)
new /obj/item/weapon/storage/lockbox/loyalty(src)
new /obj/item/weapon/storage/flashbang_kit(src)
new /obj/item/weapon/storage/belt/security(src)
new /obj/item/device/flash(src)
new /obj/item/weapon/melee/baton(src)
new /obj/item/weapon/gun/energy/taser(src)
new /obj/item/weapon/reagent_containers/spray/pepper(src)
return
/obj/structure/closet/secure_closet/warden
name = "Correctional Advisor's Locker"
req_access = list(access_armory)
icon_state = "wardensecure1"
icon_closed = "wardensecure"
icon_locked = "wardensecure1"
icon_opened = "wardensecureopen"
icon_broken = "wardensecurebroken"
icon_off = "wardensecureoff"
New()
sleep(2)
new /obj/item/weapon/storage/backpack/satchel_sec(src)
new /obj/item/clothing/under/rank/advisor(src)
new /obj/item/device/radio/headset/headset_sec(src)
new /obj/item/clothing/glasses/sunglasses(src)
new /obj/item/weapon/storage/flashbang_kit(src)
new /obj/item/weapon/storage/belt/security(src)
new /obj/item/weapon/reagent_containers/spray/pepper(src)
new /obj/item/weapon/reagent_containers/spray/pepper(src)
new /obj/item/weapon/melee/baton(src)
return
/obj/structure/closet/secure_closet/security
name = "Crew Supervisor's Locker"
req_access = list(access_security)
icon_state = "sec1"
icon_closed = "sec"
icon_locked = "sec1"
icon_opened = "secopen"
icon_broken = "secbroken"
icon_off = "secoff"
New()
sleep(2)
new /obj/item/weapon/storage/backpack/satchel_sec(src)
new /obj/item/device/radio/headset/headset_sec(src)
new /obj/item/weapon/storage/belt/security(src)
new /obj/item/device/flash(src)
new /obj/item/weapon/reagent_containers/spray/pepper(src)
new /obj/item/weapon/reagent_containers/spray/pepper(src)
new /obj/item/clothing/glasses/sunglasses(src)
return
/obj/structure/closet/secure_closet/detective
name = "Detective's Cabinet"
req_access = list(access_forensics_lockers)
icon_state = "cabinetdetective_locked"
icon_closed = "cabinetdetective"
icon_locked = "cabinetdetective_locked"
icon_opened = "cabinetdetective_open"
icon_broken = "cabinetdetective_broken"
icon_off = "cabinetdetective_broken"
New()
sleep(2)
new /obj/item/clothing/under/det(src)
new /obj/item/clothing/suit/armor/det_suit(src)
new /obj/item/clothing/suit/det_suit(src)
new /obj/item/clothing/gloves/black(src)
new /obj/item/clothing/head/det_hat(src)
new /obj/item/clothing/shoes/brown(src)
new /obj/item/device/radio/headset/headset_sec(src)
new /obj/item/weapon/cartridge/detective(src)
new /obj/item/weapon/clipboard(src)
new /obj/item/device/detective_scanner(src)
new /obj/item/weapon/storage/box/evidence(src)
return
/obj/structure/closet/secure_closet/detective/update_icon()
if(broken)
icon_state = icon_broken
else
if(!opened)
if(locked)
icon_state = icon_locked
else
icon_state = icon_closed
else
icon_state = icon_opened
/obj/structure/closet/secure_closet/injection
name = "Lethal Injections"
req_access = list(access_hos)
New()
sleep(2)
new /obj/item/weapon/reagent_containers/ld50_syringe/choral(src)
new /obj/item/weapon/reagent_containers/ld50_syringe/choral(src)
return
/obj/structure/closet/secure_closet/brig
name = "Brig Locker"
req_access = list(access_brig)
anchored = 1
New()
new /obj/item/clothing/under/color/orange( src )
new /obj/item/clothing/shoes/orange( src )
return
/obj/structure/closet/secure_closet/courtroom
name = "Courtroom Locker"
req_access = list(access_court)
New()
sleep(2)
new /obj/item/clothing/shoes/brown(src)
new /obj/item/weapon/paper/Court (src)
new /obj/item/weapon/paper/Court (src)
new /obj/item/weapon/paper/Court (src)
new /obj/item/weapon/pen (src)
new /obj/item/clothing/suit/judgerobe (src)
new /obj/item/clothing/head/powdered_wig (src)
new /obj/item/weapon/storage/briefcase(src)
return
/obj/structure/closet/secure_closet/wall
name = "wall locker"
req_access = list(access_security)
icon_state = "wall-locker1"
density = 1
icon_closed = "wall-locker"
icon_locked = "wall-locker1"
icon_opened = "wall-lockeropen"
icon_broken = "wall-lockerbroken"
icon_off = "wall-lockeroff"
//too small to put a man in
large = 0
/obj/structure/closet/secure_closet/wall/update_icon()
if(broken)
icon_state = icon_broken
else
if(!opened)
if(locked)
icon_state = icon_locked
else
icon_state = icon_closed
else
icon_state = icon_opened
@@ -0,0 +1,311 @@
/obj/structure/closet/wardrobe
name = "wardrobe"
desc = "It's a storage unit for standard-issue Nanotrasen attire."
icon_state = "blue"
icon_closed = "blue"
/obj/structure/closet/wardrobe/New()
new /obj/item/clothing/under/color/blue(src)
new /obj/item/clothing/under/color/blue(src)
new /obj/item/clothing/under/color/blue(src)
new /obj/item/clothing/shoes/brown(src)
new /obj/item/clothing/shoes/brown(src)
new /obj/item/clothing/shoes/brown(src)
return
/obj/structure/closet/wardrobe/red
name = "security wardrobe"
icon_state = "red"
icon_closed = "red"
/obj/structure/closet/wardrobe/red/New()
new /obj/item/clothing/under/rank/supervisor(src)
new /obj/item/clothing/under/rank/supervisor(src)
new /obj/item/clothing/under/rank/supervisor(src)
new /obj/item/clothing/shoes/boots(src)
new /obj/item/clothing/shoes/boots(src)
new /obj/item/clothing/shoes/boots(src)
new /obj/item/clothing/head/soft/grey(src)
new /obj/item/clothing/head/soft/grey(src)
new /obj/item/clothing/head/soft/grey(src)
return
/obj/structure/closet/wardrobe/pink
name = "pink wardrobe"
icon_state = "pink"
icon_closed = "pink"
/obj/structure/closet/wardrobe/pink/New()
new /obj/item/clothing/under/color/pink(src)
new /obj/item/clothing/under/color/pink(src)
new /obj/item/clothing/under/color/pink(src)
new /obj/item/clothing/shoes/brown(src)
new /obj/item/clothing/shoes/brown(src)
new /obj/item/clothing/shoes/brown(src)
return
/obj/structure/closet/wardrobe/black
name = "black wardrobe"
icon_state = "black"
icon_closed = "black"
/obj/structure/closet/wardrobe/black/New()
new /obj/item/clothing/under/color/black(src)
new /obj/item/clothing/under/color/black(src)
new /obj/item/clothing/under/color/black(src)
new /obj/item/clothing/shoes/black(src)
new /obj/item/clothing/shoes/black(src)
new /obj/item/clothing/shoes/black(src)
new /obj/item/clothing/head/that(src)
new /obj/item/clothing/head/that(src)
new /obj/item/clothing/head/that(src)
return
/obj/structure/closet/wardrobe/chaplain_black
name = "chapel wardrobe"
desc = "It's a storage unit for Nanotrasen-approved religious attire."
icon_state = "black"
icon_closed = "black"
/obj/structure/closet/wardrobe/chaplain_black/New()
new /obj/item/clothing/under/rank/chaplain(src)
new /obj/item/clothing/shoes/black(src)
new /obj/item/clothing/suit/nun(src)
new /obj/item/clothing/head/nun_hood(src)
new /obj/item/clothing/suit/chaplain_hoodie(src)
new /obj/item/clothing/head/chaplain_hood(src)
new /obj/item/clothing/suit/holidaypriest(src)
new /obj/item/weapon/storage/backpack/cultpack (src)
new /obj/item/weapon/storage/fancy/candle_box(src)
new /obj/item/weapon/storage/fancy/candle_box(src)
return
/obj/structure/closet/wardrobe/green
name = "green wardrobe"
icon_state = "green"
icon_closed = "green"
/obj/structure/closet/wardrobe/green/New()
new /obj/item/clothing/under/color/green(src)
new /obj/item/clothing/under/color/green(src)
new /obj/item/clothing/under/color/green(src)
new /obj/item/clothing/shoes/black(src)
new /obj/item/clothing/shoes/black(src)
new /obj/item/clothing/shoes/black(src)
return
/obj/structure/closet/wardrobe/orange
name = "prison wardrobe"
desc = "It's a storage unit for Nanotrasen-regulation prisoner attire."
icon_state = "orange"
icon_closed = "orange"
/obj/structure/closet/wardrobe/orange/New()
new /obj/item/clothing/under/color/orange(src)
new /obj/item/clothing/under/color/orange(src)
new /obj/item/clothing/under/color/orange(src)
new /obj/item/clothing/shoes/orange(src)
new /obj/item/clothing/shoes/orange(src)
new /obj/item/clothing/shoes/orange(src)
return
/obj/structure/closet/wardrobe/yellow
name = "yellow wardrobe"
icon_state = "wardrobe-y"
icon_closed = "wardrobe-y"
/obj/structure/closet/wardrobe/yellow/New()
new /obj/item/clothing/under/color/yellow(src)
new /obj/item/clothing/under/color/yellow(src)
new /obj/item/clothing/under/color/yellow(src)
new /obj/item/clothing/shoes/orange(src)
new /obj/item/clothing/shoes/orange(src)
new /obj/item/clothing/shoes/orange(src)
return
/obj/structure/closet/wardrobe/atmospherics_yellow
name = "atmospherics wardrobe"
icon_state = "yellow"
icon_closed = "yellow"
/obj/structure/closet/wardrobe/atmospherics_yellow/New()
new /obj/item/clothing/under/rank/atmospheric_technician(src)
new /obj/item/clothing/under/rank/atmospheric_technician(src)
new /obj/item/clothing/under/rank/atmospheric_technician(src)
new /obj/item/clothing/shoes/black(src)
new /obj/item/clothing/shoes/black(src)
new /obj/item/clothing/shoes/black(src)
return
/obj/structure/closet/wardrobe/engineering_yellow
name = "engineering wardrobe"
icon_state = "yellow"
icon_closed = "yellow"
/obj/structure/closet/wardrobe/engineering_yellow/New()
new /obj/item/clothing/under/rank/engineer(src)
new /obj/item/clothing/under/rank/engineer(src)
new /obj/item/clothing/under/rank/engineer(src)
new /obj/item/clothing/shoes/orange(src)
new /obj/item/clothing/shoes/orange(src)
new /obj/item/clothing/shoes/orange(src)
return
/obj/structure/closet/wardrobe/white
name = "white wardrobe"
icon_state = "white"
icon_closed = "white"
/obj/structure/closet/wardrobe/white/New()
new /obj/item/clothing/under/color/white(src)
new /obj/item/clothing/under/color/white(src)
new /obj/item/clothing/under/color/white(src)
new /obj/item/clothing/shoes/white(src)
new /obj/item/clothing/shoes/white(src)
new /obj/item/clothing/shoes/white(src)
return
/obj/structure/closet/wardrobe/pjs
name = "Pajama wardrobe"
icon_state = "white"
icon_closed = "white"
/obj/structure/closet/wardrobe/pjs/New()
new /obj/item/clothing/under/pj/red(src)
new /obj/item/clothing/under/pj/red(src)
new /obj/item/clothing/under/pj/blue(src)
new /obj/item/clothing/under/pj/blue(src)
new /obj/item/clothing/shoes/white(src)
new /obj/item/clothing/shoes/white(src)
new /obj/item/clothing/shoes/white(src)
new /obj/item/clothing/shoes/white(src)
return
/obj/structure/closet/wardrobe/toxins_white
name = "toxins wardrobe"
icon_state = "white"
icon_closed = "white"
/obj/structure/closet/wardrobe/toxins_white/New()
new /obj/item/clothing/under/rank/scientist(src)
new /obj/item/clothing/under/rank/scientist(src)
new /obj/item/clothing/under/rank/scientist(src)
new /obj/item/clothing/suit/labcoat(src)
new /obj/item/clothing/suit/labcoat(src)
new /obj/item/clothing/suit/labcoat(src)
new /obj/item/clothing/shoes/white(src)
new /obj/item/clothing/shoes/white(src)
new /obj/item/clothing/shoes/white(src)
return
/obj/structure/closet/wardrobe/robotics_black
name = "robotics wardrobe"
icon_state = "black"
icon_closed = "black"
/obj/structure/closet/wardrobe/robotics_black/New()
new /obj/item/clothing/under/rank/roboticist(src)
new /obj/item/clothing/under/rank/roboticist(src)
new /obj/item/clothing/suit/labcoat(src)
new /obj/item/clothing/suit/labcoat(src)
new /obj/item/clothing/shoes/black(src)
new /obj/item/clothing/shoes/black(src)
new /obj/item/clothing/gloves/black(src)
new /obj/item/clothing/gloves/black(src)
return
/obj/structure/closet/wardrobe/chemistry_white
name = "chemistry wardrobe"
icon_state = "white"
icon_closed = "white"
/obj/structure/closet/wardrobe/chemistry_white/New()
new /obj/item/clothing/under/rank/chemist(src)
new /obj/item/clothing/under/rank/chemist(src)
new /obj/item/clothing/shoes/white(src)
new /obj/item/clothing/shoes/white(src)
new /obj/item/clothing/suit/labcoat/chemist(src)
new /obj/item/clothing/suit/labcoat/chemist(src)
return
/obj/structure/closet/wardrobe/genetics_white
name = "genetics wardrobe"
icon_state = "white"
icon_closed = "white"
/obj/structure/closet/wardrobe/genetics_white/New()
new /obj/item/clothing/under/rank/geneticist(src)
new /obj/item/clothing/under/rank/geneticist(src)
new /obj/item/clothing/shoes/white(src)
new /obj/item/clothing/shoes/white(src)
new /obj/item/clothing/suit/labcoat/genetics(src)
new /obj/item/clothing/suit/labcoat/genetics(src)
return
/obj/structure/closet/wardrobe/virology_white
name = "virology wardrobe"
icon_state = "white"
icon_closed = "white"
/obj/structure/closet/wardrobe/virology_white/New()
new /obj/item/clothing/under/rank/virologist(src)
new /obj/item/clothing/under/rank/virologist(src)
new /obj/item/clothing/shoes/white(src)
new /obj/item/clothing/shoes/white(src)
new /obj/item/clothing/suit/labcoat/virologist(src)
new /obj/item/clothing/suit/labcoat/virologist(src)
new /obj/item/clothing/mask/surgical(src)
new /obj/item/clothing/mask/surgical(src)
return
/obj/structure/closet/wardrobe/grey
name = "grey wardrobe"
icon_state = "grey"
icon_closed = "grey"
/obj/structure/closet/wardrobe/grey/New()
new /obj/item/clothing/under/color/grey(src)
new /obj/item/clothing/under/color/grey(src)
new /obj/item/clothing/under/color/grey(src)
new /obj/item/clothing/shoes/black(src)
new /obj/item/clothing/shoes/black(src)
new /obj/item/clothing/shoes/black(src)
new /obj/item/clothing/head/soft/grey(src)
new /obj/item/clothing/head/soft/grey(src)
new /obj/item/clothing/head/soft/grey(src)
return
/obj/structure/closet/wardrobe/mixed
name = "mixed wardrobe"
icon_state = "mixed"
icon_closed = "mixed"
/obj/structure/closet/wardrobe/mixed/New()
new /obj/item/clothing/under/color/white(src)
new /obj/item/clothing/under/color/blue(src)
new /obj/item/clothing/under/color/yellow(src)
new /obj/item/clothing/under/color/green(src)
new /obj/item/clothing/under/color/orange(src)
new /obj/item/clothing/under/color/pink(src)
new /obj/item/clothing/shoes/black(src)
new /obj/item/clothing/shoes/brown(src)
new /obj/item/clothing/shoes/white(src)
return
+5 -5
View File
@@ -116,7 +116,7 @@
new /obj/item/clothing/head/helmet/welding(src)
new /obj/item/weapon/storage/belt/utility/full(src)
new /obj/item/weapon/storage/toolbox/mechanical(src)
new /obj/item/clothing/suit/hazardvest(src)
new /obj/item/clothing/suit/storage/hazardvest(src)
new /obj/item/clothing/gloves/yellow(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/clothing/glasses/meson(src)
@@ -135,7 +135,7 @@
new /obj/item/weapon/pen(src)
new /obj/item/device/pda/engineering(src)
new /obj/item/device/t_scanner(src)
new /obj/item/clothing/suit/hazardvest(src)
new /obj/item/clothing/suit/storage/hazardvest(src)
new /obj/item/weapon/storage/belt/utility/full(src)
new /obj/item/weapon/storage/toolbox/mechanical(src)
new /obj/item/clothing/mask/gas(src)
@@ -426,7 +426,7 @@
new /obj/item/taperoll/police(src)
new /obj/item/weapon/storage/box/evidence(src)
new /obj/item/device/pda/detective(src)
new /obj/item/clothing/suit/det_suit/armor(src)
new /obj/item/clothing/suit/storage/det_suit/armor(src)
new /obj/item/clothing/suit/storage/det_suit(src)
new /obj/item/clothing/gloves/detective(src)
new /obj/item/clothing/head/det_hat(src)
@@ -606,9 +606,9 @@
new /obj/item/clothing/shoes/brown(src)
if(prob(50))
new /obj/item/clothing/under/lawyer/bluesuit(src)
new /obj/item/clothing/suit/lawyer/bluejacket(src)
new /obj/item/clothing/suit/storage/lawyer/bluejacket(src)
else
new /obj/item/clothing/under/lawyer/purpsuit(src)
new /obj/item/clothing/suit/lawyer/purpjacket(src)
new /obj/item/clothing/suit/storage/lawyer/purpjacket(src)
Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

@@ -0,0 +1,467 @@
//this is everything i'm going to be using in my outpost zeta map, and possibly future maps.
turf/unsimulated/desert
name = "desert"
icon = 'desert.dmi'
icon_state = "desert"
temperature = 393.15
luminosity = 5
lighting_lumcount = 8
turf/unsimulated/desert/New()
icon_state = "desert[rand(0,4)]"
turf/simulated/wall/impassable_rock
name = "Mountain Wall"
//so that you can see the impassable sections in the map editor
icon_state = "riveted"
New()
icon_state = "rock"
/area/awaymission/labs/researchdivision
name = "Research"
icon_state = "away3"
/area/awaymission/labs/militarydivision
name = "Military"
icon_state = "away2"
/area/awaymission/labs/gateway
name = "Gateway"
icon_state = "away1"
/area/awaymission/labs/command
name = "Command"
icon_state = "away"
/area/awaymission/labs/civilian
name = "Civilian"
icon_state = "away3"
/area/awaymission/labs/cargo
name = "Cargo"
icon_state = "away2"
/area/awaymission/labs/medical
name = "Medical"
icon_state = "away1"
/area/awaymission/labs/security
name = "Security"
icon_state = "away"
/area/awaymission/labs/solars
name = "Solars"
icon_state = "away3"
/area/awaymission/labs/cave
name = "Caves"
icon_state = "away2"
//corpses and possibly other decorative items
/obj/effect/landmark/corpse/alien
mutantrace = "lizard"
/obj/effect/landmark/corpse/alien/cargo
name = "Cargo Technician"
corpseuniform = /obj/item/clothing/under/rank/cargo
corpseradio = /obj/item/device/radio/headset/headset_cargo
corpseid = 1
corpseidjob = "Cargo Technician"
corpseidaccess = "Quartermaster"
/obj/effect/landmark/corpse/alien/laborer
name = "Laborer"
corpseuniform = /obj/item/clothing/under/overalls
corpseradio = /obj/item/device/radio/headset/headset_eng
corpseback = /obj/item/weapon/storage/backpack/industrial
corpsebelt = /obj/item/weapon/storage/belt/utility/full
corpsehelmet = /obj/item/clothing/head/hardhat
corpseid = 1
corpseidjob = "Laborer"
corpseidaccess = "Engineer"
/obj/effect/landmark/corpse/alien/testsubject
name = "Unfortunate Test Subject"
corpseuniform = /obj/item/clothing/under/color/white
corpseid = 0
/obj/effect/landmark/corpse/overseer
name = "Overseer"
corpseuniform = /obj/item/clothing/under/rank/navyhead_of_security
corpsesuit = /obj/item/clothing/suit/armor/hosnavycoat
corpseradio = /obj/item/device/radio/headset/heads/captain
corpsegloves = /obj/item/clothing/gloves/black/hos
corpseshoes = /obj/item/clothing/shoes/swat
corpsehelmet = /obj/item/clothing/head/beret/navyhos
corpseglasses = /obj/item/clothing/glasses/eyepatch
corpseid = 1
corpseidjob = "Facility Overseer"
corpseidaccess = "Captain"
/obj/effect/landmark/corpse/officer
name = "Security Officer"
corpseuniform = /obj/item/clothing/under/rank/navysecurity
corpsesuit = /obj/item/clothing/suit/armor/navysecvest
corpseradio = /obj/item/device/radio/headset/headset_sec
corpseshoes = /obj/item/clothing/shoes/swat
corpsehelmet = /obj/item/clothing/head/beret/navysec
corpseid = 1
corpseidjob = "Security Officer"
corpseidaccess = "Security Officer"
/*
* Weeds
*/
#define NODERANGE 1
/obj/effect/alien/flesh/weeds
name = "Fleshy Growth"
desc = "A pulsating grouping of odd, alien tissues. It's almost like it has a heartbeat..."
icon = 'biocraps.dmi'
icon_state = "flesh"
anchored = 1
density = 0
var/health = 15
var/obj/effect/alien/weeds/node/linked_node = null
/obj/effect/alien/flesh/weeds/node
icon_state = "fleshnode"
icon = 'biocraps.dmi'
name = "Throbbing Pustule"
desc = "A grotquese, oozing, pimple-like growth. You swear you can see something moving around in the bulb..."
luminosity = NODERANGE
var/node_range = NODERANGE
/obj/effect/alien/flesh/weeds/node/New()
..(src.loc, src)
/obj/effect/alien/flesh/weeds/New(pos, node)
..()
linked_node = node
if(istype(loc, /turf/space))
del(src)
return
if(icon_state == "flesh")icon_state = pick("flesh", "flesh1", "flesh2")
spawn(rand(150, 200))
if(src)
Life()
return
/obj/effect/alien/flesh/weeds/proc/Life()
set background = 1
var/turf/U = get_turf(src)
/*
if (locate(/obj/movable, U))
U = locate(/obj/movable, U)
if(U.density == 1)
del(src)
return
Alien plants should do something if theres a lot of poison
if(U.poison> 200000)
health -= round(U.poison/200000)
update()
return
*/
if (istype(U, /turf/space))
del(src)
return
direction_loop:
for(var/dirn in cardinal)
var/turf/T = get_step(src, dirn)
if (!istype(T) || T.density || locate(/obj/effect/alien/flesh/weeds) in T || istype(T.loc, /area/arrival) || istype(T, /turf/space))
continue
if(!linked_node || get_dist(linked_node, src) > linked_node.node_range)
return
// if (locate(/obj/movable, T)) // don't propogate into movables
// continue
for(var/obj/O in T)
if(O.density)
continue direction_loop
new /obj/effect/alien/flesh/weeds(T, linked_node)
/obj/effect/alien/flesh/weeds/ex_act(severity)
switch(severity)
if(1.0)
del(src)
if(2.0)
if (prob(50))
del(src)
if(3.0)
if (prob(5))
del(src)
return
/obj/effect/alien/flesh/weeds/attackby(var/obj/item/weapon/W, var/mob/user)
if(W.attack_verb.len)
visible_message("\red <B>\The [src] has been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]")
else
visible_message("\red <B>\The [src] has been attacked with \the [W][(user ? " by [user]." : ".")]")
var/damage = W.force / 4.0
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0, user))
damage = 15
playsound(loc, 'sound/items/Welder.ogg', 100, 1)
health -= damage
healthcheck()
/obj/effect/alien/flesh/weeds/proc/healthcheck()
if(health <= 0)
del(src)
/obj/effect/alien/flesh/weeds/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
health -= 5
healthcheck()
/*/obj/effect/alien/weeds/burn(fi_amount)
if (fi_amount > 18000)
spawn( 0 )
del(src)
return
return 0
return 1
*/
#undef NODERANGE
//clothing, weapons, and other items that can be worn or used in some way
/obj/item/clothing/under/rank/navywarden
desc = "It's made of a slightly sturdier material than standard jumpsuits, to allow for more robust protection. It has the word \"Warden\" written on the shoulders."
name = "warden's jumpsuit"
icon_state = "wardendnavyclothes"
item_state = "wardendnavyclothes"
color = "wardendnavyclothes"
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
flags = FPRINT | TABLEPASS
/obj/item/clothing/under/rank/navysecurity
name = "security officer's jumpsuit"
desc = "It's made of a slightly sturdier material than standard jumpsuits, to allow for robust protection."
icon_state = "officerdnavyclothes"
item_state = "officerdnavyclothes"
color = "officerdnavyclothes"
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
flags = FPRINT | TABLEPASS
/obj/item/clothing/under/rank/navyhead_of_security
desc = "It's a jumpsuit worn by those few with the dedication to achieve the position of \"Head of Security\". It has additional armor to protect the wearer."
name = "head of security's jumpsuit"
icon_state = "hosdnavyclothes"
item_state = "hosdnavyclothes"
color = "hosdnavyclothes"
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
flags = FPRINT | TABLEPASS
/obj/item/clothing/suit/armor/hosnavycoat
name = "armored coat"
desc = "A coat enchanced with a special alloy for some protection and style."
icon_state = "hosdnavyjacket"
item_state = "armor"
armor = list(melee = 65, bullet = 30, laser = 50, energy = 10, bomb = 25, bio = 0, rad = 0)
/obj/item/clothing/head/beret/navysec
name = "security beret"
desc = "A beret with the security insignia emblazoned on it. For officers that are more inclined towards style than safety."
icon_state = "officerberet"
flags = FPRINT | TABLEPASS
/obj/item/clothing/head/beret/navywarden
name = "warden's beret"
desc = "A beret with a two-colored security insignia emblazoned on it. For wardens that are more inclined towards style than safety."
icon_state = "wardenberet"
flags = FPRINT | TABLEPASS
/obj/item/clothing/head/beret/navyhos
name = "security head's beret"
desc = "A stylish beret bearing a golden insignia that proudly displays the security coat of arms. A commander's must-have."
icon_state = "hosberet"
flags = FPRINT | TABLEPASS
/obj/item/clothing/suit/armor/navysecvest
name = "armored coat"
desc = "An armored coat that protects against some damage."
icon_state = "officerdnavyjacket"
item_state = "armor"
flags = FPRINT | TABLEPASS
armor = list(melee = 50, bullet = 15, laser = 50, energy = 10, bomb = 25, bio = 0, rad = 0)
/obj/item/clothing/suit/armor/navywardenvest
name = "Warden's jacket"
desc = "An armoured jacket with silver rank pips and livery."
icon_state = "wardendnavyjacket"
item_state = "armor"
flags = FPRINT | TABLEPASS
armor = list(melee = 50, bullet = 15, laser = 50, energy = 10, bomb = 25, bio = 0, rad = 0)
//hostile entities or npcs
/obj/item/projectile/slimeglob
icon = 'projectiles.dmi'
icon_state = "toxin"
damage = 20
damage_type = BRUTE
/obj/effect/critter/fleshmonster
name = "Fleshy Horror"
desc = "A grotesque, shambling fleshy horror... was this once a... a person?"
icon = 'icons/mob/mob.dmi'
icon_state = "horror"
/*
health = 120
max_health = 120
aggressive = 1
defensive = 1
wanderer = 1
opensdoors = 1
atkcarbon = 1
atksilicon = 1
atkcritter = 1
atksame = 0
atkmech = 1
firevuln = 0.5
brutevuln = 1
seekrange = 25
armor = 15
melee_damage_lower = 12
melee_damage_upper = 17
angertext = "shambles"
attacktext = "slashes"
var/ranged = 0
var/rapid = 0
proc
Shoot(var/target, var/start, var/user, var/bullet = 0)
OpenFire(var/thing)//bluh ill rename this later or somethin
Die()
if (!src.alive) return
src.alive = 0
walk_to(src,0)
src.visible_message("<b>[src]</b> disintegrates into mush!")
playsound(loc, 'sound/voice/hiss6.ogg', 80, 1, 1)
var/turf/Ts = get_turf(src)
new /obj/effect/decal/cleanable/blood(Ts)
del(src)
seek_target()
src.anchored = 0
var/T = null
for(var/mob/living/C in view(src.seekrange,src))//TODO: mess with this
if (src.target)
src.task = "chasing"
break
if((C.name == src.oldtarget_name) && (world.time < src.last_found + 100)) continue
if(istype(C, /mob/living/carbon/) && !src.atkcarbon) continue
if(istype(C, /mob/living/silicon/) && !src.atksilicon) continue
if(C.health < 0) continue
if(istype(C, /mob/living/carbon/) && src.atkcarbon)
if(C:mind)
if(C:mind:special_role == "H.I.V.E")
continue
src.attack = 1
if(istype(C, /mob/living/silicon/) && src.atksilicon)
if(C:mind)
if(C:mind:special_role == "H.I.V.E")
continue
src.attack = 1
if(src.attack)
T = C
break
if(!src.attack)
for(var/obj/effect/critter/C in view(src.seekrange,src))
if(istype(C, /obj/effect/critter) && !src.atkcritter) continue
if(C.health <= 0) continue
if(istype(C, /obj/effect/critter) && src.atkcritter)
if((istype(C, /obj/effect/critter/hivebot) && !src.atksame) || (C == src)) continue
T = C
break
for(var/obj/mecha/M in view(src.seekrange,src))
if(istype(M, /obj/mecha) && !src.atkmech) continue
if(M.health <= 0) continue
if(istype(M, /obj/mecha) && src.atkmech) src.attack = 1
if(src.attack)
T = M
break
if(src.attack)
src.target = T
src.oldtarget_name = T:name
if(src.ranged)
OpenFire(T)
return
src.task = "chasing"
return
OpenFire(var/thing)
src.target = thing
src.oldtarget_name = thing:name
for(var/mob/O in viewers(src, null))
O.show_message("\red <b>[src]</b> spits a glob at [src.target]!", 1)
var/tturf = get_turf(target)
if(rapid)
spawn(1)
Shoot(tturf, src.loc, src)
spawn(4)
Shoot(tturf, src.loc, src)
spawn(6)
Shoot(tturf, src.loc, src)
else
Shoot(tturf, src.loc, src)
src.attack = 0
sleep(12)
seek_target()
src.task = "thinking"
return
Shoot(var/target, var/start, var/user, var/bullet = 0)
if(target == start)
return
var/obj/item/projectile/slimeglob/A = new /obj/item/projectile/slimeglob(user:loc)
playsound(user, 'sound/weapons/bite.ogg', 100, 1)
if(!A) return
if (!istype(target, /turf))
del(A)
return
A.current = target
A.yo = target:y - start:y
A.xo = target:x - start:x
spawn( 0 )
A.process()
return
*/
obj/effect/critter/fleshmonster/fleshslime
name = "Flesh Slime"
icon = 'biocraps.dmi'
icon_state = "livingflesh"
desc = "A creature that appears to be made out of living tissue strewn together haphazardly. Some kind of liquid bubbles from its maw."
//ranged = 1
+19 -4
View File
@@ -1,3 +1,20 @@
//moved these here from code/defines/obj/weapon.dm
//please preference put stuff where it's easy to find - C
/obj/item/weapon/autopsy_scanner
name = "autopsy scanner"
desc = "Extracts information on wounds."
icon = 'icons/obj/autopsy_scanner.dmi'
icon_state = ""
flags = FPRINT | TABLEPASS | CONDUCT
w_class = 1.0
origin_tech = "materials=1;biotech=1"
var/list/datum/autopsy_data_scanner/wdata = list()
var/list/datum/autopsy_data_scanner/chemtraces = list()
var/target_name = null
var/timeofdeath = null
/datum/autopsy_data_scanner
var/weapon = null // this is the DEFINITE weapon type that was used
var/list/organs_scanned = list() // this maps a number of scanned organs to
@@ -65,10 +82,6 @@
usr << "No."
return
if(wdata.len == 0 && chemtraces.len == 0)
usr << "<b>* There is no data about any wounds in the scanner's database. You may have to scan more bodyparts, or otherwise this wound type may not be in the scanner's database."
return
var/scan_data = ""
if(timeofdeath)
@@ -170,6 +183,8 @@
if(target_name != M.name)
target_name = M.name
src.wdata = list()
src.chemtraces = list()
src.timeofdeath = null
user << "\red A new patient has been registered.. Purging data for previous patient."
src.timeofdeath = M.timeofdeath
+8 -16
View File
@@ -149,13 +149,13 @@
if(objholder in removed_paths)
alert("That path is not allowed.")
objholder = "/obj/structure/closet"
else if (dd_hasprefix(objholder, "/mob") && !(usr.client.holder.rank in list("Game Master", "Game Admin", "Badmin")))
else if (dd_hasprefix(objholder, "/mob") && !check_rights(R_DEBUG,0))
objholder = "/obj/structure/closet"
if(3)
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "viruses", "cuffed", "ka", "last_eaten", "urine")
master.buildmode.varholder = input(usr,"Enter variable name:" ,"Name", "name")
if(master.buildmode.varholder in locked && !(usr.client.holder.rank in list("Game Master", "Game Admin")))
if(master.buildmode.varholder in locked && !check_rights(R_DEBUG,0))
return
var/thetype = input(usr,"Select variable type:" ,"Type") in list("text","number","mob-reference","obj-reference","turf-reference")
if(!thetype) return
@@ -186,28 +186,28 @@
if(istype(object,/turf) && pa.Find("left") && !pa.Find("alt") && !pa.Find("ctrl") )
if(istype(object,/turf/space))
var/turf/T = object
T.ReplaceWithFloor()
T.ChangeTurf(/turf/simulated/floor)
return
else if(istype(object,/turf/simulated/floor))
var/turf/T = object
T.ReplaceWithWall()
T.ChangeTurf(/turf/simulated/wall)
return
else if(istype(object,/turf/simulated/wall))
var/turf/T = object
T.ReplaceWithRWall()
T.ChangeTurf(/turf/simulated/wall/r_wall)
return
else if(pa.Find("right"))
if(istype(object,/turf/simulated/wall))
var/turf/T = object
T.ReplaceWithFloor()
T.ChangeTurf(/turf/simulated/floor)
return
else if(istype(object,/turf/simulated/floor))
var/turf/T = object
T.ReplaceWithSpace()
T.ChangeTurf(/turf/space)
return
else if(istype(object,/turf/simulated/wall/r_wall))
var/turf/T = object
T.ReplaceWithWall()
T.ChangeTurf(/turf/simulated/wall)
return
else if(istype(object,/obj))
del(object)
@@ -235,7 +235,6 @@
if(pa.Find("left"))
var/obj/A = new holder.buildmode.objholder (get_turf(object))
A.dir = holder.builddir.dir
blink(A)
else if(pa.Find("right"))
if(isobj(object)) del(object)
@@ -244,14 +243,12 @@
if(object.vars.Find(holder.buildmode.varholder))
log_admin("[key_name(usr)] modified [object.name]'s [holder.buildmode.varholder] to [holder.buildmode.valueholder]")
object.vars[holder.buildmode.varholder] = holder.buildmode.valueholder
blink(object)
else
usr << "\red [initial(object.name)] does not have a var called '[holder.buildmode.varholder]'"
if(pa.Find("right"))
if(object.vars.Find(holder.buildmode.varholder))
log_admin("[key_name(usr)] modified [object.name]'s [holder.buildmode.varholder] to [holder.buildmode.valueholder]")
object.vars[holder.buildmode.varholder] = initial(object.vars[holder.buildmode.varholder])
blink(object)
else
usr << "\red [initial(object.name)] does not have a var called '[holder.buildmode.varholder]'"
@@ -262,8 +259,3 @@
if(holder.throw_atom)
holder.throw_atom.throw_at(object, 10, 1)
/proc/blink(atom/A)
A.icon += rgb(0,75,75)
spawn(5)
if(A)
A.icon = initial(A.icon)
-246
View File
@@ -1,246 +0,0 @@
dmm_suite
/*
dmm_suite version 1.0
Released January 30th, 2011.
defines the object /dmm_suite
- Provides the proc load_map()
- Loads the specified map file onto the specified z-level.
- provides the proc write_map()
- Returns a text string of the map in dmm format
ready for output to a file.
- provides the proc save_map()
- Returns a .dmm file if map is saved
- Returns FALSE if map fails to save
The dmm_suite provides saving and loading of map files in BYOND's native DMM map
format. It approximates the map saving and loading processes of the Dream Maker
and Dream Seeker programs so as to allow editing, saving, and loading of maps at
runtime.
------------------------
To save a map at runtime, create an instance of /dmm_suite, and then call
write_map(), which accepts three arguments:
- A turf representing one corner of a three dimensional grid (Required).
- Another turf representing the other corner of the same grid (Required).
- Any, or a combination, of several bit flags (Optional, see documentation).
The order in which the turfs are supplied does not matter, the /dmm_writer will
determine the grid containing both, in much the same way as DM's block() function.
write_map() will then return a string representing the saved map in dmm format;
this string can then be saved to a file, or used for any other purose.
------------------------
To load a map at runtime, create an instance of /dmm_suite, and then call load_map(),
which accepts two arguments:
- A .dmm file to load (Required).
- A number representing the z-level on which to start loading the map (Optional).
The /dmm_suite will load the map file starting on the specified z-level. If no
z-level was specified, world.maxz will be increased so as to fit the map. Note
that if you wish to load a map onto a z-level that already has objects on it,
you will have to handle the removal of those objects. Otherwise the new map will
simply load the new objects on top of the old ones.
Also note that all type paths specified in the .dmm file must exist in the world's
code, and that the /dmm_reader trusts that files to be loaded are in fact valid
.dmm files. Errors in the .dmm format will cause runtime errors.
*/
verb/load_map(var/dmm_file as file, var/z_offset as num)
// dmm_file: A .dmm file to load (Required).
// z_offset: A number representing the z-level on which to start loading the map (Optional).
verb/write_map(var/turf/t1 as turf, var/turf/t2 as turf, var/flags as num)
// t1: A turf representing one corner of a three dimensional grid (Required).
// t2: Another turf representing the other corner of the same grid (Required).
// flags: Any, or a combination, of several bit flags (Optional, see documentation).
// save_map is included as a legacy proc. Use write_map instead.
verb/save_map(var/turf/t1 as turf, var/turf/t2 as turf, var/map_name as text, var/flags as num)
// t1: A turf representing one corner of a three dimensional grid (Required).
// t2: Another turf representing the other corner of the same grid (Required).
// map_name: A valid name for the map to be saved, such as "castle" (Required).
// flags: Any, or a combination, of several bit flags (Optional, see documentation).
#define DMM_IGNORE_AREAS 1
#define DMM_IGNORE_TURFS 2
#define DMM_IGNORE_OBJS 4
#define DMM_IGNORE_NPCS 8
#define DMM_IGNORE_PLAYERS 16
#define DMM_IGNORE_MOBS 24
dmm_suite{
var{
quote = "\""
list/letter_digits = list(
"a","b","c","d","e",
"f","g","h","i","j",
"k","l","m","n","o",
"p","q","r","s","t",
"u","v","w","x","y",
"z",
"A","B","C","D","E",
"F","G","H","I","J",
"K","L","M","N","O",
"P","Q","R","S","T",
"U","V","W","X","Y",
"Z"
)
}
save_map(var/turf/t1 as turf, var/turf/t2 as turf, var/map_name as text, var/flags as num){
//Check for illegal characters in file name... in a cheap way.
if(!((ckeyEx(map_name)==map_name) && ckeyEx(map_name))){
CRASH("Invalid text supplied to proc save_map, invalid characters or empty string.")
}
//Check for valid turfs.
if(!isturf(t1) || !isturf(t2)){
CRASH("Invalid arguments supplied to proc save_map, arguments were not turfs.")
}
var/file_text = write_map(t1,t2,flags)
if(fexists("[map_name].dmm")){
fdel("[map_name].dmm")
}
var/saved_map = file("[map_name].dmm")
saved_map << file_text
return saved_map
}
write_map(var/turf/t1 as turf, var/turf/t2 as turf, var/flags as num){
//Check for valid turfs.
if(!isturf(t1) || !isturf(t2)){
CRASH("Invalid arguments supplied to proc write_map, arguments were not turfs.")
}
var/turf/nw = locate(min(t1.x,t2.x),max(t1.y,t2.y),min(t1.z,t2.z))
var/turf/se = locate(max(t1.x,t2.x),min(t1.y,t2.y),max(t1.z,t2.z))
var/list/templates[0]
var/template_buffer = {""}
var/dmm_text = {""}
for(var/pos_z=nw.z;pos_z<=se.z;pos_z++){
for(var/pos_y=nw.y;pos_y>=se.y;pos_y--){
for(var/pos_x=nw.x;pos_x<=se.x;pos_x++){
var/turf/test_turf = locate(pos_x,pos_y,pos_z)
var/test_template = make_template(test_turf, flags)
var/template_number = templates.Find(test_template)
if(!template_number){
templates.Add(test_template)
template_number = templates.len
}
template_buffer += "[template_number],"
}
template_buffer += ";"
}
template_buffer += "."
}
var/key_length = round/*floor*/(log(letter_digits.len,templates.len-1)+1)
var/list/keys[templates.len]
for(var/key_pos=1;key_pos<=templates.len;key_pos++){
keys[key_pos] = get_model_key(key_pos,key_length)
dmm_text += {""[keys[key_pos]]" = ([templates[key_pos]])\n"}
}
var/z_level = 0
for(var/z_pos=1;TRUE;z_pos=findtext(template_buffer,".",z_pos)+1){
if(z_pos>=length(template_buffer)){break}
if(z_level){dmm_text+={"\n"}}
dmm_text += {"\n(1,1,[++z_level]) = {"\n"}
var/z_block = copytext(template_buffer,z_pos,findtext(template_buffer,".",z_pos))
for(var/y_pos=1;TRUE;y_pos=findtext(z_block,";",y_pos)+1){
if(y_pos>=length(z_block)){break}
var/y_block = copytext(z_block,y_pos,findtext(z_block,";",y_pos))
for(var/x_pos=1;TRUE;x_pos=findtext(y_block,",",x_pos)+1){
if(x_pos>=length(y_block)){break}
var/x_block = copytext(y_block,x_pos,findtext(y_block,",",x_pos))
var/key_number = text2num(x_block)
var/temp_key = keys[key_number]
dmm_text += temp_key
sleep(-1)
}
dmm_text += {"\n"}
sleep(-1)
}
dmm_text += {"\"}"}
sleep(-1)
}
return dmm_text
}
proc{
make_template(var/turf/model as turf, var/flags as num){
var/template = ""
var/obj_template = ""
var/mob_template = ""
var/turf_template = ""
if(!(flags & DMM_IGNORE_TURFS)){
turf_template = "[model.type][check_attributes(model)],"
} else{ turf_template = "[world.turf],"}
var/area_template = ""
if(!(flags & DMM_IGNORE_OBJS)){
for(var/obj/O in model.contents){
obj_template += "[O.type][check_attributes(O)],"
}
}
for(var/mob/M in model.contents){
if(M.client){
if(!(flags & DMM_IGNORE_PLAYERS)){
mob_template += "[M.type][check_attributes(M)],"
}
}
else{
if(!(flags & DMM_IGNORE_NPCS)){
mob_template += "[M.type][check_attributes(M)],"
}
}
}
if(!(flags & DMM_IGNORE_AREAS)){
var/area/m_area = model.loc
area_template = "[m_area.type][check_attributes(m_area)]"
} else{ area_template = "[world.area]"}
template = "[obj_template][mob_template][turf_template][area_template]"
return template
}
check_attributes(var/atom/A){
var/attributes_text = {"{"}
for(var/V in A.vars){
sleep(-1)
if((!issaved(A.vars[V])) || (A.vars[V]==initial(A.vars[V]))){continue}
if(istext(A.vars[V])){
attributes_text += {"[V] = "[A.vars[V]]""}
}
else if(isnum(A.vars[V])||ispath(A.vars[V])){
attributes_text += {"[V] = [A.vars[V]]"}
}
else if(isicon(A.vars[V])||isfile(A.vars[V])){
attributes_text += {"[V] = '[A.vars[V]]'"}
}
else{
continue
}
if(attributes_text != {"{"}){
attributes_text+={"; "}
}
}
if(attributes_text=={"{"}){
return
}
if(copytext(attributes_text, length(attributes_text)-1, 0) == {"; "}){
attributes_text = copytext(attributes_text, 1, length(attributes_text)-1)
}
attributes_text += {"}"}
return attributes_text
}
get_model_key(var/which as num, var/key_length as num){
var/key = ""
var/working_digit = which-1
for(var/digit_pos=key_length;digit_pos>=1;digit_pos--){
var/place_value = round/*floor*/(working_digit/(letter_digits.len**(digit_pos-1)))
working_digit-=place_value*(letter_digits.len**(digit_pos-1))
key = "[key][letter_digits[place_value+1]]"
}
return key
}
}
}
-181
View File
@@ -1,181 +0,0 @@
dmm_suite/load_map(var/dmm_file as file, var/z_offset as num)
if(!z_offset)
z_offset = world.maxz+1
var/quote = ascii2text(34)
var/tfile = file2text(dmm_file)
var/tfile_len = length(tfile)
var/list/grid_models[0]
var/key_len = length(copytext(tfile,2,findtext(tfile,quote,2,0)))
for(var/lpos=1;lpos<tfile_len;lpos=findtext(tfile,"\n",lpos,0)+1)
var/tline = copytext(tfile,lpos,findtext(tfile,"\n",lpos,0))
if(copytext(tline,1,2)!=quote) break
var/model_key = copytext(tline,2,findtext(tfile,quote,2,0))
var/model_contents = copytext(tline,findtext(tfile,"=")+3,length(tline))
grid_models[model_key] = model_contents
sleep(-1)
var/zcrd=-1
var/ycrd=0
var/xcrd=0
for(var/zpos=findtext(tfile,"\n(1,1,");TRUE;zpos=findtext(tfile,"\n(1,1,",zpos+1,0))
zcrd++
world.maxz = max(world.maxz, zcrd+z_offset)
ycrd=0
var/zgrid = copytext(tfile,findtext(tfile,quote+"\n",zpos,0)+2,findtext(tfile,"\n"+quote,zpos,0)+1)
for(var/gpos=1;gpos!=0;gpos=findtext(zgrid,"\n",gpos,0)+1)
var/grid_line = copytext(zgrid,gpos,findtext(zgrid,"\n",gpos,0)+1)
var/y_depth = length(zgrid)/(length(grid_line))
if(world.maxy<y_depth) world.maxy=y_depth
grid_line=copytext(grid_line,1,length(grid_line))
if(!ycrd)
ycrd = y_depth
else
ycrd--
xcrd=0
for(var/mpos=1;mpos<=length(grid_line);mpos+=key_len)
xcrd++
if(world.maxx<xcrd) world.maxx=xcrd
var/model_key = copytext(grid_line,mpos,mpos+key_len)
parse_grid(grid_models[model_key],xcrd,ycrd,zcrd+z_offset)
if(gpos+length(grid_line)+1>length(zgrid)) break
sleep(-1)
if(findtext(tfile,quote+"}",zpos,0)+2==tfile_len) break
sleep(-1)
dmm_suite/proc/parse_grid(var/model as text,var/xcrd as num,var/ycrd as num,var/zcrd as num)
set background = 1
/*Method parse_grid()
- Accepts a text string containing a comma separated list of type paths of the
same construction as those contained in a .dmm file, and instantiates them.
*/
var/list/text_strings[0]
for(var/index=1;findtext(model,quote);index++)
/*Loop: Stores quoted portions of text in text_strings, and replaces them with an
index to that list.
- Each iteration represents one quoted section of text.
*/
text_strings.len=index
text_strings[index] = copytext(model,findtext(model,quote)+1,findtext(model,quote,findtext(model,quote)+1,0))
model = copytext(model,1,findtext(model,quote))+"~[index]"+copytext(model,findtext(model,quote,findtext(model,quote)+1,0)+1,0)
sleep(-1)
for(var/dpos=1;dpos!=0;dpos=findtext(model,",",dpos,0)+1)
/*Loop: Identifies each object's data, instantiates it, and reconstitues it's fields.
- Each iteration represents one object's data, including type path and field values.
*/
var/full_def = copytext(model,dpos,findtext(model,",",dpos,0))
var/atom_def = text2path(copytext(full_def,1,findtext(full_def,"{")))
if(ispath(atom_def, /turf/space))
continue
var/list/attributes[0]
if(findtext(full_def,"{"))
full_def = copytext(full_def,1,length(full_def))
for(var/apos=findtext(full_def,"{")+1;apos!=0;apos=findtext(full_def,";",apos,0)+1)
//Loop: Identifies each attribute/value pair, and stores it in attributes[].
attributes.Add(copytext(full_def,apos,findtext(full_def,";",apos,0)))
if(!findtext(copytext(full_def,apos,0),";")) break
sleep(-1)
//Construct attributes associative list
var/list/fields = new(0)
for(var/index=1;index<=attributes.len;index++)
var/trim_left = trim_text(copytext(attributes[index],1,findtext(attributes[index],"=")))
var/trim_right = trim_text(copytext(attributes[index],findtext(attributes[index],"=")+1,0))
//Check for string
if(findtext(trim_right,"~"))
var/reference_index = copytext(trim_right,findtext(trim_right,"~")+1,0)
trim_right=text_strings[text2num(reference_index)]
//Check for number
else if(isnum(text2num(trim_right)))
trim_right = text2num(trim_right)
//Check for file
else if(copytext(trim_right,1,2) == "'")
trim_right = file(copytext(trim_right,2,length(trim_right)))
fields[trim_left] = trim_right
//End construction
//Begin Instanciation
var/atom/instance
var/dmm_suite/preloader/_preloader = new(fields)
if(ispath(atom_def,/area))
var/turf/A = locate(xcrd,ycrd,zcrd)
if(A.loc.name == "Space")
instance = locate(atom_def)
if(instance)
instance.contents.Add(locate(xcrd,ycrd,zcrd))
else
//global.current_preloader = _preloader
instance = new atom_def(locate(xcrd,ycrd,zcrd))
if(_preloader)
_preloader.load(instance)
//End Instanciation
if(!findtext(copytext(model,dpos,0),",")) break
dmm_suite/proc/trim_text(var/what as text)
while(length(what) && findtext(what," ",1,2))
what=copytext(what,2,0)
while(length(what) && findtext(what," ",length(what),0))
what=copytext(what,1,length(what))
return what
/*
var/global/dmm_suite/preloader/current_preloader = null
atom/New()
if(global.current_preloader)
global.current_preloader.load(src)
..()
*/
dmm_suite/preloader
parent_type = /datum
var/list/attributes
New(list/the_attributes)
..()
if(!the_attributes.len) Del()
attributes = the_attributes
proc/load(atom/what)
for(var/attribute in attributes)
what.vars[attribute] = attributes[attribute]
Del()
/client/proc/mapload(var/dmm_map as file)
set category = "Debug"
set name = "LoadMap"
set desc = "Loads a map"
set hidden = 1
if(src.holder)
if(!src.mob)
return
if(src.holder.rank in list("Game Admin", "Game Master"))
var/file_name = "[dmm_map]"
var/file_extension = copytext(file_name,length(file_name)-2,0)
if(file_extension != "dmm")
usr << "Supplied file must be a .dmm file."
return
var/map_z = input(usr,"Enter variable value:" ,"Value", 123) as num
if(map_z > (world.maxz+1))
map_z = (world.maxz+1)
var/dmm_suite/new_reader = new()
new_reader.load_map(dmm_map, map_z)
log_admin("[key_name(src.mob)] loaded a map on z:[map_z]")
else
alert("No")
return
return
File diff suppressed because it is too large Load Diff
+1 -2
View File
@@ -235,7 +235,6 @@ proc/airborne_can_reach(turf/source, turf/target)
if(prob(1))
majormutate()
if(mob.reagents.has_reagent("spaceacillin"))
mob.reagents.remove_reagent("spaceacillin",0.3)
return
if(mob.reagents.has_reagent("virusfood"))
mob.reagents.remove_reagent("virusfood",0.1)
@@ -599,4 +598,4 @@ proc/airborne_can_reach(turf/source, turf/target)
getrandomeffect_greater()
/proc/dprob(var/p)
return(prob(sqrt(p)) && prob(sqrt(p)))
return(prob(sqrt(p)) && prob(sqrt(p)))
+1 -1
View File
@@ -165,5 +165,5 @@
if(beaker)
if(!beaker.reagents.remove_reagent("virusfood",5))
foodsupply += 10
if(!beaker.reagents.remove_reagent("toxins",1))
if(!beaker.reagents.remove_reagent("toxin",1))
toxins += 1