mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 11:05:03 +01:00
moving all the git stuff over to this so people who don't want to spend 8 years figuring out the bass ackward git system can actually run our server code
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2983 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
+120
-120
@@ -1,120 +1,120 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* /datum/recipe by rastaf0 13 apr 2011 *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* This is powerful and flexible recipe system.
|
||||
* It exists not only for food.
|
||||
* supports both reagents and objects as prerequisites.
|
||||
* In order to use this system you have to define a deriative from /datum/recipe
|
||||
* * reagents are reagents. Acid, milc, booze, etc.
|
||||
* * items are objects. Fruits, tools, circuit boards.
|
||||
* * result is type to create as new object
|
||||
* * time is optional parameter, you shall use in in your machine,
|
||||
default /datum/recipe/ procs does not rely on this parameter.
|
||||
*
|
||||
* Functions you need:
|
||||
* /datum/recipe/proc/make(var/obj/container as obj)
|
||||
* Creates result inside container,
|
||||
* deletes prerequisite reagents,
|
||||
* transfers reagents from prerequisite objects,
|
||||
* deletes all prerequisite objects (even not needed for recipe at the moment).
|
||||
*
|
||||
* /proc/select_recipe(list/datum/recipe/avaiable_recipes, obj/obj as obj, exact = 1)
|
||||
* Wonderful function that select suitable recipe for you.
|
||||
* obj is a machine (or magik hat) with prerequisites,
|
||||
* exact = 0 forces algorithm to ignore superfluous stuff.
|
||||
*
|
||||
*
|
||||
* Functions you do not need to call directly but could:
|
||||
* /datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents)
|
||||
* //1=precisely, 0=insufficiently, -1=superfluous
|
||||
*
|
||||
* /datum/recipe/proc/check_items(var/obj/container as obj)
|
||||
* //1=precisely, 0=insufficiently, -1=superfluous
|
||||
*
|
||||
* */
|
||||
|
||||
/datum/recipe
|
||||
var/list/reagents // example: = list("berryjuice" = 5) // do not list same reagent twice
|
||||
var/list/items // example: =list(/obj/item/weapon/crowbar, /obj/item/weapon/welder) // place /foo/bar before /foo
|
||||
var/result //example: = /obj/item/weapon/reagent_containers/food/snacks/donut
|
||||
var/time = 100 // 1/10 part of second
|
||||
|
||||
|
||||
/datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents) //1=precisely, 0=insufficiently, -1=superfluous
|
||||
. = 1
|
||||
for (var/r_r in reagents)
|
||||
var/aval_r_amnt = avail_reagents.get_reagent_amount(r_r)
|
||||
if (!(abs(aval_r_amnt - reagents[r_r])<0.5)) //if NOT equals
|
||||
if (aval_r_amnt>reagents[r_r])
|
||||
. = -1
|
||||
else
|
||||
return 0
|
||||
if ((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len)
|
||||
return -1
|
||||
return .
|
||||
|
||||
/datum/recipe/proc/check_items(var/obj/container as obj) //1=precisely, 0=insufficiently, -1=superfluous
|
||||
if (!items)
|
||||
if (locate(/obj/) in container)
|
||||
return -1
|
||||
else
|
||||
return 1
|
||||
. = 1
|
||||
var/list/checklist = items.Copy()
|
||||
for (var/obj/O in container)
|
||||
var/found = 0
|
||||
for (var/type in checklist)
|
||||
if (istype(O,type))
|
||||
checklist-=type
|
||||
found = 1
|
||||
break
|
||||
if (!found)
|
||||
. = -1
|
||||
if (checklist.len)
|
||||
return 0
|
||||
return .
|
||||
|
||||
//general version
|
||||
/datum/recipe/proc/make(var/obj/container as obj)
|
||||
var/obj/result_obj = new result(container)
|
||||
for (var/obj/O in (container.contents-result_obj))
|
||||
O.reagents.trans_to(result_obj, O.reagents.total_volume)
|
||||
del(O)
|
||||
container.reagents.clear_reagents()
|
||||
return result_obj
|
||||
|
||||
// food-related
|
||||
/datum/recipe/proc/make_food(var/obj/container as obj)
|
||||
var/obj/result_obj = new result(container)
|
||||
for (var/obj/O in (container.contents-result_obj))
|
||||
if (O.reagents)
|
||||
O.reagents.del_reagent("nutriment")
|
||||
O.reagents.update_total()
|
||||
O.reagents.trans_to(result_obj, O.reagents.total_volume)
|
||||
del(O)
|
||||
container.reagents.clear_reagents()
|
||||
return result_obj
|
||||
|
||||
/proc/select_recipe(var/list/datum/recipe/avaiable_recipes, var/obj/obj as obj, var/exact = 1 as num)
|
||||
if (!exact)
|
||||
exact = -1
|
||||
var/list/datum/recipe/possible_recipes = new
|
||||
for (var/datum/recipe/recipe in avaiable_recipes)
|
||||
if (recipe.check_reagents(obj.reagents)==exact && recipe.check_items(obj)==exact)
|
||||
possible_recipes+=recipe
|
||||
if (possible_recipes.len==0)
|
||||
return null
|
||||
else if (possible_recipes.len==1)
|
||||
return possible_recipes[1]
|
||||
else //okay, let's select the most complicated recipe
|
||||
var/r_count = 0
|
||||
var/i_count = 0
|
||||
. = possible_recipes[1]
|
||||
for (var/datum/recipe/recipe in possible_recipes)
|
||||
var/N_i = (recipe.items)?(recipe.items.len):0
|
||||
var/N_r = (recipe.reagents)?(recipe.reagents.len):0
|
||||
if (N_i > i_count || (N_i== i_count && N_r > r_count ))
|
||||
r_count = N_r
|
||||
i_count = N_i
|
||||
. = recipe
|
||||
return .
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* /datum/recipe by rastaf0 13 apr 2011 *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* This is powerful and flexible recipe system.
|
||||
* It exists not only for food.
|
||||
* supports both reagents and objects as prerequisites.
|
||||
* In order to use this system you have to define a deriative from /datum/recipe
|
||||
* * reagents are reagents. Acid, milc, booze, etc.
|
||||
* * items are objects. Fruits, tools, circuit boards.
|
||||
* * result is type to create as new object
|
||||
* * time is optional parameter, you shall use in in your machine,
|
||||
default /datum/recipe/ procs does not rely on this parameter.
|
||||
*
|
||||
* Functions you need:
|
||||
* /datum/recipe/proc/make(var/obj/container as obj)
|
||||
* Creates result inside container,
|
||||
* deletes prerequisite reagents,
|
||||
* transfers reagents from prerequisite objects,
|
||||
* deletes all prerequisite objects (even not needed for recipe at the moment).
|
||||
*
|
||||
* /proc/select_recipe(list/datum/recipe/avaiable_recipes, obj/obj as obj, exact = 1)
|
||||
* Wonderful function that select suitable recipe for you.
|
||||
* obj is a machine (or magik hat) with prerequisites,
|
||||
* exact = 0 forces algorithm to ignore superfluous stuff.
|
||||
*
|
||||
*
|
||||
* Functions you do not need to call directly but could:
|
||||
* /datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents)
|
||||
* //1=precisely, 0=insufficiently, -1=superfluous
|
||||
*
|
||||
* /datum/recipe/proc/check_items(var/obj/container as obj)
|
||||
* //1=precisely, 0=insufficiently, -1=superfluous
|
||||
*
|
||||
* */
|
||||
|
||||
/datum/recipe
|
||||
var/list/reagents // example: = list("berryjuice" = 5) // do not list same reagent twice
|
||||
var/list/items // example: =list(/obj/item/weapon/crowbar, /obj/item/weapon/welder) // place /foo/bar before /foo
|
||||
var/result //example: = /obj/item/weapon/reagent_containers/food/snacks/donut
|
||||
var/time = 100 // 1/10 part of second
|
||||
|
||||
|
||||
/datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents) //1=precisely, 0=insufficiently, -1=superfluous
|
||||
. = 1
|
||||
for (var/r_r in reagents)
|
||||
var/aval_r_amnt = avail_reagents.get_reagent_amount(r_r)
|
||||
if (!(abs(aval_r_amnt - reagents[r_r])<0.5)) //if NOT equals
|
||||
if (aval_r_amnt>reagents[r_r])
|
||||
. = -1
|
||||
else
|
||||
return 0
|
||||
if ((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len)
|
||||
return -1
|
||||
return .
|
||||
|
||||
/datum/recipe/proc/check_items(var/obj/container as obj) //1=precisely, 0=insufficiently, -1=superfluous
|
||||
if (!items)
|
||||
if (locate(/obj/) in container)
|
||||
return -1
|
||||
else
|
||||
return 1
|
||||
. = 1
|
||||
var/list/checklist = items.Copy()
|
||||
for (var/obj/O in container)
|
||||
var/found = 0
|
||||
for (var/type in checklist)
|
||||
if (istype(O,type))
|
||||
checklist-=type
|
||||
found = 1
|
||||
break
|
||||
if (!found)
|
||||
. = -1
|
||||
if (checklist.len)
|
||||
return 0
|
||||
return .
|
||||
|
||||
//general version
|
||||
/datum/recipe/proc/make(var/obj/container as obj)
|
||||
var/obj/result_obj = new result(container)
|
||||
for (var/obj/O in (container.contents-result_obj))
|
||||
O.reagents.trans_to(result_obj, O.reagents.total_volume)
|
||||
del(O)
|
||||
container.reagents.clear_reagents()
|
||||
return result_obj
|
||||
|
||||
// food-related
|
||||
/datum/recipe/proc/make_food(var/obj/container as obj)
|
||||
var/obj/result_obj = new result(container)
|
||||
for (var/obj/O in (container.contents-result_obj))
|
||||
if (O.reagents)
|
||||
O.reagents.del_reagent("nutriment")
|
||||
O.reagents.update_total()
|
||||
O.reagents.trans_to(result_obj, O.reagents.total_volume)
|
||||
del(O)
|
||||
container.reagents.clear_reagents()
|
||||
return result_obj
|
||||
|
||||
/proc/select_recipe(var/list/datum/recipe/avaiable_recipes, var/obj/obj as obj, var/exact = 1 as num)
|
||||
if (!exact)
|
||||
exact = -1
|
||||
var/list/datum/recipe/possible_recipes = new
|
||||
for (var/datum/recipe/recipe in avaiable_recipes)
|
||||
if (recipe.check_reagents(obj.reagents)==exact && recipe.check_items(obj)==exact)
|
||||
possible_recipes+=recipe
|
||||
if (possible_recipes.len==0)
|
||||
return null
|
||||
else if (possible_recipes.len==1)
|
||||
return possible_recipes[1]
|
||||
else //okay, let's select the most complicated recipe
|
||||
var/r_count = 0
|
||||
var/i_count = 0
|
||||
. = possible_recipes[1]
|
||||
for (var/datum/recipe/recipe in possible_recipes)
|
||||
var/N_i = (recipe.items)?(recipe.items.len):0
|
||||
var/N_r = (recipe.reagents)?(recipe.reagents.len):0
|
||||
if (N_i > i_count || (N_i== i_count && N_r > r_count ))
|
||||
r_count = N_r
|
||||
i_count = N_i
|
||||
. = recipe
|
||||
return .
|
||||
|
||||
@@ -546,4 +546,19 @@ obj/item/clothing/suit/justice
|
||||
desc = "this pretty much looks ridiculous"
|
||||
icon_state = "justice"
|
||||
item_state = "justice"
|
||||
flags = FPRINT | TABLEPASS
|
||||
flags = FPRINT | TABLEPASS
|
||||
|
||||
/obj/item/clothing/under/gladiator
|
||||
name = "gladiator uniform"
|
||||
desc = "Are you not entertained? Is that not why you are here?"
|
||||
icon_state = "gladiator"
|
||||
item_state = "gladiator"
|
||||
color = "gladiator"
|
||||
body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS
|
||||
|
||||
/obj/item/clothing/head/helmet/gladiator
|
||||
name = "gladiator helmet"
|
||||
desc = "Ave, Imperator, morituri te salutant."
|
||||
icon_state = "gladiator"
|
||||
flags = FPRINT|TABLEPASS|SUITSPACE|HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR
|
||||
item_state="gladiator"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1080,7 +1080,7 @@
|
||||
|
||||
/obj/item/weapon/cell/super
|
||||
name = "super-capacity power cell"
|
||||
origin_tech = "powerstorage=3"
|
||||
origin_tech = "powerstorage=5"
|
||||
maxcharge = 20000
|
||||
g_amt = 70
|
||||
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
/datum/game_mode/traitor/changeling
|
||||
name = "traitor+changeling"
|
||||
config_tag = "traitorchan"
|
||||
traitors_possible = 3 //hard limit on traitors if scaling is turned off
|
||||
required_players = 20
|
||||
required_enemies = 2
|
||||
|
||||
/datum/game_mode/traitor/changeling/announce()
|
||||
world << "<B>The current game mode is - Traitor+Changeling!</B>"
|
||||
world << "<B>There is an alien creature on the station along with some syndicate operatives out for their own gain! Do not let the changeling and the traitors succeed!</B>"
|
||||
|
||||
|
||||
/datum/game_mode/traitor/changeling/pre_setup()
|
||||
var/list/datum/mind/possible_changelings = get_players_for_role(BE_CHANGELING)
|
||||
|
||||
for(var/datum/mind/player in possible_changelings)
|
||||
for(var/job in restricted_jobs)//Removing robots from the list
|
||||
if(player.assigned_role == job)
|
||||
possible_changelings -= player
|
||||
|
||||
if(possible_changelings.len>0)
|
||||
var/datum/mind/changeling = pick(possible_changelings)
|
||||
//possible_changelings-=changeling
|
||||
changelings += changeling
|
||||
modePlayer += changelings
|
||||
return ..()
|
||||
else
|
||||
return 0
|
||||
|
||||
/datum/game_mode/traitor/changeling/post_setup()
|
||||
for(var/datum/mind/changeling in changelings)
|
||||
grant_changeling_powers(changeling.current)
|
||||
changeling.special_role = "Changeling"
|
||||
forge_changeling_objectives(changeling)
|
||||
greet_changeling(changeling)
|
||||
..()
|
||||
/datum/game_mode/traitor/changeling
|
||||
name = "traitor+changeling"
|
||||
config_tag = "traitorchan"
|
||||
traitors_possible = 3 //hard limit on traitors if scaling is turned off
|
||||
required_players = 20
|
||||
required_enemies = 2
|
||||
|
||||
/datum/game_mode/traitor/changeling/announce()
|
||||
world << "<B>The current game mode is - Traitor+Changeling!</B>"
|
||||
world << "<B>There is an alien creature on the station along with some syndicate operatives out for their own gain! Do not let the changeling and the traitors succeed!</B>"
|
||||
|
||||
|
||||
/datum/game_mode/traitor/changeling/pre_setup()
|
||||
var/list/datum/mind/possible_changelings = get_players_for_role(BE_CHANGELING)
|
||||
|
||||
for(var/datum/mind/player in possible_changelings)
|
||||
for(var/job in restricted_jobs)//Removing robots from the list
|
||||
if(player.assigned_role == job)
|
||||
possible_changelings -= player
|
||||
|
||||
if(possible_changelings.len>0)
|
||||
var/datum/mind/changeling = pick(possible_changelings)
|
||||
//possible_changelings-=changeling
|
||||
changelings += changeling
|
||||
modePlayer += changelings
|
||||
return ..()
|
||||
else
|
||||
return 0
|
||||
|
||||
/datum/game_mode/traitor/changeling/post_setup()
|
||||
for(var/datum/mind/changeling in changelings)
|
||||
grant_changeling_powers(changeling.current)
|
||||
changeling.special_role = "Changeling"
|
||||
forge_changeling_objectives(changeling)
|
||||
greet_changeling(changeling)
|
||||
..()
|
||||
return
|
||||
@@ -204,7 +204,7 @@ datum/objective/block
|
||||
|
||||
|
||||
datum/objective/escape
|
||||
explanation_text = "Escape on the shuttle alive."
|
||||
explanation_text = "Escape on the shuttle or an escape pod alive."
|
||||
|
||||
|
||||
check_completion()
|
||||
|
||||
+113
-113
@@ -1,113 +1,113 @@
|
||||
#define ui_dropbutton "SOUTH-1,7"
|
||||
#define ui_swapbutton "SOUTH-1,7"
|
||||
#define ui_iclothing "SOUTH-1,2"
|
||||
#define ui_oclothing "SOUTH,2"
|
||||
//#define ui_headset "SOUTH,8"
|
||||
#define ui_rhand "SOUTH,1"
|
||||
#define ui_lhand "SOUTH,3"
|
||||
#define ui_id "SOUTH-1,1"
|
||||
#define ui_mask "SOUTH+1,1"
|
||||
#define ui_back "SOUTH+1,3"
|
||||
#define ui_storage1 "SOUTH-1,4"
|
||||
#define ui_storage2 "SOUTH-1,5"
|
||||
#define ui_sstore1 "SOUTH+1,4"
|
||||
#define ui_hstore1 "SOUTH+1,5"
|
||||
#define ui_resist "EAST+1,SOUTH-1"
|
||||
#define ui_gloves "SOUTH,5"
|
||||
#define ui_glasses "SOUTH,7"
|
||||
#define ui_ears "SOUTH,6"
|
||||
#define ui_head "SOUTH+1,2"
|
||||
#define ui_shoes "SOUTH,4"
|
||||
#define ui_belt "SOUTH-1,3"
|
||||
#define ui_throw "SOUTH-1,8"
|
||||
#define ui_oxygen "EAST+1, NORTH-4"
|
||||
#define ui_pressure "EAST+1, NORTH-5"
|
||||
#define ui_toxin "EAST+1, NORTH-6"
|
||||
#define ui_internal "EAST+1, NORTH-2"
|
||||
#define ui_fire "EAST+1, NORTH-8"
|
||||
#define ui_temp "EAST+1, NORTH-10"
|
||||
#define ui_health "EAST+1, NORTH-11"
|
||||
#define ui_nutrition "EAST+1, NORTH-12"
|
||||
#define ui_pull "SOUTH-1,10"
|
||||
#define ui_hand "SOUTH-1,6"
|
||||
#define ui_sleep "EAST+1, NORTH-13"
|
||||
#define ui_rest "EAST+1, NORTH-14"
|
||||
|
||||
#define ui_acti "SOUTH-1,12"
|
||||
#define ui_movi "SOUTH-1,14"
|
||||
|
||||
#define ui_iarrowleft "SOUTH-1,11"
|
||||
#define ui_iarrowright "SOUTH-1,13"
|
||||
|
||||
#define ui_inv1 "SOUTH-1,1"
|
||||
#define ui_inv2 "SOUTH-1,2"
|
||||
#define ui_inv3 "SOUTH-1,3"
|
||||
|
||||
|
||||
|
||||
obj/hud/New(var/type = 0)
|
||||
instantiate(type)
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
/obj/hud/proc/other_update()
|
||||
|
||||
if(!mymob) return
|
||||
if(show_otherinventory)
|
||||
if(mymob:shoes) mymob:shoes:screen_loc = ui_shoes
|
||||
if(mymob:gloves) mymob:gloves:screen_loc = ui_gloves
|
||||
if(mymob:ears) mymob:ears:screen_loc = ui_ears
|
||||
if(mymob:s_store) mymob:s_store:screen_loc = ui_sstore1
|
||||
if(mymob:glasses) mymob:glasses:screen_loc = ui_glasses
|
||||
if(mymob:h_store) mymob:h_store:screen_loc = ui_hstore1
|
||||
else
|
||||
if(istype(mymob, /mob/living/carbon/human))
|
||||
if(mymob:shoes) mymob:shoes:screen_loc = null
|
||||
if(mymob:gloves) mymob:gloves:screen_loc = null
|
||||
if(mymob:ears) mymob:ears:screen_loc = null
|
||||
if(mymob:s_store) mymob:s_store:screen_loc = null
|
||||
if(mymob:glasses) mymob:glasses:screen_loc = null
|
||||
if(mymob:h_store) mymob:h_store:screen_loc = null
|
||||
|
||||
|
||||
/obj/hud/var/show_otherinventory = 1
|
||||
/obj/hud/var/obj/screen/action_intent
|
||||
/obj/hud/var/obj/screen/move_intent
|
||||
|
||||
/obj/hud/proc/instantiate(var/type = 0)
|
||||
|
||||
mymob = loc
|
||||
ASSERT(istype(mymob, /mob))
|
||||
|
||||
if(ishuman(mymob))
|
||||
human_hud(mymob.UI) // Pass the player the UI style chosen in preferences
|
||||
|
||||
else if(ismonkey(mymob))
|
||||
monkey_hud(mymob.UI)
|
||||
|
||||
else if(isbrain(mymob))
|
||||
brain_hud(mymob.UI)
|
||||
|
||||
else if(islarva(mymob))
|
||||
larva_hud()
|
||||
|
||||
else if(isalien(mymob))
|
||||
alien_hud()
|
||||
|
||||
else if(isAI(mymob))
|
||||
ai_hud()
|
||||
|
||||
else if(isrobot(mymob))
|
||||
robot_hud()
|
||||
|
||||
// else if(ishivebot(mymob))
|
||||
// hivebot_hud()
|
||||
|
||||
// else if(ishivemainframe(mymob))
|
||||
// hive_mainframe_hud()
|
||||
|
||||
else if(isobserver(mymob))
|
||||
ghost_hud()
|
||||
|
||||
return
|
||||
#define ui_dropbutton "SOUTH-1,7"
|
||||
#define ui_swapbutton "SOUTH-1,7"
|
||||
#define ui_iclothing "SOUTH-1,2"
|
||||
#define ui_oclothing "SOUTH,2"
|
||||
//#define ui_headset "SOUTH,8"
|
||||
#define ui_rhand "SOUTH,1"
|
||||
#define ui_lhand "SOUTH,3"
|
||||
#define ui_id "SOUTH-1,1"
|
||||
#define ui_mask "SOUTH+1,1"
|
||||
#define ui_back "SOUTH+1,3"
|
||||
#define ui_storage1 "SOUTH-1,4"
|
||||
#define ui_storage2 "SOUTH-1,5"
|
||||
#define ui_sstore1 "SOUTH+1,4"
|
||||
#define ui_hstore1 "SOUTH+1,5"
|
||||
#define ui_resist "EAST+1,SOUTH-1"
|
||||
#define ui_gloves "SOUTH,5"
|
||||
#define ui_glasses "SOUTH,7"
|
||||
#define ui_ears "SOUTH,6"
|
||||
#define ui_head "SOUTH+1,2"
|
||||
#define ui_shoes "SOUTH,4"
|
||||
#define ui_belt "SOUTH-1,3"
|
||||
#define ui_throw "SOUTH-1,8"
|
||||
#define ui_oxygen "EAST+1, NORTH-4"
|
||||
#define ui_pressure "EAST+1, NORTH-5"
|
||||
#define ui_toxin "EAST+1, NORTH-6"
|
||||
#define ui_internal "EAST+1, NORTH-2"
|
||||
#define ui_fire "EAST+1, NORTH-8"
|
||||
#define ui_temp "EAST+1, NORTH-10"
|
||||
#define ui_health "EAST+1, NORTH-11"
|
||||
#define ui_nutrition "EAST+1, NORTH-12"
|
||||
#define ui_pull "SOUTH-1,10"
|
||||
#define ui_hand "SOUTH-1,6"
|
||||
#define ui_sleep "EAST+1, NORTH-13"
|
||||
#define ui_rest "EAST+1, NORTH-14"
|
||||
|
||||
#define ui_acti "SOUTH-1,12"
|
||||
#define ui_movi "SOUTH-1,14"
|
||||
|
||||
#define ui_iarrowleft "SOUTH-1,11"
|
||||
#define ui_iarrowright "SOUTH-1,13"
|
||||
|
||||
#define ui_inv1 "SOUTH-1,1"
|
||||
#define ui_inv2 "SOUTH-1,2"
|
||||
#define ui_inv3 "SOUTH-1,3"
|
||||
|
||||
|
||||
|
||||
obj/hud/New(var/type = 0)
|
||||
instantiate(type)
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
/obj/hud/proc/other_update()
|
||||
|
||||
if(!mymob) return
|
||||
if(show_otherinventory)
|
||||
if(mymob:shoes) mymob:shoes:screen_loc = ui_shoes
|
||||
if(mymob:gloves) mymob:gloves:screen_loc = ui_gloves
|
||||
if(mymob:ears) mymob:ears:screen_loc = ui_ears
|
||||
if(mymob:s_store) mymob:s_store:screen_loc = ui_sstore1
|
||||
if(mymob:glasses) mymob:glasses:screen_loc = ui_glasses
|
||||
if(mymob:h_store) mymob:h_store:screen_loc = ui_hstore1
|
||||
else
|
||||
if(istype(mymob, /mob/living/carbon/human))
|
||||
if(mymob:shoes) mymob:shoes:screen_loc = null
|
||||
if(mymob:gloves) mymob:gloves:screen_loc = null
|
||||
if(mymob:ears) mymob:ears:screen_loc = null
|
||||
if(mymob:s_store) mymob:s_store:screen_loc = null
|
||||
if(mymob:glasses) mymob:glasses:screen_loc = null
|
||||
if(mymob:h_store) mymob:h_store:screen_loc = null
|
||||
|
||||
|
||||
/obj/hud/var/show_otherinventory = 1
|
||||
/obj/hud/var/obj/screen/action_intent
|
||||
/obj/hud/var/obj/screen/move_intent
|
||||
|
||||
/obj/hud/proc/instantiate(var/type = 0)
|
||||
|
||||
mymob = loc
|
||||
ASSERT(istype(mymob, /mob))
|
||||
|
||||
if(ishuman(mymob))
|
||||
human_hud(mymob.UI) // Pass the player the UI style chosen in preferences
|
||||
|
||||
else if(ismonkey(mymob))
|
||||
monkey_hud(mymob.UI)
|
||||
|
||||
else if(isbrain(mymob))
|
||||
brain_hud(mymob.UI)
|
||||
|
||||
else if(islarva(mymob))
|
||||
larva_hud()
|
||||
|
||||
else if(isalien(mymob))
|
||||
alien_hud()
|
||||
|
||||
else if(isAI(mymob))
|
||||
ai_hud()
|
||||
|
||||
else if(isrobot(mymob))
|
||||
robot_hud()
|
||||
|
||||
// else if(ishivebot(mymob))
|
||||
// hivebot_hud()
|
||||
|
||||
// else if(ishivemainframe(mymob))
|
||||
// hive_mainframe_hud()
|
||||
|
||||
else if(isobserver(mymob))
|
||||
ghost_hud()
|
||||
|
||||
return
|
||||
|
||||
+447
-447
@@ -1,447 +1,447 @@
|
||||
obj/machinery/air_sensor
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "gsensor1"
|
||||
name = "Gas Sensor"
|
||||
|
||||
anchored = 1
|
||||
var/state = 0
|
||||
|
||||
var/id_tag
|
||||
var/frequency = 1439
|
||||
|
||||
var/on = 1
|
||||
var/output = 3
|
||||
//Flags:
|
||||
// 1 for pressure
|
||||
// 2 for temperature
|
||||
// Output >= 4 includes gas composition
|
||||
// 4 for oxygen concentration
|
||||
// 8 for toxins concentration
|
||||
// 16 for nitrogen concentration
|
||||
// 32 for carbon dioxide concentration
|
||||
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
update_icon()
|
||||
icon_state = "gsensor[on]"
|
||||
|
||||
process()
|
||||
if(on)
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.data["tag"] = id_tag
|
||||
signal.data["timestamp"] = world.time
|
||||
|
||||
var/datum/gas_mixture/air_sample = return_air()
|
||||
|
||||
if(output&1)
|
||||
signal.data["pressure"] = num2text(round(air_sample.return_pressure(),0.1),)
|
||||
if(output&2)
|
||||
signal.data["temperature"] = round(air_sample.temperature,0.1)
|
||||
|
||||
if(output>4)
|
||||
var/total_moles = air_sample.total_moles()
|
||||
if(total_moles > 0)
|
||||
if(output&4)
|
||||
signal.data["oxygen"] = round(100*air_sample.oxygen/total_moles,0.1)
|
||||
if(output&8)
|
||||
signal.data["toxins"] = round(100*air_sample.toxins/total_moles,0.1)
|
||||
if(output&16)
|
||||
signal.data["nitrogen"] = round(100*air_sample.nitrogen/total_moles,0.1)
|
||||
if(output&32)
|
||||
signal.data["carbon_dioxide"] = round(100*air_sample.carbon_dioxide/total_moles,0.1)
|
||||
else
|
||||
signal.data["oxygen"] = 0
|
||||
signal.data["toxins"] = 0
|
||||
signal.data["nitrogen"] = 0
|
||||
signal.data["carbon_dioxide"] = 0
|
||||
signal.data["sigtype"]="status"
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA)
|
||||
|
||||
initialize()
|
||||
set_frequency(frequency)
|
||||
|
||||
New()
|
||||
..()
|
||||
|
||||
if(radio_controller)
|
||||
set_frequency(frequency)
|
||||
|
||||
obj/machinery/computer/general_air_control
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "computer_generic"
|
||||
|
||||
name = "Computer"
|
||||
|
||||
var/frequency = 1439
|
||||
var/list/sensors = list()
|
||||
|
||||
var/list/sensor_information = list()
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
attack_hand(mob/user)
|
||||
user << browse(return_text(),"window=computer")
|
||||
user.machine = src
|
||||
onclose(user, "computer")
|
||||
|
||||
process()
|
||||
..()
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/air_management/M = new /obj/item/weapon/circuitboard/air_management( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/air_management/M = new /obj/item/weapon/circuitboard/air_management( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
var/id_tag = signal.data["tag"]
|
||||
if(!id_tag || !sensors.Find(id_tag)) return
|
||||
|
||||
sensor_information[id_tag] = signal.data
|
||||
|
||||
proc/return_text()
|
||||
var/sensor_data
|
||||
if(sensors.len)
|
||||
for(var/id_tag in sensors)
|
||||
var/long_name = sensors[id_tag]
|
||||
var/list/data = sensor_information[id_tag]
|
||||
var/sensor_part = "<B>[long_name]</B>:<BR>"
|
||||
|
||||
if(data)
|
||||
if(data["pressure"])
|
||||
sensor_part += " <B>Pressure:</B> [data["pressure"]] kPa<BR>"
|
||||
if(data["temperature"])
|
||||
sensor_part += " <B>Temperature:</B> [data["temperature"]] K<BR>"
|
||||
if(data["oxygen"]||data["toxins"]||data["nitrogen"]||data["carbon_dioxide"])
|
||||
sensor_part += " <B>Gas Composition :</B>"
|
||||
if(data["oxygen"])
|
||||
sensor_part += "[data["oxygen"]]% O2; "
|
||||
if(data["nitrogen"])
|
||||
sensor_part += "[data["nitrogen"]]% N; "
|
||||
if(data["carbon_dioxide"])
|
||||
sensor_part += "[data["carbon_dioxide"]]% CO2; "
|
||||
if(data["toxins"])
|
||||
sensor_part += "[data["toxins"]]% TX; "
|
||||
sensor_part += "<HR>"
|
||||
|
||||
else
|
||||
sensor_part = "<FONT color='red'>[long_name] can not be found!</FONT><BR>"
|
||||
|
||||
sensor_data += sensor_part
|
||||
|
||||
else
|
||||
sensor_data = "No sensors connected."
|
||||
|
||||
var/output = {"<B>[name]</B><HR>
|
||||
<B>Sensor Data:</B><HR><HR>[sensor_data]"}
|
||||
|
||||
return output
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA)
|
||||
|
||||
initialize()
|
||||
set_frequency(frequency)
|
||||
|
||||
large_tank_control
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "tank"
|
||||
|
||||
var/input_tag
|
||||
var/output_tag
|
||||
|
||||
var/list/input_info
|
||||
var/list/output_info
|
||||
|
||||
var/pressure_setting = ONE_ATMOSPHERE * 45
|
||||
|
||||
|
||||
return_text()
|
||||
var/output = ..()
|
||||
//if(signal.data)
|
||||
// input_info = signal.data // Attempting to fix intake control -- TLE
|
||||
|
||||
output += "<B>Tank Control System</B><BR>"
|
||||
if(input_info)
|
||||
var/power = (input_info["power"])
|
||||
var/volume_rate = input_info["volume_rate"]
|
||||
output += {"<B>Input</B>: [power?("Injecting"):("On Hold")] <A href='?src=\ref[src];in_refresh_status=1'>Refresh</A><BR>
|
||||
Rate: [volume_rate] L/sec<BR>"}
|
||||
output += "Command: <A href='?src=\ref[src];in_toggle_injector=1'>Toggle Power</A><BR>"
|
||||
|
||||
else
|
||||
output += "<FONT color='red'>ERROR: Can not find input port</FONT> <A href='?src=\ref[src];in_refresh_status=1'>Search</A><BR>"
|
||||
|
||||
output += "<BR>"
|
||||
|
||||
if(output_info)
|
||||
var/power = (output_info["power"])
|
||||
var/output_pressure = output_info["internal"]
|
||||
output += {"<B>Output</B>: [power?("Open"):("On Hold")] <A href='?src=\ref[src];out_refresh_status=1'>Refresh</A><BR>
|
||||
Max Output Pressure: [output_pressure] kPa<BR>"}
|
||||
output += "Command: <A href='?src=\ref[src];out_toggle_power=1'>Toggle Power</A> <A href='?src=\ref[src];out_set_pressure=1'>Set Pressure</A><BR>"
|
||||
|
||||
else
|
||||
output += "<FONT color='red'>ERROR: Can not find output port</FONT> <A href='?src=\ref[src];out_refresh_status=1'>Search</A><BR>"
|
||||
|
||||
output += "Max Output Pressure Set: <A href='?src=\ref[src];adj_pressure=-100'>-</A> <A href='?src=\ref[src];adj_pressure=-1'>-</A> [pressure_setting] kPa <A href='?src=\ref[src];adj_pressure=1'>+</A> <A href='?src=\ref[src];adj_pressure=100'>+</A><BR>"
|
||||
|
||||
return output
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
var/id_tag = signal.data["tag"]
|
||||
|
||||
if(input_tag == id_tag)
|
||||
input_info = signal.data
|
||||
else if(output_tag == id_tag)
|
||||
output_info = signal.data
|
||||
else
|
||||
..(signal)
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["adj_pressure"])
|
||||
var/change = text2num(href_list["adj_pressure"])
|
||||
pressure_setting = between(0, pressure_setting + change, 50*ONE_ATMOSPHERE)
|
||||
spawn(1)
|
||||
src.updateDialog()
|
||||
return
|
||||
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
if(href_list["in_refresh_status"])
|
||||
input_info = null
|
||||
signal.data = list ("tag" = input_tag, "status")
|
||||
|
||||
if(href_list["in_toggle_injector"])
|
||||
input_info = null
|
||||
signal.data = list ("tag" = input_tag, "power_toggle")
|
||||
|
||||
if(href_list["out_refresh_status"])
|
||||
output_info = null
|
||||
signal.data = list ("tag" = output_tag, "status")
|
||||
|
||||
if(href_list["out_toggle_power"])
|
||||
output_info = null
|
||||
signal.data = list ("tag" = output_tag, "power_toggle")
|
||||
|
||||
if(href_list["out_set_pressure"])
|
||||
output_info = null
|
||||
signal.data = list ("tag" = output_tag, "set_internal_pressure" = "[pressure_setting]")
|
||||
|
||||
signal.data["sigtype"]="command"
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
spawn(5)
|
||||
src.updateDialog()
|
||||
|
||||
fuel_injection
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "atmos"
|
||||
|
||||
var/device_tag
|
||||
var/list/device_info
|
||||
|
||||
var/automation = 0
|
||||
|
||||
var/cutoff_temperature = 2000
|
||||
var/on_temperature = 1200
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/injector_control/M = new /obj/item/weapon/circuitboard/injector_control( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/injector_control/M = new /obj/item/weapon/circuitboard/injector_control( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
process()
|
||||
if(automation)
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/injecting = 0
|
||||
for(var/id_tag in sensor_information)
|
||||
var/list/data = sensor_information[id_tag]
|
||||
if(data["temperature"])
|
||||
if(data["temperature"] >= cutoff_temperature)
|
||||
injecting = 0
|
||||
break
|
||||
if(data["temperature"] <= on_temperature)
|
||||
injecting = 1
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
"tag" = device_tag,
|
||||
"power" = injecting,
|
||||
"sigtype"="command"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
..()
|
||||
|
||||
return_text()
|
||||
var/output = ..()
|
||||
|
||||
output += "<B>Fuel Injection System</B><BR>"
|
||||
if(device_info)
|
||||
var/power = device_info["power"]
|
||||
var/volume_rate = device_info["volume_rate"]
|
||||
output += {"Status: [power?("Injecting"):("On Hold")] <A href='?src=\ref[src];refresh_status=1'>Refresh</A><BR>
|
||||
Rate: [volume_rate] L/sec<BR>"}
|
||||
|
||||
if(automation)
|
||||
output += "Automated Fuel Injection: <A href='?src=\ref[src];toggle_automation=1'>Engaged</A><BR>"
|
||||
output += "Injector Controls Locked Out<BR>"
|
||||
else
|
||||
output += "Automated Fuel Injection: <A href='?src=\ref[src];toggle_automation=1'>Disengaged</A><BR>"
|
||||
output += "Injector: <A href='?src=\ref[src];toggle_injector=1'>Toggle Power</A> <A href='?src=\ref[src];injection=1'>Inject (1 Cycle)</A><BR>"
|
||||
|
||||
else
|
||||
output += "<FONT color='red'>ERROR: Can not find device</FONT> <A href='?src=\ref[src];refresh_status=1'>Search</A><BR>"
|
||||
|
||||
return output
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
var/id_tag = signal.data["tag"]
|
||||
|
||||
if(device_tag == id_tag)
|
||||
device_info = signal.data
|
||||
else
|
||||
..(signal)
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["refresh_status"])
|
||||
device_info = null
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
signal.data = list(
|
||||
"tag" = device_tag,
|
||||
"status",
|
||||
"sigtype"="command"
|
||||
)
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
if(href_list["toggle_automation"])
|
||||
automation = !automation
|
||||
|
||||
if(href_list["toggle_injector"])
|
||||
device_info = null
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
signal.data = list(
|
||||
"tag" = device_tag,
|
||||
"power_toggle",
|
||||
"sigtype"="command"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
if(href_list["injection"])
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
signal.data = list(
|
||||
"tag" = device_tag,
|
||||
"inject",
|
||||
"sigtype"="command"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
|
||||
|
||||
|
||||
obj/machinery/air_sensor
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "gsensor1"
|
||||
name = "Gas Sensor"
|
||||
|
||||
anchored = 1
|
||||
var/state = 0
|
||||
|
||||
var/id_tag
|
||||
var/frequency = 1439
|
||||
|
||||
var/on = 1
|
||||
var/output = 3
|
||||
//Flags:
|
||||
// 1 for pressure
|
||||
// 2 for temperature
|
||||
// Output >= 4 includes gas composition
|
||||
// 4 for oxygen concentration
|
||||
// 8 for toxins concentration
|
||||
// 16 for nitrogen concentration
|
||||
// 32 for carbon dioxide concentration
|
||||
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
update_icon()
|
||||
icon_state = "gsensor[on]"
|
||||
|
||||
process()
|
||||
if(on)
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.data["tag"] = id_tag
|
||||
signal.data["timestamp"] = world.time
|
||||
|
||||
var/datum/gas_mixture/air_sample = return_air()
|
||||
|
||||
if(output&1)
|
||||
signal.data["pressure"] = num2text(round(air_sample.return_pressure(),0.1),)
|
||||
if(output&2)
|
||||
signal.data["temperature"] = round(air_sample.temperature,0.1)
|
||||
|
||||
if(output>4)
|
||||
var/total_moles = air_sample.total_moles()
|
||||
if(total_moles > 0)
|
||||
if(output&4)
|
||||
signal.data["oxygen"] = round(100*air_sample.oxygen/total_moles,0.1)
|
||||
if(output&8)
|
||||
signal.data["toxins"] = round(100*air_sample.toxins/total_moles,0.1)
|
||||
if(output&16)
|
||||
signal.data["nitrogen"] = round(100*air_sample.nitrogen/total_moles,0.1)
|
||||
if(output&32)
|
||||
signal.data["carbon_dioxide"] = round(100*air_sample.carbon_dioxide/total_moles,0.1)
|
||||
else
|
||||
signal.data["oxygen"] = 0
|
||||
signal.data["toxins"] = 0
|
||||
signal.data["nitrogen"] = 0
|
||||
signal.data["carbon_dioxide"] = 0
|
||||
signal.data["sigtype"]="status"
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA)
|
||||
|
||||
initialize()
|
||||
set_frequency(frequency)
|
||||
|
||||
New()
|
||||
..()
|
||||
|
||||
if(radio_controller)
|
||||
set_frequency(frequency)
|
||||
|
||||
obj/machinery/computer/general_air_control
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "computer_generic"
|
||||
|
||||
name = "Computer"
|
||||
|
||||
var/frequency = 1439
|
||||
var/list/sensors = list()
|
||||
|
||||
var/list/sensor_information = list()
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
attack_hand(mob/user)
|
||||
user << browse(return_text(),"window=computer")
|
||||
user.machine = src
|
||||
onclose(user, "computer")
|
||||
|
||||
process()
|
||||
..()
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/air_management/M = new /obj/item/weapon/circuitboard/air_management( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/air_management/M = new /obj/item/weapon/circuitboard/air_management( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
var/id_tag = signal.data["tag"]
|
||||
if(!id_tag || !sensors.Find(id_tag)) return
|
||||
|
||||
sensor_information[id_tag] = signal.data
|
||||
|
||||
proc/return_text()
|
||||
var/sensor_data
|
||||
if(sensors.len)
|
||||
for(var/id_tag in sensors)
|
||||
var/long_name = sensors[id_tag]
|
||||
var/list/data = sensor_information[id_tag]
|
||||
var/sensor_part = "<B>[long_name]</B>:<BR>"
|
||||
|
||||
if(data)
|
||||
if(data["pressure"])
|
||||
sensor_part += " <B>Pressure:</B> [data["pressure"]] kPa<BR>"
|
||||
if(data["temperature"])
|
||||
sensor_part += " <B>Temperature:</B> [data["temperature"]] K<BR>"
|
||||
if(data["oxygen"]||data["toxins"]||data["nitrogen"]||data["carbon_dioxide"])
|
||||
sensor_part += " <B>Gas Composition :</B>"
|
||||
if(data["oxygen"])
|
||||
sensor_part += "[data["oxygen"]]% O2; "
|
||||
if(data["nitrogen"])
|
||||
sensor_part += "[data["nitrogen"]]% N; "
|
||||
if(data["carbon_dioxide"])
|
||||
sensor_part += "[data["carbon_dioxide"]]% CO2; "
|
||||
if(data["toxins"])
|
||||
sensor_part += "[data["toxins"]]% TX; "
|
||||
sensor_part += "<HR>"
|
||||
|
||||
else
|
||||
sensor_part = "<FONT color='red'>[long_name] can not be found!</FONT><BR>"
|
||||
|
||||
sensor_data += sensor_part
|
||||
|
||||
else
|
||||
sensor_data = "No sensors connected."
|
||||
|
||||
var/output = {"<B>[name]</B><HR>
|
||||
<B>Sensor Data:</B><HR><HR>[sensor_data]"}
|
||||
|
||||
return output
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA)
|
||||
|
||||
initialize()
|
||||
set_frequency(frequency)
|
||||
|
||||
large_tank_control
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "tank"
|
||||
|
||||
var/input_tag
|
||||
var/output_tag
|
||||
|
||||
var/list/input_info
|
||||
var/list/output_info
|
||||
|
||||
var/pressure_setting = ONE_ATMOSPHERE * 45
|
||||
|
||||
|
||||
return_text()
|
||||
var/output = ..()
|
||||
//if(signal.data)
|
||||
// input_info = signal.data // Attempting to fix intake control -- TLE
|
||||
|
||||
output += "<B>Tank Control System</B><BR>"
|
||||
if(input_info)
|
||||
var/power = (input_info["power"])
|
||||
var/volume_rate = input_info["volume_rate"]
|
||||
output += {"<B>Input</B>: [power?("Injecting"):("On Hold")] <A href='?src=\ref[src];in_refresh_status=1'>Refresh</A><BR>
|
||||
Rate: [volume_rate] L/sec<BR>"}
|
||||
output += "Command: <A href='?src=\ref[src];in_toggle_injector=1'>Toggle Power</A><BR>"
|
||||
|
||||
else
|
||||
output += "<FONT color='red'>ERROR: Can not find input port</FONT> <A href='?src=\ref[src];in_refresh_status=1'>Search</A><BR>"
|
||||
|
||||
output += "<BR>"
|
||||
|
||||
if(output_info)
|
||||
var/power = (output_info["power"])
|
||||
var/output_pressure = output_info["internal"]
|
||||
output += {"<B>Output</B>: [power?("Open"):("On Hold")] <A href='?src=\ref[src];out_refresh_status=1'>Refresh</A><BR>
|
||||
Max Output Pressure: [output_pressure] kPa<BR>"}
|
||||
output += "Command: <A href='?src=\ref[src];out_toggle_power=1'>Toggle Power</A> <A href='?src=\ref[src];out_set_pressure=1'>Set Pressure</A><BR>"
|
||||
|
||||
else
|
||||
output += "<FONT color='red'>ERROR: Can not find output port</FONT> <A href='?src=\ref[src];out_refresh_status=1'>Search</A><BR>"
|
||||
|
||||
output += "Max Output Pressure Set: <A href='?src=\ref[src];adj_pressure=-100'>-</A> <A href='?src=\ref[src];adj_pressure=-1'>-</A> [pressure_setting] kPa <A href='?src=\ref[src];adj_pressure=1'>+</A> <A href='?src=\ref[src];adj_pressure=100'>+</A><BR>"
|
||||
|
||||
return output
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
var/id_tag = signal.data["tag"]
|
||||
|
||||
if(input_tag == id_tag)
|
||||
input_info = signal.data
|
||||
else if(output_tag == id_tag)
|
||||
output_info = signal.data
|
||||
else
|
||||
..(signal)
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["adj_pressure"])
|
||||
var/change = text2num(href_list["adj_pressure"])
|
||||
pressure_setting = between(0, pressure_setting + change, 50*ONE_ATMOSPHERE)
|
||||
spawn(1)
|
||||
src.updateDialog()
|
||||
return
|
||||
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
if(href_list["in_refresh_status"])
|
||||
input_info = null
|
||||
signal.data = list ("tag" = input_tag, "status")
|
||||
|
||||
if(href_list["in_toggle_injector"])
|
||||
input_info = null
|
||||
signal.data = list ("tag" = input_tag, "power_toggle")
|
||||
|
||||
if(href_list["out_refresh_status"])
|
||||
output_info = null
|
||||
signal.data = list ("tag" = output_tag, "status")
|
||||
|
||||
if(href_list["out_toggle_power"])
|
||||
output_info = null
|
||||
signal.data = list ("tag" = output_tag, "power_toggle")
|
||||
|
||||
if(href_list["out_set_pressure"])
|
||||
output_info = null
|
||||
signal.data = list ("tag" = output_tag, "set_internal_pressure" = "[pressure_setting]")
|
||||
|
||||
signal.data["sigtype"]="command"
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
spawn(5)
|
||||
src.updateDialog()
|
||||
|
||||
fuel_injection
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "atmos"
|
||||
|
||||
var/device_tag
|
||||
var/list/device_info
|
||||
|
||||
var/automation = 0
|
||||
|
||||
var/cutoff_temperature = 2000
|
||||
var/on_temperature = 1200
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/injector_control/M = new /obj/item/weapon/circuitboard/injector_control( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/injector_control/M = new /obj/item/weapon/circuitboard/injector_control( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
process()
|
||||
if(automation)
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/injecting = 0
|
||||
for(var/id_tag in sensor_information)
|
||||
var/list/data = sensor_information[id_tag]
|
||||
if(data["temperature"])
|
||||
if(data["temperature"] >= cutoff_temperature)
|
||||
injecting = 0
|
||||
break
|
||||
if(data["temperature"] <= on_temperature)
|
||||
injecting = 1
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
"tag" = device_tag,
|
||||
"power" = injecting,
|
||||
"sigtype"="command"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
..()
|
||||
|
||||
return_text()
|
||||
var/output = ..()
|
||||
|
||||
output += "<B>Fuel Injection System</B><BR>"
|
||||
if(device_info)
|
||||
var/power = device_info["power"]
|
||||
var/volume_rate = device_info["volume_rate"]
|
||||
output += {"Status: [power?("Injecting"):("On Hold")] <A href='?src=\ref[src];refresh_status=1'>Refresh</A><BR>
|
||||
Rate: [volume_rate] L/sec<BR>"}
|
||||
|
||||
if(automation)
|
||||
output += "Automated Fuel Injection: <A href='?src=\ref[src];toggle_automation=1'>Engaged</A><BR>"
|
||||
output += "Injector Controls Locked Out<BR>"
|
||||
else
|
||||
output += "Automated Fuel Injection: <A href='?src=\ref[src];toggle_automation=1'>Disengaged</A><BR>"
|
||||
output += "Injector: <A href='?src=\ref[src];toggle_injector=1'>Toggle Power</A> <A href='?src=\ref[src];injection=1'>Inject (1 Cycle)</A><BR>"
|
||||
|
||||
else
|
||||
output += "<FONT color='red'>ERROR: Can not find device</FONT> <A href='?src=\ref[src];refresh_status=1'>Search</A><BR>"
|
||||
|
||||
return output
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
var/id_tag = signal.data["tag"]
|
||||
|
||||
if(device_tag == id_tag)
|
||||
device_info = signal.data
|
||||
else
|
||||
..(signal)
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["refresh_status"])
|
||||
device_info = null
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
signal.data = list(
|
||||
"tag" = device_tag,
|
||||
"status",
|
||||
"sigtype"="command"
|
||||
)
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
if(href_list["toggle_automation"])
|
||||
automation = !automation
|
||||
|
||||
if(href_list["toggle_injector"])
|
||||
device_info = null
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
signal.data = list(
|
||||
"tag" = device_tag,
|
||||
"power_toggle",
|
||||
"sigtype"="command"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
if(href_list["injection"])
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
signal.data = list(
|
||||
"tag" = device_tag,
|
||||
"inject",
|
||||
"sigtype"="command"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
volume = 750
|
||||
|
||||
stationary
|
||||
name = "Stationary Air Scrubber"
|
||||
icon_state = "scrubber:0"
|
||||
anchored = 1
|
||||
volume = 30000
|
||||
|
||||
@@ -560,6 +560,10 @@
|
||||
process_bot()
|
||||
sleep(2)
|
||||
process_bot()
|
||||
sleep(2)
|
||||
process_bot()
|
||||
sleep(2)
|
||||
process_bot()
|
||||
if(2)
|
||||
process_bot()
|
||||
spawn(4)
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
if(!charging || (stat & (BROKEN|NOPOWER)) )
|
||||
return
|
||||
|
||||
var/added = charging.give(50)
|
||||
var/added = charging.give(500)
|
||||
use_power(added / CELLRATE)
|
||||
|
||||
updateicon()
|
||||
@@ -22,10 +22,10 @@
|
||||
var/name_part1
|
||||
var/name_part2
|
||||
|
||||
name_action = pick("Defeat ", "Annihilate ", "Save ", "Strike ", "Stop ", "Destroy ", "Robust ", "Romance ", "Rape ", "Pwn ", "Own ")
|
||||
name_action = pick("Defeat ", "Annihilate ", "Save ", "Strike ", "Stop ", "Destroy ", "Robust ", "Romance ", "Pwn ", "Own ")
|
||||
|
||||
name_part1 = pick("the Automatic ", "Farmer ", "Lord ", "Professor ", "the Cuban ", "the Evil ", "the Dread King ", "the Space ", "Lord ", "the Faggot ", "Duke ", "General ")
|
||||
name_part2 = pick("Melonoid", "Murdertron", "Sorcerer", "Ruin", "Jeff", "Ectoplasm", "Crushulon", "Uhangoid", "Vhakoid", "Peteoid", "Metroid", "Griefer", "ERPer", "Homosexual", "Lizard Man", "Unicorn")
|
||||
name_part1 = pick("the Automatic ", "Farmer ", "Lord ", "Professor ", "the Cuban ", "the Evil ", "the Dread King ", "the Space ", "Lord ", "the Great ", "Duke ", "General ")
|
||||
name_part2 = pick("Melonoid", "Murdertron", "Sorcerer", "Ruin", "Jeff", "Ectoplasm", "Crushulon", "Uhangoid", "Vhakoid", "Peteoid", "Metroid", "Griefer", "ERPer", "Lizard Man", "Unicorn")
|
||||
|
||||
src.enemy_name = dd_replacetext((name_part1 + name_part2), "the ", "")
|
||||
src.name = (name_action + name_part1 + name_part2)
|
||||
|
||||
@@ -1,131 +1,131 @@
|
||||
/obj/machinery/computer
|
||||
name = "computer"
|
||||
icon = 'computer.dmi'
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/item/weapon/circuitboard/circuit = null //if circuit==null, computer can't disassemble
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn(2)
|
||||
power_change()
|
||||
|
||||
|
||||
meteorhit(var/obj/O as obj)
|
||||
for(var/x in verbs)
|
||||
verbs -= x
|
||||
set_broken()
|
||||
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
|
||||
smoke.set_up(5, 0, src)
|
||||
smoke.start()
|
||||
return
|
||||
|
||||
|
||||
emp_act(severity)
|
||||
if(prob(20/severity)) set_broken()
|
||||
..()
|
||||
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(25))
|
||||
del(src)
|
||||
return
|
||||
if (prob(50))
|
||||
for(var/x in verbs)
|
||||
verbs -= x
|
||||
set_broken()
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in verbs)
|
||||
verbs -= x
|
||||
set_broken()
|
||||
else
|
||||
return
|
||||
|
||||
|
||||
blob_act()
|
||||
if (prob(75))
|
||||
for(var/x in verbs)
|
||||
verbs -= x
|
||||
set_broken()
|
||||
density = 0
|
||||
|
||||
|
||||
power_change()
|
||||
if(!istype(src,/obj/machinery/computer/security/telescreen))
|
||||
if(stat & BROKEN)
|
||||
icon_state = initial(icon_state)
|
||||
icon_state += "b"
|
||||
if (istype(src,/obj/machinery/computer/aifixer))
|
||||
overlays = null
|
||||
|
||||
else if(powered())
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
if (istype(src,/obj/machinery/computer/aifixer))
|
||||
var/obj/machinery/computer/aifixer/O = src
|
||||
if (O.occupant)
|
||||
switch (O.occupant.stat)
|
||||
if (0)
|
||||
overlays += image('computer.dmi', "ai-fixer-full")
|
||||
if (2)
|
||||
overlays += image('computer.dmi', "ai-fixer-404")
|
||||
else
|
||||
overlays += image('computer.dmi', "ai-fixer-empty")
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
//icon_state = "c_unpowered"
|
||||
icon_state = initial(icon_state)
|
||||
icon_state += "0"
|
||||
stat |= NOPOWER
|
||||
if (istype(src,/obj/machinery/computer/aifixer))
|
||||
overlays = null
|
||||
|
||||
|
||||
process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(250)
|
||||
|
||||
|
||||
proc/set_broken()
|
||||
icon_state = initial(icon_state)
|
||||
icon_state += "b"
|
||||
stat |= BROKEN
|
||||
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver) && circuit)
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/M = new circuit( A )
|
||||
A.circuit = M
|
||||
A.anchored = 1
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
del(src)
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer
|
||||
name = "computer"
|
||||
icon = 'computer.dmi'
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/item/weapon/circuitboard/circuit = null //if circuit==null, computer can't disassemble
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn(2)
|
||||
power_change()
|
||||
|
||||
|
||||
meteorhit(var/obj/O as obj)
|
||||
for(var/x in verbs)
|
||||
verbs -= x
|
||||
set_broken()
|
||||
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
|
||||
smoke.set_up(5, 0, src)
|
||||
smoke.start()
|
||||
return
|
||||
|
||||
|
||||
emp_act(severity)
|
||||
if(prob(20/severity)) set_broken()
|
||||
..()
|
||||
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(25))
|
||||
del(src)
|
||||
return
|
||||
if (prob(50))
|
||||
for(var/x in verbs)
|
||||
verbs -= x
|
||||
set_broken()
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in verbs)
|
||||
verbs -= x
|
||||
set_broken()
|
||||
else
|
||||
return
|
||||
|
||||
|
||||
blob_act()
|
||||
if (prob(75))
|
||||
for(var/x in verbs)
|
||||
verbs -= x
|
||||
set_broken()
|
||||
density = 0
|
||||
|
||||
|
||||
power_change()
|
||||
if(!istype(src,/obj/machinery/computer/security/telescreen))
|
||||
if(stat & BROKEN)
|
||||
icon_state = initial(icon_state)
|
||||
icon_state += "b"
|
||||
if (istype(src,/obj/machinery/computer/aifixer))
|
||||
overlays = null
|
||||
|
||||
else if(powered())
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
if (istype(src,/obj/machinery/computer/aifixer))
|
||||
var/obj/machinery/computer/aifixer/O = src
|
||||
if (O.occupant)
|
||||
switch (O.occupant.stat)
|
||||
if (0)
|
||||
overlays += image('computer.dmi', "ai-fixer-full")
|
||||
if (2)
|
||||
overlays += image('computer.dmi', "ai-fixer-404")
|
||||
else
|
||||
overlays += image('computer.dmi', "ai-fixer-empty")
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
//icon_state = "c_unpowered"
|
||||
icon_state = initial(icon_state)
|
||||
icon_state += "0"
|
||||
stat |= NOPOWER
|
||||
if (istype(src,/obj/machinery/computer/aifixer))
|
||||
overlays = null
|
||||
|
||||
|
||||
process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(250)
|
||||
|
||||
|
||||
proc/set_broken()
|
||||
icon_state = initial(icon_state)
|
||||
icon_state += "b"
|
||||
stat |= BROKEN
|
||||
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver) && circuit)
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/M = new circuit( A )
|
||||
A.circuit = M
|
||||
A.anchored = 1
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
del(src)
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ to destroy them and players will be able to make replacements.
|
||||
build_path = "/obj/machinery/r_n_d/destructive_analyzer"
|
||||
board_type = "machine"
|
||||
origin_tech = "magnets=2;engineering=2;programming=2"
|
||||
frame_desc = "Requires 2 Scanning Modules, 1 Manipulator, and 1 Micro-Laser."
|
||||
frame_desc = "Requires 1 Scanning Module, 1 Manipulator, and 1 Micro-Laser."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/scanning_module" = 1,
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 1,
|
||||
|
||||
@@ -1,72 +1,72 @@
|
||||
obj/machinery/recharger
|
||||
anchored = 1.0
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "recharger0"
|
||||
name = "recharger"
|
||||
use_power = 1
|
||||
idle_power_usage = 4
|
||||
active_power_usage = 250
|
||||
|
||||
var
|
||||
obj/item/weapon/gun/energy/charging = null
|
||||
obj/item/weapon/melee/baton/charging2 = null
|
||||
|
||||
/obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob)
|
||||
if (src.charging || src.charging2)
|
||||
return
|
||||
if (istype(G, /obj/item/weapon/gun/energy))
|
||||
if (istype(G, /obj/item/weapon/gun/energy/gun/nuclear) || istype(G, /obj/item/weapon/gun/energy/crossbow))
|
||||
user << "Your gun's recharge port was removed to make room for a miniaturized reactor."
|
||||
return
|
||||
if (istype(G, /obj/item/weapon/gun/energy/staff))
|
||||
user << "It's a wooden staff, not a gun!"
|
||||
return
|
||||
user.drop_item()
|
||||
G.loc = src
|
||||
src.charging = G
|
||||
use_power = 2
|
||||
if (istype(G, /obj/item/weapon/melee/baton))
|
||||
user.drop_item()
|
||||
G.loc = src
|
||||
src.charging2 = G
|
||||
use_power = 2
|
||||
|
||||
/obj/machinery/recharger/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
if(ishuman(user))
|
||||
if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
|
||||
call(/obj/item/clothing/gloves/space_ninja/proc/drain)("MACHINERY",src,user:wear_suit)
|
||||
return
|
||||
|
||||
if (src.charging)
|
||||
src.charging.update_icon()
|
||||
src.charging.loc = src.loc
|
||||
src.charging = null
|
||||
use_power = 1
|
||||
if(src.charging2)
|
||||
src.charging2.update_icon()
|
||||
src.charging2.loc = src.loc
|
||||
src.charging2 = null
|
||||
use_power = 1
|
||||
|
||||
/obj/machinery/recharger/attack_paw(mob/user as mob)
|
||||
if ((ticker && ticker.mode.name == "monkey"))
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/recharger/process()
|
||||
if ((src.charging) && ! (stat & NOPOWER) )
|
||||
if (src.charging.power_supply.charge < src.charging.power_supply.maxcharge)
|
||||
src.charging.power_supply.give(100)
|
||||
src.icon_state = "recharger1"
|
||||
use_power(250)
|
||||
else
|
||||
src.icon_state = "recharger2"
|
||||
if ((src.charging2) && ! (stat & NOPOWER) )
|
||||
if (src.charging2.charges < src.charging2.maximum_charges)
|
||||
src.charging2.charges++
|
||||
src.icon_state = "recharger1"
|
||||
use_power(250)
|
||||
else
|
||||
src.icon_state = "recharger2"
|
||||
else if (!(src.charging || src.charging2))
|
||||
src.icon_state = "recharger0"
|
||||
obj/machinery/recharger
|
||||
anchored = 1.0
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "recharger0"
|
||||
name = "recharger"
|
||||
use_power = 1
|
||||
idle_power_usage = 4
|
||||
active_power_usage = 250
|
||||
|
||||
var
|
||||
obj/item/weapon/gun/energy/charging = null
|
||||
obj/item/weapon/melee/baton/charging2 = null
|
||||
|
||||
/obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob)
|
||||
if (src.charging || src.charging2)
|
||||
return
|
||||
if (istype(G, /obj/item/weapon/gun/energy))
|
||||
if (istype(G, /obj/item/weapon/gun/energy/gun/nuclear) || istype(G, /obj/item/weapon/gun/energy/crossbow))
|
||||
user << "Your gun's recharge port was removed to make room for a miniaturized reactor."
|
||||
return
|
||||
if (istype(G, /obj/item/weapon/gun/energy/staff))
|
||||
user << "It's a wooden staff, not a gun!"
|
||||
return
|
||||
user.drop_item()
|
||||
G.loc = src
|
||||
src.charging = G
|
||||
use_power = 2
|
||||
if (istype(G, /obj/item/weapon/melee/baton))
|
||||
user.drop_item()
|
||||
G.loc = src
|
||||
src.charging2 = G
|
||||
use_power = 2
|
||||
|
||||
/obj/machinery/recharger/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
if(ishuman(user))
|
||||
if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
|
||||
call(/obj/item/clothing/gloves/space_ninja/proc/drain)("MACHINERY",src,user:wear_suit)
|
||||
return
|
||||
|
||||
if (src.charging)
|
||||
src.charging.update_icon()
|
||||
src.charging.loc = src.loc
|
||||
src.charging = null
|
||||
use_power = 1
|
||||
if(src.charging2)
|
||||
src.charging2.update_icon()
|
||||
src.charging2.loc = src.loc
|
||||
src.charging2 = null
|
||||
use_power = 1
|
||||
|
||||
/obj/machinery/recharger/attack_paw(mob/user as mob)
|
||||
if ((ticker && ticker.mode.name == "monkey"))
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/recharger/process()
|
||||
if ((src.charging) && ! (stat & NOPOWER) )
|
||||
if (src.charging.power_supply.charge < src.charging.power_supply.maxcharge)
|
||||
src.charging.power_supply.give(100)
|
||||
src.icon_state = "recharger1"
|
||||
use_power(250)
|
||||
else
|
||||
src.icon_state = "recharger2"
|
||||
if ((src.charging2) && ! (stat & NOPOWER) )
|
||||
if (src.charging2.charges < src.charging2.maximum_charges)
|
||||
src.charging2.charges++
|
||||
src.icon_state = "recharger1"
|
||||
use_power(250)
|
||||
else
|
||||
src.icon_state = "recharger2"
|
||||
else if (!(src.charging || src.charging2))
|
||||
src.icon_state = "recharger0"
|
||||
|
||||
+195
-195
@@ -1,196 +1,196 @@
|
||||
/obj/machinery/space_heater
|
||||
anchored = 0
|
||||
density = 1
|
||||
icon = 'atmos.dmi'
|
||||
icon_state = "sheater0"
|
||||
name = "space heater"
|
||||
desc = "Made by Space Amish using traditional space techniques, this heater is guaranteed not to set the station on fire."
|
||||
var/obj/item/weapon/cell/cell
|
||||
var/on = 0
|
||||
var/open = 0
|
||||
var/set_temperature = 50 // in celcius, add T0C for kelvin
|
||||
var/heating_power = 40000
|
||||
|
||||
flags = FPRINT
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
cell = new(src)
|
||||
cell.charge = 1000
|
||||
cell.maxcharge = 1000
|
||||
update_icon()
|
||||
return
|
||||
|
||||
update_icon()
|
||||
if(open)
|
||||
icon_state = "sheater-open"
|
||||
else
|
||||
icon_state = "sheater[on]"
|
||||
return
|
||||
|
||||
examine()
|
||||
set src in oview(12)
|
||||
if (!( usr ))
|
||||
return
|
||||
usr << "This is \icon[src] \an [src.name]."
|
||||
usr << src.desc
|
||||
|
||||
usr << "The heater is [on ? "on" : "off"] and the hatch is [open ? "open" : "closed"]."
|
||||
if(open)
|
||||
usr << "The power cell is [cell ? "installed" : "missing"]."
|
||||
else
|
||||
usr << "The charge meter reads [cell ? round(cell.percent(),1) : 0]%"
|
||||
return
|
||||
|
||||
|
||||
attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/weapon/cell))
|
||||
if(open)
|
||||
if(cell)
|
||||
user << "There is already a power cell inside."
|
||||
return
|
||||
else
|
||||
// insert cell
|
||||
var/obj/item/weapon/cell/C = usr.equipped()
|
||||
if(istype(C))
|
||||
user.drop_item()
|
||||
cell = C
|
||||
C.loc = src
|
||||
C.add_fingerprint(usr)
|
||||
|
||||
user.visible_message("\blue [user] inserts a power cell into [src].", "\blue You insert the power cell into [src].")
|
||||
else
|
||||
user << "The hatch must be open to insert a power cell."
|
||||
return
|
||||
else if(istype(I, /obj/item/weapon/screwdriver))
|
||||
open = !open
|
||||
user.visible_message("\blue [user] [open ? "opens" : "closes"] the hatch on the [src].", "\blue You [open ? "open" : "close"] the hatch on the [src].")
|
||||
update_icon()
|
||||
if(!open && user.machine == src)
|
||||
user << browse(null, "window=spaceheater")
|
||||
user.machine = null
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
if(open)
|
||||
|
||||
var/dat
|
||||
dat = "Power cell: "
|
||||
if(cell)
|
||||
dat += "<A href='byond://?src=\ref[src];op=cellremove'>Installed</A><BR>"
|
||||
else
|
||||
dat += "<A href='byond://?src=\ref[src];op=cellinstall'>Removed</A><BR>"
|
||||
|
||||
dat += "Power Level: [cell ? round(cell.percent(),1) : 0]%<BR><BR>"
|
||||
|
||||
dat += "Set Temperature: "
|
||||
|
||||
dat += "<A href='?src=\ref[src];op=temp;val=-5'>-</A>"
|
||||
|
||||
dat += " [set_temperature]°C "
|
||||
dat += "<A href='?src=\ref[src];op=temp;val=5'>+</A><BR>"
|
||||
|
||||
user.machine = src
|
||||
user << browse("<HEAD><TITLE>Space Heater Control Panel</TITLE></HEAD><TT>[dat]</TT>", "window=spaceheater")
|
||||
onclose(user, "spaceheater")
|
||||
|
||||
|
||||
|
||||
|
||||
else
|
||||
on = !on
|
||||
user.visible_message("\blue [user] switches [on ? "on" : "off"] the [src].","\blue You switch [on ? "on" : "off"] the [src].")
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if (usr.stat)
|
||||
return
|
||||
if ((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon)))
|
||||
usr.machine = src
|
||||
|
||||
switch(href_list["op"])
|
||||
|
||||
if("temp")
|
||||
var/value = text2num(href_list["val"])
|
||||
|
||||
// limit to 20-90 degC
|
||||
set_temperature = dd_range(20, 90, set_temperature + value)
|
||||
|
||||
if("cellremove")
|
||||
if(open && cell && !usr.equipped())
|
||||
cell.loc = usr
|
||||
cell.layer = 20
|
||||
if(usr.hand)
|
||||
usr.l_hand = cell
|
||||
else
|
||||
usr.r_hand = cell
|
||||
|
||||
cell.add_fingerprint(usr)
|
||||
cell.updateicon()
|
||||
cell = null
|
||||
|
||||
usr.visible_message("\blue [usr] removes the power cell from \the [src].", "\blue You remove the power cell from \the [src].")
|
||||
|
||||
|
||||
if("cellinstall")
|
||||
if(open && !cell)
|
||||
var/obj/item/weapon/cell/C = usr.equipped()
|
||||
if(istype(C))
|
||||
usr.drop_item()
|
||||
cell = C
|
||||
C.loc = src
|
||||
C.add_fingerprint(usr)
|
||||
|
||||
usr.visible_message("\blue [usr] inserts a power cell into \the [src].", "\blue You insert the power cell into \the [src].")
|
||||
|
||||
updateDialog()
|
||||
else
|
||||
usr << browse(null, "window=spaceheater")
|
||||
usr.machine = null
|
||||
return
|
||||
|
||||
|
||||
|
||||
process()
|
||||
if(on)
|
||||
if(cell && cell.charge > 0)
|
||||
|
||||
var/turf/simulated/L = loc
|
||||
if(istype(L))
|
||||
var/datum/gas_mixture/env = L.return_air()
|
||||
if(env.temperature < (set_temperature+T0C))
|
||||
|
||||
var/transfer_moles = 0.25 * env.total_moles()
|
||||
|
||||
var/datum/gas_mixture/removed = env.remove(transfer_moles)
|
||||
|
||||
//world << "got [transfer_moles] moles at [removed.temperature]"
|
||||
|
||||
if(removed)
|
||||
|
||||
var/heat_capacity = removed.heat_capacity()
|
||||
//world << "heating ([heat_capacity])"
|
||||
if(heat_capacity == 0 || heat_capacity == null) // Added check to avoid divide by zero (oshi-) runtime errors -- TLE
|
||||
heat_capacity = 1
|
||||
removed.temperature = min((removed.temperature*heat_capacity + heating_power)/heat_capacity, 1000) // Added min() check to try and avoid wacky superheating issues in low gas scenarios -- TLE
|
||||
cell.use(heating_power/20000)
|
||||
|
||||
//world << "now at [removed.temperature]"
|
||||
|
||||
env.merge(removed)
|
||||
|
||||
//world << "turf now at [env.temperature]"
|
||||
|
||||
|
||||
else
|
||||
on = 0
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/space_heater
|
||||
anchored = 0
|
||||
density = 1
|
||||
icon = 'atmos.dmi'
|
||||
icon_state = "sheater0"
|
||||
name = "space heater"
|
||||
desc = "Made by Space Amish using traditional space techniques, this heater is guaranteed not to set the station on fire."
|
||||
var/obj/item/weapon/cell/cell
|
||||
var/on = 0
|
||||
var/open = 0
|
||||
var/set_temperature = 50 // in celcius, add T0C for kelvin
|
||||
var/heating_power = 40000
|
||||
|
||||
flags = FPRINT
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
cell = new(src)
|
||||
cell.charge = 1000
|
||||
cell.maxcharge = 1000
|
||||
update_icon()
|
||||
return
|
||||
|
||||
update_icon()
|
||||
if(open)
|
||||
icon_state = "sheater-open"
|
||||
else
|
||||
icon_state = "sheater[on]"
|
||||
return
|
||||
|
||||
examine()
|
||||
set src in oview(12)
|
||||
if (!( usr ))
|
||||
return
|
||||
usr << "This is \icon[src] \an [src.name]."
|
||||
usr << src.desc
|
||||
|
||||
usr << "The heater is [on ? "on" : "off"] and the hatch is [open ? "open" : "closed"]."
|
||||
if(open)
|
||||
usr << "The power cell is [cell ? "installed" : "missing"]."
|
||||
else
|
||||
usr << "The charge meter reads [cell ? round(cell.percent(),1) : 0]%"
|
||||
return
|
||||
|
||||
|
||||
attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/weapon/cell))
|
||||
if(open)
|
||||
if(cell)
|
||||
user << "There is already a power cell inside."
|
||||
return
|
||||
else
|
||||
// insert cell
|
||||
var/obj/item/weapon/cell/C = usr.equipped()
|
||||
if(istype(C))
|
||||
user.drop_item()
|
||||
cell = C
|
||||
C.loc = src
|
||||
C.add_fingerprint(usr)
|
||||
|
||||
user.visible_message("\blue [user] inserts a power cell into [src].", "\blue You insert the power cell into [src].")
|
||||
else
|
||||
user << "The hatch must be open to insert a power cell."
|
||||
return
|
||||
else if(istype(I, /obj/item/weapon/screwdriver))
|
||||
open = !open
|
||||
user.visible_message("\blue [user] [open ? "opens" : "closes"] the hatch on the [src].", "\blue You [open ? "open" : "close"] the hatch on the [src].")
|
||||
update_icon()
|
||||
if(!open && user.machine == src)
|
||||
user << browse(null, "window=spaceheater")
|
||||
user.machine = null
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
if(open)
|
||||
|
||||
var/dat
|
||||
dat = "Power cell: "
|
||||
if(cell)
|
||||
dat += "<A href='byond://?src=\ref[src];op=cellremove'>Installed</A><BR>"
|
||||
else
|
||||
dat += "<A href='byond://?src=\ref[src];op=cellinstall'>Removed</A><BR>"
|
||||
|
||||
dat += "Power Level: [cell ? round(cell.percent(),1) : 0]%<BR><BR>"
|
||||
|
||||
dat += "Set Temperature: "
|
||||
|
||||
dat += "<A href='?src=\ref[src];op=temp;val=-5'>-</A>"
|
||||
|
||||
dat += " [set_temperature]°C "
|
||||
dat += "<A href='?src=\ref[src];op=temp;val=5'>+</A><BR>"
|
||||
|
||||
user.machine = src
|
||||
user << browse("<HEAD><TITLE>Space Heater Control Panel</TITLE></HEAD><TT>[dat]</TT>", "window=spaceheater")
|
||||
onclose(user, "spaceheater")
|
||||
|
||||
|
||||
|
||||
|
||||
else
|
||||
on = !on
|
||||
user.visible_message("\blue [user] switches [on ? "on" : "off"] the [src].","\blue You switch [on ? "on" : "off"] the [src].")
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if (usr.stat)
|
||||
return
|
||||
if ((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon)))
|
||||
usr.machine = src
|
||||
|
||||
switch(href_list["op"])
|
||||
|
||||
if("temp")
|
||||
var/value = text2num(href_list["val"])
|
||||
|
||||
// limit to 20-90 degC
|
||||
set_temperature = dd_range(20, 90, set_temperature + value)
|
||||
|
||||
if("cellremove")
|
||||
if(open && cell && !usr.equipped())
|
||||
cell.loc = usr
|
||||
cell.layer = 20
|
||||
if(usr.hand)
|
||||
usr.l_hand = cell
|
||||
else
|
||||
usr.r_hand = cell
|
||||
|
||||
cell.add_fingerprint(usr)
|
||||
cell.updateicon()
|
||||
cell = null
|
||||
|
||||
usr.visible_message("\blue [usr] removes the power cell from \the [src].", "\blue You remove the power cell from \the [src].")
|
||||
|
||||
|
||||
if("cellinstall")
|
||||
if(open && !cell)
|
||||
var/obj/item/weapon/cell/C = usr.equipped()
|
||||
if(istype(C))
|
||||
usr.drop_item()
|
||||
cell = C
|
||||
C.loc = src
|
||||
C.add_fingerprint(usr)
|
||||
|
||||
usr.visible_message("\blue [usr] inserts a power cell into \the [src].", "\blue You insert the power cell into \the [src].")
|
||||
|
||||
updateDialog()
|
||||
else
|
||||
usr << browse(null, "window=spaceheater")
|
||||
usr.machine = null
|
||||
return
|
||||
|
||||
|
||||
|
||||
process()
|
||||
if(on)
|
||||
if(cell && cell.charge > 0)
|
||||
|
||||
var/turf/simulated/L = loc
|
||||
if(istype(L))
|
||||
var/datum/gas_mixture/env = L.return_air()
|
||||
if(env.temperature < (set_temperature+T0C))
|
||||
|
||||
var/transfer_moles = 0.25 * env.total_moles()
|
||||
|
||||
var/datum/gas_mixture/removed = env.remove(transfer_moles)
|
||||
|
||||
//world << "got [transfer_moles] moles at [removed.temperature]"
|
||||
|
||||
if(removed)
|
||||
|
||||
var/heat_capacity = removed.heat_capacity()
|
||||
//world << "heating ([heat_capacity])"
|
||||
if(heat_capacity == 0 || heat_capacity == null) // Added check to avoid divide by zero (oshi-) runtime errors -- TLE
|
||||
heat_capacity = 1
|
||||
removed.temperature = min((removed.temperature*heat_capacity + heating_power)/heat_capacity, 1000) // Added min() check to try and avoid wacky superheating issues in low gas scenarios -- TLE
|
||||
cell.use(heating_power/20000)
|
||||
|
||||
//world << "now at [removed.temperature]"
|
||||
|
||||
env.merge(removed)
|
||||
|
||||
//world << "turf now at [env.temperature]"
|
||||
|
||||
|
||||
else
|
||||
on = 0
|
||||
update_icon()
|
||||
|
||||
|
||||
return
|
||||
@@ -5,6 +5,9 @@
|
||||
They receive their message from a server after the message has been logged.
|
||||
*/
|
||||
|
||||
var
|
||||
list/recentmessages = list() // global list of recent messages broadcasted : used to circumvent massive radio spam
|
||||
|
||||
|
||||
/obj/machinery/telecomms/broadcaster
|
||||
name = "Subspace Broadcaster"
|
||||
@@ -19,11 +22,17 @@
|
||||
heatgen = 60
|
||||
delay = 7
|
||||
circuitboard = "/obj/item/weapon/circuitboard/telecomms/broadcaster"
|
||||
|
||||
receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from)
|
||||
|
||||
|
||||
if(signal.data["message"])
|
||||
|
||||
// Kind of lame way to prevent MASSIVE RADIO SPAM but it works
|
||||
if("[signal.data["message"]]:[signal.data["realname"]]" in recentmessages)
|
||||
return
|
||||
recentmessages.Add( "[signal.data["message"]]:[signal.data["realname"]]" )
|
||||
|
||||
|
||||
signal.data["done"] = 1 // mark the signal as being broadcasted
|
||||
|
||||
// Search for the original signal and mark it as done as well
|
||||
@@ -44,6 +53,9 @@
|
||||
/* --- Do a snazzy animation! --- */
|
||||
flick("broadcaster_send", src)
|
||||
|
||||
spawn(1)
|
||||
recentmessages = list()
|
||||
|
||||
|
||||
/*
|
||||
Basically just an empty shell for receiving and broadcasting radio messages. Not
|
||||
@@ -68,38 +80,36 @@
|
||||
if(!on) // has to be on to receive messages
|
||||
return
|
||||
|
||||
if(signal.transmission_method == 2)
|
||||
if(is_freq_listening(signal)) // detect subspace signals
|
||||
|
||||
if(is_freq_listening(signal)) // detect subspace signals
|
||||
signal.data["done"] = 1 // mark the signal as being broadcasted
|
||||
signal.data["compression"] = 0
|
||||
|
||||
signal.data["done"] = 1 // mark the signal as being broadcasted
|
||||
signal.data["compression"] = 0
|
||||
// Search for the original signal and mark it as done as well
|
||||
var/datum/signal/original = signal.data["original"]
|
||||
if(original)
|
||||
original.data["done"] = 1
|
||||
|
||||
// Search for the original signal and mark it as done as well
|
||||
var/datum/signal/original = signal.data["original"]
|
||||
if(original)
|
||||
original.data["done"] = 1
|
||||
if(signal.data["slow"] > 0)
|
||||
sleep(signal.data["slow"]) // simulate the network lag if necessary
|
||||
|
||||
if(signal.data["slow"] > 0)
|
||||
sleep(signal.data["slow"]) // simulate the network lag if necessary
|
||||
/* ###### Broadcast a message using signal.data ###### */
|
||||
|
||||
/* ###### Broadcast a message using signal.data ###### */
|
||||
var/datum/radio_frequency/connection = signal.data["connection"]
|
||||
|
||||
var/datum/radio_frequency/connection = signal.data["connection"]
|
||||
|
||||
if(connection.frequency == SYND_FREQ) // if syndicate broadcast, just
|
||||
if(connection.frequency == SYND_FREQ) // if syndicate broadcast, just
|
||||
Broadcast_Message(signal.data["connection"], signal.data["mob"],
|
||||
signal.data["vmask"], signal.data["vmessage"],
|
||||
signal.data["radio"], signal.data["message"],
|
||||
signal.data["name"], signal.data["job"],
|
||||
signal.data["realname"], signal.data["vname"],, signal.data["compression"])
|
||||
else
|
||||
if(intercept)
|
||||
Broadcast_Message(signal.data["connection"], signal.data["mob"],
|
||||
signal.data["vmask"], signal.data["vmessage"],
|
||||
signal.data["radio"], signal.data["message"],
|
||||
signal.data["name"], signal.data["job"],
|
||||
signal.data["realname"], signal.data["vname"],, signal.data["compression"])
|
||||
else
|
||||
if(intercept)
|
||||
Broadcast_Message(signal.data["connection"], signal.data["mob"],
|
||||
signal.data["vmask"], signal.data["vmessage"],
|
||||
signal.data["radio"], signal.data["message"],
|
||||
signal.data["name"], signal.data["job"],
|
||||
signal.data["realname"], signal.data["vname"], 3, signal.data["compression"])
|
||||
signal.data["vmask"], signal.data["vmessage"],
|
||||
signal.data["radio"], signal.data["message"],
|
||||
signal.data["name"], signal.data["job"],
|
||||
signal.data["realname"], signal.data["vname"], 3, signal.data["compression"])
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -77,6 +77,9 @@
|
||||
newpath = text2path(I)
|
||||
var/obj/item/s = new newpath
|
||||
s.loc = user.loc
|
||||
if(istype(P, /obj/item/weapon/cable_coil))
|
||||
var/obj/item/weapon/cable_coil/A = P
|
||||
A.amount = 1
|
||||
|
||||
// Drop a circuit board too
|
||||
C.loc = user.loc
|
||||
@@ -113,13 +116,16 @@
|
||||
dat += "<br>Network: <a href='?src=\ref[src];input=network'>[network]</a>"
|
||||
dat += "<br>Prefabrication: [autolinkers.len ? "TRUE" : "FALSE"]"
|
||||
dat += "<br>Linked Network Entities: <ol>"
|
||||
|
||||
var/i = 0
|
||||
for(var/obj/machinery/telecomms/T in links)
|
||||
dat += "<li>\ref[T] [T.name] ([T.id])</li>"
|
||||
i++
|
||||
dat += "<li>\ref[T] [T.name] ([T.id]) <a href='?src=\ref[src];unlink=[i]'>\[X\]</a></li>"
|
||||
dat += "</ol>"
|
||||
|
||||
dat += "<br>Filtering Frequencies: "
|
||||
var/i = 0
|
||||
|
||||
i = 0
|
||||
if(length(freq_listening))
|
||||
for(var/x in freq_listening)
|
||||
i++
|
||||
@@ -197,6 +203,16 @@
|
||||
temp = "<font color = #666633>-% Removed frequency filter [x] %-</font color>"
|
||||
freq_listening.Remove(x)
|
||||
|
||||
if(href_list["unlink"])
|
||||
|
||||
var/obj/machinery/telecomms/T = links[text2num(href_list["unlink"])]
|
||||
temp = "<font color = #666633>-% Removed \ref[T] [T.name] from linked entities. %-</font color>"
|
||||
|
||||
// Remove link entries from both T and src.
|
||||
if(src in T.links)
|
||||
T.links.Remove(src)
|
||||
links.Remove(T)
|
||||
|
||||
if(href_list["link"])
|
||||
|
||||
if(P.buffer)
|
||||
|
||||
+314
-314
@@ -1,314 +1,314 @@
|
||||
/obj/machinery/computer/teleporter
|
||||
name = "Teleporter"
|
||||
desc = "Used to control a linked teleportation Hub and Station."
|
||||
icon_state = "teleport"
|
||||
circuit = "/obj/item/weapon/circuitboard/teleporter"
|
||||
var/obj/item/locked = null
|
||||
var/id = null
|
||||
|
||||
/obj/machinery/computer/teleporter/New()
|
||||
src.id = text("[]", rand(1000, 9999))
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/teleporter/attackby(I as obj, user as mob)
|
||||
if (istype(I, /obj/item/weapon/card/data/))
|
||||
var/obj/item/weapon/card/data/M = I
|
||||
if(stat & (NOPOWER|BROKEN) & (M.function != "teleporter"))
|
||||
src.attack_hand()
|
||||
|
||||
var/obj/S = null
|
||||
for(var/obj/effect/landmark/sloc in world)
|
||||
if (sloc.name != M.data)
|
||||
continue
|
||||
if (locate(/mob) in sloc.loc)
|
||||
continue
|
||||
S = sloc
|
||||
break
|
||||
if (!S)
|
||||
S = locate("landmark*[M.data]") // use old stype
|
||||
if (istype(S, /obj/effect/landmark/) && istype(S.loc, /turf))
|
||||
usr.loc = S.loc
|
||||
del(I)
|
||||
return
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/teleporter/attack_paw()
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/computer/teleporter/security/attackby(obj/item/weapon/W)
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/computer/teleporter/security/attack_paw()
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/teleport/station/attack_ai()
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/computer/teleporter/attack_hand()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
var/list/L = list()
|
||||
var/list/areaindex = list()
|
||||
|
||||
for(var/obj/item/device/radio/beacon/R in world)
|
||||
var/turf/T = get_turf(R)
|
||||
if (!T) continue
|
||||
if(T.z == 2) continue
|
||||
var/tmpname = T.loc.name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
else
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = R
|
||||
|
||||
for (var/obj/item/weapon/implant/tracking/I in world)
|
||||
if (!I.implanted || !ismob(I.loc))
|
||||
continue
|
||||
else
|
||||
var/mob/M = I.loc
|
||||
if (M.stat == 2)
|
||||
if (M.timeofdeath + 6000 < world.time)
|
||||
continue
|
||||
var/turf/T = get_turf(M)
|
||||
if(T) continue
|
||||
if(T.z == 2) continue
|
||||
var/tmpname = M.real_name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
else
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = I
|
||||
|
||||
var/desc = input("Please select a location to lock in.", "Locking Computer") in L
|
||||
src.locked = L[desc]
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Locked In", 2)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/teleporter/verb/set_id(t as text)
|
||||
set category = "Object"
|
||||
set name = "Set teleporter ID"
|
||||
set src in oview(1)
|
||||
set desc = "ID Tag:"
|
||||
|
||||
if(stat & (NOPOWER|BROKEN) || !istype(usr,/mob/living))
|
||||
return
|
||||
if (t)
|
||||
src.id = t
|
||||
return
|
||||
|
||||
/proc/find_loc(obj/R as obj)
|
||||
if (!R) return null
|
||||
var/turf/T = R.loc
|
||||
while(!istype(T, /turf))
|
||||
T = T.loc
|
||||
if(!T || istype(T, /area)) return null
|
||||
return T
|
||||
|
||||
/obj/machinery/teleport/hub/Bumped(M as mob|obj)
|
||||
spawn()
|
||||
if (src.icon_state == "tele1")
|
||||
teleport(M)
|
||||
use_power(5000)
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/hub/proc/teleport(atom/movable/M as mob|obj)
|
||||
var/atom/l = src.loc
|
||||
var/obj/machinery/computer/teleporter/com = locate(/obj/machinery/computer/teleporter, locate(l.x - 2, l.y, l.z))
|
||||
if (!com)
|
||||
return
|
||||
if (!com.locked)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\red Failure: Cannot authenticate locked on coordinates. Please reinstate coordinate matrix.")
|
||||
return
|
||||
if (istype(M, /atom/movable))
|
||||
if(prob(5) && !accurate) //oh dear a problem, put em in deep space
|
||||
do_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy - 5), 3), 2)
|
||||
else
|
||||
do_teleport(M, com.locked) //dead-on precision
|
||||
else
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
for(var/mob/B in hearers(src, null))
|
||||
B.show_message("\blue Test fire completed.")
|
||||
return
|
||||
/*
|
||||
/proc/do_teleport(atom/movable/M as mob|obj, atom/destination, precision)
|
||||
if(istype(M, /obj/effect))
|
||||
del(M)
|
||||
return
|
||||
if (istype(M, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks get teleported --NeoFite
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message(text("\red <B>The [] bounces off of the portal!</B>", M.name), 1)
|
||||
return
|
||||
if (istype(M, /mob/living))
|
||||
var/mob/living/MM = M
|
||||
if(MM.check_contents_for(/obj/item/weapon/disk/nuclear))
|
||||
MM << "\red Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through."
|
||||
return
|
||||
var/disky = 0
|
||||
for (var/atom/O in M.contents) //I'm pretty sure this accounts for the maximum amount of container in container stacking. --NeoFite
|
||||
if (istype(O, /obj/item/weapon/storage) || istype(O, /obj/item/weapon/gift))
|
||||
for (var/obj/OO in O.contents)
|
||||
if (istype(OO, /obj/item/weapon/storage) || istype(OO, /obj/item/weapon/gift))
|
||||
for (var/obj/OOO in OO.contents)
|
||||
if (istype(OOO, /obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (istype(OO, /obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (istype(O, /obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (istype(O, /mob/living))
|
||||
var/mob/living/MM = O
|
||||
if(MM.check_contents_for(/obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (disky)
|
||||
for(var/mob/P in viewers(M, null))
|
||||
P.show_message(text("\red <B>The [] bounces off of the portal!</B>", M.name), 1)
|
||||
return
|
||||
|
||||
//Bags of Holding cause bluespace teleportation to go funky. --NeoFite
|
||||
if (istype(M, /mob/living))
|
||||
var/mob/living/MM = M
|
||||
if(MM.check_contents_for(/obj/item/weapon/storage/backpack/holding))
|
||||
MM << "\red The Bluespace interface on your Bag of Holding interferes with the teleport!"
|
||||
precision = rand(1,100)
|
||||
if (istype(M, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
for (var/atom/O in M.contents) //I'm pretty sure this accounts for the maximum amount of container in container stacking. --NeoFite
|
||||
if (istype(O, /obj/item/weapon/storage) || istype(O, /obj/item/weapon/gift))
|
||||
for (var/obj/OO in O.contents)
|
||||
if (istype(OO, /obj/item/weapon/storage) || istype(OO, /obj/item/weapon/gift))
|
||||
for (var/obj/OOO in OO.contents)
|
||||
if (istype(OOO, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
if (istype(OO, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
if (istype(O, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
if (istype(O, /mob/living))
|
||||
var/mob/living/MM = O
|
||||
if(MM.check_contents_for(/obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
|
||||
|
||||
var/turf/destturf = get_turf(destination)
|
||||
|
||||
var/tx = destturf.x + rand(precision * -1, precision)
|
||||
var/ty = destturf.y + rand(precision * -1, precision)
|
||||
|
||||
var/tmploc
|
||||
|
||||
if (ismob(destination.loc)) //If this is an implant.
|
||||
tmploc = locate(tx, ty, destturf.z)
|
||||
else
|
||||
tmploc = locate(tx, ty, destination.z)
|
||||
|
||||
if(tx == destturf.x && ty == destturf.y && (istype(destination.loc, /obj/structure/closet) || istype(destination.loc, /obj/structure/closet/secure_closet)))
|
||||
tmploc = destination.loc
|
||||
|
||||
if(tmploc==null)
|
||||
return
|
||||
|
||||
M.loc = tmploc
|
||||
sleep(2)
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, M)
|
||||
s.start()
|
||||
return
|
||||
*/
|
||||
/obj/machinery/teleport/station/attackby(var/obj/item/weapon/W)
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/teleport/station/attack_paw()
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/teleport/station/attack_ai()
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/teleport/station/attack_hand()
|
||||
if(engaged)
|
||||
src.disengage()
|
||||
else
|
||||
src.engage()
|
||||
|
||||
/obj/machinery/teleport/station/proc/engage()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
var/atom/l = src.loc
|
||||
var/atom/com = locate(/obj/machinery/teleport/hub, locate(l.x + 1, l.y, l.z))
|
||||
if (com)
|
||||
com.icon_state = "tele1"
|
||||
use_power(5000)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Teleporter engaged!", 2)
|
||||
src.add_fingerprint(usr)
|
||||
src.engaged = 1
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/proc/disengage()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
var/atom/l = src.loc
|
||||
var/atom/com = locate(/obj/machinery/teleport/hub, locate(l.x + 1, l.y, l.z))
|
||||
if (com)
|
||||
com.icon_state = "tele0"
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Teleporter disengaged!", 2)
|
||||
src.add_fingerprint(usr)
|
||||
src.engaged = 0
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/verb/testfire()
|
||||
set name = "Test Fire Teleporter"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(stat & (BROKEN|NOPOWER) || !istype(usr,/mob/living))
|
||||
return
|
||||
|
||||
var/atom/l = src.loc
|
||||
var/obj/machinery/teleport/hub/com = locate(/obj/machinery/teleport/hub, locate(l.x + 1, l.y, l.z))
|
||||
if (com && !active)
|
||||
active = 1
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Test firing!", 2)
|
||||
com.teleport()
|
||||
use_power(5000)
|
||||
|
||||
spawn(30)
|
||||
active=0
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/power_change()
|
||||
..()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "controller-p"
|
||||
var/obj/machinery/teleport/hub/com = locate(/obj/machinery/teleport/hub, locate(x + 1, y, z))
|
||||
if(com)
|
||||
com.icon_state = "tele0"
|
||||
else
|
||||
icon_state = "controller"
|
||||
|
||||
|
||||
/obj/effect/laser/Bump()
|
||||
src.range--
|
||||
return
|
||||
|
||||
/obj/effect/laser/Move()
|
||||
src.range--
|
||||
return
|
||||
|
||||
/atom/proc/laserhit(L as obj)
|
||||
return 1
|
||||
/obj/machinery/computer/teleporter
|
||||
name = "Teleporter"
|
||||
desc = "Used to control a linked teleportation Hub and Station."
|
||||
icon_state = "teleport"
|
||||
circuit = "/obj/item/weapon/circuitboard/teleporter"
|
||||
var/obj/item/locked = null
|
||||
var/id = null
|
||||
|
||||
/obj/machinery/computer/teleporter/New()
|
||||
src.id = text("[]", rand(1000, 9999))
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/teleporter/attackby(I as obj, user as mob)
|
||||
if (istype(I, /obj/item/weapon/card/data/))
|
||||
var/obj/item/weapon/card/data/M = I
|
||||
if(stat & (NOPOWER|BROKEN) & (M.function != "teleporter"))
|
||||
src.attack_hand()
|
||||
|
||||
var/obj/S = null
|
||||
for(var/obj/effect/landmark/sloc in world)
|
||||
if (sloc.name != M.data)
|
||||
continue
|
||||
if (locate(/mob) in sloc.loc)
|
||||
continue
|
||||
S = sloc
|
||||
break
|
||||
if (!S)
|
||||
S = locate("landmark*[M.data]") // use old stype
|
||||
if (istype(S, /obj/effect/landmark/) && istype(S.loc, /turf))
|
||||
usr.loc = S.loc
|
||||
del(I)
|
||||
return
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/teleporter/attack_paw()
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/computer/teleporter/security/attackby(obj/item/weapon/W)
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/computer/teleporter/security/attack_paw()
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/teleport/station/attack_ai()
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/computer/teleporter/attack_hand()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
var/list/L = list()
|
||||
var/list/areaindex = list()
|
||||
|
||||
for(var/obj/item/device/radio/beacon/R in world)
|
||||
var/turf/T = get_turf(R)
|
||||
if (!T) continue
|
||||
if(T.z == 2) continue
|
||||
var/tmpname = T.loc.name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
else
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = R
|
||||
|
||||
for (var/obj/item/weapon/implant/tracking/I in world)
|
||||
if (!I.implanted || !ismob(I.loc))
|
||||
continue
|
||||
else
|
||||
var/mob/M = I.loc
|
||||
if (M.stat == 2)
|
||||
if (M.timeofdeath + 6000 < world.time)
|
||||
continue
|
||||
var/turf/T = get_turf(M)
|
||||
if(T) continue
|
||||
if(T.z == 2) continue
|
||||
var/tmpname = M.real_name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
else
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = I
|
||||
|
||||
var/desc = input("Please select a location to lock in.", "Locking Computer") in L
|
||||
src.locked = L[desc]
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Locked In", 2)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/teleporter/verb/set_id(t as text)
|
||||
set category = "Object"
|
||||
set name = "Set teleporter ID"
|
||||
set src in oview(1)
|
||||
set desc = "ID Tag:"
|
||||
|
||||
if(stat & (NOPOWER|BROKEN) || !istype(usr,/mob/living))
|
||||
return
|
||||
if (t)
|
||||
src.id = t
|
||||
return
|
||||
|
||||
/proc/find_loc(obj/R as obj)
|
||||
if (!R) return null
|
||||
var/turf/T = R.loc
|
||||
while(!istype(T, /turf))
|
||||
T = T.loc
|
||||
if(!T || istype(T, /area)) return null
|
||||
return T
|
||||
|
||||
/obj/machinery/teleport/hub/Bumped(M as mob|obj)
|
||||
spawn()
|
||||
if (src.icon_state == "tele1")
|
||||
teleport(M)
|
||||
use_power(5000)
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/hub/proc/teleport(atom/movable/M as mob|obj)
|
||||
var/atom/l = src.loc
|
||||
var/obj/machinery/computer/teleporter/com = locate(/obj/machinery/computer/teleporter, locate(l.x - 2, l.y, l.z))
|
||||
if (!com)
|
||||
return
|
||||
if (!com.locked)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\red Failure: Cannot authenticate locked on coordinates. Please reinstate coordinate matrix.")
|
||||
return
|
||||
if (istype(M, /atom/movable))
|
||||
if(prob(5) && !accurate) //oh dear a problem, put em in deep space
|
||||
do_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy - 5), 3), 2)
|
||||
else
|
||||
do_teleport(M, com.locked) //dead-on precision
|
||||
else
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
for(var/mob/B in hearers(src, null))
|
||||
B.show_message("\blue Test fire completed.")
|
||||
return
|
||||
/*
|
||||
/proc/do_teleport(atom/movable/M as mob|obj, atom/destination, precision)
|
||||
if(istype(M, /obj/effect))
|
||||
del(M)
|
||||
return
|
||||
if (istype(M, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks get teleported --NeoFite
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message(text("\red <B>The [] bounces off of the portal!</B>", M.name), 1)
|
||||
return
|
||||
if (istype(M, /mob/living))
|
||||
var/mob/living/MM = M
|
||||
if(MM.check_contents_for(/obj/item/weapon/disk/nuclear))
|
||||
MM << "\red Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through."
|
||||
return
|
||||
var/disky = 0
|
||||
for (var/atom/O in M.contents) //I'm pretty sure this accounts for the maximum amount of container in container stacking. --NeoFite
|
||||
if (istype(O, /obj/item/weapon/storage) || istype(O, /obj/item/weapon/gift))
|
||||
for (var/obj/OO in O.contents)
|
||||
if (istype(OO, /obj/item/weapon/storage) || istype(OO, /obj/item/weapon/gift))
|
||||
for (var/obj/OOO in OO.contents)
|
||||
if (istype(OOO, /obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (istype(OO, /obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (istype(O, /obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (istype(O, /mob/living))
|
||||
var/mob/living/MM = O
|
||||
if(MM.check_contents_for(/obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (disky)
|
||||
for(var/mob/P in viewers(M, null))
|
||||
P.show_message(text("\red <B>The [] bounces off of the portal!</B>", M.name), 1)
|
||||
return
|
||||
|
||||
//Bags of Holding cause bluespace teleportation to go funky. --NeoFite
|
||||
if (istype(M, /mob/living))
|
||||
var/mob/living/MM = M
|
||||
if(MM.check_contents_for(/obj/item/weapon/storage/backpack/holding))
|
||||
MM << "\red The Bluespace interface on your Bag of Holding interferes with the teleport!"
|
||||
precision = rand(1,100)
|
||||
if (istype(M, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
for (var/atom/O in M.contents) //I'm pretty sure this accounts for the maximum amount of container in container stacking. --NeoFite
|
||||
if (istype(O, /obj/item/weapon/storage) || istype(O, /obj/item/weapon/gift))
|
||||
for (var/obj/OO in O.contents)
|
||||
if (istype(OO, /obj/item/weapon/storage) || istype(OO, /obj/item/weapon/gift))
|
||||
for (var/obj/OOO in OO.contents)
|
||||
if (istype(OOO, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
if (istype(OO, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
if (istype(O, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
if (istype(O, /mob/living))
|
||||
var/mob/living/MM = O
|
||||
if(MM.check_contents_for(/obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
|
||||
|
||||
var/turf/destturf = get_turf(destination)
|
||||
|
||||
var/tx = destturf.x + rand(precision * -1, precision)
|
||||
var/ty = destturf.y + rand(precision * -1, precision)
|
||||
|
||||
var/tmploc
|
||||
|
||||
if (ismob(destination.loc)) //If this is an implant.
|
||||
tmploc = locate(tx, ty, destturf.z)
|
||||
else
|
||||
tmploc = locate(tx, ty, destination.z)
|
||||
|
||||
if(tx == destturf.x && ty == destturf.y && (istype(destination.loc, /obj/structure/closet) || istype(destination.loc, /obj/structure/closet/secure_closet)))
|
||||
tmploc = destination.loc
|
||||
|
||||
if(tmploc==null)
|
||||
return
|
||||
|
||||
M.loc = tmploc
|
||||
sleep(2)
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, M)
|
||||
s.start()
|
||||
return
|
||||
*/
|
||||
/obj/machinery/teleport/station/attackby(var/obj/item/weapon/W)
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/teleport/station/attack_paw()
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/teleport/station/attack_ai()
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/teleport/station/attack_hand()
|
||||
if(engaged)
|
||||
src.disengage()
|
||||
else
|
||||
src.engage()
|
||||
|
||||
/obj/machinery/teleport/station/proc/engage()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
var/atom/l = src.loc
|
||||
var/atom/com = locate(/obj/machinery/teleport/hub, locate(l.x + 1, l.y, l.z))
|
||||
if (com)
|
||||
com.icon_state = "tele1"
|
||||
use_power(5000)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Teleporter engaged!", 2)
|
||||
src.add_fingerprint(usr)
|
||||
src.engaged = 1
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/proc/disengage()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
var/atom/l = src.loc
|
||||
var/atom/com = locate(/obj/machinery/teleport/hub, locate(l.x + 1, l.y, l.z))
|
||||
if (com)
|
||||
com.icon_state = "tele0"
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Teleporter disengaged!", 2)
|
||||
src.add_fingerprint(usr)
|
||||
src.engaged = 0
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/verb/testfire()
|
||||
set name = "Test Fire Teleporter"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(stat & (BROKEN|NOPOWER) || !istype(usr,/mob/living))
|
||||
return
|
||||
|
||||
var/atom/l = src.loc
|
||||
var/obj/machinery/teleport/hub/com = locate(/obj/machinery/teleport/hub, locate(l.x + 1, l.y, l.z))
|
||||
if (com && !active)
|
||||
active = 1
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Test firing!", 2)
|
||||
com.teleport()
|
||||
use_power(5000)
|
||||
|
||||
spawn(30)
|
||||
active=0
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/power_change()
|
||||
..()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "controller-p"
|
||||
var/obj/machinery/teleport/hub/com = locate(/obj/machinery/teleport/hub, locate(x + 1, y, z))
|
||||
if(com)
|
||||
com.icon_state = "tele0"
|
||||
else
|
||||
icon_state = "controller"
|
||||
|
||||
|
||||
/obj/effect/laser/Bump()
|
||||
src.range--
|
||||
return
|
||||
|
||||
/obj/effect/laser/Move()
|
||||
src.range--
|
||||
return
|
||||
|
||||
/atom/proc/laserhit(L as obj)
|
||||
return 1
|
||||
|
||||
@@ -105,6 +105,14 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/drill/diamonddrill
|
||||
name = "Diamond Drill"
|
||||
desc = "This is an upgraded version of the drill that'll pierce the heavens! (Can be attached to: Combat and Engineering Exosuits)"
|
||||
icon_state = "mecha_diamond_drill"
|
||||
origin_tech = "materials=4;engineering=3"
|
||||
construction_cost = list("metal"=10000,"diamond"=6500)
|
||||
equip_cooldown = 20
|
||||
force = 15
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/extinguisher
|
||||
name = "Extinguisher"
|
||||
@@ -1543,3 +1551,69 @@
|
||||
return 1
|
||||
|
||||
*/
|
||||
|
||||
//This is pretty much just for the death-ripley so that it is harmless
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/safety_clamp
|
||||
name = "KILL CLAMP"
|
||||
icon_state = "mecha_clamp"
|
||||
equip_cooldown = 15
|
||||
energy_drain = 0
|
||||
var/dam_force = 0
|
||||
var/obj/mecha/working/ripley/cargo_holder
|
||||
|
||||
can_attach(obj/mecha/working/ripley/M as obj)
|
||||
if(..())
|
||||
if(istype(M))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
attach(obj/mecha/M as obj)
|
||||
..()
|
||||
cargo_holder = M
|
||||
return
|
||||
|
||||
action(atom/target)
|
||||
if(!action_checks(target)) return
|
||||
if(!cargo_holder) return
|
||||
if(istype(target,/obj))
|
||||
var/obj/O = target
|
||||
if(!O.anchored)
|
||||
if(cargo_holder.cargo.len < cargo_holder.cargo_capacity)
|
||||
chassis.occupant_message("You lift [target] and start to load it into cargo compartment.")
|
||||
chassis.visible_message("[chassis] lifts [target] and starts to load it into cargo compartment.")
|
||||
set_ready_state(0)
|
||||
chassis.use_power(energy_drain)
|
||||
O.anchored = 1
|
||||
var/T = chassis.loc
|
||||
if(do_after_cooldown(target))
|
||||
if(T == chassis.loc && src == chassis.selected)
|
||||
cargo_holder.cargo += O
|
||||
O.loc = chassis
|
||||
O.anchored = 0
|
||||
chassis.occupant_message("<font color='blue'>[target] succesfully loaded.</font>")
|
||||
chassis.log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
|
||||
else
|
||||
chassis.occupant_message("<font color='red'>You must hold still while handling objects.</font>")
|
||||
O.anchored = initial(O.anchored)
|
||||
else
|
||||
chassis.occupant_message("<font color='red'>Not enough room in cargo compartment.</font>")
|
||||
else
|
||||
chassis.occupant_message("<font color='red'>[target] is firmly secured.</font>")
|
||||
|
||||
else if(istype(target,/mob/living))
|
||||
var/mob/living/M = target
|
||||
if(M.stat>1) return
|
||||
if(chassis.occupant.a_intent == "hurt")
|
||||
chassis.occupant_message("\red You obliterate [target] with [src.name], leaving blood and guts everywhere.")
|
||||
chassis.visible_message("\red [chassis] destroys [target] in an unholy fury.")
|
||||
if(chassis.occupant.a_intent == "disarm")
|
||||
chassis.occupant_message("\red You tear [target]'s limbs off with [src.name].")
|
||||
chassis.visible_message("\red [chassis] rips [target]'s arms off.")
|
||||
else
|
||||
step_away(M,chassis)
|
||||
chassis.occupant_message("You smash into [target], sending them flying.")
|
||||
chassis.visible_message("[chassis] tosses [target] like a piece of paper.")
|
||||
set_ready_state(0)
|
||||
chassis.use_power(energy_drain)
|
||||
do_after_cooldown()
|
||||
return 1
|
||||
@@ -94,6 +94,7 @@
|
||||
/obj/item/mecha_parts/part/honker_right_leg
|
||||
),
|
||||
"Exosuit Equipment"=list(
|
||||
/obj/item/mecha_parts/chassis/firefighter,
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp,
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/drill,
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/extinguisher,
|
||||
@@ -111,9 +112,17 @@
|
||||
|
||||
"Misc"=list(/obj/item/mecha_tracking)
|
||||
)
|
||||
|
||||
New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/mechfab(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
RefreshParts()
|
||||
|
||||
for(var/part_set in part_sets)
|
||||
convert_part_set(part_set)
|
||||
files = new /datum/research(src) //Setup the research data holder.
|
||||
|
||||
@@ -559,10 +559,29 @@
|
||||
src.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT),1)
|
||||
return
|
||||
|
||||
//TODO
|
||||
/obj/mecha/blob_act()
|
||||
/*Will fix later -Sieve
|
||||
/obj/mecha/attack_blob(mob/user as mob)
|
||||
src.log_message("Attack by blob. Attacker - [user].",1)
|
||||
if(!prob(src.deflect_chance))
|
||||
src.take_damage(6)
|
||||
src.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
|
||||
playsound(src.loc, 'blobattack.ogg', 50, 1, -1)
|
||||
user << "\red You smash at the armored suit!"
|
||||
for (var/mob/V in viewers(src))
|
||||
if(V.client && !(V.blinded))
|
||||
V.show_message("\red The [user] smashes against [src.name]'s armor!", 1)
|
||||
else
|
||||
src.log_append_to_last("Armor saved.")
|
||||
playsound(src.loc, 'blobattack.ogg', 50, 1, -1)
|
||||
user << "\green Your attack had no effect!"
|
||||
src.occupant_message("\blue The [user]'s attack is stopped by the armor.")
|
||||
for (var/mob/V in viewers(src))
|
||||
if(V.client && !(V.blinded))
|
||||
V.show_message("\blue The [user] rebounds off the [src.name] armor!", 1)
|
||||
return
|
||||
*/
|
||||
|
||||
//TODO
|
||||
/obj/mecha/meteorhit()
|
||||
return ex_act(rand(1,3))//should do for now
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
else if(istype(used_atom, /obj/item/weapon/wrench))
|
||||
playsound(holder, 'Ratchet.ogg', 50, 1)
|
||||
|
||||
else if(istype(used_atom, /obj/item/weapon/screwdriver))
|
||||
playsound(holder, 'Screwdriver.ogg', 50, 1)
|
||||
|
||||
else if(istype(used_atom, /obj/item/weapon/wirecutters))
|
||||
playsound(holder, 'Wirecutter.ogg', 50, 1)
|
||||
|
||||
@@ -22,6 +25,7 @@
|
||||
return 0
|
||||
else
|
||||
C.use(4)
|
||||
playsound(holder, 'Deconstruct.ogg', 50, 1)
|
||||
else if(istype(used_atom, /obj/item/stack))
|
||||
var/obj/item/stack/S = used_atom
|
||||
if(S.amount < 5)
|
||||
@@ -41,6 +45,9 @@
|
||||
else if(istype(used_atom, /obj/item/weapon/wrench))
|
||||
playsound(holder, 'Ratchet.ogg', 50, 1)
|
||||
|
||||
else if(istype(used_atom, /obj/item/weapon/screwdriver))
|
||||
playsound(holder, 'Screwdriver.ogg', 50, 1)
|
||||
|
||||
else if(istype(used_atom, /obj/item/weapon/wirecutters))
|
||||
playsound(holder, 'Wirecutter.ogg', 50, 1)
|
||||
|
||||
@@ -51,6 +58,7 @@
|
||||
return 0
|
||||
else
|
||||
C.use(4)
|
||||
playsound(holder, 'Deconstruct.ogg', 50, 1)
|
||||
else if(istype(used_atom, /obj/item/stack))
|
||||
var/obj/item/stack/S = used_atom
|
||||
if(S.amount < 5)
|
||||
@@ -477,11 +485,12 @@
|
||||
|
||||
|
||||
/datum/construction/mecha/firefighter_chassis
|
||||
steps = list(list("key"=/obj/item/mecha_parts/part/firefighter_torso),//1
|
||||
list("key"=/obj/item/mecha_parts/part/firefighter_left_arm),//2
|
||||
list("key"=/obj/item/mecha_parts/part/firefighter_right_arm),//3
|
||||
list("key"=/obj/item/mecha_parts/part/firefighter_left_leg),//4
|
||||
list("key"=/obj/item/mecha_parts/part/firefighter_right_leg)//5
|
||||
steps = list(list("key"=/obj/item/mecha_parts/part/ripley_torso),//1
|
||||
list("key"=/obj/item/mecha_parts/part/ripley_left_arm),//2
|
||||
list("key"=/obj/item/mecha_parts/part/ripley_right_arm),//3
|
||||
list("key"=/obj/item/mecha_parts/part/ripley_left_leg),//4
|
||||
list("key"=/obj/item/mecha_parts/part/ripley_right_leg),//5
|
||||
list("key"=/obj/item/clothing/suit/fire)//6
|
||||
)
|
||||
|
||||
custom_action(step, atom/used_atom, mob/user)
|
||||
@@ -495,7 +504,7 @@
|
||||
|
||||
spawn_result()
|
||||
var/obj/item/mecha_parts/chassis/const_holder = holder
|
||||
const_holder.construct = new /datum/construction/mecha/firefighter(const_holder)
|
||||
const_holder.construct = new /datum/construction/reversible/mecha/firefighter(const_holder)
|
||||
const_holder.density = 1
|
||||
spawn()
|
||||
del src
|
||||
@@ -503,64 +512,165 @@
|
||||
return
|
||||
|
||||
|
||||
/datum/construction/mecha/firefighter
|
||||
result = "/obj/mecha/working/firefighter"
|
||||
steps = list(list("key"=/obj/item/weapon/weldingtool),//1
|
||||
list("key"=/obj/item/weapon/wrench),//2
|
||||
list("key"=/obj/item/stack/sheet/plasteel),//3
|
||||
list("key"=/obj/item/weapon/weldingtool),//4
|
||||
list("key"=/obj/item/weapon/wrench),//5
|
||||
list("key"=/obj/item/stack/sheet/metal),//6
|
||||
list("key"=/obj/item/weapon/screwdriver),//7
|
||||
list("key"=/obj/item/weapon/circuitboard/mecha/firefighter/peripherals),//8
|
||||
list("key"=/obj/item/weapon/screwdriver),//9
|
||||
list("key"=/obj/item/weapon/circuitboard/mecha/ripley/main),//10
|
||||
list("key"=/obj/item/weapon/wirecutters),//11
|
||||
list("key"=/obj/item/weapon/cable_coil),//12
|
||||
list("key"=/obj/item/weapon/screwdriver),//13
|
||||
list("key"=/obj/item/weapon/wrench)//14
|
||||
/datum/construction/reversible/mecha/firefighter
|
||||
result = "/obj/mecha/working/ripley/firefighter"
|
||||
steps = list(
|
||||
//1
|
||||
list("key"=/obj/item/weapon/weldingtool,
|
||||
"backkey"=/obj/item/weapon/wrench,
|
||||
"desc"="External armor is wrenched."),
|
||||
//2
|
||||
list("key"=/obj/item/weapon/wrench,
|
||||
"backkey"=/obj/item/weapon/crowbar,
|
||||
"desc"="External armor is installed."),
|
||||
//3
|
||||
list("key"=/obj/item/stack/sheet/plasteel,
|
||||
"backkey"=/obj/item/weapon/crowbar,
|
||||
"desc"="External armor is being installed."),
|
||||
//4
|
||||
list("key"=/obj/item/stack/sheet/plasteel,
|
||||
"backkey"=/obj/item/weapon/weldingtool,
|
||||
"desc"="Internal armor is welded."),
|
||||
//5
|
||||
list("key"=/obj/item/weapon/weldingtool,
|
||||
"backkey"=/obj/item/weapon/wrench,
|
||||
"desc"="Internal armor is wrenched"),
|
||||
//6
|
||||
list("key"=/obj/item/weapon/wrench,
|
||||
"backkey"=/obj/item/weapon/crowbar,
|
||||
"desc"="Internal armor is installed"),
|
||||
|
||||
//7
|
||||
list("key"=/obj/item/stack/sheet/plasteel,
|
||||
"backkey"=/obj/item/weapon/screwdriver,
|
||||
"desc"="Peripherals control module is secured"),
|
||||
//8
|
||||
list("key"=/obj/item/weapon/screwdriver,
|
||||
"backkey"=/obj/item/weapon/crowbar,
|
||||
"desc"="Peripherals control module is installed"),
|
||||
//9
|
||||
list("key"=/obj/item/weapon/circuitboard/mecha/ripley/peripherals,
|
||||
"backkey"=/obj/item/weapon/screwdriver,
|
||||
"desc"="Central control module is secured"),
|
||||
//10
|
||||
list("key"=/obj/item/weapon/screwdriver,
|
||||
"backkey"=/obj/item/weapon/crowbar,
|
||||
"desc"="Central control module is installed"),
|
||||
//11
|
||||
list("key"=/obj/item/weapon/circuitboard/mecha/ripley/main,
|
||||
"backkey"=/obj/item/weapon/screwdriver,
|
||||
"desc"="The wiring is adjusted"),
|
||||
//12
|
||||
list("key"=/obj/item/weapon/wirecutters,
|
||||
"backkey"=/obj/item/weapon/screwdriver,
|
||||
"desc"="The wiring is added"),
|
||||
//13
|
||||
list("key"=/obj/item/weapon/cable_coil,
|
||||
"backkey"=/obj/item/weapon/screwdriver,
|
||||
"desc"="The hydraulic systems are active."),
|
||||
//14
|
||||
list("key"=/obj/item/weapon/screwdriver,
|
||||
"backkey"=/obj/item/weapon/wrench,
|
||||
"desc"="The hydraulic systems are connected."),
|
||||
//15
|
||||
list("key"=/obj/item/weapon/wrench,
|
||||
"desc"="The hydraulic systems are disconnected.")
|
||||
)
|
||||
|
||||
action(atom/used_atom,mob/user as mob)
|
||||
return check_step(used_atom,user)
|
||||
|
||||
|
||||
custom_action(step, atom/used_atom, mob/user)
|
||||
custom_action(index, diff, atom/used_atom, mob/user)
|
||||
if(!..())
|
||||
return 0
|
||||
|
||||
//TODO: better messages.
|
||||
switch(step)
|
||||
if(14)
|
||||
switch(index)
|
||||
if(15)
|
||||
user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.")
|
||||
if(14)
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.")
|
||||
else
|
||||
user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.")
|
||||
if(13)
|
||||
user.visible_message("[user] adjusts [holder] hydraulic systems.", "You adjust [holder] hydraulic systems.")
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].")
|
||||
else
|
||||
user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.")
|
||||
if(12)
|
||||
user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].")
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].")
|
||||
else
|
||||
user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].")
|
||||
var/obj/item/weapon/cable_coil/coil = new /obj/item/weapon/cable_coil(get_turf(holder))
|
||||
coil.amount = 4
|
||||
if(11)
|
||||
user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].")
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
|
||||
del used_atom
|
||||
else
|
||||
user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
|
||||
if(10)
|
||||
user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
|
||||
del used_atom
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] secures the mainboard.", "You secure the mainboard.")
|
||||
else
|
||||
user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].")
|
||||
new /obj/item/weapon/circuitboard/mecha/ripley/main(get_turf(holder))
|
||||
if(9)
|
||||
user.visible_message("[user] secures the mainboard.", "You secure the mainboard.")
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
|
||||
del used_atom
|
||||
else
|
||||
user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
|
||||
if(8)
|
||||
user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
|
||||
del used_atom
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.")
|
||||
else
|
||||
user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].")
|
||||
new /obj/item/weapon/circuitboard/mecha/ripley/peripherals(get_turf(holder))
|
||||
if(7)
|
||||
user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.")
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].")
|
||||
else
|
||||
user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
|
||||
|
||||
if(6)
|
||||
user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].")
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.")
|
||||
else
|
||||
user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].")
|
||||
var/obj/item/stack/sheet/plasteel/MS = new /obj/item/stack/sheet/plasteel(get_turf(holder))
|
||||
MS.amount = 5
|
||||
if(5)
|
||||
user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.")
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].")
|
||||
else
|
||||
user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.")
|
||||
if(4)
|
||||
user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].")
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] starts to install the external armor layer to [holder].", "You start to install the external armor layer to [holder].")
|
||||
else
|
||||
user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
|
||||
if(3)
|
||||
user.visible_message("[user] installs external reinforced armor layer to [holder].", "You install external reinforced armor layer to [holder].")
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] installs external reinforced armor layer to [holder].", "You install external reinforced armor layer to [holder].")
|
||||
else
|
||||
user.visible_message("[user] removes the external armor from [holder].", "You remove the external armor from [holder].")
|
||||
var/obj/item/stack/sheet/plasteel/MS = new /obj/item/stack/sheet/plasteel(get_turf(holder))
|
||||
MS.amount = 5
|
||||
if(2)
|
||||
user.visible_message("[user] secures external armor layer.", "You secure external reinforced armor layer.")
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] secures external armor layer.", "You secure external reinforced armor layer.")
|
||||
else
|
||||
user.visible_message("[user] pries external armor layer from [holder].", "You prie external armor layer from [holder].")
|
||||
var/obj/item/stack/sheet/plasteel/MS = new /obj/item/stack/sheet/plasteel(get_turf(holder))
|
||||
MS.amount = 5
|
||||
if(1)
|
||||
user.visible_message("[user] welds external armor layer to [holder].", "You weld external armor layer to [holder].")
|
||||
if(diff==FORWARD)
|
||||
user.visible_message("[user] welds external armor layer to [holder].", "You weld external armor layer to [holder].")
|
||||
else
|
||||
user.visible_message("[user] unfastens the external armor layer.", "You unfasten the external armor layer.")
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
@@ -205,12 +205,12 @@
|
||||
////////// Firefighter
|
||||
|
||||
/obj/item/mecha_parts/chassis/firefighter
|
||||
name = "Ripley-on-Fire Chassis"
|
||||
name = "Firefighter Chassis"
|
||||
|
||||
New()
|
||||
..()
|
||||
construct = new /datum/construction/mecha/firefighter_chassis(src)
|
||||
|
||||
/*
|
||||
/obj/item/mecha_parts/part/firefighter_torso
|
||||
name="Ripley-on-Fire Torso"
|
||||
icon_state = "ripley_harness"
|
||||
@@ -230,7 +230,7 @@
|
||||
/obj/item/mecha_parts/part/firefighter_right_leg
|
||||
name="Ripley-on-Fire Right Leg"
|
||||
icon_state = "ripley_r_leg"
|
||||
|
||||
*/
|
||||
|
||||
////////// HONK
|
||||
|
||||
@@ -452,10 +452,6 @@
|
||||
name = "Circuit board (Durand Central Control module)"
|
||||
icon_state = "mainboard"
|
||||
|
||||
firefighter/peripherals
|
||||
name = "Circuit board (Ripley-on-Fire Peripherals Control module)"
|
||||
icon_state = "mcontroller"
|
||||
|
||||
honker
|
||||
origin_tech = "programming=4"
|
||||
|
||||
|
||||
@@ -126,6 +126,29 @@
|
||||
parts -= part
|
||||
return
|
||||
|
||||
/obj/effect/decal/mecha_wreckage/ripley
|
||||
name = "Firefighter wreckage"
|
||||
icon_state = "firefighter-broken"
|
||||
|
||||
New()
|
||||
..()
|
||||
var/list/parts = list(/obj/item/mecha_parts/part/ripley_torso,
|
||||
/obj/item/mecha_parts/part/ripley_left_arm,
|
||||
/obj/item/mecha_parts/part/ripley_right_arm,
|
||||
/obj/item/mecha_parts/part/ripley_left_leg,
|
||||
/obj/item/mecha_parts/part/ripley_right_leg,
|
||||
/obj/item/clothing/suit/fire)
|
||||
for(var/i=0;i<2;i++)
|
||||
if(!isemptylist(parts) && prob(40))
|
||||
var/part = pick(parts)
|
||||
welder_salvage += part
|
||||
parts -= part
|
||||
return
|
||||
|
||||
/obj/effect/decal/mecha_wreckage/deathripley
|
||||
name = "Death-Ripley wreckage"
|
||||
icon_state = "deathripley-broken"
|
||||
|
||||
/obj/effect/decal/mecha_wreckage/honker
|
||||
name = "Honker wreckage"
|
||||
icon_state = "honker-broken"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/mecha/working/firefighter
|
||||
/*/obj/mecha/working/firefighter
|
||||
desc = "Standart APLU chassis was refitted with additional thermal protection and cistern."
|
||||
name = "Ripley-on-Fire"
|
||||
icon_state = "ripley"
|
||||
@@ -9,17 +9,17 @@
|
||||
wreckage = /obj/effect/decal/mecha_wreckage/ripley
|
||||
infra_luminosity = 5
|
||||
|
||||
/*
|
||||
|
||||
/obj/mecha/working/firefighter/New()
|
||||
..()
|
||||
// tools += new /datum/mecha_tool/uni_interface(src)
|
||||
tools += new /datum/mecha_tool/extinguisher(src)
|
||||
tools += new /datum/mecha_tool/drill(src)
|
||||
/*
|
||||
|
||||
for(var/g_type in typesof(/datum/mecha_tool/gimmick))
|
||||
if(g_type!=/datum/mecha_tool/gimmick)
|
||||
tools += new g_type(src)
|
||||
*/
|
||||
|
||||
selected_tool = tools[1]
|
||||
return
|
||||
*/
|
||||
@@ -15,6 +15,30 @@
|
||||
return
|
||||
*/
|
||||
|
||||
/obj/mecha/working/ripley/firefighter
|
||||
desc = "Standart APLU chassis was refitted with additional thermal protection and cistern."
|
||||
name = "APLU \"Firefighter\""
|
||||
icon_state = "firefighter"
|
||||
max_temperature = 2500
|
||||
health = 250
|
||||
lights_power = 8
|
||||
list/damage_absorption = list("fire"=0.5,"bullet"=0.8,"bomb"=0.5)
|
||||
|
||||
/obj/mecha/working/ripley/deathripley
|
||||
desc = "OH SHIT IT'S THE DEATHSQUAD WE'RE ALL GONNA DIE"
|
||||
name = "DEATH-RIPLEY"
|
||||
icon_state = "deathripley"
|
||||
step_in = 2
|
||||
opacity=0
|
||||
lights_power = 60
|
||||
step_energy_drain = 0
|
||||
|
||||
/obj/mecha/working/ripley/deathripley/New()
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/tool/safety_clamp
|
||||
ME.attach(src)
|
||||
return
|
||||
|
||||
/obj/mecha/working/ripley/Exit(atom/movable/O)
|
||||
if(O in cargo)
|
||||
return 0
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
for(var/obj/item/I in src)
|
||||
I.loc = src.loc
|
||||
|
||||
for(var/obj/mecha/working/ripley/deathripley/I in src)
|
||||
I.loc = src.loc
|
||||
|
||||
for(var/mob/M in src)
|
||||
M.loc = src.loc
|
||||
if(M.client)
|
||||
@@ -54,6 +57,9 @@
|
||||
if(!I.anchored)
|
||||
I.loc = src
|
||||
|
||||
for(var/obj/mecha/working/ripley/deathripley/I in src.loc)
|
||||
I.loc = src
|
||||
|
||||
for(var/mob/M in src.loc)
|
||||
if(istype (M, /mob/dead/observer))
|
||||
continue
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/obj/structure/closet/secure_closet/cargotech
|
||||
name = "Cargo Technician's Locker"
|
||||
req_access = list(access_cargo)
|
||||
//icon_state = "secureeng1"
|
||||
//icon_closed = "secureeng"
|
||||
//icon_locked = "secureeng1"
|
||||
//icon_opened = "toolclosetopen"
|
||||
//icon_broken = "secureengbroken"
|
||||
//icon_off = "secureengoff"
|
||||
|
||||
//Needs proper sprites
|
||||
|
||||
New()
|
||||
..()
|
||||
sleep(2)
|
||||
new /obj/item/clothing/under/rank/cargo(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
new /obj/item/device/radio/headset/headset_cargo(src)
|
||||
new /obj/item/clothing/gloves/black(src)
|
||||
return
|
||||
@@ -745,7 +745,7 @@
|
||||
if(istype(C, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = C
|
||||
var/list/damaged = H.get_damaged_organs(1,1)
|
||||
user.show_message("\blue Localized Damage, Brute-Burn:",1)
|
||||
user.show_message("\blue Localized Damage, Brute/Burn:",1)
|
||||
if(length(damaged)>0)
|
||||
for(var/datum/organ/external/org in damaged)
|
||||
user.show_message(text("\blue \t []: []\blue-[]",capitalize(org.getDisplayName()),(org.brute_dam > 0)?"\red [org.brute_dam]":0,(org.burn_dam > 0)?"\red [org.burn_dam]":0),1)
|
||||
|
||||
@@ -208,7 +208,7 @@ MASS SPECTROMETER
|
||||
if(mode == 1 && istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/list/damaged = H.get_damaged_organs(1,1)
|
||||
user.show_message("\blue Localized Damage, Brute\\Burn:",1)
|
||||
user.show_message("\blue Localized Damage, Brute/Burn:",1)
|
||||
if(length(damaged)>0)
|
||||
for(var/datum/organ/external/org in damaged)
|
||||
user.show_message(text("\blue \t []: []\blue-[]",capitalize(org.getDisplayName()),(org.brute_dam > 0)?"\red [org.brute_dam]":0,(org.burn_dam > 0)?"\red [org.burn_dam]":0),1)
|
||||
|
||||
@@ -1,267 +1,267 @@
|
||||
/obj/item/blueprints
|
||||
var/const/AREA_ERRNONE = 0
|
||||
var/const/AREA_STATION = 1
|
||||
var/const/AREA_SPACE = 2
|
||||
var/const/AREA_SPECIAL = 3
|
||||
|
||||
var/const/BORDER_ERROR = 0
|
||||
var/const/BORDER_NONE = 1
|
||||
var/const/BORDER_BETWEEN = 2
|
||||
var/const/BORDER_2NDTILE = 3
|
||||
var/const/BORDER_SPACE = 4
|
||||
|
||||
var/const/ROOM_ERR_LOLWAT = 0
|
||||
var/const/ROOM_ERR_SPACE = -1
|
||||
var/const/ROOM_ERR_TOOLARGE = -2
|
||||
|
||||
/obj/item/blueprints/attack_self(mob/M as mob)
|
||||
if (!istype(M,/mob/living/carbon/human))
|
||||
M << "This is stack of useless pieces of harsh paper." //monkeys cannot into projecting
|
||||
return
|
||||
interact()
|
||||
return
|
||||
|
||||
/obj/item/blueprints/Topic(href, href_list)
|
||||
..()
|
||||
if ((usr.restrained() || usr.stat || usr.equipped() != src))
|
||||
return
|
||||
if (!href_list["action"])
|
||||
return
|
||||
switch(href_list["action"])
|
||||
if ("create_area")
|
||||
if (get_area_type()!=AREA_SPACE)
|
||||
interact()
|
||||
return
|
||||
create_area()
|
||||
if ("edit_area")
|
||||
if (get_area_type()!=AREA_STATION)
|
||||
interact()
|
||||
return
|
||||
edit_area()
|
||||
|
||||
/obj/item/blueprints/proc/interact()
|
||||
var/area/A = get_area()
|
||||
var/text = {"<HTML><head><title>[src]</title></head><BODY>
|
||||
<h2>[station_name()] blueprints</h2>
|
||||
<small>Property of Nanotrasen. For heads of staff only. Store in high-secure storage.</small><hr>
|
||||
"}
|
||||
switch (get_area_type())
|
||||
if (AREA_SPACE)
|
||||
text += {"
|
||||
<p>According this blueprints you are in <b>open space</b> now.</p>
|
||||
<p><a href='?src=\ref[src];action=create_area'>Mark this place as new area.</a></p>
|
||||
"}
|
||||
if (AREA_STATION)
|
||||
text += {"
|
||||
<p>According this blueprints you are in <b>[A.name]</b> now.</p>
|
||||
<p>You may <a href='?src=\ref[src];action=edit_area'>
|
||||
move an amendment</a> to the drawing.</p>
|
||||
"}
|
||||
if (AREA_SPECIAL)
|
||||
text += {"
|
||||
<p>This place doesn't noted on this blueprints.</p>
|
||||
"}
|
||||
else
|
||||
return
|
||||
text += "</BODY></HTML>"
|
||||
usr << browse(text, "window=blueprints")
|
||||
onclose(usr, "blueprints")
|
||||
|
||||
|
||||
/obj/item/blueprints/proc/get_area()
|
||||
var/turf/T = get_turf_loc(usr)
|
||||
var/area/A = T.loc
|
||||
A = A.master
|
||||
return A
|
||||
|
||||
/obj/item/blueprints/proc/get_area_type(var/area/A = get_area())
|
||||
if (A.name == "Space")
|
||||
return AREA_SPACE
|
||||
var/list/SPECIALS = list(
|
||||
/area/shuttle,
|
||||
/area/admin,
|
||||
/area/arrival,
|
||||
/area/centcom,
|
||||
/area/asteroid,
|
||||
/area/tdome,
|
||||
/area/syndicate_station,
|
||||
/area/wizard_station,
|
||||
/area/prison
|
||||
// /area/derelict //commented out, all hail derelict-rebuilders!
|
||||
)
|
||||
for (var/type in SPECIALS)
|
||||
if ( istype(A,type) )
|
||||
return AREA_SPECIAL
|
||||
return AREA_STATION
|
||||
|
||||
/obj/item/blueprints/proc/create_area()
|
||||
//world << "DEBUG: create_area"
|
||||
var/res = detect_room(get_turf_loc(usr))
|
||||
if(!istype(res,/list))
|
||||
switch(res)
|
||||
if(ROOM_ERR_SPACE)
|
||||
usr << "\red New area must be complete airtight!"
|
||||
return
|
||||
if(ROOM_ERR_TOOLARGE)
|
||||
usr << "\red New area too large!"
|
||||
return
|
||||
else
|
||||
usr << "\red Error! Please notify administration!"
|
||||
return
|
||||
var/list/turf/turfs = res
|
||||
var/str = sanitize(trim(input(usr,"New area title","Blueprints editing")))
|
||||
if(!str || !length(str)) //cancel
|
||||
return
|
||||
if(length(str) > 50)
|
||||
usr << "\red Text too long."
|
||||
return
|
||||
var/area/A = new
|
||||
A.name = str
|
||||
A.tag="[A.type]_[md5(str)]" // without this dynamic light system ruin everithing
|
||||
//var/ma
|
||||
//ma = A.master ? "[A.master]" : "(null)"
|
||||
//world << "DEBUG: create_area: <br>A.name=[A.name]<br>A.tag=[A.tag]<br>A.master=[ma]"
|
||||
A.power_equip = 0
|
||||
A.power_light = 0
|
||||
A.power_environ = 0
|
||||
move_turfs_to_area(turfs, A)
|
||||
spawn(5)
|
||||
//ma = A.master ? "[A.master]" : "(null)"
|
||||
//world << "DEBUG: create_area(5): <br>A.name=[A.name]<br>A.tag=[A.tag]<br>A.master=[ma]"
|
||||
interact()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/blueprints/proc/move_turfs_to_area(var/list/turf/turfs, var/area/A)
|
||||
A.contents.Add(turfs)
|
||||
//oldarea.contents.Remove(usr.loc) // not needed
|
||||
//T.loc = A //error: cannot change constant value
|
||||
|
||||
|
||||
/obj/item/blueprints/proc/edit_area()
|
||||
var/area/A = get_area()
|
||||
//world << "DEBUG: edit_area"
|
||||
var/prevname = A.name
|
||||
var/str = sanitize(trim(input(usr,"New area title","Blueprints editing",prevname)))
|
||||
if(!str || !length(str) || str==prevname) //cancel
|
||||
return
|
||||
if(length(str) > 50)
|
||||
usr << "\red Text too long."
|
||||
return
|
||||
set_area_machinery_title(A,str,prevname)
|
||||
for(var/area/RA in A.related)
|
||||
RA.name = str
|
||||
usr << "\blue You set the area '[prevname]' title to '[str]'."
|
||||
interact()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/blueprints/proc/set_area_machinery_title(var/area/A,var/title,var/oldtitle)
|
||||
if (!oldtitle) // or dd_replacetext goes to infinite loop
|
||||
return
|
||||
for(var/area/RA in A.related)
|
||||
for(var/obj/machinery/alarm/M in RA)
|
||||
M.name = dd_replacetext(M.name,oldtitle,title)
|
||||
for(var/obj/machinery/power/apc/M in RA)
|
||||
M.name = dd_replacetext(M.name,oldtitle,title)
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/M in RA)
|
||||
M.name = dd_replacetext(M.name,oldtitle,title)
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/M in RA)
|
||||
M.name = dd_replacetext(M.name,oldtitle,title)
|
||||
for(var/obj/machinery/door/M in RA)
|
||||
M.name = dd_replacetext(M.name,oldtitle,title)
|
||||
//TODO: much much more. Unnamed airlocks, cameras, etc.
|
||||
|
||||
/obj/item/blueprints/proc/check_tile_is_border(var/turf/T2,var/dir)
|
||||
if (istype(T2, /turf/space))
|
||||
return BORDER_SPACE //omg hull breach we all going to die here
|
||||
if (istype(T2, /turf/simulated/shuttle))
|
||||
return BORDER_SPACE
|
||||
if (get_area_type(T2.loc)!=AREA_SPACE)
|
||||
return BORDER_BETWEEN
|
||||
if (istype(T2, /turf/simulated/wall))
|
||||
return BORDER_2NDTILE
|
||||
if (!istype(T2, /turf/simulated))
|
||||
return BORDER_BETWEEN
|
||||
|
||||
for (var/obj/structure/window/W in T2)
|
||||
if(turn(dir,180) == W.dir)
|
||||
return BORDER_BETWEEN
|
||||
if (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST))
|
||||
return BORDER_2NDTILE
|
||||
for(var/obj/machinery/door/window/D in T2)
|
||||
if(turn(dir,180) == D.dir)
|
||||
return BORDER_BETWEEN
|
||||
if (locate(/obj/machinery/door) in T2)
|
||||
return BORDER_2NDTILE
|
||||
if (locate(/obj/structure/falsewall) in T2)
|
||||
return BORDER_2NDTILE
|
||||
if (locate(/obj/structure/falserwall) in T2)
|
||||
return BORDER_2NDTILE
|
||||
|
||||
return BORDER_NONE
|
||||
|
||||
/obj/item/blueprints/proc/detect_room(var/turf/first)
|
||||
var/list/turf/found = new
|
||||
var/list/turf/pending = list(first)
|
||||
while(pending.len)
|
||||
if (found.len+pending.len > 300)
|
||||
return ROOM_ERR_TOOLARGE
|
||||
var/turf/T = pending[1] //why byond havent list::pop()?
|
||||
pending -= T
|
||||
for (var/dir in cardinal)
|
||||
var/skip = 0
|
||||
for (var/obj/structure/window/W in T)
|
||||
if(dir == W.dir || (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST)))
|
||||
skip = 1; break
|
||||
if (skip) continue
|
||||
for(var/obj/machinery/door/window/D in T)
|
||||
if(dir == D.dir)
|
||||
skip = 1; break
|
||||
if (skip) continue
|
||||
|
||||
var/turf/NT = get_step(T,dir)
|
||||
if (!isturf(NT) || (NT in found) || (NT in pending))
|
||||
continue
|
||||
|
||||
switch(check_tile_is_border(NT,dir))
|
||||
if(BORDER_NONE)
|
||||
pending+=NT
|
||||
if(BORDER_BETWEEN)
|
||||
//do nothing, may be later i'll add 'rejected' list as optimization
|
||||
if(BORDER_2NDTILE)
|
||||
found+=NT //tile included to new area, but we dont seek more
|
||||
if(BORDER_SPACE)
|
||||
return ROOM_ERR_SPACE
|
||||
found+=T
|
||||
return found
|
||||
|
||||
/*
|
||||
/proc/check_apc(var/area/A)
|
||||
for(var/area/RA in A.related)
|
||||
for(var/obj/machinery/power/apc/FINDME in RA)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/fuckingfreemachinery()
|
||||
for(var/obj/machinery/machine in machines)
|
||||
if (istype(machine,/obj/machinery/power/solar))
|
||||
continue
|
||||
var/area/A = machine.loc.loc // make sure it's in an area
|
||||
if (istype(A,/area/tdome))
|
||||
continue
|
||||
if (istype(A,/area/shuttle))
|
||||
continue
|
||||
if(!A || !isarea(A))
|
||||
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) hasnt area!"
|
||||
continue
|
||||
A = A.master
|
||||
if (A.name=="Space")
|
||||
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) work in space!"
|
||||
continue
|
||||
if (!check_apc(A))
|
||||
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) work without APC!"
|
||||
world << "\red END ====="
|
||||
|
||||
/obj/item/blueprints
|
||||
var/const/AREA_ERRNONE = 0
|
||||
var/const/AREA_STATION = 1
|
||||
var/const/AREA_SPACE = 2
|
||||
var/const/AREA_SPECIAL = 3
|
||||
|
||||
var/const/BORDER_ERROR = 0
|
||||
var/const/BORDER_NONE = 1
|
||||
var/const/BORDER_BETWEEN = 2
|
||||
var/const/BORDER_2NDTILE = 3
|
||||
var/const/BORDER_SPACE = 4
|
||||
|
||||
var/const/ROOM_ERR_LOLWAT = 0
|
||||
var/const/ROOM_ERR_SPACE = -1
|
||||
var/const/ROOM_ERR_TOOLARGE = -2
|
||||
|
||||
/obj/item/blueprints/attack_self(mob/M as mob)
|
||||
if (!istype(M,/mob/living/carbon/human))
|
||||
M << "This is stack of useless pieces of harsh paper." //monkeys cannot into projecting
|
||||
return
|
||||
interact()
|
||||
return
|
||||
|
||||
/obj/item/blueprints/Topic(href, href_list)
|
||||
..()
|
||||
if ((usr.restrained() || usr.stat || usr.equipped() != src))
|
||||
return
|
||||
if (!href_list["action"])
|
||||
return
|
||||
switch(href_list["action"])
|
||||
if ("create_area")
|
||||
if (get_area_type()!=AREA_SPACE)
|
||||
interact()
|
||||
return
|
||||
create_area()
|
||||
if ("edit_area")
|
||||
if (get_area_type()!=AREA_STATION)
|
||||
interact()
|
||||
return
|
||||
edit_area()
|
||||
|
||||
/obj/item/blueprints/proc/interact()
|
||||
var/area/A = get_area()
|
||||
var/text = {"<HTML><head><title>[src]</title></head><BODY>
|
||||
<h2>[station_name()] blueprints</h2>
|
||||
<small>Property of Nanotrasen. For heads of staff only. Store in high-secure storage.</small><hr>
|
||||
"}
|
||||
switch (get_area_type())
|
||||
if (AREA_SPACE)
|
||||
text += {"
|
||||
<p>According this blueprints you are in <b>open space</b> now.</p>
|
||||
<p><a href='?src=\ref[src];action=create_area'>Mark this place as new area.</a></p>
|
||||
"}
|
||||
if (AREA_STATION)
|
||||
text += {"
|
||||
<p>According this blueprints you are in <b>[A.name]</b> now.</p>
|
||||
<p>You may <a href='?src=\ref[src];action=edit_area'>
|
||||
move an amendment</a> to the drawing.</p>
|
||||
"}
|
||||
if (AREA_SPECIAL)
|
||||
text += {"
|
||||
<p>This place doesn't noted on this blueprints.</p>
|
||||
"}
|
||||
else
|
||||
return
|
||||
text += "</BODY></HTML>"
|
||||
usr << browse(text, "window=blueprints")
|
||||
onclose(usr, "blueprints")
|
||||
|
||||
|
||||
/obj/item/blueprints/proc/get_area()
|
||||
var/turf/T = get_turf_loc(usr)
|
||||
var/area/A = T.loc
|
||||
A = A.master
|
||||
return A
|
||||
|
||||
/obj/item/blueprints/proc/get_area_type(var/area/A = get_area())
|
||||
if (A.name == "Space")
|
||||
return AREA_SPACE
|
||||
var/list/SPECIALS = list(
|
||||
/area/shuttle,
|
||||
/area/admin,
|
||||
/area/arrival,
|
||||
/area/centcom,
|
||||
/area/asteroid,
|
||||
/area/tdome,
|
||||
/area/syndicate_station,
|
||||
/area/wizard_station,
|
||||
/area/prison
|
||||
// /area/derelict //commented out, all hail derelict-rebuilders!
|
||||
)
|
||||
for (var/type in SPECIALS)
|
||||
if ( istype(A,type) )
|
||||
return AREA_SPECIAL
|
||||
return AREA_STATION
|
||||
|
||||
/obj/item/blueprints/proc/create_area()
|
||||
//world << "DEBUG: create_area"
|
||||
var/res = detect_room(get_turf_loc(usr))
|
||||
if(!istype(res,/list))
|
||||
switch(res)
|
||||
if(ROOM_ERR_SPACE)
|
||||
usr << "\red New area must be complete airtight!"
|
||||
return
|
||||
if(ROOM_ERR_TOOLARGE)
|
||||
usr << "\red New area too large!"
|
||||
return
|
||||
else
|
||||
usr << "\red Error! Please notify administration!"
|
||||
return
|
||||
var/list/turf/turfs = res
|
||||
var/str = sanitize(trim(input(usr,"New area title","Blueprints editing")))
|
||||
if(!str || !length(str)) //cancel
|
||||
return
|
||||
if(length(str) > 50)
|
||||
usr << "\red Text too long."
|
||||
return
|
||||
var/area/A = new
|
||||
A.name = str
|
||||
A.tag="[A.type]_[md5(str)]" // without this dynamic light system ruin everithing
|
||||
//var/ma
|
||||
//ma = A.master ? "[A.master]" : "(null)"
|
||||
//world << "DEBUG: create_area: <br>A.name=[A.name]<br>A.tag=[A.tag]<br>A.master=[ma]"
|
||||
A.power_equip = 0
|
||||
A.power_light = 0
|
||||
A.power_environ = 0
|
||||
move_turfs_to_area(turfs, A)
|
||||
spawn(5)
|
||||
//ma = A.master ? "[A.master]" : "(null)"
|
||||
//world << "DEBUG: create_area(5): <br>A.name=[A.name]<br>A.tag=[A.tag]<br>A.master=[ma]"
|
||||
interact()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/blueprints/proc/move_turfs_to_area(var/list/turf/turfs, var/area/A)
|
||||
A.contents.Add(turfs)
|
||||
//oldarea.contents.Remove(usr.loc) // not needed
|
||||
//T.loc = A //error: cannot change constant value
|
||||
|
||||
|
||||
/obj/item/blueprints/proc/edit_area()
|
||||
var/area/A = get_area()
|
||||
//world << "DEBUG: edit_area"
|
||||
var/prevname = A.name
|
||||
var/str = sanitize(trim(input(usr,"New area title","Blueprints editing",prevname)))
|
||||
if(!str || !length(str) || str==prevname) //cancel
|
||||
return
|
||||
if(length(str) > 50)
|
||||
usr << "\red Text too long."
|
||||
return
|
||||
set_area_machinery_title(A,str,prevname)
|
||||
for(var/area/RA in A.related)
|
||||
RA.name = str
|
||||
usr << "\blue You set the area '[prevname]' title to '[str]'."
|
||||
interact()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/blueprints/proc/set_area_machinery_title(var/area/A,var/title,var/oldtitle)
|
||||
if (!oldtitle) // or dd_replacetext goes to infinite loop
|
||||
return
|
||||
for(var/area/RA in A.related)
|
||||
for(var/obj/machinery/alarm/M in RA)
|
||||
M.name = dd_replacetext(M.name,oldtitle,title)
|
||||
for(var/obj/machinery/power/apc/M in RA)
|
||||
M.name = dd_replacetext(M.name,oldtitle,title)
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/M in RA)
|
||||
M.name = dd_replacetext(M.name,oldtitle,title)
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/M in RA)
|
||||
M.name = dd_replacetext(M.name,oldtitle,title)
|
||||
for(var/obj/machinery/door/M in RA)
|
||||
M.name = dd_replacetext(M.name,oldtitle,title)
|
||||
//TODO: much much more. Unnamed airlocks, cameras, etc.
|
||||
|
||||
/obj/item/blueprints/proc/check_tile_is_border(var/turf/T2,var/dir)
|
||||
if (istype(T2, /turf/space))
|
||||
return BORDER_SPACE //omg hull breach we all going to die here
|
||||
if (istype(T2, /turf/simulated/shuttle))
|
||||
return BORDER_SPACE
|
||||
if (get_area_type(T2.loc)!=AREA_SPACE)
|
||||
return BORDER_BETWEEN
|
||||
if (istype(T2, /turf/simulated/wall))
|
||||
return BORDER_2NDTILE
|
||||
if (!istype(T2, /turf/simulated))
|
||||
return BORDER_BETWEEN
|
||||
|
||||
for (var/obj/structure/window/W in T2)
|
||||
if(turn(dir,180) == W.dir)
|
||||
return BORDER_BETWEEN
|
||||
if (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST))
|
||||
return BORDER_2NDTILE
|
||||
for(var/obj/machinery/door/window/D in T2)
|
||||
if(turn(dir,180) == D.dir)
|
||||
return BORDER_BETWEEN
|
||||
if (locate(/obj/machinery/door) in T2)
|
||||
return BORDER_2NDTILE
|
||||
if (locate(/obj/structure/falsewall) in T2)
|
||||
return BORDER_2NDTILE
|
||||
if (locate(/obj/structure/falserwall) in T2)
|
||||
return BORDER_2NDTILE
|
||||
|
||||
return BORDER_NONE
|
||||
|
||||
/obj/item/blueprints/proc/detect_room(var/turf/first)
|
||||
var/list/turf/found = new
|
||||
var/list/turf/pending = list(first)
|
||||
while(pending.len)
|
||||
if (found.len+pending.len > 300)
|
||||
return ROOM_ERR_TOOLARGE
|
||||
var/turf/T = pending[1] //why byond havent list::pop()?
|
||||
pending -= T
|
||||
for (var/dir in cardinal)
|
||||
var/skip = 0
|
||||
for (var/obj/structure/window/W in T)
|
||||
if(dir == W.dir || (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST)))
|
||||
skip = 1; break
|
||||
if (skip) continue
|
||||
for(var/obj/machinery/door/window/D in T)
|
||||
if(dir == D.dir)
|
||||
skip = 1; break
|
||||
if (skip) continue
|
||||
|
||||
var/turf/NT = get_step(T,dir)
|
||||
if (!isturf(NT) || (NT in found) || (NT in pending))
|
||||
continue
|
||||
|
||||
switch(check_tile_is_border(NT,dir))
|
||||
if(BORDER_NONE)
|
||||
pending+=NT
|
||||
if(BORDER_BETWEEN)
|
||||
//do nothing, may be later i'll add 'rejected' list as optimization
|
||||
if(BORDER_2NDTILE)
|
||||
found+=NT //tile included to new area, but we dont seek more
|
||||
if(BORDER_SPACE)
|
||||
return ROOM_ERR_SPACE
|
||||
found+=T
|
||||
return found
|
||||
|
||||
/*
|
||||
/proc/check_apc(var/area/A)
|
||||
for(var/area/RA in A.related)
|
||||
for(var/obj/machinery/power/apc/FINDME in RA)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/fuckingfreemachinery()
|
||||
for(var/obj/machinery/machine in machines)
|
||||
if (istype(machine,/obj/machinery/power/solar))
|
||||
continue
|
||||
var/area/A = machine.loc.loc // make sure it's in an area
|
||||
if (istype(A,/area/tdome))
|
||||
continue
|
||||
if (istype(A,/area/shuttle))
|
||||
continue
|
||||
if(!A || !isarea(A))
|
||||
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) hasnt area!"
|
||||
continue
|
||||
A = A.master
|
||||
if (A.name=="Space")
|
||||
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) work in space!"
|
||||
continue
|
||||
if (!check_apc(A))
|
||||
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) work without APC!"
|
||||
world << "\red END ====="
|
||||
|
||||
*/
|
||||
@@ -307,6 +307,14 @@
|
||||
<li>Install the external reinforced armor plating (Not included due to Nanotrasen regulations. Can be made using 5 reinforced metal sheets.)</li>
|
||||
<li>Secure the external reinforced armor plating with a wrench</li>
|
||||
<li>Weld the external reinforced armor plating to the chassis</li>
|
||||
<li></li>
|
||||
<li>Additional Information:</li>
|
||||
<li>The firefighting variation is made in a similar fashion.</li>
|
||||
<li>A firesuit must be connected to the Firefighter chassis for heat shielding.</li>
|
||||
<li>Internal armor is plasteel for additional strength.</li>
|
||||
<li>External armor must be installed in 2 parts, totaling 10 sheets.</li>
|
||||
<li>Completed mech is more resiliant against fire, and is a bit more durable overall</li>
|
||||
<li>Nanotrasen is determined to the safety of its <s>investments</s> employees.</li>
|
||||
</ol>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
icon_state = "plantbag"
|
||||
name = "Plant Bag"
|
||||
var/mode = 1; //0 = pick one at a time, 1 = pick all on tile
|
||||
var/capacity = 10; //the number of plant pieces it can carry.
|
||||
var/capacity = 50; //the number of plant pieces it can carry.
|
||||
flags = FPRINT | TABLEPASS | ONBELT
|
||||
w_class = 1
|
||||
|
||||
|
||||
+136
-136
@@ -1,137 +1,137 @@
|
||||
|
||||
/obj/effect/new_year_tree
|
||||
name = "The fir"
|
||||
desc = "This is a fir. Real fir on dammit spess station. You smell pine-needles."
|
||||
icon = '160x160.dmi'
|
||||
icon_state = "new-year-tree"
|
||||
anchored = 1
|
||||
opacity = 1
|
||||
density = 1
|
||||
layer = 5
|
||||
pixel_x = -64
|
||||
//pixel_y = -64
|
||||
|
||||
/obj/effect/new_year_tree/attackby(obj/item/W, mob/user)
|
||||
if (istype(W, /obj/item/weapon/grab))
|
||||
return
|
||||
W.loc = src
|
||||
if (user.client)
|
||||
user.client.screen -= W
|
||||
user.u_equip(W)
|
||||
var/const/bottom_right_x = 115.0
|
||||
var/const/bottom_right_y = 150.0
|
||||
var/const/top_left_x = 15.0
|
||||
var/const/top_left_y = 15.0
|
||||
var/const/bottom_med_x = top_left_x+(bottom_right_x-top_left_x)/2
|
||||
var/x = rand(top_left_x,bottom_med_x) //point in half of circumscribing rectangle
|
||||
var/y = rand(top_left_y,bottom_right_y)
|
||||
/*
|
||||
y1=a*x1+b
|
||||
y2=a*x2+b b = y2-a*x2
|
||||
|
||||
y1=a*x1+ y2-a*x2
|
||||
a*(x1-x2)+y2-y1=0
|
||||
a = (y1-y2)/(x1-x2)
|
||||
*/
|
||||
var/a = (top_left_y-bottom_right_y)/(top_left_x-bottom_med_x)
|
||||
var/b = bottom_right_y-a*bottom_med_x
|
||||
|
||||
if (a*x+b < y) //if point is above diagonal top_left -> bottom_median
|
||||
x = bottom_med_x + x - top_left_x
|
||||
y = bottom_right_y - y + top_left_y
|
||||
var/image/I = image(W.icon, W, icon_state = W.icon_state)
|
||||
I.pixel_x = x
|
||||
I.pixel_y = y
|
||||
overlays += I
|
||||
|
||||
/obj/item/weapon/firbang
|
||||
desc = "It is set to detonate in 10 seconds."
|
||||
name = "firbang"
|
||||
icon = 'grenade.dmi'
|
||||
icon_state = "flashbang"
|
||||
var/state = null
|
||||
var/det_time = 100.0
|
||||
w_class = 2.0
|
||||
item_state = "flashbang"
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
|
||||
|
||||
/obj/item/weapon/firbang/afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
|
||||
if (user.equipped() == src)
|
||||
if ((user.mutations & CLUMSY) && prob(50))
|
||||
user << "\red Huh? How does this thing work?!"
|
||||
src.state = 1
|
||||
src.icon_state = "flashbang1"
|
||||
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
|
||||
spawn( 5 )
|
||||
prime()
|
||||
return
|
||||
else if (!( src.state ))
|
||||
user << "\red You prime the [src]! [det_time/10] seconds!"
|
||||
src.state = 1
|
||||
src.icon_state = "flashbang1"
|
||||
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
|
||||
spawn( src.det_time )
|
||||
prime()
|
||||
return
|
||||
user.dir = get_dir(user, target)
|
||||
user.drop_item()
|
||||
var/t = (isturf(target) ? target : target.loc)
|
||||
walk_towards(src, t, 3)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/weapon/firbang/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/item/weapon/firbang/attack_hand()
|
||||
walk(src, null, null)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/firbang/proc/prime()
|
||||
playsound(src.loc, 'bang.ogg', 25, 1)
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new
|
||||
smoke.set_up(3, 0, src.loc)
|
||||
smoke.attach(src)
|
||||
smoke.start()
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
new /obj/effect/new_year_tree(T)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/firbang/attack_self(mob/user as mob)
|
||||
if (!src.state)
|
||||
if (user.mutations & CLUMSY)
|
||||
user << "\red Huh? How does this thing work?!"
|
||||
spawn( 5 )
|
||||
prime()
|
||||
return
|
||||
else
|
||||
user << "\red You prime the [src]! [det_time/10] seconds!"
|
||||
src.state = 1
|
||||
src.icon_state = "flashbang1"
|
||||
add_fingerprint(user)
|
||||
spawn( src.det_time )
|
||||
prime()
|
||||
return
|
||||
return
|
||||
|
||||
/*
|
||||
/datum/supply_packs/new_year
|
||||
name = "New Year Celebration Equipment"
|
||||
contains = list("/obj/item/weapon/firbang",
|
||||
"/obj/item/weapon/firbang",
|
||||
"/obj/item/weapon/firbang",
|
||||
"/obj/item/weapon/wrapping_paper",
|
||||
"/obj/item/weapon/wrapping_paper",
|
||||
"/obj/item/weapon/wrapping_paper")
|
||||
cost = 20
|
||||
containertype = "/obj/structure/closet/crate"
|
||||
containername = "New Year Celebration crate"
|
||||
|
||||
/obj/effect/new_year_tree
|
||||
name = "The fir"
|
||||
desc = "This is a fir. Real fir on dammit spess station. You smell pine-needles."
|
||||
icon = '160x160.dmi'
|
||||
icon_state = "new-year-tree"
|
||||
anchored = 1
|
||||
opacity = 1
|
||||
density = 1
|
||||
layer = 5
|
||||
pixel_x = -64
|
||||
//pixel_y = -64
|
||||
|
||||
/obj/effect/new_year_tree/attackby(obj/item/W, mob/user)
|
||||
if (istype(W, /obj/item/weapon/grab))
|
||||
return
|
||||
W.loc = src
|
||||
if (user.client)
|
||||
user.client.screen -= W
|
||||
user.u_equip(W)
|
||||
var/const/bottom_right_x = 115.0
|
||||
var/const/bottom_right_y = 150.0
|
||||
var/const/top_left_x = 15.0
|
||||
var/const/top_left_y = 15.0
|
||||
var/const/bottom_med_x = top_left_x+(bottom_right_x-top_left_x)/2
|
||||
var/x = rand(top_left_x,bottom_med_x) //point in half of circumscribing rectangle
|
||||
var/y = rand(top_left_y,bottom_right_y)
|
||||
/*
|
||||
y1=a*x1+b
|
||||
y2=a*x2+b b = y2-a*x2
|
||||
|
||||
y1=a*x1+ y2-a*x2
|
||||
a*(x1-x2)+y2-y1=0
|
||||
a = (y1-y2)/(x1-x2)
|
||||
*/
|
||||
var/a = (top_left_y-bottom_right_y)/(top_left_x-bottom_med_x)
|
||||
var/b = bottom_right_y-a*bottom_med_x
|
||||
|
||||
if (a*x+b < y) //if point is above diagonal top_left -> bottom_median
|
||||
x = bottom_med_x + x - top_left_x
|
||||
y = bottom_right_y - y + top_left_y
|
||||
var/image/I = image(W.icon, W, icon_state = W.icon_state)
|
||||
I.pixel_x = x
|
||||
I.pixel_y = y
|
||||
overlays += I
|
||||
|
||||
/obj/item/weapon/firbang
|
||||
desc = "It is set to detonate in 10 seconds."
|
||||
name = "firbang"
|
||||
icon = 'grenade.dmi'
|
||||
icon_state = "flashbang"
|
||||
var/state = null
|
||||
var/det_time = 100.0
|
||||
w_class = 2.0
|
||||
item_state = "flashbang"
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
|
||||
|
||||
/obj/item/weapon/firbang/afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
|
||||
if (user.equipped() == src)
|
||||
if ((user.mutations & CLUMSY) && prob(50))
|
||||
user << "\red Huh? How does this thing work?!"
|
||||
src.state = 1
|
||||
src.icon_state = "flashbang1"
|
||||
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
|
||||
spawn( 5 )
|
||||
prime()
|
||||
return
|
||||
else if (!( src.state ))
|
||||
user << "\red You prime the [src]! [det_time/10] seconds!"
|
||||
src.state = 1
|
||||
src.icon_state = "flashbang1"
|
||||
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
|
||||
spawn( src.det_time )
|
||||
prime()
|
||||
return
|
||||
user.dir = get_dir(user, target)
|
||||
user.drop_item()
|
||||
var/t = (isturf(target) ? target : target.loc)
|
||||
walk_towards(src, t, 3)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/weapon/firbang/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/item/weapon/firbang/attack_hand()
|
||||
walk(src, null, null)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/firbang/proc/prime()
|
||||
playsound(src.loc, 'bang.ogg', 25, 1)
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new
|
||||
smoke.set_up(3, 0, src.loc)
|
||||
smoke.attach(src)
|
||||
smoke.start()
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
new /obj/effect/new_year_tree(T)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/firbang/attack_self(mob/user as mob)
|
||||
if (!src.state)
|
||||
if (user.mutations & CLUMSY)
|
||||
user << "\red Huh? How does this thing work?!"
|
||||
spawn( 5 )
|
||||
prime()
|
||||
return
|
||||
else
|
||||
user << "\red You prime the [src]! [det_time/10] seconds!"
|
||||
src.state = 1
|
||||
src.icon_state = "flashbang1"
|
||||
add_fingerprint(user)
|
||||
spawn( src.det_time )
|
||||
prime()
|
||||
return
|
||||
return
|
||||
|
||||
/*
|
||||
/datum/supply_packs/new_year
|
||||
name = "New Year Celebration Equipment"
|
||||
contains = list("/obj/item/weapon/firbang",
|
||||
"/obj/item/weapon/firbang",
|
||||
"/obj/item/weapon/firbang",
|
||||
"/obj/item/weapon/wrapping_paper",
|
||||
"/obj/item/weapon/wrapping_paper",
|
||||
"/obj/item/weapon/wrapping_paper")
|
||||
cost = 20
|
||||
containertype = "/obj/structure/closet/crate"
|
||||
containername = "New Year Celebration crate"
|
||||
*/
|
||||
+218
-218
@@ -1,218 +1,218 @@
|
||||
/*
|
||||
Base object for stackable items.
|
||||
Stackable items are:
|
||||
metal
|
||||
rmetal
|
||||
glass
|
||||
rglass
|
||||
wood planks
|
||||
floor tiles
|
||||
metal rods
|
||||
*/
|
||||
|
||||
/obj/item/stack/New(var/loc, var/amount=null)
|
||||
..()
|
||||
if (amount)
|
||||
src.amount=amount
|
||||
|
||||
return
|
||||
|
||||
/obj/item/stack/examine()
|
||||
set src in view(1)
|
||||
..()
|
||||
usr << text("There are [] []\s left on the stack.", src.amount, src.singular_name)
|
||||
return
|
||||
|
||||
/obj/item/stack/proc/use(var/amount)
|
||||
src.amount-=amount
|
||||
if (src.amount<=0)
|
||||
var/oldsrc = src
|
||||
src = null //dont kill proc after del()
|
||||
usr.before_take_item(oldsrc)
|
||||
del(oldsrc)
|
||||
return
|
||||
|
||||
/obj/item/stack/proc/add_to_stacks(mob/usr as mob)
|
||||
var/obj/item/stack/oldsrc = src
|
||||
src = null
|
||||
for (var/obj/item/stack/item in usr.loc)
|
||||
if (item==oldsrc)
|
||||
continue
|
||||
if (!istype(item, oldsrc.type))
|
||||
continue
|
||||
if (item.amount>=item.max_amount)
|
||||
continue
|
||||
oldsrc.attackby(item, usr)
|
||||
usr << "You add new [item.singular_name] to the stack. It now contains [item.amount] [item.singular_name]\s."
|
||||
if(!oldsrc)
|
||||
break
|
||||
|
||||
/obj/item/stack/attack_hand(mob/user as mob)
|
||||
if (user.get_inactive_hand() == src)
|
||||
var/obj/item/stack/F = new src.type( user, amount=1)
|
||||
F.copy_evidences(src)
|
||||
user.put_in_hand(F)
|
||||
src.add_fingerprint(user)
|
||||
F.add_fingerprint(user)
|
||||
use(1)
|
||||
if (src && usr.machine==src)
|
||||
spawn(0) src.interact(usr)
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/stack/attackby(obj/item/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, src.type))
|
||||
var/obj/item/stack/S = W
|
||||
if (S.amount >= max_amount)
|
||||
return 1
|
||||
var/to_transfer as num
|
||||
if (user.get_inactive_hand()==src)
|
||||
to_transfer = 1
|
||||
else
|
||||
to_transfer = min(src.amount, S.max_amount-S.amount)
|
||||
S.amount+=to_transfer
|
||||
if (S && usr.machine==S)
|
||||
spawn(0) S.interact(usr)
|
||||
src.use(to_transfer)
|
||||
if (src && usr.machine==src)
|
||||
spawn(0) src.interact(usr)
|
||||
else return ..()
|
||||
|
||||
/obj/item/stack/proc/copy_evidences(obj/item/stack/from as obj)
|
||||
src.blood_DNA = from.blood_DNA
|
||||
src.blood_type = from.blood_type
|
||||
src.fingerprints = from.fingerprints
|
||||
src.fingerprintshidden = from.fingerprintshidden
|
||||
src.fingerprintslast = from.fingerprintslast
|
||||
//TODO bloody overlay
|
||||
|
||||
/datum/stack_recipe
|
||||
var/title = "ERROR"
|
||||
var/result_type
|
||||
var/req_amount = 1
|
||||
var/res_amount = 1
|
||||
var/max_res_amount = 1
|
||||
var/time = 0
|
||||
var/one_per_turf = 0
|
||||
var/on_floor = 0
|
||||
New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1, time = 0, one_per_turf = 0, on_floor = 0)
|
||||
src.title = title
|
||||
src.result_type = result_type
|
||||
src.req_amount = req_amount
|
||||
src.res_amount = res_amount
|
||||
src.max_res_amount = max_res_amount
|
||||
src.time = time
|
||||
src.one_per_turf = one_per_turf
|
||||
src.on_floor = on_floor
|
||||
|
||||
/obj/item/stack
|
||||
var/list/datum/stack_recipe/recipes
|
||||
origin_tech = "materials=1"
|
||||
|
||||
/obj/item/stack/attack_self(mob/user as mob)
|
||||
interact(user)
|
||||
|
||||
/obj/item/stack/proc/interact(mob/user as mob)
|
||||
if (!recipes)
|
||||
return
|
||||
if (!src || amount<=0)
|
||||
user << browse(null, "window=stack")
|
||||
user.machine = src //for correct work of onclose
|
||||
var/t1 = text("<HTML><HEAD><title>Constructions from []</title></HEAD><body><TT>Amount Left: []<br>", src, src.amount)
|
||||
for(var/i=1;i<=recipes.len,i++)
|
||||
var/datum/stack_recipe/R = recipes[i]
|
||||
if (isnull(R))
|
||||
t1 += "<hr>"
|
||||
continue
|
||||
if (i>1 && !isnull(recipes[i-1]))
|
||||
t1+="<br>"
|
||||
var/max_multiplier = round(src.amount / R.req_amount)
|
||||
var/title as text
|
||||
var/can_build = 1
|
||||
can_build = can_build && (max_multiplier>0)
|
||||
/*
|
||||
if (R.one_per_turf)
|
||||
can_build = can_build && !(locate(R.result_type) in usr.loc)
|
||||
if (R.on_floor)
|
||||
can_build = can_build && istype(usr.loc, /turf/simulated/floor)
|
||||
*/
|
||||
if (R.res_amount>1)
|
||||
title+= "[R.res_amount]x [R.title]\s"
|
||||
else
|
||||
title+= "[R.title]"
|
||||
title+= " ([R.req_amount] [src.singular_name]\s)"
|
||||
if (can_build)
|
||||
t1 += text("<A href='?src=\ref[];make=[]'>[]</A> ", src, i, title)
|
||||
else
|
||||
t1 += text("[]", title)
|
||||
continue
|
||||
if (R.max_res_amount>1 && max_multiplier>1)
|
||||
max_multiplier = min(max_multiplier, round(R.max_res_amount/R.res_amount))
|
||||
t1 += " |"
|
||||
var/list/multipliers = list(5,10,25)
|
||||
for (var/n in multipliers)
|
||||
if (max_multiplier>=n)
|
||||
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[n]'>[n*R.res_amount]x</A>"
|
||||
if (!(max_multiplier in multipliers))
|
||||
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[max_multiplier]'>[max_multiplier*R.res_amount]x</A>"
|
||||
|
||||
t1 += "</TT></body></HTML>"
|
||||
user << browse(t1, "window=stack")
|
||||
onclose(user, "stack")
|
||||
return
|
||||
|
||||
/obj/item/stack/Topic(href, href_list)
|
||||
..()
|
||||
if ((usr.restrained() || usr.stat || usr.equipped() != src))
|
||||
return
|
||||
if (href_list["make"])
|
||||
if (src.amount < 1) del(src) //Never should happen
|
||||
|
||||
var/datum/stack_recipe/R = recipes[text2num(href_list["make"])]
|
||||
var/multiplier = text2num(href_list["multiplier"])
|
||||
if (!multiplier) multiplier = 1
|
||||
if (src.amount < R.req_amount*multiplier)
|
||||
if (R.req_amount*multiplier>1)
|
||||
usr << "\red You haven't got enough [src] to build \the [R.req_amount*multiplier] [R.title]\s!"
|
||||
else
|
||||
usr << "\red You haven't got enough [src] to build \the [R.title]!"
|
||||
return
|
||||
if (R.one_per_turf && (locate(R.result_type) in usr.loc))
|
||||
usr << "\red There is another [R.title] here!"
|
||||
return
|
||||
if (R.on_floor && !istype(usr.loc, /turf/simulated/floor))
|
||||
usr << "\red \The [R.title] must be constructed on the floor!"
|
||||
return
|
||||
if (R.time)
|
||||
usr << "\blue Building [R.title] ..."
|
||||
if (!do_after(usr, R.time))
|
||||
return
|
||||
if (src.amount < R.req_amount*multiplier)
|
||||
return
|
||||
var/atom/O = new R.result_type( usr.loc )
|
||||
O.dir = usr.dir
|
||||
if (R.max_res_amount>1)
|
||||
var/obj/item/stack/new_item = O
|
||||
new_item.amount = R.res_amount*multiplier
|
||||
//new_item.add_to_stacks(usr)
|
||||
src.amount-=R.req_amount*multiplier
|
||||
if (src.amount<=0)
|
||||
var/oldsrc = src
|
||||
src = null //dont kill proc after del()
|
||||
usr.before_take_item(oldsrc)
|
||||
del(oldsrc)
|
||||
if (istype(O,/obj/item))
|
||||
usr.put_in_hand(O)
|
||||
O.add_fingerprint(usr)
|
||||
if (src && usr.machine==src) //do not reopen closed window
|
||||
spawn( 0 )
|
||||
src.interact(usr)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/stack/Del()
|
||||
if (src && usr && usr.machine==src)
|
||||
usr << browse(null, "window=stack")
|
||||
..()
|
||||
/*
|
||||
Base object for stackable items.
|
||||
Stackable items are:
|
||||
metal
|
||||
rmetal
|
||||
glass
|
||||
rglass
|
||||
wood planks
|
||||
floor tiles
|
||||
metal rods
|
||||
*/
|
||||
|
||||
/obj/item/stack/New(var/loc, var/amount=null)
|
||||
..()
|
||||
if (amount)
|
||||
src.amount=amount
|
||||
|
||||
return
|
||||
|
||||
/obj/item/stack/examine()
|
||||
set src in view(1)
|
||||
..()
|
||||
usr << text("There are [] []\s left on the stack.", src.amount, src.singular_name)
|
||||
return
|
||||
|
||||
/obj/item/stack/proc/use(var/amount)
|
||||
src.amount-=amount
|
||||
if (src.amount<=0)
|
||||
var/oldsrc = src
|
||||
src = null //dont kill proc after del()
|
||||
usr.before_take_item(oldsrc)
|
||||
del(oldsrc)
|
||||
return
|
||||
|
||||
/obj/item/stack/proc/add_to_stacks(mob/usr as mob)
|
||||
var/obj/item/stack/oldsrc = src
|
||||
src = null
|
||||
for (var/obj/item/stack/item in usr.loc)
|
||||
if (item==oldsrc)
|
||||
continue
|
||||
if (!istype(item, oldsrc.type))
|
||||
continue
|
||||
if (item.amount>=item.max_amount)
|
||||
continue
|
||||
oldsrc.attackby(item, usr)
|
||||
usr << "You add new [item.singular_name] to the stack. It now contains [item.amount] [item.singular_name]\s."
|
||||
if(!oldsrc)
|
||||
break
|
||||
|
||||
/obj/item/stack/attack_hand(mob/user as mob)
|
||||
if (user.get_inactive_hand() == src)
|
||||
var/obj/item/stack/F = new src.type( user, amount=1)
|
||||
F.copy_evidences(src)
|
||||
user.put_in_hand(F)
|
||||
src.add_fingerprint(user)
|
||||
F.add_fingerprint(user)
|
||||
use(1)
|
||||
if (src && usr.machine==src)
|
||||
spawn(0) src.interact(usr)
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/stack/attackby(obj/item/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, src.type))
|
||||
var/obj/item/stack/S = W
|
||||
if (S.amount >= max_amount)
|
||||
return 1
|
||||
var/to_transfer as num
|
||||
if (user.get_inactive_hand()==src)
|
||||
to_transfer = 1
|
||||
else
|
||||
to_transfer = min(src.amount, S.max_amount-S.amount)
|
||||
S.amount+=to_transfer
|
||||
if (S && usr.machine==S)
|
||||
spawn(0) S.interact(usr)
|
||||
src.use(to_transfer)
|
||||
if (src && usr.machine==src)
|
||||
spawn(0) src.interact(usr)
|
||||
else return ..()
|
||||
|
||||
/obj/item/stack/proc/copy_evidences(obj/item/stack/from as obj)
|
||||
src.blood_DNA = from.blood_DNA
|
||||
src.blood_type = from.blood_type
|
||||
src.fingerprints = from.fingerprints
|
||||
src.fingerprintshidden = from.fingerprintshidden
|
||||
src.fingerprintslast = from.fingerprintslast
|
||||
//TODO bloody overlay
|
||||
|
||||
/datum/stack_recipe
|
||||
var/title = "ERROR"
|
||||
var/result_type
|
||||
var/req_amount = 1
|
||||
var/res_amount = 1
|
||||
var/max_res_amount = 1
|
||||
var/time = 0
|
||||
var/one_per_turf = 0
|
||||
var/on_floor = 0
|
||||
New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1, time = 0, one_per_turf = 0, on_floor = 0)
|
||||
src.title = title
|
||||
src.result_type = result_type
|
||||
src.req_amount = req_amount
|
||||
src.res_amount = res_amount
|
||||
src.max_res_amount = max_res_amount
|
||||
src.time = time
|
||||
src.one_per_turf = one_per_turf
|
||||
src.on_floor = on_floor
|
||||
|
||||
/obj/item/stack
|
||||
var/list/datum/stack_recipe/recipes
|
||||
origin_tech = "materials=1"
|
||||
|
||||
/obj/item/stack/attack_self(mob/user as mob)
|
||||
interact(user)
|
||||
|
||||
/obj/item/stack/proc/interact(mob/user as mob)
|
||||
if (!recipes)
|
||||
return
|
||||
if (!src || amount<=0)
|
||||
user << browse(null, "window=stack")
|
||||
user.machine = src //for correct work of onclose
|
||||
var/t1 = text("<HTML><HEAD><title>Constructions from []</title></HEAD><body><TT>Amount Left: []<br>", src, src.amount)
|
||||
for(var/i=1;i<=recipes.len,i++)
|
||||
var/datum/stack_recipe/R = recipes[i]
|
||||
if (isnull(R))
|
||||
t1 += "<hr>"
|
||||
continue
|
||||
if (i>1 && !isnull(recipes[i-1]))
|
||||
t1+="<br>"
|
||||
var/max_multiplier = round(src.amount / R.req_amount)
|
||||
var/title as text
|
||||
var/can_build = 1
|
||||
can_build = can_build && (max_multiplier>0)
|
||||
/*
|
||||
if (R.one_per_turf)
|
||||
can_build = can_build && !(locate(R.result_type) in usr.loc)
|
||||
if (R.on_floor)
|
||||
can_build = can_build && istype(usr.loc, /turf/simulated/floor)
|
||||
*/
|
||||
if (R.res_amount>1)
|
||||
title+= "[R.res_amount]x [R.title]\s"
|
||||
else
|
||||
title+= "[R.title]"
|
||||
title+= " ([R.req_amount] [src.singular_name]\s)"
|
||||
if (can_build)
|
||||
t1 += text("<A href='?src=\ref[];make=[]'>[]</A> ", src, i, title)
|
||||
else
|
||||
t1 += text("[]", title)
|
||||
continue
|
||||
if (R.max_res_amount>1 && max_multiplier>1)
|
||||
max_multiplier = min(max_multiplier, round(R.max_res_amount/R.res_amount))
|
||||
t1 += " |"
|
||||
var/list/multipliers = list(5,10,25)
|
||||
for (var/n in multipliers)
|
||||
if (max_multiplier>=n)
|
||||
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[n]'>[n*R.res_amount]x</A>"
|
||||
if (!(max_multiplier in multipliers))
|
||||
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[max_multiplier]'>[max_multiplier*R.res_amount]x</A>"
|
||||
|
||||
t1 += "</TT></body></HTML>"
|
||||
user << browse(t1, "window=stack")
|
||||
onclose(user, "stack")
|
||||
return
|
||||
|
||||
/obj/item/stack/Topic(href, href_list)
|
||||
..()
|
||||
if ((usr.restrained() || usr.stat || usr.equipped() != src))
|
||||
return
|
||||
if (href_list["make"])
|
||||
if (src.amount < 1) del(src) //Never should happen
|
||||
|
||||
var/datum/stack_recipe/R = recipes[text2num(href_list["make"])]
|
||||
var/multiplier = text2num(href_list["multiplier"])
|
||||
if (!multiplier) multiplier = 1
|
||||
if (src.amount < R.req_amount*multiplier)
|
||||
if (R.req_amount*multiplier>1)
|
||||
usr << "\red You haven't got enough [src] to build \the [R.req_amount*multiplier] [R.title]\s!"
|
||||
else
|
||||
usr << "\red You haven't got enough [src] to build \the [R.title]!"
|
||||
return
|
||||
if (R.one_per_turf && (locate(R.result_type) in usr.loc))
|
||||
usr << "\red There is another [R.title] here!"
|
||||
return
|
||||
if (R.on_floor && !istype(usr.loc, /turf/simulated/floor))
|
||||
usr << "\red \The [R.title] must be constructed on the floor!"
|
||||
return
|
||||
if (R.time)
|
||||
usr << "\blue Building [R.title] ..."
|
||||
if (!do_after(usr, R.time))
|
||||
return
|
||||
if (src.amount < R.req_amount*multiplier)
|
||||
return
|
||||
var/atom/O = new R.result_type( usr.loc )
|
||||
O.dir = usr.dir
|
||||
if (R.max_res_amount>1)
|
||||
var/obj/item/stack/new_item = O
|
||||
new_item.amount = R.res_amount*multiplier
|
||||
//new_item.add_to_stacks(usr)
|
||||
src.amount-=R.req_amount*multiplier
|
||||
if (src.amount<=0)
|
||||
var/oldsrc = src
|
||||
src = null //dont kill proc after del()
|
||||
usr.before_take_item(oldsrc)
|
||||
del(oldsrc)
|
||||
if (istype(O,/obj/item))
|
||||
usr.put_in_hand(O)
|
||||
O.add_fingerprint(usr)
|
||||
if (src && usr.machine==src) //do not reopen closed window
|
||||
spawn( 0 )
|
||||
src.interact(usr)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/stack/Del()
|
||||
if (src && usr && usr.machine==src)
|
||||
usr << browse(null, "window=stack")
|
||||
..()
|
||||
|
||||
+218
-218
@@ -1,219 +1,219 @@
|
||||
//Banhammer deserves to be the first thing here
|
||||
|
||||
/obj/item/weapon/banhammer/attack(mob/M as mob, mob/user as mob)
|
||||
M << "<font color='red'><b> You have been banned FOR NO REISIN by [user]<b></font>"
|
||||
user << "<font color='red'> You have <b>BANNED</b> [M]</font>"
|
||||
|
||||
/obj/effect/mine/proc/triggerrad(obj)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
obj:radiation += 50
|
||||
randmutb(obj)
|
||||
domutcheck(obj,null)
|
||||
spawn(0)
|
||||
del(src)
|
||||
|
||||
/obj/effect/mine/proc/triggerstun(obj)
|
||||
if(ismob(obj))
|
||||
var/mob/M = obj
|
||||
M.Stun(30)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
spawn(0)
|
||||
del(src)
|
||||
|
||||
/obj/effect/mine/proc/triggern2o(obj)
|
||||
//example: n2o triggerproc
|
||||
//note: im lazy
|
||||
|
||||
for (var/turf/simulated/floor/target in range(1,src))
|
||||
if(!target.blocks_air)
|
||||
if(target.parent)
|
||||
target.parent.suspend_group_processing()
|
||||
|
||||
var/datum/gas_mixture/payload = new
|
||||
var/datum/gas/sleeping_agent/trace_gas = new
|
||||
|
||||
trace_gas.moles = 30
|
||||
payload += trace_gas
|
||||
|
||||
target.air.merge(payload)
|
||||
|
||||
spawn(0)
|
||||
del(src)
|
||||
|
||||
/obj/effect/mine/proc/triggerplasma(obj)
|
||||
for (var/turf/simulated/floor/target in range(1,src))
|
||||
if(!target.blocks_air)
|
||||
if(target.parent)
|
||||
target.parent.suspend_group_processing()
|
||||
|
||||
var/datum/gas_mixture/payload = new
|
||||
|
||||
payload.toxins = 30
|
||||
|
||||
target.air.merge(payload)
|
||||
|
||||
target.hotspot_expose(1000, CELL_VOLUME)
|
||||
|
||||
spawn(0)
|
||||
del(src)
|
||||
|
||||
/obj/effect/mine/proc/triggerkick(obj)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
del(obj:client)
|
||||
spawn(0)
|
||||
del(src)
|
||||
|
||||
/obj/effect/mine/proc/explode(obj)
|
||||
explosion(loc, 0, 1, 2, 3)
|
||||
spawn(0)
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/effect/mine/HasEntered(AM as mob|obj)
|
||||
Bumped(AM)
|
||||
|
||||
/obj/effect/mine/Bumped(mob/M as mob|obj)
|
||||
|
||||
if(triggered) return
|
||||
|
||||
if(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey))
|
||||
for(var/mob/O in viewers(world.view, src.loc))
|
||||
O << text("<font color='red'>[M] triggered the \icon[] [src]</font>", src)
|
||||
triggered = 1
|
||||
call(src,triggerproc)(M)
|
||||
|
||||
/obj/effect/mine/New()
|
||||
icon_state = "uglyminearmed"
|
||||
|
||||
/atom/proc/ex_act()
|
||||
return
|
||||
|
||||
/atom/proc/blob_act()
|
||||
return
|
||||
|
||||
// bullet_act called when anything is hit buy a projectile (bullet, tazer shot, laser, etc.)
|
||||
// flag is projectile type, can be:
|
||||
//PROJECTILE_TASER = 1 taser gun
|
||||
//PROJECTILE_LASER = 2 laser gun
|
||||
//PROJECTILE_BULLET = 3 traitor pistol
|
||||
//PROJECTILE_PULSE = 4 pulse rifle
|
||||
//PROJECTILE_BOLT = 5 crossbow
|
||||
//PROJECTILE_WEAKBULLET = 6 detective's revolver
|
||||
|
||||
/turf/Entered(atom/A as mob|obj)
|
||||
..()
|
||||
if ((A && A.density && !( istype(A, /obj/effect/beam) )))
|
||||
for(var/obj/effect/beam/i_beam/I in src)
|
||||
spawn( 0 )
|
||||
if (I)
|
||||
I.hit()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/weapon/mousetrap/examine()
|
||||
set src in oview(12)
|
||||
..()
|
||||
if(armed)
|
||||
usr << "\red It looks like it's armed."
|
||||
|
||||
/obj/item/weapon/mousetrap/proc/triggered(mob/target as mob, var/type = "feet")
|
||||
if(!armed)
|
||||
return
|
||||
var/datum/organ/external/affecting = null
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
switch(type)
|
||||
if("feet")
|
||||
if(!H.shoes)
|
||||
affecting = H.get_organ(pick("l_leg", "r_leg"))
|
||||
H.Weaken(3)
|
||||
if("l_hand", "r_hand")
|
||||
if(!H.gloves)
|
||||
affecting = H.get_organ(type)
|
||||
H.Stun(3)
|
||||
if(affecting)
|
||||
affecting.take_damage(1, 0)
|
||||
H.UpdateDamageIcon()
|
||||
H.updatehealth()
|
||||
playsound(target.loc, 'snap.ogg', 50, 1)
|
||||
icon_state = "mousetrap"
|
||||
armed = 0
|
||||
/*
|
||||
else if (ismouse(target))
|
||||
target.adjustBruteLoss(100)
|
||||
*/
|
||||
|
||||
/obj/item/weapon/mousetrap/attack_self(mob/user as mob)
|
||||
if(!armed)
|
||||
icon_state = "mousetraparmed"
|
||||
user << "\blue You arm the mousetrap."
|
||||
else
|
||||
icon_state = "mousetrap"
|
||||
if((user.getBrainLoss() >= 60 || user.mutations & CLUMSY) && prob(50))
|
||||
var/which_hand = "l_hand"
|
||||
if(!user.hand)
|
||||
which_hand = "r_hand"
|
||||
src.triggered(user, which_hand)
|
||||
user << "\red <B>You accidentally trigger the mousetrap!</B>"
|
||||
for(var/mob/O in viewers(user, null))
|
||||
if(O == user)
|
||||
continue
|
||||
O.show_message(text("\red <B>[user] accidentally sets off the mousetrap, breaking their fingers.</B>"), 1)
|
||||
return
|
||||
user << "\blue You disarm the mousetrap."
|
||||
armed = !armed
|
||||
playsound(user.loc, 'handcuffs.ogg', 30, 1, -3)
|
||||
|
||||
/obj/item/weapon/mousetrap/attack_hand(mob/user as mob)
|
||||
if(armed)
|
||||
if((user.getBrainLoss() >= 60 || user.mutations & CLUMSY) && prob(50))
|
||||
var/which_hand = "l_hand"
|
||||
if(!user.hand)
|
||||
which_hand = "r_hand"
|
||||
src.triggered(user, which_hand)
|
||||
user << "\red <B>You accidentally trigger the mousetrap!</B>"
|
||||
for(var/mob/O in viewers(user, null))
|
||||
if(O == user)
|
||||
continue
|
||||
O.show_message(text("\red <B>[user] accidentally sets off the mousetrap, breaking their fingers.</B>"), 1)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/mousetrap/HasEntered(AM as mob|obj)
|
||||
if((ishuman(AM)) && (armed))
|
||||
var/mob/living/carbon/H = AM
|
||||
if(H.m_intent == "run")
|
||||
src.triggered(H)
|
||||
H << "\red <B>You accidentally step on the mousetrap!</B>"
|
||||
for(var/mob/O in viewers(H, null))
|
||||
if(O == H)
|
||||
continue
|
||||
O.show_message(text("\red <B>[H] accidentally steps on the mousetrap.</B>"), 1)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/mousetrap/hitby(A as mob|obj)
|
||||
if(!armed)
|
||||
return ..()
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>The mousetrap is triggered by [A].</B>"), 1)
|
||||
src.triggered(null)
|
||||
|
||||
/obj/item/weapon/fireaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
|
||||
..()
|
||||
if(A && wielded && (istype(A,/obj/structure/window) || istype(A,/obj/structure/grille))) //destroys windows and grilles in one hit
|
||||
if(istype(A,/obj/structure/window)) //should just make a window.Break() proc but couldn't bother with it
|
||||
var/obj/structure/window/W = A
|
||||
|
||||
new /obj/item/weapon/shard( W.loc )
|
||||
if(W.reinf) new /obj/item/stack/rods( W.loc)
|
||||
|
||||
if (W.dir == SOUTHWEST)
|
||||
new /obj/item/weapon/shard( W.loc )
|
||||
if(W.reinf) new /obj/item/stack/rods( W.loc)
|
||||
//Banhammer deserves to be the first thing here
|
||||
|
||||
/obj/item/weapon/banhammer/attack(mob/M as mob, mob/user as mob)
|
||||
M << "<font color='red'><b> You have been banned FOR NO REISIN by [user]<b></font>"
|
||||
user << "<font color='red'> You have <b>BANNED</b> [M]</font>"
|
||||
|
||||
/obj/effect/mine/proc/triggerrad(obj)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
obj:radiation += 50
|
||||
randmutb(obj)
|
||||
domutcheck(obj,null)
|
||||
spawn(0)
|
||||
del(src)
|
||||
|
||||
/obj/effect/mine/proc/triggerstun(obj)
|
||||
if(ismob(obj))
|
||||
var/mob/M = obj
|
||||
M.Stun(30)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
spawn(0)
|
||||
del(src)
|
||||
|
||||
/obj/effect/mine/proc/triggern2o(obj)
|
||||
//example: n2o triggerproc
|
||||
//note: im lazy
|
||||
|
||||
for (var/turf/simulated/floor/target in range(1,src))
|
||||
if(!target.blocks_air)
|
||||
if(target.parent)
|
||||
target.parent.suspend_group_processing()
|
||||
|
||||
var/datum/gas_mixture/payload = new
|
||||
var/datum/gas/sleeping_agent/trace_gas = new
|
||||
|
||||
trace_gas.moles = 30
|
||||
payload += trace_gas
|
||||
|
||||
target.air.merge(payload)
|
||||
|
||||
spawn(0)
|
||||
del(src)
|
||||
|
||||
/obj/effect/mine/proc/triggerplasma(obj)
|
||||
for (var/turf/simulated/floor/target in range(1,src))
|
||||
if(!target.blocks_air)
|
||||
if(target.parent)
|
||||
target.parent.suspend_group_processing()
|
||||
|
||||
var/datum/gas_mixture/payload = new
|
||||
|
||||
payload.toxins = 30
|
||||
|
||||
target.air.merge(payload)
|
||||
|
||||
target.hotspot_expose(1000, CELL_VOLUME)
|
||||
|
||||
spawn(0)
|
||||
del(src)
|
||||
|
||||
/obj/effect/mine/proc/triggerkick(obj)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
del(obj:client)
|
||||
spawn(0)
|
||||
del(src)
|
||||
|
||||
/obj/effect/mine/proc/explode(obj)
|
||||
explosion(loc, 0, 1, 2, 3)
|
||||
spawn(0)
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/effect/mine/HasEntered(AM as mob|obj)
|
||||
Bumped(AM)
|
||||
|
||||
/obj/effect/mine/Bumped(mob/M as mob|obj)
|
||||
|
||||
if(triggered) return
|
||||
|
||||
if(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey))
|
||||
for(var/mob/O in viewers(world.view, src.loc))
|
||||
O << text("<font color='red'>[M] triggered the \icon[] [src]</font>", src)
|
||||
triggered = 1
|
||||
call(src,triggerproc)(M)
|
||||
|
||||
/obj/effect/mine/New()
|
||||
icon_state = "uglyminearmed"
|
||||
|
||||
/atom/proc/ex_act()
|
||||
return
|
||||
|
||||
/atom/proc/blob_act()
|
||||
return
|
||||
|
||||
// bullet_act called when anything is hit buy a projectile (bullet, tazer shot, laser, etc.)
|
||||
// flag is projectile type, can be:
|
||||
//PROJECTILE_TASER = 1 taser gun
|
||||
//PROJECTILE_LASER = 2 laser gun
|
||||
//PROJECTILE_BULLET = 3 traitor pistol
|
||||
//PROJECTILE_PULSE = 4 pulse rifle
|
||||
//PROJECTILE_BOLT = 5 crossbow
|
||||
//PROJECTILE_WEAKBULLET = 6 detective's revolver
|
||||
|
||||
/turf/Entered(atom/A as mob|obj)
|
||||
..()
|
||||
if ((A && A.density && !( istype(A, /obj/effect/beam) )))
|
||||
for(var/obj/effect/beam/i_beam/I in src)
|
||||
spawn( 0 )
|
||||
if (I)
|
||||
I.hit()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/weapon/mousetrap/examine()
|
||||
set src in oview(12)
|
||||
..()
|
||||
if(armed)
|
||||
usr << "\red It looks like it's armed."
|
||||
|
||||
/obj/item/weapon/mousetrap/proc/triggered(mob/target as mob, var/type = "feet")
|
||||
if(!armed)
|
||||
return
|
||||
var/datum/organ/external/affecting = null
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
switch(type)
|
||||
if("feet")
|
||||
if(!H.shoes)
|
||||
affecting = H.get_organ(pick("l_leg", "r_leg"))
|
||||
H.Weaken(3)
|
||||
if("l_hand", "r_hand")
|
||||
if(!H.gloves)
|
||||
affecting = H.get_organ(type)
|
||||
H.Stun(3)
|
||||
if(affecting)
|
||||
affecting.take_damage(1, 0)
|
||||
H.UpdateDamageIcon()
|
||||
H.updatehealth()
|
||||
playsound(target.loc, 'snap.ogg', 50, 1)
|
||||
icon_state = "mousetrap"
|
||||
armed = 0
|
||||
/*
|
||||
else if (ismouse(target))
|
||||
target.adjustBruteLoss(100)
|
||||
*/
|
||||
|
||||
/obj/item/weapon/mousetrap/attack_self(mob/user as mob)
|
||||
if(!armed)
|
||||
icon_state = "mousetraparmed"
|
||||
user << "\blue You arm the mousetrap."
|
||||
else
|
||||
icon_state = "mousetrap"
|
||||
if((user.getBrainLoss() >= 60 || user.mutations & CLUMSY) && prob(50))
|
||||
var/which_hand = "l_hand"
|
||||
if(!user.hand)
|
||||
which_hand = "r_hand"
|
||||
src.triggered(user, which_hand)
|
||||
user << "\red <B>You accidentally trigger the mousetrap!</B>"
|
||||
for(var/mob/O in viewers(user, null))
|
||||
if(O == user)
|
||||
continue
|
||||
O.show_message(text("\red <B>[user] accidentally sets off the mousetrap, breaking their fingers.</B>"), 1)
|
||||
return
|
||||
user << "\blue You disarm the mousetrap."
|
||||
armed = !armed
|
||||
playsound(user.loc, 'handcuffs.ogg', 30, 1, -3)
|
||||
|
||||
/obj/item/weapon/mousetrap/attack_hand(mob/user as mob)
|
||||
if(armed)
|
||||
if((user.getBrainLoss() >= 60 || user.mutations & CLUMSY) && prob(50))
|
||||
var/which_hand = "l_hand"
|
||||
if(!user.hand)
|
||||
which_hand = "r_hand"
|
||||
src.triggered(user, which_hand)
|
||||
user << "\red <B>You accidentally trigger the mousetrap!</B>"
|
||||
for(var/mob/O in viewers(user, null))
|
||||
if(O == user)
|
||||
continue
|
||||
O.show_message(text("\red <B>[user] accidentally sets off the mousetrap, breaking their fingers.</B>"), 1)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/mousetrap/HasEntered(AM as mob|obj)
|
||||
if((ishuman(AM)) && (armed))
|
||||
var/mob/living/carbon/H = AM
|
||||
if(H.m_intent == "run")
|
||||
src.triggered(H)
|
||||
H << "\red <B>You accidentally step on the mousetrap!</B>"
|
||||
for(var/mob/O in viewers(H, null))
|
||||
if(O == H)
|
||||
continue
|
||||
O.show_message(text("\red <B>[H] accidentally steps on the mousetrap.</B>"), 1)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/mousetrap/hitby(A as mob|obj)
|
||||
if(!armed)
|
||||
return ..()
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>The mousetrap is triggered by [A].</B>"), 1)
|
||||
src.triggered(null)
|
||||
|
||||
/obj/item/weapon/fireaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
|
||||
..()
|
||||
if(A && wielded && (istype(A,/obj/structure/window) || istype(A,/obj/structure/grille))) //destroys windows and grilles in one hit
|
||||
if(istype(A,/obj/structure/window)) //should just make a window.Break() proc but couldn't bother with it
|
||||
var/obj/structure/window/W = A
|
||||
|
||||
new /obj/item/weapon/shard( W.loc )
|
||||
if(W.reinf) new /obj/item/stack/rods( W.loc)
|
||||
|
||||
if (W.dir == SOUTHWEST)
|
||||
new /obj/item/weapon/shard( W.loc )
|
||||
if(W.reinf) new /obj/item/stack/rods( W.loc)
|
||||
del(A)
|
||||
@@ -64,6 +64,9 @@ var/ordernum=0
|
||||
if (prob(5))
|
||||
del(src)
|
||||
|
||||
/obj/structure/plasticflaps/mining //A specific type for mining that doesn't allow airflow because of them damn crates
|
||||
var/blocks_air = 1
|
||||
|
||||
/area/supplyshuttle
|
||||
name = "Supply Shuttle"
|
||||
icon_state = "supply"
|
||||
|
||||
+1456
-1456
File diff suppressed because it is too large
Load Diff
@@ -480,6 +480,20 @@
|
||||
alert("The AI can't be monkeyized!", null, null, null, null, null)
|
||||
return
|
||||
|
||||
if (href_list["corgione"])
|
||||
if ((src.rank in list( "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" )))
|
||||
var/mob/M = locate(href_list["corgione"])
|
||||
if(!ismob(M))
|
||||
return
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/N = M
|
||||
log_admin("[key_name(usr)] attempting to corgize [key_name(M)]")
|
||||
message_admins("\blue [key_name_admin(usr)] attempting to corgize [key_name_admin(M)]", 1)
|
||||
N.corgize()
|
||||
if(istype(M, /mob/living/silicon))
|
||||
alert("The AI can't be corgized!", null, null, null, null, null)
|
||||
return
|
||||
|
||||
if (href_list["forcespeech"])
|
||||
if ((src.rank in list( "Trial Admin", "Badmin", "Game Admin", "Game Master" )))
|
||||
var/mob/M = locate(href_list["forcespeech"])
|
||||
@@ -1198,6 +1212,13 @@
|
||||
spawn(0)
|
||||
H.monkeyize()
|
||||
ok = 1
|
||||
if("corgi")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","M")
|
||||
for(var/mob/living/carbon/human/H in world)
|
||||
spawn(0)
|
||||
H.corgize()
|
||||
ok = 1
|
||||
if("power")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","P")
|
||||
@@ -1863,6 +1884,10 @@
|
||||
foo += text("<A HREF='?src=\ref[src];monkeyone=\ref[M]'>Monkeyize</A> | ")
|
||||
else
|
||||
foo += text("<B>Monkeyized</B> | ")
|
||||
if(!iscorgi(M))
|
||||
foo += text("<A HREF='?src=\ref[src];corgione=\ref[M]'>Corgize</A> | ")
|
||||
else
|
||||
foo += text("<B>Corgized</B> | ")
|
||||
if(isAI(M))
|
||||
foo += text("<B>Is an AI</B> | ")
|
||||
else if(ishuman(M))
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
verbs += /client/proc/jumptokey
|
||||
verbs += /client/proc/jumptomob
|
||||
verbs += /client/proc/jumptoturf
|
||||
verbs += /client/proc/jumptocoord
|
||||
|
||||
verbs += /client/proc/cmd_admin_add_freeform_ai_law
|
||||
verbs += /client/proc/cmd_admin_rejuvenate
|
||||
@@ -199,6 +200,7 @@
|
||||
verbs += /client/proc/togglebuildmodeself
|
||||
verbs += /client/proc/hide_most_verbs
|
||||
verbs += /client/proc/tension_report
|
||||
verbs += /client/proc/jumptocoord
|
||||
|
||||
if (holder.level >= 3)//Trial Admin********************************************************************
|
||||
verbs += /obj/admins/proc/toggleaban //abandon mob
|
||||
|
||||
@@ -49,6 +49,25 @@
|
||||
else
|
||||
alert("Admin jumping disabled")
|
||||
|
||||
/client/proc/jumptocoord(tx as num, ty as num, tz as num)
|
||||
set category = "Admin"
|
||||
set name = "Jump to Coordinate"
|
||||
|
||||
if (!authenticated || !holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
|
||||
if (config.allow_admin_jump)
|
||||
if(src.mob)
|
||||
var/mob/A = src.mob
|
||||
A.x = tx
|
||||
A.y = ty
|
||||
A.z = tz
|
||||
message_admins("[key_name_admin(usr)] jumped to coordinates [tx], [ty], [tz]")
|
||||
|
||||
else
|
||||
alert("Admin jumping disabled")
|
||||
|
||||
/client/proc/jumptokey()
|
||||
set category = "Admin"
|
||||
set name = "Jump to Key"
|
||||
|
||||
+1753
-1753
File diff suppressed because it is too large
Load Diff
+1088
-1088
File diff suppressed because it is too large
Load Diff
@@ -1,24 +1,24 @@
|
||||
/**********************Ore to material recipes datum**************************/
|
||||
|
||||
var/list/AVAILABLE_ORES = typesof(/obj/item/weapon/ore)
|
||||
|
||||
/datum/material_recipe
|
||||
var/name
|
||||
var/list/obj/item/weapon/ore/recipe
|
||||
var/obj/prod_type //produced material/object type
|
||||
|
||||
New(var/param_name, var/param_recipe, var/param_prod_type)
|
||||
name = param_name
|
||||
recipe = param_recipe
|
||||
prod_type = param_prod_type
|
||||
|
||||
var/list/datum/material_recipe/MATERIAL_RECIPES = list(
|
||||
new/datum/material_recipe("Metal",list(/obj/item/weapon/ore/iron),/obj/item/stack/sheet/metal),
|
||||
new/datum/material_recipe("Glass",list(/obj/item/weapon/ore/glass),/obj/item/stack/sheet/glass),
|
||||
new/datum/material_recipe("Gold",list(/obj/item/weapon/ore/gold),/obj/item/stack/sheet/gold),
|
||||
new/datum/material_recipe("Silver",list(/obj/item/weapon/ore/silver),/obj/item/stack/sheet/silver),
|
||||
new/datum/material_recipe("Diamond",list(/obj/item/weapon/ore/diamond),/obj/item/stack/sheet/diamond),
|
||||
new/datum/material_recipe("Plasma",list(/obj/item/weapon/ore/plasma),/obj/item/stack/sheet/plasma),
|
||||
new/datum/material_recipe("Bananium",list(/obj/item/weapon/ore/clown),/obj/item/stack/sheet/clown),
|
||||
new/datum/material_recipe("Adamantine",list(/obj/item/weapon/ore/adamantine),/obj/item/stack/sheet/adamantine)
|
||||
/**********************Ore to material recipes datum**************************/
|
||||
|
||||
var/list/AVAILABLE_ORES = typesof(/obj/item/weapon/ore)
|
||||
|
||||
/datum/material_recipe
|
||||
var/name
|
||||
var/list/obj/item/weapon/ore/recipe
|
||||
var/obj/prod_type //produced material/object type
|
||||
|
||||
New(var/param_name, var/param_recipe, var/param_prod_type)
|
||||
name = param_name
|
||||
recipe = param_recipe
|
||||
prod_type = param_prod_type
|
||||
|
||||
var/list/datum/material_recipe/MATERIAL_RECIPES = list(
|
||||
new/datum/material_recipe("Metal",list(/obj/item/weapon/ore/iron),/obj/item/stack/sheet/metal),
|
||||
new/datum/material_recipe("Glass",list(/obj/item/weapon/ore/glass),/obj/item/stack/sheet/glass),
|
||||
new/datum/material_recipe("Gold",list(/obj/item/weapon/ore/gold),/obj/item/stack/sheet/gold),
|
||||
new/datum/material_recipe("Silver",list(/obj/item/weapon/ore/silver),/obj/item/stack/sheet/silver),
|
||||
new/datum/material_recipe("Diamond",list(/obj/item/weapon/ore/diamond),/obj/item/stack/sheet/diamond),
|
||||
new/datum/material_recipe("Plasma",list(/obj/item/weapon/ore/plasma),/obj/item/stack/sheet/plasma),
|
||||
new/datum/material_recipe("Bananium",list(/obj/item/weapon/ore/clown),/obj/item/stack/sheet/clown),
|
||||
new/datum/material_recipe("Adamantine",list(/obj/item/weapon/ore/adamantine),/obj/item/stack/sheet/adamantine)
|
||||
)
|
||||
@@ -1,19 +1,19 @@
|
||||
/**********************Input and output plates**************************/
|
||||
|
||||
/obj/machinery/mineral/input
|
||||
icon = 'screen1.dmi'
|
||||
icon_state = "x2"
|
||||
name = "Input area"
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
New()
|
||||
icon_state = "blank"
|
||||
|
||||
/obj/machinery/mineral/output
|
||||
icon = 'screen1.dmi'
|
||||
icon_state = "x"
|
||||
name = "Output area"
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
New()
|
||||
/**********************Input and output plates**************************/
|
||||
|
||||
/obj/machinery/mineral/input
|
||||
icon = 'screen1.dmi'
|
||||
icon_state = "x2"
|
||||
name = "Input area"
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
New()
|
||||
icon_state = "blank"
|
||||
|
||||
/obj/machinery/mineral/output
|
||||
icon = 'screen1.dmi'
|
||||
icon_state = "x"
|
||||
name = "Output area"
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
New()
|
||||
icon_state = "blank"
|
||||
@@ -1,432 +1,432 @@
|
||||
/**********************Mineral processing unit console**************************/
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console
|
||||
name = "Produciton machine console"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/mineral/processing_unit/machine = null
|
||||
var/machinedir = EAST
|
||||
|
||||
/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
|
||||
else
|
||||
del(src)
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/attack_hand(user as mob)
|
||||
|
||||
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>")
|
||||
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
|
||||
|
||||
//adamantine
|
||||
if(machine.ore_adamantine)
|
||||
if (machine.selected_adamantine==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_adamantine=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_adamantine=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Adamantine: [machine.ore_adamantine]<br>")
|
||||
else
|
||||
machine.selected_adamantine = 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")
|
||||
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.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["sel_adamantine"])
|
||||
if (href_list["sel_adamantine"] == "yes")
|
||||
machine.selected_adamantine = 1
|
||||
else
|
||||
machine.selected_adamantine =0
|
||||
if(href_list["set_on"])
|
||||
if (href_list["set_on"] == "on")
|
||||
machine.on = 1
|
||||
else
|
||||
machine.on = 0
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/**********************Mineral processing unit**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit
|
||||
name = "Furnace"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "furnace"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
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/selected_adamantine = 0
|
||||
var/on = 0 //0 = off, 1 =... oh you know!
|
||||
|
||||
/obj/machinery/mineral/processing_unit/New()
|
||||
..()
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_glass > 0)
|
||||
ore_glass--;
|
||||
new /obj/item/stack/sheet/glass(output.loc)
|
||||
feedback_inc("mining_glass_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_glass > 0 && ore_iron > 0)
|
||||
ore_glass--;
|
||||
ore_iron--;
|
||||
new /obj/item/stack/sheet/rglass(output.loc)
|
||||
feedback_inc("mining_rglass_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_gold > 0)
|
||||
ore_gold--;
|
||||
new /obj/item/stack/sheet/gold(output.loc)
|
||||
feedback_inc("mining_gold_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_silver > 0)
|
||||
ore_silver--;
|
||||
new /obj/item/stack/sheet/silver(output.loc)
|
||||
feedback_inc("mining_silver_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_diamond > 0)
|
||||
ore_diamond--;
|
||||
new /obj/item/stack/sheet/diamond(output.loc)
|
||||
feedback_inc("mining_diamond_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_plasma > 0)
|
||||
ore_plasma--;
|
||||
new /obj/item/stack/sheet/plasma(output.loc)
|
||||
feedback_inc("mining_plasma_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_uranium > 0)
|
||||
ore_uranium--;
|
||||
new /obj/item/stack/sheet/uranium(output.loc)
|
||||
feedback_inc("mining_uranium_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_iron > 0)
|
||||
ore_iron--;
|
||||
new /obj/item/stack/sheet/metal(output.loc)
|
||||
feedback_inc("mining_iron_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_iron > 0 && ore_plasma > 0)
|
||||
ore_iron--;
|
||||
ore_plasma--;
|
||||
new /obj/item/stack/sheet/plasteel(output.loc)
|
||||
feedback_inc("mining_steel_produced",1) //should be plasteel, but that'd break Erro's stat logging -- Urist
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_clown > 0)
|
||||
ore_clown--;
|
||||
new /obj/item/stack/sheet/clown(output.loc)
|
||||
feedback_inc("mining_clown_produced",1)
|
||||
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 == 0 && selected_adamantine == 1)
|
||||
if (ore_adamantine > 0)
|
||||
ore_adamantine--;
|
||||
new /obj/item/stack/sheet/adamantine(output.loc)
|
||||
feedback_inc("mining_adamantine_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
|
||||
//if a non valid combination is selected
|
||||
|
||||
var/b = 1 //this part checks if all required ores are available
|
||||
|
||||
if (!(selected_gold || selected_silver ||selected_diamond || selected_uranium | selected_plasma || selected_iron || selected_iron))
|
||||
b = 0
|
||||
|
||||
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 (selected_adamantine == 1)
|
||||
if (ore_adamantine <= 0)
|
||||
b = 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--
|
||||
if (selected_adamantine == 1)
|
||||
ore_adamantine--
|
||||
new /obj/item/weapon/ore/slag(output.loc)
|
||||
on = 0
|
||||
else
|
||||
on = 0
|
||||
break
|
||||
break
|
||||
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++;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/glass))
|
||||
ore_glass++;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/diamond))
|
||||
ore_diamond++;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/plasma))
|
||||
ore_plasma++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/gold))
|
||||
ore_gold++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/silver))
|
||||
ore_silver++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/uranium))
|
||||
ore_uranium++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/clown))
|
||||
ore_clown++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/adamantine))
|
||||
ore_adamantine++
|
||||
del(O)
|
||||
continue
|
||||
O.loc = src.output.loc
|
||||
else
|
||||
break
|
||||
/**********************Mineral processing unit console**************************/
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console
|
||||
name = "Produciton machine console"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/mineral/processing_unit/machine = null
|
||||
var/machinedir = EAST
|
||||
|
||||
/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
|
||||
else
|
||||
del(src)
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/attack_hand(user as mob)
|
||||
|
||||
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>")
|
||||
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
|
||||
|
||||
//adamantine
|
||||
if(machine.ore_adamantine)
|
||||
if (machine.selected_adamantine==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_adamantine=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_adamantine=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Adamantine: [machine.ore_adamantine]<br>")
|
||||
else
|
||||
machine.selected_adamantine = 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")
|
||||
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.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["sel_adamantine"])
|
||||
if (href_list["sel_adamantine"] == "yes")
|
||||
machine.selected_adamantine = 1
|
||||
else
|
||||
machine.selected_adamantine =0
|
||||
if(href_list["set_on"])
|
||||
if (href_list["set_on"] == "on")
|
||||
machine.on = 1
|
||||
else
|
||||
machine.on = 0
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/**********************Mineral processing unit**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit
|
||||
name = "Furnace"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "furnace"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
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/selected_adamantine = 0
|
||||
var/on = 0 //0 = off, 1 =... oh you know!
|
||||
|
||||
/obj/machinery/mineral/processing_unit/New()
|
||||
..()
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_glass > 0)
|
||||
ore_glass--;
|
||||
new /obj/item/stack/sheet/glass(output.loc)
|
||||
feedback_inc("mining_glass_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_glass > 0 && ore_iron > 0)
|
||||
ore_glass--;
|
||||
ore_iron--;
|
||||
new /obj/item/stack/sheet/rglass(output.loc)
|
||||
feedback_inc("mining_rglass_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_gold > 0)
|
||||
ore_gold--;
|
||||
new /obj/item/stack/sheet/gold(output.loc)
|
||||
feedback_inc("mining_gold_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_silver > 0)
|
||||
ore_silver--;
|
||||
new /obj/item/stack/sheet/silver(output.loc)
|
||||
feedback_inc("mining_silver_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_diamond > 0)
|
||||
ore_diamond--;
|
||||
new /obj/item/stack/sheet/diamond(output.loc)
|
||||
feedback_inc("mining_diamond_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_plasma > 0)
|
||||
ore_plasma--;
|
||||
new /obj/item/stack/sheet/plasma(output.loc)
|
||||
feedback_inc("mining_plasma_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_uranium > 0)
|
||||
ore_uranium--;
|
||||
new /obj/item/stack/sheet/uranium(output.loc)
|
||||
feedback_inc("mining_uranium_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_iron > 0)
|
||||
ore_iron--;
|
||||
new /obj/item/stack/sheet/metal(output.loc)
|
||||
feedback_inc("mining_iron_produced",1)
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_iron > 0 && ore_plasma > 0)
|
||||
ore_iron--;
|
||||
ore_plasma--;
|
||||
new /obj/item/stack/sheet/plasteel(output.loc)
|
||||
feedback_inc("mining_steel_produced",1) //should be plasteel, but that'd break Erro's stat logging -- Urist
|
||||
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 && selected_adamantine == 0)
|
||||
if (ore_clown > 0)
|
||||
ore_clown--;
|
||||
new /obj/item/stack/sheet/clown(output.loc)
|
||||
feedback_inc("mining_clown_produced",1)
|
||||
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 == 0 && selected_adamantine == 1)
|
||||
if (ore_adamantine > 0)
|
||||
ore_adamantine--;
|
||||
new /obj/item/stack/sheet/adamantine(output.loc)
|
||||
feedback_inc("mining_adamantine_produced",1)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
|
||||
//if a non valid combination is selected
|
||||
|
||||
var/b = 1 //this part checks if all required ores are available
|
||||
|
||||
if (!(selected_gold || selected_silver ||selected_diamond || selected_uranium | selected_plasma || selected_iron || selected_iron))
|
||||
b = 0
|
||||
|
||||
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 (selected_adamantine == 1)
|
||||
if (ore_adamantine <= 0)
|
||||
b = 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--
|
||||
if (selected_adamantine == 1)
|
||||
ore_adamantine--
|
||||
new /obj/item/weapon/ore/slag(output.loc)
|
||||
on = 0
|
||||
else
|
||||
on = 0
|
||||
break
|
||||
break
|
||||
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++;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/glass))
|
||||
ore_glass++;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/diamond))
|
||||
ore_diamond++;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/plasma))
|
||||
ore_plasma++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/gold))
|
||||
ore_gold++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/silver))
|
||||
ore_silver++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/uranium))
|
||||
ore_uranium++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/clown))
|
||||
ore_clown++
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/adamantine))
|
||||
ore_adamantine++
|
||||
del(O)
|
||||
continue
|
||||
O.loc = src.output.loc
|
||||
else
|
||||
break
|
||||
return
|
||||
@@ -1,290 +1,290 @@
|
||||
/**********************Mineral stacking unit console**************************/
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console
|
||||
name = "Stacking machine console"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/mineral/stacking_machine/machine = null
|
||||
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
|
||||
else
|
||||
del(src)
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/attack_hand(user as mob)
|
||||
|
||||
var/dat
|
||||
|
||||
dat += text("<b>Stacking unit console</b><br><br>")
|
||||
|
||||
if(machine.ore_iron)
|
||||
dat += text("Iron: [machine.ore_iron] <A href='?src=\ref[src];release=iron'>Release</A><br>")
|
||||
if(machine.ore_plasteel)
|
||||
dat += text("Plasteel: [machine.ore_plasteel] <A href='?src=\ref[src];release=plasteel'>Release</A><br>")
|
||||
if(machine.ore_glass)
|
||||
dat += text("Glass: [machine.ore_glass] <A href='?src=\ref[src];release=glass'>Release</A><br>")
|
||||
if(machine.ore_rglass)
|
||||
dat += text("Reinforced Glass: [machine.ore_rglass] <A href='?src=\ref[src];release=rglass'>Release</A><br>")
|
||||
if(machine.ore_plasma)
|
||||
dat += text("Plasma: [machine.ore_plasma] <A href='?src=\ref[src];release=plasma'>Release</A><br>")
|
||||
if(machine.ore_gold)
|
||||
dat += text("Gold: [machine.ore_gold] <A href='?src=\ref[src];release=gold'>Release</A><br>")
|
||||
if(machine.ore_silver)
|
||||
dat += text("Silver: [machine.ore_silver] <A href='?src=\ref[src];release=silver'>Release</A><br>")
|
||||
if(machine.ore_uranium)
|
||||
dat += text("Uranium: [machine.ore_uranium] <A href='?src=\ref[src];release=uranium'>Release</A><br>")
|
||||
if(machine.ore_diamond)
|
||||
dat += text("Diamond: [machine.ore_diamond] <A href='?src=\ref[src];release=diamond'>Release</A><br>")
|
||||
if(machine.ore_clown)
|
||||
dat += text("Bananium: [machine.ore_clown] <A href='?src=\ref[src];release=clown'>Release</A><br><br>")
|
||||
if(machine.ore_adamantine)
|
||||
dat += text ("Adamantine: [machine.ore_adamantine] <A href='?src=\ref[src];release=adamantine'>Release</A><br><br>")
|
||||
|
||||
dat += text("Stacking: [machine.stack_amt]<br><br>")
|
||||
|
||||
user << browse("[dat]", "window=console_stacking_machine")
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["release"])
|
||||
switch(href_list["release"])
|
||||
if ("plasma")
|
||||
if (machine.ore_plasma > 0)
|
||||
var/obj/item/stack/sheet/plasma/G = new /obj/item/stack/sheet/plasma
|
||||
G.amount = machine.ore_plasma
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_plasma = 0
|
||||
if ("uranium")
|
||||
if (machine.ore_uranium > 0)
|
||||
var/obj/item/stack/sheet/uranium/G = new /obj/item/stack/sheet/uranium
|
||||
G.amount = machine.ore_uranium
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_uranium = 0
|
||||
if ("glass")
|
||||
if (machine.ore_glass > 0)
|
||||
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass
|
||||
G.amount = machine.ore_glass
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_glass = 0
|
||||
if ("rglass")
|
||||
if (machine.ore_rglass > 0)
|
||||
var/obj/item/stack/sheet/rglass/G = new /obj/item/stack/sheet/rglass
|
||||
G.amount = machine.ore_rglass
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_rglass = 0
|
||||
if ("gold")
|
||||
if (machine.ore_gold > 0)
|
||||
var/obj/item/stack/sheet/gold/G = new /obj/item/stack/sheet/gold
|
||||
G.amount = machine.ore_gold
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_gold = 0
|
||||
if ("silver")
|
||||
if (machine.ore_silver > 0)
|
||||
var/obj/item/stack/sheet/silver/G = new /obj/item/stack/sheet/silver
|
||||
G.amount = machine.ore_silver
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_silver = 0
|
||||
if ("diamond")
|
||||
if (machine.ore_diamond > 0)
|
||||
var/obj/item/stack/sheet/diamond/G = new /obj/item/stack/sheet/diamond
|
||||
G.amount = machine.ore_diamond
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_diamond = 0
|
||||
if ("iron")
|
||||
if (machine.ore_iron > 0)
|
||||
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal
|
||||
G.amount = machine.ore_iron
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_iron = 0
|
||||
if ("plasteel")
|
||||
if (machine.ore_plasteel > 0)
|
||||
var/obj/item/stack/sheet/plasteel/G = new /obj/item/stack/sheet/plasteel
|
||||
G.amount = machine.ore_plasteel
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_plasteel = 0
|
||||
if ("clown")
|
||||
if (machine.ore_clown > 0)
|
||||
var/obj/item/stack/sheet/clown/G = new /obj/item/stack/sheet/clown
|
||||
G.amount = machine.ore_clown
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_clown = 0
|
||||
if ("adamantine")
|
||||
if (machine.ore_adamantine > 0)
|
||||
var/obj/item/stack/sheet/adamantine/G = new /obj/item/stack/sheet/adamantine
|
||||
G.amount = machine.ore_adamantine
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_adamantine = 0
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/**********************Mineral stacking unit**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/stacking_machine
|
||||
name = "Stacking machine"
|
||||
icon = 'mining_machines.dmi'
|
||||
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/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/ore_gold = 0;
|
||||
var/ore_silver = 0;
|
||||
var/ore_diamond = 0;
|
||||
var/ore_plasma = 0;
|
||||
var/ore_iron = 0;
|
||||
var/ore_uranium = 0;
|
||||
var/ore_clown = 0;
|
||||
var/ore_glass = 0;
|
||||
var/ore_rglass = 0;
|
||||
var/ore_plasteel = 0;
|
||||
var/ore_adamantine = 0;
|
||||
var/stack_amt = 50; //ammount to stack before releassing
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/New()
|
||||
..()
|
||||
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/stacking_machine/process()
|
||||
if (src.output && src.input)
|
||||
var/obj/item/O
|
||||
while (locate(/obj/item, input.loc))
|
||||
O = locate(/obj/item, input.loc)
|
||||
if (istype(O,/obj/item/stack/sheet/metal))
|
||||
ore_iron+= O:amount;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/diamond))
|
||||
ore_diamond+= O:amount;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/plasma))
|
||||
ore_plasma+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/gold))
|
||||
ore_gold+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/silver))
|
||||
ore_silver+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/clown))
|
||||
ore_clown+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/uranium))
|
||||
ore_uranium+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/glass))
|
||||
ore_glass+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/rglass))
|
||||
ore_rglass+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/plasteel))
|
||||
ore_plasteel+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/adamantine))
|
||||
ore_adamantine+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/slag))
|
||||
del(O)
|
||||
continue
|
||||
O.loc = src.output.loc
|
||||
if (ore_gold >= stack_amt)
|
||||
var/obj/item/stack/sheet/gold/G = new /obj/item/stack/sheet/gold
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_gold -= stack_amt
|
||||
return
|
||||
if (ore_silver >= stack_amt)
|
||||
var/obj/item/stack/sheet/silver/G = new /obj/item/stack/sheet/silver
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_silver -= stack_amt
|
||||
return
|
||||
if (ore_diamond >= stack_amt)
|
||||
var/obj/item/stack/sheet/diamond/G = new /obj/item/stack/sheet/diamond
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_diamond -= stack_amt
|
||||
return
|
||||
if (ore_plasma >= stack_amt)
|
||||
var/obj/item/stack/sheet/plasma/G = new /obj/item/stack/sheet/plasma
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_plasma -= stack_amt
|
||||
return
|
||||
if (ore_iron >= stack_amt)
|
||||
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_iron -= stack_amt
|
||||
return
|
||||
if (ore_clown >= stack_amt)
|
||||
var/obj/item/stack/sheet/clown/G = new /obj/item/stack/sheet/clown
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_clown -= stack_amt
|
||||
return
|
||||
if (ore_uranium >= stack_amt)
|
||||
var/obj/item/stack/sheet/uranium/G = new /obj/item/stack/sheet/uranium
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_uranium -= stack_amt
|
||||
return
|
||||
if (ore_glass >= stack_amt)
|
||||
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_glass -= stack_amt
|
||||
return
|
||||
if (ore_rglass >= stack_amt)
|
||||
var/obj/item/stack/sheet/rglass/G = new /obj/item/stack/sheet/rglass
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_rglass -= stack_amt
|
||||
return
|
||||
if (ore_plasteel >= stack_amt)
|
||||
var/obj/item/stack/sheet/plasteel/G = new /obj/item/stack/sheet/plasteel
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_plasteel -= stack_amt
|
||||
return
|
||||
if (ore_adamantine >= stack_amt)
|
||||
var/obj/item/stack/sheet/adamantine/G = new /obj/item/stack/sheet/adamantine
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_adamantine -= stack_amt
|
||||
return
|
||||
return
|
||||
/**********************Mineral stacking unit console**************************/
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console
|
||||
name = "Stacking machine console"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/mineral/stacking_machine/machine = null
|
||||
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
|
||||
else
|
||||
del(src)
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/attack_hand(user as mob)
|
||||
|
||||
var/dat
|
||||
|
||||
dat += text("<b>Stacking unit console</b><br><br>")
|
||||
|
||||
if(machine.ore_iron)
|
||||
dat += text("Iron: [machine.ore_iron] <A href='?src=\ref[src];release=iron'>Release</A><br>")
|
||||
if(machine.ore_plasteel)
|
||||
dat += text("Plasteel: [machine.ore_plasteel] <A href='?src=\ref[src];release=plasteel'>Release</A><br>")
|
||||
if(machine.ore_glass)
|
||||
dat += text("Glass: [machine.ore_glass] <A href='?src=\ref[src];release=glass'>Release</A><br>")
|
||||
if(machine.ore_rglass)
|
||||
dat += text("Reinforced Glass: [machine.ore_rglass] <A href='?src=\ref[src];release=rglass'>Release</A><br>")
|
||||
if(machine.ore_plasma)
|
||||
dat += text("Plasma: [machine.ore_plasma] <A href='?src=\ref[src];release=plasma'>Release</A><br>")
|
||||
if(machine.ore_gold)
|
||||
dat += text("Gold: [machine.ore_gold] <A href='?src=\ref[src];release=gold'>Release</A><br>")
|
||||
if(machine.ore_silver)
|
||||
dat += text("Silver: [machine.ore_silver] <A href='?src=\ref[src];release=silver'>Release</A><br>")
|
||||
if(machine.ore_uranium)
|
||||
dat += text("Uranium: [machine.ore_uranium] <A href='?src=\ref[src];release=uranium'>Release</A><br>")
|
||||
if(machine.ore_diamond)
|
||||
dat += text("Diamond: [machine.ore_diamond] <A href='?src=\ref[src];release=diamond'>Release</A><br>")
|
||||
if(machine.ore_clown)
|
||||
dat += text("Bananium: [machine.ore_clown] <A href='?src=\ref[src];release=clown'>Release</A><br><br>")
|
||||
if(machine.ore_adamantine)
|
||||
dat += text ("Adamantine: [machine.ore_adamantine] <A href='?src=\ref[src];release=adamantine'>Release</A><br><br>")
|
||||
|
||||
dat += text("Stacking: [machine.stack_amt]<br><br>")
|
||||
|
||||
user << browse("[dat]", "window=console_stacking_machine")
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["release"])
|
||||
switch(href_list["release"])
|
||||
if ("plasma")
|
||||
if (machine.ore_plasma > 0)
|
||||
var/obj/item/stack/sheet/plasma/G = new /obj/item/stack/sheet/plasma
|
||||
G.amount = machine.ore_plasma
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_plasma = 0
|
||||
if ("uranium")
|
||||
if (machine.ore_uranium > 0)
|
||||
var/obj/item/stack/sheet/uranium/G = new /obj/item/stack/sheet/uranium
|
||||
G.amount = machine.ore_uranium
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_uranium = 0
|
||||
if ("glass")
|
||||
if (machine.ore_glass > 0)
|
||||
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass
|
||||
G.amount = machine.ore_glass
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_glass = 0
|
||||
if ("rglass")
|
||||
if (machine.ore_rglass > 0)
|
||||
var/obj/item/stack/sheet/rglass/G = new /obj/item/stack/sheet/rglass
|
||||
G.amount = machine.ore_rglass
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_rglass = 0
|
||||
if ("gold")
|
||||
if (machine.ore_gold > 0)
|
||||
var/obj/item/stack/sheet/gold/G = new /obj/item/stack/sheet/gold
|
||||
G.amount = machine.ore_gold
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_gold = 0
|
||||
if ("silver")
|
||||
if (machine.ore_silver > 0)
|
||||
var/obj/item/stack/sheet/silver/G = new /obj/item/stack/sheet/silver
|
||||
G.amount = machine.ore_silver
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_silver = 0
|
||||
if ("diamond")
|
||||
if (machine.ore_diamond > 0)
|
||||
var/obj/item/stack/sheet/diamond/G = new /obj/item/stack/sheet/diamond
|
||||
G.amount = machine.ore_diamond
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_diamond = 0
|
||||
if ("iron")
|
||||
if (machine.ore_iron > 0)
|
||||
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal
|
||||
G.amount = machine.ore_iron
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_iron = 0
|
||||
if ("plasteel")
|
||||
if (machine.ore_plasteel > 0)
|
||||
var/obj/item/stack/sheet/plasteel/G = new /obj/item/stack/sheet/plasteel
|
||||
G.amount = machine.ore_plasteel
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_plasteel = 0
|
||||
if ("clown")
|
||||
if (machine.ore_clown > 0)
|
||||
var/obj/item/stack/sheet/clown/G = new /obj/item/stack/sheet/clown
|
||||
G.amount = machine.ore_clown
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_clown = 0
|
||||
if ("adamantine")
|
||||
if (machine.ore_adamantine > 0)
|
||||
var/obj/item/stack/sheet/adamantine/G = new /obj/item/stack/sheet/adamantine
|
||||
G.amount = machine.ore_adamantine
|
||||
G.loc = machine.output.loc
|
||||
machine.ore_adamantine = 0
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/**********************Mineral stacking unit**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/stacking_machine
|
||||
name = "Stacking machine"
|
||||
icon = 'mining_machines.dmi'
|
||||
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/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/ore_gold = 0;
|
||||
var/ore_silver = 0;
|
||||
var/ore_diamond = 0;
|
||||
var/ore_plasma = 0;
|
||||
var/ore_iron = 0;
|
||||
var/ore_uranium = 0;
|
||||
var/ore_clown = 0;
|
||||
var/ore_glass = 0;
|
||||
var/ore_rglass = 0;
|
||||
var/ore_plasteel = 0;
|
||||
var/ore_adamantine = 0;
|
||||
var/stack_amt = 50; //ammount to stack before releassing
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/New()
|
||||
..()
|
||||
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/stacking_machine/process()
|
||||
if (src.output && src.input)
|
||||
var/obj/item/O
|
||||
while (locate(/obj/item, input.loc))
|
||||
O = locate(/obj/item, input.loc)
|
||||
if (istype(O,/obj/item/stack/sheet/metal))
|
||||
ore_iron+= O:amount;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/diamond))
|
||||
ore_diamond+= O:amount;
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/plasma))
|
||||
ore_plasma+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/gold))
|
||||
ore_gold+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/silver))
|
||||
ore_silver+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/clown))
|
||||
ore_clown+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/uranium))
|
||||
ore_uranium+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/glass))
|
||||
ore_glass+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/rglass))
|
||||
ore_rglass+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/plasteel))
|
||||
ore_plasteel+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/stack/sheet/adamantine))
|
||||
ore_adamantine+= O:amount
|
||||
del(O)
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/slag))
|
||||
del(O)
|
||||
continue
|
||||
O.loc = src.output.loc
|
||||
if (ore_gold >= stack_amt)
|
||||
var/obj/item/stack/sheet/gold/G = new /obj/item/stack/sheet/gold
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_gold -= stack_amt
|
||||
return
|
||||
if (ore_silver >= stack_amt)
|
||||
var/obj/item/stack/sheet/silver/G = new /obj/item/stack/sheet/silver
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_silver -= stack_amt
|
||||
return
|
||||
if (ore_diamond >= stack_amt)
|
||||
var/obj/item/stack/sheet/diamond/G = new /obj/item/stack/sheet/diamond
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_diamond -= stack_amt
|
||||
return
|
||||
if (ore_plasma >= stack_amt)
|
||||
var/obj/item/stack/sheet/plasma/G = new /obj/item/stack/sheet/plasma
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_plasma -= stack_amt
|
||||
return
|
||||
if (ore_iron >= stack_amt)
|
||||
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_iron -= stack_amt
|
||||
return
|
||||
if (ore_clown >= stack_amt)
|
||||
var/obj/item/stack/sheet/clown/G = new /obj/item/stack/sheet/clown
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_clown -= stack_amt
|
||||
return
|
||||
if (ore_uranium >= stack_amt)
|
||||
var/obj/item/stack/sheet/uranium/G = new /obj/item/stack/sheet/uranium
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_uranium -= stack_amt
|
||||
return
|
||||
if (ore_glass >= stack_amt)
|
||||
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_glass -= stack_amt
|
||||
return
|
||||
if (ore_rglass >= stack_amt)
|
||||
var/obj/item/stack/sheet/rglass/G = new /obj/item/stack/sheet/rglass
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_rglass -= stack_amt
|
||||
return
|
||||
if (ore_plasteel >= stack_amt)
|
||||
var/obj/item/stack/sheet/plasteel/G = new /obj/item/stack/sheet/plasteel
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_plasteel -= stack_amt
|
||||
return
|
||||
if (ore_adamantine >= stack_amt)
|
||||
var/obj/item/stack/sheet/adamantine/G = new /obj/item/stack/sheet/adamantine
|
||||
G.amount = stack_amt
|
||||
G.loc = output.loc
|
||||
ore_adamantine -= stack_amt
|
||||
return
|
||||
return
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
/**********************Unloading unit**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/unloading_machine
|
||||
name = "Unloading machine"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "unloader"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
|
||||
|
||||
/obj/machinery/mineral/unloading_machine/New()
|
||||
..()
|
||||
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/unloading_machine/process()
|
||||
if (src.output && src.input)
|
||||
if (locate(/obj/structure/ore_box, input.loc))
|
||||
var/obj/structure/ore_box/BOX = locate(/obj/structure/ore_box, input.loc)
|
||||
var/i = 0
|
||||
for (var/obj/item/weapon/ore/O in BOX.contents)
|
||||
BOX.contents -= O
|
||||
O.loc = output.loc
|
||||
i++
|
||||
if (i>=10)
|
||||
return
|
||||
if (locate(/obj/item, input.loc))
|
||||
var/obj/item/O
|
||||
var/i
|
||||
for (i = 0; i<10; i++)
|
||||
O = locate(/obj/item, input.loc)
|
||||
if (O)
|
||||
O.loc = src.output.loc
|
||||
else
|
||||
return
|
||||
/**********************Unloading unit**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/unloading_machine
|
||||
name = "Unloading machine"
|
||||
icon = 'mining_machines.dmi'
|
||||
icon_state = "unloader"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
|
||||
|
||||
/obj/machinery/mineral/unloading_machine/New()
|
||||
..()
|
||||
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/unloading_machine/process()
|
||||
if (src.output && src.input)
|
||||
if (locate(/obj/structure/ore_box, input.loc))
|
||||
var/obj/structure/ore_box/BOX = locate(/obj/structure/ore_box, input.loc)
|
||||
var/i = 0
|
||||
for (var/obj/item/weapon/ore/O in BOX.contents)
|
||||
BOX.contents -= O
|
||||
O.loc = output.loc
|
||||
i++
|
||||
if (i>=10)
|
||||
return
|
||||
if (locate(/obj/item, input.loc))
|
||||
var/obj/item/O
|
||||
var/i
|
||||
for (i = 0; i<10; i++)
|
||||
O = locate(/obj/item, input.loc)
|
||||
if (O)
|
||||
O.loc = src.output.loc
|
||||
else
|
||||
return
|
||||
return
|
||||
@@ -1,53 +1,53 @@
|
||||
/**********************Mine areas**************************/
|
||||
|
||||
/area/mine
|
||||
icon_state = "mining"
|
||||
|
||||
/area/mine/explored
|
||||
name = "Mine"
|
||||
icon_state = "explored"
|
||||
music = null
|
||||
|
||||
/area/mine/unexplored
|
||||
name = "Mine"
|
||||
icon_state = "unexplored"
|
||||
music = null
|
||||
|
||||
/area/mine/lobby
|
||||
name = "Mining station"
|
||||
|
||||
/area/mine/storage
|
||||
name = "Mining station Storage"
|
||||
|
||||
/area/mine/production
|
||||
name = "Mining station Production Area"
|
||||
icon_state = "mining_production"
|
||||
|
||||
/area/mine/abandoned
|
||||
name = "Abandoned Mining Station"
|
||||
|
||||
/area/mine/living_quarters
|
||||
name = "Mining Station Living Quarters"
|
||||
icon_state = "mining_living"
|
||||
|
||||
/area/mine/eva
|
||||
name = "Mining station EVA"
|
||||
icon_state = "mining_eva"
|
||||
|
||||
/area/mine/maintenance
|
||||
name = "Mining station Maintenance"
|
||||
|
||||
/area/mine/cafeteria
|
||||
name = "Mining station Cafeteria"
|
||||
|
||||
/area/mine/hydroponics
|
||||
name = "Mining station Hydroponics"
|
||||
|
||||
/area/mine/sleeper
|
||||
name = "Mining station Emergency Sleeper"
|
||||
|
||||
/area/mine/north_outpost
|
||||
name = "North Mining Outpost"
|
||||
|
||||
/area/mine/west_outpost
|
||||
/**********************Mine areas**************************/
|
||||
|
||||
/area/mine
|
||||
icon_state = "mining"
|
||||
|
||||
/area/mine/explored
|
||||
name = "Mine"
|
||||
icon_state = "explored"
|
||||
music = null
|
||||
|
||||
/area/mine/unexplored
|
||||
name = "Mine"
|
||||
icon_state = "unexplored"
|
||||
music = null
|
||||
|
||||
/area/mine/lobby
|
||||
name = "Mining station"
|
||||
|
||||
/area/mine/storage
|
||||
name = "Mining station Storage"
|
||||
|
||||
/area/mine/production
|
||||
name = "Mining station Production Area"
|
||||
icon_state = "mining_production"
|
||||
|
||||
/area/mine/abandoned
|
||||
name = "Abandoned Mining Station"
|
||||
|
||||
/area/mine/living_quarters
|
||||
name = "Mining Station Living Quarters"
|
||||
icon_state = "mining_living"
|
||||
|
||||
/area/mine/eva
|
||||
name = "Mining station EVA"
|
||||
icon_state = "mining_eva"
|
||||
|
||||
/area/mine/maintenance
|
||||
name = "Mining station Maintenance"
|
||||
|
||||
/area/mine/cafeteria
|
||||
name = "Mining station Cafeteria"
|
||||
|
||||
/area/mine/hydroponics
|
||||
name = "Mining station Hydroponics"
|
||||
|
||||
/area/mine/sleeper
|
||||
name = "Mining station Emergency Sleeper"
|
||||
|
||||
/area/mine/north_outpost
|
||||
name = "North Mining Outpost"
|
||||
|
||||
/area/mine/west_outpost
|
||||
name = "West Mining Outpost"
|
||||
+234
-234
@@ -1,234 +1,234 @@
|
||||
/**********************Light************************/
|
||||
|
||||
//this item is intended to give the effect of entering the mine, so that light gradually fades
|
||||
/obj/effect/light_emitter
|
||||
name = "Light-emtter"
|
||||
anchored = 1
|
||||
unacidable = 1
|
||||
luminosity = 8
|
||||
|
||||
/**********************Miner Lockers**************************/
|
||||
|
||||
/obj/structure/closet/secure_closet/miner
|
||||
name = "Miner's Equipment"
|
||||
icon_state = "miningsec1"
|
||||
icon_closed = "miningsec"
|
||||
icon_locked = "miningsec1"
|
||||
icon_broken = "miningsecbroken"
|
||||
icon_off = "miningsecoff"
|
||||
req_access = list(access_mining)
|
||||
|
||||
/obj/structure/closet/secure_closet/miner/New()
|
||||
..()
|
||||
sleep(2)
|
||||
new /obj/item/device/analyzer(src)
|
||||
new /obj/item/device/radio/headset/headset_mine(src)
|
||||
new /obj/item/clothing/under/rank/miner(src)
|
||||
new /obj/item/clothing/gloves/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/weapon/satchel(src)
|
||||
new /obj/item/device/flashlight/lantern(src)
|
||||
new /obj/item/weapon/shovel(src)
|
||||
new /obj/item/weapon/pickaxe(src)
|
||||
new /obj/item/clothing/glasses/meson(src)
|
||||
|
||||
|
||||
/**********************Shuttle Computer**************************/
|
||||
|
||||
var/mining_shuttle_tickstomove = 10
|
||||
var/mining_shuttle_moving = 0
|
||||
var/mining_shuttle_location = 0 // 0 = station 13, 1 = mining station
|
||||
|
||||
proc/move_mining_shuttle()
|
||||
if(mining_shuttle_moving) return
|
||||
mining_shuttle_moving = 1
|
||||
spawn(mining_shuttle_tickstomove*10)
|
||||
var/area/fromArea
|
||||
var/area/toArea
|
||||
if (mining_shuttle_location == 1)
|
||||
fromArea = locate(/area/shuttle/mining/outpost)
|
||||
toArea = locate(/area/shuttle/mining/station)
|
||||
else
|
||||
fromArea = locate(/area/shuttle/mining/station)
|
||||
toArea = locate(/area/shuttle/mining/outpost)
|
||||
fromArea.move_contents_to(toArea)
|
||||
if (mining_shuttle_location)
|
||||
mining_shuttle_location = 0
|
||||
else
|
||||
mining_shuttle_location = 1
|
||||
mining_shuttle_moving = 0
|
||||
return
|
||||
|
||||
/obj/machinery/computer/mining_shuttle
|
||||
name = "Mining Shuttle Console"
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "shuttle"
|
||||
req_access = list(access_mining)
|
||||
var/hacked = 0
|
||||
var/location = 0 //0 = station, 1 = mining base
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/attack_hand(user as mob)
|
||||
src.add_fingerprint(usr)
|
||||
var/dat
|
||||
dat = text("<center>Mining shuttle:<br> <b><A href='?src=\ref[src];move=[1]'>Send</A></b></center>")
|
||||
user << browse("[dat]", "window=miningshuttle;size=200x100")
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["move"])
|
||||
if(ticker.mode.name == "blob")
|
||||
if(ticker.mode:declared)
|
||||
usr << "Under directive 7-10, [station_name()] is quarantined until further notice."
|
||||
return
|
||||
|
||||
if (!mining_shuttle_moving)
|
||||
usr << "\blue Shuttle recieved message and will be sent shortly."
|
||||
move_mining_shuttle()
|
||||
else
|
||||
usr << "\blue Shuttle is already moving."
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/card/emag))
|
||||
src.req_access = list()
|
||||
hacked = 1
|
||||
usr << "You fried the consoles ID checking system. It's now available to everyone!"
|
||||
|
||||
/******************************Lantern*******************************/
|
||||
|
||||
/obj/item/device/flashlight/lantern
|
||||
name = "Mining Lantern"
|
||||
icon = 'lighting.dmi'
|
||||
icon_state = "lantern-off"
|
||||
desc = "A miner's lantern"
|
||||
anchored = 0
|
||||
var/brightness = 12 // luminosity when on
|
||||
|
||||
/obj/item/device/flashlight/lantern/New()
|
||||
luminosity = 0
|
||||
on = 0
|
||||
return
|
||||
|
||||
/obj/item/device/flashlight/lantern/attack_self(mob/user)
|
||||
..()
|
||||
if (on == 1)
|
||||
icon_state = "lantern-on"
|
||||
else
|
||||
icon_state = "lantern-off"
|
||||
|
||||
|
||||
/*****************************Pickaxe********************************/
|
||||
|
||||
/obj/item/weapon/pickaxe
|
||||
name = "Miner's pickaxe"
|
||||
icon = 'items.dmi'
|
||||
icon_state = "pickaxe"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
|
||||
force = 15.0
|
||||
throwforce = 4.0
|
||||
item_state = "pickaxe"
|
||||
w_class = 4.0
|
||||
m_amt = 3750 //one sheet, but where can you make them?
|
||||
var/digspeed = 40 //moving the delay to an item var so R&D can make improved picks. --NEO
|
||||
origin_tech = "materials=1;engineering=1"
|
||||
|
||||
hammer
|
||||
name = "Mining Sledge Hammer"
|
||||
desc = "A mining hammer made of reinforced metal. You feel like smashing your boss in the face with this."
|
||||
|
||||
silver
|
||||
name = "Silver Pickaxe"
|
||||
icon_state = "spickaxe"
|
||||
item_state = "spickaxe"
|
||||
digspeed = 30
|
||||
origin_tech = "materials=3"
|
||||
desc = "This makes no metallurgic sense."
|
||||
|
||||
drill
|
||||
name = "Mining Drill" // Can dig sand as well!
|
||||
icon_state = "handdrill"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 30
|
||||
origin_tech = "materials=2;powerstorage=3;engineering=2"
|
||||
desc = "Yours is the drill that will pierce through the rock walls."
|
||||
|
||||
jackhammer
|
||||
name = "Sonic Jackhammer"
|
||||
icon_state = "jackhammer"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 20 //faster than drill, but cannot dig
|
||||
origin_tech = "materials=3;powerstorage=2;engineering=2"
|
||||
desc = "Cracks rocks with sonic blasts, perfect for killing cave lizards."
|
||||
|
||||
gold
|
||||
name = "Golden Pickaxe"
|
||||
icon_state = "gpickaxe"
|
||||
item_state = "gpickaxe"
|
||||
digspeed = 20
|
||||
origin_tech = "materials=4"
|
||||
desc = "This makes no metallurgic sense."
|
||||
|
||||
plasmacutter
|
||||
name = "Plasma Cutter"
|
||||
icon_state = "plasmacutter"
|
||||
item_state = "gun"
|
||||
w_class = 3.0 //it is smaller than the pickaxe
|
||||
damtype = "fire"
|
||||
digspeed = 20 //Can slice though normal walls, all girders, or be used in reinforced wall deconstruction/ light thermite on fire
|
||||
origin_tech = "materials=4;plasmatech=3;engineering=3"
|
||||
desc = "A rock cutter that uses bursts of hot plasma. You could use it to cut limbs off of xenos! Or, you know, mine stuff."
|
||||
|
||||
diamond
|
||||
name = "Diamond Pickaxe"
|
||||
icon_state = "dpickaxe"
|
||||
item_state = "dpickaxe"
|
||||
digspeed = 10
|
||||
origin_tech = "materials=6;engineering=4"
|
||||
desc = "A pickaxe with a diamond pick head, this is just like minecraft."
|
||||
|
||||
diamonddrill //When people ask about the badass leader of the mining tools, they are talking about ME!
|
||||
name = "Diamond Mining Drill"
|
||||
icon_state = "diamonddrill"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 0 //Digs through walls, girders, and can dig up sand
|
||||
origin_tech = "materials=6;powerstorage=4;engineering=5"
|
||||
desc = "Yours is the drill that will pierce the heavens!"
|
||||
|
||||
/*****************************Shovel********************************/
|
||||
|
||||
/obj/item/weapon/shovel
|
||||
name = "Shovel"
|
||||
icon = 'items.dmi'
|
||||
icon_state = "shovel"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
|
||||
force = 8.0
|
||||
throwforce = 4.0
|
||||
item_state = "shovel"
|
||||
w_class = 3.0
|
||||
m_amt = 50
|
||||
origin_tech = "materials=1;engineering=1"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**********************Mining car (Crate like thing, not the rail car)**************************/
|
||||
|
||||
/obj/structure/closet/crate/miningcar
|
||||
desc = "A mining car. This one doesn't work on rails, but has to be dragged."
|
||||
name = "Mining car (not for rails)"
|
||||
icon = 'storage.dmi'
|
||||
icon_state = "miningcar"
|
||||
density = 1
|
||||
icon_opened = "miningcaropen"
|
||||
icon_closed = "miningcar"
|
||||
|
||||
|
||||
|
||||
|
||||
/**********************Light************************/
|
||||
|
||||
//this item is intended to give the effect of entering the mine, so that light gradually fades
|
||||
/obj/effect/light_emitter
|
||||
name = "Light-emtter"
|
||||
anchored = 1
|
||||
unacidable = 1
|
||||
luminosity = 8
|
||||
|
||||
/**********************Miner Lockers**************************/
|
||||
|
||||
/obj/structure/closet/secure_closet/miner
|
||||
name = "Miner's Equipment"
|
||||
icon_state = "miningsec1"
|
||||
icon_closed = "miningsec"
|
||||
icon_locked = "miningsec1"
|
||||
icon_broken = "miningsecbroken"
|
||||
icon_off = "miningsecoff"
|
||||
req_access = list(access_mining)
|
||||
|
||||
/obj/structure/closet/secure_closet/miner/New()
|
||||
..()
|
||||
sleep(2)
|
||||
new /obj/item/device/analyzer(src)
|
||||
new /obj/item/device/radio/headset/headset_mine(src)
|
||||
new /obj/item/clothing/under/rank/miner(src)
|
||||
new /obj/item/clothing/gloves/black(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/weapon/satchel(src)
|
||||
new /obj/item/device/flashlight/lantern(src)
|
||||
new /obj/item/weapon/shovel(src)
|
||||
new /obj/item/weapon/pickaxe(src)
|
||||
new /obj/item/clothing/glasses/meson(src)
|
||||
|
||||
|
||||
/**********************Shuttle Computer**************************/
|
||||
|
||||
var/mining_shuttle_tickstomove = 10
|
||||
var/mining_shuttle_moving = 0
|
||||
var/mining_shuttle_location = 0 // 0 = station 13, 1 = mining station
|
||||
|
||||
proc/move_mining_shuttle()
|
||||
if(mining_shuttle_moving) return
|
||||
mining_shuttle_moving = 1
|
||||
spawn(mining_shuttle_tickstomove*10)
|
||||
var/area/fromArea
|
||||
var/area/toArea
|
||||
if (mining_shuttle_location == 1)
|
||||
fromArea = locate(/area/shuttle/mining/outpost)
|
||||
toArea = locate(/area/shuttle/mining/station)
|
||||
else
|
||||
fromArea = locate(/area/shuttle/mining/station)
|
||||
toArea = locate(/area/shuttle/mining/outpost)
|
||||
fromArea.move_contents_to(toArea)
|
||||
if (mining_shuttle_location)
|
||||
mining_shuttle_location = 0
|
||||
else
|
||||
mining_shuttle_location = 1
|
||||
mining_shuttle_moving = 0
|
||||
return
|
||||
|
||||
/obj/machinery/computer/mining_shuttle
|
||||
name = "Mining Shuttle Console"
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "shuttle"
|
||||
req_access = list(access_mining)
|
||||
var/hacked = 0
|
||||
var/location = 0 //0 = station, 1 = mining base
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/attack_hand(user as mob)
|
||||
src.add_fingerprint(usr)
|
||||
var/dat
|
||||
dat = text("<center>Mining shuttle:<br> <b><A href='?src=\ref[src];move=[1]'>Send</A></b></center>")
|
||||
user << browse("[dat]", "window=miningshuttle;size=200x100")
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["move"])
|
||||
if(ticker.mode.name == "blob")
|
||||
if(ticker.mode:declared)
|
||||
usr << "Under directive 7-10, [station_name()] is quarantined until further notice."
|
||||
return
|
||||
|
||||
if (!mining_shuttle_moving)
|
||||
usr << "\blue Shuttle recieved message and will be sent shortly."
|
||||
move_mining_shuttle()
|
||||
else
|
||||
usr << "\blue Shuttle is already moving."
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/card/emag))
|
||||
src.req_access = list()
|
||||
hacked = 1
|
||||
usr << "You fried the consoles ID checking system. It's now available to everyone!"
|
||||
|
||||
/******************************Lantern*******************************/
|
||||
|
||||
/obj/item/device/flashlight/lantern
|
||||
name = "Mining Lantern"
|
||||
icon = 'lighting.dmi'
|
||||
icon_state = "lantern-off"
|
||||
desc = "A miner's lantern"
|
||||
anchored = 0
|
||||
var/brightness = 12 // luminosity when on
|
||||
|
||||
/obj/item/device/flashlight/lantern/New()
|
||||
luminosity = 0
|
||||
on = 0
|
||||
return
|
||||
|
||||
/obj/item/device/flashlight/lantern/attack_self(mob/user)
|
||||
..()
|
||||
if (on == 1)
|
||||
icon_state = "lantern-on"
|
||||
else
|
||||
icon_state = "lantern-off"
|
||||
|
||||
|
||||
/*****************************Pickaxe********************************/
|
||||
|
||||
/obj/item/weapon/pickaxe
|
||||
name = "Miner's pickaxe"
|
||||
icon = 'items.dmi'
|
||||
icon_state = "pickaxe"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
|
||||
force = 15.0
|
||||
throwforce = 4.0
|
||||
item_state = "pickaxe"
|
||||
w_class = 4.0
|
||||
m_amt = 3750 //one sheet, but where can you make them?
|
||||
var/digspeed = 40 //moving the delay to an item var so R&D can make improved picks. --NEO
|
||||
origin_tech = "materials=1;engineering=1"
|
||||
|
||||
hammer
|
||||
name = "Mining Sledge Hammer"
|
||||
desc = "A mining hammer made of reinforced metal. You feel like smashing your boss in the face with this."
|
||||
|
||||
silver
|
||||
name = "Silver Pickaxe"
|
||||
icon_state = "spickaxe"
|
||||
item_state = "spickaxe"
|
||||
digspeed = 30
|
||||
origin_tech = "materials=3"
|
||||
desc = "This makes no metallurgic sense."
|
||||
|
||||
drill
|
||||
name = "Mining Drill" // Can dig sand as well!
|
||||
icon_state = "handdrill"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 30
|
||||
origin_tech = "materials=2;powerstorage=3;engineering=2"
|
||||
desc = "Yours is the drill that will pierce through the rock walls."
|
||||
|
||||
jackhammer
|
||||
name = "Sonic Jackhammer"
|
||||
icon_state = "jackhammer"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 20 //faster than drill, but cannot dig
|
||||
origin_tech = "materials=3;powerstorage=2;engineering=2"
|
||||
desc = "Cracks rocks with sonic blasts, perfect for killing cave lizards."
|
||||
|
||||
gold
|
||||
name = "Golden Pickaxe"
|
||||
icon_state = "gpickaxe"
|
||||
item_state = "gpickaxe"
|
||||
digspeed = 20
|
||||
origin_tech = "materials=4"
|
||||
desc = "This makes no metallurgic sense."
|
||||
|
||||
plasmacutter
|
||||
name = "Plasma Cutter"
|
||||
icon_state = "plasmacutter"
|
||||
item_state = "gun"
|
||||
w_class = 3.0 //it is smaller than the pickaxe
|
||||
damtype = "fire"
|
||||
digspeed = 20 //Can slice though normal walls, all girders, or be used in reinforced wall deconstruction/ light thermite on fire
|
||||
origin_tech = "materials=4;plasmatech=3;engineering=3"
|
||||
desc = "A rock cutter that uses bursts of hot plasma. You could use it to cut limbs off of xenos! Or, you know, mine stuff."
|
||||
|
||||
diamond
|
||||
name = "Diamond Pickaxe"
|
||||
icon_state = "dpickaxe"
|
||||
item_state = "dpickaxe"
|
||||
digspeed = 10
|
||||
origin_tech = "materials=6;engineering=4"
|
||||
desc = "A pickaxe with a diamond pick head, this is just like minecraft."
|
||||
|
||||
diamonddrill //When people ask about the badass leader of the mining tools, they are talking about ME!
|
||||
name = "Diamond Mining Drill"
|
||||
icon_state = "diamonddrill"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 0 //Digs through walls, girders, and can dig up sand
|
||||
origin_tech = "materials=6;powerstorage=4;engineering=5"
|
||||
desc = "Yours is the drill that will pierce the heavens!"
|
||||
|
||||
/*****************************Shovel********************************/
|
||||
|
||||
/obj/item/weapon/shovel
|
||||
name = "Shovel"
|
||||
icon = 'items.dmi'
|
||||
icon_state = "shovel"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
|
||||
force = 8.0
|
||||
throwforce = 4.0
|
||||
item_state = "shovel"
|
||||
w_class = 3.0
|
||||
m_amt = 50
|
||||
origin_tech = "materials=1;engineering=1"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**********************Mining car (Crate like thing, not the rail car)**************************/
|
||||
|
||||
/obj/structure/closet/crate/miningcar
|
||||
desc = "A mining car. This one doesn't work on rails, but has to be dragged."
|
||||
name = "Mining car (not for rails)"
|
||||
icon = 'storage.dmi'
|
||||
icon_state = "miningcar"
|
||||
density = 1
|
||||
icon_opened = "miningcaropen"
|
||||
icon_closed = "miningcar"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+424
-424
@@ -1,425 +1,425 @@
|
||||
/**********************Mineral deposits**************************/
|
||||
|
||||
/turf/simulated/mineral //wall piece
|
||||
name = "Rock"
|
||||
icon = 'walls.dmi'
|
||||
icon_state = "rock"
|
||||
oxygen = 0
|
||||
nitrogen = 0
|
||||
opacity = 1
|
||||
density = 1
|
||||
blocks_air = 1
|
||||
temperature = TCMB
|
||||
var/mineralName = ""
|
||||
var/mineralAmt = 0
|
||||
var/spread = 0 //will the seam spread?
|
||||
var/spreadChance = 0 //the percentual chance of an ore spreading to the neighbouring tiles
|
||||
|
||||
/turf/simulated/mineral/Del()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/ex_act(severity)
|
||||
switch(severity)
|
||||
if(3.0)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(70))
|
||||
src.mineralAmt -= 1 //some of the stuff gets blown up
|
||||
src.gets_drilled()
|
||||
if(1.0)
|
||||
src.mineralAmt -= 2 //some of the stuff gets blown up
|
||||
src.gets_drilled()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/New()
|
||||
|
||||
spawn(1)
|
||||
var/turf/T
|
||||
if((istype(get_step(src, NORTH), /turf/simulated/floor)) || (istype(get_step(src, NORTH), /turf/space)) || (istype(get_step(src, NORTH), /turf/simulated/shuttle/floor)))
|
||||
T = get_step(src, NORTH)
|
||||
if (T)
|
||||
T.overlays += image('walls.dmi', "rock_side_s")
|
||||
if((istype(get_step(src, SOUTH), /turf/simulated/floor)) || (istype(get_step(src, SOUTH), /turf/space)) || (istype(get_step(src, SOUTH), /turf/simulated/shuttle/floor)))
|
||||
T = get_step(src, SOUTH)
|
||||
if (T)
|
||||
T.overlays += image('walls.dmi', "rock_side_n", layer=6)
|
||||
if((istype(get_step(src, EAST), /turf/simulated/floor)) || (istype(get_step(src, EAST), /turf/space)) || (istype(get_step(src, EAST), /turf/simulated/shuttle/floor)))
|
||||
T = get_step(src, EAST)
|
||||
if (T)
|
||||
T.overlays += image('walls.dmi', "rock_side_w", layer=6)
|
||||
if((istype(get_step(src, WEST), /turf/simulated/floor)) || (istype(get_step(src, WEST), /turf/space)) || (istype(get_step(src, WEST), /turf/simulated/shuttle/floor)))
|
||||
T = get_step(src, WEST)
|
||||
if (T)
|
||||
T.overlays += image('walls.dmi', "rock_side_e", layer=6)
|
||||
|
||||
if (mineralName && mineralAmt && spread && spreadChance)
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, SOUTH), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, SOUTH))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, NORTH), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, NORTH))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, WEST), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, WEST))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, EAST), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, EAST))
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/random
|
||||
name = "Mineral deposit"
|
||||
var/mineralAmtList = list("Uranium" = 5, "Iron" = 5, "Diamond" = 5, "Gold" = 5, "Silver" = 5, "Plasma" = 5/*, "Adamantine" = 5*/)
|
||||
var/mineralSpawnChanceList = list("Uranium" = 5, "Iron" = 50, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Plasma" = 25/*, "Adamantine" =5*/)//Currently, Adamantine won't spawn as it has no uses. -Durandan
|
||||
var/mineralChance = 10 //means 10% chance of this plot changing to a mineral deposit
|
||||
|
||||
/turf/simulated/mineral/random/New()
|
||||
..()
|
||||
if (prob(mineralChance))
|
||||
var/mName = pickweight(mineralSpawnChanceList) //temp mineral name
|
||||
|
||||
if (mName)
|
||||
var/turf/simulated/mineral/M
|
||||
switch(mName)
|
||||
if("Uranium")
|
||||
M = new/turf/simulated/mineral/uranium(src)
|
||||
if("Iron")
|
||||
M = new/turf/simulated/mineral/iron(src)
|
||||
if("Diamond")
|
||||
M = new/turf/simulated/mineral/diamond(src)
|
||||
if("Gold")
|
||||
M = new/turf/simulated/mineral/gold(src)
|
||||
if("Silver")
|
||||
M = new/turf/simulated/mineral/silver(src)
|
||||
if("Plasma")
|
||||
M = new/turf/simulated/mineral/plasma(src)
|
||||
/*if("Adamantine")
|
||||
M = new/turf/simulated/mineral/adamantine(src)*/
|
||||
if(M)
|
||||
src = M
|
||||
M.levelupdate()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/random/high_chance
|
||||
mineralChance = 25
|
||||
mineralSpawnChanceList = list("Uranium" = 10, "Iron" = 30, "Diamond" = 2, "Gold" = 10, "Silver" = 10, "Plasma" = 25)
|
||||
|
||||
/turf/simulated/mineral/random/Del()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/uranium
|
||||
name = "Uranium deposit"
|
||||
icon_state = "rock_Uranium"
|
||||
mineralName = "Uranium"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
|
||||
/turf/simulated/mineral/iron
|
||||
name = "Iron deposit"
|
||||
icon_state = "rock_Iron"
|
||||
mineralName = "Iron"
|
||||
mineralAmt = 5
|
||||
spreadChance = 25
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/diamond
|
||||
name = "Diamond deposit"
|
||||
icon_state = "rock_Diamond"
|
||||
mineralName = "Diamond"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/gold
|
||||
name = "Gold deposit"
|
||||
icon_state = "rock_Gold"
|
||||
mineralName = "Gold"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/silver
|
||||
name = "Silver deposit"
|
||||
icon_state = "rock_Silver"
|
||||
mineralName = "Silver"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/plasma
|
||||
name = "Plasma deposit"
|
||||
icon_state = "rock_Plasma"
|
||||
mineralName = "Plasma"
|
||||
mineralAmt = 5
|
||||
spreadChance = 25
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/adamantine
|
||||
name = "Adamantine deposit"
|
||||
icon_state = "rock_Adamantine"
|
||||
mineralName = "Adamantine"
|
||||
mineralAmt = 3
|
||||
spreadChance = 0
|
||||
spread = 0 //It shouldn't spawn yet; will change these to match diamond once it's fully implemented. -Durandan
|
||||
|
||||
|
||||
/turf/simulated/mineral/clown
|
||||
name = "Bananium deposit"
|
||||
icon_state = "rock_Clown"
|
||||
mineralName = "Clown"
|
||||
mineralAmt = 3
|
||||
spreadChance = 0
|
||||
spread = 0
|
||||
|
||||
|
||||
/turf/simulated/mineral/ReplaceWithFloor()
|
||||
if(!icon_old) icon_old = icon_state
|
||||
var/turf/simulated/floor/plating/airless/asteroid/W
|
||||
var/old_dir = dir
|
||||
|
||||
for(var/direction in cardinal)
|
||||
for(var/obj/effect/glowshroom/shroom in get_step(src,direction))
|
||||
if(!shroom.floor) //shrooms drop to the floor
|
||||
shroom.floor = 1
|
||||
shroom.icon_state = "glowshroomf"
|
||||
shroom.pixel_x = 0
|
||||
shroom.pixel_y = 0
|
||||
|
||||
W = new /turf/simulated/floor/plating/airless/asteroid( locate(src.x, src.y, src.z) )
|
||||
W.dir = old_dir
|
||||
W.fullUpdateMineralOverlays()
|
||||
|
||||
/*
|
||||
W.icon_old = old_icon
|
||||
if(old_icon) W.icon_state = old_icon
|
||||
*/
|
||||
W.opacity = 1
|
||||
W.sd_SetOpacity(0)
|
||||
W.sd_LumReset()
|
||||
W.levelupdate()
|
||||
return W
|
||||
|
||||
|
||||
/turf/simulated/mineral/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/weapon/pickaxe))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
/*
|
||||
if (istype(W, /obj/item/weapon/pickaxe/radius))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
*/
|
||||
//Watch your tabbing, microwave. --NEO
|
||||
|
||||
user << "\red You start picking."
|
||||
playsound(user, 'Genhit.ogg', 20, 1)
|
||||
|
||||
if(do_after(user,W:digspeed))
|
||||
user << "\blue You finish cutting into the rock."
|
||||
gets_drilled()
|
||||
|
||||
else
|
||||
return attack_hand(user)
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/proc/gets_drilled()
|
||||
if ((src.mineralName != "") && (src.mineralAmt > 0) && (src.mineralAmt < 11))
|
||||
var/i
|
||||
for (i=0;i<mineralAmt;i++)
|
||||
if (src.mineralName == "Uranium")
|
||||
new /obj/item/weapon/ore/uranium(src)
|
||||
if (src.mineralName == "Iron")
|
||||
new /obj/item/weapon/ore/iron(src)
|
||||
if (src.mineralName == "Gold")
|
||||
new /obj/item/weapon/ore/gold(src)
|
||||
if (src.mineralName == "Silver")
|
||||
new /obj/item/weapon/ore/silver(src)
|
||||
if (src.mineralName == "Plasma")
|
||||
new /obj/item/weapon/ore/plasma(src)
|
||||
if (src.mineralName == "Diamond")
|
||||
new /obj/item/weapon/ore/diamond(src)
|
||||
if (src.mineralName == "Clown")
|
||||
new /obj/item/weapon/ore/clown(src)
|
||||
if (src.mineralName == "Adamantine")
|
||||
new /obj/item/weapon/ore/adamantine(src)
|
||||
ReplaceWithFloor()
|
||||
return
|
||||
|
||||
/*
|
||||
/turf/simulated/mineral/proc/setRandomMinerals()
|
||||
var/s = pickweight(list("uranium" = 5, "iron" = 50, "gold" = 5, "silver" = 5, "plasma" = 50, "diamond" = 1))
|
||||
if (s)
|
||||
mineralName = s
|
||||
|
||||
var/N = text2path("/turf/simulated/mineral/[s]")
|
||||
if (N)
|
||||
var/turf/simulated/mineral/M = new N
|
||||
src = M
|
||||
if (src.mineralName)
|
||||
mineralAmt = 5
|
||||
return*/
|
||||
|
||||
|
||||
/**********************Asteroid**************************/
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid //floor piece
|
||||
name = "Asteroid"
|
||||
icon = 'floors.dmi'
|
||||
icon_state = "asteroid"
|
||||
oxygen = 0.01
|
||||
nitrogen = 0.01
|
||||
temperature = TCMB
|
||||
icon_plating = "asteroid"
|
||||
var/dug = 0 //0 = has not yet been dug, 1 = has already been dug
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/New()
|
||||
var/proper_name = name
|
||||
..()
|
||||
name = proper_name
|
||||
//if (prob(50))
|
||||
// seedName = pick(list("1","2","3","4"))
|
||||
// seedAmt = rand(1,4)
|
||||
if(prob(20))
|
||||
icon_state = "asteroid[rand(0,8)]"
|
||||
spawn(2)
|
||||
updateMineralOverlays()
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/ex_act(severity)
|
||||
return
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if(!W || !user)
|
||||
return 0
|
||||
|
||||
if ((istype(W, /obj/item/weapon/shovel)))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
|
||||
if (dug == 1)
|
||||
user << "\red This area has already been dug"
|
||||
return
|
||||
|
||||
user << "\red You start digging."
|
||||
playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better
|
||||
|
||||
sleep(40)
|
||||
if ((user.loc == T && user.equipped() == W))
|
||||
user << "\blue You dug a hole."
|
||||
gets_dug()
|
||||
dug = 1
|
||||
icon_plating = "asteroid_dug"
|
||||
icon_state = "asteroid_dug"
|
||||
else
|
||||
..(W,user)
|
||||
if ((istype(W,/obj/item/weapon/pickaxe/drill)))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
|
||||
if (dug == 1)
|
||||
user << "\red This area has already been dug"
|
||||
return
|
||||
|
||||
user << "\red You start digging."
|
||||
playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better
|
||||
|
||||
sleep(30)
|
||||
if ((user.loc == T && user.equipped() == W))
|
||||
user << "\blue You dug a hole."
|
||||
gets_dug()
|
||||
dug = 1
|
||||
icon_plating = "asteroid_dug"
|
||||
icon_state = "asteroid_dug"
|
||||
else
|
||||
..(W,user)
|
||||
|
||||
if ((istype(W,/obj/item/weapon/pickaxe/diamonddrill)))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
|
||||
if (dug == 1)
|
||||
user << "\red This area has already been dug"
|
||||
return
|
||||
|
||||
user << "\red You start digging."
|
||||
playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better
|
||||
|
||||
sleep(0)
|
||||
if ((user.loc == T && user.equipped() == W))
|
||||
user << "\blue You dug a hole."
|
||||
gets_dug()
|
||||
dug = 1
|
||||
icon_plating = "asteroid_dug"
|
||||
icon_state = "asteroid_dug"
|
||||
else
|
||||
..(W,user)
|
||||
|
||||
return
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/proc/gets_dug()
|
||||
new/obj/item/weapon/ore/glass(src)
|
||||
new/obj/item/weapon/ore/glass(src)
|
||||
new/obj/item/weapon/ore/glass(src)
|
||||
new/obj/item/weapon/ore/glass(src)
|
||||
new/obj/item/weapon/ore/glass(src)
|
||||
return
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/proc/updateMineralOverlays()
|
||||
|
||||
src.overlays = null
|
||||
|
||||
if(istype(get_step(src, NORTH), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_n")
|
||||
if(istype(get_step(src, SOUTH), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_s", layer=6)
|
||||
if(istype(get_step(src, EAST), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_e", layer=6)
|
||||
if(istype(get_step(src, WEST), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_w", layer=6)
|
||||
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/proc/fullUpdateMineralOverlays()
|
||||
var/turf/simulated/floor/plating/airless/asteroid/A
|
||||
if(istype(get_step(src, WEST), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, WEST)
|
||||
A.updateMineralOverlays()
|
||||
if(istype(get_step(src, EAST), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, EAST)
|
||||
A.updateMineralOverlays()
|
||||
if(istype(get_step(src, NORTH), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, NORTH)
|
||||
A.updateMineralOverlays()
|
||||
if(istype(get_step(src, NORTHWEST), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, NORTHWEST)
|
||||
A.updateMineralOverlays()
|
||||
if(istype(get_step(src, NORTHEAST), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, NORTHEAST)
|
||||
A.updateMineralOverlays()
|
||||
if(istype(get_step(src, SOUTHWEST), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, SOUTHWEST)
|
||||
A.updateMineralOverlays()
|
||||
if(istype(get_step(src, SOUTHEAST), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, SOUTHEAST)
|
||||
A.updateMineralOverlays()
|
||||
if(istype(get_step(src, SOUTH), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, SOUTH)
|
||||
A.updateMineralOverlays()
|
||||
/**********************Mineral deposits**************************/
|
||||
|
||||
/turf/simulated/mineral //wall piece
|
||||
name = "Rock"
|
||||
icon = 'walls.dmi'
|
||||
icon_state = "rock"
|
||||
oxygen = 0
|
||||
nitrogen = 0
|
||||
opacity = 1
|
||||
density = 1
|
||||
blocks_air = 1
|
||||
temperature = TCMB
|
||||
var/mineralName = ""
|
||||
var/mineralAmt = 0
|
||||
var/spread = 0 //will the seam spread?
|
||||
var/spreadChance = 0 //the percentual chance of an ore spreading to the neighbouring tiles
|
||||
|
||||
/turf/simulated/mineral/Del()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/ex_act(severity)
|
||||
switch(severity)
|
||||
if(3.0)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(70))
|
||||
src.mineralAmt -= 1 //some of the stuff gets blown up
|
||||
src.gets_drilled()
|
||||
if(1.0)
|
||||
src.mineralAmt -= 2 //some of the stuff gets blown up
|
||||
src.gets_drilled()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/New()
|
||||
|
||||
spawn(1)
|
||||
var/turf/T
|
||||
if((istype(get_step(src, NORTH), /turf/simulated/floor)) || (istype(get_step(src, NORTH), /turf/space)) || (istype(get_step(src, NORTH), /turf/simulated/shuttle/floor)))
|
||||
T = get_step(src, NORTH)
|
||||
if (T)
|
||||
T.overlays += image('walls.dmi', "rock_side_s")
|
||||
if((istype(get_step(src, SOUTH), /turf/simulated/floor)) || (istype(get_step(src, SOUTH), /turf/space)) || (istype(get_step(src, SOUTH), /turf/simulated/shuttle/floor)))
|
||||
T = get_step(src, SOUTH)
|
||||
if (T)
|
||||
T.overlays += image('walls.dmi', "rock_side_n", layer=6)
|
||||
if((istype(get_step(src, EAST), /turf/simulated/floor)) || (istype(get_step(src, EAST), /turf/space)) || (istype(get_step(src, EAST), /turf/simulated/shuttle/floor)))
|
||||
T = get_step(src, EAST)
|
||||
if (T)
|
||||
T.overlays += image('walls.dmi', "rock_side_w", layer=6)
|
||||
if((istype(get_step(src, WEST), /turf/simulated/floor)) || (istype(get_step(src, WEST), /turf/space)) || (istype(get_step(src, WEST), /turf/simulated/shuttle/floor)))
|
||||
T = get_step(src, WEST)
|
||||
if (T)
|
||||
T.overlays += image('walls.dmi', "rock_side_e", layer=6)
|
||||
|
||||
if (mineralName && mineralAmt && spread && spreadChance)
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, SOUTH), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, SOUTH))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, NORTH), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, NORTH))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, WEST), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, WEST))
|
||||
if(prob(spreadChance))
|
||||
if(istype(get_step(src, EAST), /turf/simulated/mineral/random))
|
||||
new src.type(get_step(src, EAST))
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/random
|
||||
name = "Mineral deposit"
|
||||
var/mineralAmtList = list("Uranium" = 5, "Iron" = 5, "Diamond" = 5, "Gold" = 5, "Silver" = 5, "Plasma" = 5/*, "Adamantine" = 5*/)
|
||||
var/mineralSpawnChanceList = list("Uranium" = 5, "Iron" = 50, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Plasma" = 25/*, "Adamantine" =5*/)//Currently, Adamantine won't spawn as it has no uses. -Durandan
|
||||
var/mineralChance = 10 //means 10% chance of this plot changing to a mineral deposit
|
||||
|
||||
/turf/simulated/mineral/random/New()
|
||||
..()
|
||||
if (prob(mineralChance))
|
||||
var/mName = pickweight(mineralSpawnChanceList) //temp mineral name
|
||||
|
||||
if (mName)
|
||||
var/turf/simulated/mineral/M
|
||||
switch(mName)
|
||||
if("Uranium")
|
||||
M = new/turf/simulated/mineral/uranium(src)
|
||||
if("Iron")
|
||||
M = new/turf/simulated/mineral/iron(src)
|
||||
if("Diamond")
|
||||
M = new/turf/simulated/mineral/diamond(src)
|
||||
if("Gold")
|
||||
M = new/turf/simulated/mineral/gold(src)
|
||||
if("Silver")
|
||||
M = new/turf/simulated/mineral/silver(src)
|
||||
if("Plasma")
|
||||
M = new/turf/simulated/mineral/plasma(src)
|
||||
/*if("Adamantine")
|
||||
M = new/turf/simulated/mineral/adamantine(src)*/
|
||||
if(M)
|
||||
src = M
|
||||
M.levelupdate()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/random/high_chance
|
||||
mineralChance = 25
|
||||
mineralSpawnChanceList = list("Uranium" = 10, "Iron" = 30, "Diamond" = 2, "Gold" = 10, "Silver" = 10, "Plasma" = 25)
|
||||
|
||||
/turf/simulated/mineral/random/Del()
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/uranium
|
||||
name = "Uranium deposit"
|
||||
icon_state = "rock_Uranium"
|
||||
mineralName = "Uranium"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
|
||||
/turf/simulated/mineral/iron
|
||||
name = "Iron deposit"
|
||||
icon_state = "rock_Iron"
|
||||
mineralName = "Iron"
|
||||
mineralAmt = 5
|
||||
spreadChance = 25
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/diamond
|
||||
name = "Diamond deposit"
|
||||
icon_state = "rock_Diamond"
|
||||
mineralName = "Diamond"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/gold
|
||||
name = "Gold deposit"
|
||||
icon_state = "rock_Gold"
|
||||
mineralName = "Gold"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/silver
|
||||
name = "Silver deposit"
|
||||
icon_state = "rock_Silver"
|
||||
mineralName = "Silver"
|
||||
mineralAmt = 5
|
||||
spreadChance = 10
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/plasma
|
||||
name = "Plasma deposit"
|
||||
icon_state = "rock_Plasma"
|
||||
mineralName = "Plasma"
|
||||
mineralAmt = 5
|
||||
spreadChance = 25
|
||||
spread = 1
|
||||
|
||||
|
||||
/turf/simulated/mineral/adamantine
|
||||
name = "Adamantine deposit"
|
||||
icon_state = "rock_Adamantine"
|
||||
mineralName = "Adamantine"
|
||||
mineralAmt = 3
|
||||
spreadChance = 0
|
||||
spread = 0 //It shouldn't spawn yet; will change these to match diamond once it's fully implemented. -Durandan
|
||||
|
||||
|
||||
/turf/simulated/mineral/clown
|
||||
name = "Bananium deposit"
|
||||
icon_state = "rock_Clown"
|
||||
mineralName = "Clown"
|
||||
mineralAmt = 3
|
||||
spreadChance = 0
|
||||
spread = 0
|
||||
|
||||
|
||||
/turf/simulated/mineral/ReplaceWithFloor()
|
||||
if(!icon_old) icon_old = icon_state
|
||||
var/turf/simulated/floor/plating/airless/asteroid/W
|
||||
var/old_dir = dir
|
||||
|
||||
for(var/direction in cardinal)
|
||||
for(var/obj/effect/glowshroom/shroom in get_step(src,direction))
|
||||
if(!shroom.floor) //shrooms drop to the floor
|
||||
shroom.floor = 1
|
||||
shroom.icon_state = "glowshroomf"
|
||||
shroom.pixel_x = 0
|
||||
shroom.pixel_y = 0
|
||||
|
||||
W = new /turf/simulated/floor/plating/airless/asteroid( locate(src.x, src.y, src.z) )
|
||||
W.dir = old_dir
|
||||
W.fullUpdateMineralOverlays()
|
||||
|
||||
/*
|
||||
W.icon_old = old_icon
|
||||
if(old_icon) W.icon_state = old_icon
|
||||
*/
|
||||
W.opacity = 1
|
||||
W.sd_SetOpacity(0)
|
||||
W.sd_LumReset()
|
||||
W.levelupdate()
|
||||
return W
|
||||
|
||||
|
||||
/turf/simulated/mineral/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/weapon/pickaxe))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
/*
|
||||
if (istype(W, /obj/item/weapon/pickaxe/radius))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
*/
|
||||
//Watch your tabbing, microwave. --NEO
|
||||
|
||||
user << "\red You start picking."
|
||||
playsound(user, 'Genhit.ogg', 20, 1)
|
||||
|
||||
if(do_after(user,W:digspeed))
|
||||
user << "\blue You finish cutting into the rock."
|
||||
gets_drilled()
|
||||
|
||||
else
|
||||
return attack_hand(user)
|
||||
return
|
||||
|
||||
/turf/simulated/mineral/proc/gets_drilled()
|
||||
if ((src.mineralName != "") && (src.mineralAmt > 0) && (src.mineralAmt < 11))
|
||||
var/i
|
||||
for (i=0;i<mineralAmt;i++)
|
||||
if (src.mineralName == "Uranium")
|
||||
new /obj/item/weapon/ore/uranium(src)
|
||||
if (src.mineralName == "Iron")
|
||||
new /obj/item/weapon/ore/iron(src)
|
||||
if (src.mineralName == "Gold")
|
||||
new /obj/item/weapon/ore/gold(src)
|
||||
if (src.mineralName == "Silver")
|
||||
new /obj/item/weapon/ore/silver(src)
|
||||
if (src.mineralName == "Plasma")
|
||||
new /obj/item/weapon/ore/plasma(src)
|
||||
if (src.mineralName == "Diamond")
|
||||
new /obj/item/weapon/ore/diamond(src)
|
||||
if (src.mineralName == "Clown")
|
||||
new /obj/item/weapon/ore/clown(src)
|
||||
if (src.mineralName == "Adamantine")
|
||||
new /obj/item/weapon/ore/adamantine(src)
|
||||
ReplaceWithFloor()
|
||||
return
|
||||
|
||||
/*
|
||||
/turf/simulated/mineral/proc/setRandomMinerals()
|
||||
var/s = pickweight(list("uranium" = 5, "iron" = 50, "gold" = 5, "silver" = 5, "plasma" = 50, "diamond" = 1))
|
||||
if (s)
|
||||
mineralName = s
|
||||
|
||||
var/N = text2path("/turf/simulated/mineral/[s]")
|
||||
if (N)
|
||||
var/turf/simulated/mineral/M = new N
|
||||
src = M
|
||||
if (src.mineralName)
|
||||
mineralAmt = 5
|
||||
return*/
|
||||
|
||||
|
||||
/**********************Asteroid**************************/
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid //floor piece
|
||||
name = "Asteroid"
|
||||
icon = 'floors.dmi'
|
||||
icon_state = "asteroid"
|
||||
oxygen = 0.01
|
||||
nitrogen = 0.01
|
||||
temperature = TCMB
|
||||
icon_plating = "asteroid"
|
||||
var/dug = 0 //0 = has not yet been dug, 1 = has already been dug
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/New()
|
||||
var/proper_name = name
|
||||
..()
|
||||
name = proper_name
|
||||
//if (prob(50))
|
||||
// seedName = pick(list("1","2","3","4"))
|
||||
// seedAmt = rand(1,4)
|
||||
if(prob(20))
|
||||
icon_state = "asteroid[rand(0,8)]"
|
||||
spawn(2)
|
||||
updateMineralOverlays()
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/ex_act(severity)
|
||||
return
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if(!W || !user)
|
||||
return 0
|
||||
|
||||
if ((istype(W, /obj/item/weapon/shovel)))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
|
||||
if (dug == 1)
|
||||
user << "\red This area has already been dug"
|
||||
return
|
||||
|
||||
user << "\red You start digging."
|
||||
playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better
|
||||
|
||||
sleep(40)
|
||||
if ((user.loc == T && user.equipped() == W))
|
||||
user << "\blue You dug a hole."
|
||||
gets_dug()
|
||||
dug = 1
|
||||
icon_plating = "asteroid_dug"
|
||||
icon_state = "asteroid_dug"
|
||||
else
|
||||
..(W,user)
|
||||
if ((istype(W,/obj/item/weapon/pickaxe/drill)))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
|
||||
if (dug == 1)
|
||||
user << "\red This area has already been dug"
|
||||
return
|
||||
|
||||
user << "\red You start digging."
|
||||
playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better
|
||||
|
||||
sleep(30)
|
||||
if ((user.loc == T && user.equipped() == W))
|
||||
user << "\blue You dug a hole."
|
||||
gets_dug()
|
||||
dug = 1
|
||||
icon_plating = "asteroid_dug"
|
||||
icon_state = "asteroid_dug"
|
||||
else
|
||||
..(W,user)
|
||||
|
||||
if ((istype(W,/obj/item/weapon/pickaxe/diamonddrill)))
|
||||
var/turf/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
|
||||
if (dug == 1)
|
||||
user << "\red This area has already been dug"
|
||||
return
|
||||
|
||||
user << "\red You start digging."
|
||||
playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better
|
||||
|
||||
sleep(0)
|
||||
if ((user.loc == T && user.equipped() == W))
|
||||
user << "\blue You dug a hole."
|
||||
gets_dug()
|
||||
dug = 1
|
||||
icon_plating = "asteroid_dug"
|
||||
icon_state = "asteroid_dug"
|
||||
else
|
||||
..(W,user)
|
||||
|
||||
return
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/proc/gets_dug()
|
||||
new/obj/item/weapon/ore/glass(src)
|
||||
new/obj/item/weapon/ore/glass(src)
|
||||
new/obj/item/weapon/ore/glass(src)
|
||||
new/obj/item/weapon/ore/glass(src)
|
||||
new/obj/item/weapon/ore/glass(src)
|
||||
return
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/proc/updateMineralOverlays()
|
||||
|
||||
src.overlays = null
|
||||
|
||||
if(istype(get_step(src, NORTH), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_n")
|
||||
if(istype(get_step(src, SOUTH), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_s", layer=6)
|
||||
if(istype(get_step(src, EAST), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_e", layer=6)
|
||||
if(istype(get_step(src, WEST), /turf/simulated/mineral))
|
||||
src.overlays += image('walls.dmi', "rock_side_w", layer=6)
|
||||
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/proc/fullUpdateMineralOverlays()
|
||||
var/turf/simulated/floor/plating/airless/asteroid/A
|
||||
if(istype(get_step(src, WEST), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, WEST)
|
||||
A.updateMineralOverlays()
|
||||
if(istype(get_step(src, EAST), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, EAST)
|
||||
A.updateMineralOverlays()
|
||||
if(istype(get_step(src, NORTH), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, NORTH)
|
||||
A.updateMineralOverlays()
|
||||
if(istype(get_step(src, NORTHWEST), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, NORTHWEST)
|
||||
A.updateMineralOverlays()
|
||||
if(istype(get_step(src, NORTHEAST), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, NORTHEAST)
|
||||
A.updateMineralOverlays()
|
||||
if(istype(get_step(src, SOUTHWEST), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, SOUTHWEST)
|
||||
A.updateMineralOverlays()
|
||||
if(istype(get_step(src, SOUTHEAST), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, SOUTHEAST)
|
||||
A.updateMineralOverlays()
|
||||
if(istype(get_step(src, SOUTH), /turf/simulated/floor/plating/airless/asteroid))
|
||||
A = get_step(src, SOUTH)
|
||||
A.updateMineralOverlays()
|
||||
src.updateMineralOverlays()
|
||||
+255
-255
@@ -1,256 +1,256 @@
|
||||
/**********************Mint**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint
|
||||
name = "Coin press"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "coinpress0"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/amt_silver = 0 //amount of silver
|
||||
var/amt_gold = 0 //amount of gold
|
||||
var/amt_diamond = 0
|
||||
var/amt_iron = 0
|
||||
var/amt_plasma = 0
|
||||
var/amt_uranium = 0
|
||||
var/amt_clown = 0
|
||||
var/amt_adamantine = 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
|
||||
var/coinsToProduce = 10
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/New()
|
||||
..()
|
||||
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/mint/process()
|
||||
if ( src.input)
|
||||
var/obj/item/stack/sheet/O
|
||||
O = locate(/obj/item/stack/sheet, input.loc)
|
||||
if(O)
|
||||
if (istype(O,/obj/item/stack/sheet/gold))
|
||||
amt_gold += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/silver))
|
||||
amt_silver += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/diamond))
|
||||
amt_diamond += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/plasma))
|
||||
amt_plasma += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/uranium))
|
||||
amt_uranium += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/metal))
|
||||
amt_iron += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/clown))
|
||||
amt_clown += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/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
|
||||
|
||||
var/dat = "<b>Coin Press</b><br>"
|
||||
|
||||
if (!input)
|
||||
dat += text("input connection status: ")
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b><br>")
|
||||
if (!output)
|
||||
dat += text("<br>output connection status: ")
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b><br>")
|
||||
|
||||
dat += text("<br><font color='#ffcc00'><b>Gold inserted: </b>[amt_gold]</font> ")
|
||||
if (chosen == "gold")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=gold'>Choose</A>")
|
||||
dat += text("<br><font color='#888888'><b>Silver inserted: </b>[amt_silver]</font> ")
|
||||
if (chosen == "silver")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=silver'>Choose</A>")
|
||||
dat += text("<br><font color='#555555'><b>Iron inserted: </b>[amt_iron]</font> ")
|
||||
if (chosen == "metal")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=metal'>Choose</A>")
|
||||
dat += text("<br><font color='#8888FF'><b>Diamond inserted: </b>[amt_diamond]</font> ")
|
||||
if (chosen == "diamond")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=diamond'>Choose</A>")
|
||||
dat += text("<br><font color='#FF8800'><b>Plasma inserted: </b>[amt_plasma]</font> ")
|
||||
if (chosen == "plasma")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=plasma'>Choose</A>")
|
||||
dat += text("<br><font color='#008800'><b>uranium inserted: </b>[amt_uranium]</font> ")
|
||||
if (chosen == "uranium")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=uranium'>Choose</A>")
|
||||
if(amt_clown > 0)
|
||||
dat += text("<br><font color='#AAAA00'><b>Bananium inserted: </b>[amt_clown]</font> ")
|
||||
if (chosen == "clown")
|
||||
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.")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=-10'>-10</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=-5'>-5</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=-1'>-1</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=1'>+1</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=5'>+5</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=10'>+10</A> ")
|
||||
|
||||
dat += text("<br><br>In total this machine produced <font color='green'><b>[newCoins]</b></font> coins.")
|
||||
dat += text("<br><A href='?src=\ref[src];makeCoins=[1]'>Make coins</A>")
|
||||
user << browse("[dat]", "window=mint")
|
||||
|
||||
/obj/machinery/mineral/mint/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(processing==1)
|
||||
usr << "\blue The machine is processing."
|
||||
return
|
||||
if(href_list["choose"])
|
||||
chosen = href_list["choose"]
|
||||
if(href_list["chooseAmt"])
|
||||
coinsToProduce = between(0, coinsToProduce + text2num(href_list["chooseAmt"]), 1000)
|
||||
if(href_list["makeCoins"])
|
||||
var/temp_coins = coinsToProduce
|
||||
if (src.output)
|
||||
processing = 1;
|
||||
icon_state = "coinpress1"
|
||||
var/obj/item/weapon/moneybag/M
|
||||
switch(chosen)
|
||||
if("metal")
|
||||
while(amt_iron > 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/iron(M)
|
||||
amt_iron -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("gold")
|
||||
while(amt_gold > 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/gold(M)
|
||||
amt_gold -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("silver")
|
||||
while(amt_silver > 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/silver(M)
|
||||
amt_silver -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("diamond")
|
||||
while(amt_diamond > 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/diamond(M)
|
||||
amt_diamond -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("plasma")
|
||||
while(amt_plasma > 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/plasma(M)
|
||||
amt_plasma -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("uranium")
|
||||
while(amt_uranium > 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/uranium(M)
|
||||
amt_uranium -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5)
|
||||
if("clown")
|
||||
while(amt_clown > 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/clown(M)
|
||||
amt_clown -= 20
|
||||
coinsToProduce--
|
||||
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);
|
||||
icon_state = "coinpress0"
|
||||
processing = 0;
|
||||
coinsToProduce = temp_coins
|
||||
src.updateUsrDialog()
|
||||
/**********************Mint**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint
|
||||
name = "Coin press"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "coinpress0"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/amt_silver = 0 //amount of silver
|
||||
var/amt_gold = 0 //amount of gold
|
||||
var/amt_diamond = 0
|
||||
var/amt_iron = 0
|
||||
var/amt_plasma = 0
|
||||
var/amt_uranium = 0
|
||||
var/amt_clown = 0
|
||||
var/amt_adamantine = 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
|
||||
var/coinsToProduce = 10
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/New()
|
||||
..()
|
||||
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/mint/process()
|
||||
if ( src.input)
|
||||
var/obj/item/stack/sheet/O
|
||||
O = locate(/obj/item/stack/sheet, input.loc)
|
||||
if(O)
|
||||
if (istype(O,/obj/item/stack/sheet/gold))
|
||||
amt_gold += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/silver))
|
||||
amt_silver += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/diamond))
|
||||
amt_diamond += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/plasma))
|
||||
amt_plasma += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/uranium))
|
||||
amt_uranium += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/metal))
|
||||
amt_iron += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/clown))
|
||||
amt_clown += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/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
|
||||
|
||||
var/dat = "<b>Coin Press</b><br>"
|
||||
|
||||
if (!input)
|
||||
dat += text("input connection status: ")
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b><br>")
|
||||
if (!output)
|
||||
dat += text("<br>output connection status: ")
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b><br>")
|
||||
|
||||
dat += text("<br><font color='#ffcc00'><b>Gold inserted: </b>[amt_gold]</font> ")
|
||||
if (chosen == "gold")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=gold'>Choose</A>")
|
||||
dat += text("<br><font color='#888888'><b>Silver inserted: </b>[amt_silver]</font> ")
|
||||
if (chosen == "silver")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=silver'>Choose</A>")
|
||||
dat += text("<br><font color='#555555'><b>Iron inserted: </b>[amt_iron]</font> ")
|
||||
if (chosen == "metal")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=metal'>Choose</A>")
|
||||
dat += text("<br><font color='#8888FF'><b>Diamond inserted: </b>[amt_diamond]</font> ")
|
||||
if (chosen == "diamond")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=diamond'>Choose</A>")
|
||||
dat += text("<br><font color='#FF8800'><b>Plasma inserted: </b>[amt_plasma]</font> ")
|
||||
if (chosen == "plasma")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=plasma'>Choose</A>")
|
||||
dat += text("<br><font color='#008800'><b>uranium inserted: </b>[amt_uranium]</font> ")
|
||||
if (chosen == "uranium")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=uranium'>Choose</A>")
|
||||
if(amt_clown > 0)
|
||||
dat += text("<br><font color='#AAAA00'><b>Bananium inserted: </b>[amt_clown]</font> ")
|
||||
if (chosen == "clown")
|
||||
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.")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=-10'>-10</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=-5'>-5</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=-1'>-1</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=1'>+1</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=5'>+5</A> ")
|
||||
dat += text("<A href='?src=\ref[src];chooseAmt=10'>+10</A> ")
|
||||
|
||||
dat += text("<br><br>In total this machine produced <font color='green'><b>[newCoins]</b></font> coins.")
|
||||
dat += text("<br><A href='?src=\ref[src];makeCoins=[1]'>Make coins</A>")
|
||||
user << browse("[dat]", "window=mint")
|
||||
|
||||
/obj/machinery/mineral/mint/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(processing==1)
|
||||
usr << "\blue The machine is processing."
|
||||
return
|
||||
if(href_list["choose"])
|
||||
chosen = href_list["choose"]
|
||||
if(href_list["chooseAmt"])
|
||||
coinsToProduce = between(0, coinsToProduce + text2num(href_list["chooseAmt"]), 1000)
|
||||
if(href_list["makeCoins"])
|
||||
var/temp_coins = coinsToProduce
|
||||
if (src.output)
|
||||
processing = 1;
|
||||
icon_state = "coinpress1"
|
||||
var/obj/item/weapon/moneybag/M
|
||||
switch(chosen)
|
||||
if("metal")
|
||||
while(amt_iron > 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/iron(M)
|
||||
amt_iron -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("gold")
|
||||
while(amt_gold > 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/gold(M)
|
||||
amt_gold -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("silver")
|
||||
while(amt_silver > 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/silver(M)
|
||||
amt_silver -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("diamond")
|
||||
while(amt_diamond > 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/diamond(M)
|
||||
amt_diamond -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("plasma")
|
||||
while(amt_plasma > 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/plasma(M)
|
||||
amt_plasma -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("uranium")
|
||||
while(amt_uranium > 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/uranium(M)
|
||||
amt_uranium -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5)
|
||||
if("clown")
|
||||
while(amt_clown > 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/clown(M)
|
||||
amt_clown -= 20
|
||||
coinsToProduce--
|
||||
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);
|
||||
icon_state = "coinpress0"
|
||||
processing = 0;
|
||||
coinsToProduce = temp_coins
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
+113
-113
@@ -1,114 +1,114 @@
|
||||
/*****************************Money bag********************************/
|
||||
|
||||
/obj/item/weapon/moneybag
|
||||
icon = 'storage.dmi'
|
||||
name = "Money bag"
|
||||
icon_state = "moneybag"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
force = 10.0
|
||||
throwforce = 2.0
|
||||
w_class = 4.0
|
||||
|
||||
/obj/item/weapon/moneybag/attack_hand(user as mob)
|
||||
var/amt_gold = 0
|
||||
var/amt_silver = 0
|
||||
var/amt_diamond = 0
|
||||
var/amt_iron = 0
|
||||
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))
|
||||
amt_diamond++;
|
||||
if (istype(C,/obj/item/weapon/coin/plasma))
|
||||
amt_plasma++;
|
||||
if (istype(C,/obj/item/weapon/coin/iron))
|
||||
amt_iron++;
|
||||
if (istype(C,/obj/item/weapon/coin/silver))
|
||||
amt_silver++;
|
||||
if (istype(C,/obj/item/weapon/coin/gold))
|
||||
amt_gold++;
|
||||
if (istype(C,/obj/item/weapon/coin/uranium))
|
||||
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)
|
||||
dat += text("Gold coins: [amt_gold] <A href='?src=\ref[src];remove=gold'>Remove one</A><br>")
|
||||
if (amt_silver)
|
||||
dat += text("Silver coins: [amt_silver] <A href='?src=\ref[src];remove=silver'>Remove one</A><br>")
|
||||
if (amt_iron)
|
||||
dat += text("Metal coins: [amt_iron] <A href='?src=\ref[src];remove=iron'>Remove one</A><br>")
|
||||
if (amt_diamond)
|
||||
dat += text("Diamond coins: [amt_diamond] <A href='?src=\ref[src];remove=diamond'>Remove one</A><br>")
|
||||
if (amt_plasma)
|
||||
dat += text("Plasma coins: [amt_plasma] <A href='?src=\ref[src];remove=plasma'>Remove one</A><br>")
|
||||
if (amt_uranium)
|
||||
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>")
|
||||
user << browse("[dat]", "window=moneybag")
|
||||
|
||||
/obj/item/weapon/moneybag/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/coin))
|
||||
var/obj/item/weapon/coin/C = W
|
||||
user << "\blue You add the [C.name] into the bag."
|
||||
usr.drop_item()
|
||||
contents += C
|
||||
if (istype(W, /obj/item/weapon/moneybag))
|
||||
var/obj/item/weapon/moneybag/C = W
|
||||
for (var/obj/O in C.contents)
|
||||
contents += O;
|
||||
user << "\blue You empty the [C.name] into the bag."
|
||||
return
|
||||
|
||||
/obj/item/weapon/moneybag/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["remove"])
|
||||
var/obj/item/weapon/coin/COIN
|
||||
switch(href_list["remove"])
|
||||
if("gold")
|
||||
COIN = locate(/obj/item/weapon/coin/gold,src.contents)
|
||||
if("silver")
|
||||
COIN = locate(/obj/item/weapon/coin/silver,src.contents)
|
||||
if("iron")
|
||||
COIN = locate(/obj/item/weapon/coin/iron,src.contents)
|
||||
if("diamond")
|
||||
COIN = locate(/obj/item/weapon/coin/diamond,src.contents)
|
||||
if("plasma")
|
||||
COIN = locate(/obj/item/weapon/coin/plasma,src.contents)
|
||||
if("uranium")
|
||||
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
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/moneybag/vault
|
||||
|
||||
/obj/item/weapon/moneybag/vault/New()
|
||||
..()
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
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)
|
||||
/*****************************Money bag********************************/
|
||||
|
||||
/obj/item/weapon/moneybag
|
||||
icon = 'storage.dmi'
|
||||
name = "Money bag"
|
||||
icon_state = "moneybag"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
force = 10.0
|
||||
throwforce = 2.0
|
||||
w_class = 4.0
|
||||
|
||||
/obj/item/weapon/moneybag/attack_hand(user as mob)
|
||||
var/amt_gold = 0
|
||||
var/amt_silver = 0
|
||||
var/amt_diamond = 0
|
||||
var/amt_iron = 0
|
||||
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))
|
||||
amt_diamond++;
|
||||
if (istype(C,/obj/item/weapon/coin/plasma))
|
||||
amt_plasma++;
|
||||
if (istype(C,/obj/item/weapon/coin/iron))
|
||||
amt_iron++;
|
||||
if (istype(C,/obj/item/weapon/coin/silver))
|
||||
amt_silver++;
|
||||
if (istype(C,/obj/item/weapon/coin/gold))
|
||||
amt_gold++;
|
||||
if (istype(C,/obj/item/weapon/coin/uranium))
|
||||
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)
|
||||
dat += text("Gold coins: [amt_gold] <A href='?src=\ref[src];remove=gold'>Remove one</A><br>")
|
||||
if (amt_silver)
|
||||
dat += text("Silver coins: [amt_silver] <A href='?src=\ref[src];remove=silver'>Remove one</A><br>")
|
||||
if (amt_iron)
|
||||
dat += text("Metal coins: [amt_iron] <A href='?src=\ref[src];remove=iron'>Remove one</A><br>")
|
||||
if (amt_diamond)
|
||||
dat += text("Diamond coins: [amt_diamond] <A href='?src=\ref[src];remove=diamond'>Remove one</A><br>")
|
||||
if (amt_plasma)
|
||||
dat += text("Plasma coins: [amt_plasma] <A href='?src=\ref[src];remove=plasma'>Remove one</A><br>")
|
||||
if (amt_uranium)
|
||||
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>")
|
||||
user << browse("[dat]", "window=moneybag")
|
||||
|
||||
/obj/item/weapon/moneybag/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/coin))
|
||||
var/obj/item/weapon/coin/C = W
|
||||
user << "\blue You add the [C.name] into the bag."
|
||||
usr.drop_item()
|
||||
contents += C
|
||||
if (istype(W, /obj/item/weapon/moneybag))
|
||||
var/obj/item/weapon/moneybag/C = W
|
||||
for (var/obj/O in C.contents)
|
||||
contents += O;
|
||||
user << "\blue You empty the [C.name] into the bag."
|
||||
return
|
||||
|
||||
/obj/item/weapon/moneybag/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["remove"])
|
||||
var/obj/item/weapon/coin/COIN
|
||||
switch(href_list["remove"])
|
||||
if("gold")
|
||||
COIN = locate(/obj/item/weapon/coin/gold,src.contents)
|
||||
if("silver")
|
||||
COIN = locate(/obj/item/weapon/coin/silver,src.contents)
|
||||
if("iron")
|
||||
COIN = locate(/obj/item/weapon/coin/iron,src.contents)
|
||||
if("diamond")
|
||||
COIN = locate(/obj/item/weapon/coin/diamond,src.contents)
|
||||
if("plasma")
|
||||
COIN = locate(/obj/item/weapon/coin/plasma,src.contents)
|
||||
if("uranium")
|
||||
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
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/moneybag/vault
|
||||
|
||||
/obj/item/weapon/moneybag/vault/New()
|
||||
..()
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
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)
|
||||
@@ -1,281 +1,281 @@
|
||||
/**********************Mineral ores**************************/
|
||||
|
||||
/obj/item/weapon/ore
|
||||
name = "Rock"
|
||||
icon = 'Mining.dmi'
|
||||
icon_state = "ore"
|
||||
|
||||
/obj/item/weapon/ore/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/satchel))
|
||||
var/obj/item/weapon/satchel/S = W
|
||||
if (S.mode == 1)
|
||||
for (var/obj/item/weapon/ore/O in locate(src.x,src.y,src.z))
|
||||
if (S.contents.len < S.capacity)
|
||||
S.contents += O;
|
||||
else
|
||||
user << "\blue The satchel is full."
|
||||
return
|
||||
user << "\blue You pick up all the ores."
|
||||
else
|
||||
if (S.contents.len < S.capacity)
|
||||
S.contents += src;
|
||||
else
|
||||
user << "\blue The satchel is full."
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/ore/uranium
|
||||
name = "Uranium ore"
|
||||
icon_state = "Uranium ore"
|
||||
origin_tech = "materials=5"
|
||||
|
||||
/obj/item/weapon/ore/iron
|
||||
name = "Iron ore"
|
||||
icon_state = "Iron ore"
|
||||
origin_tech = "materials=1"
|
||||
|
||||
/obj/item/weapon/ore/glass
|
||||
name = "Sand"
|
||||
icon_state = "Glass ore"
|
||||
origin_tech = "materials=1"
|
||||
|
||||
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/sandstone(location)
|
||||
del(sandToConvert)
|
||||
new /obj/item/stack/sheet/sandstone(location)
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/ore/plasma
|
||||
name = "Plasma ore"
|
||||
icon_state = "Plasma ore"
|
||||
origin_tech = "materials=2"
|
||||
|
||||
/obj/item/weapon/ore/silver
|
||||
name = "Silver ore"
|
||||
icon_state = "Silver ore"
|
||||
origin_tech = "materials=3"
|
||||
|
||||
/obj/item/weapon/ore/gold
|
||||
name = "Gold ore"
|
||||
icon_state = "Gold ore"
|
||||
origin_tech = "materials=4"
|
||||
|
||||
/obj/item/weapon/ore/diamond
|
||||
name = "Diamond ore"
|
||||
icon_state = "Diamond ore"
|
||||
origin_tech = "materials=6"
|
||||
|
||||
/obj/item/weapon/ore/clown
|
||||
name = "Bananium ore"
|
||||
icon_state = "Clown ore"
|
||||
origin_tech = "materials=4"
|
||||
|
||||
/obj/item/weapon/ore/adamantine
|
||||
name = "Adamantine ore"
|
||||
icon_state = "Adamantine ore"
|
||||
origin_tech = "materials=5"
|
||||
|
||||
/obj/item/weapon/ore/slag
|
||||
name = "Slag"
|
||||
desc = "Completely useless"
|
||||
icon_state = "slag"
|
||||
|
||||
/obj/item/weapon/ore/New()
|
||||
pixel_x = rand(0,16)-8
|
||||
pixel_y = rand(0,8)-8
|
||||
|
||||
|
||||
/*****************************Coin********************************/
|
||||
|
||||
/obj/item/weapon/coin
|
||||
icon = 'items.dmi'
|
||||
name = "Coin"
|
||||
icon_state = "coin"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
force = 0.0
|
||||
throwforce = 0.0
|
||||
w_class = 1.0
|
||||
var/string_attached
|
||||
|
||||
/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"
|
||||
|
||||
/obj/item/weapon/coin/silver
|
||||
name = "Silver coin"
|
||||
icon_state = "coin_silver"
|
||||
|
||||
/obj/item/weapon/coin/diamond
|
||||
name = "Diamond coin"
|
||||
icon_state = "coin_diamond"
|
||||
|
||||
/obj/item/weapon/coin/iron
|
||||
name = "Iron coin"
|
||||
icon_state = "coin_iron"
|
||||
|
||||
/obj/item/weapon/coin/plasma
|
||||
name = "Solid plasma coin"
|
||||
icon_state = "coin_plasma"
|
||||
|
||||
/obj/item/weapon/coin/uranium
|
||||
name = "Uranium coin"
|
||||
icon_state = "coin_uranium"
|
||||
|
||||
/obj/item/weapon/coin/clown
|
||||
name = "Bananaium coin"
|
||||
icon_state = "coin_clown"
|
||||
|
||||
/obj/item/weapon/coin/adamantine
|
||||
name = "Adamantine 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/weapon/cable_coil) )
|
||||
var/obj/item/weapon/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('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/weapon/cable_coil/CC = new/obj/item/weapon/cable_coil(user.loc)
|
||||
CC.amount = 1
|
||||
CC.updateicon()
|
||||
overlays = list()
|
||||
string_attached = null
|
||||
user << "\blue You detach the string from the coin."
|
||||
else ..()
|
||||
|
||||
/******************************Materials****************************/
|
||||
|
||||
/obj/item/stack/sheet/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
|
||||
|
||||
/obj/item/stack/sheet/gold/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
/* recipes = gold_recipes //Commenting out until there's a proper sprite. The golden plaque is supposed to be a special item dedicated to a really good player. -Agouri
|
||||
|
||||
var/global/list/datum/stack_recipe/gold_recipes = list ( \
|
||||
new/datum/stack_recipe("Plaque", /obj/item/weapon/plaque_assembly, 2), \
|
||||
)*/
|
||||
|
||||
|
||||
/obj/item/stack/sheet/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
|
||||
|
||||
/obj/item/stack/sheet/silver/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
|
||||
/obj/item/stack/sheet/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
|
||||
|
||||
/obj/item/stack/sheet/diamond/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
|
||||
/obj/item/stack/sheet/uranium
|
||||
name = "Uranium block"
|
||||
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
|
||||
|
||||
/obj/item/stack/sheet/enruranium
|
||||
name = "Enriched Uranium block"
|
||||
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
|
||||
|
||||
/obj/item/stack/sheet/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
|
||||
|
||||
/obj/item/stack/sheet/adamantine
|
||||
name = "adamantine"
|
||||
icon_state = "sheet-adamantine"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=4"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/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
|
||||
|
||||
/obj/item/stack/sheet/clown/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
/**********************Mineral ores**************************/
|
||||
|
||||
/obj/item/weapon/ore
|
||||
name = "Rock"
|
||||
icon = 'Mining.dmi'
|
||||
icon_state = "ore"
|
||||
|
||||
/obj/item/weapon/ore/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/satchel))
|
||||
var/obj/item/weapon/satchel/S = W
|
||||
if (S.mode == 1)
|
||||
for (var/obj/item/weapon/ore/O in locate(src.x,src.y,src.z))
|
||||
if (S.contents.len < S.capacity)
|
||||
S.contents += O;
|
||||
else
|
||||
user << "\blue The satchel is full."
|
||||
return
|
||||
user << "\blue You pick up all the ores."
|
||||
else
|
||||
if (S.contents.len < S.capacity)
|
||||
S.contents += src;
|
||||
else
|
||||
user << "\blue The satchel is full."
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/ore/uranium
|
||||
name = "Uranium ore"
|
||||
icon_state = "Uranium ore"
|
||||
origin_tech = "materials=5"
|
||||
|
||||
/obj/item/weapon/ore/iron
|
||||
name = "Iron ore"
|
||||
icon_state = "Iron ore"
|
||||
origin_tech = "materials=1"
|
||||
|
||||
/obj/item/weapon/ore/glass
|
||||
name = "Sand"
|
||||
icon_state = "Glass ore"
|
||||
origin_tech = "materials=1"
|
||||
|
||||
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/sandstone(location)
|
||||
del(sandToConvert)
|
||||
new /obj/item/stack/sheet/sandstone(location)
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/ore/plasma
|
||||
name = "Plasma ore"
|
||||
icon_state = "Plasma ore"
|
||||
origin_tech = "materials=2"
|
||||
|
||||
/obj/item/weapon/ore/silver
|
||||
name = "Silver ore"
|
||||
icon_state = "Silver ore"
|
||||
origin_tech = "materials=3"
|
||||
|
||||
/obj/item/weapon/ore/gold
|
||||
name = "Gold ore"
|
||||
icon_state = "Gold ore"
|
||||
origin_tech = "materials=4"
|
||||
|
||||
/obj/item/weapon/ore/diamond
|
||||
name = "Diamond ore"
|
||||
icon_state = "Diamond ore"
|
||||
origin_tech = "materials=6"
|
||||
|
||||
/obj/item/weapon/ore/clown
|
||||
name = "Bananium ore"
|
||||
icon_state = "Clown ore"
|
||||
origin_tech = "materials=4"
|
||||
|
||||
/obj/item/weapon/ore/adamantine
|
||||
name = "Adamantine ore"
|
||||
icon_state = "Adamantine ore"
|
||||
origin_tech = "materials=5"
|
||||
|
||||
/obj/item/weapon/ore/slag
|
||||
name = "Slag"
|
||||
desc = "Completely useless"
|
||||
icon_state = "slag"
|
||||
|
||||
/obj/item/weapon/ore/New()
|
||||
pixel_x = rand(0,16)-8
|
||||
pixel_y = rand(0,8)-8
|
||||
|
||||
|
||||
/*****************************Coin********************************/
|
||||
|
||||
/obj/item/weapon/coin
|
||||
icon = 'items.dmi'
|
||||
name = "Coin"
|
||||
icon_state = "coin"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
force = 0.0
|
||||
throwforce = 0.0
|
||||
w_class = 1.0
|
||||
var/string_attached
|
||||
|
||||
/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"
|
||||
|
||||
/obj/item/weapon/coin/silver
|
||||
name = "Silver coin"
|
||||
icon_state = "coin_silver"
|
||||
|
||||
/obj/item/weapon/coin/diamond
|
||||
name = "Diamond coin"
|
||||
icon_state = "coin_diamond"
|
||||
|
||||
/obj/item/weapon/coin/iron
|
||||
name = "Iron coin"
|
||||
icon_state = "coin_iron"
|
||||
|
||||
/obj/item/weapon/coin/plasma
|
||||
name = "Solid plasma coin"
|
||||
icon_state = "coin_plasma"
|
||||
|
||||
/obj/item/weapon/coin/uranium
|
||||
name = "Uranium coin"
|
||||
icon_state = "coin_uranium"
|
||||
|
||||
/obj/item/weapon/coin/clown
|
||||
name = "Bananaium coin"
|
||||
icon_state = "coin_clown"
|
||||
|
||||
/obj/item/weapon/coin/adamantine
|
||||
name = "Adamantine 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/weapon/cable_coil) )
|
||||
var/obj/item/weapon/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('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/weapon/cable_coil/CC = new/obj/item/weapon/cable_coil(user.loc)
|
||||
CC.amount = 1
|
||||
CC.updateicon()
|
||||
overlays = list()
|
||||
string_attached = null
|
||||
user << "\blue You detach the string from the coin."
|
||||
else ..()
|
||||
|
||||
/******************************Materials****************************/
|
||||
|
||||
/obj/item/stack/sheet/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
|
||||
|
||||
/obj/item/stack/sheet/gold/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
/* recipes = gold_recipes //Commenting out until there's a proper sprite. The golden plaque is supposed to be a special item dedicated to a really good player. -Agouri
|
||||
|
||||
var/global/list/datum/stack_recipe/gold_recipes = list ( \
|
||||
new/datum/stack_recipe("Plaque", /obj/item/weapon/plaque_assembly, 2), \
|
||||
)*/
|
||||
|
||||
|
||||
/obj/item/stack/sheet/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
|
||||
|
||||
/obj/item/stack/sheet/silver/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
|
||||
/obj/item/stack/sheet/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
|
||||
|
||||
/obj/item/stack/sheet/diamond/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
|
||||
/obj/item/stack/sheet/uranium
|
||||
name = "Uranium block"
|
||||
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
|
||||
|
||||
/obj/item/stack/sheet/enruranium
|
||||
name = "Enriched Uranium block"
|
||||
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
|
||||
|
||||
/obj/item/stack/sheet/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
|
||||
|
||||
/obj/item/stack/sheet/adamantine
|
||||
name = "adamantine"
|
||||
icon_state = "sheet-adamantine"
|
||||
force = 5.0
|
||||
throwforce = 5
|
||||
w_class = 3.0
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
origin_tech = "materials=4"
|
||||
perunit = 2000
|
||||
|
||||
/obj/item/stack/sheet/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
|
||||
|
||||
/obj/item/stack/sheet/clown/New(loc,amount)
|
||||
..()
|
||||
pixel_x = rand(0,4)-4
|
||||
pixel_y = rand(0,4)-4
|
||||
@@ -1,121 +1,121 @@
|
||||
/**********************Satchel**************************/
|
||||
|
||||
/obj/item/weapon/satchel
|
||||
icon = 'mining.dmi'
|
||||
icon_state = "satchel"
|
||||
name = "Mining Satchel"
|
||||
var/mode = 1; //0 = pick one at a time, 1 = pick all on tile
|
||||
var/capacity = 50; //the number of ore pieces it can carry.
|
||||
flags = FPRINT | TABLEPASS | ONBELT
|
||||
w_class = 1
|
||||
|
||||
/obj/item/weapon/satchel/attack_self(mob/user as mob)
|
||||
for (var/obj/item/weapon/ore/O in contents)
|
||||
contents -= O
|
||||
O.loc = user.loc
|
||||
user << "\blue You empty the satchel."
|
||||
return
|
||||
|
||||
/obj/item/weapon/satchel/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/ore))
|
||||
var/obj/item/weapon/ore/O = W
|
||||
src.contents += O;
|
||||
return
|
||||
|
||||
/obj/item/weapon/satchel/verb/toggle_mode()
|
||||
set name = "Switch Satchel Method"
|
||||
set category = "Object"
|
||||
|
||||
mode = !mode
|
||||
switch (mode)
|
||||
if(1)
|
||||
usr << "The satchel now picks up all ore in a tile at once."
|
||||
if(0)
|
||||
usr << "The satchel now picks up one ore at a time."
|
||||
|
||||
|
||||
/**********************Ore box**************************/
|
||||
|
||||
/obj/structure/ore_box
|
||||
icon = 'mining.dmi'
|
||||
icon_state = "orebox"
|
||||
name = "Ore Box"
|
||||
desc = "It's heavy"
|
||||
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/satchel))
|
||||
src.contents += W.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
|
||||
var/amt_glass = 0
|
||||
var/amt_iron = 0
|
||||
var/amt_plasma = 0
|
||||
var/amt_uranium = 0
|
||||
var/amt_clown = 0
|
||||
var/amt_adamantine = 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/adamantine))
|
||||
amt_adamantine++;
|
||||
|
||||
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_adamantine)
|
||||
dat += text("Adamantine ore: [amt_adamantine]<br>")
|
||||
|
||||
dat += text("<br><br><A href='?src=\ref[src];removeall=1'>Empty box</A>")
|
||||
user << browse("[dat]", "window=orebox")
|
||||
return
|
||||
|
||||
/obj/structure/ore_box/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.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()
|
||||
/**********************Satchel**************************/
|
||||
|
||||
/obj/item/weapon/satchel
|
||||
icon = 'mining.dmi'
|
||||
icon_state = "satchel"
|
||||
name = "Mining Satchel"
|
||||
var/mode = 1; //0 = pick one at a time, 1 = pick all on tile
|
||||
var/capacity = 50; //the number of ore pieces it can carry.
|
||||
flags = FPRINT | TABLEPASS | ONBELT
|
||||
w_class = 1
|
||||
|
||||
/obj/item/weapon/satchel/attack_self(mob/user as mob)
|
||||
for (var/obj/item/weapon/ore/O in contents)
|
||||
contents -= O
|
||||
O.loc = user.loc
|
||||
user << "\blue You empty the satchel."
|
||||
return
|
||||
|
||||
/obj/item/weapon/satchel/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/ore))
|
||||
var/obj/item/weapon/ore/O = W
|
||||
src.contents += O;
|
||||
return
|
||||
|
||||
/obj/item/weapon/satchel/verb/toggle_mode()
|
||||
set name = "Switch Satchel Method"
|
||||
set category = "Object"
|
||||
|
||||
mode = !mode
|
||||
switch (mode)
|
||||
if(1)
|
||||
usr << "The satchel now picks up all ore in a tile at once."
|
||||
if(0)
|
||||
usr << "The satchel now picks up one ore at a time."
|
||||
|
||||
|
||||
/**********************Ore box**************************/
|
||||
|
||||
/obj/structure/ore_box
|
||||
icon = 'mining.dmi'
|
||||
icon_state = "orebox"
|
||||
name = "Ore Box"
|
||||
desc = "It's heavy"
|
||||
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/satchel))
|
||||
src.contents += W.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
|
||||
var/amt_glass = 0
|
||||
var/amt_iron = 0
|
||||
var/amt_plasma = 0
|
||||
var/amt_uranium = 0
|
||||
var/amt_clown = 0
|
||||
var/amt_adamantine = 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/adamantine))
|
||||
amt_adamantine++;
|
||||
|
||||
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_adamantine)
|
||||
dat += text("Adamantine ore: [amt_adamantine]<br>")
|
||||
|
||||
dat += text("<br><br><A href='?src=\ref[src];removeall=1'>Empty box</A>")
|
||||
user << browse("[dat]", "window=orebox")
|
||||
return
|
||||
|
||||
/obj/structure/ore_box/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.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()
|
||||
return
|
||||
+152
-152
@@ -1,153 +1,153 @@
|
||||
/mob/living/verb/succumb()
|
||||
set hidden = 1
|
||||
if ((src.health < 0 && src.health > -95.0))
|
||||
src.adjustOxyLoss(src.health + 200)
|
||||
src.health = 100 - src.getOxyLoss() - src.getToxLoss() - src.getFireLoss() - src.getBruteLoss()
|
||||
src << "\blue You have given up life and succumbed to death."
|
||||
|
||||
|
||||
/mob/living/proc/updatehealth()
|
||||
if(!src.nodamage)
|
||||
src.health = 100 - src.getOxyLoss() - src.getToxLoss() - src.getFireLoss() - src.getBruteLoss() - src.getCloneLoss()
|
||||
else
|
||||
src.health = 100
|
||||
src.stat = 0
|
||||
|
||||
|
||||
//sort of a legacy burn method for /electrocute, /shock, and the e_chair
|
||||
/mob/living/proc/burn_skin(burn_amount)
|
||||
if(istype(src, /mob/living/carbon/human))
|
||||
//world << "DEBUG: burn_skin(), mutations=[mutations]"
|
||||
if (src.mutations & COLD_RESISTANCE) //fireproof
|
||||
return 0
|
||||
var/mob/living/carbon/human/H = src //make this damage method divide the damage to be done among all the body parts, then burn each body part for that much damage. will have better effect then just randomly picking a body part
|
||||
var/divided_damage = (burn_amount)/(H.organs.len)
|
||||
var/extradam = 0 //added to when organ is at max dam
|
||||
for(var/datum/organ/external/affecting in H.organs)
|
||||
if(!affecting) continue
|
||||
if(affecting.take_damage(0, divided_damage+extradam))
|
||||
extradam = 0
|
||||
else
|
||||
extradam += divided_damage
|
||||
H.UpdateDamageIcon()
|
||||
H.updatehealth()
|
||||
return 1
|
||||
else if(istype(src, /mob/living/carbon/monkey))
|
||||
if (src.mutations & COLD_RESISTANCE) //fireproof
|
||||
return 0
|
||||
var/mob/living/carbon/monkey/M = src
|
||||
M.adjustFireLoss(burn_amount)
|
||||
M.updatehealth()
|
||||
return 1
|
||||
else if(istype(src, /mob/living/silicon/ai))
|
||||
return 0
|
||||
|
||||
/mob/living/proc/adjustBodyTemp(actual, desired, incrementboost)
|
||||
var/temperature = actual
|
||||
var/difference = abs(actual-desired) //get difference
|
||||
var/increments = difference/10 //find how many increments apart they are
|
||||
var/change = increments*incrementboost // Get the amount to change by (x per increment)
|
||||
|
||||
// Too cold
|
||||
if(actual < desired)
|
||||
temperature += change
|
||||
if(actual > desired)
|
||||
temperature = desired
|
||||
// Too hot
|
||||
if(actual > desired)
|
||||
temperature -= change
|
||||
if(actual < desired)
|
||||
temperature = desired
|
||||
// if(istype(src, /mob/living/carbon/human))
|
||||
// world << "[src] ~ [src.bodytemperature] ~ [temperature]"
|
||||
return temperature
|
||||
|
||||
/mob/proc/get_contents()
|
||||
|
||||
/mob/living/get_contents()
|
||||
var/list/L = list()
|
||||
L += src.contents
|
||||
for(var/obj/item/weapon/storage/S in src.contents)
|
||||
L += S.return_inv()
|
||||
for(var/obj/item/weapon/gift/G in src.contents)
|
||||
L += G.gift
|
||||
if (istype(G.gift, /obj/item/weapon/storage))
|
||||
L += G.gift:return_inv()
|
||||
return L
|
||||
|
||||
/mob/living/proc/check_contents_for(A)
|
||||
var/list/L = list()
|
||||
L += src.contents
|
||||
for(var/obj/item/weapon/storage/S in src.contents)
|
||||
L += S.return_inv()
|
||||
for(var/obj/item/weapon/gift/G in src.contents)
|
||||
L += G.gift
|
||||
if (istype(G.gift, /obj/item/weapon/storage))
|
||||
L += G.gift:return_inv()
|
||||
|
||||
for(var/obj/B in L)
|
||||
if(B.type == A)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/mob/living/proc/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0)
|
||||
return 0 //only carbon liveforms have this proc
|
||||
|
||||
/mob/living/emp_act(severity)
|
||||
var/list/L = src.get_contents()
|
||||
for(var/obj/O in L)
|
||||
O.emp_act(severity)
|
||||
..()
|
||||
|
||||
/mob/living/proc/get_organ_target()
|
||||
var/mob/shooter = src
|
||||
var/t = shooter:zone_sel.selecting
|
||||
if ((t in list( "eyes", "mouth" )))
|
||||
t = "head"
|
||||
var/datum/organ/external/def_zone = ran_zone(t)
|
||||
return def_zone
|
||||
|
||||
|
||||
// heal ONE external organ, organ gets randomly selected from damaged ones.
|
||||
/mob/living/proc/heal_organ_damage(var/brute, var/burn)
|
||||
adjustBruteLoss(-brute)
|
||||
adjustFireLoss(-burn)
|
||||
src.updatehealth()
|
||||
|
||||
// damage ONE external organ, organ gets randomly selected from damaged ones.
|
||||
/mob/living/proc/take_organ_damage(var/brute, var/burn)
|
||||
adjustBruteLoss(brute)
|
||||
adjustFireLoss(burn)
|
||||
src.updatehealth()
|
||||
|
||||
// heal MANY external organs, in random order
|
||||
/mob/living/proc/heal_overall_damage(var/brute, var/burn)
|
||||
adjustBruteLoss(-brute)
|
||||
adjustFireLoss(-burn)
|
||||
src.updatehealth()
|
||||
|
||||
// damage MANY external organs, in random order
|
||||
/mob/living/proc/take_overall_damage(var/brute, var/burn)
|
||||
adjustBruteLoss(brute)
|
||||
adjustFireLoss(burn)
|
||||
src.updatehealth()
|
||||
|
||||
/mob/living/proc/revive()
|
||||
//src.fireloss = 0
|
||||
src.setToxLoss(0)
|
||||
//src.bruteloss = 0
|
||||
src.setOxyLoss(0)
|
||||
SetParalysis(0)
|
||||
SetStunned(0)
|
||||
SetWeakened(0)
|
||||
//src.health = 100
|
||||
src.heal_overall_damage(1000, 1000)
|
||||
src.buckled = initial(src.buckled)
|
||||
src.handcuffed = initial(src.handcuffed)
|
||||
if(src.stat > 1) src.stat = CONSCIOUS
|
||||
..()
|
||||
return
|
||||
|
||||
/mob/living/proc/UpdateDamageIcon()
|
||||
/mob/living/verb/succumb()
|
||||
set hidden = 1
|
||||
if ((src.health < 0 && src.health > -95.0))
|
||||
src.adjustOxyLoss(src.health + 200)
|
||||
src.health = 100 - src.getOxyLoss() - src.getToxLoss() - src.getFireLoss() - src.getBruteLoss()
|
||||
src << "\blue You have given up life and succumbed to death."
|
||||
|
||||
|
||||
/mob/living/proc/updatehealth()
|
||||
if(!src.nodamage)
|
||||
src.health = 100 - src.getOxyLoss() - src.getToxLoss() - src.getFireLoss() - src.getBruteLoss() - src.getCloneLoss()
|
||||
else
|
||||
src.health = 100
|
||||
src.stat = 0
|
||||
|
||||
|
||||
//sort of a legacy burn method for /electrocute, /shock, and the e_chair
|
||||
/mob/living/proc/burn_skin(burn_amount)
|
||||
if(istype(src, /mob/living/carbon/human))
|
||||
//world << "DEBUG: burn_skin(), mutations=[mutations]"
|
||||
if (src.mutations & COLD_RESISTANCE) //fireproof
|
||||
return 0
|
||||
var/mob/living/carbon/human/H = src //make this damage method divide the damage to be done among all the body parts, then burn each body part for that much damage. will have better effect then just randomly picking a body part
|
||||
var/divided_damage = (burn_amount)/(H.organs.len)
|
||||
var/extradam = 0 //added to when organ is at max dam
|
||||
for(var/datum/organ/external/affecting in H.organs)
|
||||
if(!affecting) continue
|
||||
if(affecting.take_damage(0, divided_damage+extradam))
|
||||
extradam = 0
|
||||
else
|
||||
extradam += divided_damage
|
||||
H.UpdateDamageIcon()
|
||||
H.updatehealth()
|
||||
return 1
|
||||
else if(istype(src, /mob/living/carbon/monkey))
|
||||
if (src.mutations & COLD_RESISTANCE) //fireproof
|
||||
return 0
|
||||
var/mob/living/carbon/monkey/M = src
|
||||
M.adjustFireLoss(burn_amount)
|
||||
M.updatehealth()
|
||||
return 1
|
||||
else if(istype(src, /mob/living/silicon/ai))
|
||||
return 0
|
||||
|
||||
/mob/living/proc/adjustBodyTemp(actual, desired, incrementboost)
|
||||
var/temperature = actual
|
||||
var/difference = abs(actual-desired) //get difference
|
||||
var/increments = difference/10 //find how many increments apart they are
|
||||
var/change = increments*incrementboost // Get the amount to change by (x per increment)
|
||||
|
||||
// Too cold
|
||||
if(actual < desired)
|
||||
temperature += change
|
||||
if(actual > desired)
|
||||
temperature = desired
|
||||
// Too hot
|
||||
if(actual > desired)
|
||||
temperature -= change
|
||||
if(actual < desired)
|
||||
temperature = desired
|
||||
// if(istype(src, /mob/living/carbon/human))
|
||||
// world << "[src] ~ [src.bodytemperature] ~ [temperature]"
|
||||
return temperature
|
||||
|
||||
/mob/proc/get_contents()
|
||||
|
||||
/mob/living/get_contents()
|
||||
var/list/L = list()
|
||||
L += src.contents
|
||||
for(var/obj/item/weapon/storage/S in src.contents)
|
||||
L += S.return_inv()
|
||||
for(var/obj/item/weapon/gift/G in src.contents)
|
||||
L += G.gift
|
||||
if (istype(G.gift, /obj/item/weapon/storage))
|
||||
L += G.gift:return_inv()
|
||||
return L
|
||||
|
||||
/mob/living/proc/check_contents_for(A)
|
||||
var/list/L = list()
|
||||
L += src.contents
|
||||
for(var/obj/item/weapon/storage/S in src.contents)
|
||||
L += S.return_inv()
|
||||
for(var/obj/item/weapon/gift/G in src.contents)
|
||||
L += G.gift
|
||||
if (istype(G.gift, /obj/item/weapon/storage))
|
||||
L += G.gift:return_inv()
|
||||
|
||||
for(var/obj/B in L)
|
||||
if(B.type == A)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/mob/living/proc/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0)
|
||||
return 0 //only carbon liveforms have this proc
|
||||
|
||||
/mob/living/emp_act(severity)
|
||||
var/list/L = src.get_contents()
|
||||
for(var/obj/O in L)
|
||||
O.emp_act(severity)
|
||||
..()
|
||||
|
||||
/mob/living/proc/get_organ_target()
|
||||
var/mob/shooter = src
|
||||
var/t = shooter:zone_sel.selecting
|
||||
if ((t in list( "eyes", "mouth" )))
|
||||
t = "head"
|
||||
var/datum/organ/external/def_zone = ran_zone(t)
|
||||
return def_zone
|
||||
|
||||
|
||||
// heal ONE external organ, organ gets randomly selected from damaged ones.
|
||||
/mob/living/proc/heal_organ_damage(var/brute, var/burn)
|
||||
adjustBruteLoss(-brute)
|
||||
adjustFireLoss(-burn)
|
||||
src.updatehealth()
|
||||
|
||||
// damage ONE external organ, organ gets randomly selected from damaged ones.
|
||||
/mob/living/proc/take_organ_damage(var/brute, var/burn)
|
||||
adjustBruteLoss(brute)
|
||||
adjustFireLoss(burn)
|
||||
src.updatehealth()
|
||||
|
||||
// heal MANY external organs, in random order
|
||||
/mob/living/proc/heal_overall_damage(var/brute, var/burn)
|
||||
adjustBruteLoss(-brute)
|
||||
adjustFireLoss(-burn)
|
||||
src.updatehealth()
|
||||
|
||||
// damage MANY external organs, in random order
|
||||
/mob/living/proc/take_overall_damage(var/brute, var/burn)
|
||||
adjustBruteLoss(brute)
|
||||
adjustFireLoss(burn)
|
||||
src.updatehealth()
|
||||
|
||||
/mob/living/proc/revive()
|
||||
//src.fireloss = 0
|
||||
src.setToxLoss(0)
|
||||
//src.bruteloss = 0
|
||||
src.setOxyLoss(0)
|
||||
SetParalysis(0)
|
||||
SetStunned(0)
|
||||
SetWeakened(0)
|
||||
//src.health = 100
|
||||
src.heal_overall_damage(1000, 1000)
|
||||
src.buckled = initial(src.buckled)
|
||||
src.handcuffed = initial(src.handcuffed)
|
||||
if(src.stat > 1) src.stat = CONSCIOUS
|
||||
..()
|
||||
return
|
||||
|
||||
/mob/living/proc/UpdateDamageIcon()
|
||||
return
|
||||
@@ -364,4 +364,11 @@
|
||||
step(AM, t)
|
||||
now_pushing = null
|
||||
return
|
||||
return
|
||||
return
|
||||
//PC stuff-Sieve
|
||||
|
||||
/mob/living/simple_animal/corgi/proc/mind_initialize(mob/G)
|
||||
mind = new
|
||||
mind.current = src
|
||||
mind.assigned_role = "Corgi"
|
||||
mind.key = G.key
|
||||
|
||||
@@ -296,6 +296,30 @@
|
||||
|
||||
new_metroid.a_intent = "hurt"
|
||||
new_metroid << "<B>You are now a baby Metroid.</B>"
|
||||
spawn(0)//To prevent the proc from returning null.
|
||||
del(src)
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/proc/corgize()
|
||||
if (monkeyizing)
|
||||
return
|
||||
for(var/obj/item/W in src)
|
||||
drop_from_slot(W)
|
||||
update_clothing()
|
||||
monkeyizing = 1
|
||||
canmove = 0
|
||||
icon = null
|
||||
invisibility = 101
|
||||
for(var/t in organs)
|
||||
del(t)
|
||||
|
||||
var/mob/living/simple_animal/corgi/new_corgi = new /mob/living/simple_animal/corgi (loc)
|
||||
|
||||
new_corgi.mind_initialize(src)
|
||||
new_corgi.key = key
|
||||
|
||||
new_corgi.a_intent = "hurt"
|
||||
new_corgi << "<B>You are now a Corgi!.</B>"
|
||||
spawn(0)//To prevent the proc from returning null.
|
||||
del(src)
|
||||
return
|
||||
+1217
-1217
File diff suppressed because it is too large
Load Diff
@@ -1,40 +1,40 @@
|
||||
/turf/simulated/floor/engine/attack_paw(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/turf/simulated/floor/engine/attack_hand(var/mob/user as mob)
|
||||
if ((!( user.canmove ) || user.restrained() || !( user.pulling )))
|
||||
return
|
||||
if (user.pulling.anchored)
|
||||
return
|
||||
if ((user.pulling.loc != user.loc && get_dist(user, user.pulling) > 1))
|
||||
return
|
||||
if (ismob(user.pulling))
|
||||
var/mob/M = user.pulling
|
||||
var/mob/t = M.pulling
|
||||
M.pulling = null
|
||||
step(user.pulling, get_dir(user.pulling.loc, src))
|
||||
M.pulling = t
|
||||
else
|
||||
step(user.pulling, get_dir(user.pulling.loc, src))
|
||||
return
|
||||
|
||||
/turf/simulated/floor/engine/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
ReplaceWithSpace()
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
ReplaceWithSpace()
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/turf/simulated/floor/engine/blob_act()
|
||||
if (prob(25))
|
||||
ReplaceWithSpace()
|
||||
del(src)
|
||||
return
|
||||
/turf/simulated/floor/engine/attack_paw(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/turf/simulated/floor/engine/attack_hand(var/mob/user as mob)
|
||||
if ((!( user.canmove ) || user.restrained() || !( user.pulling )))
|
||||
return
|
||||
if (user.pulling.anchored)
|
||||
return
|
||||
if ((user.pulling.loc != user.loc && get_dist(user, user.pulling) > 1))
|
||||
return
|
||||
if (ismob(user.pulling))
|
||||
var/mob/M = user.pulling
|
||||
var/mob/t = M.pulling
|
||||
M.pulling = null
|
||||
step(user.pulling, get_dir(user.pulling.loc, src))
|
||||
M.pulling = t
|
||||
else
|
||||
step(user.pulling, get_dir(user.pulling.loc, src))
|
||||
return
|
||||
|
||||
/turf/simulated/floor/engine/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
ReplaceWithSpace()
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
ReplaceWithSpace()
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/turf/simulated/floor/engine/blob_act()
|
||||
if (prob(25))
|
||||
ReplaceWithSpace()
|
||||
del(src)
|
||||
return
|
||||
return
|
||||
@@ -788,6 +788,14 @@ datum
|
||||
req_tech = list("materials" = 3, "biotech"=4, "magnets"=4, "programming"=3)
|
||||
build_path = "/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun"
|
||||
|
||||
mech_diamond_drill
|
||||
name = "Exosuit Module Design (Diamond Mining Drill)"
|
||||
desc = "An upgraded version of the standard drill"
|
||||
id = "mech_diamond_drill"
|
||||
build_type = MECHFAB
|
||||
req_tech = list("materials" = 4, "engineering" = 3)
|
||||
build_path = "/obj/item/mecha_parts/mecha_equipment/tool/drill/diamonddrill"
|
||||
|
||||
|
||||
////////////////////////////////////////
|
||||
//////////Disk Construction Disks///////
|
||||
@@ -1055,7 +1063,7 @@ datum
|
||||
name = "Hyper-Capacity Power Cell"
|
||||
desc = "A power cell that holds 30000 units of energy"
|
||||
id = "hyper_cell"
|
||||
req_tech = list("powerstorage" = 6, "materials" = 4)
|
||||
req_tech = list("powerstorage" = 5, "materials" = 4)
|
||||
reliability_base = 70
|
||||
build_type = PROTOLATHE
|
||||
materials = list("$metal" = 400, "$gold" = 150, "$silver" = 150, "$glass" = 70)
|
||||
|
||||
+462
-462
@@ -1,463 +1,463 @@
|
||||
/obj/machinery/sec_lock//P'sure this was part of the tunnel
|
||||
name = "Security Pad"
|
||||
desc = "A lock, for doors. Used by security."
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "sec_lock"
|
||||
var/obj/item/weapon/card/id/scan = null
|
||||
var/a_type = 0.0
|
||||
var/obj/machinery/door/d1 = null
|
||||
var/obj/machinery/door/d2 = null
|
||||
anchored = 1.0
|
||||
req_access = list(access_brig)
|
||||
use_power = 1
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 4
|
||||
|
||||
/obj/move/airtunnel/process()
|
||||
if (!( src.deployed ))
|
||||
return null
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/connector/create()
|
||||
src.current = src
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
spawn( 0 )
|
||||
src.next.create(airtunnel_start - airtunnel_stop, src.y)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/connector/wall/create()
|
||||
src.current = src
|
||||
src.next = new /obj/move/airtunnel/wall( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
spawn( 0 )
|
||||
src.next.create(airtunnel_start - airtunnel_stop, src.y)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/connector/wall/process()
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/wall/create(num, y_coord)
|
||||
if (((num < 7 || (num > 16 && num < 23)) && y_coord == airtunnel_bottom))
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
else
|
||||
src.next = new /obj/move/airtunnel/wall( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
if (num > 1)
|
||||
spawn( 0 )
|
||||
src.next.create(num - 1, y_coord)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/wall/move_right()
|
||||
flick("wall-m", src)
|
||||
return ..()
|
||||
|
||||
/obj/move/airtunnel/wall/move_left()
|
||||
flick("wall-m", src)
|
||||
return ..()
|
||||
|
||||
/obj/move/airtunnel/wall/process()
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/proc/move_left()
|
||||
src.relocate(get_step(src, WEST))
|
||||
if ((src.next && src.next.deployed))
|
||||
return src.next.move_left()
|
||||
else
|
||||
return src.next
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/proc/move_right()
|
||||
src.relocate(get_step(src, EAST))
|
||||
if ((src.previous && src.previous.deployed))
|
||||
src.previous.move_right()
|
||||
return src.previous
|
||||
|
||||
/obj/move/airtunnel/proc/create(num, y_coord)
|
||||
if (y_coord == airtunnel_bottom)
|
||||
if ((num < 7 || (num > 16 && num < 23)))
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
else
|
||||
src.next = new /obj/move/airtunnel/wall( null )
|
||||
else
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
if (num > 1)
|
||||
spawn( 0 )
|
||||
src.next.create(num - 1, y_coord)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/at_indicator/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "reader_broken"
|
||||
stat |= BROKEN
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "reader_broken"
|
||||
stat |= BROKEN
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/at_indicator/blob_act()
|
||||
if (prob(75))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "reader_broken"
|
||||
stat |= BROKEN
|
||||
|
||||
/obj/machinery/at_indicator/proc/update_icon()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
icon_state = "reader_broken"
|
||||
return
|
||||
|
||||
var/status = 0
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
status = "r"
|
||||
else
|
||||
if (SS13_airtunnel.operating == 2)
|
||||
status = "e"
|
||||
else
|
||||
if(!SS13_airtunnel.connectors)
|
||||
return
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
if (C.current == C)
|
||||
status = 0
|
||||
else
|
||||
if (!( C.current.next ))
|
||||
status = 2
|
||||
else
|
||||
status = 1
|
||||
src.icon_state = text("reader[][]", (SS13_airtunnel.siphon_status == 2 ? "1" : "0"), status)
|
||||
return
|
||||
|
||||
/obj/machinery/at_indicator/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
src.update_icon()
|
||||
return
|
||||
use_power(5, ENVIRON)
|
||||
src.update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/attack_paw(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
obj/machinery/computer/airtunnel/attack_ai(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/airtunnel/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = "<HTML><BODY><TT><B>Air Tunnel Controls</B><BR>"
|
||||
user.machine = src
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
dat += "<B>Status:</B> RETRACTING<BR>"
|
||||
else
|
||||
if (SS13_airtunnel.operating == 2)
|
||||
dat += "<B>Status:</B> EXPANDING<BR>"
|
||||
else
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
if (C.current == C)
|
||||
dat += "<B>Status:</B> Fully Retracted<BR>"
|
||||
else
|
||||
if (!( C.current.next ))
|
||||
dat += "<B>Status:</B> Fully Extended<BR>"
|
||||
else
|
||||
dat += "<B>Status:</B> Stopped Midway<BR>"
|
||||
dat += text("<A href='?src=\ref[];retract=1'>Retract</A> <A href='?src=\ref[];stop=1'>Stop</A> <A href='?src=\ref[];extend=1'>Extend</A><BR>", src, src, src)
|
||||
dat += text("<BR><B>Air Level:</B> []<BR>", (SS13_airtunnel.air_stat ? "Acceptable" : "DANGEROUS"))
|
||||
dat += "<B>Air System Status:</B> "
|
||||
switch(SS13_airtunnel.siphon_status)
|
||||
if(0.0)
|
||||
dat += "Stopped "
|
||||
if(1.0)
|
||||
dat += "Siphoning (Siphons only) "
|
||||
if(2.0)
|
||||
dat += "Regulating (BOTH) "
|
||||
if(3.0)
|
||||
dat += "RELEASING MAX (Siphons only) "
|
||||
else
|
||||
dat += text("<A href='?src=\ref[];refresh=1'>(Refresh)</A><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];release=1'>RELEASE (Siphons only)</A> <A href='?src=\ref[];siphon=1'>Siphon (Siphons only)</A> <A href='?src=\ref[];stop_siph=1'>Stop</A> <A href='?src=\ref[];auto=1'>Regulate</A><BR>", src, src, src, src)
|
||||
dat += text("<BR><BR><A href='?src=\ref[];mach_close=computer'>Close</A></TT></BODY></HTML>", user)
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/proc/update_icon()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
return
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "c_unpowered"
|
||||
return
|
||||
|
||||
var/status = 0
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
status = "r"
|
||||
else
|
||||
if (SS13_airtunnel.operating == 2)
|
||||
status = "e"
|
||||
else
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
if (C.current == C)
|
||||
status = 0
|
||||
else
|
||||
if (!( C.current.next ))
|
||||
status = 2
|
||||
else
|
||||
status = 1
|
||||
src.icon_state = text("console[][]", (SS13_airtunnel.siphon_status >= 2 ? "1" : "0"), status)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/process()
|
||||
src.update_icon()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(250)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon))))
|
||||
usr.machine = src
|
||||
if (href_list["retract"])
|
||||
SS13_airtunnel.retract()
|
||||
else if (href_list["stop"])
|
||||
SS13_airtunnel.operating = 0
|
||||
else if (href_list["extend"])
|
||||
SS13_airtunnel.extend()
|
||||
else if (href_list["release"])
|
||||
SS13_airtunnel.siphon_status = 3
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["siphon"])
|
||||
SS13_airtunnel.siphon_status = 1
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["stop_siph"])
|
||||
SS13_airtunnel.siphon_status = 0
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["auto"])
|
||||
SS13_airtunnel.siphon_status = 2
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["refresh"])
|
||||
SS13_airtunnel.siphons()
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/sec_lock/attack_ai(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/sec_lock/attack_paw(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/sec_lock/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
use_power(10)
|
||||
|
||||
if (src.loc == user.loc)
|
||||
var/dat = text("<B>Security Pad:</B><BR>\nKeycard: []<BR>\n<A href='?src=\ref[];door1=1'>Toggle Outer Door</A><BR>\n<A href='?src=\ref[];door2=1'>Toggle Inner Door</A><BR>\n<BR>\n<A href='?src=\ref[];em_cl=1'>Emergency Close</A><BR>\n<A href='?src=\ref[];em_op=1'>Emergency Open</A><BR>", (src.scan ? text("<A href='?src=\ref[];card=1'>[]</A>", src, src.scan.name) : text("<A href='?src=\ref[];card=1'>-----</A>", src)), src, src, src, src)
|
||||
user << browse(dat, "window=sec_lock")
|
||||
onclose(user, "sec_lock")
|
||||
return
|
||||
|
||||
/obj/machinery/sec_lock/attackby(nothing, user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/sec_lock/New()
|
||||
..()
|
||||
spawn( 2 )
|
||||
if (src.a_type == 1)
|
||||
src.d2 = locate(/obj/machinery/door, locate(src.x - 2, src.y - 1, src.z))
|
||||
src.d1 = locate(/obj/machinery/door, get_step(src, SOUTHWEST))
|
||||
else
|
||||
if (src.a_type == 2)
|
||||
src.d2 = locate(/obj/machinery/door, locate(src.x - 2, src.y + 1, src.z))
|
||||
src.d1 = locate(/obj/machinery/door, get_step(src, NORTHWEST))
|
||||
else
|
||||
src.d1 = locate(/obj/machinery/door, get_step(src, SOUTH))
|
||||
src.d2 = locate(/obj/machinery/door, get_step(src, SOUTHEAST))
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/sec_lock/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if ((!( src.d1 ) || !( src.d2 )))
|
||||
usr << "\red Error: Cannot interface with door security!"
|
||||
return
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon))))
|
||||
usr.machine = src
|
||||
if (href_list["card"])
|
||||
if (src.scan)
|
||||
src.scan.loc = src.loc
|
||||
src.scan = null
|
||||
else
|
||||
var/obj/item/weapon/card/id/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.scan = I
|
||||
if (href_list["door1"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
if (src.d1.density)
|
||||
spawn( 0 )
|
||||
src.d1.open()
|
||||
return
|
||||
else
|
||||
spawn( 0 )
|
||||
src.d1.close()
|
||||
return
|
||||
if (href_list["door2"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
if (src.d2.density)
|
||||
spawn( 0 )
|
||||
src.d2.open()
|
||||
return
|
||||
else
|
||||
spawn( 0 )
|
||||
src.d2.close()
|
||||
return
|
||||
if (href_list["em_cl"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
if (!( src.d1.density ))
|
||||
src.d1.close()
|
||||
return
|
||||
sleep(1)
|
||||
spawn( 0 )
|
||||
if (!( src.d2.density ))
|
||||
src.d2.close()
|
||||
return
|
||||
if (href_list["em_op"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
spawn( 0 )
|
||||
if (src.d1.density)
|
||||
src.d1.open()
|
||||
return
|
||||
sleep(1)
|
||||
spawn( 0 )
|
||||
if (src.d2.density)
|
||||
src.d2.open()
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/datum/air_tunnel/air_tunnel1/New()
|
||||
..()
|
||||
for(var/obj/move/airtunnel/A in locate(/area/airtunnel1))
|
||||
A.master = src
|
||||
A.create()
|
||||
src.connectors += A
|
||||
//Foreach goto(21)
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/siphons()
|
||||
switch(src.siphon_status)
|
||||
if(0.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/S in locate(/area/airtunnel1))
|
||||
S.t_status = 3
|
||||
if(1.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/fullairsiphon/S in locate(/area/airtunnel1))
|
||||
S.t_status = 2
|
||||
S.t_per = 1000000.0
|
||||
for(var/obj/machinery/atmoalter/siphs/scrubbers/S in locate(/area/airtunnel1))
|
||||
S.t_status = 3
|
||||
if(2.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/S in locate(/area/airtunnel1))
|
||||
S.t_status = 4
|
||||
if(3.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/fullairsiphon/S in locate(/area/airtunnel1))
|
||||
S.t_status = 1
|
||||
S.t_per = 1000000.0
|
||||
for(var/obj/machinery/atmoalter/siphs/scrubbers/S in locate(/area/airtunnel1))
|
||||
S.t_status = 3
|
||||
else
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/stop()
|
||||
src.operating = 0
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/extend()
|
||||
if (src.operating)
|
||||
return
|
||||
|
||||
spawn(0)
|
||||
src.operating = 2
|
||||
while(src.operating == 2)
|
||||
var/ok = 1
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (!( A.current.next ))
|
||||
src.operating = 0
|
||||
return
|
||||
if (!( A.move_left() ))
|
||||
ok = 0
|
||||
if (!( ok ))
|
||||
src.operating = 0
|
||||
else
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (A.current)
|
||||
A.current.next.loc = get_step(A.current.loc, EAST)
|
||||
A.current = A.current.next
|
||||
A.current.deployed = 1
|
||||
else
|
||||
src.operating = 0
|
||||
sleep(20)
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/retract()
|
||||
if (src.operating)
|
||||
return
|
||||
spawn(0)
|
||||
src.operating = 1
|
||||
while(src.operating == 1)
|
||||
var/ok = 1
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (A.current == A)
|
||||
src.operating = 0
|
||||
return
|
||||
if (A.current)
|
||||
A.current.loc = null
|
||||
A.current.deployed = 0
|
||||
A.current = A.current.previous
|
||||
else
|
||||
ok = 0
|
||||
if (!( ok ))
|
||||
src.operating = 0
|
||||
else
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (!( A.current.move_right() ))
|
||||
src.operating = 0
|
||||
sleep(20)
|
||||
/obj/machinery/sec_lock//P'sure this was part of the tunnel
|
||||
name = "Security Pad"
|
||||
desc = "A lock, for doors. Used by security."
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "sec_lock"
|
||||
var/obj/item/weapon/card/id/scan = null
|
||||
var/a_type = 0.0
|
||||
var/obj/machinery/door/d1 = null
|
||||
var/obj/machinery/door/d2 = null
|
||||
anchored = 1.0
|
||||
req_access = list(access_brig)
|
||||
use_power = 1
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 4
|
||||
|
||||
/obj/move/airtunnel/process()
|
||||
if (!( src.deployed ))
|
||||
return null
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/connector/create()
|
||||
src.current = src
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
spawn( 0 )
|
||||
src.next.create(airtunnel_start - airtunnel_stop, src.y)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/connector/wall/create()
|
||||
src.current = src
|
||||
src.next = new /obj/move/airtunnel/wall( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
spawn( 0 )
|
||||
src.next.create(airtunnel_start - airtunnel_stop, src.y)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/connector/wall/process()
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/wall/create(num, y_coord)
|
||||
if (((num < 7 || (num > 16 && num < 23)) && y_coord == airtunnel_bottom))
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
else
|
||||
src.next = new /obj/move/airtunnel/wall( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
if (num > 1)
|
||||
spawn( 0 )
|
||||
src.next.create(num - 1, y_coord)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/wall/move_right()
|
||||
flick("wall-m", src)
|
||||
return ..()
|
||||
|
||||
/obj/move/airtunnel/wall/move_left()
|
||||
flick("wall-m", src)
|
||||
return ..()
|
||||
|
||||
/obj/move/airtunnel/wall/process()
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/proc/move_left()
|
||||
src.relocate(get_step(src, WEST))
|
||||
if ((src.next && src.next.deployed))
|
||||
return src.next.move_left()
|
||||
else
|
||||
return src.next
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/proc/move_right()
|
||||
src.relocate(get_step(src, EAST))
|
||||
if ((src.previous && src.previous.deployed))
|
||||
src.previous.move_right()
|
||||
return src.previous
|
||||
|
||||
/obj/move/airtunnel/proc/create(num, y_coord)
|
||||
if (y_coord == airtunnel_bottom)
|
||||
if ((num < 7 || (num > 16 && num < 23)))
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
else
|
||||
src.next = new /obj/move/airtunnel/wall( null )
|
||||
else
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
if (num > 1)
|
||||
spawn( 0 )
|
||||
src.next.create(num - 1, y_coord)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/at_indicator/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "reader_broken"
|
||||
stat |= BROKEN
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "reader_broken"
|
||||
stat |= BROKEN
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/at_indicator/blob_act()
|
||||
if (prob(75))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "reader_broken"
|
||||
stat |= BROKEN
|
||||
|
||||
/obj/machinery/at_indicator/proc/update_icon()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
icon_state = "reader_broken"
|
||||
return
|
||||
|
||||
var/status = 0
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
status = "r"
|
||||
else
|
||||
if (SS13_airtunnel.operating == 2)
|
||||
status = "e"
|
||||
else
|
||||
if(!SS13_airtunnel.connectors)
|
||||
return
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
if (C.current == C)
|
||||
status = 0
|
||||
else
|
||||
if (!( C.current.next ))
|
||||
status = 2
|
||||
else
|
||||
status = 1
|
||||
src.icon_state = text("reader[][]", (SS13_airtunnel.siphon_status == 2 ? "1" : "0"), status)
|
||||
return
|
||||
|
||||
/obj/machinery/at_indicator/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
src.update_icon()
|
||||
return
|
||||
use_power(5, ENVIRON)
|
||||
src.update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/attack_paw(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
obj/machinery/computer/airtunnel/attack_ai(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/airtunnel/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = "<HTML><BODY><TT><B>Air Tunnel Controls</B><BR>"
|
||||
user.machine = src
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
dat += "<B>Status:</B> RETRACTING<BR>"
|
||||
else
|
||||
if (SS13_airtunnel.operating == 2)
|
||||
dat += "<B>Status:</B> EXPANDING<BR>"
|
||||
else
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
if (C.current == C)
|
||||
dat += "<B>Status:</B> Fully Retracted<BR>"
|
||||
else
|
||||
if (!( C.current.next ))
|
||||
dat += "<B>Status:</B> Fully Extended<BR>"
|
||||
else
|
||||
dat += "<B>Status:</B> Stopped Midway<BR>"
|
||||
dat += text("<A href='?src=\ref[];retract=1'>Retract</A> <A href='?src=\ref[];stop=1'>Stop</A> <A href='?src=\ref[];extend=1'>Extend</A><BR>", src, src, src)
|
||||
dat += text("<BR><B>Air Level:</B> []<BR>", (SS13_airtunnel.air_stat ? "Acceptable" : "DANGEROUS"))
|
||||
dat += "<B>Air System Status:</B> "
|
||||
switch(SS13_airtunnel.siphon_status)
|
||||
if(0.0)
|
||||
dat += "Stopped "
|
||||
if(1.0)
|
||||
dat += "Siphoning (Siphons only) "
|
||||
if(2.0)
|
||||
dat += "Regulating (BOTH) "
|
||||
if(3.0)
|
||||
dat += "RELEASING MAX (Siphons only) "
|
||||
else
|
||||
dat += text("<A href='?src=\ref[];refresh=1'>(Refresh)</A><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];release=1'>RELEASE (Siphons only)</A> <A href='?src=\ref[];siphon=1'>Siphon (Siphons only)</A> <A href='?src=\ref[];stop_siph=1'>Stop</A> <A href='?src=\ref[];auto=1'>Regulate</A><BR>", src, src, src, src)
|
||||
dat += text("<BR><BR><A href='?src=\ref[];mach_close=computer'>Close</A></TT></BODY></HTML>", user)
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/proc/update_icon()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
return
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "c_unpowered"
|
||||
return
|
||||
|
||||
var/status = 0
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
status = "r"
|
||||
else
|
||||
if (SS13_airtunnel.operating == 2)
|
||||
status = "e"
|
||||
else
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
if (C.current == C)
|
||||
status = 0
|
||||
else
|
||||
if (!( C.current.next ))
|
||||
status = 2
|
||||
else
|
||||
status = 1
|
||||
src.icon_state = text("console[][]", (SS13_airtunnel.siphon_status >= 2 ? "1" : "0"), status)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/process()
|
||||
src.update_icon()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(250)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon))))
|
||||
usr.machine = src
|
||||
if (href_list["retract"])
|
||||
SS13_airtunnel.retract()
|
||||
else if (href_list["stop"])
|
||||
SS13_airtunnel.operating = 0
|
||||
else if (href_list["extend"])
|
||||
SS13_airtunnel.extend()
|
||||
else if (href_list["release"])
|
||||
SS13_airtunnel.siphon_status = 3
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["siphon"])
|
||||
SS13_airtunnel.siphon_status = 1
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["stop_siph"])
|
||||
SS13_airtunnel.siphon_status = 0
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["auto"])
|
||||
SS13_airtunnel.siphon_status = 2
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["refresh"])
|
||||
SS13_airtunnel.siphons()
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/sec_lock/attack_ai(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/sec_lock/attack_paw(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/sec_lock/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
use_power(10)
|
||||
|
||||
if (src.loc == user.loc)
|
||||
var/dat = text("<B>Security Pad:</B><BR>\nKeycard: []<BR>\n<A href='?src=\ref[];door1=1'>Toggle Outer Door</A><BR>\n<A href='?src=\ref[];door2=1'>Toggle Inner Door</A><BR>\n<BR>\n<A href='?src=\ref[];em_cl=1'>Emergency Close</A><BR>\n<A href='?src=\ref[];em_op=1'>Emergency Open</A><BR>", (src.scan ? text("<A href='?src=\ref[];card=1'>[]</A>", src, src.scan.name) : text("<A href='?src=\ref[];card=1'>-----</A>", src)), src, src, src, src)
|
||||
user << browse(dat, "window=sec_lock")
|
||||
onclose(user, "sec_lock")
|
||||
return
|
||||
|
||||
/obj/machinery/sec_lock/attackby(nothing, user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/sec_lock/New()
|
||||
..()
|
||||
spawn( 2 )
|
||||
if (src.a_type == 1)
|
||||
src.d2 = locate(/obj/machinery/door, locate(src.x - 2, src.y - 1, src.z))
|
||||
src.d1 = locate(/obj/machinery/door, get_step(src, SOUTHWEST))
|
||||
else
|
||||
if (src.a_type == 2)
|
||||
src.d2 = locate(/obj/machinery/door, locate(src.x - 2, src.y + 1, src.z))
|
||||
src.d1 = locate(/obj/machinery/door, get_step(src, NORTHWEST))
|
||||
else
|
||||
src.d1 = locate(/obj/machinery/door, get_step(src, SOUTH))
|
||||
src.d2 = locate(/obj/machinery/door, get_step(src, SOUTHEAST))
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/sec_lock/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if ((!( src.d1 ) || !( src.d2 )))
|
||||
usr << "\red Error: Cannot interface with door security!"
|
||||
return
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon))))
|
||||
usr.machine = src
|
||||
if (href_list["card"])
|
||||
if (src.scan)
|
||||
src.scan.loc = src.loc
|
||||
src.scan = null
|
||||
else
|
||||
var/obj/item/weapon/card/id/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.scan = I
|
||||
if (href_list["door1"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
if (src.d1.density)
|
||||
spawn( 0 )
|
||||
src.d1.open()
|
||||
return
|
||||
else
|
||||
spawn( 0 )
|
||||
src.d1.close()
|
||||
return
|
||||
if (href_list["door2"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
if (src.d2.density)
|
||||
spawn( 0 )
|
||||
src.d2.open()
|
||||
return
|
||||
else
|
||||
spawn( 0 )
|
||||
src.d2.close()
|
||||
return
|
||||
if (href_list["em_cl"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
if (!( src.d1.density ))
|
||||
src.d1.close()
|
||||
return
|
||||
sleep(1)
|
||||
spawn( 0 )
|
||||
if (!( src.d2.density ))
|
||||
src.d2.close()
|
||||
return
|
||||
if (href_list["em_op"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
spawn( 0 )
|
||||
if (src.d1.density)
|
||||
src.d1.open()
|
||||
return
|
||||
sleep(1)
|
||||
spawn( 0 )
|
||||
if (src.d2.density)
|
||||
src.d2.open()
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/datum/air_tunnel/air_tunnel1/New()
|
||||
..()
|
||||
for(var/obj/move/airtunnel/A in locate(/area/airtunnel1))
|
||||
A.master = src
|
||||
A.create()
|
||||
src.connectors += A
|
||||
//Foreach goto(21)
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/siphons()
|
||||
switch(src.siphon_status)
|
||||
if(0.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/S in locate(/area/airtunnel1))
|
||||
S.t_status = 3
|
||||
if(1.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/fullairsiphon/S in locate(/area/airtunnel1))
|
||||
S.t_status = 2
|
||||
S.t_per = 1000000.0
|
||||
for(var/obj/machinery/atmoalter/siphs/scrubbers/S in locate(/area/airtunnel1))
|
||||
S.t_status = 3
|
||||
if(2.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/S in locate(/area/airtunnel1))
|
||||
S.t_status = 4
|
||||
if(3.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/fullairsiphon/S in locate(/area/airtunnel1))
|
||||
S.t_status = 1
|
||||
S.t_per = 1000000.0
|
||||
for(var/obj/machinery/atmoalter/siphs/scrubbers/S in locate(/area/airtunnel1))
|
||||
S.t_status = 3
|
||||
else
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/stop()
|
||||
src.operating = 0
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/extend()
|
||||
if (src.operating)
|
||||
return
|
||||
|
||||
spawn(0)
|
||||
src.operating = 2
|
||||
while(src.operating == 2)
|
||||
var/ok = 1
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (!( A.current.next ))
|
||||
src.operating = 0
|
||||
return
|
||||
if (!( A.move_left() ))
|
||||
ok = 0
|
||||
if (!( ok ))
|
||||
src.operating = 0
|
||||
else
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (A.current)
|
||||
A.current.next.loc = get_step(A.current.loc, EAST)
|
||||
A.current = A.current.next
|
||||
A.current.deployed = 1
|
||||
else
|
||||
src.operating = 0
|
||||
sleep(20)
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/retract()
|
||||
if (src.operating)
|
||||
return
|
||||
spawn(0)
|
||||
src.operating = 1
|
||||
while(src.operating == 1)
|
||||
var/ok = 1
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (A.current == A)
|
||||
src.operating = 0
|
||||
return
|
||||
if (A.current)
|
||||
A.current.loc = null
|
||||
A.current.deployed = 0
|
||||
A.current = A.current.previous
|
||||
else
|
||||
ok = 0
|
||||
if (!( ok ))
|
||||
src.operating = 0
|
||||
else
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (!( A.current.move_right() ))
|
||||
src.operating = 0
|
||||
sleep(20)
|
||||
return
|
||||
+961
-961
File diff suppressed because it is too large
Load Diff
@@ -1,235 +1,235 @@
|
||||
/*********************NEW AUTOLATHE / CRAFT LATHE***********************/
|
||||
|
||||
var/list/datum/craftlathe_item/CRAFT_ITEMS = list()
|
||||
var/CRAFT_ITEMS_SETUP = 1 //this should probably be a pre-game thing, but i'll do it so the first lathe2 that's created will set-up the recipes.
|
||||
|
||||
proc/check_craftlathe_recipe(var/list/param_recipe)
|
||||
if(param_recipe.len != 9)
|
||||
return
|
||||
var/i
|
||||
var/match = 0 //this one counts if there is at least one non-"" ingredient.
|
||||
for(var/datum/craftlathe_item/CI in CRAFT_ITEMS)
|
||||
match = 0
|
||||
for(i = 1; i <= 9; i++)
|
||||
if(CI.recipe[i] != param_recipe[i])
|
||||
match = 0 //use this so it passes by the match > 0 check below, otherwise i'd need a new variable to tell the return CI below that the check failed
|
||||
break
|
||||
if(CI.recipe[i] != "")
|
||||
match++
|
||||
if(match > 0)
|
||||
return CI
|
||||
return 0
|
||||
|
||||
/datum/craftlathe_item
|
||||
var/id = "" //must be unique for each item type. used to create recipes
|
||||
var/name = "unknown" //what the lathe will show as it's contents
|
||||
var/list/recipe = list("","","","","","","","","") //the 9 items here represent what items need to be placed in the lathe to produce this item.
|
||||
var/item_type = null //this is used on items like sheets which are added when inserted into the lathe.
|
||||
var/amount = 1
|
||||
var/amount_attackby = 1
|
||||
|
||||
/datum/craftlathe_item/New(var/param_id,var/param_name,var/param_amount,var/param_ammount_per_attackby,var/list/param_recipe,var/param_type = null)
|
||||
..()
|
||||
id = param_id
|
||||
name = param_name
|
||||
recipe = param_recipe
|
||||
item_type = param_type
|
||||
amount = param_amount;
|
||||
amount_attackby = param_ammount_per_attackby
|
||||
return
|
||||
|
||||
//this proc checks the recipe you give in it's parameter with the entire list of available items. If any match, it returns the item from CRAFT_ITEMS. the returned item should not be changed!!
|
||||
|
||||
/obj/machinery/autolathe2
|
||||
name = "Craft lathe"
|
||||
icon_state = "autolathe"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/datum/craftlathe_item/selected = null
|
||||
var/datum/craftlathe_item/make = null
|
||||
var/list/datum/craftlathe_item/craft_contents = list()
|
||||
var/list/current_recipe = list("","","","","","","","","")
|
||||
|
||||
/obj/machinery/autolathe2/New()
|
||||
..()
|
||||
if(CRAFT_ITEMS_SETUP)
|
||||
CRAFT_ITEMS_SETUP = 0
|
||||
build_recipes()
|
||||
return
|
||||
|
||||
/obj/machinery/autolathe2/attack_hand(mob/user as mob)
|
||||
var/dat
|
||||
dat = text("<h3>Craft Lathe</h3>")
|
||||
dat += text("<table><tr><td valign='top'>")
|
||||
|
||||
dat += text("<b>Materials</b><p>")
|
||||
var/datum/craftlathe_item/CI
|
||||
var/i
|
||||
for(i = 1; i <= craft_contents.len; i++)
|
||||
CI = craft_contents[i]
|
||||
if (CI == selected)
|
||||
dat += text("[CI.name] ([CI.amount])<br>")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];select=[i]'>[CI.name]</a> ([CI.amount])<br>")
|
||||
|
||||
dat += text("</td><td valign='top'>")
|
||||
|
||||
dat += text("<b>Crafting Table</b><p>")
|
||||
|
||||
dat += text(" <table bgcolor='#cccccc' cellpadding='4' cellspacing='0'>")
|
||||
|
||||
var/j = 0
|
||||
var/k = 0
|
||||
for (i = 0; i < 3; i++)
|
||||
dat += text(" <tr>")
|
||||
for (j = 1; j <= 3; j++)
|
||||
k = i * 3 + j
|
||||
if (current_recipe[k])
|
||||
dat += text(" <td><A href='?src=\ref[src];remove=[k]'>[current_recipe[k]]</a></td>")
|
||||
else
|
||||
dat += text(" <td><A href='?src=\ref[src];add=[k]'>----</a></td>")
|
||||
dat += text(" </tr>")
|
||||
dat += text(" </table>")
|
||||
|
||||
dat += text("<br><br>")
|
||||
dat += text("<b>Will make: </b>")
|
||||
if (make)
|
||||
dat += text("<A href='?src=\ref[src];make=[1]'>[make.name]</a>")
|
||||
else
|
||||
dat += text("nothing useful")
|
||||
|
||||
dat += text("</td></tr></table>")
|
||||
user << browse("[dat]", "window=craft")
|
||||
|
||||
/obj/machinery/autolathe2/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["remove"])
|
||||
var/n = text2num(href_list["remove"])
|
||||
if(!n || n < 1 || n > 9)
|
||||
return
|
||||
current_recipe[n] = ""
|
||||
if(href_list["select"])
|
||||
var/n = text2num(href_list["select"])
|
||||
if(!n || n < 1 || n > 9)
|
||||
return
|
||||
selected = craft_contents[n]
|
||||
if(href_list["add"])
|
||||
var/n = text2num(href_list["add"])
|
||||
if(!n || n < 1 || n > 9)
|
||||
return
|
||||
if(selected)
|
||||
current_recipe[n] = selected.id
|
||||
if(href_list["make"])
|
||||
var/datum/craftlathe_item/MAKE = check_craftlathe_recipe(src.current_recipe)
|
||||
if(MAKE)
|
||||
for (var/datum/craftlathe_item/CI2 in craft_contents)
|
||||
if(CI2.id == MAKE.id)
|
||||
CI2.amount += CI2.amount_attackby
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
craft_contents += new/datum/craftlathe_item(MAKE.id,MAKE.name,MAKE.amount,MAKE.amount_attackby,MAKE.recipe,MAKE.item_type)
|
||||
var/datum/craftlathe_item/CI = check_craftlathe_recipe(src.current_recipe)
|
||||
if(CI)
|
||||
make = CI
|
||||
else
|
||||
make = null
|
||||
src.updateUsrDialog()
|
||||
|
||||
|
||||
|
||||
/obj/machinery/autolathe2/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
for (var/datum/craftlathe_item/CI in CRAFT_ITEMS)
|
||||
if(W.type == CI.item_type)
|
||||
for (var/datum/craftlathe_item/CI2 in craft_contents)
|
||||
if(CI2.item_type == W.type)
|
||||
CI2.amount += CI2.amount_attackby
|
||||
rmv_item(W)
|
||||
return
|
||||
craft_contents += new/datum/craftlathe_item(CI.id,CI.name,CI.amount,CI.amount_attackby,CI.recipe,CI.item_type)
|
||||
rmv_item(W)
|
||||
return
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/autolathe2/proc/rmv_item(obj/item/W as obj)
|
||||
if(istype(W,/obj/item/stack))
|
||||
var/obj/item/stack/S = W
|
||||
S.amount--
|
||||
if (S.amount <= 0)
|
||||
del(S)
|
||||
else
|
||||
del(W)
|
||||
|
||||
/obj/machinery/autolathe2/proc/build_recipes()
|
||||
//Parameters: ID, Name, Amount, Amount_added_per_attackby, Recipe, Object type
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("METAL","Metal",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/metal)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("R METAL","Reinforced Metal",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/r_metal)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GLASS","Glass",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/glass)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("R GLASS","Reinforced Glass",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/rglass)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GOLD","Gold",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/gold)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SILVER","Silver",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/silver)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("DIAMOND","Diamond",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/diamond)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("PLASMA","Plasma",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/plasma)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("URANIUM","Uranium",1,1,list("","","","","","","","",""),/obj/item/weapon/ore/uranium)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CLOWN","Bananium",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/clown)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ADMAMANTINE","Adamantine",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/adamantine)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SCREWS","Screws",9,9,list("","","","","METAL","","","METAL",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("COGS","Cogs",9,9,list("","METAL","","METAL","METAL","METAL","","METAL",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SWITCH","Switch",12,12,list("METAL","","METAL","METAL","METAL","","METAL","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("KEYBOARD","Keyboard",1,1,list("","","","SWITCH","SWITCH","SWITCH","SWITCH","SWITCH","SWITCH"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("M PANEL","Metal Panel",10,10,list("","","","","METAL","METAL","","METAL","METAL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CASE","Equipment Case",1,1,list("M PANEL","M PANEL","M PANEL","M PANEL","","M PANEL","M PANEL","M PANEL","M PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("G PANEL","Glass Panel",10,10,list("","","","","GLASS","GLASS","","GLASS","GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SCREEN","Screen",1,1,list("","GLASS","","GLASS","PLASMA","GLASS","","GLASS",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EL SILVER","Electronics Silver",30,30,list("","","","","SILVER","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EL GOLD","Electronics Gold",6,6,list("","","","","GOLD","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("TINTED GL","Tinted Glass",2,2,list("","METAL","","","GLASS","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("TANK VALVE","Tank Transfer Valuve",1,1,list("","PIPE","","","PIPE","SWITCH","","PIPE",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("PIPE","Pipe",1,1,list("","M PANEL","","","M PANEL","","","M PANEL",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CB FRAME","Circuitboard Frame",1,1,list("","","","M PANEL","G PANEL","M PANEL","G PANEL","M PANEL","G PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ROM","ROM Module",1,1,list("EL SILVER","EL SILVER","EL SILVER","EL SILVER","","EL SILVER","EL SILVER","EL SILVER","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RAM","RAM Module",1,1,list("EL SILVER","EL SILVER","EL SILVER","EL SILVER","EL GOLD","EL SILVER","EL SILVER","EL SILVER","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("PROCESSOR","Processor",1,1,list("EL GOLD","EL SILVER","EL GOLD","EL SILVER","EL SILVER","EL SILVER","EL SILVER","EL GOLD","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ANTENNA","Antenna",1,1,list("","","EL SILVER","","","EL SILVER","EL SILVER","EL SILVER","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("OP RECEPTOR","Optic Receptor",1,1,list("G PANEL","G PANEL","G PANEL","","EL GOLD","","G PANEL","G PANEL","G PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("THERMAL OP R","Thermal Optic Receptor",1,1,list("","OP RECEPTOR","","ROM","DIAMOND","DIAMOND","","OP RECEPTOR",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("MASON OP R","Mason Optic Receptor",1,1,list("","OP RECEPTOR","","ROM","EL SILVER","EL SILVER","","OP RECEPTOR",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EAR FRAME","Earpiece Frame",1,1,list("M PANEL","M PANEL","M PANEL","M PANEL","","M PANEL","M PANEL","M PANEL",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RADIO M","Radio Module",1,1,list("","ANTENNA","","","ROM","","CB FRAME","CB FRAME","CB FRAME"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EARPIECE","Radio Earpiece",1,1,list("","","","","RADIO M","","","EAR FRAME",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EARMUFFS","Earmuffs",1,1,list("","M PANEL","","EAR FRAME","","EAR FRAME","","",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GLASSES FRAME","Glasses Frame",1,1,list("M PANEL","","M PANEL","M PANEL","","M PANEL","M PANEL","M PANEL","M PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("MASONS","Mason Scanners",1,1,list("","","","MASON OP R","GLASSES FRAME","MASON OP R","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("THERMALS","Thermal Scanners",1,1,list("","","","THERMAL OP R","GLASSES FRAME","THERMAL OP R","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SUNGLASSES","Sunglasses",1,1,list("","","","TINTED GL","GLASSES FRAME","TINTED GL","","",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HELMET FR","Helmet Frame",1,1,list("METAL","METAL","METAL","METAL","","METAL","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HELMET","Security Helmet",1,1,list("R METAL","R METAL","R METAL","R METAL","HELMET FR","R METAL","","GLASS",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HOS HELMET","HoS Helmet",1,1,list("SILVER","GOLD","SILVER","SILVER","HELMET","SILVER","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HARDHAT","Hardhat",1,1,list("","FLASHLIGHT","","","HELMET FR","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SWAT HELMET","SWAT Helmet",1,1,list("","","","","HELMET","","R GLASS","R GLASS","R GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("WELDING HELM","Welding Helmet",1,1,list("","","","","HELMET FR","","TINTED GL","TINTED GL","TINTED GL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SPACE HELMET","Space Helmet",1,1,list("R METAL","SILVER","R METAL","SILVER","HELMET FR","SILVER","R GLASS","R GLASS","R GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RIG HELMET","RIG Helmet",1,1,list("R METAL","SILVER","R METAL","SILVER","SPACE HELMET","SILVER","R GLASS","R GLASS","R GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GAS MASK","Gas Mask",1,1,list("","","","","HELMET FR","TANK VALVE","","G PANEL",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ARMOR FRAME","Armor Frame",1,1,list("R METAL","","R METAL","R METAL","R METAL","R METAL","R METAL","R METAL","R METAL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ARMOR","Armored Vest",1,1,list("R METAL","","R METAL","R METAL","ARMOR FRAME","R METAL","R METAL","R METAL","R METAL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HOS ARMOR","HoS Armor",1,1,list("DIAMOND","","DIAMOND","URANIUM","ARMOR","URANIUM","URANIUM","R METAL","URANIUM"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CAP ARMOR","Captain Armor",1,1,list("DIAMOND","","DIAMOND","URANIUM","HOS ARMOR","URANIUM","URANIUM","R METAL","URANIUM"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SPACE S FR","Space Suit Frame",1,1,list("SILVER","","SILVER","SILVER","SILVER","SILVER","SILVER","SILVER","SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SPACE SUIT","Space Suit",1,1,list("SILVER","","SILVER","RAM","SPACE S FR","RADIO M","SILVER","SILVEr","SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RIG SUIT","RIG Suit",1,1,list("SILVER","","SILVER","SILVER","SPACE SUIT","SILVER","SILVER","SILVER","SILVER"))
|
||||
//TODO: Flashlight, type paths
|
||||
return
|
||||
|
||||
|
||||
|
||||
/*********************NEW AUTOLATHE / CRAFT LATHE***********************/
|
||||
|
||||
var/list/datum/craftlathe_item/CRAFT_ITEMS = list()
|
||||
var/CRAFT_ITEMS_SETUP = 1 //this should probably be a pre-game thing, but i'll do it so the first lathe2 that's created will set-up the recipes.
|
||||
|
||||
proc/check_craftlathe_recipe(var/list/param_recipe)
|
||||
if(param_recipe.len != 9)
|
||||
return
|
||||
var/i
|
||||
var/match = 0 //this one counts if there is at least one non-"" ingredient.
|
||||
for(var/datum/craftlathe_item/CI in CRAFT_ITEMS)
|
||||
match = 0
|
||||
for(i = 1; i <= 9; i++)
|
||||
if(CI.recipe[i] != param_recipe[i])
|
||||
match = 0 //use this so it passes by the match > 0 check below, otherwise i'd need a new variable to tell the return CI below that the check failed
|
||||
break
|
||||
if(CI.recipe[i] != "")
|
||||
match++
|
||||
if(match > 0)
|
||||
return CI
|
||||
return 0
|
||||
|
||||
/datum/craftlathe_item
|
||||
var/id = "" //must be unique for each item type. used to create recipes
|
||||
var/name = "unknown" //what the lathe will show as it's contents
|
||||
var/list/recipe = list("","","","","","","","","") //the 9 items here represent what items need to be placed in the lathe to produce this item.
|
||||
var/item_type = null //this is used on items like sheets which are added when inserted into the lathe.
|
||||
var/amount = 1
|
||||
var/amount_attackby = 1
|
||||
|
||||
/datum/craftlathe_item/New(var/param_id,var/param_name,var/param_amount,var/param_ammount_per_attackby,var/list/param_recipe,var/param_type = null)
|
||||
..()
|
||||
id = param_id
|
||||
name = param_name
|
||||
recipe = param_recipe
|
||||
item_type = param_type
|
||||
amount = param_amount;
|
||||
amount_attackby = param_ammount_per_attackby
|
||||
return
|
||||
|
||||
//this proc checks the recipe you give in it's parameter with the entire list of available items. If any match, it returns the item from CRAFT_ITEMS. the returned item should not be changed!!
|
||||
|
||||
/obj/machinery/autolathe2
|
||||
name = "Craft lathe"
|
||||
icon_state = "autolathe"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/datum/craftlathe_item/selected = null
|
||||
var/datum/craftlathe_item/make = null
|
||||
var/list/datum/craftlathe_item/craft_contents = list()
|
||||
var/list/current_recipe = list("","","","","","","","","")
|
||||
|
||||
/obj/machinery/autolathe2/New()
|
||||
..()
|
||||
if(CRAFT_ITEMS_SETUP)
|
||||
CRAFT_ITEMS_SETUP = 0
|
||||
build_recipes()
|
||||
return
|
||||
|
||||
/obj/machinery/autolathe2/attack_hand(mob/user as mob)
|
||||
var/dat
|
||||
dat = text("<h3>Craft Lathe</h3>")
|
||||
dat += text("<table><tr><td valign='top'>")
|
||||
|
||||
dat += text("<b>Materials</b><p>")
|
||||
var/datum/craftlathe_item/CI
|
||||
var/i
|
||||
for(i = 1; i <= craft_contents.len; i++)
|
||||
CI = craft_contents[i]
|
||||
if (CI == selected)
|
||||
dat += text("[CI.name] ([CI.amount])<br>")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];select=[i]'>[CI.name]</a> ([CI.amount])<br>")
|
||||
|
||||
dat += text("</td><td valign='top'>")
|
||||
|
||||
dat += text("<b>Crafting Table</b><p>")
|
||||
|
||||
dat += text(" <table bgcolor='#cccccc' cellpadding='4' cellspacing='0'>")
|
||||
|
||||
var/j = 0
|
||||
var/k = 0
|
||||
for (i = 0; i < 3; i++)
|
||||
dat += text(" <tr>")
|
||||
for (j = 1; j <= 3; j++)
|
||||
k = i * 3 + j
|
||||
if (current_recipe[k])
|
||||
dat += text(" <td><A href='?src=\ref[src];remove=[k]'>[current_recipe[k]]</a></td>")
|
||||
else
|
||||
dat += text(" <td><A href='?src=\ref[src];add=[k]'>----</a></td>")
|
||||
dat += text(" </tr>")
|
||||
dat += text(" </table>")
|
||||
|
||||
dat += text("<br><br>")
|
||||
dat += text("<b>Will make: </b>")
|
||||
if (make)
|
||||
dat += text("<A href='?src=\ref[src];make=[1]'>[make.name]</a>")
|
||||
else
|
||||
dat += text("nothing useful")
|
||||
|
||||
dat += text("</td></tr></table>")
|
||||
user << browse("[dat]", "window=craft")
|
||||
|
||||
/obj/machinery/autolathe2/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["remove"])
|
||||
var/n = text2num(href_list["remove"])
|
||||
if(!n || n < 1 || n > 9)
|
||||
return
|
||||
current_recipe[n] = ""
|
||||
if(href_list["select"])
|
||||
var/n = text2num(href_list["select"])
|
||||
if(!n || n < 1 || n > 9)
|
||||
return
|
||||
selected = craft_contents[n]
|
||||
if(href_list["add"])
|
||||
var/n = text2num(href_list["add"])
|
||||
if(!n || n < 1 || n > 9)
|
||||
return
|
||||
if(selected)
|
||||
current_recipe[n] = selected.id
|
||||
if(href_list["make"])
|
||||
var/datum/craftlathe_item/MAKE = check_craftlathe_recipe(src.current_recipe)
|
||||
if(MAKE)
|
||||
for (var/datum/craftlathe_item/CI2 in craft_contents)
|
||||
if(CI2.id == MAKE.id)
|
||||
CI2.amount += CI2.amount_attackby
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
craft_contents += new/datum/craftlathe_item(MAKE.id,MAKE.name,MAKE.amount,MAKE.amount_attackby,MAKE.recipe,MAKE.item_type)
|
||||
var/datum/craftlathe_item/CI = check_craftlathe_recipe(src.current_recipe)
|
||||
if(CI)
|
||||
make = CI
|
||||
else
|
||||
make = null
|
||||
src.updateUsrDialog()
|
||||
|
||||
|
||||
|
||||
/obj/machinery/autolathe2/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
for (var/datum/craftlathe_item/CI in CRAFT_ITEMS)
|
||||
if(W.type == CI.item_type)
|
||||
for (var/datum/craftlathe_item/CI2 in craft_contents)
|
||||
if(CI2.item_type == W.type)
|
||||
CI2.amount += CI2.amount_attackby
|
||||
rmv_item(W)
|
||||
return
|
||||
craft_contents += new/datum/craftlathe_item(CI.id,CI.name,CI.amount,CI.amount_attackby,CI.recipe,CI.item_type)
|
||||
rmv_item(W)
|
||||
return
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/autolathe2/proc/rmv_item(obj/item/W as obj)
|
||||
if(istype(W,/obj/item/stack))
|
||||
var/obj/item/stack/S = W
|
||||
S.amount--
|
||||
if (S.amount <= 0)
|
||||
del(S)
|
||||
else
|
||||
del(W)
|
||||
|
||||
/obj/machinery/autolathe2/proc/build_recipes()
|
||||
//Parameters: ID, Name, Amount, Amount_added_per_attackby, Recipe, Object type
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("METAL","Metal",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/metal)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("R METAL","Reinforced Metal",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/r_metal)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GLASS","Glass",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/glass)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("R GLASS","Reinforced Glass",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/rglass)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GOLD","Gold",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/gold)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SILVER","Silver",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/silver)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("DIAMOND","Diamond",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/diamond)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("PLASMA","Plasma",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/plasma)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("URANIUM","Uranium",1,1,list("","","","","","","","",""),/obj/item/weapon/ore/uranium)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CLOWN","Bananium",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/clown)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ADMAMANTINE","Adamantine",1,1,list("","","","","","","","",""),/obj/item/stack/sheet/adamantine)
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SCREWS","Screws",9,9,list("","","","","METAL","","","METAL",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("COGS","Cogs",9,9,list("","METAL","","METAL","METAL","METAL","","METAL",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SWITCH","Switch",12,12,list("METAL","","METAL","METAL","METAL","","METAL","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("KEYBOARD","Keyboard",1,1,list("","","","SWITCH","SWITCH","SWITCH","SWITCH","SWITCH","SWITCH"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("M PANEL","Metal Panel",10,10,list("","","","","METAL","METAL","","METAL","METAL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CASE","Equipment Case",1,1,list("M PANEL","M PANEL","M PANEL","M PANEL","","M PANEL","M PANEL","M PANEL","M PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("G PANEL","Glass Panel",10,10,list("","","","","GLASS","GLASS","","GLASS","GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SCREEN","Screen",1,1,list("","GLASS","","GLASS","PLASMA","GLASS","","GLASS",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EL SILVER","Electronics Silver",30,30,list("","","","","SILVER","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EL GOLD","Electronics Gold",6,6,list("","","","","GOLD","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("TINTED GL","Tinted Glass",2,2,list("","METAL","","","GLASS","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("TANK VALVE","Tank Transfer Valuve",1,1,list("","PIPE","","","PIPE","SWITCH","","PIPE",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("PIPE","Pipe",1,1,list("","M PANEL","","","M PANEL","","","M PANEL",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CB FRAME","Circuitboard Frame",1,1,list("","","","M PANEL","G PANEL","M PANEL","G PANEL","M PANEL","G PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ROM","ROM Module",1,1,list("EL SILVER","EL SILVER","EL SILVER","EL SILVER","","EL SILVER","EL SILVER","EL SILVER","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RAM","RAM Module",1,1,list("EL SILVER","EL SILVER","EL SILVER","EL SILVER","EL GOLD","EL SILVER","EL SILVER","EL SILVER","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("PROCESSOR","Processor",1,1,list("EL GOLD","EL SILVER","EL GOLD","EL SILVER","EL SILVER","EL SILVER","EL SILVER","EL GOLD","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ANTENNA","Antenna",1,1,list("","","EL SILVER","","","EL SILVER","EL SILVER","EL SILVER","EL SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("OP RECEPTOR","Optic Receptor",1,1,list("G PANEL","G PANEL","G PANEL","","EL GOLD","","G PANEL","G PANEL","G PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("THERMAL OP R","Thermal Optic Receptor",1,1,list("","OP RECEPTOR","","ROM","DIAMOND","DIAMOND","","OP RECEPTOR",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("MASON OP R","Mason Optic Receptor",1,1,list("","OP RECEPTOR","","ROM","EL SILVER","EL SILVER","","OP RECEPTOR",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EAR FRAME","Earpiece Frame",1,1,list("M PANEL","M PANEL","M PANEL","M PANEL","","M PANEL","M PANEL","M PANEL",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RADIO M","Radio Module",1,1,list("","ANTENNA","","","ROM","","CB FRAME","CB FRAME","CB FRAME"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EARPIECE","Radio Earpiece",1,1,list("","","","","RADIO M","","","EAR FRAME",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("EARMUFFS","Earmuffs",1,1,list("","M PANEL","","EAR FRAME","","EAR FRAME","","",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GLASSES FRAME","Glasses Frame",1,1,list("M PANEL","","M PANEL","M PANEL","","M PANEL","M PANEL","M PANEL","M PANEL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("MASONS","Mason Scanners",1,1,list("","","","MASON OP R","GLASSES FRAME","MASON OP R","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("THERMALS","Thermal Scanners",1,1,list("","","","THERMAL OP R","GLASSES FRAME","THERMAL OP R","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SUNGLASSES","Sunglasses",1,1,list("","","","TINTED GL","GLASSES FRAME","TINTED GL","","",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HELMET FR","Helmet Frame",1,1,list("METAL","METAL","METAL","METAL","","METAL","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HELMET","Security Helmet",1,1,list("R METAL","R METAL","R METAL","R METAL","HELMET FR","R METAL","","GLASS",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HOS HELMET","HoS Helmet",1,1,list("SILVER","GOLD","SILVER","SILVER","HELMET","SILVER","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HARDHAT","Hardhat",1,1,list("","FLASHLIGHT","","","HELMET FR","","","",""))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SWAT HELMET","SWAT Helmet",1,1,list("","","","","HELMET","","R GLASS","R GLASS","R GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("WELDING HELM","Welding Helmet",1,1,list("","","","","HELMET FR","","TINTED GL","TINTED GL","TINTED GL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SPACE HELMET","Space Helmet",1,1,list("R METAL","SILVER","R METAL","SILVER","HELMET FR","SILVER","R GLASS","R GLASS","R GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RIG HELMET","RIG Helmet",1,1,list("R METAL","SILVER","R METAL","SILVER","SPACE HELMET","SILVER","R GLASS","R GLASS","R GLASS"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("GAS MASK","Gas Mask",1,1,list("","","","","HELMET FR","TANK VALVE","","G PANEL",""))
|
||||
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ARMOR FRAME","Armor Frame",1,1,list("R METAL","","R METAL","R METAL","R METAL","R METAL","R METAL","R METAL","R METAL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("ARMOR","Armored Vest",1,1,list("R METAL","","R METAL","R METAL","ARMOR FRAME","R METAL","R METAL","R METAL","R METAL"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("HOS ARMOR","HoS Armor",1,1,list("DIAMOND","","DIAMOND","URANIUM","ARMOR","URANIUM","URANIUM","R METAL","URANIUM"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("CAP ARMOR","Captain Armor",1,1,list("DIAMOND","","DIAMOND","URANIUM","HOS ARMOR","URANIUM","URANIUM","R METAL","URANIUM"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SPACE S FR","Space Suit Frame",1,1,list("SILVER","","SILVER","SILVER","SILVER","SILVER","SILVER","SILVER","SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("SPACE SUIT","Space Suit",1,1,list("SILVER","","SILVER","RAM","SPACE S FR","RADIO M","SILVER","SILVEr","SILVER"))
|
||||
CRAFT_ITEMS += new/datum/craftlathe_item("RIG SUIT","RIG Suit",1,1,list("SILVER","","SILVER","SILVER","SPACE SUIT","SILVER","SILVER","SILVER","SILVER"))
|
||||
//TODO: Flashlight, type paths
|
||||
return
|
||||
|
||||
|
||||
|
||||
return
|
||||
@@ -1,78 +1,78 @@
|
||||
/**********************Gas extractor**************************/
|
||||
|
||||
/obj/machinery/mineral/gasextractor
|
||||
name = "Gas extractor"
|
||||
desc = "A machine which extracts gasses from ores"
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "aiupload"
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/message = "";
|
||||
var/processing = 0
|
||||
var/newtoxins = 0
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
|
||||
/obj/machinery/mineral/gasextractor/New()
|
||||
..()
|
||||
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
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/gasextractor/attack_hand(user as mob)
|
||||
|
||||
if(processing == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
var/dat
|
||||
dat = text("input connection status: ")
|
||||
if (input)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
dat += text("<br>output connection status: ")
|
||||
if (output)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
|
||||
dat += text("<br><br><A href='?src=\ref[src];extract=[input]'>Extract gas</A>")
|
||||
|
||||
dat += text("<br><br>Message: [message]")
|
||||
|
||||
user << browse("[dat]", "window=purifier")
|
||||
|
||||
/obj/machinery/mineral/gasextractor/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["extract"])
|
||||
if (src.output)
|
||||
if (locate(/obj/machinery/portable_atmospherics/canister,output.loc))
|
||||
newtoxins = 0
|
||||
processing = 1
|
||||
var/obj/item/weapon/ore/O
|
||||
while(locate(/obj/item/weapon/ore/plasma, input.loc) && locate(/obj/machinery/portable_atmospherics/canister,output.loc))
|
||||
O = locate(/obj/item/weapon/ore/plasma, input.loc)
|
||||
if (istype(O,/obj/item/weapon/ore/plasma))
|
||||
var/obj/machinery/portable_atmospherics/canister/C
|
||||
C = locate(/obj/machinery/portable_atmospherics/canister,output.loc)
|
||||
C.air_contents.toxins += 100
|
||||
newtoxins += 100
|
||||
del(O)
|
||||
sleep(5);
|
||||
processing = 0;
|
||||
message = "Canister filled with [newtoxins] units of toxins"
|
||||
else
|
||||
message = "No canister found"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
/**********************Gas extractor**************************/
|
||||
|
||||
/obj/machinery/mineral/gasextractor
|
||||
name = "Gas extractor"
|
||||
desc = "A machine which extracts gasses from ores"
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "aiupload"
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/message = "";
|
||||
var/processing = 0
|
||||
var/newtoxins = 0
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
|
||||
/obj/machinery/mineral/gasextractor/New()
|
||||
..()
|
||||
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
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/gasextractor/attack_hand(user as mob)
|
||||
|
||||
if(processing == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
var/dat
|
||||
dat = text("input connection status: ")
|
||||
if (input)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
dat += text("<br>output connection status: ")
|
||||
if (output)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
|
||||
dat += text("<br><br><A href='?src=\ref[src];extract=[input]'>Extract gas</A>")
|
||||
|
||||
dat += text("<br><br>Message: [message]")
|
||||
|
||||
user << browse("[dat]", "window=purifier")
|
||||
|
||||
/obj/machinery/mineral/gasextractor/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["extract"])
|
||||
if (src.output)
|
||||
if (locate(/obj/machinery/portable_atmospherics/canister,output.loc))
|
||||
newtoxins = 0
|
||||
processing = 1
|
||||
var/obj/item/weapon/ore/O
|
||||
while(locate(/obj/item/weapon/ore/plasma, input.loc) && locate(/obj/machinery/portable_atmospherics/canister,output.loc))
|
||||
O = locate(/obj/item/weapon/ore/plasma, input.loc)
|
||||
if (istype(O,/obj/item/weapon/ore/plasma))
|
||||
var/obj/machinery/portable_atmospherics/canister/C
|
||||
C = locate(/obj/machinery/portable_atmospherics/canister,output.loc)
|
||||
C.air_contents.toxins += 100
|
||||
newtoxins += 100
|
||||
del(O)
|
||||
sleep(5);
|
||||
processing = 0;
|
||||
message = "Canister filled with [newtoxins] units of toxins"
|
||||
else
|
||||
message = "No canister found"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
@@ -1,88 +1,88 @@
|
||||
/**********************Mineral purifier (not used, replaced with mineral processing unit)**************************/
|
||||
|
||||
/obj/machinery/mineral/purifier
|
||||
name = "Ore Purifier"
|
||||
desc = "A machine which makes building material out of ores"
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "aiupload"
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/processed = 0
|
||||
var/processing = 0
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
|
||||
/obj/machinery/mineral/purifier/attack_hand(user as mob)
|
||||
|
||||
if(processing == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
var/dat
|
||||
dat = text("input connection status: ")
|
||||
if (input)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
dat += text("<br>output connection status: ")
|
||||
if (output)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
|
||||
dat += text("<br><br><A href='?src=\ref[src];purify=[input]'>Purify</A>")
|
||||
|
||||
dat += text("<br><br>found: <font color='green'><b>[processed]</b></font>")
|
||||
user << browse("[dat]", "window=purifier")
|
||||
|
||||
/obj/machinery/mineral/purifier/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["purify"])
|
||||
if (src.output)
|
||||
processing = 1;
|
||||
var/obj/item/weapon/ore/O
|
||||
processed = 0;
|
||||
while(locate(/obj/item/weapon/ore, input.loc))
|
||||
O = locate(/obj/item/weapon/ore, input.loc)
|
||||
if (istype(O,/obj/item/weapon/ore/iron))
|
||||
new /obj/item/stack/sheet/metal(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/diamond))
|
||||
new /obj/item/stack/sheet/diamond(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/plasma))
|
||||
new /obj/item/stack/sheet/plasma(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/gold))
|
||||
new /obj/item/stack/sheet/gold(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/silver))
|
||||
new /obj/item/stack/sheet/silver(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/uranium))
|
||||
new /obj/item/weapon/ore/uranium(output.loc)
|
||||
del(O)
|
||||
/*if (istype(O,/obj/item/weapon/ore/adamantine))
|
||||
new /obj/item/weapon/ore/adamantine(output.loc)
|
||||
del(O)*/ //Dunno what this area does so I'll keep it commented out for now -Durandan
|
||||
processed++
|
||||
sleep(5);
|
||||
processing = 0;
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/mineral/purifier/New()
|
||||
..()
|
||||
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
|
||||
return
|
||||
return
|
||||
/**********************Mineral purifier (not used, replaced with mineral processing unit)**************************/
|
||||
|
||||
/obj/machinery/mineral/purifier
|
||||
name = "Ore Purifier"
|
||||
desc = "A machine which makes building material out of ores"
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "aiupload"
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/processed = 0
|
||||
var/processing = 0
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
|
||||
/obj/machinery/mineral/purifier/attack_hand(user as mob)
|
||||
|
||||
if(processing == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
var/dat
|
||||
dat = text("input connection status: ")
|
||||
if (input)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
dat += text("<br>output connection status: ")
|
||||
if (output)
|
||||
dat += text("<b><font color='green'>CONNECTED</font></b>")
|
||||
else
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b>")
|
||||
|
||||
dat += text("<br><br><A href='?src=\ref[src];purify=[input]'>Purify</A>")
|
||||
|
||||
dat += text("<br><br>found: <font color='green'><b>[processed]</b></font>")
|
||||
user << browse("[dat]", "window=purifier")
|
||||
|
||||
/obj/machinery/mineral/purifier/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["purify"])
|
||||
if (src.output)
|
||||
processing = 1;
|
||||
var/obj/item/weapon/ore/O
|
||||
processed = 0;
|
||||
while(locate(/obj/item/weapon/ore, input.loc))
|
||||
O = locate(/obj/item/weapon/ore, input.loc)
|
||||
if (istype(O,/obj/item/weapon/ore/iron))
|
||||
new /obj/item/stack/sheet/metal(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/diamond))
|
||||
new /obj/item/stack/sheet/diamond(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/plasma))
|
||||
new /obj/item/stack/sheet/plasma(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/gold))
|
||||
new /obj/item/stack/sheet/gold(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/silver))
|
||||
new /obj/item/stack/sheet/silver(output.loc)
|
||||
del(O)
|
||||
if (istype(O,/obj/item/weapon/ore/uranium))
|
||||
new /obj/item/weapon/ore/uranium(output.loc)
|
||||
del(O)
|
||||
/*if (istype(O,/obj/item/weapon/ore/adamantine))
|
||||
new /obj/item/weapon/ore/adamantine(output.loc)
|
||||
del(O)*/ //Dunno what this area does so I'll keep it commented out for now -Durandan
|
||||
processed++
|
||||
sleep(5);
|
||||
processing = 0;
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/mineral/purifier/New()
|
||||
..()
|
||||
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
|
||||
return
|
||||
return
|
||||
|
||||
@@ -1,174 +1,174 @@
|
||||
/**********************Random mine generator************************/
|
||||
|
||||
//this item is intended to give the effect of entering the mine, so that light gradually fades
|
||||
/obj/effect/mine_generator
|
||||
name = "Random mine generator"
|
||||
anchored = 1
|
||||
unacidable = 1
|
||||
var/turf/last_loc
|
||||
var/turf/target_loc
|
||||
var/turf/start_loc
|
||||
var/randXParam //the value of these two parameters are generated by the code itself and used to
|
||||
var/randYParam //determine the random XY parameters
|
||||
var/mineDirection = 3
|
||||
/*
|
||||
0 = none
|
||||
1 = N
|
||||
2 = NNW
|
||||
3 = NW
|
||||
4 = WNW
|
||||
5 = W
|
||||
6 = WSW
|
||||
7 = SW
|
||||
8 = SSW
|
||||
9 = S
|
||||
10 = SSE
|
||||
11 = SE
|
||||
12 = ESE
|
||||
13 = E
|
||||
14 = ENE
|
||||
15 = NE
|
||||
16 = NNE
|
||||
*/
|
||||
|
||||
/obj/effect/mine_generator/New()
|
||||
last_loc = src.loc
|
||||
var/i
|
||||
for(i = 0; i < 50; i++)
|
||||
gererateTargetLoc()
|
||||
//target_loc = locate(last_loc.x + rand(5), last_loc.y + rand(5), src.z)
|
||||
fillWithAsteroids()
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/effect/mine_generator/proc/gererateTargetLoc() //this proc determines where the next square-room will end.
|
||||
switch(mineDirection)
|
||||
if(1)
|
||||
randXParam = 0
|
||||
randYParam = 4
|
||||
if(2)
|
||||
randXParam = 1
|
||||
randYParam = 3
|
||||
if(3)
|
||||
randXParam = 2
|
||||
randYParam = 2
|
||||
if(4)
|
||||
randXParam = 3
|
||||
randYParam = 1
|
||||
if(5)
|
||||
randXParam = 4
|
||||
randYParam = 0
|
||||
if(6)
|
||||
randXParam = 3
|
||||
randYParam = -1
|
||||
if(7)
|
||||
randXParam = 2
|
||||
randYParam = -2
|
||||
if(8)
|
||||
randXParam = 1
|
||||
randYParam = -3
|
||||
if(9)
|
||||
randXParam = 0
|
||||
randYParam = -4
|
||||
if(10)
|
||||
randXParam = -1
|
||||
randYParam = -3
|
||||
if(11)
|
||||
randXParam = -2
|
||||
randYParam = -2
|
||||
if(12)
|
||||
randXParam = -3
|
||||
randYParam = -1
|
||||
if(13)
|
||||
randXParam = -4
|
||||
randYParam = 0
|
||||
if(14)
|
||||
randXParam = -3
|
||||
randYParam = 1
|
||||
if(15)
|
||||
randXParam = -2
|
||||
randYParam = 2
|
||||
if(16)
|
||||
randXParam = -1
|
||||
randYParam = 3
|
||||
target_loc = last_loc
|
||||
if (randXParam > 0)
|
||||
target_loc = locate(target_loc.x+rand(randXParam),target_loc.y,src.z)
|
||||
if (randYParam > 0)
|
||||
target_loc = locate(target_loc.x,target_loc.y+rand(randYParam),src.z)
|
||||
if (randXParam < 0)
|
||||
target_loc = locate(target_loc.x-rand(-randXParam),target_loc.y,src.z)
|
||||
if (randYParam < 0)
|
||||
target_loc = locate(target_loc.x,target_loc.y-rand(-randXParam),src.z)
|
||||
if (mineDirection == 1 || mineDirection == 5 || mineDirection == 9 || mineDirection == 13) //if N,S,E,W, turn quickly
|
||||
if(prob(50))
|
||||
mineDirection += 2
|
||||
else
|
||||
mineDirection -= 2
|
||||
if(mineDirection < 1)
|
||||
mineDirection += 16
|
||||
else
|
||||
if(prob(50))
|
||||
if(prob(50))
|
||||
mineDirection += 1
|
||||
else
|
||||
mineDirection -= 1
|
||||
if(mineDirection < 1)
|
||||
mineDirection += 16
|
||||
return
|
||||
|
||||
|
||||
/obj/effect/mine_generator/proc/fillWithAsteroids()
|
||||
|
||||
if(last_loc)
|
||||
start_loc = last_loc
|
||||
|
||||
if(start_loc && target_loc)
|
||||
var/x1
|
||||
var/y1
|
||||
|
||||
var/turf/line_start = start_loc
|
||||
var/turf/column = line_start
|
||||
|
||||
if(start_loc.x <= target_loc.x)
|
||||
if(start_loc.y <= target_loc.y) //GOING NORTH-EAST
|
||||
for(y1 = start_loc.y; y1 <= target_loc.y; y1++)
|
||||
for(x1 = start_loc.x; x1 <= target_loc.x; x1++)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,EAST)
|
||||
line_start = get_step(line_start,NORTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
else //GOING NORTH-WEST
|
||||
for(y1 = start_loc.y; y1 >= target_loc.y; y1--)
|
||||
for(x1 = start_loc.x; x1 <= target_loc.x; x1++)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,WEST)
|
||||
line_start = get_step(line_start,NORTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
else
|
||||
if(start_loc.y <= target_loc.y) //GOING SOUTH-EAST
|
||||
for(y1 = start_loc.y; y1 <= target_loc.y; y1++)
|
||||
for(x1 = start_loc.x; x1 >= target_loc.x; x1--)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,EAST)
|
||||
line_start = get_step(line_start,SOUTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
else //GOING SOUTH-WEST
|
||||
for(y1 = start_loc.y; y1 >= target_loc.y; y1--)
|
||||
for(x1 = start_loc.x; x1 >= target_loc.x; x1--)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,WEST)
|
||||
line_start = get_step(line_start,SOUTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
|
||||
|
||||
/**********************Random mine generator************************/
|
||||
|
||||
//this item is intended to give the effect of entering the mine, so that light gradually fades
|
||||
/obj/effect/mine_generator
|
||||
name = "Random mine generator"
|
||||
anchored = 1
|
||||
unacidable = 1
|
||||
var/turf/last_loc
|
||||
var/turf/target_loc
|
||||
var/turf/start_loc
|
||||
var/randXParam //the value of these two parameters are generated by the code itself and used to
|
||||
var/randYParam //determine the random XY parameters
|
||||
var/mineDirection = 3
|
||||
/*
|
||||
0 = none
|
||||
1 = N
|
||||
2 = NNW
|
||||
3 = NW
|
||||
4 = WNW
|
||||
5 = W
|
||||
6 = WSW
|
||||
7 = SW
|
||||
8 = SSW
|
||||
9 = S
|
||||
10 = SSE
|
||||
11 = SE
|
||||
12 = ESE
|
||||
13 = E
|
||||
14 = ENE
|
||||
15 = NE
|
||||
16 = NNE
|
||||
*/
|
||||
|
||||
/obj/effect/mine_generator/New()
|
||||
last_loc = src.loc
|
||||
var/i
|
||||
for(i = 0; i < 50; i++)
|
||||
gererateTargetLoc()
|
||||
//target_loc = locate(last_loc.x + rand(5), last_loc.y + rand(5), src.z)
|
||||
fillWithAsteroids()
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/effect/mine_generator/proc/gererateTargetLoc() //this proc determines where the next square-room will end.
|
||||
switch(mineDirection)
|
||||
if(1)
|
||||
randXParam = 0
|
||||
randYParam = 4
|
||||
if(2)
|
||||
randXParam = 1
|
||||
randYParam = 3
|
||||
if(3)
|
||||
randXParam = 2
|
||||
randYParam = 2
|
||||
if(4)
|
||||
randXParam = 3
|
||||
randYParam = 1
|
||||
if(5)
|
||||
randXParam = 4
|
||||
randYParam = 0
|
||||
if(6)
|
||||
randXParam = 3
|
||||
randYParam = -1
|
||||
if(7)
|
||||
randXParam = 2
|
||||
randYParam = -2
|
||||
if(8)
|
||||
randXParam = 1
|
||||
randYParam = -3
|
||||
if(9)
|
||||
randXParam = 0
|
||||
randYParam = -4
|
||||
if(10)
|
||||
randXParam = -1
|
||||
randYParam = -3
|
||||
if(11)
|
||||
randXParam = -2
|
||||
randYParam = -2
|
||||
if(12)
|
||||
randXParam = -3
|
||||
randYParam = -1
|
||||
if(13)
|
||||
randXParam = -4
|
||||
randYParam = 0
|
||||
if(14)
|
||||
randXParam = -3
|
||||
randYParam = 1
|
||||
if(15)
|
||||
randXParam = -2
|
||||
randYParam = 2
|
||||
if(16)
|
||||
randXParam = -1
|
||||
randYParam = 3
|
||||
target_loc = last_loc
|
||||
if (randXParam > 0)
|
||||
target_loc = locate(target_loc.x+rand(randXParam),target_loc.y,src.z)
|
||||
if (randYParam > 0)
|
||||
target_loc = locate(target_loc.x,target_loc.y+rand(randYParam),src.z)
|
||||
if (randXParam < 0)
|
||||
target_loc = locate(target_loc.x-rand(-randXParam),target_loc.y,src.z)
|
||||
if (randYParam < 0)
|
||||
target_loc = locate(target_loc.x,target_loc.y-rand(-randXParam),src.z)
|
||||
if (mineDirection == 1 || mineDirection == 5 || mineDirection == 9 || mineDirection == 13) //if N,S,E,W, turn quickly
|
||||
if(prob(50))
|
||||
mineDirection += 2
|
||||
else
|
||||
mineDirection -= 2
|
||||
if(mineDirection < 1)
|
||||
mineDirection += 16
|
||||
else
|
||||
if(prob(50))
|
||||
if(prob(50))
|
||||
mineDirection += 1
|
||||
else
|
||||
mineDirection -= 1
|
||||
if(mineDirection < 1)
|
||||
mineDirection += 16
|
||||
return
|
||||
|
||||
|
||||
/obj/effect/mine_generator/proc/fillWithAsteroids()
|
||||
|
||||
if(last_loc)
|
||||
start_loc = last_loc
|
||||
|
||||
if(start_loc && target_loc)
|
||||
var/x1
|
||||
var/y1
|
||||
|
||||
var/turf/line_start = start_loc
|
||||
var/turf/column = line_start
|
||||
|
||||
if(start_loc.x <= target_loc.x)
|
||||
if(start_loc.y <= target_loc.y) //GOING NORTH-EAST
|
||||
for(y1 = start_loc.y; y1 <= target_loc.y; y1++)
|
||||
for(x1 = start_loc.x; x1 <= target_loc.x; x1++)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,EAST)
|
||||
line_start = get_step(line_start,NORTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
else //GOING NORTH-WEST
|
||||
for(y1 = start_loc.y; y1 >= target_loc.y; y1--)
|
||||
for(x1 = start_loc.x; x1 <= target_loc.x; x1++)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,WEST)
|
||||
line_start = get_step(line_start,NORTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
else
|
||||
if(start_loc.y <= target_loc.y) //GOING SOUTH-EAST
|
||||
for(y1 = start_loc.y; y1 <= target_loc.y; y1++)
|
||||
for(x1 = start_loc.x; x1 >= target_loc.x; x1--)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,EAST)
|
||||
line_start = get_step(line_start,SOUTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
else //GOING SOUTH-WEST
|
||||
for(y1 = start_loc.y; y1 >= target_loc.y; y1--)
|
||||
for(x1 = start_loc.x; x1 >= target_loc.x; x1--)
|
||||
new/turf/simulated/floor/plating/airless/asteroid(column)
|
||||
column = get_step(column,WEST)
|
||||
line_start = get_step(line_start,SOUTH)
|
||||
column = line_start
|
||||
last_loc = target_loc
|
||||
return
|
||||
|
||||
|
||||
return
|
||||
+337
-337
@@ -1,338 +1,338 @@
|
||||
/**********************Rail track**************************/
|
||||
|
||||
/obj/machinery/rail_track
|
||||
name = "Rail track"
|
||||
icon = 'Mining.dmi'
|
||||
icon_state = "rail"
|
||||
dir = 2
|
||||
var/id = null //this is needed for switches to work Set to the same on the whole length of the track
|
||||
anchored = 1
|
||||
|
||||
/**********************Rail intersection**************************/
|
||||
|
||||
/obj/machinery/rail_track/intersections
|
||||
name = "Rail track intersection"
|
||||
icon_state = "rail_intersection"
|
||||
|
||||
/obj/machinery/rail_track/intersections/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (1) dir = 5
|
||||
if (5) dir = 4
|
||||
if (4) dir = 9
|
||||
if (9) dir = 2
|
||||
if (2) dir = 10
|
||||
if (10) dir = 8
|
||||
if (8) dir = 6
|
||||
if (6) dir = 1
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSE
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_NSE"
|
||||
dir = 2
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSE/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (1) dir = 5
|
||||
if (2) dir = 5
|
||||
if (5) dir = 9
|
||||
if (9) dir = 2
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/SEW
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_SEW"
|
||||
dir = 8
|
||||
|
||||
/obj/machinery/rail_track/intersections/SEW/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (8) dir = 6
|
||||
if (4) dir = 6
|
||||
if (6) dir = 5
|
||||
if (5) dir = 8
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSW
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_NSW"
|
||||
dir = 2
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSW/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (1) dir = 10
|
||||
if (2) dir = 10
|
||||
if (10) dir = 6
|
||||
if (6) dir = 2
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/NEW
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_NEW"
|
||||
dir = 8
|
||||
|
||||
/obj/machinery/rail_track/intersections/NEW/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (4) dir = 9
|
||||
if (8) dir = 9
|
||||
if (9) dir = 10
|
||||
if (10) dir = 8
|
||||
return
|
||||
|
||||
/**********************Rail switch**************************/
|
||||
|
||||
/obj/machinery/rail_switch
|
||||
name = "Rail switch"
|
||||
icon = 'Mining.dmi'
|
||||
icon_state = "rail"
|
||||
dir = 2
|
||||
icon = 'recycling.dmi'
|
||||
icon_state = "switch-off"
|
||||
var/obj/machinery/rail_track/track = null
|
||||
var/id //used for to change the track pieces
|
||||
|
||||
/obj/machinery/rail_switch/New()
|
||||
spawn(10)
|
||||
src.track = locate(/obj/machinery/rail_track, get_step(src, NORTH))
|
||||
if(track)
|
||||
id = track.id
|
||||
return
|
||||
|
||||
/obj/machinery/rail_switch/attack_hand(user as mob)
|
||||
user << "You switch the rail track's direction"
|
||||
for (var/obj/machinery/rail_track/T in world)
|
||||
if (T.id == src.id)
|
||||
var/obj/machinery/rail_car/C = locate(/obj/machinery/rail_car, T.loc)
|
||||
if (C)
|
||||
switch (T.dir)
|
||||
if(1)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "N"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(2)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "N"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(4)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "E"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "W"
|
||||
if("W") C.direction = "E"
|
||||
if(8)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "E"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "W"
|
||||
if("W") C.direction = "E"
|
||||
if(5)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(6)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "W"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(9)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "E"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "N"
|
||||
if("W") C.direction = "E"
|
||||
if(10)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "W"
|
||||
if("S") C.direction = "W"
|
||||
if("E") C.direction = "W"
|
||||
if("W") C.direction = "N"
|
||||
return
|
||||
|
||||
/**********************Rail car**************************/
|
||||
|
||||
/obj/machinery/rail_car
|
||||
name = "Rail car"
|
||||
icon = 'Storage.dmi'
|
||||
icon_state = "miningcar"
|
||||
var/direction = "S" //S = south, N = north, E = east, W = west. Determines whichw ay it'll look first
|
||||
var/moving = 0;
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/speed = 0
|
||||
var/slowing = 0
|
||||
var/atom/movable/load = null //what it's carrying
|
||||
|
||||
/obj/machinery/rail_car/attack_hand(user as mob)
|
||||
if (moving == 0)
|
||||
processing_items.Add(src)
|
||||
moving = 1
|
||||
else
|
||||
processing_items.Remove(src)
|
||||
moving = 0
|
||||
return
|
||||
|
||||
/*
|
||||
for (var/client/C)
|
||||
C << "Dela."
|
||||
*/
|
||||
|
||||
/obj/machinery/rail_car/MouseDrop_T(var/atom/movable/C, mob/user)
|
||||
|
||||
if(user.stat)
|
||||
return
|
||||
|
||||
if (!istype(C) || C.anchored || get_dist(user, src) > 1 || get_dist(src,C) > 1 )
|
||||
return
|
||||
|
||||
if(ismob(C))
|
||||
load(C)
|
||||
|
||||
|
||||
/obj/machinery/rail_car/proc/load(var/atom/movable/C)
|
||||
|
||||
if(get_dist(C, src) > 1)
|
||||
return
|
||||
//mode = 1
|
||||
|
||||
C.loc = src.loc
|
||||
sleep(2)
|
||||
C.loc = src
|
||||
load = C
|
||||
|
||||
C.pixel_y += 9
|
||||
if(C.layer < layer)
|
||||
C.layer = layer + 0.1
|
||||
overlays += C
|
||||
|
||||
if(ismob(C))
|
||||
var/mob/M = C
|
||||
if(M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
//mode = 0
|
||||
//send_status()
|
||||
|
||||
/obj/machinery/rail_car/proc/unload(var/dirn = 0)
|
||||
if(!load)
|
||||
return
|
||||
|
||||
overlays = null
|
||||
|
||||
load.loc = src.loc
|
||||
load.pixel_y -= 9
|
||||
load.layer = initial(load.layer)
|
||||
if(ismob(load))
|
||||
var/mob/M = load
|
||||
if(M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
|
||||
if(dirn)
|
||||
step(load, dirn)
|
||||
|
||||
load = null
|
||||
|
||||
// in case non-load items end up in contents, dump every else too
|
||||
// this seems to happen sometimes due to race conditions
|
||||
// with items dropping as mobs are loaded
|
||||
|
||||
for(var/atom/movable/AM in src)
|
||||
AM.loc = src.loc
|
||||
AM.layer = initial(AM.layer)
|
||||
AM.pixel_y = initial(AM.pixel_y)
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
/obj/machinery/rail_car/relaymove(var/mob/user)
|
||||
if(user.stat)
|
||||
return
|
||||
if(load == user)
|
||||
unload(0)
|
||||
return
|
||||
|
||||
/obj/machinery/rail_car/process()
|
||||
if (moving == 1)
|
||||
if (slowing == 1)
|
||||
if (speed > 0)
|
||||
speed--;
|
||||
if (speed == 0)
|
||||
slowing = 0
|
||||
else
|
||||
if (speed < 10)
|
||||
speed++;
|
||||
var/i = 0
|
||||
for (i = 0; i < speed; i++)
|
||||
if (moving == 1)
|
||||
switch (direction)
|
||||
if ("S")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x,src.y-1,src.z))
|
||||
if (R.dir == 10)
|
||||
direction = "W"
|
||||
if (R.dir == 9)
|
||||
direction = "E"
|
||||
if (R.dir == 2 || R.dir == 1 || R.dir == 10 || R.dir == 9)
|
||||
for (var/mob/living/M in locate(src.x,src.y-1,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
if ("N")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x,src.y+1,src.z))
|
||||
if (R.dir == 5)
|
||||
direction = "E"
|
||||
if (R.dir == 6)
|
||||
direction = "W"
|
||||
if (R.dir == 5 || R.dir == 1 || R.dir == 6 || R.dir == 2)
|
||||
for (var/mob/living/M in locate(src.x,src.y+1,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
if ("E")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x+1,src.y,src.z))
|
||||
if (R.dir == 6)
|
||||
direction = "S"
|
||||
if (R.dir == 10)
|
||||
direction = "N"
|
||||
if (R.dir == 4 || R.dir == 8 || R.dir == 10 || R.dir == 6)
|
||||
for (var/mob/living/M in locate(src.x+1,src.y,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
if ("W")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x-1,src.y,src.z))
|
||||
if (R.dir == 9)
|
||||
direction = "N"
|
||||
if (R.dir == 5)
|
||||
direction = "S"
|
||||
if (R.dir == 8 || R.dir == 9 || R.dir == 5 || R.dir == 4)
|
||||
for (var/mob/living/M in locate(src.x-1,src.y,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
sleep(1)
|
||||
else
|
||||
processing_items.Remove(src)
|
||||
moving = 0
|
||||
/**********************Rail track**************************/
|
||||
|
||||
/obj/machinery/rail_track
|
||||
name = "Rail track"
|
||||
icon = 'Mining.dmi'
|
||||
icon_state = "rail"
|
||||
dir = 2
|
||||
var/id = null //this is needed for switches to work Set to the same on the whole length of the track
|
||||
anchored = 1
|
||||
|
||||
/**********************Rail intersection**************************/
|
||||
|
||||
/obj/machinery/rail_track/intersections
|
||||
name = "Rail track intersection"
|
||||
icon_state = "rail_intersection"
|
||||
|
||||
/obj/machinery/rail_track/intersections/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (1) dir = 5
|
||||
if (5) dir = 4
|
||||
if (4) dir = 9
|
||||
if (9) dir = 2
|
||||
if (2) dir = 10
|
||||
if (10) dir = 8
|
||||
if (8) dir = 6
|
||||
if (6) dir = 1
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSE
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_NSE"
|
||||
dir = 2
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSE/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (1) dir = 5
|
||||
if (2) dir = 5
|
||||
if (5) dir = 9
|
||||
if (9) dir = 2
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/SEW
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_SEW"
|
||||
dir = 8
|
||||
|
||||
/obj/machinery/rail_track/intersections/SEW/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (8) dir = 6
|
||||
if (4) dir = 6
|
||||
if (6) dir = 5
|
||||
if (5) dir = 8
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSW
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_NSW"
|
||||
dir = 2
|
||||
|
||||
/obj/machinery/rail_track/intersections/NSW/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (1) dir = 10
|
||||
if (2) dir = 10
|
||||
if (10) dir = 6
|
||||
if (6) dir = 2
|
||||
return
|
||||
|
||||
/obj/machinery/rail_track/intersections/NEW
|
||||
name = "Rail track T intersection"
|
||||
icon_state = "rail_intersection_NEW"
|
||||
dir = 8
|
||||
|
||||
/obj/machinery/rail_track/intersections/NEW/attack_hand(user as mob)
|
||||
switch (dir)
|
||||
if (4) dir = 9
|
||||
if (8) dir = 9
|
||||
if (9) dir = 10
|
||||
if (10) dir = 8
|
||||
return
|
||||
|
||||
/**********************Rail switch**************************/
|
||||
|
||||
/obj/machinery/rail_switch
|
||||
name = "Rail switch"
|
||||
icon = 'Mining.dmi'
|
||||
icon_state = "rail"
|
||||
dir = 2
|
||||
icon = 'recycling.dmi'
|
||||
icon_state = "switch-off"
|
||||
var/obj/machinery/rail_track/track = null
|
||||
var/id //used for to change the track pieces
|
||||
|
||||
/obj/machinery/rail_switch/New()
|
||||
spawn(10)
|
||||
src.track = locate(/obj/machinery/rail_track, get_step(src, NORTH))
|
||||
if(track)
|
||||
id = track.id
|
||||
return
|
||||
|
||||
/obj/machinery/rail_switch/attack_hand(user as mob)
|
||||
user << "You switch the rail track's direction"
|
||||
for (var/obj/machinery/rail_track/T in world)
|
||||
if (T.id == src.id)
|
||||
var/obj/machinery/rail_car/C = locate(/obj/machinery/rail_car, T.loc)
|
||||
if (C)
|
||||
switch (T.dir)
|
||||
if(1)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "N"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(2)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "N"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(4)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "E"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "W"
|
||||
if("W") C.direction = "E"
|
||||
if(8)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "E"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "W"
|
||||
if("W") C.direction = "E"
|
||||
if(5)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(6)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "S"
|
||||
if("S") C.direction = "W"
|
||||
if("E") C.direction = "S"
|
||||
if("W") C.direction = "S"
|
||||
if(9)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "E"
|
||||
if("S") C.direction = "E"
|
||||
if("E") C.direction = "N"
|
||||
if("W") C.direction = "E"
|
||||
if(10)
|
||||
switch(C.direction)
|
||||
if("N") C.direction = "W"
|
||||
if("S") C.direction = "W"
|
||||
if("E") C.direction = "W"
|
||||
if("W") C.direction = "N"
|
||||
return
|
||||
|
||||
/**********************Rail car**************************/
|
||||
|
||||
/obj/machinery/rail_car
|
||||
name = "Rail car"
|
||||
icon = 'Storage.dmi'
|
||||
icon_state = "miningcar"
|
||||
var/direction = "S" //S = south, N = north, E = east, W = west. Determines whichw ay it'll look first
|
||||
var/moving = 0;
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/speed = 0
|
||||
var/slowing = 0
|
||||
var/atom/movable/load = null //what it's carrying
|
||||
|
||||
/obj/machinery/rail_car/attack_hand(user as mob)
|
||||
if (moving == 0)
|
||||
processing_items.Add(src)
|
||||
moving = 1
|
||||
else
|
||||
processing_items.Remove(src)
|
||||
moving = 0
|
||||
return
|
||||
|
||||
/*
|
||||
for (var/client/C)
|
||||
C << "Dela."
|
||||
*/
|
||||
|
||||
/obj/machinery/rail_car/MouseDrop_T(var/atom/movable/C, mob/user)
|
||||
|
||||
if(user.stat)
|
||||
return
|
||||
|
||||
if (!istype(C) || C.anchored || get_dist(user, src) > 1 || get_dist(src,C) > 1 )
|
||||
return
|
||||
|
||||
if(ismob(C))
|
||||
load(C)
|
||||
|
||||
|
||||
/obj/machinery/rail_car/proc/load(var/atom/movable/C)
|
||||
|
||||
if(get_dist(C, src) > 1)
|
||||
return
|
||||
//mode = 1
|
||||
|
||||
C.loc = src.loc
|
||||
sleep(2)
|
||||
C.loc = src
|
||||
load = C
|
||||
|
||||
C.pixel_y += 9
|
||||
if(C.layer < layer)
|
||||
C.layer = layer + 0.1
|
||||
overlays += C
|
||||
|
||||
if(ismob(C))
|
||||
var/mob/M = C
|
||||
if(M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
//mode = 0
|
||||
//send_status()
|
||||
|
||||
/obj/machinery/rail_car/proc/unload(var/dirn = 0)
|
||||
if(!load)
|
||||
return
|
||||
|
||||
overlays = null
|
||||
|
||||
load.loc = src.loc
|
||||
load.pixel_y -= 9
|
||||
load.layer = initial(load.layer)
|
||||
if(ismob(load))
|
||||
var/mob/M = load
|
||||
if(M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
|
||||
if(dirn)
|
||||
step(load, dirn)
|
||||
|
||||
load = null
|
||||
|
||||
// in case non-load items end up in contents, dump every else too
|
||||
// this seems to happen sometimes due to race conditions
|
||||
// with items dropping as mobs are loaded
|
||||
|
||||
for(var/atom/movable/AM in src)
|
||||
AM.loc = src.loc
|
||||
AM.layer = initial(AM.layer)
|
||||
AM.pixel_y = initial(AM.pixel_y)
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
/obj/machinery/rail_car/relaymove(var/mob/user)
|
||||
if(user.stat)
|
||||
return
|
||||
if(load == user)
|
||||
unload(0)
|
||||
return
|
||||
|
||||
/obj/machinery/rail_car/process()
|
||||
if (moving == 1)
|
||||
if (slowing == 1)
|
||||
if (speed > 0)
|
||||
speed--;
|
||||
if (speed == 0)
|
||||
slowing = 0
|
||||
else
|
||||
if (speed < 10)
|
||||
speed++;
|
||||
var/i = 0
|
||||
for (i = 0; i < speed; i++)
|
||||
if (moving == 1)
|
||||
switch (direction)
|
||||
if ("S")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x,src.y-1,src.z))
|
||||
if (R.dir == 10)
|
||||
direction = "W"
|
||||
if (R.dir == 9)
|
||||
direction = "E"
|
||||
if (R.dir == 2 || R.dir == 1 || R.dir == 10 || R.dir == 9)
|
||||
for (var/mob/living/M in locate(src.x,src.y-1,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
if ("N")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x,src.y+1,src.z))
|
||||
if (R.dir == 5)
|
||||
direction = "E"
|
||||
if (R.dir == 6)
|
||||
direction = "W"
|
||||
if (R.dir == 5 || R.dir == 1 || R.dir == 6 || R.dir == 2)
|
||||
for (var/mob/living/M in locate(src.x,src.y+1,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
if ("E")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x+1,src.y,src.z))
|
||||
if (R.dir == 6)
|
||||
direction = "S"
|
||||
if (R.dir == 10)
|
||||
direction = "N"
|
||||
if (R.dir == 4 || R.dir == 8 || R.dir == 10 || R.dir == 6)
|
||||
for (var/mob/living/M in locate(src.x+1,src.y,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
if ("W")
|
||||
for (var/obj/machinery/rail_track/R in locate(src.x-1,src.y,src.z))
|
||||
if (R.dir == 9)
|
||||
direction = "N"
|
||||
if (R.dir == 5)
|
||||
direction = "S"
|
||||
if (R.dir == 8 || R.dir == 9 || R.dir == 5 || R.dir == 4)
|
||||
for (var/mob/living/M in locate(src.x-1,src.y,src.z))
|
||||
step(M,get_dir(src,R))
|
||||
step(src,get_dir(src,R))
|
||||
break
|
||||
else
|
||||
moving = 0
|
||||
speed = 0
|
||||
sleep(1)
|
||||
else
|
||||
processing_items.Remove(src)
|
||||
moving = 0
|
||||
return
|
||||
@@ -1,173 +1,173 @@
|
||||
/**********************Spaceship builder area definitions**************************/
|
||||
|
||||
/area/shipbuilder
|
||||
requires_power = 0
|
||||
luminosity = 1
|
||||
sd_lighting = 0
|
||||
|
||||
/area/shipbuilder/station
|
||||
name = "shipbuilder station"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship1
|
||||
name = "shipbuilder ship1"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship2
|
||||
name = "shipbuilder ship2"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship3
|
||||
name = "shipbuilder ship3"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship4
|
||||
name = "shipbuilder ship4"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship5
|
||||
name = "shipbuilder ship5"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship6
|
||||
name = "shipbuilder ship6"
|
||||
icon_state = "teleporter"
|
||||
|
||||
|
||||
/**********************Spaceship builder**************************/
|
||||
|
||||
/obj/machinery/spaceship_builder
|
||||
name = "Robotic Fabricator"
|
||||
icon = 'surgery.dmi'
|
||||
icon_state = "fab-idle"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/metal_amount = 0
|
||||
var/operating = 0
|
||||
var/area/currentShuttleArea = null
|
||||
var/currentShuttleName = null
|
||||
|
||||
/obj/machinery/spaceship_builder/proc/buildShuttle(var/shuttle)
|
||||
|
||||
var/shuttleat = null
|
||||
var/shuttleto = "/area/shipbuilder/station"
|
||||
|
||||
var/req_metal = 0
|
||||
switch(shuttle)
|
||||
if("hopper")
|
||||
shuttleat = "/area/shipbuilder/ship1"
|
||||
currentShuttleName = "Planet hopper"
|
||||
req_metal = 25000
|
||||
if("bus")
|
||||
shuttleat = "/area/shipbuilder/ship2"
|
||||
currentShuttleName = "Blnder Bus"
|
||||
req_metal = 60000
|
||||
if("dinghy")
|
||||
shuttleat = "/area/shipbuilder/ship3"
|
||||
currentShuttleName = "Space dinghy"
|
||||
req_metal = 100000
|
||||
if("van")
|
||||
shuttleat = "/area/shipbuilder/ship4"
|
||||
currentShuttleName = "Boxvan MMDLVI"
|
||||
req_metal = 120000
|
||||
if("secvan")
|
||||
shuttleat = "/area/shipbuilder/ship5"
|
||||
currentShuttleName = "Boxvan MMDLVI - Security edition"
|
||||
req_metal = 125000
|
||||
if("station4")
|
||||
shuttleat = "/area/shipbuilder/ship6"
|
||||
currentShuttleName = "Space station 4"
|
||||
req_metal = 250000
|
||||
|
||||
if (metal_amount - req_metal < 0)
|
||||
return
|
||||
|
||||
if (!shuttleat)
|
||||
return
|
||||
|
||||
var/area/from = locate(shuttleat)
|
||||
var/area/dest = locate(shuttleto)
|
||||
|
||||
if(!from || !dest)
|
||||
return
|
||||
|
||||
currentShuttleArea = shuttleat
|
||||
from.move_contents_to(dest)
|
||||
return
|
||||
|
||||
/obj/machinery/spaceship_builder/proc/scrapShuttle()
|
||||
|
||||
var/shuttleat = "/area/shipbuilder/station"
|
||||
var/shuttleto = currentShuttleArea
|
||||
|
||||
if (!shuttleto)
|
||||
return
|
||||
|
||||
var/area/from = locate(shuttleat)
|
||||
var/area/dest = locate(shuttleto)
|
||||
|
||||
if(!from || !dest)
|
||||
return
|
||||
|
||||
currentShuttleArea = null
|
||||
currentShuttleName = null
|
||||
from.move_contents_to(dest)
|
||||
return
|
||||
|
||||
/obj/machinery/spaceship_builder/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if(operating == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/stack/sheet/metal))
|
||||
|
||||
var/obj/item/stack/sheet/metal/M = W
|
||||
user << "\blue You insert all the metal into the machine."
|
||||
metal_amount += M.amount * 100
|
||||
del(M)
|
||||
|
||||
else
|
||||
return attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/spaceship_builder/attack_hand(user as mob)
|
||||
if(operating == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
var/dat
|
||||
dat = text("<b>Ship fabricator</b><br><br>")
|
||||
dat += text("Current ammount of <font color='gray'>Metal: <b>[metal_amount]</b></font><br><hr>")
|
||||
|
||||
if (currentShuttleArea)
|
||||
dat += text("<b>Currently building</b><br><br>[currentShuttleName]<br><br>")
|
||||
dat += text("<b>Build the shuttle to your liking.</b><br>This shuttle will be sent to the station in the event of an emergency along with a centcom emergency shuttle.")
|
||||
dat += text("<br><br><br><A href='?src=\ref[src];scrap=1'>Scrap current shuttle</A>")
|
||||
else
|
||||
dat += text("<b>Available ships to build:</b><br><br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=hopper'>Planet hopper</A> - Tiny, Slow, 25000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=bus'>Blunder Bus</A> - Small, Decent speed, 60000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=dinghy'>Space dinghy</A> - Medium size, Decent speed, 100000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=van'>Boxvan MMDLVIr</A> - Medium size, Decent speed, 120000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=secvan'>Boxvan MMDLVI - Security eidition</A> - Large, Rather slow, 125000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=station4'>Space station 4</A> - Huge, Slow, 250000 metal<br>")
|
||||
|
||||
user << browse("[dat]", "window=shipbuilder")
|
||||
|
||||
|
||||
/obj/machinery/spaceship_builder/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["ship"])
|
||||
buildShuttle(href_list["ship"])
|
||||
if(href_list["scrap"])
|
||||
scrapShuttle(href_list["ship"])
|
||||
src.updateUsrDialog()
|
||||
/**********************Spaceship builder area definitions**************************/
|
||||
|
||||
/area/shipbuilder
|
||||
requires_power = 0
|
||||
luminosity = 1
|
||||
sd_lighting = 0
|
||||
|
||||
/area/shipbuilder/station
|
||||
name = "shipbuilder station"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship1
|
||||
name = "shipbuilder ship1"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship2
|
||||
name = "shipbuilder ship2"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship3
|
||||
name = "shipbuilder ship3"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship4
|
||||
name = "shipbuilder ship4"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship5
|
||||
name = "shipbuilder ship5"
|
||||
icon_state = "teleporter"
|
||||
|
||||
/area/shipbuilder/ship6
|
||||
name = "shipbuilder ship6"
|
||||
icon_state = "teleporter"
|
||||
|
||||
|
||||
/**********************Spaceship builder**************************/
|
||||
|
||||
/obj/machinery/spaceship_builder
|
||||
name = "Robotic Fabricator"
|
||||
icon = 'surgery.dmi'
|
||||
icon_state = "fab-idle"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/metal_amount = 0
|
||||
var/operating = 0
|
||||
var/area/currentShuttleArea = null
|
||||
var/currentShuttleName = null
|
||||
|
||||
/obj/machinery/spaceship_builder/proc/buildShuttle(var/shuttle)
|
||||
|
||||
var/shuttleat = null
|
||||
var/shuttleto = "/area/shipbuilder/station"
|
||||
|
||||
var/req_metal = 0
|
||||
switch(shuttle)
|
||||
if("hopper")
|
||||
shuttleat = "/area/shipbuilder/ship1"
|
||||
currentShuttleName = "Planet hopper"
|
||||
req_metal = 25000
|
||||
if("bus")
|
||||
shuttleat = "/area/shipbuilder/ship2"
|
||||
currentShuttleName = "Blnder Bus"
|
||||
req_metal = 60000
|
||||
if("dinghy")
|
||||
shuttleat = "/area/shipbuilder/ship3"
|
||||
currentShuttleName = "Space dinghy"
|
||||
req_metal = 100000
|
||||
if("van")
|
||||
shuttleat = "/area/shipbuilder/ship4"
|
||||
currentShuttleName = "Boxvan MMDLVI"
|
||||
req_metal = 120000
|
||||
if("secvan")
|
||||
shuttleat = "/area/shipbuilder/ship5"
|
||||
currentShuttleName = "Boxvan MMDLVI - Security edition"
|
||||
req_metal = 125000
|
||||
if("station4")
|
||||
shuttleat = "/area/shipbuilder/ship6"
|
||||
currentShuttleName = "Space station 4"
|
||||
req_metal = 250000
|
||||
|
||||
if (metal_amount - req_metal < 0)
|
||||
return
|
||||
|
||||
if (!shuttleat)
|
||||
return
|
||||
|
||||
var/area/from = locate(shuttleat)
|
||||
var/area/dest = locate(shuttleto)
|
||||
|
||||
if(!from || !dest)
|
||||
return
|
||||
|
||||
currentShuttleArea = shuttleat
|
||||
from.move_contents_to(dest)
|
||||
return
|
||||
|
||||
/obj/machinery/spaceship_builder/proc/scrapShuttle()
|
||||
|
||||
var/shuttleat = "/area/shipbuilder/station"
|
||||
var/shuttleto = currentShuttleArea
|
||||
|
||||
if (!shuttleto)
|
||||
return
|
||||
|
||||
var/area/from = locate(shuttleat)
|
||||
var/area/dest = locate(shuttleto)
|
||||
|
||||
if(!from || !dest)
|
||||
return
|
||||
|
||||
currentShuttleArea = null
|
||||
currentShuttleName = null
|
||||
from.move_contents_to(dest)
|
||||
return
|
||||
|
||||
/obj/machinery/spaceship_builder/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if(operating == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/stack/sheet/metal))
|
||||
|
||||
var/obj/item/stack/sheet/metal/M = W
|
||||
user << "\blue You insert all the metal into the machine."
|
||||
metal_amount += M.amount * 100
|
||||
del(M)
|
||||
|
||||
else
|
||||
return attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/spaceship_builder/attack_hand(user as mob)
|
||||
if(operating == 1)
|
||||
user << "The machine is processing"
|
||||
return
|
||||
|
||||
var/dat
|
||||
dat = text("<b>Ship fabricator</b><br><br>")
|
||||
dat += text("Current ammount of <font color='gray'>Metal: <b>[metal_amount]</b></font><br><hr>")
|
||||
|
||||
if (currentShuttleArea)
|
||||
dat += text("<b>Currently building</b><br><br>[currentShuttleName]<br><br>")
|
||||
dat += text("<b>Build the shuttle to your liking.</b><br>This shuttle will be sent to the station in the event of an emergency along with a centcom emergency shuttle.")
|
||||
dat += text("<br><br><br><A href='?src=\ref[src];scrap=1'>Scrap current shuttle</A>")
|
||||
else
|
||||
dat += text("<b>Available ships to build:</b><br><br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=hopper'>Planet hopper</A> - Tiny, Slow, 25000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=bus'>Blunder Bus</A> - Small, Decent speed, 60000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=dinghy'>Space dinghy</A> - Medium size, Decent speed, 100000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=van'>Boxvan MMDLVIr</A> - Medium size, Decent speed, 120000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=secvan'>Boxvan MMDLVI - Security eidition</A> - Large, Rather slow, 125000 metal<br>")
|
||||
dat += text("<A href='?src=\ref[src];ship=station4'>Space station 4</A> - Huge, Slow, 250000 metal<br>")
|
||||
|
||||
user << browse("[dat]", "window=shipbuilder")
|
||||
|
||||
|
||||
/obj/machinery/spaceship_builder/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["ship"])
|
||||
buildShuttle(href_list["ship"])
|
||||
if(href_list["scrap"])
|
||||
scrapShuttle(href_list["ship"])
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
Reference in New Issue
Block a user