mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-15 17:13:46 +01:00
Updating PR again
This commit is contained in:
@@ -86,9 +86,6 @@
|
||||
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)
|
||||
|
||||
@@ -144,10 +144,12 @@ You've gained <b>[totalkarma]</b> total karma in your time here.<br>"}
|
||||
/client/proc/karmashopmenu()
|
||||
var/dat = {"<B>Karma Shop</B><br>
|
||||
<a href='?src=\ref[src];KarmaBuy=1'>Unlock Barber -- 5KP</a><br>
|
||||
<a href='?src=\ref[src];KarmaBuy=2'>Unlock Nanotrasen Representative -- 30KP</a><br>
|
||||
<a href='?src=\ref[src];KarmaBuy=3'>Unlock Customs Officer -- 30P</a><br>
|
||||
<a href='?src=\ref[src];KarmaBuy=4'>Unlock Blueshield -- 30KP</a><br>
|
||||
<a href='?src=\ref[src];KarmaBuy=5'>Unlock Mechanic -- 30KP</a><br>
|
||||
<a href='?src=\ref[src];KarmaBuy=2'>Unlock Brig Physician -- 5KP</a><br>
|
||||
<a href='?src=\ref[src];KarmaBuy=3'>Unlock Nanotrasen Representative -- 30KP</a><br>
|
||||
<a href='?src=\ref[src];KarmaBuy=4'>Unlock Customs Officer -- 30P</a><br>
|
||||
<a href='?src=\ref[src];KarmaBuy=5'>Unlock Blueshield -- 30KP</a><br>
|
||||
<a href='?src=\ref[src];KarmaBuy=6'>Unlock Mechanic -- 30KP</a><br>
|
||||
<a href='?src=\ref[src];KarmaBuy=7'>Unlock Magistrate -- 45KP</a><br>
|
||||
|
||||
<br>
|
||||
<a href='?src=\ref[src];KarmaBuy2=1'>Unlock Machine People -- 15KP</a><br>
|
||||
|
||||
@@ -85,6 +85,10 @@ datum/controller/game_controller/proc/setup()
|
||||
|
||||
color_windows_init()
|
||||
|
||||
//Create the mining ore distribution map.
|
||||
var/datum/ore_distribution/O = new()
|
||||
O.populate_distribution_map()
|
||||
|
||||
spawn(0)
|
||||
if(ticker)
|
||||
ticker.pregame()
|
||||
|
||||
@@ -411,27 +411,59 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
|
||||
if(usr.get_active_hand() != src)
|
||||
return
|
||||
|
||||
var/w1
|
||||
var/w2
|
||||
var/w3
|
||||
var/list/dictionary = list (
|
||||
"convert" = list("join","blood","self"),
|
||||
"wall" = list("destroy","travel","self"),
|
||||
"blood boil" = list("destroy","see","blood"),
|
||||
"blood drain" = list("travel","blood","self"),
|
||||
"raise dead" = list("blood","join","hell"),
|
||||
"summon narsie" = list("hell","join","self"),
|
||||
"communicate" = list("self","other","technology"),
|
||||
"emp" = list("destroy","see","technology"),
|
||||
"manifest" = list("blood","see","travel"),
|
||||
"summon tome" = list("see","blood","hell"),
|
||||
"see invisible" = list("see","hell","join"),
|
||||
"hide" = list("hide","see","blood"),
|
||||
"reveal" = list("blood","see","hide"),
|
||||
"astral journey" = list("hell","travel","self"),
|
||||
"imbue" = list("hell","technology","join"),
|
||||
"sacrifice" = list("hell","blood","join"),
|
||||
"summon cultist" = list("join","other","self"),
|
||||
"free cultist" = list("travel","technology","other"),
|
||||
"deafen" = list("hide","other","see"),
|
||||
"blind" = list("destroy","see","other"),
|
||||
"stun" = list("join","hide","technology"),
|
||||
"armor" = list("hell","destroy","other"),
|
||||
"teleport" = list("travel","self"),
|
||||
"teleport other" = list("travel","other")
|
||||
)
|
||||
|
||||
var/list/english = list()
|
||||
for (var/w in words)
|
||||
english+=words[w]
|
||||
|
||||
var/list/scribewords = list("none")
|
||||
|
||||
for (var/entry in words)
|
||||
if (words[entry] != entry)
|
||||
english += list(words[entry] = entry)
|
||||
|
||||
for (var/entry in dictionary)
|
||||
var/list/required = dictionary[entry]
|
||||
if (length(english&required) == required.len)
|
||||
scribewords += entry
|
||||
|
||||
var/chosen_rune = null
|
||||
|
||||
if(usr)
|
||||
w1 = input("Write your first rune:", "Rune Scribing") in english
|
||||
for (var/w in words)
|
||||
if (words[w] == w1)
|
||||
w1 = w
|
||||
if(usr)
|
||||
w2 = input("Write your second rune:", "Rune Scribing") in english
|
||||
for (var/w in words)
|
||||
if (words[w] == w2)
|
||||
w2 = w
|
||||
if(usr)
|
||||
w3 = input("Write your third rune:", "Rune Scribing") in english
|
||||
for (var/w in words)
|
||||
if (words[w] == w3)
|
||||
w3 = w
|
||||
chosen_rune = input ("Choose a rune to scribe.") in scribewords
|
||||
if (!chosen_rune)
|
||||
return
|
||||
if (chosen_rune == "none")
|
||||
user << "\red You decide against scribing a rune, perhaps you should take this time to study your notes."
|
||||
return
|
||||
if (chosen_rune == "teleport")
|
||||
dictionary[chosen_rune] += input ("Choose a destination word") in english
|
||||
if (chosen_rune == "teleport other")
|
||||
dictionary[chosen_rune] += input ("Choose a destination word") in english
|
||||
|
||||
if(usr.get_active_hand() != src)
|
||||
return
|
||||
@@ -446,9 +478,10 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
|
||||
var/mob/living/carbon/human/H = user
|
||||
var/obj/effect/rune/R = new /obj/effect/rune(user.loc)
|
||||
user << "\red You finish drawing the arcane markings of the Geometer."
|
||||
R.word1 = w1
|
||||
R.word2 = w2
|
||||
R.word3 = w3
|
||||
var/list/required = dictionary[chosen_rune]
|
||||
R.word1 = english[required[1]]
|
||||
R.word2 = english[required[2]]
|
||||
R.word3 = english[required[3]]
|
||||
R.check_icon()
|
||||
R.blood_DNA = list()
|
||||
R.blood_DNA[H.dna.unique_enzymes] = H.dna.b_type
|
||||
@@ -467,8 +500,8 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
|
||||
// return
|
||||
// for(var/mob/M in nearby)
|
||||
// if(M == user)
|
||||
for(var/w in words)
|
||||
words[w] = T.words[w]
|
||||
for(var/entry in words)
|
||||
words[entry] = T.words[entry]
|
||||
user << "You copy the translation notes from your tome."
|
||||
|
||||
|
||||
|
||||
@@ -340,49 +340,6 @@
|
||||
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
//var/global/lawyer = 0//Checks for another lawyer //This changed clothes on 2nd lawyer, both IA get the same dreds.
|
||||
/datum/job/lawyer
|
||||
title = "Internal Affairs Agent"
|
||||
flag = LAWYER
|
||||
department_flag = CIVILIAN
|
||||
faction = "Station"
|
||||
total_positions = 2
|
||||
spawn_positions = 2
|
||||
supervisors = "the captain"
|
||||
selection_color = "#dddddd"
|
||||
access = list(access_lawyer, access_court, access_sec_doors, access_maint_tunnels)
|
||||
minimal_access = list(access_lawyer, access_court, access_sec_doors, access_maint_tunnels)
|
||||
alt_titles = list("Lawyer","Public Defender")
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
switch(H.backbag)
|
||||
if(2) H.equip_or_collect(new /obj/item/weapon/storage/backpack(H), slot_back)
|
||||
if(3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
|
||||
if(4) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
|
||||
H.equip_or_collect(new /obj/item/clothing/under/rank/internalaffairs(H), slot_w_uniform)
|
||||
H.equip_or_collect(new /obj/item/clothing/suit/storage/internalaffairs(H), slot_wear_suit)
|
||||
H.equip_or_collect(new /obj/item/clothing/shoes/brown(H), slot_shoes)
|
||||
H.equip_or_collect(new /obj/item/clothing/glasses/sunglasses/big(H), slot_glasses)
|
||||
H.equip_or_collect(new /obj/item/device/pda/lawyer(H), slot_wear_pda)
|
||||
H.equip_or_collect(new /obj/item/weapon/storage/briefcase(H), slot_l_hand)
|
||||
H.equip_or_collect(new /obj/item/device/laser_pointer(H), slot_l_store)
|
||||
if(H.backbag == 1)
|
||||
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
|
||||
else
|
||||
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
|
||||
L.imp_in = H
|
||||
L.implanted = 1
|
||||
var/datum/organ/external/affected = H.organs_by_name["head"]
|
||||
affected.implants += L
|
||||
L.part = affected
|
||||
return 1
|
||||
|
||||
|
||||
/datum/job/barber
|
||||
title = "Barber"
|
||||
flag = BARBER
|
||||
|
||||
@@ -204,3 +204,34 @@
|
||||
H.equip_or_collect(new /obj/item/weapon/stamp(H), slot_in_backpack)
|
||||
H.equip_or_collect(new /obj/item/weapon/stamp/denied(H), slot_in_backpack)
|
||||
return 1
|
||||
|
||||
/datum/job/brigdoc
|
||||
title = "Brig Physician"
|
||||
flag = BRIGDOC
|
||||
department_flag = KARMA
|
||||
faction = "Station"
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
supervisors = "the warden"
|
||||
selection_color = "#ffeeee"
|
||||
access = list(access_medical, access_morgue, access_surgery, access_chemistry, access_virology, access_genetics)
|
||||
minimal_access = list(access_medical, access_morgue, access_surgery, access_security, access_sec_doors, access_brig, access_court, access_maint_tunnels)
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
switch(H.backbag)
|
||||
if(2) H.equip_or_collect(new /obj/item/weapon/storage/backpack/medic(H), slot_back)
|
||||
if(3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back)
|
||||
if(4) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
|
||||
H.equip_or_collect(new /obj/item/clothing/under/rank/medical(H), slot_w_uniform)
|
||||
H.equip_or_collect(new /obj/item/clothing/suit/storage/fr_jacket(H), slot_wear_suit)
|
||||
H.equip_or_collect(new /obj/item/clothing/shoes/white(H), slot_shoes)
|
||||
H.equip_or_collect(new /obj/item/device/pda/medical(H), slot_wear_pda)
|
||||
H.equip_or_collect(new /obj/item/weapon/storage/firstaid/adv(H), slot_l_hand)
|
||||
H.equip_or_collect(new /obj/item/device/flashlight/pen(H), slot_s_store)
|
||||
if(H.backbag == 1)
|
||||
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
|
||||
else
|
||||
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
return 1
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
supervisors = "Nanotrasen Board of Directors"
|
||||
selection_color = "#ccccff"
|
||||
selection_color = "#ddddff"
|
||||
idtype = /obj/item/weapon/card/id/centcom
|
||||
req_admin_notify = 1
|
||||
minimal_player_age = 10
|
||||
@@ -149,7 +149,7 @@
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
supervisors = "Whichever head your protect, and ultimately the Captain"
|
||||
selection_color = "#ccccff"
|
||||
selection_color = "#ddddff"
|
||||
idtype = /obj/item/weapon/card/id/centcom
|
||||
req_admin_notify = 1
|
||||
minimal_player_age = 10
|
||||
@@ -189,4 +189,85 @@
|
||||
var/datum/organ/external/affected = H.organs_by_name["head"]
|
||||
affected.implants += L
|
||||
L.part = affected
|
||||
return 1
|
||||
|
||||
/datum/job/judge
|
||||
title = "Magistrate"
|
||||
flag = JUDGE
|
||||
department_flag = KARMA
|
||||
faction = "Station"
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
supervisors = "Centcom High Court"
|
||||
selection_color = "#ddddff"
|
||||
idtype = /obj/item/weapon/card/id/centcom
|
||||
req_admin_notify = 1
|
||||
minimal_player_age = 10
|
||||
access = list(access_security, access_sec_doors, access_brig, access_court, access_forensics_lockers,
|
||||
access_medical, access_engine, access_change_ids, access_ai_upload, access_eva, access_heads,
|
||||
access_all_personal_lockers, access_maint_tunnels, access_bar, access_janitor, access_construction, access_morgue,
|
||||
access_crematorium, access_kitchen, 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)
|
||||
minimal_access = list(access_security, access_sec_doors, access_brig, access_court, access_maint_tunnels, access_lawyer)
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/heads/hop(H), slot_l_ear)
|
||||
switch(H.backbag)
|
||||
if(2) H.equip_or_collect(new /obj/item/weapon/storage/backpack(H), slot_back)
|
||||
if(3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
|
||||
if(4) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
|
||||
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_if_possible(new /obj/item/clothing/under/suit_jacket/really_black(H), slot_w_uniform)
|
||||
H.equip_if_possible(new /obj/item/clothing/suit/judgerobe(H), slot_wear_suit)
|
||||
H.equip_if_possible(new /obj/item/clothing/shoes/centcom(H), slot_shoes)
|
||||
H.equip_or_collect(new /obj/item/clothing/head/powdered_wig(H), slot_head)
|
||||
H.equip_or_collect(new /obj/item/device/pda/heads/hop(H), slot_wear_pda)
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
|
||||
L.imp_in = H
|
||||
L.implanted = 1
|
||||
var/datum/organ/external/affected = H.organs_by_name["head"]
|
||||
affected.implants += L
|
||||
L.part = affected
|
||||
return 1
|
||||
|
||||
//var/global/lawyer = 0//Checks for another lawyer //This changed clothes on 2nd lawyer, both IA get the same dreds.
|
||||
/datum/job/lawyer
|
||||
title = "Internal Affairs Agent"
|
||||
flag = LAWYER
|
||||
department_flag = CIVILIAN
|
||||
faction = "Station"
|
||||
total_positions = 2
|
||||
spawn_positions = 2
|
||||
supervisors = "the magistrate"
|
||||
selection_color = "#ddddff"
|
||||
access = list(access_lawyer, access_court, access_sec_doors, access_maint_tunnels)
|
||||
minimal_access = list(access_lawyer, access_court, access_sec_doors, access_maint_tunnels)
|
||||
alt_titles = list("Lawyer","Public Defender")
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
switch(H.backbag)
|
||||
if(2) H.equip_or_collect(new /obj/item/weapon/storage/backpack(H), slot_back)
|
||||
if(3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
|
||||
if(4) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
|
||||
H.equip_or_collect(new /obj/item/clothing/under/rank/internalaffairs(H), slot_w_uniform)
|
||||
H.equip_or_collect(new /obj/item/clothing/suit/storage/internalaffairs(H), slot_wear_suit)
|
||||
H.equip_or_collect(new /obj/item/clothing/shoes/brown(H), slot_shoes)
|
||||
H.equip_or_collect(new /obj/item/clothing/glasses/sunglasses/big(H), slot_glasses)
|
||||
H.equip_or_collect(new /obj/item/device/pda/lawyer(H), slot_wear_pda)
|
||||
H.equip_or_collect(new /obj/item/weapon/storage/briefcase(H), slot_l_hand)
|
||||
H.equip_or_collect(new /obj/item/device/laser_pointer(H), slot_l_store)
|
||||
if(H.backbag == 1)
|
||||
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
|
||||
else
|
||||
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
|
||||
L.imp_in = H
|
||||
L.implanted = 1
|
||||
var/datum/organ/external/affected = H.organs_by_name["head"]
|
||||
affected.implants += L
|
||||
L.part = affected
|
||||
return 1
|
||||
+10
-5
@@ -53,6 +53,8 @@ var/const/BLUESHIELD =(1<<1)
|
||||
var/const/CUSTOMS =(1<<2)
|
||||
var/const/BARBER =(1<<3)
|
||||
var/const/MECHANIC =(1<<4)
|
||||
var/const/BRIGDOC =(1<<5)
|
||||
var/const/JUDGE =(1<<6)
|
||||
|
||||
var/list/assistant_occupations = list(
|
||||
)
|
||||
@@ -64,8 +66,7 @@ var/list/command_positions = list(
|
||||
"Head of Security",
|
||||
"Chief Engineer",
|
||||
"Research Director",
|
||||
"Chief Medical Officer",
|
||||
"Nanotrasen Representative"
|
||||
"Chief Medical Officer"
|
||||
)
|
||||
|
||||
|
||||
@@ -112,7 +113,8 @@ var/list/civilian_positions = list(
|
||||
"Assistant",
|
||||
"Clown",
|
||||
"Mime",
|
||||
"Barber"
|
||||
"Barber",
|
||||
"Magistrate"
|
||||
|
||||
)
|
||||
|
||||
@@ -123,7 +125,8 @@ var/list/security_positions = list(
|
||||
"Detective",
|
||||
"Security Officer",
|
||||
"Customs Officer",
|
||||
"Blueshield"
|
||||
"Blueshield",
|
||||
"Brig Physician"
|
||||
)
|
||||
|
||||
|
||||
@@ -138,7 +141,9 @@ var/list/whitelisted_positions = list(
|
||||
"Customs Officer",
|
||||
"Nanotrasen Representative",
|
||||
"Barber",
|
||||
"Mechanic"
|
||||
"Mechanic",
|
||||
"Brig Physician",
|
||||
"Magistrate"
|
||||
)
|
||||
|
||||
/proc/guest_jobbans(var/job)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#define AIRLOCK_CONTROL_RANGE 5
|
||||
#define AIRLOCK_CONTROL_RANGE 22
|
||||
|
||||
// This code allows for airlocks to be controlled externally by setting an id_tag and comm frequency (disables ID access)
|
||||
obj/machinery/door/airlock
|
||||
@@ -53,8 +53,6 @@ obj/machinery/door/airlock/receive_signal(datum/signal/signal)
|
||||
|
||||
|
||||
obj/machinery/door/airlock/proc/send_status()
|
||||
if (!can_radio()) return
|
||||
|
||||
if(radio_connection)
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
|
||||
@@ -109,11 +109,6 @@
|
||||
/datum/computer/file/embedded_program/docking/airlock/ready_for_undocking()
|
||||
return airlock_program.check_doors_secured()
|
||||
|
||||
/datum/computer/file/embedded_program/docking/airlock/reset()
|
||||
airlock_program.stop_cycling()
|
||||
airlock_program.close_doors()
|
||||
..()
|
||||
|
||||
//An airlock controller to be used by the airlock-based docking port controller.
|
||||
//Same as a regular airlock controller but allows disabling of the regular airlock functions when docking
|
||||
/datum/computer/file/embedded_program/airlock/docking
|
||||
@@ -171,4 +166,5 @@
|
||||
set category = "Debug"
|
||||
set src in view(1)
|
||||
src.program:initiate_undocking()
|
||||
|
||||
*/
|
||||
@@ -14,8 +14,13 @@
|
||||
MODE_CLIENT|STATE_UNDOCKED sent a request for docking and now waiting for a reply.
|
||||
MODE_CLIENT|STATE_DOCKING server told us they are OK to dock, waiting for our docking port to be ready.
|
||||
MODE_CLIENT|STATE_DOCKED idle - docked as client.
|
||||
<<<<<<< HEAD
|
||||
MODE_CLIENT|STATE_UNDOCKING we are either waiting for our docking port to be ready or for the server to give us the OK to undock.
|
||||
|
||||
=======
|
||||
MODE_CLIENT|STATE_UNDOCKING we are either waiting for our docking port to be ready or for the server to give us the OK to finish undocking.
|
||||
|
||||
>>>>>>> 232e50e... Shuttle console refactoring
|
||||
MODE_SERVER|STATE_UNDOCKED should never happen.
|
||||
MODE_SERVER|STATE_DOCKING someone requested docking, we are waiting for our docking port to be ready.
|
||||
MODE_SERVER|STATE_DOCKED idle - docked as server
|
||||
@@ -24,10 +29,68 @@
|
||||
MODE_NONE|STATE_UNDOCKED idle - not docked.
|
||||
MODE_NONE|anything else should never happen.
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
|
||||
>>>>>>> ed4fb8d... Shuttles now dock on arrival and departure
|
||||
=======
|
||||
|
||||
=======
|
||||
|
||||
*** Docking Signals ***
|
||||
|
||||
Docking
|
||||
Client sends request_dock
|
||||
<<<<<<< HEAD
|
||||
When server is ready, sends confirm_dock
|
||||
Client sends confirm_dock back
|
||||
|
||||
Undocking
|
||||
Client sends request_undock
|
||||
When server is ready, sends confirm_dock
|
||||
Client sends confirm_dock back
|
||||
|
||||
Note that in both cases each side exchanges confirm_dock before the docking operation is considered done.
|
||||
|
||||
>>>>>>> dc7d8fa... Adjusts how undocking signals are used
|
||||
=======
|
||||
Server sends confirm_dock to say that yes, we will serve your request
|
||||
When client is ready, sends confirm_dock
|
||||
Server sends confirm_dock back to indicate that docking is complete
|
||||
|
||||
Undocking
|
||||
Client sends request_undock
|
||||
When client is ready, sends confirm_undock
|
||||
Server sends confirm_undock back to indicate that docking is complete
|
||||
|
||||
Note that in both cases each side exchanges confirm_dock before the docking operation is considered done.
|
||||
The client first sends a confirm message to indicate it is ready, and then finally the server will send it's
|
||||
confirm message to indicate that the operation is complete.
|
||||
|
||||
Note also that when docking, the server sends an additional confirm message. This is because before docking,
|
||||
the server and client do not have a defined relationship. Before undocking, the server and client are already
|
||||
related to each other, thus the extra confirm message is not needed.
|
||||
|
||||
>>>>>>> d837e5d... Streamlined docking code
|
||||
*** Override, what is it? ***
|
||||
|
||||
The purpose of enabling the override is to prevent the docking program from automatically doing things with the docking port when docking or undocking.
|
||||
Maybe the shuttle is full of plamsa/phoron for some reason, and you don't want the door to automatically open, or the airlock to cycle.
|
||||
This means that the prepare_for_docking/undocking and finish_docking/undocking procs don't get called.
|
||||
|
||||
The docking controller will still check the state of the docking port, and thus prevent the shuttle from launching unless they force the launch (handling forced
|
||||
launches is not the docking controller's responsibility). In this case it is up to the players to manually get the docking port into a good state to undock
|
||||
(which usually just means closing and locking the doors).
|
||||
<<<<<<< HEAD
|
||||
|
||||
In line with this, docking controllers should prevent players from manually doing things when the override is disabled.
|
||||
>>>>>>> acec01f... Docking overrides now have a clear purpose
|
||||
=======
|
||||
|
||||
In line with this, docking controllers should prevent players from manually doing things when the override is NOT enabled.
|
||||
>>>>>>> 232e50e... Shuttle console refactoring
|
||||
*/
|
||||
|
||||
|
||||
@@ -38,6 +101,7 @@
|
||||
var/response_sent = 0 //so we don't spam confirmation messages
|
||||
|
||||
var/override_enabled = 0 //skips checks for the docking port being ready
|
||||
var/received_confirm = 0 //for undocking, whether the client has recieved a confirmation from the server
|
||||
|
||||
/datum/computer/file/embedded_program/docking/receive_signal(datum/signal/signal, receive_method, receive_param)
|
||||
var/receive_tag = signal.data["tag"] //for docking signals, this is the sender id
|
||||
@@ -53,13 +117,14 @@
|
||||
dock_state = STATE_DOCKING
|
||||
if (!override_enabled)
|
||||
prepare_for_docking()
|
||||
else if (control_mode == MODE_SERVER && dock_state == STATE_DOCKING && receive_tag == tag_target) //client just sent us the confirmation back, we're done with the docking process
|
||||
|
||||
else if (control_mode == MODE_CLIENT && dock_state == STATE_DOCKING && receive_tag == tag_target)
|
||||
dock_state = STATE_DOCKED
|
||||
if (!override_enabled)
|
||||
finish_docking() //server done docking!
|
||||
finish_docking() //client done docking!
|
||||
response_sent = 0
|
||||
else
|
||||
send_docking_command(tag_target, "abort_dock") //not expecting confirmation for anything - tell the other guy.
|
||||
else if (control_mode == MODE_SERVER && dock_state == STATE_DOCKING && receive_tag == tag_target) //client just sent us the confirmation back, we're done with the docking process
|
||||
received_confirm = 1
|
||||
|
||||
if ("request_dock")
|
||||
if (control_mode == MODE_NONE && dock_state == STATE_UNDOCKED)
|
||||
@@ -68,16 +133,21 @@
|
||||
tag_target = receive_tag
|
||||
if (!override_enabled)
|
||||
prepare_for_docking()
|
||||
send_docking_command(tag_target, "confirm_dock") //acknowledge the request
|
||||
|
||||
if ("confirm_undock")
|
||||
if (control_mode == MODE_CLIENT && dock_state == STATE_UNDOCKING && receive_tag == tag_target)
|
||||
send_docking_command(tag_target, "confirm_undock")
|
||||
if (!override_enabled)
|
||||
finish_undocking()
|
||||
reset() //client is done undocking!
|
||||
else if (control_mode == MODE_SERVER && dock_state == STATE_UNDOCKING && receive_tag == tag_target)
|
||||
received_confirm = 1
|
||||
|
||||
if ("request_undock")
|
||||
if (control_mode == MODE_SERVER && dock_state == STATE_DOCKED && receive_tag == tag_target)
|
||||
dock_state = STATE_UNDOCKING
|
||||
prepare_for_undocking()
|
||||
if (!override_enabled)
|
||||
prepare_for_undocking()
|
||||
|
||||
if ("dock_error")
|
||||
if (receive_tag == tag_target)
|
||||
@@ -86,26 +156,36 @@
|
||||
/datum/computer/file/embedded_program/docking/process()
|
||||
switch(dock_state)
|
||||
if (STATE_DOCKING) //waiting for our docking port to be ready for docking
|
||||
if (ready_for_docking() || override_enabled)
|
||||
if (!response_sent)
|
||||
send_docking_command(tag_target, "confirm_dock") //tell the other guy we're ready
|
||||
response_sent = 1
|
||||
|
||||
if (control_mode == MODE_CLIENT) //client doesn't need to do anything further
|
||||
dock_state = STATE_DOCKED
|
||||
if (!override_enabled)
|
||||
finish_docking() //client done docking!
|
||||
response_sent = 0
|
||||
if (STATE_UNDOCKING)
|
||||
if (ready_for_undocking() || override_enabled)
|
||||
if (ready_for_docking())
|
||||
if (control_mode == MODE_CLIENT)
|
||||
if (!response_sent)
|
||||
send_docking_command(tag_target, "request_undock") //tell the server we want to undock now.
|
||||
send_docking_command(tag_target, "confirm_dock") //tell the server we're ready
|
||||
response_sent = 1
|
||||
else if (control_mode == MODE_SERVER)
|
||||
send_docking_command(tag_target, "confirm_undock") //tell the client we are OK to undock.
|
||||
|
||||
else if (control_mode == MODE_SERVER && received_confirm)
|
||||
send_docking_command(tag_target, "confirm_dock") //tell the client we are done docking.
|
||||
dock_state = STATE_DOCKED
|
||||
if (!override_enabled)
|
||||
finish_docking() //server done docking!
|
||||
response_sent = 0
|
||||
received_confirm = 0
|
||||
|
||||
if (STATE_UNDOCKING)
|
||||
if (ready_for_undocking())
|
||||
if (control_mode == MODE_CLIENT)
|
||||
if (!response_sent)
|
||||
send_docking_command(tag_target, "confirm_undock") //tell the server we are OK to undock.
|
||||
response_sent = 1
|
||||
|
||||
else if (control_mode == MODE_SERVER && received_confirm)
|
||||
send_docking_command(tag_target, "confirm_undock") //tell the client we are done undocking.
|
||||
if (!override_enabled)
|
||||
finish_undocking()
|
||||
reset() //server is done undocking!
|
||||
|
||||
|
||||
|
||||
|
||||
if (dock_state != STATE_DOCKING && dock_state != STATE_UNDOCKING)
|
||||
response_sent = 0
|
||||
|
||||
@@ -132,11 +212,11 @@
|
||||
return
|
||||
|
||||
dock_state = STATE_UNDOCKING
|
||||
prepare_for_undocking()
|
||||
if (!override_enabled)
|
||||
prepare_for_undocking()
|
||||
|
||||
send_docking_command(tag_target, "request_undock")
|
||||
|
||||
|
||||
//tell the docking port to start getting ready for docking - e.g. pressurize
|
||||
/datum/computer/file/embedded_program/docking/proc/prepare_for_docking()
|
||||
return
|
||||
@@ -153,27 +233,29 @@
|
||||
/datum/computer/file/embedded_program/docking/proc/prepare_for_undocking()
|
||||
return
|
||||
|
||||
//we are docked, open the doors or whatever.
|
||||
/datum/computer/file/embedded_program/docking/proc/finish_undocking()
|
||||
return
|
||||
|
||||
//are we ready for undocking?
|
||||
/datum/computer/file/embedded_program/docking/proc/ready_for_undocking()
|
||||
return 1
|
||||
|
||||
/datum/computer/file/embedded_program/docking/proc/enable_override()
|
||||
override_enabled = 1
|
||||
//if (tag_target)
|
||||
// send_docking_command(tag_target, "enable_override")
|
||||
|
||||
/datum/computer/file/embedded_program/docking/proc/disable_override()
|
||||
override_enabled = 0
|
||||
//if (tag_target)
|
||||
// send_docking_command(tag_target, "disable_override")
|
||||
|
||||
/datum/computer/file/embedded_program/docking/proc/reset()
|
||||
dock_state = STATE_UNDOCKED
|
||||
control_mode = MODE_NONE
|
||||
tag_target = null
|
||||
response_sent = 0
|
||||
received_confirm = 0
|
||||
|
||||
/datum/computer/file/embedded_program/docking/proc/force_undock()
|
||||
//world << "[id_tag]: forcing undock"
|
||||
if (tag_target)
|
||||
send_docking_command(tag_target, "dock_error")
|
||||
reset()
|
||||
|
||||
@@ -127,10 +127,6 @@
|
||||
/datum/computer/file/embedded_program/docking/simple/ready_for_undocking()
|
||||
return (memory["door_status"]["state"] == "closed" && memory["door_status"]["lock"] == "locked")
|
||||
|
||||
/datum/computer/file/embedded_program/docking/simple/reset()
|
||||
close_door()
|
||||
..()
|
||||
|
||||
/*** DEBUG VERBS ***
|
||||
|
||||
/obj/machinery/embedded_controller/radio/simple_docking_controller/verb/view_state()
|
||||
@@ -157,4 +153,5 @@
|
||||
set category = "Debug"
|
||||
set src in view(1)
|
||||
src.program:initiate_undocking()
|
||||
*/
|
||||
|
||||
*/
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
|
||||
|
||||
if(do_after(user, 20))
|
||||
if(!src) return
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
|
||||
@@ -189,7 +189,7 @@
|
||||
user.visible_message("[user] unfastens the bolts securing \the [src] to the floor.", "You unfasten the bolts securing \the [src] to the floor.")
|
||||
anchored = 0
|
||||
return
|
||||
|
||||
|
||||
else if(src.panel_open)
|
||||
for(var/datum/data/vending_product/R in product_records)
|
||||
if(istype(W, R.product_path))
|
||||
@@ -414,6 +414,7 @@
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
usr.unset_machine()
|
||||
usr << browse(null, "window=vending")
|
||||
return
|
||||
return
|
||||
|
||||
@@ -273,7 +273,10 @@
|
||||
/obj/item/robot_parts/head/attackby(obj/item/W as obj, mob/user as mob)
|
||||
..()
|
||||
if(istype(W, /obj/item/device/flash))
|
||||
if(src.flash1 && src.flash2)
|
||||
if(istype(user,/mob/living/silicon/robot))
|
||||
user << "\red How do you propose to do that?"
|
||||
return
|
||||
else if(src.flash1 && src.flash2)
|
||||
user << "\blue You have already inserted the eyes!"
|
||||
return
|
||||
else if(src.flash1)
|
||||
|
||||
@@ -8,133 +8,38 @@ Mineral Sheets
|
||||
- Gold
|
||||
- Silver
|
||||
- Clown
|
||||
Others:
|
||||
- Adamantine
|
||||
- Mythril
|
||||
- Enriched Uranium
|
||||
- Platinum
|
||||
- Metallic Hydrogen
|
||||
- Tritium
|
||||
- Osmium
|
||||
*/
|
||||
|
||||
/*
|
||||
* Sandstone
|
||||
*/
|
||||
/obj/item/stack/sheet/mineral/sandstone
|
||||
name = "sandstone bricks"
|
||||
desc = "This appears to be a combination of both sand and stone."
|
||||
singular_name = "sandstone brick"
|
||||
icon_state = "sheet-sandstone"
|
||||
throw_speed = 4
|
||||
throw_range = 5
|
||||
origin_tech = "materials=1"
|
||||
sheettype = "sandstone"
|
||||
|
||||
var/global/list/datum/stack_recipe/sandstone_recipes = list ( \
|
||||
new/datum/stack_recipe("pile of dirt", /obj/machinery/hydroponics/soil, 3, time = 10, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("sandstone door", /obj/structure/mineral_door/sandstone, 10, one_per_turf = 1, on_floor = 1), \
|
||||
/* new/datum/stack_recipe("sandstone wall", ???), \
|
||||
new/datum/stack_recipe("sandstone floor", ???),\ */
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/mineral/sandstone/New(var/loc, var/amount=null)
|
||||
recipes = sandstone_recipes
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
..()
|
||||
|
||||
/*
|
||||
* Diamond
|
||||
*/
|
||||
/obj/item/stack/sheet/mineral/diamond
|
||||
name = "diamond"
|
||||
icon_state = "sheet-diamond"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_range = 3
|
||||
origin_tech = "materials=6"
|
||||
perunit = 3750
|
||||
sheettype = "diamond"
|
||||
var/global/list/datum/stack_recipe/silver_recipes = list ( \
|
||||
new/datum/stack_recipe("silver door", /obj/structure/mineral_door/silver, 10, one_per_turf = 1, on_floor = 1), \
|
||||
)
|
||||
|
||||
var/global/list/datum/stack_recipe/diamond_recipes = list ( \
|
||||
new/datum/stack_recipe("diamond door", /obj/structure/mineral_door/transparent/diamond, 10, one_per_turf = 1, on_floor = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/mineral/diamond/New(var/loc, var/amount=null)
|
||||
recipes = diamond_recipes
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
..()
|
||||
|
||||
/*
|
||||
* Uranium
|
||||
*/
|
||||
/obj/item/stack/sheet/mineral/uranium
|
||||
name = "uranium"
|
||||
icon_state = "sheet-uranium"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=5"
|
||||
perunit = 2000
|
||||
sheettype = "uranium"
|
||||
|
||||
var/global/list/datum/stack_recipe/uranium_recipes = list ( \
|
||||
new/datum/stack_recipe("uranium door", /obj/structure/mineral_door/uranium, 10, one_per_turf = 1, on_floor = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/mineral/uranium/New(var/loc, var/amount=null)
|
||||
recipes = uranium_recipes
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
..()
|
||||
|
||||
/*
|
||||
* Plasma
|
||||
*/
|
||||
/obj/item/stack/sheet/mineral/plasma
|
||||
name = "solid plasma"
|
||||
icon_state = "sheet-plasma"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "plasmatech=2;materials=2"
|
||||
perunit = 2000
|
||||
sheettype = "plasma"
|
||||
var/global/list/datum/stack_recipe/gold_recipes = list ( \
|
||||
new/datum/stack_recipe("golden door", /obj/structure/mineral_door/gold, 10, one_per_turf = 1, on_floor = 1), \
|
||||
)
|
||||
|
||||
var/global/list/datum/stack_recipe/plasma_recipes = list ( \
|
||||
new/datum/stack_recipe("plasma door", /obj/structure/mineral_door/transparent/plasma, 10, one_per_turf = 1, on_floor = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/mineral/plasma/New(var/loc, var/amount=null)
|
||||
recipes = plasma_recipes
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
..()
|
||||
|
||||
/obj/item/stack/sheet/mineral/plastic
|
||||
name = "Plastic"
|
||||
icon_state = "sheet-plastic"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=3"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/mineral/plastic/cyborg
|
||||
name = "plastic sheets"
|
||||
icon_state = "sheet-plastic"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
perunit = 2000
|
||||
|
||||
var/global/list/datum/stack_recipe/plastic_recipes = list ( \
|
||||
new/datum/stack_recipe("plastic crate", /obj/structure/closet/crate/plastic, 10, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("plastic ashtray", /obj/item/ashtray/plastic, 2, one_per_turf = 1, on_floor = 1), \
|
||||
@@ -144,131 +49,171 @@ var/global/list/datum/stack_recipe/plastic_recipes = list ( \
|
||||
new/datum/stack_recipe("plastic bag", /obj/item/weapon/storage/bag/plasticbag, 3, on_floor = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/mineral/plastic/New(var/loc, var/amount=null)
|
||||
recipes = plastic_recipes
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
..()
|
||||
|
||||
/*
|
||||
* Gold
|
||||
*/
|
||||
/obj/item/stack/sheet/mineral/gold
|
||||
name = "gold"
|
||||
icon_state = "sheet-gold"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=4"
|
||||
perunit = 2000
|
||||
sheettype = "gold"
|
||||
|
||||
var/global/list/datum/stack_recipe/gold_recipes = list ( \
|
||||
new/datum/stack_recipe("golden door", /obj/structure/mineral_door/gold, 10, one_per_turf = 1, on_floor = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/mineral/gold/New(var/loc, var/amount=null)
|
||||
recipes = gold_recipes
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
..()
|
||||
|
||||
/*
|
||||
* Silver
|
||||
*/
|
||||
/obj/item/stack/sheet/mineral/silver
|
||||
name = "silver"
|
||||
icon_state = "sheet-silver"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=3"
|
||||
perunit = 2000
|
||||
sheettype = "silver"
|
||||
|
||||
var/global/list/datum/stack_recipe/silver_recipes = list ( \
|
||||
new/datum/stack_recipe("silver door", /obj/structure/mineral_door/silver, 10, one_per_turf = 1, on_floor = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/mineral/silver/New(var/loc, var/amount=null)
|
||||
recipes = silver_recipes
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
..()
|
||||
|
||||
/*
|
||||
* Clown
|
||||
*/
|
||||
/obj/item/stack/sheet/mineral/clown
|
||||
name = "bananium"
|
||||
icon_state = "sheet-clown"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=4"
|
||||
perunit = 2000
|
||||
sheettype = "clown"
|
||||
|
||||
|
||||
/obj/item/stack/sheet/mineral/clown/New(var/loc, var/amount=null)
|
||||
recipes = clown_recipes
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
..()
|
||||
|
||||
var/global/list/datum/stack_recipe/clown_recipes = list ( \
|
||||
new/datum/stack_recipe("bananium computer frame", /obj/structure/computerframe/HONKputer, 50, time = 25, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("bananium grenade casing", /obj/item/weapon/grenade/bananade/casing, 4, on_floor = 1), \
|
||||
)
|
||||
|
||||
var/global/list/datum/stack_recipe/iron_recipes = list ( \
|
||||
new/datum/stack_recipe("iron door", /obj/structure/mineral_door/iron, 20, one_per_turf = 1, on_floor = 1), \
|
||||
null, \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/mineral
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
|
||||
/obj/item/stack/sheet/mineral/New()
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
|
||||
obj/item/stack/sheet/mineral/iron
|
||||
name = "iron"
|
||||
icon_state = "sheet-silver"
|
||||
origin_tech = "materials=1"
|
||||
sheettype = "iron"
|
||||
color = "#333333"
|
||||
perunit = 3750
|
||||
|
||||
obj/item/stack/sheet/mineral/iron/New()
|
||||
..()
|
||||
recipes = iron_recipes
|
||||
|
||||
/obj/item/stack/sheet/mineral/sandstone
|
||||
name = "sandstone brick"
|
||||
desc = "This appears to be a combination of both sand and stone."
|
||||
singular_name = "sandstone brick"
|
||||
icon_state = "sheet-sandstone"
|
||||
throw_speed = 4
|
||||
throw_range = 5
|
||||
origin_tech = "materials=1"
|
||||
sheettype = "sandstone"
|
||||
|
||||
/obj/item/stack/sheet/mineral/sandstone/New()
|
||||
..()
|
||||
recipes = sandstone_recipes
|
||||
|
||||
/obj/item/stack/sheet/mineral/diamond
|
||||
name = "diamond"
|
||||
icon_state = "sheet-diamond"
|
||||
origin_tech = "materials=6"
|
||||
perunit = 3750
|
||||
sheettype = "diamond"
|
||||
|
||||
|
||||
/****************************** Others ****************************/
|
||||
/obj/item/stack/sheet/mineral/diamond/New()
|
||||
..()
|
||||
recipes = diamond_recipes
|
||||
|
||||
/obj/item/stack/sheet/mineral/uranium
|
||||
name = "uranium"
|
||||
icon_state = "sheet-uranium"
|
||||
origin_tech = "materials=5"
|
||||
perunit = 2000
|
||||
sheettype = "uranium"
|
||||
|
||||
/obj/item/stack/sheet/mineral/uranium/New()
|
||||
..()
|
||||
recipes = uranium_recipes
|
||||
|
||||
/obj/item/stack/sheet/mineral/plasma
|
||||
name = "solid plasma"
|
||||
icon_state = "sheet-plasma"
|
||||
origin_tech = "plasmatech=2;materials=2"
|
||||
perunit = 2000
|
||||
sheettype = "plasma"
|
||||
|
||||
/obj/item/stack/sheet/mineral/plasma/New()
|
||||
..()
|
||||
recipes = plasma_recipes
|
||||
|
||||
/obj/item/stack/sheet/mineral/plastic
|
||||
name = "Plastic"
|
||||
icon_state = "sheet-plastic"
|
||||
origin_tech = "materials=3"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/mineral/plastic/New()
|
||||
..()
|
||||
recipes = plastic_recipes
|
||||
|
||||
/obj/item/stack/sheet/mineral/plastic/cyborg
|
||||
name = "plastic sheets"
|
||||
icon_state = "sheet-plastic"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/mineral/gold
|
||||
name = "gold"
|
||||
icon_state = "sheet-gold"
|
||||
origin_tech = "materials=4"
|
||||
perunit = 2000
|
||||
sheettype = "gold"
|
||||
|
||||
/obj/item/stack/sheet/mineral/gold/New()
|
||||
..()
|
||||
recipes = gold_recipes
|
||||
|
||||
/obj/item/stack/sheet/mineral/silver
|
||||
name = "silver"
|
||||
icon_state = "sheet-silver"
|
||||
origin_tech = "materials=3"
|
||||
perunit = 2000
|
||||
sheettype = "silver"
|
||||
|
||||
/obj/item/stack/sheet/mineral/silver/New()
|
||||
..()
|
||||
recipes = silver_recipes
|
||||
|
||||
/obj/item/stack/sheet/mineral/clown
|
||||
name = "bananium"
|
||||
icon_state = "sheet-clown"
|
||||
origin_tech = "materials=4"
|
||||
perunit = 2000
|
||||
sheettype = "clown"
|
||||
|
||||
/obj/item/stack/sheet/mineral/clown/New(var/loc, var/amount=null)
|
||||
..()
|
||||
recipes = clown_recipes
|
||||
|
||||
/*
|
||||
* Enriched Uranium
|
||||
*/
|
||||
/obj/item/stack/sheet/mineral/enruranium
|
||||
name = "enriched uranium"
|
||||
icon_state = "sheet-enruranium"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=5"
|
||||
perunit = 1000
|
||||
|
||||
/*
|
||||
* Adamantine
|
||||
*/
|
||||
/obj/item/stack/sheet/mineral/adamantine
|
||||
name = "adamantine"
|
||||
//Valuable resource, cargo can sell it.
|
||||
/obj/item/stack/sheet/mineral/platinum
|
||||
name = "platinum"
|
||||
icon_state = "sheet-adamantine"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=4"
|
||||
origin_tech = "materials=2"
|
||||
sheettype = "platinum"
|
||||
perunit = 2000
|
||||
|
||||
/*
|
||||
* Mythril
|
||||
*/
|
||||
/obj/item/stack/sheet/mineral/mythril
|
||||
name = "mythril"
|
||||
//Extremely valuable to Research.
|
||||
/obj/item/stack/sheet/mineral/mhydrogen
|
||||
name = "metallic hydrogen"
|
||||
icon_state = "sheet-mythril"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=4"
|
||||
origin_tech = "materials=6;powerstorage=5;magnets=5"
|
||||
sheettype = "mhydrogen"
|
||||
perunit = 2000
|
||||
|
||||
//Fuel for MRSPACMAN generator.
|
||||
/obj/item/stack/sheet/mineral/tritium
|
||||
name = "tritium"
|
||||
icon_state = "sheet-silver"
|
||||
sheettype = "tritium"
|
||||
origin_tech = "materials=5"
|
||||
color = "#777777"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/mineral/osmium
|
||||
name = "osmium"
|
||||
icon_state = "sheet-silver"
|
||||
sheettype = "osmium"
|
||||
origin_tech = "materials=5"
|
||||
color = "#9999FF"
|
||||
perunit = 2000
|
||||
|
||||
@@ -70,7 +70,6 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \
|
||||
new/datum/stack_recipe("air alarm frame", /obj/item/alarm_frame, 2), \
|
||||
new/datum/stack_recipe("fire alarm frame", /obj/item/firealarm_frame, 2), \
|
||||
null, \
|
||||
new/datum/stack_recipe("iron door", /obj/structure/mineral_door/iron, 20, one_per_turf = 1, on_floor = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/metal
|
||||
|
||||
@@ -99,7 +99,8 @@
|
||||
/obj/machinery/bot,
|
||||
/obj/machinery/door,
|
||||
/obj/machinery/telecomms,
|
||||
/obj/machinery/mecha_part_fabricator
|
||||
/obj/machinery/mecha_part_fabricator,
|
||||
/obj/vehicle
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -120,6 +120,8 @@ var/last_chew = 0
|
||||
|
||||
if(O.take_damage(3,0,1,"teeth marks"))
|
||||
H:UpdateDamageIcon()
|
||||
if(prob(10))
|
||||
O.droplimb()
|
||||
|
||||
last_chew = world.time
|
||||
|
||||
|
||||
@@ -135,7 +135,8 @@ var/list/mechtoys = list(
|
||||
var/points_per_process = 1
|
||||
var/points_per_slip = 2
|
||||
var/points_per_crate = 5
|
||||
var/plasma_per_point = 2 // 2 plasma for 1 point
|
||||
var/points_per_platinum = 5 // 5 points per sheet
|
||||
var/points_per_plasma = 5
|
||||
//control
|
||||
var/ordernum
|
||||
var/list/shoppinglist = list()
|
||||
@@ -217,6 +218,7 @@ var/list/mechtoys = list(
|
||||
if(!shuttle) return
|
||||
|
||||
var/plasma_count = 0
|
||||
var/plat_count = 0
|
||||
|
||||
for(var/atom/movable/MA in shuttle)
|
||||
if(MA.anchored) continue
|
||||
@@ -238,14 +240,23 @@ var/list/mechtoys = list(
|
||||
find_slip = 0
|
||||
continue
|
||||
|
||||
// Sell plasma
|
||||
// Sell phoron
|
||||
if(istype(A, /obj/item/stack/sheet/mineral/plasma))
|
||||
var/obj/item/stack/sheet/mineral/plasma/P = A
|
||||
plasma_count += P.amount
|
||||
|
||||
// Sell platinum
|
||||
if(istype(A, /obj/item/stack/sheet/mineral/platinum))
|
||||
var/obj/item/stack/sheet/mineral/platinum/P = A
|
||||
plat_count += P.amount
|
||||
|
||||
del(MA)
|
||||
|
||||
if(plasma_count)
|
||||
points += Floor(plasma_count / plasma_per_point)
|
||||
points += plasma_count * points_per_plasma
|
||||
|
||||
if(plat_count)
|
||||
points += plat_count * points_per_platinum
|
||||
|
||||
//Buyin
|
||||
proc/buy()
|
||||
|
||||
@@ -2,4 +2,16 @@
|
||||
name = "wall"
|
||||
desc = "The patterns engraved on the wall seem to shift as you try to focus on them. You feel sick"
|
||||
icon_state = "cult"
|
||||
walltype = "cult"
|
||||
walltype = "cult"
|
||||
|
||||
/turf/simulated/wall/rust
|
||||
name = "rusted wall"
|
||||
desc = "A rusted metal wall."
|
||||
icon_state = "arust"
|
||||
walltype = "arust"
|
||||
|
||||
/turf/simulated/wall/r_wall/rust
|
||||
name = "rusted reinforced wall"
|
||||
desc = "A huge chunk of rusted reinforced metal."
|
||||
icon_state = "rrust"
|
||||
walltype = "rrust"
|
||||
@@ -22,6 +22,10 @@
|
||||
var/icon_old = null
|
||||
var/pathweight = 1
|
||||
|
||||
//Mining resource generation stuff.
|
||||
var/has_resources
|
||||
var/list/resources
|
||||
|
||||
/turf/New()
|
||||
..()
|
||||
for(var/atom/movable/AM as mob|obj in src)
|
||||
|
||||
@@ -70,25 +70,35 @@
|
||||
else
|
||||
src.DB_job_unlock("Barber",5)
|
||||
if("2")
|
||||
if(karma <30)
|
||||
if(karma <5)
|
||||
usr << "You do not have enough karma!"
|
||||
else
|
||||
src.DB_job_unlock("Nanotrasen Representative",30)
|
||||
src.DB_job_unlock("Brig Physician",5)
|
||||
if("3")
|
||||
if(karma <30)
|
||||
usr << "You do not have enough karma!"
|
||||
else
|
||||
src.DB_job_unlock("Customs Officer",30)
|
||||
src.DB_job_unlock("Nanotrasen Representative",30)
|
||||
if("4")
|
||||
if(karma <30)
|
||||
usr << "You do not have enough karma!"
|
||||
else
|
||||
src.DB_job_unlock("Blueshield",30)
|
||||
src.DB_job_unlock("Customs Officer",30)
|
||||
if("5")
|
||||
if(karma <30)
|
||||
usr << "You do not have enough karma!"
|
||||
else
|
||||
src.DB_job_unlock("Blueshield",30)
|
||||
if("6")
|
||||
if(karma <30)
|
||||
usr << "You do not have enough karma!"
|
||||
else
|
||||
src.DB_job_unlock("Mechanic",30)
|
||||
if("7")
|
||||
if(karma <45)
|
||||
usr << "You do not have enough karma!"
|
||||
else
|
||||
src.DB_job_unlock("Magistrate",45)
|
||||
|
||||
if(href_list["KarmaBuy2"])
|
||||
var/karma=verify_karma()
|
||||
|
||||
@@ -352,7 +352,7 @@ datum/preferences
|
||||
popup.set_content(dat)
|
||||
popup.open(0)
|
||||
|
||||
proc/SetChoices(mob/user, limit = 14, list/splitJobs = list("Chief Engineer","Research Director"), width = 610, height = 650)
|
||||
proc/SetChoices(mob/user, limit = 14, list/splitJobs = list("Chief Engineer","Research Director","Captain"), width = 1025, height = 800)
|
||||
if(!job_master)
|
||||
return
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/obj/item/clothing/glasses
|
||||
name = "glasses"
|
||||
icon = 'icons/obj/clothing/glasses.dmi'
|
||||
@@ -17,11 +16,19 @@
|
||||
item_state = "glasses"
|
||||
origin_tech = "magnets=2;engineering=2"
|
||||
vision_flags = SEE_TURFS
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/glasses/meson/prescription
|
||||
name = "prescription mesons"
|
||||
desc = "Optical Meson Scanner with prescription lenses."
|
||||
prescription = 1
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/glasses/science
|
||||
name = "Science Goggles"
|
||||
@@ -37,6 +44,10 @@
|
||||
origin_tech = "magnets=2"
|
||||
vision_flags = SEE_TURFS
|
||||
darkness_view = 3
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/glasses/eyepatch
|
||||
name = "eyepatch"
|
||||
@@ -49,6 +60,10 @@
|
||||
desc = "Such a dapper eyepiece!"
|
||||
icon_state = "monocle"
|
||||
item_state = "headset" // lol
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/glasses/material
|
||||
name = "Optical Material Scanner"
|
||||
@@ -57,6 +72,10 @@
|
||||
item_state = "glasses"
|
||||
origin_tech = "magnets=3;engineering=3"
|
||||
vision_flags = SEE_OBJS
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/glasses/regular
|
||||
name = "Prescription Glasses"
|
||||
@@ -89,7 +108,10 @@
|
||||
icon_state = "sun"
|
||||
item_state = "sunglasses"
|
||||
darkness_view = -1
|
||||
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/glasses/virussunglasses
|
||||
desc = "Strangely ancient technology used to help provide rudimentary eye cover. Enhanced shielding blocks many flashes."
|
||||
@@ -97,7 +119,10 @@
|
||||
icon_state = "sun"
|
||||
item_state = "sunglasses"
|
||||
darkness_view = -1
|
||||
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/glasses/welding
|
||||
name = "welding goggles"
|
||||
@@ -106,6 +131,10 @@
|
||||
item_state = "welding-g"
|
||||
icon_action_button = "action_welding_g"
|
||||
var/up = 0
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/glasses/welding/proc/getMask()
|
||||
return global_hud.darkMask
|
||||
@@ -141,6 +170,10 @@
|
||||
icon_state = "rwelding-g"
|
||||
item_state = "rwelding-g"
|
||||
icon_action_button = "action_welding_g"
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/glasses/welding/superior/getMask()
|
||||
return null
|
||||
@@ -151,21 +184,37 @@
|
||||
icon_state = "blindfold"
|
||||
item_state = "blindfold"
|
||||
vision_flags = BLIND
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/prescription
|
||||
name = "prescription sunglasses"
|
||||
prescription = 1
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/big
|
||||
desc = "Strangely ancient technology used to help provide rudimentary eye cover. Larger than average enhanced shielding blocks many flashes."
|
||||
icon_state = "bigsunglasses"
|
||||
item_state = "bigsunglasses"
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/sechud
|
||||
name = "HUDSunglasses"
|
||||
desc = "Sunglasses with a HUD."
|
||||
icon_state = "sunhud"
|
||||
var/obj/item/clothing/glasses/hud/security/hud = null
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
New()
|
||||
..()
|
||||
@@ -198,6 +247,10 @@
|
||||
desc = "Used for seeing walls, floors, and stuff through anything."
|
||||
icon_state = "meson"
|
||||
origin_tech = "magnets=3;syndicate=4"
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/glasses/thermal/monocle
|
||||
name = "Thermoncle"
|
||||
@@ -215,4 +268,8 @@
|
||||
name = "Optical Thermal Implants"
|
||||
desc = "A set of implantable lenses designed to augment your vision"
|
||||
icon_state = "thermalimplants"
|
||||
item_state = "syringe_kit"
|
||||
item_state = "syringe_kit"
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
@@ -66,6 +66,10 @@
|
||||
icon_state = "welding"
|
||||
item_state = "welding"
|
||||
loose = 0
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/head/collectable/slime
|
||||
name = "collectable slime hat"
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
desc = "It's a helmet specifically designed to protect against close range attacks."
|
||||
icon_state = "riot"
|
||||
item_state = "helmet"
|
||||
flags = FPRINT|TABLEPASS|HEADCOVERSEYES
|
||||
flags = FPRINT|TABLEPASS|HEADCOVERSEYES|HEADCOVERSMOUTH
|
||||
armor = list(melee = 82, bullet = 15, laser = 5,energy = 5, bomb = 5, bio = 2, rad = 0)
|
||||
flags_inv = HIDEEARS
|
||||
siemens_coefficient = 0.7
|
||||
|
||||
@@ -25,6 +25,10 @@
|
||||
icon_action_button = "action_welding"
|
||||
siemens_coefficient = 0.9
|
||||
loose = 4
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/eyes.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/head/welding/attack_self()
|
||||
toggle()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
icon_state = "capspace"
|
||||
item_state = "capspacehelmet"
|
||||
desc = "A special helmet designed for work in a hazardous, low-pressure environment. Only for the most fashionable of military figureheads."
|
||||
flags = FPRINT | TABLEPASS | HEADCOVERSEYES | BLOCKHAIR | STOPSPRESSUREDMAGE
|
||||
flags = FPRINT | TABLEPASS | HEADCOVERSEYES | BLOCKHAIR | STOPSPRESSUREDMAGE|HEADCOVERSMOUTH
|
||||
flags_inv = HIDEFACE
|
||||
permeability_coefficient = 0.01
|
||||
armor = list(melee = 65, bullet = 50, laser = 50,energy = 25, bomb = 50, bio = 100, rad = 50)
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
icon_state = "paramedic-vest"
|
||||
item_state = "paramedic-vest"
|
||||
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 10, rad = 10)
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
//Botonist
|
||||
/obj/item/clothing/suit/apron
|
||||
@@ -18,6 +22,10 @@
|
||||
blood_overlay_type = "armor"
|
||||
body_parts_covered = UPPER_TORSO|LOWER_TORSO
|
||||
allowed = list (/obj/item/weapon/reagent_containers/spray/plantbgone,/obj/item/device/analyzer/plant_analyzer,/obj/item/seeds,/obj/item/nutrient,/obj/item/weapon/minihoe)
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
//Captain
|
||||
/obj/item/clothing/suit/captunic
|
||||
@@ -28,6 +36,11 @@
|
||||
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS
|
||||
flags_inv = HIDEJUMPSUIT
|
||||
flags = FPRINT | TABLEPASS | ONESIZEFITSALL
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
|
||||
/obj/item/clothing/suit/captunic/capjacket
|
||||
name = "captain's uniform jacket"
|
||||
@@ -36,6 +49,10 @@
|
||||
item_state = "bio_suit"
|
||||
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS
|
||||
flags_inv = HIDEJUMPSUIT
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
//Chaplain
|
||||
/obj/item/clothing/suit/chaplain_hoodie
|
||||
@@ -45,6 +62,10 @@
|
||||
item_state = "chaplain_hoodie"
|
||||
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS
|
||||
allowed = list(/obj/item/weapon/storage/bible, /obj/item/weapon/nullrod, /obj/item/weapon/reagent_containers/food/drinks/bottle/holywater, /obj/item/weapon/storage/fancy/candle_box, /obj/item/candle, /obj/item/weapon/tank/emergency_oxygen)
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
//Chaplain
|
||||
/obj/item/clothing/suit/nun
|
||||
@@ -55,6 +76,10 @@
|
||||
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS|HANDS
|
||||
flags_inv = HIDESHOES|HIDEJUMPSUIT
|
||||
allowed = list(/obj/item/weapon/storage/bible, /obj/item/weapon/nullrod, /obj/item/weapon/reagent_containers/food/drinks/bottle/holywater, /obj/item/weapon/storage/fancy/candle_box, /obj/item/candle, /obj/item/weapon/tank/emergency_oxygen)
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
//Chef
|
||||
/obj/item/clothing/suit/chef
|
||||
@@ -66,6 +91,10 @@
|
||||
permeability_coefficient = 0.50
|
||||
body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS
|
||||
allowed = list (/obj/item/weapon/kitchenknife,/obj/item/weapon/butch)
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
//Chef
|
||||
/obj/item/clothing/suit/chef/classic
|
||||
@@ -75,6 +104,10 @@
|
||||
item_state = "apronchef"
|
||||
blood_overlay_type = "armor"
|
||||
body_parts_covered = UPPER_TORSO|LOWER_TORSO
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
//Detective
|
||||
/obj/item/clothing/suit/storage/det_suit
|
||||
@@ -87,6 +120,10 @@
|
||||
allowed = list(/obj/item/weapon/tank/emergency_oxygen, /obj/item/device/flashlight,/obj/item/weapon/gun/energy,/obj/item/weapon/gun/projectile,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/storage/fancy/cigarettes,/obj/item/weapon/lighter,/obj/item/device/detective_scanner,/obj/item/device/taperecorder)
|
||||
armor = list(melee = 50, bullet = 10, laser = 25, energy = 10, bomb = 0, bio = 0, rad = 0)
|
||||
flags = FPRINT | TABLEPASS | ONESIZEFITSALL
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
//Forensics
|
||||
/obj/item/clothing/suit/storage/forensics
|
||||
@@ -116,6 +153,10 @@
|
||||
blood_overlay_type = "armor"
|
||||
allowed = list (/obj/item/device/analyzer, /obj/item/device/flashlight, /obj/item/device/multitool, /obj/item/device/pipe_painter, /obj/item/device/radio, /obj/item/device/t_scanner, \
|
||||
/obj/item/weapon/crowbar, /obj/item/weapon/screwdriver, /obj/item/weapon/weldingtool, /obj/item/weapon/wirecutters, /obj/item/weapon/wrench, /obj/item/weapon/tank/emergency_oxygen)
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
//Lawyer
|
||||
/obj/item/clothing/suit/storage/lawyer/bluejacket
|
||||
@@ -196,4 +237,4 @@
|
||||
desc = "They suspend the illusion of the mime's play."
|
||||
icon = 'icons/obj/clothing/belts.dmi'
|
||||
icon_state = "suspenders"
|
||||
blood_overlay_type = "armor" //it's the less thing that I can put here
|
||||
blood_overlay_type = "armor" //it's the less thing that I can put here
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
allowed = list(/obj/item/device/analyzer,/obj/item/stack/medical,/obj/item/weapon/dnainjector,/obj/item/weapon/reagent_containers/dropper,/obj/item/weapon/reagent_containers/syringe,/obj/item/weapon/reagent_containers/hypospray,/obj/item/device/healthanalyzer,/obj/item/device/flashlight/pen)
|
||||
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 50, rad = 0)
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
verb/toggle()
|
||||
set name = "Toggle Labcoat Buttons"
|
||||
@@ -71,6 +74,9 @@
|
||||
icon_state = "labcoat_cmo_open"
|
||||
item_state = "labcoat_cmo"
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/suit/storage/labcoat/mad
|
||||
name = "The Mad's labcoat"
|
||||
@@ -78,6 +84,9 @@
|
||||
icon_state = "labgreen_open"
|
||||
item_state = "labgreen"
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/suit/storage/labcoat/genetics
|
||||
name = "Geneticist Labcoat"
|
||||
@@ -85,7 +94,7 @@
|
||||
icon_state = "labcoat_gen_open"
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/shoes.dmi'
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/suit/storage/labcoat/chemist
|
||||
@@ -94,7 +103,7 @@
|
||||
icon_state = "labcoat_chem_open"
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/shoes.dmi'
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/suit/storage/labcoat/virologist
|
||||
@@ -104,7 +113,7 @@
|
||||
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 60, rad = 0)
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/shoes.dmi'
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/suit/storage/labcoat/science
|
||||
@@ -113,5 +122,5 @@
|
||||
icon_state = "labcoat_tox_open"
|
||||
species_fit = list("Vox")
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/species/vox/shoes.dmi'
|
||||
"Vox" = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
//Alloys that contain subsets of each other's ingredients must be ordered in the desired sequence
|
||||
//eg. steel comes after plasteel because plasteel's ingredients contain the ingredients for steel and
|
||||
//it would be impossible to produce.
|
||||
|
||||
/datum/alloy
|
||||
var/list/requires
|
||||
var/product_mod = 1
|
||||
var/product
|
||||
var/metaltag
|
||||
|
||||
/datum/alloy/plasteel
|
||||
metaltag = "plasteel"
|
||||
requires = list(
|
||||
"platinum" = 1,
|
||||
"coal" = 2,
|
||||
"hematite" = 2
|
||||
)
|
||||
product_mod = 0.3
|
||||
product = /obj/item/stack/sheet/plasteel
|
||||
|
||||
/datum/alloy/steel
|
||||
metaltag = "steel"
|
||||
requires = list(
|
||||
"coal" = 1,
|
||||
"hematite" = 1
|
||||
)
|
||||
product = /obj/item/stack/sheet/metal
|
||||
@@ -0,0 +1,86 @@
|
||||
/*****************************Coin********************************/
|
||||
|
||||
/obj/item/weapon/coin
|
||||
icon = 'icons/obj/items.dmi'
|
||||
name = "Coin"
|
||||
icon_state = "coin"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
force = 0.0
|
||||
throwforce = 0.0
|
||||
w_class = 1.0
|
||||
var/string_attached
|
||||
var/material="iron" // Ore ID, used with coinbags.
|
||||
var/credits = 0 // How many credits is this coin worth?
|
||||
|
||||
/obj/item/weapon/coin/New()
|
||||
pixel_x = rand(0,16)-8
|
||||
pixel_y = rand(0,8)-8
|
||||
|
||||
/obj/item/weapon/coin/gold
|
||||
name = "Gold coin"
|
||||
icon_state = "coin_gold"
|
||||
credits = 10
|
||||
|
||||
/obj/item/weapon/coin/silver
|
||||
name = "Silver coin"
|
||||
icon_state = "coin_silver"
|
||||
credits = 5
|
||||
|
||||
/obj/item/weapon/coin/diamond
|
||||
name = "Diamond coin"
|
||||
icon_state = "coin_diamond"
|
||||
credits = 25
|
||||
|
||||
/obj/item/weapon/coin/iron
|
||||
name = "Iron coin"
|
||||
icon_state = "coin_iron"
|
||||
credits = 1
|
||||
|
||||
/obj/item/weapon/coin/plasma
|
||||
name = "Solid plasma coin"
|
||||
icon_state = "coin_plasma"
|
||||
credits = 5
|
||||
|
||||
/obj/item/weapon/coin/uranium
|
||||
name = "Uranium coin"
|
||||
icon_state = "coin_uranium"
|
||||
credits = 25
|
||||
|
||||
/obj/item/weapon/coin/clown
|
||||
name = "Bananaium coin"
|
||||
icon_state = "coin_clown"
|
||||
credits = 1000
|
||||
|
||||
|
||||
/obj/item/weapon/coin/platinum
|
||||
name = "platinum coin"
|
||||
icon_state = "coin_adamantine"
|
||||
|
||||
/obj/item/weapon/coin/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/stack/cable_coil) )
|
||||
var/obj/item/stack/cable_coil/CC = W
|
||||
if(string_attached)
|
||||
user << "\blue There already is a string attached to this coin."
|
||||
return
|
||||
|
||||
if(CC.amount <= 0)
|
||||
user << "\blue This cable coil appears to be empty."
|
||||
del(CC)
|
||||
return
|
||||
|
||||
overlays += image('icons/obj/items.dmi',"coin_string_overlay")
|
||||
string_attached = 1
|
||||
user << "\blue You attach a string to the coin."
|
||||
CC.use(1)
|
||||
else if(istype(W,/obj/item/weapon/wirecutters) )
|
||||
if(!string_attached)
|
||||
..()
|
||||
return
|
||||
|
||||
var/obj/item/stack/cable_coil/CC = new/obj/item/stack/cable_coil(user.loc)
|
||||
CC.amount = 1
|
||||
// CC.updateicon()
|
||||
overlays = list()
|
||||
string_attached = null
|
||||
user << "\blue You detach the string from the coin."
|
||||
else ..()
|
||||
@@ -0,0 +1,248 @@
|
||||
//If anyone can think of a less shitty way to work out x,y points on a linear string of integers please tell me.
|
||||
#define MAP_CELL ((y-1)*real_size)+x
|
||||
#define MAP_CENTRE (((y-1)+size/2)*real_size)+(x+size/2)
|
||||
#define MAP_TOP_LEFT ((y-1)*real_size)+x
|
||||
#define MAP_TOP_RIGHT ((y-1)*real_size)+(x+size)
|
||||
#define MAP_BOTTOM_LEFT (((y+size)-1)*real_size)+x
|
||||
#define MAP_BOTTOM_RIGHT ((((y+size)-1)*real_size)+(x+size))
|
||||
#define MAP_MID_TOP MAP_TOP_LEFT + (size/2)
|
||||
#define MAP_MID_BOTTOM MAP_BOTTOM_LEFT + (size/2)
|
||||
#define MAP_MID_LEFT (((y-1)+size/2)*real_size)+x
|
||||
#define MAP_MID_RIGHT (((y-1)+size/2)*real_size)+(x+size)
|
||||
|
||||
#define MIN_SURFACE_COUNT 1000
|
||||
#define MAX_SURFACE_COUNT 5000
|
||||
#define MIN_RARE_COUNT 1000
|
||||
#define MAX_RARE_COUNT 5000
|
||||
#define MIN_DEEP_COUNT 100
|
||||
#define MAX_DEEP_COUNT 300
|
||||
#define ITERATE_BEFORE_FAIL 200
|
||||
|
||||
#define RESOURCE_HIGH_MAX 8
|
||||
#define RESOURCE_HIGH_MIN 5
|
||||
#define RESOURCE_MID_MAX 4
|
||||
#define RESOURCE_MID_MIN 2
|
||||
#define RESOURCE_LOW_MAX 1
|
||||
#define RESOURCE_LOW_MIN 0
|
||||
|
||||
/*
|
||||
Surface minerals:
|
||||
silicates
|
||||
iron
|
||||
gold
|
||||
silver
|
||||
|
||||
Rare minerals:
|
||||
uranium
|
||||
diamond
|
||||
|
||||
Deep minerals:
|
||||
phoron
|
||||
xerxium (adamantine)
|
||||
fulgurium (mythril)
|
||||
*/
|
||||
|
||||
/datum/ore_distribution
|
||||
|
||||
var/real_size = 65 //Overall map size ((must be power of 2)+1)
|
||||
var/chunk_size = 4 //Size each cell represents on map (like hell we're generating up to 100 256^2 grids at roundstart)
|
||||
var/list/map[4225] //The actual map. real_size squared.
|
||||
var/range = 255 //Max random range of cells in map.
|
||||
|
||||
var/random_variance_chance = 25
|
||||
var/random_element = 0.5
|
||||
|
||||
//Called by the drilling rigs each process().
|
||||
/datum/ore_distribution/proc/get_ore(var/x,var/y)
|
||||
return "Nope."
|
||||
|
||||
/datum/ore_distribution/proc/map_is_sane()
|
||||
if(!map) return 0
|
||||
|
||||
var/rare_count = 0
|
||||
var/surface_count = 0
|
||||
var/deep_count = 0
|
||||
|
||||
for(var/cell in map)
|
||||
if(cell>(range*0.60))
|
||||
deep_count++
|
||||
else if(cell>(range*0.40))
|
||||
rare_count++
|
||||
else
|
||||
surface_count++
|
||||
|
||||
if(surface_count < MIN_SURFACE_COUNT || surface_count > MAX_SURFACE_COUNT) return 0
|
||||
if(rare_count < MIN_RARE_COUNT || rare_count > MAX_RARE_COUNT) return 0
|
||||
if(deep_count < MIN_DEEP_COUNT || deep_count > MAX_DEEP_COUNT) return 0
|
||||
return 1
|
||||
|
||||
//Halfassed diamond-square algorithm with some fuckery since it's a single dimension array.
|
||||
/datum/ore_distribution/proc/populate_distribution_map()
|
||||
|
||||
//Seed beginning values.
|
||||
|
||||
var/x = 1
|
||||
var/y = 1
|
||||
var/size = real_size-1
|
||||
|
||||
map[MAP_TOP_LEFT] = (range/3)+rand(range/5)
|
||||
map[MAP_TOP_RIGHT] = (range/3)+rand(range/5)
|
||||
map[MAP_BOTTOM_LEFT] = (range/3)+rand(range/5)
|
||||
map[MAP_BOTTOM_RIGHT] = (range/3)+rand(range/5)
|
||||
|
||||
//Fill in and smooth it out.
|
||||
var/attempts = 0
|
||||
do
|
||||
attempts++
|
||||
generate_distribution_map(1,1,size)
|
||||
while(attempts < ITERATE_BEFORE_FAIL && !map_is_sane())
|
||||
|
||||
if(attempts >= ITERATE_BEFORE_FAIL)
|
||||
world << "<b><font color='red'>Could not generate a sane distribution map. Aborting.</font></b>"
|
||||
map = null
|
||||
return
|
||||
else
|
||||
apply_to_asteroid()
|
||||
|
||||
/datum/ore_distribution/proc/clear_distribution_map()
|
||||
for(var/x = 1, x <= real_size, x++)
|
||||
for(var/y = 1, y <= real_size, y++)
|
||||
map[MAP_CELL] = 0
|
||||
|
||||
/datum/ore_distribution/proc/generate_distribution_map(var/x,var/y,var/input_size)
|
||||
|
||||
var/size = input_size
|
||||
|
||||
map[MAP_MID_TOP] = (map[MAP_TOP_LEFT] + map[MAP_TOP_RIGHT])/2
|
||||
map[MAP_MID_RIGHT] = (map[MAP_BOTTOM_RIGHT] + map[MAP_TOP_RIGHT])/2
|
||||
map[MAP_MID_BOTTOM] = (map[MAP_BOTTOM_LEFT] + map[MAP_BOTTOM_RIGHT])/2
|
||||
map[MAP_MID_LEFT] = (map[MAP_TOP_LEFT] + map[MAP_BOTTOM_RIGHT])/2
|
||||
map[MAP_CENTRE] = (map[MAP_MID_LEFT]+map[MAP_MID_RIGHT]+map[MAP_MID_BOTTOM]+map[MAP_MID_TOP])/4
|
||||
|
||||
if(prob(random_variance_chance))
|
||||
map[MAP_CENTRE] *= (rand(1) ? (1.0-random_element) : (1.0+random_element))
|
||||
map[MAP_CENTRE] = max(0,min(range,map[MAP_CENTRE]))
|
||||
|
||||
if(size>3)
|
||||
generate_distribution_map(x,y,input_size/2)
|
||||
generate_distribution_map(x+(input_size/2),y,input_size/2)
|
||||
generate_distribution_map(x,y+(input_size/2),input_size/2)
|
||||
generate_distribution_map(x+(input_size/2),y+(input_size/2),input_size/2)
|
||||
|
||||
/datum/ore_distribution/proc/apply_to_asteroid()
|
||||
|
||||
var/origin_x = 13
|
||||
var/origin_y = 32
|
||||
var/limit_x = 217
|
||||
var/limit_y = 223
|
||||
var/asteroid_z = 5
|
||||
|
||||
var/tx = origin_x
|
||||
var/ty = origin_y
|
||||
|
||||
for(var/y = 1, y <= real_size, y++)
|
||||
|
||||
for(var/x = 1, x <= real_size, x++)
|
||||
|
||||
var/turf/target_turf
|
||||
|
||||
for(var/i=0,i<chunk_size,i++)
|
||||
|
||||
for(var/j=0,j<chunk_size,j++)
|
||||
|
||||
if(tx+j > limit_x || ty+i > limit_y)
|
||||
continue
|
||||
|
||||
target_turf = locate(tx+j, ty+i, asteroid_z)
|
||||
|
||||
if(target_turf.has_resources)
|
||||
|
||||
var/printcolor
|
||||
if(map[MAP_CELL] > (range*0.60))
|
||||
printcolor = "#FF0000"
|
||||
else if(map[MAP_CELL] > (range*0.40))
|
||||
printcolor = "#00FF00"
|
||||
else
|
||||
printcolor = "#0000FF"
|
||||
target_turf.color = "#[printcolor]"
|
||||
target_turf.resources = list()
|
||||
|
||||
target_turf.resources["silicates"] = rand(RESOURCE_HIGH_MIN,RESOURCE_HIGH_MAX)
|
||||
target_turf.resources["carbonaceous rock"] = rand(RESOURCE_HIGH_MIN,RESOURCE_HIGH_MAX)
|
||||
|
||||
if(map[MAP_CELL] > (range*0.60))
|
||||
target_turf.resources["iron"] = 0
|
||||
target_turf.resources["gold"] = 0
|
||||
target_turf.resources["silver"] = 0
|
||||
target_turf.resources["uranium"] = rand(RESOURCE_HIGH_MIN,RESOURCE_HIGH_MAX)
|
||||
target_turf.resources["diamond"] = rand(RESOURCE_HIGH_MIN,RESOURCE_HIGH_MAX)
|
||||
target_turf.resources["phoron"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["osmium"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["hydrogen"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
else if(map[MAP_CELL] > (range*0.40))
|
||||
target_turf.resources["iron"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["gold"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["silver"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["uranium"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["diamond"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
|
||||
target_turf.resources["phoron"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["osmium"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["hydrogen"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
else
|
||||
target_turf.resources["iron"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["gold"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["silver"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["uranium"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["diamond"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
|
||||
target_turf.resources["phoron"] = 0
|
||||
target_turf.resources["osmium"] = 0
|
||||
target_turf.resources["hydrogen"] = 0
|
||||
|
||||
tx += chunk_size
|
||||
tx = origin_x
|
||||
ty += chunk_size
|
||||
|
||||
/datum/ore_distribution/proc/print_map()
|
||||
world << "---"
|
||||
var/string = ""
|
||||
for(var/y = 1, y <= real_size, y++)
|
||||
for(var/x = 1, x <= real_size, x++)
|
||||
|
||||
var/printcolor
|
||||
if(map[MAP_CELL] > (range*0.60))
|
||||
printcolor = "#FF0000"
|
||||
else if(map[MAP_CELL] > (range*0.40))
|
||||
printcolor = "#00FF00"
|
||||
else
|
||||
printcolor = "#0000FF"
|
||||
string += "<font color='[printcolor]'>#</font>"
|
||||
|
||||
world << string
|
||||
string = ""
|
||||
world << "---"
|
||||
|
||||
#undef MAP_CELL
|
||||
#undef MAP_CENTRE
|
||||
#undef MAP_TOP_LEFT
|
||||
#undef MAP_TOP_RIGHT
|
||||
#undef MAP_BOTTOM_LEFT
|
||||
#undef MAP_BOTTOM_RIGHT
|
||||
#undef MAP_MID_TOP
|
||||
#undef MAP_MID_BOTTOM
|
||||
#undef MAP_MID_LEFT
|
||||
#undef MAP_MID_RIGHT
|
||||
|
||||
#undef MIN_SURFACE_COUNT
|
||||
#undef MAX_SURFACE_COUNT
|
||||
#undef MIN_RARE_COUNT
|
||||
#undef MAX_RARE_COUNT
|
||||
#undef MIN_DEEP_COUNT
|
||||
#undef MAX_DEEP_COUNT
|
||||
#undef ITERATE_BEFORE_FAIL
|
||||
|
||||
#undef RESOURCE_HIGH_MAX
|
||||
#undef RESOURCE_HIGH_MIN
|
||||
#undef RESOURCE_MID_MAX
|
||||
#undef RESOURCE_MID_MIN
|
||||
#undef RESOURCE_LOW_MAX
|
||||
#undef RESOURCE_LOW_MIN
|
||||
@@ -0,0 +1,386 @@
|
||||
/obj/machinery/mining
|
||||
icon = 'icons/obj/mining_drill.dmi'
|
||||
anchored = 0
|
||||
use_power = 0 //The drill takes power directly from a cell.
|
||||
density = 1
|
||||
layer = MOB_LAYER+0.1 //So it draws over mobs in the tile north of it.
|
||||
|
||||
/obj/machinery/mining/drill
|
||||
name = "mining drill head"
|
||||
desc = "An enormous drill."
|
||||
icon_state = "mining_drill"
|
||||
var/braces_needed = 2
|
||||
var/list/supports = list()
|
||||
var/supported = 0
|
||||
var/active = 0
|
||||
var/list/resource_field = list()
|
||||
var/open = 0
|
||||
|
||||
var/ore_types = list(
|
||||
"iron" = /obj/item/weapon/ore/iron,
|
||||
"uranium" = /obj/item/weapon/ore/uranium,
|
||||
"gold" = /obj/item/weapon/ore/gold,
|
||||
"silver" = /obj/item/weapon/ore/silver,
|
||||
"diamond" = /obj/item/weapon/ore/diamond,
|
||||
"phoron" = /obj/item/weapon/ore/plasma,
|
||||
"osmium" = /obj/item/weapon/ore/osmium,
|
||||
"hydrogen" = /obj/item/weapon/ore/hydrogen,
|
||||
"silicates" = /obj/item/weapon/ore/glass,
|
||||
"carbonaceous rock" = /obj/item/weapon/ore/coal
|
||||
)
|
||||
|
||||
//Upgrades
|
||||
var/obj/item/weapon/stock_parts/matter_bin/storage
|
||||
var/obj/item/weapon/stock_parts/micro_laser/cutter
|
||||
var/obj/item/weapon/stock_parts/capacitor/cellmount
|
||||
var/obj/item/weapon/cell/cell
|
||||
|
||||
//Flags
|
||||
var/need_update_field = 0
|
||||
var/need_player_check = 0
|
||||
|
||||
/obj/machinery/mining/drill/New()
|
||||
|
||||
..()
|
||||
|
||||
storage = new(src)
|
||||
cutter = new(src)
|
||||
cellmount = new(src)
|
||||
|
||||
cell = new(src)
|
||||
cell.maxcharge = 10000
|
||||
cell.charge = cell.maxcharge
|
||||
|
||||
/obj/machinery/mining/drill/process()
|
||||
|
||||
if(need_player_check)
|
||||
return
|
||||
|
||||
check_supports()
|
||||
|
||||
if(!active) return
|
||||
|
||||
if(!anchored || !use_cell_power())
|
||||
system_error("system configuration or charge error")
|
||||
return
|
||||
|
||||
if(need_update_field)
|
||||
get_resource_field()
|
||||
|
||||
if(world.time % 10 == 0)
|
||||
update_icon()
|
||||
|
||||
if(!active)
|
||||
return
|
||||
|
||||
//Drill through the flooring, if any.
|
||||
if(istype(get_turf(src),/turf/simulated/floor/plating/airless/asteroid))
|
||||
var/turf/simulated/floor/plating/airless/asteroid/T = get_turf(src)
|
||||
if(!T.dug)
|
||||
T.gets_dug()
|
||||
else if(istype(get_turf(src),/turf/simulated/floor))
|
||||
var/turf/simulated/floor/T = get_turf(src)
|
||||
T.ex_act(2.0)
|
||||
|
||||
//Dig out the tasty ores.
|
||||
if(resource_field.len)
|
||||
var/turf/harvesting = pick(resource_field)
|
||||
|
||||
while(resource_field.len && !harvesting.resources)
|
||||
harvesting.has_resources = 0
|
||||
harvesting.resources = null
|
||||
resource_field -= harvesting
|
||||
harvesting = pick(resource_field)
|
||||
|
||||
if(!harvesting) return
|
||||
|
||||
var/total_harvest = get_harvest_capacity() //Ore harvest-per-tick.
|
||||
var/found_resource = 0 //If this doesn't get set, the area is depleted and the drill errors out.
|
||||
|
||||
for(var/metal in ore_types)
|
||||
|
||||
if(contents.len >= get_storage_capacity())
|
||||
active = 0
|
||||
need_player_check = 1
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(contents.len + total_harvest >= get_storage_capacity())
|
||||
total_harvest = get_storage_capacity() - contents.len
|
||||
|
||||
if(total_harvest <= 0) break
|
||||
if(harvesting.resources[metal])
|
||||
|
||||
found_resource = 1
|
||||
|
||||
var/create_ore = 0
|
||||
if(harvesting.resources[metal] >= total_harvest)
|
||||
harvesting.resources[metal] -= total_harvest
|
||||
create_ore = total_harvest
|
||||
total_harvest = 0
|
||||
else
|
||||
total_harvest -= harvesting.resources[metal]
|
||||
create_ore = harvesting.resources[metal]
|
||||
harvesting.resources[metal] = 0
|
||||
|
||||
for(var/i=1,i<=create_ore,i++)
|
||||
var/oretype = ore_types[metal]
|
||||
new oretype(src)
|
||||
|
||||
if(!found_resource)
|
||||
harvesting.has_resources = 0
|
||||
harvesting.resources = null
|
||||
resource_field -= harvesting
|
||||
else
|
||||
active = 0
|
||||
need_player_check = 1
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/mining/drill/attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/mining/drill/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/weapon/screwdriver))
|
||||
if(active) return
|
||||
open = !open
|
||||
user << "\blue You [open ? "open" : "close"] the maintenance panel." //TODO: Sprite.
|
||||
return
|
||||
else
|
||||
if(!open || active) return ..()
|
||||
if(istype(W,/obj/item/weapon/crowbar))
|
||||
if(cell)
|
||||
user << "You pry out \the [cell]."
|
||||
cell.loc = get_turf(src)
|
||||
cell = null
|
||||
else if(storage)
|
||||
user << "You slip the bolt and pry out \the [storage]."
|
||||
storage.loc = get_turf(src)
|
||||
storage = null
|
||||
else if(cutter)
|
||||
user << "You carefully detatch and pry out \the [cutter]."
|
||||
cutter.loc = get_turf(src)
|
||||
cutter = null
|
||||
else if(cellmount)
|
||||
user << "You yank out a few wires and pry out \the [cellmount]."
|
||||
cellmount.loc = get_turf(src)
|
||||
cellmount = null
|
||||
else
|
||||
user << "There's nothing inside the drilling rig to remove."
|
||||
return
|
||||
else if(istype(W,/obj/item/weapon/stock_parts/matter_bin))
|
||||
if(storage)
|
||||
user << "The drill already has a matter bin installed."
|
||||
else
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
storage = W
|
||||
user << "You install \the [W]."
|
||||
return
|
||||
else if(istype(W,/obj/item/weapon/stock_parts/micro_laser))
|
||||
if(cutter)
|
||||
user << "The drill already has a cutting head installed."
|
||||
else
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
cutter = W
|
||||
user << "You install \the [W]."
|
||||
return
|
||||
else if(istype(W,/obj/item/weapon/stock_parts/capacitor))
|
||||
if(cellmount)
|
||||
user << "The drill already has a cell capacitor installed."
|
||||
else
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
cellmount = W
|
||||
user << "You install \the [W]."
|
||||
return
|
||||
else if(istype(W,/obj/item/weapon/cell))
|
||||
if(cell)
|
||||
user << "The drill already has a cell installed."
|
||||
else
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
cell = W
|
||||
user << "You install \the [W]."
|
||||
return
|
||||
..()
|
||||
/obj/machinery/mining/drill/attack_hand(mob/user as mob)
|
||||
check_supports()
|
||||
|
||||
if(need_player_check)
|
||||
user << "You hit the manual override and reset the drill's error checking."
|
||||
need_player_check = 0
|
||||
if(anchored) get_resource_field()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
else if(supported)
|
||||
if(use_cell_power())
|
||||
active = !active
|
||||
if(active)
|
||||
user << "\blue You engage \the [src] and it lurches downwards, grinding noisily."
|
||||
need_update_field = 1
|
||||
else
|
||||
user << "\blue You disengage \the [src] and it shudders to a grinding halt."
|
||||
else
|
||||
user << "\blue The drill is unpowered."
|
||||
else
|
||||
user << "\blue Turning on a piece of industrial machinery without sufficient bracing is a bad idea."
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/mining/drill/update_icon()
|
||||
if(need_player_check)
|
||||
icon_state = "mining_drill_error"
|
||||
else if(active)
|
||||
icon_state = "mining_drill_active"
|
||||
else if(supported)
|
||||
icon_state = "mining_drill_braced"
|
||||
else
|
||||
icon_state = "mining_drill"
|
||||
return
|
||||
|
||||
/obj/machinery/mining/drill/proc/check_supports()
|
||||
|
||||
supported = 0
|
||||
|
||||
if((!supports || !supports.len) && initial(anchored) == 0)
|
||||
icon_state = "mining_drill"
|
||||
anchored = 0
|
||||
active = 0
|
||||
else
|
||||
anchored = 1
|
||||
|
||||
if(supports && supports.len >= braces_needed)
|
||||
supported = 1
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/mining/drill/proc/system_error(var/error)
|
||||
|
||||
if(error) src.visible_message("\red \The [src] flashes a '[error]' warning.")
|
||||
need_player_check = 1
|
||||
active = 0
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/mining/drill/proc/get_harvest_capacity()
|
||||
return 3 * (cutter ? cutter.rating : 0)
|
||||
|
||||
/obj/machinery/mining/drill/proc/get_storage_capacity()
|
||||
return 100 * (storage ? storage.rating : 0)
|
||||
|
||||
/obj/machinery/mining/drill/proc/get_charge_use()
|
||||
return 100 - (20 * (cellmount ? cellmount.rating : 0))
|
||||
|
||||
/obj/machinery/mining/drill/proc/get_resource_field()
|
||||
|
||||
resource_field = list()
|
||||
need_update_field = 0
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T)) return
|
||||
|
||||
var/tx = T.x-2
|
||||
var/ty = T.y-2
|
||||
var/turf/mine_turf
|
||||
for(var/iy=0,iy<5,iy++)
|
||||
for(var/ix=0,ix<5,ix++)
|
||||
mine_turf = locate(tx+ix,ty+iy,T.z)
|
||||
if(mine_turf && istype(mine_turf) && mine_turf.has_resources)
|
||||
resource_field += mine_turf
|
||||
|
||||
if(!resource_field.len)
|
||||
system_error("resources depleted")
|
||||
|
||||
/obj/machinery/mining/drill/proc/use_cell_power()
|
||||
if(!cell) return 0
|
||||
var/req = get_charge_use()
|
||||
if(cell.charge >= req)
|
||||
cell.use(req)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/mining/drill/verb/unload()
|
||||
set name = "Unload Drill"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(usr.stat) return
|
||||
|
||||
var/obj/structure/ore_box/B = locate() in orange(1)
|
||||
if(B)
|
||||
for(var/obj/item/weapon/ore/O in contents)
|
||||
O.loc = B
|
||||
usr << "\red You unload the drill's storage cache into the ore box."
|
||||
else
|
||||
usr << "\red You must move an ore box up to the drill before you can unload it."
|
||||
|
||||
|
||||
/obj/machinery/mining/brace
|
||||
name = "mining drill brace"
|
||||
desc = "A machinery brace for an industrial drill. It looks easily two feet thick."
|
||||
icon_state = "mining_brace"
|
||||
var/obj/machinery/mining/drill/connected
|
||||
|
||||
/obj/machinery/mining/brace/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/weapon/wrench))
|
||||
|
||||
if(istype(get_turf(src),/turf/space))
|
||||
user << "\blue You can't anchor something to empty space. Idiot."
|
||||
return
|
||||
|
||||
if(connected && connected.active)
|
||||
user << "\blue You can't unanchor the brace of a running drill!"
|
||||
return
|
||||
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
|
||||
user << "\blue You [anchored ? "un" : ""]anchor the brace."
|
||||
|
||||
anchored = !anchored
|
||||
if(anchored)
|
||||
connect()
|
||||
else
|
||||
disconnect()
|
||||
|
||||
/obj/machinery/mining/brace/proc/connect()
|
||||
|
||||
var/turf/T = get_step(get_turf(src), src.dir)
|
||||
for(var/thing in T.contents)
|
||||
if(istype(thing,/obj/machinery/mining/drill))
|
||||
connected = thing
|
||||
break
|
||||
|
||||
if(!connected) return
|
||||
|
||||
if(!connected.supports) connected.supports = list()
|
||||
|
||||
icon_state = "mining_brace_active"
|
||||
|
||||
connected.supports += src
|
||||
connected.check_supports()
|
||||
|
||||
/obj/machinery/mining/brace/proc/disconnect()
|
||||
|
||||
if(!connected) return
|
||||
|
||||
if(!connected.supports) connected.supports = list()
|
||||
|
||||
icon_state = "mining_brace"
|
||||
|
||||
connected.supports -= src
|
||||
connected.check_supports()
|
||||
connected = null
|
||||
|
||||
/obj/machinery/mining/brace/verb/rotate()
|
||||
set name = "Rotate"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(usr.stat) return
|
||||
|
||||
if (src.anchored)
|
||||
usr << "It is anchored in place!"
|
||||
return 0
|
||||
|
||||
src.dir = turn(src.dir, 90)
|
||||
return 1
|
||||
@@ -35,7 +35,7 @@
|
||||
/obj/machinery/mineral/ore_redemption/proc/process_sheet(obj/item/weapon/ore/O)
|
||||
var/obj/item/stack/sheet/processed_sheet = SmeltMineral(O)
|
||||
if(processed_sheet)
|
||||
var/datum/material/mat = materials.getMaterial(O.material)
|
||||
var/datum/material/mat = materials.getMaterial(O.oretag)
|
||||
mat.stored += processed_sheet.amount //Stack the sheets
|
||||
O.loc = null //Let the old sheet garbage collect
|
||||
while(mat.stored > stack_amt) //Get rid of excessive stackage
|
||||
@@ -54,8 +54,8 @@
|
||||
process_sheet(O)
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/proc/SmeltMineral(var/obj/item/weapon/ore/O)
|
||||
if(O.material)
|
||||
var/datum/material/mat = materials.getMaterial(O.material)
|
||||
if(O.oretag)
|
||||
var/datum/material/mat = materials.getMaterial(O.oretag)
|
||||
var/obj/item/stack/sheet/M = new mat.sheettype(src)
|
||||
points += mat.value
|
||||
return M
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
if(t == src.door_tag)
|
||||
src.release_door = d
|
||||
if (machine && release_door)
|
||||
machine.CONSOLE = src
|
||||
machine.console = src
|
||||
else
|
||||
del(src)
|
||||
|
||||
@@ -104,12 +104,20 @@
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker
|
||||
var/points = 0 //The unclaimed value of ore stacked. Value for each ore loosely relative to its rarity. Iron = 1; Diamond = 25.
|
||||
var/list/ore_values = list(("metal" = 1), ("diamond" = 25), ("solid plasma" = 2), ("gold" = 5), ("silver" = 5), ("bananium" = 9999), ("uranium" = 5), ("glass" = 1), ("reinforced glass" = 2), ("plasteel" = 3))
|
||||
var/list/ore_values = list(("iron" = 1), ("diamond" = 25), ("solid plasma" = 2), ("gold" = 5), ("silver" = 5), ("bananium" = 9999), ("uranium" = 5), ("glass" = 1), ("reinforced glass" = 2), ("plasteel" = 3))
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker/process_sheet(obj/item/stack/sheet/inp)
|
||||
if(istype(inp))
|
||||
var/n = inp.name
|
||||
var/a = inp.amount
|
||||
if(n in ore_values)
|
||||
points += ore_values[n] * a
|
||||
..()
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker/process()
|
||||
if (src.output && src.input)
|
||||
var/turf/T = get_turf(input)
|
||||
for(var/obj/item/O in T.contents)
|
||||
if(!O) return
|
||||
if(istype(O,/obj/item/stack))
|
||||
var/obj/item/stack/S = O
|
||||
if(S.name in ore_values)
|
||||
points += ore_values[S.name] * S.amount
|
||||
S.loc = null
|
||||
else
|
||||
S.loc = output.loc
|
||||
else
|
||||
O.loc = output.loc
|
||||
@@ -6,175 +6,92 @@
|
||||
icon_state = "console"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
var/obj/machinery/mineral/processing_unit/machine = null
|
||||
var/machinedir = EAST
|
||||
var/show_all_ores = 0
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/New()
|
||||
..()
|
||||
spawn(7)
|
||||
src.machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir))
|
||||
if (machine)
|
||||
machine.CONSOLE = src
|
||||
machine.console = src
|
||||
else
|
||||
del(src)
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/process()
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/interact(mob/user)
|
||||
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(!allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
|
||||
var/dat = "<b>Smelter control console</b><br><br>"
|
||||
//iron
|
||||
if(machine.ore_iron || machine.ore_glass || machine.ore_plasma || machine.ore_uranium || machine.ore_gold || machine.ore_silver || machine.ore_diamond || machine.ore_clown || machine.ore_adamantine)
|
||||
if(machine.ore_iron)
|
||||
if (machine.selected_iron==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_iron=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_iron=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Iron: [machine.ore_iron]<br>")
|
||||
var/dat = "<h1>Ore processor console</h1>"
|
||||
|
||||
dat += "<hr><table>"
|
||||
|
||||
for(var/ore in machine.ores_processing)
|
||||
|
||||
if(!machine.ores_stored[ore] && !show_all_ores) continue
|
||||
|
||||
dat += "<tr><td width = 40><b>[capitalize(ore)]</b></td><td width = 30>[machine.ores_stored[ore]]</td><td width = 100><font color='"
|
||||
if(machine.ores_processing[ore])
|
||||
switch(machine.ores_processing[ore])
|
||||
if(0)
|
||||
dat += "red'>not processing"
|
||||
if(1)
|
||||
dat += "orange'>smelting"
|
||||
if(2)
|
||||
dat += "blue'>compressing"
|
||||
if(3)
|
||||
dat += "gray'>alloying"
|
||||
else
|
||||
machine.selected_iron = 0
|
||||
|
||||
//sand - glass
|
||||
if(machine.ore_glass)
|
||||
if (machine.selected_glass==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_glass=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_glass=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Sand: [machine.ore_glass]<br>")
|
||||
else
|
||||
machine.selected_glass = 0
|
||||
|
||||
//plasma
|
||||
if(machine.ore_plasma)
|
||||
if (machine.selected_plasma==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_plasma=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_plasma=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Plasma: [machine.ore_plasma]<br>")
|
||||
else
|
||||
machine.selected_plasma = 0
|
||||
|
||||
//uranium
|
||||
if(machine.ore_uranium)
|
||||
if (machine.selected_uranium==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_uranium=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_uranium=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Uranium: [machine.ore_uranium]<br>")
|
||||
else
|
||||
machine.selected_uranium = 0
|
||||
|
||||
//gold
|
||||
if(machine.ore_gold)
|
||||
if (machine.selected_gold==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_gold=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_gold=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Gold: [machine.ore_gold]<br>")
|
||||
else
|
||||
machine.selected_gold = 0
|
||||
|
||||
//silver
|
||||
if(machine.ore_silver)
|
||||
if (machine.selected_silver==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_silver=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_silver=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Silver: [machine.ore_silver]<br>")
|
||||
else
|
||||
machine.selected_silver = 0
|
||||
|
||||
//diamond
|
||||
if(machine.ore_diamond)
|
||||
if (machine.selected_diamond==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_diamond=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_diamond=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Diamond: [machine.ore_diamond]<br>")
|
||||
else
|
||||
machine.selected_diamond = 0
|
||||
|
||||
//bananium
|
||||
if(machine.ore_clown)
|
||||
if (machine.selected_clown==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_clown=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_clown=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Bananium: [machine.ore_clown]<br>")
|
||||
else
|
||||
machine.selected_clown = 0
|
||||
|
||||
|
||||
//On or off
|
||||
dat += text("Machine is currently ")
|
||||
if (machine.on==1)
|
||||
dat += text("<A href='?src=\ref[src];set_on=off'>On</A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];set_on=on'>Off</A> ")
|
||||
else
|
||||
dat+="---No Materials Loaded---"
|
||||
|
||||
|
||||
user << browse("[dat]", "window=console_processing_unit")
|
||||
onclose(user, "console_processing_unit")
|
||||
dat += "red'>not processing"
|
||||
dat += "</font>.</td><td width = 30><a href='?src=\ref[src];toggle_smelting=[ore]'>\[change\]</a></td></tr>"
|
||||
|
||||
dat += "</table><hr>"
|
||||
dat += "Currently displaying [show_all_ores ? "all ore types" : "only available ore types"]. <A href='?src=\ref[src];toggle_ores=1'>\[[show_all_ores ? "show less" : "show more"]\]</a></br>"
|
||||
dat += "The ore processor is currently <A href='?src=\ref[src];toggle_power=1'>[(machine.active ? "<font color='green'>processing</font>" : "<font color='red'>disabled</font>")]</a>."
|
||||
user << browse(dat, "window=processor_console;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["sel_iron"])
|
||||
if (href_list["sel_iron"] == "yes")
|
||||
machine.selected_iron = 1
|
||||
else
|
||||
machine.selected_iron = 0
|
||||
if(href_list["sel_glass"])
|
||||
if (href_list["sel_glass"] == "yes")
|
||||
machine.selected_glass = 1
|
||||
else
|
||||
machine.selected_glass = 0
|
||||
if(href_list["sel_plasma"])
|
||||
if (href_list["sel_plasma"] == "yes")
|
||||
machine.selected_plasma = 1
|
||||
else
|
||||
machine.selected_plasma = 0
|
||||
if(href_list["sel_uranium"])
|
||||
if (href_list["sel_uranium"] == "yes")
|
||||
machine.selected_uranium = 1
|
||||
else
|
||||
machine.selected_uranium = 0
|
||||
if(href_list["sel_gold"])
|
||||
if (href_list["sel_gold"] == "yes")
|
||||
machine.selected_gold = 1
|
||||
else
|
||||
machine.selected_gold = 0
|
||||
if(href_list["sel_silver"])
|
||||
if (href_list["sel_silver"] == "yes")
|
||||
machine.selected_silver = 1
|
||||
else
|
||||
machine.selected_silver = 0
|
||||
if(href_list["sel_diamond"])
|
||||
if (href_list["sel_diamond"] == "yes")
|
||||
machine.selected_diamond = 1
|
||||
else
|
||||
machine.selected_diamond = 0
|
||||
if(href_list["sel_clown"])
|
||||
if (href_list["sel_clown"] == "yes")
|
||||
machine.selected_clown = 1
|
||||
else
|
||||
machine.selected_clown = 0
|
||||
if(href_list["set_on"])
|
||||
if (href_list["set_on"] == "on")
|
||||
machine.on = 1
|
||||
else
|
||||
machine.on = 0
|
||||
|
||||
if(href_list["toggle_smelting"])
|
||||
|
||||
var/choice = input("What setting do you wish to use for processing [href_list["toggle_smelting"]]?") as null|anything in list("Smelting","Compressing","Alloying","Nothing")
|
||||
if(!choice) return
|
||||
|
||||
switch(choice)
|
||||
if("Nothing") choice = 0
|
||||
if("Smelting") choice = 1
|
||||
if("Compressing") choice = 2
|
||||
if("Alloying") choice = 3
|
||||
|
||||
machine.ores_processing[href_list["toggle_smelting"]] = choice
|
||||
|
||||
if(href_list["toggle_power"])
|
||||
|
||||
machine.active = !machine.active
|
||||
|
||||
if(href_list["toggle_ores"])
|
||||
|
||||
show_all_ores = !show_all_ores
|
||||
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
@@ -182,258 +99,133 @@
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit
|
||||
name = "furnace"
|
||||
name = "material processor" //This isn't actually a goddamn furnace, we're in space and it's processing platinum and flammable phoron...
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "furnace"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
anchored = 1
|
||||
luminosity = 3
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/obj/machinery/mineral/CONSOLE = null
|
||||
var/ore_gold = 0;
|
||||
var/ore_silver = 0;
|
||||
var/ore_diamond = 0;
|
||||
var/ore_glass = 0;
|
||||
var/ore_plasma = 0;
|
||||
var/ore_uranium = 0;
|
||||
var/ore_iron = 0;
|
||||
var/ore_clown = 0;
|
||||
var/ore_adamantine = 0;
|
||||
var/selected_gold = 0
|
||||
var/selected_silver = 0
|
||||
var/selected_diamond = 0
|
||||
var/selected_glass = 0
|
||||
var/selected_plasma = 0
|
||||
var/selected_uranium = 0
|
||||
var/selected_iron = 0
|
||||
var/selected_clown = 0
|
||||
var/on = 0 //0 = off, 1 =... oh you know!
|
||||
var/obj/machinery/mineral/console = null
|
||||
var/sheets_per_tick = 10
|
||||
var/list/ores_processing[0]
|
||||
var/list/ores_stored[0]
|
||||
var/list/ore_data[0]
|
||||
var/list/alloy_data[0]
|
||||
var/active = 0
|
||||
|
||||
/obj/machinery/mineral/processing_unit/New()
|
||||
|
||||
..()
|
||||
spawn( 5 )
|
||||
|
||||
//TODO: Ore and alloy global storage datum.
|
||||
for(var/alloytype in typesof(/datum/alloy)-/datum/alloy)
|
||||
alloy_data += new alloytype()
|
||||
|
||||
for(var/oretype in typesof(/datum/ore)-/datum/ore)
|
||||
var/datum/ore/OD = new oretype()
|
||||
ore_data[OD.oretag] = OD
|
||||
ores_processing[OD.oretag] = 0
|
||||
ores_stored[OD.oretag] = 0
|
||||
|
||||
//Locate our output and input machinery.
|
||||
spawn(5)
|
||||
for (var/dir in cardinal)
|
||||
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
if(src.input) break
|
||||
for (var/dir in cardinal)
|
||||
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(src.output) break
|
||||
processing_objects.Add(src)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/processing_unit/process()
|
||||
if (src.output && src.input)
|
||||
var/i
|
||||
for (i = 0; i < 10; i++)
|
||||
if (on)
|
||||
if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
|
||||
if (ore_glass > 0)
|
||||
ore_glass--;
|
||||
new /obj/item/stack/sheet/glass(output.loc)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0)
|
||||
if (ore_glass > 0 && ore_iron > 0)
|
||||
ore_glass--;
|
||||
ore_iron--;
|
||||
new /obj/item/stack/sheet/rglass(output.loc)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 1 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
|
||||
if (ore_gold > 0)
|
||||
ore_gold--;
|
||||
new /obj/item/stack/sheet/mineral/gold(output.loc)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
|
||||
if (ore_silver > 0)
|
||||
ore_silver--;
|
||||
new /obj/item/stack/sheet/mineral/silver(output.loc)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
|
||||
if (ore_diamond > 0)
|
||||
ore_diamond--;
|
||||
new /obj/item/stack/sheet/mineral/diamond(output.loc)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
|
||||
if (ore_plasma > 0)
|
||||
ore_plasma--;
|
||||
new /obj/item/stack/sheet/mineral/plasma(output.loc)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0)
|
||||
if (ore_uranium > 0)
|
||||
ore_uranium--;
|
||||
new /obj/item/stack/sheet/mineral/uranium(output.loc)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0)
|
||||
if (ore_iron > 0)
|
||||
ore_iron--;
|
||||
new /obj/item/stack/sheet/metal(output.loc)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0)
|
||||
if (ore_iron > 0 && ore_plasma > 0)
|
||||
ore_iron--;
|
||||
ore_plasma--;
|
||||
new /obj/item/stack/sheet/plasteel(output.loc)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 1)
|
||||
if (ore_clown > 0)
|
||||
ore_clown--;
|
||||
new /obj/item/stack/sheet/mineral/clown(output.loc)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
|
||||
if (ore_glass > 0 && ore_plasma > 0)
|
||||
ore_glass--;
|
||||
ore_plasma--;
|
||||
new /obj/item/stack/sheet/plasmaglass(output.loc)
|
||||
else
|
||||
on = 0
|
||||
if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0)
|
||||
if (ore_glass > 0 && ore_plasma > 0 && ore_iron > 0)
|
||||
ore_glass--;
|
||||
ore_iron--;
|
||||
ore_plasma--;
|
||||
new /obj/item/stack/sheet/plasmarglass(output.loc)
|
||||
else
|
||||
on = 0
|
||||
//THESE TWO ARE CODED FOR URIST TO USE WHEN HE GETS AROUND TO IT.
|
||||
//They were coded on 18 Feb 2012. If you're reading this in 2015, then firstly congratulations on the world not ending on 21 Dec 2012 and secondly, Urist is apparently VERY lazy. ~Errorage
|
||||
/*if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0)
|
||||
if (ore_uranium >= 2 && ore_diamond >= 1)
|
||||
ore_uranium -= 2
|
||||
ore_diamond -= 1
|
||||
new /obj/item/stack/sheet/mineral/adamantine(output.loc)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
|
||||
if (ore_silver >= 1 && ore_plasma >= 3)
|
||||
ore_silver -= 1
|
||||
ore_plasma -= 3
|
||||
new /obj/item/stack/sheet/mineral/mythril(output.loc)
|
||||
else
|
||||
on = 0
|
||||
continue*/
|
||||
|
||||
if (!active || !src.output || !src.input) return
|
||||
|
||||
//if a non valid combination is selected
|
||||
var/list/tick_alloys = list()
|
||||
|
||||
var/b = 1 //this part checks if all required ores are available
|
||||
//Process our stored ores and spit out sheets.
|
||||
var/sheets = 0
|
||||
for(var/metal in ores_stored)
|
||||
|
||||
if (!(selected_gold || selected_silver ||selected_diamond || selected_uranium | selected_plasma || selected_iron || selected_iron))
|
||||
b = 0
|
||||
if(sheets >= sheets_per_tick) break
|
||||
|
||||
if (selected_gold == 1)
|
||||
if (ore_gold <= 0)
|
||||
b = 0
|
||||
if (selected_silver == 1)
|
||||
if (ore_silver <= 0)
|
||||
b = 0
|
||||
if (selected_diamond == 1)
|
||||
if (ore_diamond <= 0)
|
||||
b = 0
|
||||
if (selected_uranium == 1)
|
||||
if (ore_uranium <= 0)
|
||||
b = 0
|
||||
if (selected_plasma == 1)
|
||||
if (ore_plasma <= 0)
|
||||
b = 0
|
||||
if (selected_iron == 1)
|
||||
if (ore_iron <= 0)
|
||||
b = 0
|
||||
if (selected_glass == 1)
|
||||
if (ore_glass <= 0)
|
||||
b = 0
|
||||
if (selected_clown == 1)
|
||||
if (ore_clown <= 0)
|
||||
b = 0
|
||||
if(ores_stored[metal] > 0 && ores_processing[metal] != 0)
|
||||
|
||||
if (b) //if they are, deduct one from each, produce slag and shut the machine off
|
||||
if (selected_gold == 1)
|
||||
ore_gold--
|
||||
if (selected_silver == 1)
|
||||
ore_silver--
|
||||
if (selected_diamond == 1)
|
||||
ore_diamond--
|
||||
if (selected_uranium == 1)
|
||||
ore_uranium--
|
||||
if (selected_plasma == 1)
|
||||
ore_plasma--
|
||||
if (selected_iron == 1)
|
||||
ore_iron--
|
||||
if (selected_clown == 1)
|
||||
ore_clown--
|
||||
new /obj/item/weapon/ore/slag(output.loc)
|
||||
on = 0
|
||||
else
|
||||
on = 0
|
||||
break
|
||||
break
|
||||
var/datum/ore/O = ore_data[metal]
|
||||
|
||||
if(!O) continue
|
||||
|
||||
if(ores_processing[metal] == 3 && O.alloy) //Alloying.
|
||||
|
||||
for(var/datum/alloy/A in alloy_data)
|
||||
|
||||
if(A.metaltag in tick_alloys)
|
||||
continue
|
||||
|
||||
tick_alloys += A.metaltag
|
||||
var/enough_metal
|
||||
|
||||
if(!isnull(A.requires[metal]) && ores_stored[metal] >= A.requires[metal]) //We have enough of our first metal, we're off to a good start.
|
||||
|
||||
enough_metal = 1
|
||||
|
||||
for(var/needs_metal in A.requires)
|
||||
//Check if we're alloying the needed metal and have it stored.
|
||||
if(ores_processing[needs_metal] != 3 || ores_stored[needs_metal] < A.requires[needs_metal])
|
||||
enough_metal = 0
|
||||
break
|
||||
|
||||
if(!enough_metal)
|
||||
continue
|
||||
else
|
||||
var/total
|
||||
for(var/needs_metal in A.requires)
|
||||
ores_stored[needs_metal] -= A.requires[needs_metal]
|
||||
total += A.requires[needs_metal]
|
||||
total = max(1,round(total*A.product_mod)) //Always get at least one sheet.
|
||||
sheets += total-1
|
||||
|
||||
for(var/i=0,i<total,i++)
|
||||
new A.product(output.loc)
|
||||
|
||||
else if(ores_processing[metal] == 2 && O.compresses_to) //Compressing.
|
||||
|
||||
var/can_make = Clamp(ores_stored[metal],0,sheets_per_tick-sheets)
|
||||
if(can_make%2>0) can_make--
|
||||
|
||||
if(!can_make || ores_stored[metal] < 1)
|
||||
continue
|
||||
|
||||
for(var/i=0,i<can_make,i+=2)
|
||||
ores_stored[metal]-=2
|
||||
sheets+=2
|
||||
new O.compresses_to(output.loc)
|
||||
|
||||
else if(ores_processing[metal] == 1 && O.smelts_to) //Smelting.
|
||||
|
||||
var/can_make = Clamp(ores_stored[metal],0,sheets_per_tick-sheets)
|
||||
if(!can_make || ores_stored[metal] < 1)
|
||||
continue
|
||||
|
||||
for(var/i=0,i<can_make,i++)
|
||||
ores_stored[metal]--
|
||||
sheets++
|
||||
new O.smelts_to(output.loc)
|
||||
else
|
||||
break
|
||||
for (i = 0; i < 10; i++)
|
||||
var/obj/item/O
|
||||
O = locate(/obj/item, input.loc)
|
||||
if (O)
|
||||
if (istype(O,/obj/item/weapon/ore/iron))
|
||||
ore_iron++;
|
||||
O.loc = null
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/glass))
|
||||
ore_glass++;
|
||||
O.loc = null
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/diamond))
|
||||
ore_diamond++;
|
||||
O.loc = null
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/plasma))
|
||||
ore_plasma++
|
||||
O.loc = null
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/gold))
|
||||
ore_gold++
|
||||
O.loc = null
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/silver))
|
||||
ore_silver++
|
||||
O.loc = null
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/uranium))
|
||||
ore_uranium++
|
||||
O.loc = null
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/clown))
|
||||
ore_clown++
|
||||
O.loc = null
|
||||
del(O)
|
||||
continue
|
||||
O.loc = src.output.loc
|
||||
else
|
||||
break
|
||||
return
|
||||
ores_stored[metal]--
|
||||
sheets++
|
||||
new /obj/item/weapon/ore/slag(output.loc)
|
||||
else
|
||||
continue
|
||||
|
||||
//Grab some more ore to process next tick.
|
||||
for(var/i = 0,i<sheets_per_tick,i++)
|
||||
var/obj/item/weapon/ore/O = locate() in input.loc
|
||||
if(!O) break
|
||||
if(!isnull(ores_stored[O.oretag])) ores_stored[O.oretag]++
|
||||
O.loc = null
|
||||
|
||||
console.updateUsrDialog()
|
||||
|
||||
@@ -10,48 +10,57 @@
|
||||
var/machinedir = SOUTHEAST
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/New()
|
||||
|
||||
..()
|
||||
|
||||
spawn(7)
|
||||
src.machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
|
||||
if (machine)
|
||||
machine.CONSOLE = src
|
||||
machine.console = src
|
||||
else
|
||||
del(src)
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/attack_hand(user as mob)
|
||||
/obj/machinery/mineral/stacking_unit_console/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/interact(mob/user)
|
||||
user.set_machine(src)
|
||||
|
||||
var/obj/item/stack/sheet/s
|
||||
var/dat
|
||||
|
||||
dat += text("<b>Stacking unit console</b><br><br>")
|
||||
dat += text("<h1>Stacking unit console</h1><hr><table>")
|
||||
|
||||
for(var/O in machine.stack_list)
|
||||
s = machine.stack_list[O]
|
||||
if(s.amount > 0)
|
||||
dat += text("[s.name]: [s.amount] <A href='?src=\ref[src];release=[s.type]'>Release</A><br>")
|
||||
|
||||
dat += text("<br>Stacking: [machine.stack_amt]<br><br>")
|
||||
for(var/stacktype in machine.stack_storage)
|
||||
if(machine.stack_storage[stacktype] > 0)
|
||||
dat += "<tr><td width = 150><b>[capitalize(stacktype)]:</b></td><td width = 30>[machine.stack_storage[stacktype]]</td><td width = 50><A href='?src=\ref[src];release_stack=[stacktype]'>\[release\]</a></td></tr>"
|
||||
dat += "</table><hr>"
|
||||
dat += text("<br>Stacking: [machine.stack_amt] <A href='?src=\ref[src];change_stack=1'>\[change\]</a><br><br>")
|
||||
|
||||
user << browse("[dat]", "window=console_stacking_machine")
|
||||
onclose(user, "console_stacking_machine")
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["change_stack"])
|
||||
var/choice = input("What would you like to set the stack amount to?") as null|anything in list(1,5,10,20,50)
|
||||
if(!choice) return
|
||||
machine.stack_amt = choice
|
||||
|
||||
if(href_list["release_stack"])
|
||||
if(machine.stack_storage[href_list["release_stack"]] > 0)
|
||||
var/stacktype = machine.stack_paths[href_list["release_stack"]]
|
||||
var/obj/item/stack/sheet/S = new stacktype (get_turf(machine.output))
|
||||
S.amount = machine.stack_storage[href_list["release_stack"]]
|
||||
machine.stack_storage[href_list["release_stack"]] = 0
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["release"])
|
||||
var/obj/item/stack/sheet/inp = machine.stack_list[text2path(href_list["release"])]
|
||||
var/obj/item/stack/sheet/out = new inp.type()
|
||||
out.amount = inp.amount
|
||||
inp.amount = 0
|
||||
out.loc = machine.output.loc
|
||||
|
||||
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
/**********************Mineral stacking unit**************************/
|
||||
|
||||
@@ -62,16 +71,29 @@
|
||||
icon_state = "stacker"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/stacking_unit_console/CONSOLE
|
||||
var/stk_types = list()
|
||||
var/stk_amt = list()
|
||||
var/obj/machinery/mineral/stacking_unit_console/console
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/stack_list[0] //Key: Type. Value: Instance of type.
|
||||
var/stack_amt = 50; //ammount to stack before releassing
|
||||
var/list/stack_storage[0]
|
||||
var/list/stack_paths[0]
|
||||
var/stack_amt = 50; // Amount to stack before releassing
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/New()
|
||||
..()
|
||||
|
||||
for(var/stacktype in typesof(/obj/item/stack/sheet/mineral)-/obj/item/stack/sheet/mineral)
|
||||
var/obj/item/stack/S = new stacktype(src)
|
||||
stack_storage[S.name] = 0
|
||||
stack_paths[S.name] = stacktype
|
||||
del(S)
|
||||
|
||||
stack_storage["glass"] = 0
|
||||
stack_paths["glass"] = /obj/item/stack/sheet/glass
|
||||
stack_storage["metal"] = 0
|
||||
stack_paths["metal"] = /obj/item/stack/sheet/metal
|
||||
stack_storage["plasteel"] = 0
|
||||
stack_paths["plasteel"] = /obj/item/stack/sheet/plasteel
|
||||
|
||||
spawn( 5 )
|
||||
for (var/dir in cardinal)
|
||||
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
@@ -79,34 +101,31 @@
|
||||
for (var/dir in cardinal)
|
||||
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(src.output) break
|
||||
if(!istype(output) || !istype(input))
|
||||
del(src)
|
||||
return
|
||||
processing_objects.Add(src)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/proc/process_sheet(obj/item/stack/sheet/inp)
|
||||
if(!istype(inp)) //Non-sheets. Yuck.
|
||||
return
|
||||
if(!(inp.type in stack_list)) //It's the first of this sheet added
|
||||
stack_list[inp.type] = new inp.type(src,0)
|
||||
var/obj/item/stack/sheet/storage = stack_list[inp.type]
|
||||
storage.amount += inp.amount //Stack the sheets
|
||||
inp.loc = null //Let the old sheet garbage collect
|
||||
while(storage.amount > stack_amt) //Get rid of excessive stackage
|
||||
var/obj/item/stack/sheet/out = new inp.type()
|
||||
out.amount = stack_amt
|
||||
out.loc = output.loc
|
||||
storage.amount -= stack_amt
|
||||
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/process()
|
||||
var/obj/item/O
|
||||
while (locate(/obj/item, input.loc))
|
||||
O = locate(/obj/item, input.loc)
|
||||
if(istype(O,/obj/item/stack/sheet))
|
||||
process_sheet(O)
|
||||
else
|
||||
O.loc = src.output.loc
|
||||
if (src.output && src.input)
|
||||
var/turf/T = get_turf(input)
|
||||
for(var/obj/item/O in T.contents)
|
||||
if(!O) return
|
||||
if(istype(O,/obj/item/stack))
|
||||
if(!isnull(stack_storage[O.name]))
|
||||
stack_storage[O.name]++
|
||||
O.loc = null
|
||||
else
|
||||
O.loc = output.loc
|
||||
else
|
||||
O.loc = output.loc
|
||||
|
||||
//Output amounts that are past stack_amt.
|
||||
for(var/sheet in stack_storage)
|
||||
if(stack_storage[sheet] >= stack_amt)
|
||||
var/stacktype = stack_paths[sheet]
|
||||
var/obj/item/stack/sheet/S = new stacktype (get_turf(output))
|
||||
S.amount = stack_amt
|
||||
stack_storage[sheet] -= stack_amt
|
||||
|
||||
console.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ var/list/artifact_spawn = list() // Runtime fix for geometry loading before cont
|
||||
var/datum/artifact_find/artifact_find
|
||||
var/scan_state = null
|
||||
|
||||
has_resources = 1
|
||||
|
||||
New()
|
||||
. = ..()
|
||||
@@ -405,6 +406,7 @@ var/list/artifact_spawn = list() // Runtime fix for geometry loading before cont
|
||||
temperature = T0C
|
||||
icon_plating = "asteroid"
|
||||
var/dug = 0 //0 = has not yet been dug, 1 = has already been dug
|
||||
has_resources = 1
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/New()
|
||||
var/proper_name = name
|
||||
@@ -572,92 +574,6 @@ var/list/artifact_spawn = list() // Runtime fix for geometry loading before cont
|
||||
else
|
||||
return
|
||||
|
||||
|
||||
////////////////////////////////Gibtonite
|
||||
/turf/simulated/mineral/gibtonite
|
||||
name = "Diamond deposit" //honk
|
||||
icon_state = "rock_Gibtonite"
|
||||
mineral = new /mineral/gibtonite
|
||||
scan_state = "rock_Gibtonite"
|
||||
var/det_time = 8 //Countdown till explosion, but also rewards the player for how close you were to detonation when you defuse it
|
||||
var/stage = 0 //How far into the lifecycle of gibtonite we are, 0 is untouched, 1 is active and attempting to detonate, 2 is benign and ready for extraction
|
||||
var/activated_ckey = null //These are to track who triggered the gibtonite deposit for logging purposes
|
||||
var/activated_name = null
|
||||
|
||||
/turf/simulated/mineral/gibtonite/New()
|
||||
icon_state="rock_Diamond"
|
||||
det_time = rand(8,10) //So you don't know exactly when the hot potato will explode
|
||||
..()
|
||||
|
||||
/turf/simulated/mineral/gibtonite/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/device/analyzer) && stage == 1)
|
||||
user.visible_message("<span class='notice'>You use the analyzer to locate where to cut off the chain reaction and attempt to stop it...</span>")
|
||||
defuse()
|
||||
if(istype(I, /obj/item/weapon/pickaxe))
|
||||
src.activated_ckey = "[user.ckey]"
|
||||
src.activated_name = "[user.name]"
|
||||
..()
|
||||
|
||||
/turf/simulated/mineral/gibtonite/proc/explosive_reaction()
|
||||
if(stage == 0)
|
||||
icon_state = "rock_Gibtonite_active"
|
||||
name = "Gibtonite deposit"
|
||||
desc = "An active gibtonite reserve. Run!"
|
||||
stage = 1
|
||||
visible_message("<span class='warning'>There was gibtonite inside! It's going to explode!</span>")
|
||||
var/turf/bombturf = get_turf(src)
|
||||
var/area/A = get_area(bombturf)
|
||||
var/log_str = "[src.activated_ckey]<A HREF='?_src_=holder;adminmoreinfo=\ref[usr]'>?</A> [src.activated_name] has triggered a gibtonite deposit reaction <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>."
|
||||
log_game(log_str)
|
||||
countdown()
|
||||
|
||||
/turf/simulated/mineral/gibtonite/proc/countdown()
|
||||
spawn(0)
|
||||
while(stage == 1 && det_time > 0 && mineral.result_amount >= 1)
|
||||
det_time--
|
||||
sleep(5)
|
||||
if(stage == 1 && det_time <= 0 && mineral.result_amount >= 1)
|
||||
var/turf/bombturf = get_turf(src)
|
||||
mineral.result_amount = 0
|
||||
explosion(bombturf,1,3,5, adminlog = 0)
|
||||
if(stage == 0 || stage == 2)
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/gibtonite/proc/defuse()
|
||||
if(stage == 1)
|
||||
icon_state = "rock_Gibtonite_inactive"
|
||||
desc = "An inactive gibtonite reserve. The ore can be extracted."
|
||||
stage = 2
|
||||
if(det_time < 0)
|
||||
det_time = 0
|
||||
visible_message("<span class='notice'>The chain reaction was stopped! The gibtonite had [src.det_time] reactions left till the explosion!</span>")
|
||||
|
||||
/turf/simulated/mineral/gibtonite/GetDrilled()
|
||||
if(stage == 0 && mineral.result_amount >= 1) //Gibtonite deposit is activated
|
||||
playsound(src,'sound/effects/hit_on_shattered_glass.ogg',50,1)
|
||||
explosive_reaction()
|
||||
return
|
||||
if(stage == 1 && mineral.result_amount >= 1) //Gibtonite deposit goes kaboom
|
||||
var/turf/bombturf = get_turf(src)
|
||||
mineral.result_amount = 0
|
||||
explosion(bombturf,1,2,5, adminlog = 0)
|
||||
if(stage == 2) //Gibtonite deposit is now benign and extractable. Depending on how close you were to it blowing up before defusing, you get better quality ore.
|
||||
var/obj/item/weapon/twohanded/required/gibtonite/G = new /obj/item/weapon/twohanded/required/gibtonite/(src)
|
||||
if(det_time <= 0)
|
||||
G.quality = 3
|
||||
G.icon_state = "Gibtonite ore 3"
|
||||
if(det_time >= 1 && det_time <= 2)
|
||||
G.quality = 2
|
||||
G.icon_state = "Gibtonite ore 2"
|
||||
var/turf/simulated/floor/plating/airless/asteroid/gibtonite_remains/G = ChangeTurf(/turf/simulated/floor/plating/airless/asteroid/gibtonite_remains)
|
||||
G.fullUpdateMineralOverlays()
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/gibtonite_remains
|
||||
var/det_time = 0
|
||||
var/stage = 0
|
||||
|
||||
////////////////////////////////End Gibtonite
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/cave
|
||||
var/length = 100
|
||||
var/mob_spawn_list = list(
|
||||
|
||||
@@ -74,18 +74,6 @@ mineral/clown
|
||||
spread = 0
|
||||
ore = /obj/item/weapon/ore/clown
|
||||
|
||||
mineral/gibtonite
|
||||
display_name = "Gibtonite"
|
||||
name = "Gibtonite"
|
||||
result_amount = 1
|
||||
spread_chance = 10
|
||||
ore = /obj/item/weapon/twohanded/required/gibtonite
|
||||
UpdateTurf(var/turf/T)
|
||||
if(!istype(T,/turf/simulated/mineral/gibtonite))
|
||||
T.ChangeTurf(/turf/simulated/mineral/gibtonite)
|
||||
else
|
||||
..()
|
||||
|
||||
mineral/cave
|
||||
display_name = "Cave"
|
||||
name = "Cave"
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
var/amt_plasma = 0
|
||||
var/amt_uranium = 0
|
||||
var/amt_clown = 0
|
||||
var/amt_adamantine = 0
|
||||
var/amt_mythril = 0
|
||||
var/newCoins = 0 //how many coins the machine made in it's last load
|
||||
var/processing = 0
|
||||
var/chosen = "metal" //which material will be used to make coins
|
||||
@@ -64,9 +62,6 @@
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/clown))
|
||||
amt_clown += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/adamantine))
|
||||
amt_adamantine += 100 * O.amount
|
||||
del(O) //Commented out for now. -Durandan
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/attack_hand(user as mob) //TODO: Adamantine coins! -Durandan
|
||||
@@ -116,11 +111,6 @@
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=clown'>Choose</A>")
|
||||
dat += text("<br><font color='#888888'><b>Adamantine inserted: </b>[amt_adamantine]</font> ")//I don't even know these color codes, so fuck it.
|
||||
if (chosen == "adamantine")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=adamantine'>Choose</A>")
|
||||
|
||||
dat += text("<br><br>Will produce [coinsToProduce] [chosen] coins if enough materials are available.<br>")
|
||||
//dat += text("The dial which controls the number of conins to produce seems to be stuck. A technician has already been dispatched to fix this.")
|
||||
@@ -238,30 +228,6 @@
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("adamantine")
|
||||
while(amt_adamantine > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/adamantine(M)
|
||||
amt_adamantine -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("mythril")
|
||||
while(amt_adamantine > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/mythril(M)
|
||||
amt_mythril -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
icon_state = "coinpress0"
|
||||
processing = 0;
|
||||
coinsToProduce = temp_coins
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
var/amt_plasma = 0
|
||||
var/amt_uranium = 0
|
||||
var/amt_clown = 0
|
||||
var/amt_adamantine = 0
|
||||
|
||||
for (var/obj/item/weapon/coin/C in contents)
|
||||
if (istype(C,/obj/item/weapon/coin/diamond))
|
||||
@@ -34,8 +33,6 @@
|
||||
amt_uranium++;
|
||||
if (istype(C,/obj/item/weapon/coin/clown))
|
||||
amt_clown++;
|
||||
if (istype(C,/obj/item/weapon/coin/adamantine))
|
||||
amt_adamantine++;
|
||||
|
||||
var/dat = text("<b>The contents of the moneybag reveal...</b><br>")
|
||||
if (amt_gold)
|
||||
@@ -52,8 +49,6 @@
|
||||
dat += text("Uranium coins: [amt_uranium] <A href='?src=\ref[src];remove=uranium'>Remove one</A><br>")
|
||||
if (amt_clown)
|
||||
dat += text("Bananium coins: [amt_clown] <A href='?src=\ref[src];remove=clown'>Remove one</A><br>")
|
||||
if (amt_adamantine)
|
||||
dat += text("Adamantine coins: [amt_adamantine] <A href='?src=\ref[src];remove=adamantine'>Remove one</A><br>")
|
||||
/*
|
||||
var/credits=0
|
||||
var/list/ore=list()
|
||||
@@ -113,8 +108,6 @@
|
||||
COIN = locate(/obj/item/weapon/coin/uranium,src.contents)
|
||||
if("clown")
|
||||
COIN = locate(/obj/item/weapon/coin/clown,src.contents)
|
||||
if("adamantine")
|
||||
COIN = locate(/obj/item/weapon/coin/adamantine,src.contents)
|
||||
if(!COIN)
|
||||
return
|
||||
COIN.loc = src.loc
|
||||
@@ -131,5 +124,4 @@
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
new /obj/item/weapon/coin/gold(src)
|
||||
new /obj/item/weapon/coin/gold(src)
|
||||
new /obj/item/weapon/coin/adamantine(src)
|
||||
new /obj/item/weapon/coin/gold(src)
|
||||
@@ -0,0 +1,87 @@
|
||||
/obj/item/weapon/ore
|
||||
name = "rock"
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "ore2"
|
||||
var/datum/geosample/geologic_data
|
||||
var/oretag
|
||||
|
||||
/obj/item/weapon/ore/uranium
|
||||
name = "pitchblende"
|
||||
icon_state = "Uranium ore"
|
||||
origin_tech = "materials=5"
|
||||
oretag = "uranium"
|
||||
|
||||
/obj/item/weapon/ore/iron
|
||||
name = "hematite"
|
||||
icon_state = "Iron ore"
|
||||
origin_tech = "materials=1"
|
||||
oretag = "hematite"
|
||||
|
||||
/obj/item/weapon/ore/coal
|
||||
name = "carbonaceous rock"
|
||||
icon_state = "Iron ore" //TODO
|
||||
origin_tech = "materials=1"
|
||||
oretag = "coal"
|
||||
|
||||
/obj/item/weapon/ore/glass
|
||||
name = "impure silicates"
|
||||
icon_state = "Glass ore"
|
||||
origin_tech = "materials=1"
|
||||
oretag = "sand"
|
||||
|
||||
/obj/item/weapon/ore/plasma
|
||||
name = "plasma crystals"
|
||||
icon_state = "Plasa ore"
|
||||
origin_tech = "materials=2"
|
||||
oretag = "plasma"
|
||||
|
||||
/obj/item/weapon/ore/silver
|
||||
name = "native silver ore"
|
||||
icon_state = "Silver ore"
|
||||
origin_tech = "materials=3"
|
||||
oretag = "silver"
|
||||
|
||||
/obj/item/weapon/ore/gold
|
||||
name = "native gold ore"
|
||||
icon_state = "Gold ore"
|
||||
origin_tech = "materials=4"
|
||||
oretag = "gold"
|
||||
|
||||
/obj/item/weapon/ore/diamond
|
||||
name = "diamonds"
|
||||
icon_state = "Diamond ore"
|
||||
origin_tech = "materials=6"
|
||||
oretag = "diamond"
|
||||
|
||||
/obj/item/weapon/ore/osmium
|
||||
name = "raw platinum"
|
||||
icon_state = "slag" //TODO
|
||||
oretag = "platinum"
|
||||
|
||||
/obj/item/weapon/ore/hydrogen
|
||||
name = "raw hydrogen"
|
||||
icon_state = "slag" //TODO
|
||||
oretag = "hydrogen"
|
||||
|
||||
/obj/item/weapon/ore/clown
|
||||
name = "Bananium ore"
|
||||
icon_state = "Clown ore"
|
||||
origin_tech = "materials=4"
|
||||
oretag="clown"
|
||||
|
||||
/obj/item/weapon/ore/slag
|
||||
name = "Slag"
|
||||
desc = "Completely useless"
|
||||
icon_state = "slag"
|
||||
oretag = "slag"
|
||||
|
||||
/obj/item/weapon/ore/New()
|
||||
pixel_x = rand(0,16)-8
|
||||
pixel_y = rand(0,8)-8
|
||||
|
||||
/obj/item/weapon/ore/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/device/core_sampler))
|
||||
var/obj/item/device/core_sampler/C = W
|
||||
C.sample_item(src, user)
|
||||
else
|
||||
return ..()
|
||||
@@ -0,0 +1,51 @@
|
||||
/datum/ore
|
||||
var/oretag
|
||||
var/alloy
|
||||
var/smelts_to
|
||||
var/compresses_to
|
||||
|
||||
/datum/ore/uranium
|
||||
smelts_to = /obj/item/stack/sheet/mineral/uranium
|
||||
oretag = "uranium"
|
||||
|
||||
/datum/ore/iron
|
||||
smelts_to = /obj/item/stack/sheet/mineral/iron
|
||||
alloy = 1
|
||||
oretag = "hematite"
|
||||
|
||||
/datum/ore/coal
|
||||
smelts_to = /obj/item/stack/sheet/mineral/plastic
|
||||
alloy = 1
|
||||
oretag = "coal"
|
||||
|
||||
/datum/ore/glass
|
||||
smelts_to = /obj/item/stack/sheet/glass
|
||||
compresses_to = /obj/item/stack/sheet/mineral/sandstone
|
||||
oretag = "sand"
|
||||
|
||||
/datum/ore/plasma
|
||||
smelts_to = /obj/item/stack/sheet/mineral/plasma
|
||||
oretag = "plasma"
|
||||
|
||||
/datum/ore/silver
|
||||
smelts_to = /obj/item/stack/sheet/mineral/silver
|
||||
oretag = "silver"
|
||||
|
||||
/datum/ore/gold
|
||||
smelts_to = /obj/item/stack/sheet/mineral/gold
|
||||
oretag = "gold"
|
||||
|
||||
/datum/ore/diamond
|
||||
compresses_to = /obj/item/stack/sheet/mineral/diamond
|
||||
oretag = "diamond"
|
||||
|
||||
/datum/ore/osmium
|
||||
smelts_to = /obj/item/stack/sheet/mineral/platinum
|
||||
compresses_to = /obj/item/stack/sheet/mineral/osmium
|
||||
alloy = 1
|
||||
oretag = "platinum"
|
||||
|
||||
/datum/ore/hydrogen
|
||||
smelts_to = /obj/item/stack/sheet/mineral/tritium
|
||||
compresses_to = /obj/item/stack/sheet/mineral/mhydrogen
|
||||
oretag = "hydrogen"
|
||||
@@ -1,237 +0,0 @@
|
||||
/**********************Mineral ores**************************/
|
||||
|
||||
/obj/item/weapon/ore
|
||||
name = "Rock"
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "ore2"
|
||||
var/material=null
|
||||
var/datum/geosample/geologic_data
|
||||
|
||||
/obj/item/weapon/ore/uranium
|
||||
name = "Uranium ore"
|
||||
icon_state = "Uranium ore"
|
||||
origin_tech = "materials=5"
|
||||
material="uranium"
|
||||
|
||||
/obj/item/weapon/ore/iron
|
||||
name = "Iron ore"
|
||||
icon_state = "Iron ore"
|
||||
origin_tech = "materials=1"
|
||||
material="iron"
|
||||
|
||||
/obj/item/weapon/ore/glass
|
||||
name = "Sand"
|
||||
icon_state = "Glass ore"
|
||||
origin_tech = "materials=1"
|
||||
material="glass"
|
||||
|
||||
attack_self(mob/living/user as mob) //It's magic I ain't gonna explain how instant conversion with no tool works. -- Urist
|
||||
var/location = get_turf(user)
|
||||
for(var/obj/item/weapon/ore/glass/sandToConvert in location)
|
||||
new /obj/item/stack/sheet/mineral/sandstone(location)
|
||||
qdel(sandToConvert)
|
||||
new /obj/item/stack/sheet/mineral/sandstone(location)
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/ore/plasma
|
||||
name = "Plasma ore"
|
||||
icon_state = "Plasma ore"
|
||||
origin_tech = "materials=2"
|
||||
material="plasma"
|
||||
|
||||
/obj/item/weapon/ore/silver
|
||||
name = "Silver ore"
|
||||
icon_state = "Silver ore"
|
||||
origin_tech = "materials=3"
|
||||
material="silver"
|
||||
|
||||
/obj/item/weapon/ore/gold
|
||||
name = "Gold ore"
|
||||
icon_state = "Gold ore"
|
||||
origin_tech = "materials=4"
|
||||
material="gold"
|
||||
|
||||
/obj/item/weapon/ore/diamond
|
||||
name = "Diamond ore"
|
||||
icon_state = "Diamond ore"
|
||||
origin_tech = "materials=6"
|
||||
material="diamond"
|
||||
|
||||
/obj/item/weapon/ore/clown
|
||||
name = "Bananium ore"
|
||||
icon_state = "Clown ore"
|
||||
origin_tech = "materials=4"
|
||||
material="clown"
|
||||
|
||||
/obj/item/weapon/ore/slag
|
||||
name = "Slag"
|
||||
desc = "Completely useless"
|
||||
icon_state = "slag"
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite
|
||||
name = "Gibtonite ore"
|
||||
desc = "Extremely explosive if struck with mining equipment, Gibtonite is often used by miners to speed up their work by using it as a mining charge. This material is illegal to possess by unauthorized personnel under space law."
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "Gibtonite ore"
|
||||
item_state = "Gibtonite ore"
|
||||
w_class = 4
|
||||
throw_range = 0
|
||||
anchored = 1 //Forces people to carry it by hand, no pulling!
|
||||
var/primed = 0
|
||||
var/det_time = 100
|
||||
var/quality = 1 //How pure this gibtonite is, determines the explosion produced by it and is derived from the det_time of the rock wall it was taken from, higher value = better
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/weapon/pickaxe) || istype(I, /obj/item/weapon/resonator))
|
||||
GibtoniteReaction(user)
|
||||
return
|
||||
if(istype(I, /obj/item/device/mining_scanner) && primed)
|
||||
primed = 0
|
||||
user.visible_message("<span class='notice'>The chain reaction was stopped! ...The ore's quality went down.</span>")
|
||||
icon_state = "Gibtonite ore"
|
||||
quality = 1
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/bullet_act(var/obj/item/projectile/P)
|
||||
if(istype(P, /obj/item/projectile/bullet))
|
||||
GibtoniteReaction(P.firer)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/ex_act()
|
||||
GibtoniteReaction(triggered_by_explosive = 1)
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/proc/GibtoniteReaction(mob/user, triggered_by_explosive = 0)
|
||||
if(!primed)
|
||||
playsound(src,'sound/effects/hit_on_shattered_glass.ogg',50,1)
|
||||
primed = 1
|
||||
icon_state = "Gibtonite active"
|
||||
var/turf/bombturf = get_turf(src)
|
||||
var/area/A = get_area(bombturf)
|
||||
var/notify_admins = 0
|
||||
if(z != 5)//Only annoy the admins ingame if we're triggered off the mining zlevel
|
||||
notify_admins = 1
|
||||
if(notify_admins)
|
||||
if(triggered_by_explosive)
|
||||
message_admins("An explosion has triggered a [name] to detonate at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>.")
|
||||
else
|
||||
message_admins("[key_name(usr)]<A HREF='?_src_=holder;adminmoreinfo=\ref[usr]'>?</A> has triggered a [name] to detonate at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>.")
|
||||
if(triggered_by_explosive)
|
||||
log_game("An explosion has primed a [name] for detonation at [A.name]([bombturf.x],[bombturf.y],[bombturf.z])")
|
||||
else
|
||||
user.visible_message("<span class='warning'>[user] strikes the [src], causing a chain reaction!</span>")
|
||||
log_game("[key_name(usr)] has primed a [name] for detonation at [A.name]([bombturf.x],[bombturf.y],[bombturf.z])")
|
||||
spawn(det_time)
|
||||
if(primed)
|
||||
switch(quality)
|
||||
if(1)
|
||||
explosion(src.loc,-1,1,3,adminlog = notify_admins)
|
||||
if(2)
|
||||
explosion(src.loc,1,2,5,adminlog = notify_admins)
|
||||
if(3)
|
||||
explosion(src.loc,2,4,9,adminlog = notify_admins)
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/ore/New()
|
||||
pixel_x = rand(0,16)-8
|
||||
pixel_y = rand(0,8)-8
|
||||
|
||||
/obj/item/weapon/ore/ex_act()
|
||||
return
|
||||
|
||||
/obj/item/weapon/ore/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/device/core_sampler))
|
||||
var/obj/item/device/core_sampler/C = W
|
||||
C.sample_item(src, user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/*****************************Coin********************************/
|
||||
|
||||
/obj/item/weapon/coin
|
||||
icon = 'icons/obj/items.dmi'
|
||||
name = "Coin"
|
||||
icon_state = "coin"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
force = 0.0
|
||||
throwforce = 0.0
|
||||
w_class = 1.0
|
||||
var/string_attached
|
||||
var/material="iron" // Ore ID, used with coinbags.
|
||||
var/credits = 0 // How many credits is this coin worth?
|
||||
|
||||
/obj/item/weapon/coin/New()
|
||||
pixel_x = rand(0,16)-8
|
||||
pixel_y = rand(0,8)-8
|
||||
|
||||
/obj/item/weapon/coin/gold
|
||||
name = "Gold coin"
|
||||
icon_state = "coin_gold"
|
||||
credits = 10
|
||||
|
||||
/obj/item/weapon/coin/silver
|
||||
name = "Silver coin"
|
||||
icon_state = "coin_silver"
|
||||
credits = 5
|
||||
|
||||
/obj/item/weapon/coin/diamond
|
||||
name = "Diamond coin"
|
||||
icon_state = "coin_diamond"
|
||||
credits = 25
|
||||
|
||||
/obj/item/weapon/coin/iron
|
||||
name = "Iron coin"
|
||||
icon_state = "coin_iron"
|
||||
credits = 1
|
||||
|
||||
/obj/item/weapon/coin/plasma
|
||||
name = "Solid plasma coin"
|
||||
icon_state = "coin_plasma"
|
||||
credits = 5
|
||||
|
||||
/obj/item/weapon/coin/uranium
|
||||
name = "Uranium coin"
|
||||
icon_state = "coin_uranium"
|
||||
credits = 25
|
||||
|
||||
/obj/item/weapon/coin/clown
|
||||
name = "Bananaium coin"
|
||||
icon_state = "coin_clown"
|
||||
credits = 1000
|
||||
|
||||
/obj/item/weapon/coin/adamantine
|
||||
name = "Adamantine coin"
|
||||
icon_state = "coin_adamantine"
|
||||
|
||||
/obj/item/weapon/coin/mythril
|
||||
name = "Mythril coin"
|
||||
icon_state = "coin_mythril"
|
||||
|
||||
/obj/item/weapon/coin/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/stack/cable_coil) )
|
||||
var/obj/item/stack/cable_coil/CC = W
|
||||
if(string_attached)
|
||||
user << "\blue There already is a string attached to this coin."
|
||||
return
|
||||
|
||||
if(CC.amount <= 0)
|
||||
user << "\blue This cable coil appears to be empty."
|
||||
del(CC)
|
||||
return
|
||||
|
||||
overlays += image('icons/obj/items.dmi',"coin_string_overlay")
|
||||
string_attached = 1
|
||||
user << "\blue You attach a string to the coin."
|
||||
CC.use(1)
|
||||
else if(istype(W,/obj/item/weapon/wirecutters) )
|
||||
if(!string_attached)
|
||||
..()
|
||||
return
|
||||
|
||||
var/obj/item/stack/cable_coil/CC = new/obj/item/stack/cable_coil(user.loc)
|
||||
CC.amount = 1
|
||||
// CC.updateicon()
|
||||
overlays = list()
|
||||
string_attached = null
|
||||
user << "\blue You detach the string from the coin."
|
||||
else ..()
|
||||
@@ -7,19 +7,6 @@
|
||||
name = "Ore Box"
|
||||
desc = "A heavy box used for storing ore."
|
||||
density = 1
|
||||
|
||||
/obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/ore))
|
||||
src.contents += W;
|
||||
if (istype(W, /obj/item/weapon/storage))
|
||||
var/obj/item/weapon/storage/S = W
|
||||
S.hide_from(usr)
|
||||
for(var/obj/item/weapon/ore/O in S.contents)
|
||||
S.remove_from_storage(O, src) //This will move the item to this item's contents
|
||||
user << "\blue You empty the satchel into the box."
|
||||
return
|
||||
|
||||
/obj/structure/ore_box/attack_hand(obj, mob/user as mob)
|
||||
var/amt_gold = 0
|
||||
var/amt_silver = 0
|
||||
var/amt_diamond = 0
|
||||
@@ -29,62 +16,142 @@
|
||||
var/amt_uranium = 0
|
||||
var/amt_clown = 0
|
||||
var/amt_strange = 0
|
||||
var/last_update = 0
|
||||
|
||||
|
||||
for (var/obj/item/weapon/ore/C in contents)
|
||||
if (istype(C,/obj/item/weapon/ore/diamond))
|
||||
amt_diamond++;
|
||||
if (istype(C,/obj/item/weapon/ore/glass))
|
||||
amt_glass++;
|
||||
if (istype(C,/obj/item/weapon/ore/plasma))
|
||||
amt_plasma++;
|
||||
if (istype(C,/obj/item/weapon/ore/iron))
|
||||
amt_iron++;
|
||||
if (istype(C,/obj/item/weapon/ore/silver))
|
||||
amt_silver++;
|
||||
if (istype(C,/obj/item/weapon/ore/gold))
|
||||
amt_gold++;
|
||||
if (istype(C,/obj/item/weapon/ore/uranium))
|
||||
amt_uranium++;
|
||||
if (istype(C,/obj/item/weapon/ore/clown))
|
||||
amt_clown++;
|
||||
if (istype(C,/obj/item/weapon/ore/strangerock))
|
||||
amt_strange++;
|
||||
|
||||
var/dat = text("<b>The contents of the ore box reveal...</b><br>")
|
||||
if (amt_gold)
|
||||
dat += text("Gold ore: [amt_gold]<br>")
|
||||
if (amt_silver)
|
||||
dat += text("Silver ore: [amt_silver]<br>")
|
||||
if (amt_iron)
|
||||
dat += text("Metal ore: [amt_iron]<br>")
|
||||
if (amt_glass)
|
||||
dat += text("Sand: [amt_glass]<br>")
|
||||
if (amt_diamond)
|
||||
dat += text("Diamond ore: [amt_diamond]<br>")
|
||||
if (amt_plasma)
|
||||
dat += text("Plasma ore: [amt_plasma]<br>")
|
||||
if (amt_uranium)
|
||||
dat += text("Uranium ore: [amt_uranium]<br>")
|
||||
if (amt_clown)
|
||||
dat += text("Bananium ore: [amt_clown]<br>")
|
||||
if (amt_strange)
|
||||
dat += text("Strange rocks: [amt_strange]<br>")
|
||||
|
||||
dat += text("<br><br><A href='?src=\ref[src];removeall=1'>Empty box</A>")
|
||||
user << browse("[dat]", "window=orebox")
|
||||
/obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/ore))
|
||||
user.u_equip(W)
|
||||
src.contents += W
|
||||
if (istype(W, /obj/item/weapon/storage))
|
||||
var/obj/item/weapon/storage/S = W
|
||||
S.hide_from(usr)
|
||||
for(var/obj/item/weapon/ore/O in S.contents)
|
||||
S.remove_from_storage(O, src) //This will move the item to this item's contents
|
||||
user << "\blue You empty the satchel into the box."
|
||||
return
|
||||
|
||||
/obj/structure/ore_box/Topic(href, href_list)
|
||||
if(..())
|
||||
/obj/structure/ore_box/examine()
|
||||
set name = "Examine"
|
||||
set category = "IC"
|
||||
set src in view(usr.client) //If it can be seen, it can be examined.
|
||||
|
||||
if (!( usr ))
|
||||
return
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["removeall"])
|
||||
for (var/obj/item/weapon/ore/O in contents)
|
||||
contents -= O
|
||||
O.loc = src.loc
|
||||
usr << "\blue You empty the box"
|
||||
src.updateUsrDialog()
|
||||
usr << "That's an [src]."
|
||||
usr << desc
|
||||
|
||||
if(!istype(usr, /mob/living/carbon/human)) //Only living, intelligent creatures with hands can check the contents of ore boxes.
|
||||
return
|
||||
|
||||
if(!Adjacent(usr)) //Can only check the contents of ore boxes if you can physically reach them.
|
||||
return
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
if(contents.len < 1)
|
||||
usr << "It is empty."
|
||||
return
|
||||
|
||||
if(world.time > last_update + 10)
|
||||
update_orecount()
|
||||
last_update = world.time
|
||||
|
||||
var/dat = text("<b>The contents of the ore box reveal...</b>")
|
||||
if (amt_iron)
|
||||
dat += text("<br>Metal ore: [amt_iron]")
|
||||
if (amt_glass)
|
||||
dat += text("<br>Sand: [amt_glass]")
|
||||
if (amt_plasma)
|
||||
dat += text("<br>Plasma ore: [amt_plasma]")
|
||||
if (amt_uranium)
|
||||
dat += text("<br>Uranium ore: [amt_uranium]")
|
||||
if (amt_silver)
|
||||
dat += text("<br>Silver ore: [amt_silver]")
|
||||
if (amt_gold)
|
||||
dat += text("<br>Gold ore: [amt_gold]")
|
||||
if (amt_diamond)
|
||||
dat += text("<br>Diamond ore: [amt_diamond]")
|
||||
if (amt_strange)
|
||||
dat += text("<br>Strange rocks: [amt_strange]")
|
||||
if (amt_clown)
|
||||
dat += text("<br>Bananium ore: [amt_clown]")
|
||||
|
||||
usr << dat
|
||||
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/ore_box/verb/empty_box()
|
||||
set name = "Empty Ore Box"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(!istype(usr, /mob/living/carbon/human)) //Only living, intelligent creatures with hands can empty ore boxes.
|
||||
usr << "\red You are physically incapable of emptying the ore box."
|
||||
return
|
||||
|
||||
if( usr.stat || usr.restrained() )
|
||||
return
|
||||
|
||||
if(!Adjacent(usr)) //You can only empty the box if you can physically reach it
|
||||
usr << "You cannot reach the ore box."
|
||||
return
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
if(contents.len < 1)
|
||||
usr << "\red The ore box is empty"
|
||||
return
|
||||
|
||||
for (var/obj/item/weapon/ore/O in contents)
|
||||
contents -= O
|
||||
O.loc = src.loc
|
||||
usr << "\blue You empty the ore box"
|
||||
|
||||
return
|
||||
|
||||
|
||||
// Updates ore tally
|
||||
/obj/structure/ore_box/proc/update_orecount()
|
||||
amt_iron = 0
|
||||
amt_glass = 0
|
||||
amt_plasma = 0
|
||||
amt_uranium = 0
|
||||
amt_silver = 0
|
||||
amt_gold = 0
|
||||
amt_diamond = 0
|
||||
amt_strange = 0
|
||||
amt_clown = 0
|
||||
|
||||
for(var/obj/item/weapon/ore/O in contents)
|
||||
if(!istype(O))
|
||||
continue
|
||||
|
||||
if (istype(O, /obj/item/weapon/ore/iron))
|
||||
amt_iron++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/glass))
|
||||
amt_glass++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/plasma))
|
||||
amt_plasma++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/uranium))
|
||||
amt_uranium++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/silver))
|
||||
amt_silver++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/gold))
|
||||
amt_gold++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/diamond))
|
||||
amt_diamond++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/strangerock))
|
||||
amt_strange++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/clown))
|
||||
amt_clown++
|
||||
continue
|
||||
return
|
||||
|
||||
@@ -84,7 +84,6 @@
|
||||
/obj/item/weapon/dice=3,
|
||||
/obj/item/weapon/staff=2,
|
||||
/obj/effect/decal/cleanable/dirt=3,
|
||||
/obj/item/weapon/coin/mythril=3
|
||||
)
|
||||
|
||||
flags = CONTIGUOUS_WALLS | CONTIGUOUS_FLOORS
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
brainmob.real_name = H.real_name
|
||||
brainmob.dna = H.dna
|
||||
brainmob.timeofhostdeath = H.timeofdeath
|
||||
brainmob.stat = 0
|
||||
if(brainmob.mind)
|
||||
brainmob.mind.assigned_role = "Positronic Brain"
|
||||
if(H.mind)
|
||||
|
||||
@@ -468,12 +468,17 @@
|
||||
return
|
||||
|
||||
// called when something steps onto a human
|
||||
// this could be made more general, but for now just handle mulebot
|
||||
// this handles mulebots and vehicles
|
||||
/mob/living/carbon/human/Crossed(var/atom/movable/AM)
|
||||
var/obj/machinery/bot/mulebot/MB = AM
|
||||
if(istype(MB))
|
||||
if(istype(AM, /obj/machinery/bot/mulebot))
|
||||
var/obj/machinery/bot/mulebot/MB = AM
|
||||
MB.RunOver(src)
|
||||
|
||||
if(istype(AM, /obj/vehicle))
|
||||
var/obj/vehicle/V = AM
|
||||
V.RunOver(src)
|
||||
|
||||
|
||||
//gets assignment from ID or ID inside PDA or PDA itself
|
||||
//Useful when player do something with computers
|
||||
/mob/living/carbon/human/proc/get_assignment(var/if_no_id = "No id", var/if_no_job = "No job")
|
||||
|
||||
@@ -33,6 +33,16 @@
|
||||
layer = MOB_LAYER
|
||||
src << text("\blue You have stopped hiding.")
|
||||
|
||||
/mob/living/silicon/robot/drone/verb/light()
|
||||
set name = "Light On/Off"
|
||||
set desc = "Activate a low power omnidirectional LED. Toggled on or off."
|
||||
set category = "Drone"
|
||||
|
||||
if(luminosity)
|
||||
SetLuminosity(0)
|
||||
return
|
||||
SetLuminosity(2)
|
||||
|
||||
//Actual picking-up event.
|
||||
/mob/living/silicon/robot/drone/attack_hand(mob/living/carbon/human/M as mob)
|
||||
|
||||
|
||||
@@ -615,9 +615,6 @@
|
||||
if(istype(WC))
|
||||
C.brute_damage = WC.brute
|
||||
C.electronics_damage = WC.burn
|
||||
else //This will nominally mean that removing and replacing a power cell will repair the mount, but I don't care at this point. ~Z
|
||||
C.brute_damage = 0
|
||||
C.electronics_damage = 0
|
||||
|
||||
usr << "\blue You install the [W.name]."
|
||||
|
||||
@@ -657,8 +654,12 @@
|
||||
user << "You close the cover."
|
||||
opened = 0
|
||||
updateicon()
|
||||
else if(mmi && wiresexposed && wires.IsAllCut())
|
||||
else if(wiresexposed && wires.IsAllCut())
|
||||
//Cell is out, wires are exposed, remove MMI, produce damaged chassis, baleet original mob.
|
||||
if(!mmi)
|
||||
user << "\The [src] has no brain to remove."
|
||||
return
|
||||
|
||||
user << "You jam the crowbar into the robot and begin levering [mmi]."
|
||||
if(do_after(user,3 SECONDS))
|
||||
user << "You damage some parts of the chassis, but eventually manage to rip out [mmi]!"
|
||||
@@ -721,6 +722,9 @@
|
||||
C.installed = 1
|
||||
C.wrapped = W
|
||||
C.install()
|
||||
//This will mean that removing and replacing a power cell will repair the mount, but I don't care at this point. ~Z
|
||||
C.brute_damage = 0
|
||||
C.electronics_damage = 0
|
||||
|
||||
else if (istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/device/multitool))
|
||||
if (wiresexposed)
|
||||
|
||||
@@ -201,6 +201,12 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/robot_module/butler/respawn_consumable(var/mob/living/silicon/robot/R)
|
||||
var/obj/item/weapon/reagent_containers/food/condiment/enzyme/E = locate() in src.modules
|
||||
E.reagents.add_reagent("enzyme", 2)
|
||||
if(src.emag)
|
||||
var/obj/item/weapon/reagent_containers/food/drinks/cans/beer/B = src.emag
|
||||
B.reagents.add_reagent("beer2", 2)
|
||||
|
||||
/obj/item/weapon/robot_module/miner
|
||||
name = "miner robot module"
|
||||
@@ -276,7 +282,6 @@
|
||||
)
|
||||
|
||||
New()
|
||||
src.modules += new /obj/item/device/flashlight/drone(src)
|
||||
src.modules += new /obj/item/weapon/weldingtool(src)
|
||||
src.modules += new /obj/item/weapon/screwdriver(src)
|
||||
src.modules += new /obj/item/weapon/wrench(src)
|
||||
|
||||
@@ -844,7 +844,7 @@ var/list/slot_equipment_priority = list( \
|
||||
stat(null, "PiNet-[master_controller.networks_cost]\t#[pipe_networks.len]")
|
||||
stat(null, "Ponet-[master_controller.powernets_cost]\t#[powernets.len]")
|
||||
stat(null, "NanoUI-[master_controller.nano_cost]\t#[nanomanager.processing_uis.len]")
|
||||
stat(null, "GC-[master_controller.gc_cost]\t#[garbage.queue.len]")
|
||||
// stat(null, "GC-[master_controller.gc_cost]\t#[garbage.queue.len]")
|
||||
stat(null, "Tick-[master_controller.ticker_cost]")
|
||||
stat(null, "ALL-[master_controller.total_cost]")
|
||||
else
|
||||
|
||||
@@ -207,6 +207,7 @@
|
||||
|
||||
if(!mob.canmove)
|
||||
if (mob.buckled && (istype(mob.buckled, /obj/structure/stool/bed/chair/wheelchair))) // Exception for wheelchairs
|
||||
else if (mob.buckled && (istype(mob.buckled, /obj/structure/stool/bed/chair/cart)))
|
||||
else return
|
||||
|
||||
//if(istype(mob.loc, /turf/space) || (mob.flags & NOGRAV))
|
||||
@@ -269,6 +270,8 @@
|
||||
return // No hands to drive your chair? Tough luck!
|
||||
move_delay += 2
|
||||
return mob.buckled.relaymove(mob,direct)
|
||||
else if(istype(mob.buckled, /obj/structure/stool/bed/chair/cart))
|
||||
return mob.buckled.relaymove(mob,direct)
|
||||
|
||||
//We are now going to move
|
||||
moving = 1
|
||||
|
||||
@@ -134,12 +134,12 @@
|
||||
. = O
|
||||
del(src)
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/human/make_into_mask(var/should_gib = 0)
|
||||
for(var/t in organs)
|
||||
del(t)
|
||||
return ..(should_gib)
|
||||
|
||||
|
||||
|
||||
/mob/proc/make_into_mask(var/should_gib = 0, var/should_remove_items = 0)
|
||||
|
||||
@@ -150,18 +150,18 @@
|
||||
if(!should_remove_items)
|
||||
for(var/obj/item/W in src)
|
||||
drop_from_inventory(W)
|
||||
|
||||
|
||||
var/mob/spirit/mask/new_spirit = new()
|
||||
|
||||
|
||||
if(mind)
|
||||
new_spirit.mind = mind
|
||||
new_spirit.mind.assigned_role = "Mask"
|
||||
new_spirit.mind.original = new_spirit
|
||||
|
||||
|
||||
new_spirit.key = key
|
||||
new_spirit.loc=loc
|
||||
|
||||
if (should_gib)
|
||||
|
||||
if (should_gib)
|
||||
spawn(0)
|
||||
src.gib() // gib the body
|
||||
else
|
||||
@@ -171,22 +171,22 @@
|
||||
"You disappear into the shadows, never to be seen again.", \
|
||||
"You hear strange noise, you can't quite place it.")
|
||||
del(src)
|
||||
|
||||
|
||||
new_spirit << "<font color=\"purple\"><b><i>You are a Mask of Nar'sie now. You are a tiny fragment of the unknowable entity that is the god.</b></i></font>"
|
||||
new_spirit << "<font color=\"purple\"><b><i>Your job is to help your acolytes complete their goals. Be spooky. Do evil.</b></i></font>"
|
||||
|
||||
|
||||
new_spirit.set_name()
|
||||
|
||||
|
||||
// let spirits identify cultists
|
||||
if(ticker.mode)
|
||||
ticker.mode.reset_cult_icons_for_spirit(new_spirit)
|
||||
|
||||
|
||||
// highlander test
|
||||
there_can_be_only_one_mask(new_spirit)
|
||||
|
||||
return new_spirit
|
||||
|
||||
|
||||
|
||||
|
||||
//human -> robot
|
||||
/mob/living/carbon/human/proc/Robotize()
|
||||
if (monkeyizing)
|
||||
@@ -212,12 +212,11 @@
|
||||
O.gender = gender
|
||||
O.invisibility = 0
|
||||
|
||||
|
||||
if(mind) //TODO
|
||||
mind.transfer_to(O)
|
||||
if(O.mind.assigned_role == "Cyborg")
|
||||
O.mind.original = O
|
||||
else if(mind.special_role)
|
||||
else if(mind && mind.special_role)
|
||||
O.mind.store_memory("In case you look at this after being borged, the objectives are only here until I find a way to make them not show up for you, as I can't simply delete them without screwing up round-end reporting. --NeoFite")
|
||||
else
|
||||
O.key = key
|
||||
@@ -229,11 +228,11 @@
|
||||
if(O.mind.role_alt_title == "Android")
|
||||
O.mmi = new /obj/item/device/mmi/posibrain(O)
|
||||
else if(O.mind.role_alt_title == "Robot")
|
||||
O.mmi = new /obj/item/device/mmi/posibrain(O) //Ravensdale wants a circuit based brain for another robot class, this is a placeholder.
|
||||
O.mmi = null //Robots do not have removable brains.
|
||||
else
|
||||
O.mmi = new /obj/item/device/mmi(O)
|
||||
O.mmi.transfer_identity(src)//Does not transfer key/client.
|
||||
|
||||
if(O.mmi) O.mmi.transfer_identity(src) //Does not transfer key/client.
|
||||
|
||||
callHook("borgify", list(O))
|
||||
|
||||
|
||||
@@ -616,11 +616,10 @@ This function completely restores a damaged organ to perfect condition.
|
||||
//Throw organs around
|
||||
var/lol = pick(cardinal)
|
||||
step(organ,lol)
|
||||
owner.regenerate_icons()
|
||||
return organ
|
||||
|
||||
// OK so maybe your limb just flew off, but if it was attached to a pair of cuffs then hooray! Freedom!
|
||||
release_restraints()
|
||||
owner.regenerate_icons()
|
||||
return organ
|
||||
|
||||
/****************************************************
|
||||
HELPERS
|
||||
|
||||
@@ -337,7 +337,7 @@ display round(lastgen) and plasmatank amount
|
||||
/obj/machinery/power/port_gen/pacman/mrs
|
||||
name = "M.R.S.P.A.C.M.A.N.-type Portable Generator"
|
||||
icon_state = "portgen2"
|
||||
sheet_path = /obj/item/stack/sheet/mineral/diamond
|
||||
sheet_path = /obj/item/stack/sheet/mineral/tritium
|
||||
power_gen = 40000
|
||||
time_per_sheet = 80
|
||||
board_path = "/obj/item/weapon/circuitboard/pacman/mrs"
|
||||
|
||||
@@ -22,7 +22,6 @@ Note: Must be placed west/left of and R&D console to function.
|
||||
var/uranium_amount = 0.0
|
||||
var/diamond_amount = 0.0
|
||||
var/clown_amount = 0.0
|
||||
var/adamantine_amount = 0.0
|
||||
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/New()
|
||||
@@ -111,9 +110,6 @@ Note: Must be placed west/left of and R&D console to function.
|
||||
if(clown_amount >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/clown/G = new /obj/item/stack/sheet/mineral/clown(src.loc)
|
||||
G.amount = round(clown_amount / G.perunit)
|
||||
if(adamantine_amount >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/adamantine/G = new /obj/item/stack/sheet/mineral/adamantine(src.loc)
|
||||
G.amount = round(adamantine_amount / G.perunit)
|
||||
del(src)
|
||||
return 1
|
||||
else
|
||||
@@ -182,8 +178,6 @@ Note: Must be placed west/left of and R&D console to function.
|
||||
diamond_amount += amount * 2000
|
||||
if(/obj/item/stack/sheet/mineral/clown)
|
||||
clown_amount += amount * 2000
|
||||
if(/obj/item/stack/sheet/mineral/adamantine)
|
||||
adamantine_amount += amount * 2000
|
||||
else
|
||||
new stacktype(src.loc, amount)
|
||||
busy = 0
|
||||
|
||||
@@ -225,7 +225,6 @@
|
||||
possible_spawns += /obj/item/stack/sheet/glass
|
||||
possible_spawns += /obj/item/stack/sheet/rglass
|
||||
possible_spawns += /obj/item/stack/sheet/mineral/plasma
|
||||
possible_spawns += /obj/item/stack/sheet/mineral/mythril
|
||||
possible_spawns += /obj/item/stack/sheet/mineral/gold
|
||||
possible_spawns += /obj/item/stack/sheet/mineral/silver
|
||||
possible_spawns += /obj/item/stack/sheet/mineral/enruranium
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/obj/machinery/computer/shuttle_control/engineering
|
||||
name = "engineering shuttle console"
|
||||
shuttle_tag = "Engineering"
|
||||
req_access = list(access_engine)
|
||||
req_one_access_txt = "11;24"
|
||||
circuit = "/obj/item/weapon/circuitboard/engineering_shuttle"
|
||||
|
||||
/obj/machinery/computer/shuttle_control/research
|
||||
|
||||
@@ -8,23 +8,16 @@
|
||||
var/global/list/shuttles
|
||||
|
||||
/datum/shuttle
|
||||
var/location = 0 //0 = at area_station, 1 = at area_offsite
|
||||
var/warmup_time = 0
|
||||
var/moving_status = SHUTTLE_IDLE //prevents people from doing things they shouldn't when the shuttle is in transit
|
||||
var/in_use = 0 //this mutex ensures that only one console can be doing things with the shuttle at a time.
|
||||
var/area_station
|
||||
var/area_offsite
|
||||
|
||||
var/docking_controller_tag //tag of the controller used to coordinate docking
|
||||
var/datum/computer/file/embedded_program/docking/docking_controller //the controller itself
|
||||
//TODO: change location to a string and use a mapping for area and dock targets.
|
||||
var/dock_target_station
|
||||
var/dock_target_offsite
|
||||
|
||||
|
||||
/datum/shuttle/proc/short_jump(var/datum/shuttle/shuttle,var/area/origin,var/area/destination)
|
||||
/datum/shuttle/proc/short_jump(var/area/origin,var/area/destination)
|
||||
if(moving_status != SHUTTLE_IDLE) return
|
||||
|
||||
//it would be cool to play a sound here
|
||||
moving_status = SHUTTLE_WARMUP
|
||||
spawn(warmup_time*10)
|
||||
if (moving_status == SHUTTLE_IDLE)
|
||||
@@ -33,11 +26,11 @@ var/global/list/shuttles
|
||||
move(origin, destination)
|
||||
moving_status = SHUTTLE_IDLE
|
||||
|
||||
/datum/shuttle/proc/long_jump(var/shuttle_tag,var/area/departing,var/area/destination,var/area/interim,var/travel_time)
|
||||
/datum/shuttle/proc/long_jump(var/area/departing,var/area/destination,var/area/interim,var/travel_time)
|
||||
if(moving_status != SHUTTLE_IDLE) return
|
||||
|
||||
//it would be cool to play a sound here
|
||||
moving_status = SHUTTLE_WARMUP
|
||||
|
||||
spawn(warmup_time*10)
|
||||
if (moving_status == SHUTTLE_IDLE)
|
||||
return //someone cancelled the launch
|
||||
@@ -68,40 +61,22 @@ var/global/list/shuttles
|
||||
docking_controller.initiate_undocking()
|
||||
|
||||
/datum/shuttle/proc/current_dock_target()
|
||||
var/dock_target
|
||||
if (!location) //station
|
||||
dock_target = dock_target_station
|
||||
else
|
||||
dock_target = dock_target_offsite
|
||||
return dock_target
|
||||
return null
|
||||
|
||||
/datum/shuttle/proc/skip_docking_checks()
|
||||
if (!docking_controller || !current_dock_target())
|
||||
return 1 //shuttles without docking controllers or at locations without docking ports act like old-style shuttles
|
||||
return 0
|
||||
|
||||
//just moves the shuttle from A to B, if it can be moved
|
||||
/datum/shuttle/proc/move(var/area/origin,var/area/destination)
|
||||
|
||||
//world << "move_shuttle() called for [shuttle_tag] leaving [origin] en route to [destination]."
|
||||
if(isnull(location))
|
||||
return
|
||||
|
||||
var/area/area_going_to
|
||||
if(destination)
|
||||
//world << "Using supplied destination [destination]."
|
||||
area_going_to = destination
|
||||
else
|
||||
//world << "Using controller value [(cur_location[shuttle_tag] == 1 ? areas_station[shuttle_tag] : areas_offsite[shuttle_tag])]."
|
||||
area_going_to = (location == 1 ? area_station : area_offsite)
|
||||
|
||||
var/area/area_coming_from
|
||||
if(origin)
|
||||
//world << "Using supplied origin [origin]."
|
||||
area_coming_from = origin
|
||||
else
|
||||
//world << "Using controller value [(cur_location[shuttle_tag] == 1 ? areas_offsite[shuttle_tag] : areas_station[shuttle_tag])]."
|
||||
area_coming_from = (location == 1 ? area_offsite : area_station)
|
||||
|
||||
//world << "area_coming_from: [area_coming_from]"
|
||||
//world << "area_going_to: [area_going_to]"
|
||||
//world << "destination: [destination]"
|
||||
|
||||
if(area_coming_from == area_going_to)
|
||||
if(origin == destination)
|
||||
//world << "cancelling move, shuttle will overlap."
|
||||
return
|
||||
|
||||
@@ -110,7 +85,7 @@ var/global/list/shuttles
|
||||
var/list/dstturfs = list()
|
||||
var/throwy = world.maxy
|
||||
|
||||
for(var/turf/T in area_going_to)
|
||||
for(var/turf/T in destination)
|
||||
dstturfs += T
|
||||
if(T.y < throwy)
|
||||
throwy = T.y
|
||||
@@ -122,17 +97,15 @@ var/global/list/shuttles
|
||||
if(istype(T, /turf/simulated))
|
||||
del(T)
|
||||
|
||||
for(var/mob/living/carbon/bug in area_going_to)
|
||||
for(var/mob/living/carbon/bug in destination)
|
||||
bug.gib()
|
||||
|
||||
for(var/mob/living/simple_animal/pest in area_going_to)
|
||||
for(var/mob/living/simple_animal/pest in destination)
|
||||
pest.gib()
|
||||
|
||||
area_coming_from.move_contents_to(area_going_to)
|
||||
origin.move_contents_to(destination)
|
||||
|
||||
location = !location //this needs to change.
|
||||
|
||||
for(var/mob/M in area_going_to)
|
||||
for(var/mob/M in destination)
|
||||
if(M.client)
|
||||
spawn(0)
|
||||
if(M.buckled)
|
||||
@@ -152,48 +125,62 @@ var/global/list/shuttles
|
||||
/proc/setup_shuttles()
|
||||
shuttles = list()
|
||||
|
||||
var/datum/shuttle/shuttle
|
||||
var/datum/shuttle/ferry/shuttle
|
||||
|
||||
//Supply and escape shuttles.
|
||||
shuttle = new/datum/shuttle()
|
||||
shuttle = new()
|
||||
shuttle.location = 1
|
||||
shuttle.area_offsite = locate(/area/supply/dock)
|
||||
shuttle.area_station = locate(/area/supply/station)
|
||||
shuttles["Supply"] = shuttle
|
||||
|
||||
// Admin shuttles.
|
||||
shuttle = new/datum/shuttle()
|
||||
shuttle = new()
|
||||
shuttle.location = 1
|
||||
shuttle.warmup_time = 10
|
||||
shuttle.area_offsite = locate(/area/shuttle/transport1/centcom)
|
||||
shuttle.area_station = locate(/area/shuttle/transport1/station)
|
||||
shuttle.docking_controller_tag = "centcom_shuttle"
|
||||
shuttle.dock_target_station = "centcom_shuttle_dock_airlock"
|
||||
shuttle.dock_target_offsite = "centcom_shuttle_bay"
|
||||
shuttles["Centcom"] = shuttle
|
||||
|
||||
shuttle = new/datum/shuttle()
|
||||
shuttle = new()
|
||||
shuttle.location = 1
|
||||
shuttle.warmup_time = 10 //want some warmup time so people can cancel.
|
||||
shuttle.area_offsite = locate(/area/shuttle/administration/centcom)
|
||||
shuttle.area_station = locate(/area/shuttle/administration/station)
|
||||
shuttle.docking_controller_tag = "admin_shuttle"
|
||||
shuttle.dock_target_station = "admin_shuttle_dock_airlock"
|
||||
shuttle.dock_target_offsite = "admin_shuttle_bay"
|
||||
shuttles["Administration"] = shuttle
|
||||
|
||||
shuttle = new/datum/shuttle()
|
||||
shuttle = new()
|
||||
shuttle.area_offsite = locate(/area/shuttle/alien/base)
|
||||
shuttle.area_station = locate(/area/shuttle/alien/mine)
|
||||
shuttles["Alien"] = shuttle
|
||||
|
||||
// Public shuttles
|
||||
shuttle = new/datum/shuttle()
|
||||
shuttle = new()
|
||||
shuttle.location = 1
|
||||
shuttle.warmup_time = 10
|
||||
shuttle.area_offsite = locate(/area/shuttle/constructionsite/site)
|
||||
shuttle.area_station = locate(/area/shuttle/constructionsite/station)
|
||||
shuttle.docking_controller_tag = "engineering_shuttle"
|
||||
shuttle.dock_target_station = "engineering_dock_airlock"
|
||||
shuttle.dock_target_offsite = "engineering_station_airlock"
|
||||
shuttles["Engineering"] = shuttle
|
||||
|
||||
shuttle = new/datum/shuttle()
|
||||
shuttle = new()
|
||||
shuttle.warmup_time = 10
|
||||
shuttle.area_offsite = locate(/area/shuttle/mining/outpost)
|
||||
shuttle.area_station = locate(/area/shuttle/mining/station)
|
||||
shuttle.docking_controller_tag = "mining_shuttle"
|
||||
shuttle.dock_target_station = "mining_dock_airlock"
|
||||
shuttle.dock_target_offsite = "mining_outpost_airlock"
|
||||
shuttles["Mining"] = shuttle
|
||||
|
||||
shuttle = new/datum/shuttle()
|
||||
shuttle = new()
|
||||
shuttle.warmup_time = 10
|
||||
shuttle.area_offsite = locate(/area/shuttle/research/outpost)
|
||||
shuttle.area_station = locate(/area/shuttle/research/station)
|
||||
@@ -202,6 +189,19 @@ var/global/list/shuttles
|
||||
shuttle.dock_target_offsite = "research_outpost_dock"
|
||||
shuttles["Research"] = shuttle
|
||||
|
||||
// ERT Shuttle
|
||||
var/datum/shuttle/ferry/multidock/specops/ERT = new()
|
||||
ERT.location = 0
|
||||
ERT.warmup_time = 10
|
||||
ERT.area_offsite = locate(/area/shuttle/specops/station) //centcom is the home station, the Exodus is offsite
|
||||
ERT.area_station = locate(/area/shuttle/specops/centcom)
|
||||
ERT.docking_controller_tag = "specops_shuttle_port"
|
||||
ERT.docking_controller_tag_station = "specops_shuttle_port"
|
||||
ERT.docking_controller_tag_offsite = "specops_shuttle_fore"
|
||||
ERT.dock_target_station = "specops_centcom_dock"
|
||||
ERT.dock_target_offsite = "specops_dock_airlock"
|
||||
shuttles["Special Operations"] = ERT
|
||||
|
||||
//Vox Shuttle.
|
||||
var/datum/shuttle/multi_shuttle/VS = new/datum/shuttle/multi_shuttle()
|
||||
VS.origin = /area/shuttle/vox/station
|
||||
@@ -215,7 +215,6 @@ var/global/list/shuttles
|
||||
VS.departure_message = "Your guests are pulling away, Exodus - moving too fast for us to draw a bead on them. Looks like they're heading out of the system at a rapid clip."
|
||||
VS.interim = /area/vox_station/transit
|
||||
|
||||
VS.location = 1
|
||||
VS.warmup_time = 10
|
||||
shuttles["Vox Skipjack"] = VS
|
||||
|
||||
@@ -239,32 +238,51 @@ var/global/list/shuttles
|
||||
MS.departure_message = "Your visitors are on their way out of the system, Exodus, burning delta-v like it's nothing. Good riddance."
|
||||
MS.interim = /area/syndicate_station/transit
|
||||
|
||||
MS.location = 1
|
||||
MS.warmup_time = 10
|
||||
shuttles["Syndicate"] = MS
|
||||
|
||||
|
||||
/proc/setup_shuttle_docks()
|
||||
var/datum/shuttle/shuttle
|
||||
var/datum/shuttle/ferry/multidock/multidock
|
||||
var/list/dock_controller_map = list() //so we only have to iterate once through each list
|
||||
|
||||
//multidock shuttles
|
||||
var/list/dock_controller_map_station = list()
|
||||
var/list/dock_controller_map_offsite = list()
|
||||
|
||||
for (var/shuttle_tag in shuttles)
|
||||
shuttle = shuttles[shuttle_tag]
|
||||
if (shuttle.docking_controller_tag)
|
||||
dock_controller_map[shuttle.docking_controller_tag] = shuttle
|
||||
if (istype(shuttle, /datum/shuttle/ferry/multidock))
|
||||
multidock = shuttle
|
||||
dock_controller_map_station[multidock.docking_controller_tag_station] = multidock
|
||||
dock_controller_map_offsite[multidock.docking_controller_tag_offsite] = multidock
|
||||
|
||||
//search for the controllers, if we have one.
|
||||
if (dock_controller_map.len)
|
||||
for (var/obj/machinery/embedded_controller/radio/C in machines) //only radio controllers are supported at the moment
|
||||
if (istype(C.program, /datum/computer/file/embedded_program/docking) && C.id_tag in dock_controller_map)
|
||||
shuttle = dock_controller_map[C.id_tag]
|
||||
shuttle.docking_controller = C.program
|
||||
dock_controller_map -= C.id_tag
|
||||
if (istype(C.program, /datum/computer/file/embedded_program/docking))
|
||||
if (C.id_tag in dock_controller_map)
|
||||
shuttle = dock_controller_map[C.id_tag]
|
||||
shuttle.docking_controller = C.program
|
||||
dock_controller_map -= C.id_tag
|
||||
if (C.id_tag in dock_controller_map_station)
|
||||
multidock = dock_controller_map_station[C.id_tag]
|
||||
if (istype(multidock))
|
||||
multidock.docking_controller_station = C.program
|
||||
dock_controller_map_station -= C.id_tag
|
||||
if (C.id_tag in dock_controller_map_offsite)
|
||||
multidock = dock_controller_map_offsite[C.id_tag]
|
||||
if (istype(multidock))
|
||||
multidock.docking_controller_offsite = C.program
|
||||
dock_controller_map_offsite -= C.id_tag
|
||||
|
||||
//sanity check
|
||||
if (dock_controller_map.len)
|
||||
if (dock_controller_map.len || dock_controller_map_station.len || dock_controller_map_offsite.len)
|
||||
var/dat = ""
|
||||
for (var/dock_tag in dock_controller_map)
|
||||
for (var/dock_tag in dock_controller_map + dock_controller_map_station + dock_controller_map_offsite)
|
||||
dat += "\"[dock_tag]\", "
|
||||
world << "/red /b warning: shuttles with docking tags [dat] could not find their controllers!"
|
||||
|
||||
|
||||
@@ -4,12 +4,133 @@
|
||||
#define WAIT_FINISH 3
|
||||
|
||||
|
||||
/*
|
||||
I dont really like how much this manipulates shuttle it's docking controller, as it makes this code
|
||||
depend a lot on their current implementation, and also having var/datum/shuttle/shuttle = shuttles[shuttle_tag]
|
||||
everywhere is kind of messy. I'm probably going to end up creating a subtype of shuttle called ferry_shuttle
|
||||
and move a lot of this into there when I get the time.
|
||||
*/
|
||||
/datum/shuttle/ferry
|
||||
var/location = 0 //0 = at area_station, 1 = at area_offsite
|
||||
var/process_state = IDLE_STATE
|
||||
|
||||
//this mutex ensures that only one console is processing the shuttle's controls at a time
|
||||
var/obj/machinery/computer/shuttle_control/in_use = null
|
||||
|
||||
var/area_station
|
||||
var/area_offsite
|
||||
//TODO: change location to a string and use a mapping for area and dock targets.
|
||||
var/dock_target_station
|
||||
var/dock_target_offsite
|
||||
|
||||
/datum/shuttle/ferry/short_jump(var/area/origin,var/area/destination)
|
||||
if(isnull(location))
|
||||
return
|
||||
|
||||
if(!destination)
|
||||
destination = (location == 1 ? area_station : area_offsite)
|
||||
if(!origin)
|
||||
origin = (location == 1 ? area_offsite : area_station)
|
||||
|
||||
..(origin, destination)
|
||||
|
||||
/datum/shuttle/ferry/long_jump(var/area/departing,var/area/destination,var/area/interim,var/travel_time)
|
||||
if(isnull(location))
|
||||
return
|
||||
|
||||
if(!destination)
|
||||
destination = (location == 1 ? area_station : area_offsite)
|
||||
if(!departing)
|
||||
departing = (location == 1 ? area_offsite : area_station)
|
||||
|
||||
..(departing, destination, interim, travel_time)
|
||||
|
||||
/datum/shuttle/ferry/move(var/area/origin,var/area/destination)
|
||||
if(!destination)
|
||||
destination = (location == 1 ? area_station : area_offsite)
|
||||
if(!origin)
|
||||
origin = (location == 1 ? area_offsite : area_station)
|
||||
|
||||
if (docking_controller && !docking_controller.undocked())
|
||||
docking_controller.force_undock()
|
||||
..(origin, destination)
|
||||
location = !location
|
||||
|
||||
/datum/shuttle/ferry/proc/process_shuttle()
|
||||
switch(process_state)
|
||||
if (WAIT_LAUNCH)
|
||||
if (skip_docking_checks() || docking_controller.can_launch())
|
||||
|
||||
//once you have a transition area, making ferry shuttles have a transition would merely requre replacing this with
|
||||
//if (transition_area) long_jump(...)
|
||||
//else short_jump ()
|
||||
short_jump()
|
||||
|
||||
process_state = WAIT_ARRIVE
|
||||
if (WAIT_ARRIVE)
|
||||
if (moving_status == SHUTTLE_IDLE)
|
||||
dock()
|
||||
process_state = WAIT_FINISH
|
||||
if (WAIT_FINISH)
|
||||
if (skip_docking_checks() || docking_controller.docked())
|
||||
process_state = IDLE_STATE
|
||||
in_use = null //release lock
|
||||
|
||||
/datum/shuttle/ferry/current_dock_target()
|
||||
var/dock_target
|
||||
if (!location) //station
|
||||
dock_target = dock_target_station
|
||||
else
|
||||
dock_target = dock_target_offsite
|
||||
return dock_target
|
||||
|
||||
|
||||
/datum/shuttle/ferry/proc/launch(var/obj/machinery/computer/shuttle_control/user)
|
||||
if (!can_launch()) return
|
||||
|
||||
in_use = user //obtain an exclusive lock on the shuttle
|
||||
|
||||
process_state = WAIT_LAUNCH
|
||||
undock()
|
||||
|
||||
/datum/shuttle/ferry/proc/force_launch(var/obj/machinery/computer/shuttle_control/user)
|
||||
if (!can_force()) return
|
||||
|
||||
in_use = user //obtain an exclusive lock on the shuttle
|
||||
|
||||
short_jump()
|
||||
|
||||
process_state = WAIT_ARRIVE
|
||||
|
||||
/datum/shuttle/ferry/proc/cancel_launch(var/obj/machinery/computer/shuttle_control/user)
|
||||
if (!can_cancel()) return
|
||||
|
||||
moving_status = SHUTTLE_IDLE
|
||||
process_state = WAIT_FINISH
|
||||
|
||||
if (docking_controller && !docking_controller.undocked())
|
||||
docking_controller.force_undock()
|
||||
|
||||
spawn(10)
|
||||
dock()
|
||||
|
||||
return
|
||||
|
||||
/datum/shuttle/ferry/proc/can_launch()
|
||||
if (moving_status != SHUTTLE_IDLE)
|
||||
return 0
|
||||
|
||||
if (in_use)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
/datum/shuttle/ferry/proc/can_force()
|
||||
if (moving_status == SHUTTLE_IDLE && process_state == WAIT_LAUNCH)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/shuttle/ferry/proc/can_cancel()
|
||||
if (moving_status == SHUTTLE_WARMUP || process_state == WAIT_LAUNCH)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer/shuttle_control
|
||||
name = "shuttle control console"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
@@ -19,107 +140,29 @@
|
||||
|
||||
var/shuttle_tag // Used to coordinate data in shuttle controller.
|
||||
var/hacked = 0 // Has been emagged, no access restrictions.
|
||||
|
||||
var/process_state = IDLE_STATE
|
||||
var/launch_override = 0
|
||||
|
||||
/obj/machinery/computer/shuttle_control/proc/launch_shuttle()
|
||||
if (!can_launch()) return
|
||||
|
||||
var/datum/shuttle/shuttle = shuttles[shuttle_tag]
|
||||
|
||||
shuttle.in_use = 1 //obtain an exclusive lock on the shuttle
|
||||
|
||||
process_state = WAIT_LAUNCH
|
||||
shuttle.undock()
|
||||
|
||||
/obj/machinery/computer/shuttle_control/proc/cancel_launch()
|
||||
if (!can_cancel()) return
|
||||
|
||||
var/datum/shuttle/shuttle = shuttles[shuttle_tag]
|
||||
|
||||
shuttle.moving_status = SHUTTLE_IDLE
|
||||
process_state = WAIT_FINISH
|
||||
|
||||
if (shuttle.docking_controller && !shuttle.docking_controller.undocked())
|
||||
shuttle.docking_controller.force_undock()
|
||||
shuttle.dock()
|
||||
|
||||
shuttle.in_use = 0
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/computer/shuttle_control/proc/toggle_override()
|
||||
if (!can_override()) return
|
||||
|
||||
var/datum/shuttle/shuttle = shuttles[shuttle_tag]
|
||||
|
||||
if (shuttle.docking_controller.override_enabled)
|
||||
shuttle.docking_controller.disable_override()
|
||||
else
|
||||
shuttle.docking_controller.enable_override()
|
||||
|
||||
/obj/machinery/computer/shuttle_control/proc/can_launch()
|
||||
var/datum/shuttle/shuttle = shuttles[shuttle_tag]
|
||||
|
||||
if (shuttle.moving_status != SHUTTLE_IDLE)
|
||||
return 0
|
||||
|
||||
if (shuttle.in_use && !skip_checks())
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/shuttle_control/proc/can_cancel()
|
||||
var/datum/shuttle/shuttle = shuttles[shuttle_tag]
|
||||
|
||||
if (shuttle.moving_status == SHUTTLE_WARMUP || process_state == WAIT_LAUNCH)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/computer/shuttle_control/proc/can_override()
|
||||
var/datum/shuttle/shuttle = shuttles[shuttle_tag]
|
||||
|
||||
if (shuttle.docking_controller && (!shuttle.docking_controller.override_enabled || !shuttle.in_use))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//TODO move this stuff into the shuttle datum itself, instead of manipulating the shuttle's members
|
||||
/obj/machinery/computer/shuttle_control/process()
|
||||
if (!shuttles || !(shuttle_tag in shuttles))
|
||||
return
|
||||
|
||||
var/datum/shuttle/shuttle = shuttles[shuttle_tag]
|
||||
|
||||
switch(process_state)
|
||||
if (WAIT_LAUNCH)
|
||||
if (skip_checks() || shuttle.docking_controller.can_launch())
|
||||
shuttle.short_jump()
|
||||
if (shuttle.docking_controller && !shuttle.docking_controller.undocked())
|
||||
shuttle.docking_controller.force_undock()
|
||||
process_state = WAIT_ARRIVE
|
||||
if (WAIT_ARRIVE)
|
||||
if (shuttle.moving_status == SHUTTLE_IDLE)
|
||||
shuttle.dock()
|
||||
process_state = WAIT_FINISH
|
||||
if (WAIT_FINISH)
|
||||
if (skip_checks() || shuttle.docking_controller.docked())
|
||||
process_state = IDLE_STATE
|
||||
shuttle.in_use = 0 //release lock
|
||||
|
||||
/obj/machinery/computer/shuttle_control/proc/skip_checks()
|
||||
var/datum/shuttle/shuttle = shuttles[shuttle_tag]
|
||||
|
||||
if (!shuttle.docking_controller || !shuttle.current_dock_target())
|
||||
return 1 //shuttles without docking controllers or at locations without docking ports act like old-style shuttles
|
||||
|
||||
return shuttle.docking_controller.override_enabled //override pretty much lets you do whatever you want
|
||||
|
||||
|
||||
var/datum/shuttle/ferry/shuttle = shuttles[shuttle_tag]
|
||||
if (!istype(shuttle))
|
||||
return
|
||||
|
||||
if (shuttle.in_use == src)
|
||||
shuttle.process_shuttle()
|
||||
|
||||
/obj/machinery/computer/shuttle_control/Del()
|
||||
var/datum/shuttle/shuttle = shuttles[shuttle_tag]
|
||||
var/datum/shuttle/ferry/shuttle = shuttles[shuttle_tag]
|
||||
if (!istype(shuttle))
|
||||
return
|
||||
|
||||
if (process_state != IDLE_STATE)
|
||||
shuttle.in_use = 0 //shuttle may not dock properly if this gets deleted while in transit, but its not a big deal
|
||||
if (shuttle.in_use == src)
|
||||
shuttle.in_use = null //shuttle may not dock properly if this gets deleted while in transit, but its not a big deal
|
||||
|
||||
/obj/machinery/computer/shuttle_control/attack_hand(user as mob)
|
||||
if(..(user))
|
||||
@@ -130,7 +173,9 @@
|
||||
|
||||
/obj/machinery/computer/shuttle_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
var/data[0]
|
||||
var/datum/shuttle/shuttle = shuttles[shuttle_tag]
|
||||
var/datum/shuttle/ferry/shuttle = shuttles[shuttle_tag]
|
||||
if (!istype(shuttle))
|
||||
return
|
||||
|
||||
var/shuttle_state
|
||||
switch(shuttle.moving_status)
|
||||
@@ -139,7 +184,7 @@
|
||||
if(SHUTTLE_INTRANSIT) shuttle_state = "in_transit"
|
||||
|
||||
var/shuttle_status
|
||||
switch (process_state)
|
||||
switch (shuttle.process_state)
|
||||
if(IDLE_STATE)
|
||||
if (shuttle.in_use)
|
||||
shuttle_status = "Busy."
|
||||
@@ -159,10 +204,10 @@
|
||||
"shuttle_state" = shuttle_state,
|
||||
"has_docking" = shuttle.docking_controller? 1 : 0,
|
||||
"docking_status" = shuttle.docking_controller? shuttle.docking_controller.get_docking_status() : null,
|
||||
"override_enabled" = shuttle.docking_controller? shuttle.docking_controller.override_enabled : null,
|
||||
"can_launch" = can_launch(),
|
||||
"can_cancel" = can_cancel(),
|
||||
"can_override" = can_override(),
|
||||
"docking_override" = shuttle.docking_controller? shuttle.docking_controller.override_enabled : null,
|
||||
"can_launch" = shuttle.can_launch(),
|
||||
"can_cancel" = shuttle.can_cancel(),
|
||||
"can_force" = shuttle.can_force(),
|
||||
)
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
@@ -181,13 +226,16 @@
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
var/datum/shuttle/ferry/shuttle = shuttles[shuttle_tag]
|
||||
if (!istype(shuttle))
|
||||
return
|
||||
|
||||
if(href_list["move"])
|
||||
launch_shuttle()
|
||||
shuttle.launch(src)
|
||||
if(href_list["force"])
|
||||
shuttle.force_launch(src)
|
||||
else if(href_list["cancel"])
|
||||
cancel_launch()
|
||||
else if(href_list["override"])
|
||||
toggle_override()
|
||||
shuttle.cancel_launch()
|
||||
|
||||
|
||||
/obj/machinery/computer/shuttle_control/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
/obj/machinery/computer/shuttle_control/specops
|
||||
name = "special operations shuttle console"
|
||||
shuttle_tag = "Special Operations"
|
||||
req_access = list(access_cent_specops)
|
||||
|
||||
//for shuttles that may use a different docking port at each location
|
||||
/datum/shuttle/ferry/multidock
|
||||
var/docking_controller_tag_station
|
||||
var/docking_controller_tag_offsite
|
||||
var/datum/computer/file/embedded_program/docking/docking_controller_station
|
||||
var/datum/computer/file/embedded_program/docking/docking_controller_offsite
|
||||
|
||||
/datum/shuttle/ferry/multidock/move(var/area/origin,var/area/destination)
|
||||
..(origin, destination)
|
||||
if (!location)
|
||||
docking_controller = docking_controller_station
|
||||
else
|
||||
docking_controller = docking_controller_offsite
|
||||
|
||||
/datum/shuttle/ferry/multidock/specops
|
||||
var/specops_return_delay = 6000 //After moving, the amount of time that must pass before the shuttle may move again
|
||||
var/specops_countdown_time = 600 //Length of the countdown when moving the shuttle
|
||||
|
||||
var/obj/item/device/radio/intercom/announcer = null
|
||||
var/reset_time = 0 //the world.time at which the shuttle will be ready to move again.
|
||||
var/launch_prep = 0
|
||||
var/cancel_countdown = 0
|
||||
|
||||
/datum/shuttle/ferry/multidock/specops/New()
|
||||
..()
|
||||
announcer = new /obj/item/device/radio/intercom(null)//We need a fake AI to announce some stuff below. Otherwise it will be wonky.
|
||||
announcer.config(list("Response Team" = 0))
|
||||
|
||||
/datum/shuttle/ferry/multidock/specops/proc/radio_announce(var/message)
|
||||
if(announcer)
|
||||
announcer.autosay(message, "A.L.I.C.E.", "Response Team")
|
||||
|
||||
/datum/shuttle/ferry/multidock/specops/launch(var/obj/machinery/computer/shuttle_control/user)
|
||||
if (!can_launch())
|
||||
return
|
||||
|
||||
if(world.time <= reset_time)
|
||||
user.visible_message("\blue Central Command will not allow the Special Operations shuttle to launch yet.")
|
||||
if (((world.time - reset_time)/10) > 60)
|
||||
user.visible_message("\blue [-((world.time - reset_time)/10)/60] minutes remain!")
|
||||
else
|
||||
user.visible_message("\blue [-(world.time - reset_time)/10] seconds remain!")
|
||||
return
|
||||
|
||||
user.visible_message("\blue The Special Operations shuttle will depart in [(specops_countdown_time/10)] seconds.")
|
||||
|
||||
if (location) //returning
|
||||
radio_announce("THE SPECIAL OPERATIONS SHUTTLE IS PREPARING TO RETURN")
|
||||
else
|
||||
radio_announce("THE SPECIAL OPERATIONS SHUTTLE IS PREPARING FOR LAUNCH")
|
||||
|
||||
sleep_until_launch()
|
||||
if (cancel_countdown)
|
||||
radio_announce("ALERT: LAUNCH SEQUENCE ABORTED")
|
||||
user.visible_message("\red Launch sequence aborted.")
|
||||
return
|
||||
|
||||
//launch
|
||||
radio_announce("ALERT: INITIATING LAUNCH SEQUENCE")
|
||||
..(user)
|
||||
|
||||
/datum/shuttle/ferry/multidock/specops/move(var/area/origin,var/area/destination)
|
||||
..(origin, destination)
|
||||
if (!location) //just arrived home
|
||||
for(var/turf/T in get_area_turfs(destination))
|
||||
var/mob/M = locate(/mob) in T
|
||||
M << "\red You have arrived at Central Command. Operation has ended!"
|
||||
else //just left for the station
|
||||
launch_mauraders()
|
||||
for(var/turf/T in get_area_turfs(destination))
|
||||
var/mob/M = locate(/mob) in T
|
||||
M << "\red You have arrived at [station_name]. Commence operation!"
|
||||
|
||||
reset_time = world.time + specops_return_delay //set the timeout
|
||||
|
||||
/datum/shuttle/ferry/multidock/specops/cancel_launch()
|
||||
..()
|
||||
cancel_countdown = 1
|
||||
|
||||
|
||||
/datum/shuttle/ferry/multidock/specops/can_launch()
|
||||
if(launch_prep)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
//should be fine to allow forcing. process_state only becomes WAIT_LAUNCH after the countdown is over.
|
||||
///datum/shuttle/ferry/multidock/specops/can_force()
|
||||
// return 0
|
||||
|
||||
/datum/shuttle/ferry/multidock/specops/can_cancel()
|
||||
if(launch_prep)
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/datum/shuttle/ferry/multidock/specops/proc/sleep_until_launch()
|
||||
var/message_tracker[] = list(0,1,2,3,5,10,30,45)//Create a a list with potential time values.
|
||||
|
||||
var/launch_time = world.time + specops_countdown_time
|
||||
var/time_until_launch
|
||||
|
||||
cancel_countdown = 0
|
||||
launch_prep = 1
|
||||
while(!cancel_countdown && (launch_time - world.time) > 0)
|
||||
var/ticksleft = launch_time - world.time
|
||||
|
||||
//if(ticksleft > 1e5)
|
||||
// launch_time = world.timeofday + 10 // midnight rollover
|
||||
time_until_launch = (ticksleft / 10)
|
||||
|
||||
//All this does is announce the time before launch.
|
||||
var/rounded_time_left = round(time_until_launch)//Round time so that it will report only once, not in fractions.
|
||||
if(rounded_time_left in message_tracker)//If that time is in the list for message announce.
|
||||
radio_announce("ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN")
|
||||
message_tracker -= rounded_time_left//Remove the number from the list so it won't be called again next cycle.
|
||||
//Should call all the numbers but lag could mean some issues. Oh well. Not much I can do about that.
|
||||
|
||||
sleep(5)
|
||||
launch_prep = 0
|
||||
|
||||
|
||||
/proc/launch_mauraders()
|
||||
var/area/centcom/specops/special_ops = locate()//Where is the specops area located?
|
||||
//Begin Marauder launchpad.
|
||||
spawn(0)//So it parallel processes it.
|
||||
for(var/obj/machinery/door/poddoor/M in special_ops)
|
||||
switch(M.id)
|
||||
if("ASSAULT0")
|
||||
spawn(10)//1 second delay between each.
|
||||
M.open()
|
||||
if("ASSAULT1")
|
||||
spawn(20)
|
||||
M.open()
|
||||
if("ASSAULT2")
|
||||
spawn(30)
|
||||
M.open()
|
||||
if("ASSAULT3")
|
||||
spawn(40)
|
||||
M.open()
|
||||
|
||||
sleep(10)
|
||||
|
||||
var/spawn_marauder[] = new()
|
||||
for(var/obj/effect/landmark/L in world)
|
||||
if(L.name == "Marauder Entry")
|
||||
spawn_marauder.Add(L)
|
||||
for(var/obj/effect/landmark/L in world)
|
||||
if(L.name == "Marauder Exit")
|
||||
var/obj/effect/portal/P = new(L.loc)
|
||||
P.invisibility = 101//So it is not seen by anyone.
|
||||
P.failchance = 0//So it has no fail chance when teleporting.
|
||||
P.target = pick(spawn_marauder)//Where the marauder will arrive.
|
||||
spawn_marauder.Remove(P.target)
|
||||
|
||||
sleep(10)
|
||||
|
||||
for(var/obj/machinery/mass_driver/M in special_ops)
|
||||
switch(M.id)
|
||||
if("ASSAULT0")
|
||||
spawn(10)
|
||||
M.drive()
|
||||
if("ASSAULT1")
|
||||
spawn(20)
|
||||
M.drive()
|
||||
if("ASSAULT2")
|
||||
spawn(30)
|
||||
M.drive()
|
||||
if("ASSAULT3")
|
||||
spawn(40)
|
||||
M.drive()
|
||||
|
||||
sleep(50)//Doors remain open for 5 seconds.
|
||||
|
||||
for(var/obj/machinery/door/poddoor/M in special_ops)
|
||||
switch(M.id)//Doors close at the same time.
|
||||
if("ASSAULT0")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT1")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT2")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT3")
|
||||
spawn(0)
|
||||
M.close()
|
||||
special_ops.readyreset()//Reset firealarm after the team launched.
|
||||
//End Marauder launchpad.
|
||||
@@ -0,0 +1,277 @@
|
||||
/obj/vehicle/train/cargo/engine
|
||||
name = "cargo train tug"
|
||||
icon = 'icons/obj/aibots.dmi'
|
||||
icon_state = "mulebot1" //mulebot icons until I get some proper icons
|
||||
on = 1
|
||||
powered = 1
|
||||
locked = 0
|
||||
|
||||
load_item_visible = 1
|
||||
load_offset_x = 0
|
||||
load_offset_y = 9
|
||||
|
||||
var/car_limit = 3 //how many cars an engine can pull before performance degrades
|
||||
var/lead_engine = 1 //if the engine is the lead engine - set automatically
|
||||
active_engines = 1
|
||||
|
||||
/obj/vehicle/train/cargo/trolley
|
||||
name = "cargo train trolley"
|
||||
icon = 'icons/obj/aibots.dmi'
|
||||
icon_state = "mulebot0"
|
||||
anchored = 0
|
||||
passenger_allowed = 0
|
||||
locked = 0
|
||||
|
||||
load_item_visible = 1
|
||||
load_offset_x = 0
|
||||
load_offset_y = 9
|
||||
|
||||
//-------------------------------------------
|
||||
// Standard procs
|
||||
//-------------------------------------------
|
||||
/obj/vehicle/train/cargo/engine/New()
|
||||
..()
|
||||
cell = new /obj/item/weapon/cell/high
|
||||
verbs -= /atom/movable/verb/pull
|
||||
|
||||
/obj/vehicle/train/cargo/engine/initialize()
|
||||
..()
|
||||
|
||||
/obj/vehicle/train/cargo/engine/Move()
|
||||
if(on && cell.charge < power_use)
|
||||
turn_off()
|
||||
update_stats()
|
||||
if(load && lead_engine)
|
||||
load << "The drive motor briefly whines, then crawls to a stop."
|
||||
if(lead_engine && !on)
|
||||
return 0
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/train/cargo/trolley/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(open && istype(W, /obj/item/weapon/wirecutters))
|
||||
passenger_allowed = !passenger_allowed
|
||||
user.visible_message("<span class='notice'>[user] [passenger_allowed ? "cuts" : "mends"] a cable in [src].</span>","<span class='notice'>You [passenger_allowed ? "cut" : "mend"] the load limiter cable.</span>")
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/vehicle/train/cargo/update_icon()
|
||||
if(open)
|
||||
icon_state = "mulebot-hatch"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/vehicle/train/cargo/engine/Emag(mob/user as mob)
|
||||
..()
|
||||
flick("mulebot-emagged", src)
|
||||
|
||||
/obj/vehicle/train/cargo/trolley/insert_cell(var/obj/item/weapon/cell/C, var/mob/living/carbon/human/H)
|
||||
return
|
||||
|
||||
/obj/vehicle/train/cargo/engine/insert_cell(var/obj/item/weapon/cell/C, var/mob/living/carbon/human/H)
|
||||
..()
|
||||
update_stats()
|
||||
|
||||
/obj/vehicle/train/cargo/engine/remove_cell(var/mob/living/carbon/human/H)
|
||||
..()
|
||||
update_stats()
|
||||
|
||||
/obj/vehicle/train/cargo/engine/Bump(atom/Obstacle)
|
||||
var/obj/machinery/door/D = Obstacle
|
||||
var/mob/living/carbon/human/H = load
|
||||
if(istype(D) && istype(H))
|
||||
D.Bumped(H) //a little hacky, but hey, it works, and repects access rights
|
||||
|
||||
..()
|
||||
|
||||
/obj/vehicle/train/cargo/trolley/Bump(atom/Obstacle)
|
||||
if(!lead)
|
||||
return //so people can't knock others over by pushing a trolley around
|
||||
..()
|
||||
|
||||
//-------------------------------------------
|
||||
// Train procs
|
||||
//-------------------------------------------
|
||||
/obj/vehicle/train/cargo/RunOver(var/mob/living/carbon/human/H)
|
||||
var/list/parts = list("head", "chest", "l_leg", "r_leg", "l_arm", "r_arm")
|
||||
|
||||
H.apply_effects(5, 5)
|
||||
for(var/i = 0, i < rand(1,3), i++)
|
||||
H.apply_damage(rand(1,5), BRUTE, pick(parts))
|
||||
|
||||
/obj/vehicle/train/cargo/trolley/RunOver(var/mob/living/carbon/human/H)
|
||||
..()
|
||||
attack_log += text("\[[time_stamp()]\] <font color='red'>ran over [H.name] ([H.ckey])</font>")
|
||||
|
||||
/obj/vehicle/train/cargo/engine/RunOver(var/mob/living/carbon/human/H)
|
||||
..()
|
||||
|
||||
if(lead_engine && istype(load, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/D = load
|
||||
D << "\red \b You ran over [H]!"
|
||||
visible_message("<B>\red \The [src] ran over [H]!</B>")
|
||||
attack_log += text("\[[time_stamp()]\] <font color='red'>ran over [H.name] ([H.ckey]), driven by [D.name] ([D.ckey])</font>")
|
||||
msg_admin_attack("[D.name] ([D.ckey]) ran over [H.name] ([H.ckey]). (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[src.x];Y=[src.y];Z=[src.z]'>JMP</a>)")
|
||||
else
|
||||
attack_log += text("\[[time_stamp()]\] <font color='red'>ran over [H.name] ([H.ckey])</font>")
|
||||
|
||||
|
||||
//-------------------------------------------
|
||||
// Interaction procs
|
||||
//-------------------------------------------
|
||||
/obj/vehicle/train/cargo/trolley/verb/rotate()
|
||||
set name = "Rotate"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(anchored)
|
||||
usr << "You cannot turn the trolley while it is latched onto a train."
|
||||
return
|
||||
|
||||
var/cur_dir = null
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
cur_dir = "North"
|
||||
if(SOUTH)
|
||||
cur_dir = "South"
|
||||
if(EAST)
|
||||
cur_dir = "East"
|
||||
if(WEST)
|
||||
cur_dir = "West"
|
||||
|
||||
var/new_dir = input("Select a new direction:", "Rotate", cur_dir) in list("North", "South", "East", "West")
|
||||
|
||||
switch(new_dir)
|
||||
if("North")
|
||||
dir = NORTH
|
||||
if("South")
|
||||
dir = SOUTH
|
||||
if("East")
|
||||
dir = EAST
|
||||
if("West")
|
||||
dir = WEST
|
||||
|
||||
|
||||
/obj/vehicle/train/cargo/engine/relaymove(mob/user, direction)
|
||||
if(user != load)
|
||||
return 0
|
||||
|
||||
if(lead_engine)
|
||||
if(direction == reverse_direction(dir))
|
||||
return 0
|
||||
if(Move(get_step(src, direction)))
|
||||
return 1
|
||||
return 0
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/vehicle/train/cargo/engine/verb/start_engine()
|
||||
set name = "Start engine"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(on)
|
||||
usr << "The engine is already running."
|
||||
return
|
||||
|
||||
if(turn_on())
|
||||
usr << "You start [src]."
|
||||
else
|
||||
if(cell.charge < power_use)
|
||||
usr << "[src] is out of power."
|
||||
else
|
||||
usr << "[src] won't start."
|
||||
|
||||
//-------------------------------------------
|
||||
// Latching/unlatching procs
|
||||
//-------------------------------------------
|
||||
/obj/vehicle/train/cargo/trolley/latch(var/obj/vehicle/train/T)
|
||||
if(..())
|
||||
//if this is a trolley, and is now part of a train, anchor it so it cant be pushed around
|
||||
if(lead)
|
||||
anchored = 1
|
||||
lead.anchored = 1
|
||||
if(tow)
|
||||
anchored = 1
|
||||
tow.anchored = 1
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/vehicle/train/cargo/trolley/unlatch()
|
||||
if(..())
|
||||
//if this carraige isn't part of a train anymore; unanchor it so it can be pushed around
|
||||
if(!tow && !lead)
|
||||
anchored = 0
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
|
||||
/obj/vehicle/train/cargo/engine/latch(var/obj/vehicle/train/T)
|
||||
if(..())
|
||||
//check if this is not the lead engine
|
||||
if(lead)
|
||||
lead_engine = 0
|
||||
if(tow)
|
||||
tow.anchored = 1
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/vehicle/train/cargo/engine/unlatch()
|
||||
if(..())
|
||||
//check if this is now the lead engine
|
||||
if(!lead)
|
||||
lead_engine = 1
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
|
||||
//-------------------------------------------
|
||||
// Loading/unloading procs
|
||||
//-------------------------------------------
|
||||
/obj/vehicle/train/cargo/trolley/load(var/atom/movable/C)
|
||||
if(ismob(C) && !passenger_allowed)
|
||||
return 0
|
||||
if(!istype(C,/obj/machinery) && !istype(C,/obj/structure/closet) && !istype(C,/obj/structure/largecrate) && !istype(C,/obj/structure/reagent_dispensers) && !istype(C,/obj/structure/ore_box) && !ismob(C))
|
||||
return 0
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/train/cargo/engine/load(var/atom/movable/C)
|
||||
if(!ismob(C))
|
||||
return 0
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
//-------------------------------------------------------
|
||||
// Stat update procs
|
||||
//
|
||||
// Update the trains stats for speed calculations.
|
||||
// The longer the train, the slower it will go. car_limit
|
||||
// sets the max number of cars one engine can pull at
|
||||
// full speed. Adding more cars beyond this will slow the
|
||||
// train proportionate to the length of the train. Adding
|
||||
// more engines increases this limit by car_limit per
|
||||
// engine.
|
||||
//-------------------------------------------------------
|
||||
/obj/vehicle/train/cargo/engine/update_train_stats()
|
||||
..()
|
||||
|
||||
speed_calc()
|
||||
|
||||
if(!lead) //check if this is the lead engine
|
||||
lead_engine = 1
|
||||
|
||||
/obj/vehicle/train/cargo/engine/proc/speed_calc()
|
||||
if(!lead_engine)
|
||||
move_delay = initial(move_delay) //so that engines that have been turned off don't lag behind
|
||||
else
|
||||
move_delay = max(0, (-car_limit * active_engines) + train_length - active_engines) //limits base overweight so you cant overspeed trains
|
||||
move_delay *= (1 / max(1, active_engines)) * 2 //overweight penalty (scaled by the number of engines)
|
||||
move_delay += config.run_speed //base reference speed
|
||||
move_delay *= 1.05
|
||||
@@ -0,0 +1,204 @@
|
||||
/obj/vehicle/train
|
||||
name = "train"
|
||||
dir = 4
|
||||
|
||||
move_delay = 1
|
||||
|
||||
health = 100
|
||||
maxhealth = 100
|
||||
fire_dam_coeff = 0.7
|
||||
brute_dam_coeff = 0.5
|
||||
|
||||
var/passenger_allowed = 1
|
||||
|
||||
var/active_engines = 0
|
||||
var/train_length = 0
|
||||
|
||||
var/obj/vehicle/train/lead
|
||||
var/obj/vehicle/train/tow
|
||||
|
||||
|
||||
//-------------------------------------------
|
||||
// Standard procs
|
||||
//-------------------------------------------
|
||||
/obj/vehicle/train/initialize()
|
||||
for(var/obj/vehicle/train/T in orange(1, src))
|
||||
latch(T)
|
||||
|
||||
/obj/vehicle/train/Move()
|
||||
var/old_loc = get_turf(src)
|
||||
if(..())
|
||||
if(tow)
|
||||
tow.Move(old_loc)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/vehicle/train/Bump(atom/Obstacle)
|
||||
if(!istype(Obstacle, /atom/movable))
|
||||
return
|
||||
var/atom/movable/A = Obstacle
|
||||
|
||||
if(!A.anchored)
|
||||
var/turf/T = get_step(A, dir)
|
||||
if(isturf(T))
|
||||
A.Move(T) //bump things away when hit
|
||||
|
||||
if(emagged)
|
||||
if(istype(A, /mob/living))
|
||||
var/mob/living/M = A
|
||||
visible_message("\red [src] knocks over [M]!")
|
||||
M.apply_effects(5, 5) //knock people down if you hit them
|
||||
M.apply_damages(5 * train_length / move_delay) // and do damage according to how fast the train is going and how heavy it is
|
||||
if(istype(load, /mob/living/carbon/human))
|
||||
var/mob/living/D = load
|
||||
D << "\red You hit [M]!"
|
||||
msg_admin_attack("[D.name] ([D.ckey]) hit [M.name] ([M.ckey]) with [src]. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[src.x];Y=[src.y];Z=[src.z]'>JMP</a>)")
|
||||
|
||||
|
||||
//-------------------------------------------
|
||||
// Interaction procs
|
||||
//-------------------------------------------
|
||||
/obj/vehicle/train/relaymove(mob/user, direction)
|
||||
var/turf/T = get_step_to(src, get_step(src, direction))
|
||||
if(!T)
|
||||
user << "You can't find a clear area to step onto."
|
||||
return 0
|
||||
|
||||
if(user != load)
|
||||
if(user in src) //for handling players stuck in src
|
||||
unload(user, direction, 1)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
unload(user, direction)
|
||||
|
||||
user << "\blue You climb down from [src]."
|
||||
|
||||
return 1
|
||||
|
||||
/obj/vehicle/train/MouseDrop_T(var/atom/movable/C, mob/user as mob)
|
||||
if(!usr.canmove || usr.stat || usr.restrained() || !Adjacent(usr) || !user.Adjacent(C))
|
||||
return
|
||||
|
||||
if(istype(C,/obj/vehicle/train))
|
||||
if(latch(C))
|
||||
user << "\blue You successfully connect the [C] to [src]."
|
||||
else
|
||||
user << "\red You were unable to connect the [C] to [src]."
|
||||
return
|
||||
|
||||
if(!load(C))
|
||||
user << "\red You were unable to load [C] on [src]."
|
||||
|
||||
/obj/vehicle/train/attack_hand(mob/user as mob)
|
||||
if(!user.canmove || user.stat || user.restrained() || !Adjacent(user))
|
||||
return 0
|
||||
|
||||
if(user != load && (user in src))
|
||||
unload(user, null, 1) //for handling players stuck in src
|
||||
else if(load)
|
||||
unload(user) //unload if loaded
|
||||
else if(!load)
|
||||
load(user) //else try climbing on board
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/vehicle/train/verb/unlatch_v()
|
||||
set name = "Unlatch"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(!usr.canmove || usr.stat || usr.restrained() || !Adjacent(usr))
|
||||
return
|
||||
|
||||
if(unlatch())
|
||||
usr << "\blue You unlatch [src]."
|
||||
else
|
||||
usr << "\red [src] is already unlatched."
|
||||
|
||||
|
||||
//-------------------------------------------
|
||||
// Latching/unlatching procs
|
||||
//-------------------------------------------
|
||||
/obj/vehicle/train/proc/latch(var/obj/vehicle/train/T)
|
||||
if(!istype(T) || !Adjacent(T))
|
||||
return 0
|
||||
|
||||
/* --- commented out until we get directional sprites ---
|
||||
if(dir != T.dir) //cars need to be inline to latch
|
||||
return 0
|
||||
*/
|
||||
|
||||
var/T_dir = get_dir(src, T)
|
||||
|
||||
if(dir & T_dir) //if car is ahead
|
||||
if(!lead && !T.tow)
|
||||
lead = T
|
||||
T.tow = src
|
||||
else
|
||||
return 0
|
||||
else if(reverse_direction(dir) & T_dir) //else if car is behind
|
||||
if(!tow && !T.lead)
|
||||
tow = T
|
||||
T.lead = src
|
||||
else
|
||||
return 0
|
||||
else
|
||||
return 0
|
||||
|
||||
update_stats()
|
||||
|
||||
return 1
|
||||
|
||||
/obj/vehicle/train/proc/unlatch(var/obj/vehicle/train/T)
|
||||
if(!lead && !tow)
|
||||
return 0
|
||||
|
||||
if(T)
|
||||
if(T == tow)
|
||||
tow = null
|
||||
else if(T == lead)
|
||||
lead = null
|
||||
else
|
||||
if(tow)
|
||||
tow.unlatch(src)
|
||||
tow = null
|
||||
if(lead)
|
||||
lead.unlatch(src)
|
||||
lead = null
|
||||
|
||||
update_stats()
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------
|
||||
// Stat update procs
|
||||
//
|
||||
// Used for updating the stats for how long the train is.
|
||||
// These are useful for calculating speed based on the
|
||||
// size of the train, to limit super long trains.
|
||||
//-------------------------------------------------------
|
||||
/obj/vehicle/train/update_stats()
|
||||
if(!tow)
|
||||
update_train_stats()
|
||||
else
|
||||
return tow.update_stats()
|
||||
|
||||
/obj/vehicle/train/proc/update_train_stats()
|
||||
if(powered && on)
|
||||
active_engines = 1 //increment active engine count if this is a running engine
|
||||
else
|
||||
active_engines = 0
|
||||
|
||||
train_length = 1
|
||||
|
||||
if(tow)
|
||||
active_engines += tow.active_engines
|
||||
train_length += tow.train_length
|
||||
|
||||
//update the next section of train ahead of us
|
||||
if(lead)
|
||||
lead.update_train_stats()
|
||||
@@ -0,0 +1,378 @@
|
||||
/obj/vehicle
|
||||
name = "vehicle"
|
||||
icon = 'icons/obj/vehicles.dmi'
|
||||
layer = MOB_LAYER
|
||||
density = 1
|
||||
anchored = 1
|
||||
animate_movement=1
|
||||
luminosity = 3
|
||||
|
||||
var/attack_log = null
|
||||
var/on = 0
|
||||
var/health = 0 //do not forget to set health for your vehicle!
|
||||
var/maxhealth = 0
|
||||
var/fire_dam_coeff = 1.0
|
||||
var/brute_dam_coeff = 1.0
|
||||
var/open = 0 //Maint panel
|
||||
var/locked = 1
|
||||
var/stat = 0
|
||||
var/emagged = 0
|
||||
var/powered = 0 //set if vehicle is powered and should use fuel when moving
|
||||
var/move_delay = 1 //set this to limit the speed of the vehicle
|
||||
|
||||
var/obj/item/weapon/cell/cell
|
||||
var/power_use = 5 //set this to adjust the amount of power the vehicle uses per move
|
||||
|
||||
var/atom/movable/load //all vehicles can take a load, since they should all be a least drivable
|
||||
var/load_item_visible = 1 //set if the loaded item should be overlayed on the vehicle sprite
|
||||
var/load_offset_x = 0 //pixel_x offset for item overlay
|
||||
var/load_offset_y = 0 //pixel_y offset for item overlay
|
||||
|
||||
//-------------------------------------------
|
||||
// Standard procs
|
||||
//-------------------------------------------
|
||||
/obj/vehicle/New()
|
||||
..()
|
||||
//spawn the cell you want in each vehicle
|
||||
|
||||
/obj/vehicle/Move()
|
||||
if(world.timeofday > l_move_time + move_delay)
|
||||
if(on && powered && cell.charge < power_use)
|
||||
turn_off()
|
||||
|
||||
var/init_anc = anchored
|
||||
anchored = 0
|
||||
if(..())
|
||||
if(on && powered)
|
||||
cell.use(power_use)
|
||||
anchored = init_anc
|
||||
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/vehicle/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(!locked)
|
||||
open = !open
|
||||
update_icon()
|
||||
user << "<span class='notice'>Maintenance panel is now [open ? "opened" : "closed"].</span>"
|
||||
else if(istype(W, /obj/item/weapon/crowbar) && cell && open)
|
||||
remove_cell(user)
|
||||
|
||||
else if(istype(W, /obj/item/weapon/cell) && !cell && open)
|
||||
insert_cell(W, user)
|
||||
else if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/T = W
|
||||
if(T.welding)
|
||||
if(health < maxhealth)
|
||||
if(open)
|
||||
health = min(maxhealth, health+10)
|
||||
user.visible_message("\red [user] repairs [src]!","\blue You repair [src]!")
|
||||
else
|
||||
user << "<span class='notice'>Unable to repair with the maintenance panel closed.</span>"
|
||||
else
|
||||
user << "<span class='notice'>[src] does not need a repair.</span>"
|
||||
else
|
||||
user << "<span class='notice'>Unable to repair while [src] is off.</span>"
|
||||
else if(istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
Emag(user)
|
||||
else if(hasvar(W,"force") && hasvar(W,"damtype"))
|
||||
switch(W.damtype)
|
||||
if("fire")
|
||||
health -= W.force * fire_dam_coeff
|
||||
if("brute")
|
||||
health -= W.force * brute_dam_coeff
|
||||
..()
|
||||
healthcheck()
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/vehicle/attack_animal(var/mob/living/simple_animal/M as mob)
|
||||
if(M.melee_damage_upper == 0) return
|
||||
health -= M.melee_damage_upper
|
||||
src.visible_message("\red <B>[M] has [M.attacktext] [src]!</B>")
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>attacked [src.name]</font>")
|
||||
if(prob(10))
|
||||
new /obj/effect/decal/cleanable/oil(src.loc)
|
||||
healthcheck()
|
||||
|
||||
/obj/vehicle/bullet_act(var/obj/item/projectile/Proj)
|
||||
health -= Proj.damage
|
||||
..()
|
||||
healthcheck()
|
||||
|
||||
/obj/vehicle/meteorhit()
|
||||
explode()
|
||||
return
|
||||
|
||||
/obj/vehicle/blob_act()
|
||||
src.health -= rand(20,40)*fire_dam_coeff
|
||||
healthcheck()
|
||||
return
|
||||
|
||||
/obj/vehicle/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
explode()
|
||||
return
|
||||
if(2.0)
|
||||
health -= rand(5,10)*fire_dam_coeff
|
||||
health -= rand(10,20)*brute_dam_coeff
|
||||
healthcheck()
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(50))
|
||||
health -= rand(1,5)*fire_dam_coeff
|
||||
health -= rand(1,5)*brute_dam_coeff
|
||||
healthcheck()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/vehicle/emp_act(severity)
|
||||
var/was_on = on
|
||||
stat |= EMPED
|
||||
var/obj/effect/overlay/pulse2 = new/obj/effect/overlay ( src.loc )
|
||||
pulse2.icon = 'icons/effects/effects.dmi'
|
||||
pulse2.icon_state = "empdisable"
|
||||
pulse2.name = "emp sparks"
|
||||
pulse2.anchored = 1
|
||||
pulse2.dir = pick(cardinal)
|
||||
|
||||
spawn(10)
|
||||
pulse2.delete()
|
||||
if(on)
|
||||
turn_off()
|
||||
spawn(severity*300)
|
||||
stat &= ~EMPED
|
||||
if(was_on)
|
||||
turn_on()
|
||||
|
||||
/obj/vehicle/attack_ai(mob/user as mob)
|
||||
return
|
||||
|
||||
|
||||
//-------------------------------------------
|
||||
// Vehicle procs
|
||||
//-------------------------------------------
|
||||
/obj/vehicle/proc/turn_on()
|
||||
if(stat)
|
||||
return 0
|
||||
if(powered && cell.charge < power_use)
|
||||
return 0
|
||||
on = 1
|
||||
luminosity = initial(luminosity)
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
/obj/vehicle/proc/turn_off()
|
||||
on = 0
|
||||
luminosity = 0
|
||||
update_icon()
|
||||
|
||||
/obj/vehicle/proc/Emag(mob/user as mob)
|
||||
emagged = 1
|
||||
|
||||
if(locked)
|
||||
locked = 0
|
||||
user << "<span class='warning'>You bypass [src]'s controls.</span>"
|
||||
|
||||
/obj/vehicle/proc/explode()
|
||||
src.visible_message("\red <B>[src] blows apart!</B>", 1)
|
||||
var/turf/Tsec = get_turf(src)
|
||||
|
||||
new /obj/item/stack/rods(Tsec)
|
||||
new /obj/item/stack/rods(Tsec)
|
||||
new /obj/item/stack/cable_coil/cut(Tsec)
|
||||
|
||||
if(cell)
|
||||
cell.loc = Tsec
|
||||
cell.update_icon()
|
||||
cell = null
|
||||
|
||||
unload()
|
||||
|
||||
new /obj/effect/gibspawner/robot(Tsec)
|
||||
new /obj/effect/decal/cleanable/oil(src.loc)
|
||||
|
||||
del(src)
|
||||
|
||||
/obj/vehicle/proc/healthcheck()
|
||||
if(health <= 0)
|
||||
explode()
|
||||
|
||||
/obj/vehicle/proc/powercheck()
|
||||
if(!cell && !powered)
|
||||
return
|
||||
|
||||
if(!cell && powered)
|
||||
turn_off()
|
||||
return
|
||||
|
||||
if(cell.charge < power_use)
|
||||
turn_off()
|
||||
return
|
||||
|
||||
if(cell && powered)
|
||||
turn_on()
|
||||
return
|
||||
|
||||
/obj/vehicle/proc/insert_cell(var/obj/item/weapon/cell/C, var/mob/living/carbon/human/H)
|
||||
if(cell)
|
||||
return
|
||||
if(!istype(C))
|
||||
return
|
||||
|
||||
H.drop_from_inventory(C)
|
||||
cell = C
|
||||
C.loc = null //this wont be GC'd since it's referrenced above
|
||||
powercheck()
|
||||
usr << "<span class='notice'>You install [C] in [src].</span>"
|
||||
|
||||
/obj/vehicle/proc/remove_cell(var/mob/living/carbon/human/H)
|
||||
if(!cell)
|
||||
return
|
||||
|
||||
usr << "<span class='notice'>You remove [cell] from [src].</span>"
|
||||
cell.loc = get_turf(H)
|
||||
cell = null
|
||||
powercheck()
|
||||
|
||||
/obj/vehicle/proc/RunOver(var/mob/living/carbon/human/H)
|
||||
return //write specifics for different vehicles
|
||||
|
||||
//-------------------------------------------
|
||||
// Loading/unloading procs
|
||||
//
|
||||
// Set specific item restriction checks in
|
||||
// the vehicle load() definition before
|
||||
// calling this parent proc.
|
||||
//-------------------------------------------
|
||||
/obj/vehicle/proc/load(var/atom/movable/C)
|
||||
//define allowed items for loading in specific vehicle definitions
|
||||
|
||||
if(!isturf(C.loc)) //To prevent loading things from someone's inventory, which wouldn't get handled properly.
|
||||
return 0
|
||||
if(load || C.anchored)
|
||||
return 0
|
||||
|
||||
// if a create/closet, close before loading
|
||||
var/obj/structure/closet/crate = C
|
||||
if(istype(crate))
|
||||
crate.close()
|
||||
|
||||
C.loc = loc
|
||||
sleep(2)
|
||||
if(C.loc != loc) //To prevent you from going onto more than one train.
|
||||
return 0
|
||||
C.loc = src
|
||||
|
||||
load = C
|
||||
|
||||
if(load_item_visible)
|
||||
C.pixel_x += load_offset_x
|
||||
C.pixel_y += load_offset_y
|
||||
C.layer = layer
|
||||
|
||||
overlays += C
|
||||
|
||||
//we can set these back now since we have already cloned the icon into the overlay
|
||||
C.pixel_x = initial(C.pixel_x)
|
||||
C.pixel_y = initial(C.pixel_y)
|
||||
C.layer = initial(C.layer)
|
||||
|
||||
if(ismob(C))
|
||||
var/mob/M = C
|
||||
if(M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/obj/vehicle/proc/unload(var/mob/user, var/direction, var/exception = 0)
|
||||
if(!load)
|
||||
// in case non-load items end up in contents, dump everything else too
|
||||
for(var/atom/movable/AM in src)
|
||||
AM.loc = get_turf(src)
|
||||
AM.pixel_x = initial(AM.pixel_x)
|
||||
AM.pixel_y = initial(AM.pixel_y)
|
||||
AM.layer = initial(AM.layer)
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
return 0
|
||||
|
||||
var/turf/dest = null
|
||||
|
||||
//find a turf to unload to
|
||||
if(direction) //if direction specified, unload in that direction
|
||||
dest = get_step(src, direction)
|
||||
else if(user) //if a user has unloaded the vehicle, unload at their feet
|
||||
dest = get_turf(user)
|
||||
|
||||
if(!dest)
|
||||
dest = get_step_to(src, get_step(src, turn(dir, 90))) //try unloading to the side of the vehicle first if neither of the above are present
|
||||
|
||||
//if these all result in the same turf as the vehicle or nullspace, pick a new turf with open space
|
||||
if(!dest || dest == get_turf(src))
|
||||
var/list/options = new()
|
||||
for(var/test_dir in alldirs)
|
||||
var/new_dir = get_step_to(src, get_step(src, test_dir))
|
||||
if(new_dir)
|
||||
options += new_dir
|
||||
if(options.len)
|
||||
dest = pick(options)
|
||||
else
|
||||
dest = get_turf(src) //otherwise just dump it on the same turf as the vehicle
|
||||
|
||||
if(!isturf(dest)) //if there still is nowhere to unload, cancel out since the vehicle is probably in nullspace
|
||||
return 0
|
||||
|
||||
|
||||
if(exception) //for handling any players that end up in src.contents that are trying to climb off
|
||||
user.loc = dest
|
||||
user.pixel_x = initial(user.pixel_x)
|
||||
user.pixel_y = initial(user.pixel_y)
|
||||
user.layer = initial(user.layer)
|
||||
|
||||
if(ismob(user))
|
||||
var/mob/M = user
|
||||
if(M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
src.contents -= user
|
||||
|
||||
return 1
|
||||
|
||||
overlays.Cut()
|
||||
|
||||
load.loc = dest
|
||||
|
||||
/*
|
||||
load.pixel_x = initial(load.pixel_x)
|
||||
load.pixel_y = initial(load.pixel_y)
|
||||
load.layer = initial(load.layer)
|
||||
*/
|
||||
|
||||
if(ismob(load))
|
||||
var/mob/M = load
|
||||
if(M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
load = null
|
||||
|
||||
unload() //recursive check for anything left in contents
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
//-------------------------------------------------------
|
||||
// Stat update procs
|
||||
//-------------------------------------------------------
|
||||
/obj/vehicle/proc/update_stats()
|
||||
return
|
||||
Reference in New Issue
Block a user