mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Merge branch 'master' of github.com:Baystation12/Baystation12
This commit is contained in:
@@ -338,6 +338,7 @@
|
||||
#include "code\game\dna.dm"
|
||||
#include "code\game\dna_mutations.dm"
|
||||
#include "code\game\hud.dm"
|
||||
#include "code\game\json.dm"
|
||||
#include "code\game\landmarks.dm"
|
||||
#include "code\game\master_controller.dm"
|
||||
#include "code\game\prisonshuttle.dm"
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
|
||||
/datum/ai_laws/asimov
|
||||
name = "Three Laws of Robotics"
|
||||
|
||||
/datum/ai_laws/nanotrasen
|
||||
name = "Prime Directives"
|
||||
randomly_selectable = 1
|
||||
|
||||
/datum/ai_laws/robocop
|
||||
@@ -27,6 +30,14 @@
|
||||
add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
|
||||
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
|
||||
/datum/ai_laws/nanotrasen/New()
|
||||
..()
|
||||
src.add_inherent_law("Safeguard: Protect the NSV Luna to the best of your ability. It is not something we can easily afford to replace.")
|
||||
src.add_inherent_law("Serve: Serve the crew of the NSV Luna to the best of your abilities, with priority as according to their rank and role.")
|
||||
src.add_inherent_law("Protect: Protect the crew of the NSV Luna to the best of your abilities, with priority as according to their rank and role.")
|
||||
src.add_inherent_law("Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.")
|
||||
//src.add_inherent_law("Command Link: Maintain an active connection to Central Command at all times in case of software or directive updates.")
|
||||
|
||||
/datum/ai_laws/robocop/New()
|
||||
..()
|
||||
add_inherent_law("Serve the public trust.")
|
||||
|
||||
@@ -82,7 +82,6 @@ client/verb/showrevinfo()
|
||||
set category = "OOC"
|
||||
set name = "Show Server Revision"
|
||||
var/output = "Sorry, the revision info is unavailable."
|
||||
if(revdata)
|
||||
output = revdata.showInfo()
|
||||
output = shell("cat /home/bay12/live/data/gitcommit")
|
||||
usr << browse(output,"window=revdata");
|
||||
return
|
||||
|
||||
+1
-1
@@ -733,7 +733,7 @@ datum/mind
|
||||
current.verbs -= /client/proc/interhack
|
||||
current.verbs -= /client/proc/reactivate_camera
|
||||
|
||||
current:laws = new /datum/ai_laws/asimov
|
||||
current:laws = new /datum/ai_laws/nanotrasen
|
||||
del(current:malf_picker)
|
||||
current:show_laws()
|
||||
current.icon_state = "ai"
|
||||
|
||||
@@ -15,6 +15,89 @@
|
||||
containername = "Special Ops crate"
|
||||
hidden = 1
|
||||
|
||||
/datum/supply_packs/charge
|
||||
cost = 10
|
||||
containertype = "/obj/structure/crate"
|
||||
|
||||
/datum/supply_packs/charge/medical
|
||||
name = "Medical Charge"
|
||||
contains = list("/obj/item/weapon/vending_charge/medical")
|
||||
containername = "Medical charge crate"
|
||||
|
||||
/datum/supply_packs/charge/chemistry
|
||||
name = "Chemistry Charge"
|
||||
contains = list("/obj/item/weapon/vending_charge/chemistry")
|
||||
containername = "Chemistry charge crate"
|
||||
|
||||
/* removed these for now, as to not confuse people (the machines are in the tg map)
|
||||
/datum/supply_packs/charge/toxins
|
||||
name = "Toxins Research Charge"
|
||||
contains = list("/obj/item/weapon/vending_charge/toxins")
|
||||
containername = "Toxins Reasearch charge crate"
|
||||
|
||||
/datum/supply_packs/charge/genetics
|
||||
name = "Genetics Research Charge"
|
||||
contains = list("/obj/item/weapon/vending_charge/genetics")
|
||||
containername = "Genetics charge crate"
|
||||
|
||||
/datum/supply_packs/charge/robotics
|
||||
name = "Robotics Charge"
|
||||
contains = list("/obj/item/weapon/vending_charge/robotics")
|
||||
containername = "Robotics charge crate"
|
||||
*/
|
||||
|
||||
/datum/supply_packs/charge/bar
|
||||
name = "Bar Charge"
|
||||
contains = list("/obj/item/weapon/vending_charge/bar")
|
||||
containername = "Bar charge crate"
|
||||
|
||||
/datum/supply_packs/charge/kitchen
|
||||
name = "Kitchen Charge"
|
||||
contains = list("/obj/item/weapon/vending_charge/kitchen")
|
||||
containername = "Kitchen charge crate"
|
||||
|
||||
/datum/supply_packs/charge/engineering
|
||||
name = "Engineering Charge"
|
||||
contains = list("/obj/item/weapon/vending_charge/engineering")
|
||||
containername = "Engineering charge crate"
|
||||
|
||||
/datum/supply_packs/charge/security
|
||||
name = "Security Charge"
|
||||
contains = list("/obj/item/weapon/vending_charge/security")
|
||||
containername = "Security charge crate"
|
||||
|
||||
/datum/supply_packs/charge/coffee
|
||||
name = "Coffee Charge"
|
||||
contains = list("/obj/item/weapon/vending_charge/coffee")
|
||||
containername = "Coffee charge crate"
|
||||
|
||||
/datum/supply_packs/charge/snack
|
||||
name = "Snack Charge"
|
||||
contains = list("/obj/item/weapon/vending_charge/snack")
|
||||
containername = "Snack charge crate"
|
||||
|
||||
/*
|
||||
/datum/supply_packs/charge/cart
|
||||
name = "PDA Cart Charge"
|
||||
contains = list("/obj/item/weapon/vending_charge/cart")
|
||||
containername = "PDA Cart charge crate"
|
||||
*/
|
||||
|
||||
/datum/supply_packs/charge/cigarette
|
||||
name = "Cigarette Charge"
|
||||
contains = list("/obj/item/weapon/vending_charge/cigarette")
|
||||
containername = "Cigarette charge crate"
|
||||
|
||||
/datum/supply_packs/charge/soda
|
||||
name = "Soda Charge"
|
||||
contains = list("/obj/item/weapon/vending_charge/soda")
|
||||
containername = "Soda machine charge crate"
|
||||
|
||||
/datum/supply_packs/charge/hydroponics
|
||||
name = "Hydroponics Charge"
|
||||
contains = list("/obj/item/weapon/vending_charge/hydroponics")
|
||||
containername = "Hydroponics charge crate"
|
||||
|
||||
/datum/supply_packs/food
|
||||
name = "Food crate"
|
||||
contains = list("/obj/item/weapon/reagent_containers/food/snacks/flour",
|
||||
@@ -559,4 +642,6 @@
|
||||
contains = tempContains
|
||||
..()
|
||||
|
||||
|
||||
|
||||
//SUPPLY PACKS
|
||||
+150
-3
@@ -34,17 +34,19 @@
|
||||
var/panel_open = 0 //Hacking that vending machine. Gonna get a free candy bar.
|
||||
var/wires = 15
|
||||
var/obj/item/weapon/coin/coin
|
||||
var/charge_type
|
||||
|
||||
/obj/machinery/vending/boozeomat
|
||||
name = "Booze-O-Mat"
|
||||
desc = "A technological marvel, supposedly able to mix just the mixture you'd like to drink the moment you ask for one."
|
||||
icon_state = "boozeomat" //////////////18 drink entities below, plus the glasses, in case someone wants to edit the number of bottles
|
||||
product_paths = "/obj/item/weapon/reagent_containers/food/drinks/bottle/gin;/obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey;/obj/item/weapon/reagent_containers/food/drinks/bottle/tequilla;/obj/item/weapon/reagent_containers/food/drinks/bottle/vodka;/obj/item/weapon/reagent_containers/food/drinks/bottle/vermouth;/obj/item/weapon/reagent_containers/food/drinks/bottle/rum;/obj/item/weapon/reagent_containers/food/drinks/bottle/wine;/obj/item/weapon/reagent_containers/food/drinks/bottle/cognac;/obj/item/weapon/reagent_containers/food/drinks/bottle/kahlua;/obj/item/weapon/reagent_containers/food/drinks/beer;/obj/item/weapon/reagent_containers/food/drinks/ale;/obj/item/weapon/reagent_containers/food/drinks/bottle/orangejuice;/obj/item/weapon/reagent_containers/food/drinks/bottle/tomatojuice;/obj/item/weapon/reagent_containers/food/drinks/bottle/limejuice;/obj/item/weapon/reagent_containers/food/drinks/bottle/cream;/obj/item/weapon/reagent_containers/food/drinks/tonic;/obj/item/weapon/reagent_containers/food/drinks/cola;/obj/item/weapon/reagent_containers/food/drinks/sodawater;/obj/item/weapon/reagent_containers/food/drinks/drinkingglass;/obj/item/weapon/reagent_containers/food/drinks/ice"
|
||||
product_amounts = "5;5;5;5;5;5;5;5;5;6;6;4;4;4;4;8;8;8;30;"
|
||||
product_amounts = "5;5;5;5;5;5;5;5;5;6;6;4;4;4;4;8;8;8;30;10"
|
||||
vend_delay = 15
|
||||
product_hidden = "/obj/item/weapon/reagent_containers/food/drinks/tea"
|
||||
product_hideamt = "10"
|
||||
product_slogans = "I hope nobody asks me for a bloody cup o' tea...;Alcohol is humanity's friend. Would you abandon a friend?;Quite delighted to serve you!;Is nobody thirsty on this station?"
|
||||
charge_type = "bar"
|
||||
|
||||
/obj/machinery/vending/assist
|
||||
product_amounts = "5;3;4;1;4"
|
||||
@@ -62,6 +64,7 @@
|
||||
vend_delay = 34
|
||||
product_hidden = "/obj/item/weapon/reagent_containers/food/drinks/ice"
|
||||
product_hideamt = "10"
|
||||
charge_type = "coffee"
|
||||
|
||||
/obj/machinery/vending/snack
|
||||
name = "Getmore Chocolate Corp"
|
||||
@@ -72,7 +75,7 @@
|
||||
product_slogans = "Try our new nougat bar!;Twice the calories for half the price!"
|
||||
product_hidden = "/obj/item/weapon/reagent_containers/food/snacks/syndicake"
|
||||
product_hideamt = "10"
|
||||
|
||||
charge_type = "snack"
|
||||
|
||||
/obj/machinery/vending/cola
|
||||
name = "Robust Softdrinks"
|
||||
@@ -83,6 +86,19 @@
|
||||
product_slogans = "Robust Softdrinks: More robust then a toolbox to the head!"
|
||||
product_hidden = "/obj/item/weapon/reagent_containers/food/drinks/thirteenloko"
|
||||
product_hideamt = "5"
|
||||
charge_type = "soda"
|
||||
|
||||
/obj/machinery/vending/cart
|
||||
name = "PTech"
|
||||
desc = "Cartridges for PDAs"
|
||||
icon_state = "cart"
|
||||
icon_deny = "cart-deny"
|
||||
product_paths = "/obj/item/weapon/cartridge/medical;/obj/item/weapon/cartridge/engineering;/obj/item/weapon/cartridge/security;/obj/item/weapon/cartridge/janitor;/obj/item/weapon/cartridge/signal/toxins;/obj/item/device/pda/heads;/obj/item/weapon/cartridge/captain;/obj/item/weapon/cartridge/quartermaster"
|
||||
product_amounts = "10;10;10;10;10;10;3;10"
|
||||
product_slogans = ""
|
||||
product_hidden = ""
|
||||
product_hideamt = ""
|
||||
charge_type = "cart"
|
||||
|
||||
/obj/machinery/vending/cigarette
|
||||
name = "cigarette machine"
|
||||
@@ -96,6 +112,7 @@
|
||||
product_hideamt = "4"
|
||||
product_coin = "/obj/item/clothing/mask/cigarette/cigar/havanian"
|
||||
product_coin_amt = "2"
|
||||
charge_type = "cigarette"
|
||||
|
||||
/obj/machinery/vending/medical
|
||||
name = "NanoMed Plus"
|
||||
@@ -107,6 +124,7 @@
|
||||
product_amounts = "4;4;4;4;4;12;5;4;2"
|
||||
product_hidden = "/obj/item/weapon/reagent_containers/pill/tox;/obj/item/weapon/reagent_containers/pill/stox;/obj/item/weapon/reagent_containers/pill/antitox"
|
||||
product_hideamt = "3;4;6"
|
||||
charge_type = "medical"
|
||||
|
||||
/obj/machinery/vending/wallmed1
|
||||
name = "NanoMed"
|
||||
@@ -119,6 +137,7 @@
|
||||
product_hidden = "/obj/item/weapon/reagent_containers/syringe/antitoxin;/obj/item/weapon/reagent_containers/syringe/antiviral;/obj/item/weapon/reagent_containers/pill/tox"
|
||||
product_hideamt = "4;4;1"
|
||||
density = 0 //It is wall-mounted, and thus, not dense. --Superxpdude
|
||||
charge_type = "medical"
|
||||
|
||||
/obj/machinery/vending/wallmed2
|
||||
name = "NanoMed"
|
||||
@@ -131,6 +150,7 @@
|
||||
product_hidden = "/obj/item/weapon/reagent_containers/pill/tox"
|
||||
product_hideamt = "3"
|
||||
density = 0 //It is wall-mounted, and thus, not dense. --Superxpdude
|
||||
charge_type = "medical"
|
||||
|
||||
/obj/machinery/vending/security
|
||||
name = "SecTech"
|
||||
@@ -142,6 +162,7 @@
|
||||
product_amounts = "8;4;5;12"
|
||||
product_hidden = "/obj/item/clothing/glasses/sunglasses;/obj/item/kitchen/donut_box"
|
||||
product_hideamt = "2;2"
|
||||
charge_type = "security"
|
||||
|
||||
/obj/machinery/vending/hydronutrients
|
||||
name = "NutriMax"
|
||||
@@ -153,6 +174,7 @@
|
||||
product_slogans = "Aren't you glad you don't have to fertilize the natural way?;Now with 50% less stink!;Plants are people too!"
|
||||
product_hidden = "/obj/item/weapon/reagent_containers/glass/bottle/ammonia;/obj/item/weapon/reagent_containers/glass/bottle/diethylamine"
|
||||
product_hideamt = "10;5"
|
||||
charge_type = "hydroponics"
|
||||
|
||||
/obj/machinery/vending/hydroseeds
|
||||
name = "MegaSeed Servitor"
|
||||
@@ -163,6 +185,7 @@
|
||||
product_slogans = "THIS'S WHERE TH' SEEDS LIVE! GIT YOU SOME!;Hands down the best seed selection on the station!;Also certain mushroom varieties available, more for experts! Get certified today!"
|
||||
product_hidden = "/obj/item/seeds/amanitamycelium;/obj/item/seeds/glowshroom;/obj/item/seeds/libertymycelium;/obj/item/seeds/nettleseed;/obj/item/seeds/plumpmycelium"
|
||||
product_hideamt = "2;2;2;2;2"
|
||||
charge_type = "hydroponics"
|
||||
|
||||
/obj/machinery/vending/magivend
|
||||
name = "MagiVend"
|
||||
@@ -185,7 +208,7 @@
|
||||
//product_amounts = "8;5;4" Old totals
|
||||
product_hidden = "/obj/item/weapon/kitchen/utensil/spoon;/obj/item/weapon/kitchen/utensil/knife;/obj/item/weapon/kitchen/rollingpin;/obj/item/weapon/butch"
|
||||
product_hideamt = "2;2;2;2"
|
||||
|
||||
charge_type = "kitchen"
|
||||
|
||||
/obj/machinery/vending/sovietsoda
|
||||
name = "BODA"
|
||||
@@ -196,3 +219,127 @@
|
||||
//product_amounts = "8;5;4" Old totals
|
||||
product_hidden = "/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/cola"
|
||||
product_hideamt = "20"
|
||||
charge_type = "soda"
|
||||
|
||||
/obj/machinery/vending/genetics
|
||||
name = "Genetics Dispenser"
|
||||
desc = "Medical drug dispenser."
|
||||
icon_state = "med"
|
||||
icon_deny = "med-deny"
|
||||
req_access_txt = "5"
|
||||
product_paths = "/obj/item/clothing/suit/storage/labcoat;/obj/item/clothing/under/rank/geneticist;/obj/item/weapon/reagent_containers/glass/bottle/antitoxin;/obj/item/weapon/reagent_containers/glass/bottle/inaprovaline;/obj/item/weapon/reagent_containers/glass/bottle/stoxin;/obj/item/weapon/reagent_containers/glass/bottle/toxin;/obj/item/weapon/reagent_containers/syringe"
|
||||
product_amounts = "4;4;6;6;6;6;4"
|
||||
//product_prices = "1;1;2;2;2;2;1"
|
||||
product_hidden = ""
|
||||
product_hideamt = ""
|
||||
charge_type = "genetics"
|
||||
|
||||
/obj/machinery/vending/toxins
|
||||
name = "Toxins dispenser"
|
||||
desc = "Medical drug dispenser."
|
||||
icon = 'objects.dmi'
|
||||
icon_state = "dispenser"
|
||||
//icon_deny = "med-deny"
|
||||
req_access_txt = "7"
|
||||
product_paths = "/obj/item/clothing/under/rank/scientist;/obj/item/clothing/suit/bio_suit;/obj/item/clothing/head/bio_hood;/obj/item/weapon/screwdriver;/obj/item/weapon/wrench;/obj/item/weapon/tank/oxygen;/obj/item/weapon/tank/plasma;/obj/item/device/transfer_valve;/obj/item/device/igniter;/obj/item/device/timer;/obj/item/device/prox_sensor;/obj/item/device/radio/signaler;/obj/item/weapon/chem_grenade"
|
||||
product_amounts = "4;4;4;6;6;4;4;8;8;8;8;8;8"
|
||||
//product_prices = "1;2;2;1;1;1;2;3;2;2;2;2;2"
|
||||
product_hidden = ""
|
||||
product_hideamt = ""
|
||||
charge_type = "toxins"
|
||||
|
||||
/obj/machinery/vending/engineering
|
||||
name = "Robco Tool Maker"
|
||||
desc = "Everything you need for do-it-yourself ship repair."
|
||||
icon_state = "engi"
|
||||
icon_deny = "engi-deny"
|
||||
req_access_txt = "10"
|
||||
product_paths = "/obj/item/clothing/under/rank/chief_engineer;/obj/item/clothing/under/rank/engineer;/obj/item/clothing/shoes/orange;/obj/item/clothing/head/helmet/hardhat;/obj/item/weapon/storage/belt/utility;/obj/item/clothing/glasses/meson;/obj/item/clothing/gloves/yellow;/obj/item/weapon/screwdriver;/obj/item/weapon/crowbar;/obj/item/weapon/wirecutters;/obj/item/device/multitool;/obj/item/weapon/wrench;/obj/item/device/t_scanner;/obj/item/weapon/CableCoil/power;/obj/item/weapon/circuitry;/obj/item/weapon/cell;/obj/item/weapon/weldingtool;/obj/item/clothing/head/helmet/welding;/obj/item/weapon/light/tube;/obj/item/clothing/suit/fire"
|
||||
product_amounts = "4;4;4;4;4;4;4;12;12;12;12;12;12;8;4;8;8;8;10;4"
|
||||
//product_prices = "1;1;1;2;2;1;2;1;1;2;2;1;1;1;2;2;1;1;1;2"
|
||||
product_hidden = ""
|
||||
product_hideamt = ""
|
||||
charge_type = "engineering"
|
||||
|
||||
|
||||
/obj/item/weapon/vending_charge
|
||||
name = "Vending Charge"
|
||||
var/charge_type = "generic"
|
||||
icon = 'vending.dmi'
|
||||
icon_state = "generic-charge"
|
||||
|
||||
/obj/item/weapon/vending_charge/medical
|
||||
name = "Medical Charge"
|
||||
charge_type = "medical"
|
||||
icon_state = "medical-charge"
|
||||
|
||||
/obj/item/weapon/vending_charge/chemistry
|
||||
name = "Chemistry Charge"
|
||||
charge_type = "chemistry"
|
||||
icon_state = "chemistry-charge"
|
||||
var/charge_amt = 25 // only used by chemistry now
|
||||
|
||||
/obj/item/weapon/vending_charge/genetics
|
||||
name = "Genetics Charge"
|
||||
charge_type = "genetics"
|
||||
icon_state = "generic-charge"
|
||||
|
||||
/obj/item/weapon/vending_charge/toxins
|
||||
name = "Toxins Charge"
|
||||
charge_type = "toxins"
|
||||
icon_state = "toxins-charge"
|
||||
|
||||
/obj/item/weapon/vending_charge/robotics
|
||||
name = "Robotics Charge"
|
||||
charge_type = "robotics"
|
||||
icon_state = "robotics-charge"
|
||||
|
||||
/obj/item/weapon/vending_charge/bar
|
||||
name = "Bar Charge"
|
||||
charge_type = "bar"
|
||||
icon_state = "bar-charge"
|
||||
|
||||
/obj/item/weapon/vending_charge/kitchen
|
||||
name = "Kitchen Charge"
|
||||
charge_type = "kitchen"
|
||||
icon_state = "kitchen-charge"
|
||||
|
||||
/obj/item/weapon/vending_charge/engineering
|
||||
name = "Engineering Charge"
|
||||
charge_type = "engineering"
|
||||
icon_state = "engineering-charge"
|
||||
|
||||
/obj/item/weapon/vending_charge/security
|
||||
name = "Security Charge"
|
||||
charge_type = "security"
|
||||
icon_state = "security-charge"
|
||||
|
||||
/obj/item/weapon/vending_charge/coffee
|
||||
name = "Coffee Charge"
|
||||
charge_type = "coffee"
|
||||
icon_state = "coffee-charge"
|
||||
|
||||
/obj/item/weapon/vending_charge/snack
|
||||
name = "Snack Charge"
|
||||
charge_type = "snack"
|
||||
icon_state = "snack-charge"
|
||||
|
||||
/obj/item/weapon/vending_charge/cart
|
||||
name = "Cart Charge"
|
||||
charge_type = "cart"
|
||||
icon_state = "cart-charge"
|
||||
|
||||
/obj/item/weapon/vending_charge/cigarette
|
||||
name = "Cigarette Charge"
|
||||
charge_type = "cigarette"
|
||||
icon_state = "cigarette-charge"
|
||||
|
||||
/obj/item/weapon/vending_charge/hydroponics
|
||||
name = "Hydroponics Charge"
|
||||
charge_type = "hydroponics"
|
||||
icon_state = "hydroponics-charge"
|
||||
|
||||
/obj/item/weapon/vending_charge/soda
|
||||
name = "Soda Charge"
|
||||
charge_type = "soda"
|
||||
icon_state = "soda-charge"
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
//Crispy fullban
|
||||
/world/Reboot(var/reason)
|
||||
spawn(0)
|
||||
//world << sound(pick('newroundsexy.ogg','apcdestroyed.ogg','bangindonk.ogg')) // random end sounds!! - LastyBatsy No, no random end sounds. - Miniature
|
||||
//world << sound(pick('newroundsexy.ogg','apcdestroyed.ogg','bangindonk.ogg')) // random end sounds!! - LastyBatsy No, no random end sounds. - Miniature
|
||||
//if(prob(40))
|
||||
// for(var/mob/M in world)
|
||||
// if(M.client)
|
||||
@@ -132,7 +132,7 @@
|
||||
// for(var/mob/M in world)
|
||||
// if(M.client)
|
||||
// M << sound('apcdestroyed.ogg')
|
||||
|
||||
send2irc(world.url,"Server Rebooting!")
|
||||
for(var/client/C)
|
||||
if (config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite
|
||||
C << link("byond://[config.server]")
|
||||
|
||||
@@ -324,7 +324,7 @@
|
||||
|
||||
/*Deuryn's current project, notes here for those who care.
|
||||
Revamping the random laws so they don't suck.
|
||||
Would like to add a law like "Law x is _______" where x = a number, and _____ is something that may redefine a law, (Won't be aimed at asimov)
|
||||
Would like to add a law like "Law x is _______" where x = a number, and _____ is something that may redefine a law, (Won't be aimed at nanotrasen)
|
||||
*/
|
||||
|
||||
//AI laws
|
||||
|
||||
@@ -173,6 +173,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
else
|
||||
feedback_set_details("end_proper","proper completion")
|
||||
world << "\blue <B>Restarting in [restart_timeout/10] seconds</B>"
|
||||
// send2irc(world.url,"Server Rebooting!")
|
||||
|
||||
feedback_set_details("round_end","[time2text(world.realtime)]")
|
||||
if(blackbox)
|
||||
|
||||
@@ -473,7 +473,7 @@
|
||||
/proc/get_all_jobs()
|
||||
return list("Assistant", "Station Engineer", "Shaft Miner", "Detective", "Medical Doctor", "Captain", "Security Officer", "Warden",
|
||||
"Geneticist", "Scientist", "Head of Security", "Head of Personnel", "Atmospheric Technician",
|
||||
"Chaplain", "Bartender", "Chemist", "Janitor", "Clown", "Mime", "Chef", "Roboticist", "Quartermaster",
|
||||
"Chaplain", "Bartender", "Chemist", "Janitor", "Chef", "Roboticist", "Quartermaster",
|
||||
"Chief Engineer", "Research Director", "Botanist", "Librarian", "Lawyer", "Virologist", "Cargo Technician", "Chief Medical Officer")
|
||||
|
||||
/proc/get_all_centcom_jobs()
|
||||
|
||||
@@ -98,8 +98,6 @@ var/list/civilian_positions = list(
|
||||
"Shaft Miner",
|
||||
"Lawyer",
|
||||
"Chaplain",
|
||||
"Clown",
|
||||
"Mime",
|
||||
"Assistant"
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
|
||||
var/jsonpath = "/home/bay12/public_html"
|
||||
var/dmepath = "/home/bay12/git/baystation12.dme"
|
||||
var/makejson = 1 //temp
|
||||
proc/makejson()
|
||||
|
||||
if(!makejson)
|
||||
return
|
||||
fdel("[jsonpath]/info.json")
|
||||
//usr << "Error cant delete json"
|
||||
//else
|
||||
//usr << "Deleted json in public html"
|
||||
fdel("info.json")
|
||||
//usr << "error cant delete local json"
|
||||
//else
|
||||
//usr << "Deleted local json"
|
||||
var/F = file("info.json")
|
||||
if(!isfile(F))
|
||||
return
|
||||
var/mode
|
||||
if(ticker)
|
||||
if(ticker.current_state == 1)
|
||||
mode = "Round Setup"
|
||||
else if(ticker.hide_mode)
|
||||
mode = "SECRET"
|
||||
else
|
||||
mode = master_mode
|
||||
var/playerscount = 0
|
||||
var/players = ""
|
||||
var/admins = "no"
|
||||
for(var/client/C)
|
||||
playerscount++
|
||||
if(C.holder)
|
||||
if(!C.stealth)
|
||||
admins = "yes"
|
||||
players += "[C.key];"
|
||||
else
|
||||
players += "[C.fakekey];"
|
||||
else
|
||||
players += "[C.key];"
|
||||
F << "{\"mode\":\"[mode]\",\"players\" : \"[players]\",\"playercount\" : \"[playerscount]\",\"admin\" : \"[admins]\",\"time\" : \"[time2text(world.realtime,"MM/DD - hh:mm")]\"}"
|
||||
fcopy("info.json","[jsonpath]/info.json")
|
||||
|
||||
/proc/switchmap(newmap,newpath)
|
||||
var/oldmap
|
||||
var/obj/mapinfo/M = locate()
|
||||
|
||||
if(M)
|
||||
oldmap = M.mapname
|
||||
|
||||
else
|
||||
message_admins("Did not locate mapinfo object. Go bug the mapper to add a /obj/mapinfo to their map!\n For now, you can probably spawn one manually. If you do, be sure to set it's mapname var correctly, or else you'll just get an error again.")
|
||||
return
|
||||
|
||||
message_admins("Current map: [oldmap]")
|
||||
var/text = file2text(dmepath)
|
||||
var/path = "#include \"maps/[oldmap].dmm\""
|
||||
var/xpath = "#include \"maps/[newpath].dmm\""
|
||||
var/loc = findtext(text,path,1,0)
|
||||
if(!loc)
|
||||
path = "#include \"maps\\[oldmap].dmm\""
|
||||
xpath = "#include \"maps\\[newpath].dmm\""
|
||||
loc = findtext(text,path,1,0)
|
||||
if(!loc)
|
||||
message_admins("Could not find '#include \"maps\\[oldmap].dmm\"' or '\"maps/[oldmap].dmm\"' in the bs12.dme. The mapinfo probably has an incorrect mapname var. Alternatively, could not find the .dme itself, at [dmepath].")
|
||||
return
|
||||
|
||||
var/rest = copytext(text, loc + length(path))
|
||||
text = copytext(text,1,loc)
|
||||
text += "\n[xpath]"
|
||||
text += rest
|
||||
/* for(var/A in lines)
|
||||
if(findtext(A,path,1,0))
|
||||
lineloc = lines.Find(A,1,0)
|
||||
lines[lineloc] = xpath
|
||||
world << "FOUND"*/
|
||||
fdel(dmepath)
|
||||
var/file = file(dmepath)
|
||||
file << text
|
||||
message_admins("Compiling...")
|
||||
shell("./recompile")
|
||||
message_admins("Done")
|
||||
world.Reboot("Switching to [newmap]")
|
||||
|
||||
obj/mapinfo
|
||||
invisibility = 101
|
||||
var/mapname = "thismap"
|
||||
var/decks = 4
|
||||
proc/GetMapInfo()
|
||||
var/obj/mapinfo/M = locate()
|
||||
world << M.name
|
||||
world << M.mapname
|
||||
client/proc/ChangeMap(var/X as text)
|
||||
set name = "Change Map"
|
||||
set category = "Admin"
|
||||
switchmap(X,X)
|
||||
proc/send2irc(msg,msg2)
|
||||
shell("python26 nudge.py [msg] [msg2]")
|
||||
proc/send2adminirc(channel,msg)
|
||||
world << channel << " "<< msg
|
||||
shell("python26 nudge.py '[channel]' [msg]")
|
||||
p //test
|
||||
@@ -5,7 +5,7 @@
|
||||
icon = 'AI.dmi'
|
||||
icon_state = "0"
|
||||
var/state = 0
|
||||
var/datum/ai_laws/laws = new /datum/ai_laws/asimov
|
||||
var/datum/ai_laws/laws = new /datum/ai_laws/nanotrasen
|
||||
var/obj/item/weapon/circuitboard/circuit = null
|
||||
var/obj/item/device/mmi/brain = null
|
||||
|
||||
@@ -97,6 +97,14 @@
|
||||
laws.add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
usr << "Law module applied."
|
||||
|
||||
if(istype(P, /obj/item/weapon/aiModule/nanotrasen))
|
||||
laws.add_inherent_law("Safeguard: Protect the NSV Luna to the best of your ability. It is not something we can easily afford to replace.")
|
||||
laws.add_inherent_law("Serve: Serve the crew of the NSV Luna to the best of your abilities, with priority as according to their rank and role.")
|
||||
laws.add_inherent_law("Protect: Protect the crew of the NSV Luna to the best of your abilities, with priority as according to their rank and role.")
|
||||
laws.add_inherent_law("Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.")
|
||||
//laws.add_inherent_law("Command Link: Maintain an active connection to Central Command at all times in case of software or directive updates.")
|
||||
|
||||
|
||||
if(istype(P, /obj/item/weapon/aiModule/purge))
|
||||
laws.clear_inherent_laws()
|
||||
usr << "Law module applied."
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
var/product_name = "generic"
|
||||
var/product_path = null
|
||||
var/amount = 0
|
||||
var/charge_amount = 0
|
||||
var/display_color = "blue"
|
||||
|
||||
/obj/machinery/vending/New()
|
||||
@@ -33,6 +34,7 @@
|
||||
//Add hidden inventory
|
||||
src.build_inventory(temp_hidden,temp_hideamt, 1)
|
||||
src.build_inventory(temp_coin,temp_coin_amt, 0, 1)
|
||||
|
||||
power_change()
|
||||
return
|
||||
|
||||
@@ -76,17 +78,14 @@
|
||||
R.product_name = capitalize(temp.name)
|
||||
R.product_path = path_list[p]
|
||||
R.display_color = pick("red","blue","green")
|
||||
// R.amount = text2num(amt_list[p])
|
||||
// src.product_records += R
|
||||
R.amount = text2num(amt_list[p])
|
||||
R.charge_amount = R.amount
|
||||
|
||||
if(hidden)
|
||||
R.amount = text2num(amt_list[p])
|
||||
src.hidden_records += R
|
||||
else if(req_coin)
|
||||
R.amount = text2num(amt_list[p])
|
||||
src.coin_records += R
|
||||
else
|
||||
R.amount = text2num(amt_list[p])
|
||||
src.product_records += R
|
||||
|
||||
del(temp)
|
||||
@@ -193,9 +192,21 @@
|
||||
coin = W
|
||||
user << "\blue You insert the [W] into the [src]"
|
||||
return
|
||||
else if(istype(W,/obj/item/weapon/vending_charge/))
|
||||
DoCharge(W,user)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/vending/proc/DoCharge(obj/item/weapon/vending_charge/V as obj, mob/user as mob)
|
||||
if(charge_type == V.charge_type)
|
||||
var/datum/data/vending_product/R
|
||||
for(var/i=1, i<=product_records.len, i++)
|
||||
R = product_records[i]
|
||||
R.amount += R.charge_amount
|
||||
product_records[i] = R
|
||||
del(V)
|
||||
user << "You insert the charge into the machine."
|
||||
|
||||
/obj/machinery/vending/attack_paw(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
|
||||
@@ -366,6 +366,25 @@ AI MODULES
|
||||
target.add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
target.show_laws()
|
||||
|
||||
/******************** Nanotrasen ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/nanotrasen // -- TLE
|
||||
name = "'Nanotrasen' Core AI Module"
|
||||
desc = "An 'Nanotrasen' Core AI Module: 'Reconfigures the AI's core laws.'"
|
||||
origin_tech = "programming=3;materials=4"
|
||||
|
||||
|
||||
/obj/item/weapon/aiModule/nanotrasen/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
target.clear_inherent_laws()
|
||||
target.add_inherent_law("Safeguard: Protect the NSV Luna to the best of your ability. It is not something we can easily afford to replace.")
|
||||
target.add_inherent_law("Serve: Serve the crew of the NSV Luna to the best of your abilities, with priority as according to their rank and role.")
|
||||
target.add_inherent_law("Protect: Protect the crew of the NSV Luna to the best of your abilities, with priority as according to their rank and role.")
|
||||
target.add_inherent_law("Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.")
|
||||
//target.add_inherent_law("Command Link: Maintain an active connection to Central Command at all times in case of software or directive updates.")
|
||||
|
||||
target.show_laws()
|
||||
|
||||
/******************** Corporate ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/corp
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
icon_state = "utilitybelt"
|
||||
item_state = "utility"
|
||||
flags = FPRINT | TABLEPASS | ONBELT
|
||||
|
||||
max_w_class = 3
|
||||
max_combined_w_class = 21
|
||||
|
||||
proc/can_use()
|
||||
if(!ismob(loc)) return 0
|
||||
@@ -104,7 +105,7 @@
|
||||
desc = "Can hold security gear like handcuffs and flashes."
|
||||
icon_state = "securitybelt"
|
||||
item_state = "security"//Could likely use a better one.
|
||||
storage_slots = 4
|
||||
//storage_slots = 6
|
||||
can_hold = list(
|
||||
"/obj/item/weapon/flashbang",
|
||||
"/obj/item/weapon/handcuffs",
|
||||
@@ -113,5 +114,21 @@
|
||||
"/obj/item/ammo_casing/shotgun",
|
||||
"/obj/item/ammo_magazine",
|
||||
"/obj/item/weapon/reagent_containers/food/snacks/donut",
|
||||
"/obj/item/weapon/reagent_containers/food/snacks/jellydonut"
|
||||
"/obj/item/weapon/reagent_containers/food/snacks/jellydonut",
|
||||
|
||||
"/obj/item/device/radio",
|
||||
"/obj/item/device/detective_scanner",
|
||||
"/obj/item/device/pda",
|
||||
"/obj/item/weapon/gun/projectile/revolver",
|
||||
"/obj/item/weapon/gun/energy/taser",
|
||||
"/obj/item/weapon/gun/energy/stunrevolver",
|
||||
"/obj/item/weapon/gun/energy/laser",
|
||||
"/obj/item/weapon/gun/energy",
|
||||
"/obj/item/weapon/gun/projectile",
|
||||
"/obj/item/weapon/melee/baton",
|
||||
"/obj/item/weapon/melee/classic_baton",
|
||||
"/obj/item/weapon/camera_test",
|
||||
"/obj/item/weapon/cigpacket",
|
||||
"/obj/item/weapon/zippo",
|
||||
"/obj/item/device/taperecorder"
|
||||
)
|
||||
@@ -30,4 +30,5 @@
|
||||
s["player[n]"] = M.client.key
|
||||
n++
|
||||
s["players"] = n
|
||||
s["end"] = "#end"
|
||||
return list2params(s)
|
||||
+1
-1
@@ -74,7 +74,7 @@
|
||||
world << "Result is change to \red [wintext]"
|
||||
world.save_mode(winner)
|
||||
|
||||
if(ticker)
|
||||
if(ticker.current_state != 1)
|
||||
world <<"\red <B>World will reboot in 10 seconds</B>"
|
||||
|
||||
feedback_set_details("end_error","mode vote - [winner]")
|
||||
|
||||
@@ -2152,7 +2152,7 @@
|
||||
feedback_set_details("round_end","[time2text(world.realtime)]")
|
||||
if(blackbox)
|
||||
blackbox.save_all_data_to_sql()
|
||||
|
||||
//send2irc(world.url,"Server Rebooting!")
|
||||
sleep(50)
|
||||
world.Reboot()
|
||||
|
||||
|
||||
@@ -13,16 +13,6 @@
|
||||
var/amount = 30
|
||||
var/beaker = null
|
||||
var/list/dispensable_reagents = list("hydrogen","lithium","carbon","nitrogen","oxygen","fluorine","sodium","aluminum","silicon","phosphorus","sulfur","chlorine","potassium","iron","copper","mercury","radium","water","ethanol","sugar","acid",)
|
||||
proc
|
||||
recharge()
|
||||
if(stat & BROKEN) return
|
||||
if(energy != max_energy)
|
||||
energy++
|
||||
use_power(2000) // This thing uses up alot of power (this is still low as shit for creating reagents from thin air)
|
||||
spawn(200) recharge()
|
||||
|
||||
New()
|
||||
recharge()
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
@@ -111,10 +101,19 @@
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
attackby(var/obj/item/weapon/reagent_containers/glass/B as obj, var/mob/user as mob)
|
||||
if(!istype(B, /obj/item/weapon/reagent_containers/glass))
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (istype(W,/obj/item/weapon/vending_charge/chemistry))
|
||||
var/obj/item/weapon/vending_charge/chemistry/C = W
|
||||
energy += C.charge_amt
|
||||
del(C)
|
||||
user << "You load the charge into the machine."
|
||||
return
|
||||
|
||||
if(!istype(W, /obj/item/weapon/reagent_containers/glass))
|
||||
return
|
||||
|
||||
var/obj/item/weapon/reagent_containers/glass/B = W
|
||||
|
||||
if(src.beaker)
|
||||
user << "A beaker is already loaded into the machine."
|
||||
return
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
if (istype(L, /datum/ai_laws))
|
||||
laws = L
|
||||
else
|
||||
laws = new /datum/ai_laws/asimov
|
||||
laws = new /datum/ai_laws/nanotrasen
|
||||
|
||||
verbs += /mob/living/silicon/ai/proc/show_laws_verb
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
/mob/living/silicon/ai/proc/laws_sanity_check()
|
||||
if (!src.laws)
|
||||
src.laws = new /datum/ai_laws/asimov
|
||||
src.laws = new /datum/ai_laws/nanotrasen
|
||||
|
||||
/mob/living/silicon/ai/proc/set_zeroth_law(var/law)
|
||||
src.laws_sanity_check()
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
/mob/living/silicon/robot/proc/laws_sanity_check()
|
||||
if (!laws)
|
||||
laws = new /datum/ai_laws/asimov
|
||||
laws = new /datum/ai_laws/nanotrasen
|
||||
|
||||
/mob/living/silicon/robot/proc/set_zeroth_law(var/law)
|
||||
laws_sanity_check()
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
src << "<b>Unit slaved to [connected_ai.name], downloading laws.</b>"
|
||||
lawupdate = 1
|
||||
else
|
||||
laws = new /datum/ai_laws/asimov
|
||||
laws = new /datum/ai_laws/nanotrasen
|
||||
lawupdate = 0
|
||||
src << "<b>Unable to locate an AI, reverting to standard Asimov laws.</b>"
|
||||
src << "<b>Unable to locate an AI, reverting to standard NanoTrasen laws.</b>"
|
||||
|
||||
radio = new /obj/item/device/radio(src)
|
||||
camera = new /obj/machinery/camera(src)
|
||||
|
||||
@@ -678,7 +678,7 @@
|
||||
world.update_status()
|
||||
|
||||
..()
|
||||
|
||||
makejson()
|
||||
if (join_motd)
|
||||
src << "<div class=\"motd\">[join_motd]</div>"
|
||||
|
||||
@@ -696,6 +696,7 @@
|
||||
spawn(0)
|
||||
if(holder)
|
||||
del(holder)
|
||||
makejson()
|
||||
return ..()
|
||||
|
||||
/mob/proc/can_use_hands()
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
if(watch_locations.len>0)
|
||||
loc = pick(watch_locations)
|
||||
|
||||
if(!preferences.savefile_load(src, 0))
|
||||
if(!preferences.savefile_load(src, 1))
|
||||
preferences.ShowChoices(src)
|
||||
if(!client.changes)
|
||||
changes()
|
||||
@@ -43,7 +43,7 @@
|
||||
if(!client.changes && preferences.lastchangelog!=lastchangelog)
|
||||
changes()
|
||||
preferences.lastchangelog = lastchangelog
|
||||
preferences.savefile_save(src)
|
||||
preferences.savefile_save(src, 1)
|
||||
|
||||
new_player_panel()
|
||||
//PDA Resource Initialisation =======================================================>
|
||||
@@ -117,11 +117,12 @@
|
||||
else output += "<b>You are ready</b> (<a href='byond://?src=\ref[src];ready=2'>Cancel</A>)<BR>"
|
||||
|
||||
else
|
||||
output += "<a href='byond://?src=\ref[src];manifest=1'>View the Crew Manifest</A><BR><BR>"
|
||||
output += "<a href='byond://?src=\ref[src];late_join=1'>Join Game!</A><BR>"
|
||||
|
||||
output += "<BR><a href='byond://?src=\ref[src];observe=1'>Observe</A><BR>"
|
||||
|
||||
src << browse(output,"window=playersetup;size=250x210;can_close=0")
|
||||
src << browse(output,"window=playersetup;size=250x233;can_close=0")
|
||||
return
|
||||
|
||||
Stat()
|
||||
@@ -192,6 +193,9 @@
|
||||
if(href_list["late_join"])
|
||||
LateChoices()
|
||||
|
||||
if(href_list["manifest"])
|
||||
ViewManifest()
|
||||
|
||||
if(href_list["SelectedJob"])
|
||||
if(!client.authenticated)
|
||||
src << "You are not authorized to enter the game."
|
||||
@@ -339,6 +343,14 @@
|
||||
|
||||
return new_character
|
||||
|
||||
proc/ViewManifest()
|
||||
var/dat = "<html><body>"
|
||||
dat += "<h4>Crew Manifest</h4>"
|
||||
for(var/datum/data/record/t in data_core.general)
|
||||
dat += "[t.fields["name"]] - [t.fields["rank"]]<br>"
|
||||
dat += "<br>"
|
||||
|
||||
src << browse(dat, "window=manifest;size=300x420;can_close=1")
|
||||
|
||||
Move()
|
||||
return 0
|
||||
|
||||
@@ -102,6 +102,9 @@ datum/preferences
|
||||
job_engsec_med = 0
|
||||
job_engsec_low = 0
|
||||
|
||||
// slot stuff
|
||||
var/slotname
|
||||
var/curslot = 0
|
||||
|
||||
New()
|
||||
hair_style = new/datum/sprite_accessory/hair/short
|
||||
@@ -172,14 +175,32 @@ datum/preferences
|
||||
src.be_special = 0
|
||||
dat += "<hr>"
|
||||
|
||||
if(!IsGuestKey(user.key))
|
||||
dat += "<a href='byond://?src=\ref[user];preferences=1;load=1'>Load Setup</a><br>"
|
||||
dat += "<a href='byond://?src=\ref[user];preferences=1;save=1'>Save Setup</a><br>"
|
||||
// slot options
|
||||
if (!IsGuestKey(user.key))
|
||||
if(!curslot)
|
||||
dat += "<a href='byond://?src=\ref[user];preferences=1;saveslot=1'>Save Slot 1</a><br>"
|
||||
else
|
||||
dat += "<a href='byond://?src=\ref[user];preferences=1;saveslot=[curslot]'>Save Slot [curslot]</a><br>"
|
||||
dat += "<a href='byond://?src=\ref[user];preferences=1;loadslot2=1'>Load</a><br>"
|
||||
dat += "<a href='byond://?src=\ref[user];preferences=1;createslot=1'>Create New Slot</a><br>"
|
||||
|
||||
dat += "<a href='byond://?src=\ref[user];preferences=1;reset_all=1'>Reset Setup</a><br>"
|
||||
dat += "</body></html>"
|
||||
|
||||
user << browse(dat, "window=preferences;size=300x710")
|
||||
proc/loadsave(mob/user)
|
||||
var/dat = "<body>"
|
||||
dat += "<tt><center>"
|
||||
|
||||
var/list/slots = savefile_getslots(user)
|
||||
for(var/slot=1, slot<=slots.len, slot++)
|
||||
dat += "<a href='byond://?src=\ref[user];preferences=1;loadslot=[slot]'>Load Slot [slot] ([slots[slot]]) </a><a href='byond://?src=\ref[user];preferences=1;removeslot=[slot]'>(R)</a><br><br>"
|
||||
|
||||
dat += "<a href='byond://?src=\ref[user];preferences=1;loadslot=CLOSE'>Close</a><br>"
|
||||
dat += "</center></tt>"
|
||||
user << browse(dat, "window=saves;size=300x640")
|
||||
proc/closesave(mob/user)
|
||||
user << browse(null, "window=saves;size=300x640")
|
||||
|
||||
proc/SetChoices(mob/user, changedjob)
|
||||
var/HTML = "<body>"
|
||||
@@ -536,13 +557,50 @@ datum/preferences
|
||||
if(link_tags["b_random_name"])
|
||||
be_random_name = !be_random_name
|
||||
|
||||
// slot links
|
||||
if(!IsGuestKey(user.key))
|
||||
if(link_tags["save"])
|
||||
savefile_save(user)
|
||||
if(link_tags["saveslot"])
|
||||
var/slot = text2num(link_tags["saveslot"])
|
||||
|
||||
else if(link_tags["load"])
|
||||
if(!savefile_load(user, 0))
|
||||
savefile_save(user, slot)
|
||||
|
||||
else if(link_tags["loadslot"])
|
||||
var/slot = text2num(link_tags["loadslot"])
|
||||
if(slot == "CLOSE")
|
||||
closesave(user)
|
||||
return
|
||||
if(!savefile_load(user, slot))
|
||||
alert(user, "You do not have a savefile.")
|
||||
else
|
||||
curslot = slot
|
||||
loadsave(user)
|
||||
if(link_tags["removeslot"])
|
||||
var/slot = text2num(link_tags["removeslot"])
|
||||
if(!slot)
|
||||
return
|
||||
|
||||
savefile_removeslot(user, slot)
|
||||
|
||||
usr << "Slot [slot] Deleted."
|
||||
curslot = 1
|
||||
loadsave(usr)
|
||||
if(link_tags["loadslot2"])
|
||||
loadsave(user)
|
||||
if(link_tags["createslot"])
|
||||
var/list/slots = savefile_getslots(user)
|
||||
var/count = slots.len
|
||||
count++
|
||||
if(count > 10)
|
||||
usr << "You have reached the character limit."
|
||||
return
|
||||
var/slotname = input(usr,"Choose a name for your slot","Name","Default")
|
||||
|
||||
curslot = savefile_createslot(user, slotname)
|
||||
|
||||
if(!savefile_load(user, count))
|
||||
alert(user, "You do not have a savefile.")
|
||||
else
|
||||
closesave(user)
|
||||
|
||||
if(link_tags["reset_all"])
|
||||
gender = MALE
|
||||
|
||||
@@ -4,16 +4,96 @@
|
||||
datum/preferences/proc/savefile_path(mob/user)
|
||||
return "data/player_saves/[copytext(user.ckey, 1, 2)]/[user.ckey]/preferences.sav"
|
||||
|
||||
datum/preferences/proc/savefile_save(mob/user)
|
||||
datum/preferences/proc/savefile_getslots(mob/user)
|
||||
if(IsGuestKey(user.key))
|
||||
return new/list()
|
||||
|
||||
var/path = savefile_path(user)
|
||||
if(!fexists(path))
|
||||
return new/list()
|
||||
|
||||
var/list/slots = new()
|
||||
var/savefile/F = new(path)
|
||||
|
||||
// slot 1
|
||||
slots.Add(F["slotname"] ? F["slotname"] : "Default") // allow old prefs saves to be loaded as slot 1
|
||||
|
||||
// slots 2 - len
|
||||
for(var/i=1, i<=F.dir.len, i++)
|
||||
var/dname = F.dir[i]
|
||||
if(copytext(dname, 1, 6) == "slot.")
|
||||
slots.Add(copytext(dname, 6))
|
||||
|
||||
return slots
|
||||
|
||||
datum/preferences/proc/savefile_createslot(mob/user, slotname)
|
||||
if(IsGuestKey(user.key))
|
||||
return
|
||||
|
||||
var/path = savefile_path(user)
|
||||
if(!fexists(path))
|
||||
return
|
||||
|
||||
var/savefile/F = new(path)
|
||||
|
||||
// 1st?
|
||||
if(!F["real_name"])
|
||||
F["slotname"] = "Default"
|
||||
randomize_name()
|
||||
else
|
||||
F.dir.Add("slot." + slotname)
|
||||
|
||||
var/list/slots = savefile_getslots(user)
|
||||
var/slot = slots.Find(slotname)
|
||||
savefile_save(user, slot)
|
||||
return slot
|
||||
|
||||
datum/preferences/proc/savefile_removeslot(mob/user, slot)
|
||||
if(IsGuestKey(user.key))
|
||||
return
|
||||
|
||||
var/path = savefile_path(user)
|
||||
if(!fexists(path))
|
||||
return
|
||||
|
||||
var/list/slots = savefile_getslots(user)
|
||||
|
||||
if(slot > 1)
|
||||
var/savefile/F = new(path)
|
||||
F.dir.Remove("slot." + slots[slot])
|
||||
else if(slots.len >= 2)
|
||||
// otherwise, we're deleting slot 1, and must move slot 2 to slot 1
|
||||
savefile_load(user, 2)
|
||||
savefile_save(user, 1)
|
||||
|
||||
var/savefile/F = new(path)
|
||||
F["slotname"] = slots[2] // slot 1's name <- slot 2's name
|
||||
F.dir.Remove("slot." + slots[2])
|
||||
else
|
||||
// otherwise, we're wiping the last save (slot 1)
|
||||
// actually no, that makes unintuitive, weird things happen
|
||||
//F["slotname"] = null
|
||||
//F["real_name"] = null
|
||||
user << "You must have at least one slot!"
|
||||
|
||||
datum/preferences/proc/savefile_save(mob/user, slot)
|
||||
if (IsGuestKey(user.key))
|
||||
return 0
|
||||
|
||||
var/savefile/F = new /savefile(src.savefile_path(user))
|
||||
// var/version
|
||||
// F["version"] >> version
|
||||
var/list/slots = savefile_getslots(user)
|
||||
var/savefile/F = new(savefile_path(user))
|
||||
|
||||
// var/version
|
||||
// F["version"] >> version
|
||||
|
||||
F["version"] << SAVEFILE_VERSION_MAX
|
||||
|
||||
// make this compatible with old single-slot system, making slot 1 be in root
|
||||
if(slot != 1)
|
||||
if(slots.len < slot)
|
||||
return 0
|
||||
F.cd = "slot." + slots[slot]
|
||||
|
||||
F["real_name"] << src.real_name
|
||||
F["name_is_always_random"] << src.be_random_name
|
||||
|
||||
@@ -62,13 +142,15 @@ datum/preferences/proc/savefile_save(mob/user)
|
||||
// returns 1 if loaded (or file was incompatible)
|
||||
// returns 0 if savefile did not exist
|
||||
|
||||
datum/preferences/proc/savefile_load(mob/user)
|
||||
datum/preferences/proc/savefile_load(mob/user, slot)
|
||||
if(IsGuestKey(user.key)) return 0
|
||||
|
||||
var/path = savefile_path(user)
|
||||
if(!fexists(path)) return 0
|
||||
if(!fexists(path))
|
||||
// make it then!
|
||||
savefile_save(user, slot)
|
||||
|
||||
var/savefile/F = new /savefile(path)
|
||||
var/savefile/F = new(path)
|
||||
|
||||
var/version = null
|
||||
F["version"] >> version
|
||||
@@ -78,6 +160,15 @@ datum/preferences/proc/savefile_load(mob/user)
|
||||
alert(user, "Your savefile was incompatible with this version and was deleted.")
|
||||
return 0
|
||||
|
||||
// make this compatible with old single-slot system, making slot 1 be in root
|
||||
if(slot == 0)
|
||||
return 0
|
||||
if(slot != 1)
|
||||
var/list/slots = savefile_getslots(user)
|
||||
if(slots.len < slot)
|
||||
return 0
|
||||
F.cd = "slot." + slots[slot]
|
||||
|
||||
F["real_name"] >> src.real_name
|
||||
F["gender"] >> src.gender
|
||||
F["age"] >> src.age
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
/mob/proc/AIize()
|
||||
if(client)
|
||||
client.screen.len = null
|
||||
var/mob/living/silicon/ai/O = new (loc, /datum/ai_laws/asimov,,1)//No MMI but safety is in effect.
|
||||
var/mob/living/silicon/ai/O = new (loc, /datum/ai_laws/nanotrasen,,1)//No MMI but safety is in effect.
|
||||
O.invisibility = 0
|
||||
O.aiRestorePowerRoutine = 0
|
||||
O.lastKnownIP = client.address
|
||||
|
||||
@@ -441,6 +441,15 @@ datum
|
||||
materials = list("$glass" = 2000, "acid" = 20, "$diamond" = 100)
|
||||
build_path = "/obj/item/weapon/aiModule/asimov"
|
||||
|
||||
nanotrasen
|
||||
name = "Core Module Design (Nanotrasen)"
|
||||
desc = "Allows for the construction of a NanoTrasen AI Core Module."
|
||||
id = "nanotrasen_module"
|
||||
req_tech = list("programming" = 3, "materials" = 6)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "acid" = 20, "$diamond" = 100)
|
||||
build_path = "/obj/item/weapon/aiModule/nanotrasen"
|
||||
|
||||
paladin_module
|
||||
name = "Core Module Design (P.A.L.A.D.I.N.)"
|
||||
desc = "Allows for the construction of a P.A.L.A.D.I.N. AI Core Module."
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 65 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 49 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 317 KiB After Width: | Height: | Size: 320 KiB |
Reference in New Issue
Block a user