Merge branch 'master' of https://github.com/tgstation/-tg-station into VisionUpdateRefactor

Conflicts:
	code/_onclick/hud/alien.dm
	code/_onclick/hud/alien_larva.dm
	code/_onclick/hud/hud.dm
	code/_onclick/hud/human.dm
	code/_onclick/hud/monkey.dm
	code/_onclick/hud/other_mobs.dm
	code/_onclick/hud/robot.dm
	code/game/machinery/Sleeper.dm
	code/modules/mob/living/carbon/alien/larva/death.dm
	code/modules/mob/living/carbon/brain/death.dm
	code/modules/mob/living/carbon/human/death.dm
	code/modules/mob/living/carbon/human/life.dm
	code/modules/mob/living/carbon/human/species.dm
	code/modules/mob/living/carbon/life.dm
	code/modules/mob/living/carbon/monkey/death.dm
	code/modules/mob/living/death.dm
	code/modules/mob/living/life.dm
	code/modules/mob/living/silicon/ai/death.dm
	code/modules/mob/living/silicon/ai/life.dm
	code/modules/mob/living/silicon/ai/login.dm
	code/modules/mob/living/silicon/pai/death.dm
	code/modules/mob/living/silicon/robot/death.dm
	code/modules/mob/living/silicon/robot/robot.dm
	code/modules/mob/mob_defines.dm
This commit is contained in:
phil235
2016-02-06 15:42:13 +01:00
committed by phil235
232 changed files with 3352 additions and 3653 deletions
-1
View File
@@ -24,7 +24,6 @@ var/datum/subsystem/air/SSair
var/list/networks = list()
var/list/obj/machinery/atmos_machinery = list()
//Special functions lists
var/list/turf/simulated/active_super_conductivity = list()
var/list/turf/simulated/high_pressure_delta = list()
+4 -4
View File
@@ -426,10 +426,10 @@ var/datum/subsystem/job/SSjob
/datum/subsystem/job/proc/LoadJobs()
var/jobstext = return_file_text("config/jobs.txt")
for(var/datum/job/J in occupations)
var/regex = "[J.title]=(-1|\\d+),(-1|\\d+)"
var/datum/regex/results = regex_find(jobstext, regex)
J.total_positions = text2num(results.str(2))
J.spawn_positions = text2num(results.str(3))
var/regex/jobs = new("[J.title]=(-1|\\d+),(-1|\\d+)")
jobs.Find(jobstext)
J.total_positions = text2num(jobs.group[2])
J.spawn_positions = text2num(jobs.group[3])
/datum/subsystem/job/proc/HandleFeedbackGathering()
for(var/datum/job/job in occupations)
-123
View File
@@ -210,126 +210,3 @@ var/datum/subsystem/shuttle/SSshuttle
S.dwidth = M.dwidth
S.dheight = M.dheight
moveShuttle(M.id, "[M.roundstart_move]", 0)
/datum/supply_order
var/ordernum
var/datum/supply_packs/object = null
var/orderedby = null
var/orderedbyRank
var/comment = null
/datum/supply_order/proc/generateRequisition(atom/_loc)
if(!object)
return
var/obj/item/weapon/paper/reqform = new /obj/item/weapon/paper(_loc)
reqform.name = "requisition form - [object.name]"
reqform.info += "<h3>[station_name] Supply Requisition Form</h3><hr>"
reqform.info += "INDEX: #[ordernum]<br>"
reqform.info += "REQUESTED BY: [orderedby]<br>"
reqform.info += "RANK: [orderedbyRank]<br>"
reqform.info += "REASON: [comment]<br>"
reqform.info += "SUPPLY CRATE TYPE: [object.name]<br>"
reqform.info += "ACCESS RESTRICTION: [get_access_desc(object.access)]<br>"
reqform.info += "CONTENTS:<br>"
reqform.info += object.manifest
reqform.info += "<hr>"
reqform.info += "STAMP BELOW TO APPROVE THIS REQUISITION:<br>"
reqform.update_icon() //Fix for appearing blank when printed.
return reqform
/datum/supply_order/proc/createObject(atom/_loc, errors=0)
if(!object)
return
//create the crate
var/atom/Crate = new object.containertype(_loc)
Crate.name = "[object.containername] [comment ? "([comment])":"" ]"
if(object.access)
Crate:req_access = list(text2num(object.access))
//create the manifest slip
var/obj/item/weapon/paper/manifest/slip = new /obj/item/weapon/paper/manifest()
slip.erroneous = errors
slip.points = object.cost
slip.ordernumber = ordernum
var/stationName = (errors & MANIFEST_ERROR_NAME) ? new_station_name() : station_name()
var/packagesAmt = SSshuttle.shoppinglist.len + ((errors & MANIFEST_ERROR_COUNT) ? rand(1,2) : 0)
slip.info = "<h3>[command_name()] Shipping Manifest</h3><hr><br>"
slip.info +="Order #[ordernum]<br>"
slip.info +="Destination: [stationName]<br>"
slip.info +="[packagesAmt] PACKAGES IN THIS SHIPMENT<br>"
slip.info +="CONTENTS:<br><ul>"
//we now create the actual contents
var/list/contains
if(istype(object, /datum/supply_packs/misc/randomised))
var/datum/supply_packs/misc/randomised/SO = object
contains = list()
if(object.contains.len)
for(var/j=1, j<=SO.num_contained, j++)
contains += pick(object.contains)
else
contains = object.contains
for(var/typepath in contains)
if(!typepath)
continue
var/atom/A = new typepath(Crate)
if(object.amount && A.vars.Find("amount") && A:amount)
A:amount = object.amount
slip.info += "<li>[A.name]</li>" //add the item to the manifest (even if it was misplaced)
if(istype(Crate, /obj/structure/closet/critter)) // critter crates do not actually spawn mobs yet and have no contains var, but the manifest still needs to list them
var/obj/structure/closet/critter/CritCrate = Crate
if(CritCrate.content_mob)
var/mob/crittername = CritCrate.content_mob
slip.info += "<li>[initial(crittername.name)]</li>"
if((errors & MANIFEST_ERROR_ITEM))
//secure and large crates cannot lose items
if(findtext("[object.containertype]", "/secure/") || findtext("[object.containertype]","/largecrate/"))
errors &= ~MANIFEST_ERROR_ITEM
else
var/lostAmt = max(round(Crate.contents.len/10), 1)
//lose some of the items
while(--lostAmt >= 0)
qdel(pick(Crate.contents))
//manifest finalisation
slip.info += "</ul><br>"
slip.info += "CHECK CONTENTS AND STAMP BELOW THE LINE TO CONFIRM RECEIPT OF GOODS<hr>" // And now this is actually meaningful.
slip.loc = Crate
if(istype(Crate, /obj/structure/closet/crate))
var/obj/structure/closet/crate/CR = Crate
CR.manifest = slip
CR.update_icon()
if(istype(Crate, /obj/structure/largecrate))
var/obj/structure/largecrate/LC = Crate
LC.manifest = slip
LC.update_icon()
return Crate
/datum/subsystem/shuttle/proc/generateSupplyOrder(packId, _orderedby, _orderedbyRank, _comment)
if(!packId)
return
var/datum/supply_packs/P = supply_packs["[packId]"]
if(!P)
return
var/datum/supply_order/O = new()
O.ordernum = ordernum++
O.object = P
O.orderedby = _orderedby
O.orderedbyRank = _orderedbyRank
O.comment = _comment
requestlist += O
return O
+169 -517
View File
@@ -16,205 +16,6 @@
height = 7
roundstart_move = "supply_away"
/obj/docking_port/mobile/supply/New()
..()
SSshuttle.supply = src
/obj/docking_port/mobile/supply/canMove()
if(z == ZLEVEL_STATION)
return forbidden_atoms_check(areaInstance)
return ..()
/obj/docking_port/mobile/supply/request(obj/docking_port/stationary/S)
if(mode != SHUTTLE_IDLE)
return 2
return ..()
/obj/docking_port/mobile/supply/dock()
. = ..()
if(.)
return .
buy()
sell()
/obj/docking_port/mobile/supply/proc/buy()
if(z != ZLEVEL_STATION) //we only buy when we are -at- the station
return 1
if(!SSshuttle.shoppinglist.len)
return 2
var/list/emptyTurfs = list()
for(var/turf/simulated/floor/T in areaInstance)
if(T.density || T.contents.len)
continue
emptyTurfs += T
for(var/datum/supply_order/SO in SSshuttle.shoppinglist)
if(!SO.object)
continue
var/turf/T = pick_n_take(emptyTurfs) //turf we will place it in
if(!T)
SSshuttle.shoppinglist.Cut(1, SSshuttle.shoppinglist.Find(SO))
return
var/errors = 0
if(prob(5))
errors |= MANIFEST_ERROR_COUNT
if(prob(5))
errors |= MANIFEST_ERROR_NAME
if(prob(5))
errors |= MANIFEST_ERROR_ITEM
SO.createObject(T, errors)
SSshuttle.shoppinglist.Cut()
/obj/docking_port/mobile/supply/proc/sell()
if(z != ZLEVEL_CENTCOM) //we only sell when we are -at- centcomm
return 1
var/plasma_count = 0
var/intel_count = 0
var/crate_count = 0
var/msg = ""
var/pointsEarned
for(var/atom/movable/MA in areaInstance)
if(MA.anchored)
continue
SSshuttle.sold_atoms += " [MA.name]"
// Must be in a crate (or a critter crate)!
if(istype(MA,/obj/structure/closet/crate) || istype(MA,/obj/structure/closet/critter))
SSshuttle.sold_atoms += ":"
if(!MA.contents.len)
SSshuttle.sold_atoms += " (empty)"
++crate_count
var/find_slip = 1
for(var/thing in MA)
// Sell manifests
SSshuttle.sold_atoms += " [thing:name]"
if(find_slip && istype(thing,/obj/item/weapon/paper/manifest))
var/obj/item/weapon/paper/manifest/slip = thing
// TODO: Check for a signature, too.
if(slip.stamped && slip.stamped.len) //yes, the clown stamp will work. clown is the highest authority on the station, it makes sense
// Did they mark it as erroneous?
var/denied = 0
for(var/i=1,i<=slip.stamped.len,i++)
if(slip.stamped[i] == /obj/item/weapon/stamp/denied)
denied = 1
if(slip.erroneous && denied) // Caught a mistake by Centcom (IDEA: maybe Centcom rarely gets offended by this)
pointsEarned = slip.points - SSshuttle.points_per_crate
SSshuttle.points += pointsEarned // For now, give a full refund for paying attention (minus the crate cost)
msg += "<font color=green>+[pointsEarned]</font>: Station correctly denied package [slip.ordernumber]: "
if(slip.erroneous & MANIFEST_ERROR_NAME)
msg += "Destination station incorrect. "
else if(slip.erroneous & MANIFEST_ERROR_COUNT)
msg += "Packages incorrectly counted. "
else if(slip.erroneous & MANIFEST_ERROR_ITEM)
msg += "Package incomplete. "
msg += "Points refunded.<BR>"
else if(!slip.erroneous && !denied) // Approving a proper order awards the relatively tiny points_per_slip
SSshuttle.points += SSshuttle.points_per_slip
msg += "<font color=green>+[SSshuttle.points_per_slip]</font>: Package [slip.ordernumber] accorded.<BR>"
else // You done goofed.
if(slip.erroneous)
msg += "<font color=red>+0</font>: Station approved package [slip.ordernumber] despite error: "
if(slip.erroneous & MANIFEST_ERROR_NAME)
msg += "Destination station incorrect."
else if(slip.erroneous & MANIFEST_ERROR_COUNT)
msg += "Packages incorrectly counted."
else if(slip.erroneous & MANIFEST_ERROR_ITEM)
msg += "We found unshipped items on our dock."
msg += " Be more vigilant.<BR>"
else
pointsEarned = round(SSshuttle.points_per_crate - slip.points)
SSshuttle.points += pointsEarned
msg += "<font color=red>[pointsEarned]</font>: Station denied package [slip.ordernumber]. Our records show no fault on our part.<BR>"
find_slip = 0
continue
// Sell plasma
if(istype(thing, /obj/item/stack/sheet/mineral/plasma))
var/obj/item/stack/sheet/mineral/plasma/P = thing
plasma_count += P.amount
// Sell syndicate intel
if(istype(thing, /obj/item/documents/syndicate))
++intel_count
// Sell tech levels
if(istype(thing, /obj/item/weapon/disk/tech_disk))
var/obj/item/weapon/disk/tech_disk/disk = thing
if(!disk.stored)
continue
var/datum/tech/tech = disk.stored
var/cost = tech.getCost(SSshuttle.techLevels[tech.id])
if(cost)
SSshuttle.techLevels[tech.id] = tech.level
SSshuttle.points += cost
msg += "<font color=green>+[cost]</font>: [tech.name] - new data.<BR>"
// Sell max reliablity designs
if(istype(thing, /obj/item/weapon/disk/design_disk))
var/obj/item/weapon/disk/design_disk/disk = thing
if(!disk.blueprint)
continue
var/datum/design/design = disk.blueprint
if(design.id in SSshuttle.researchDesigns)
continue
if(initial(design.reliability) < 100 && design.reliability >= 100)
// Maxed out reliability designs only.
SSshuttle.points += SSshuttle.points_per_design
SSshuttle.researchDesigns += design.id
msg += "<font color=green>+[SSshuttle.points_per_design]</font>: Reliable [design.name] design.<BR>"
// Sell exotic plants
if(istype(thing, /obj/item/seeds))
var/obj/item/seeds/S = thing
if(S.rarity == 0) // Mundane species
msg += "<font color=red>+0</font>: We don't need samples of mundane species \"[capitalize(S.species)]\".<BR>"
else if(SSshuttle.discoveredPlants[S.type]) // This species has already been sent to CentComm
var/potDiff = S.potency - SSshuttle.discoveredPlants[S.type] // Compare it to the previous best
if(potDiff > 0) // This sample is better
SSshuttle.discoveredPlants[S.type] = S.potency
msg += "<font color=green>+[potDiff]</font>: New sample of \"[capitalize(S.species)]\" is superior. Good work.<BR>"
SSshuttle.points += potDiff
else // This sample is worthless
msg += "<font color=red>+0</font>: New sample of \"[capitalize(S.species)]\" is not more potent than existing sample ([SSshuttle.discoveredPlants[S.type]] potency).<BR>"
else // This is a new discovery!
SSshuttle.discoveredPlants[S.type] = S.potency
msg += "<font color=green>+[S.rarity]</font>: New species discovered: \"[capitalize(S.species)]\". Excellent work.<BR>"
SSshuttle.points += S.rarity // That's right, no bonus for potency. Send a crappy sample first to "show improvement" later
qdel(MA)
SSshuttle.sold_atoms += "."
if(plasma_count > 0)
pointsEarned = round(plasma_count * SSshuttle.points_per_plasma)
msg += "<font color=green>+[pointsEarned]</font>: Received [plasma_count] unit(s) of exotic material.<BR>"
SSshuttle.points += pointsEarned
if(intel_count > 0)
pointsEarned = round(intel_count * SSshuttle.points_per_intel)
msg += "<font color=green>+[pointsEarned]</font>: Received [intel_count] article(s) of enemy intelligence.<BR>"
SSshuttle.points += pointsEarned
if(crate_count > 0)
pointsEarned = round(crate_count * SSshuttle.points_per_crate)
msg += "<font color=green>+[pointsEarned]</font>: Received [crate_count] crate(s).<BR>"
SSshuttle.points += pointsEarned
SSshuttle.centcom_message = msg
/proc/forbidden_atoms_check(atom/A)
var/list/blacklist = list(
/mob/living,
/obj/effect/blob,
@@ -230,348 +31,199 @@
/obj/machinery/telepad,
/obj/machinery/clonepod
)
if(A)
if(is_type_in_list(A, blacklist))
/obj/docking_port/mobile/supply/New()
..()
SSshuttle.supply = src
/obj/docking_port/mobile/supply/canMove()
if(z == ZLEVEL_STATION)
return check_blacklist(areaInstance)
return ..()
/obj/docking_port/mobile/supply/proc/check_blacklist(atom/A)
if(is_type_in_list(A, blacklist))
return 1
for(var/thing in A)
if(.(thing))
return 1
for(var/thing in A)
if(.(thing))
return 1
return 0
/obj/docking_port/mobile/supply/request()
if(mode != SHUTTLE_IDLE)
return 2
return ..()
/obj/machinery/computer/ordercomp/attack_hand(mob/user)
if(..())
/obj/docking_port/mobile/supply/dock()
if(getDockedId() == "supply_away") // Buy when we leave home.
buy()
if(..()) // Fly/enter transit.
return
user.set_machine(src)
var/dat
if(temp)
dat = temp
else
dat += {"<div class='statusDisplay'>Shuttle Location: [SSshuttle.supply.name]<BR>
<HR>Supply Points: [SSshuttle.points]<BR></div>
if(getDockedId() == "supply_away") // Sell when we get home
sell()
<BR>\n<A href='?src=\ref[src];order=categories'>Request items</A><BR><BR>
<A href='?src=\ref[src];vieworders=1'>View approved orders</A><BR><BR>
<A href='?src=\ref[src];viewrequests=1'>View requests</A><BR><BR>
<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
// Removing the old window method but leaving it here for reference
//user << browse(dat, "window=computer;size=575x450")
//onclose(user, "computer")
// Added the new browser window method
var/datum/browser/popup = new(user, "computer", "Supply Ordering Console", 575, 450)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
return
/obj/machinery/computer/ordercomp/Topic(href, href_list)
if(..())
/obj/docking_port/mobile/supply/proc/buy()
if(!SSshuttle.shoppinglist.len)
return
if( isturf(loc) && (in_range(src, usr) || istype(usr, /mob/living/silicon)) )
usr.set_machine(src)
var/list/emptyTurfs = list()
for(var/turf/simulated/floor/T in areaInstance)
if(T.density || T.contents.len)
continue
emptyTurfs += T
if(href_list["order"])
if(href_list["order"] == "categories")
//all_supply_groups
//Request what?
last_viewed_group = "categories"
temp = "<div class='statusDisplay'><b>Supply points: [SSshuttle.points]</b><BR>"
temp += "<A href='?src=\ref[src];mainmenu=1'>Main Menu</A><BR></div><BR>"
temp += "<b>Select a category</b><BR><BR>"
for(var/cat in all_supply_groups )
temp += "<A href='?src=\ref[src];order=[cat]'>[get_supply_group_name(cat)]</A><BR>"
else
last_viewed_group = href_list["order"]
var/cat = text2num(last_viewed_group)
temp = "<div class='statusDisplay'><b>Supply points: [SSshuttle.points]</b><BR>"
temp += "<A href='?src=\ref[src];order=categories'>Back to all categories</A><BR></div><BR>"
temp += "<b>Request from: [get_supply_group_name(cat)]</b><BR><BR>"
for(var/supply_type in SSshuttle.supply_packs )
var/datum/supply_packs/N = SSshuttle.supply_packs[supply_type]
if(N.hidden || N.contraband || N.group != cat)
continue //Have to send the type instead of a reference to
temp += "<A href='?src=\ref[src];doorder=[supply_type]'>[N.name]</A> Cost: [N.cost]<BR>" //the obj because it would get caught by the garbage
else if (href_list["doorder"])
if(world.time < reqtime)
say("[world.time - reqtime] seconds remaining until another requisition form may be printed.")
return
for(var/datum/supply_order/SO in SSshuttle.shoppinglist)
if(!SO.object)
continue
if(SO.object.cost > SSshuttle.points)
continue
//Find the correct supply_pack datum
if(!SSshuttle.supply_packs["[href_list["doorder"]]"])
return
var/errors = 0
if(prob(5))
errors |= MANIFEST_ERROR_COUNT
if(prob(5))
errors |= MANIFEST_ERROR_NAME
if(prob(5))
errors |= MANIFEST_ERROR_ITEM
var/timeout = world.time + 600
var/reason = stripped_input(usr,"Reason:","Why do you require this item?","")
if(world.time > timeout)
return
if(!reason)
return
var/turf/T = pick_n_take(emptyTurfs)
SO.createObject(T, errors)
var/idname = "*None Provided*"
var/idrank = "*None Provided*"
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
idname = H.get_authentification_name()
idrank = H.get_assignment()
else if(issilicon(usr))
idname = usr.real_name
SSshuttle.points -= SO.object.cost
SSshuttle.shoppinglist -= SO
var/datum/supply_order/O = SSshuttle.generateSupplyOrder(href_list["doorder"], idname, idrank, reason)
if(!O)
return
O.generateRequisition(loc)
/obj/docking_port/mobile/supply/proc/sell()
var/crates = 0
var/plasma = 0
var/intel = 0
reqtime = (world.time + 5) % 1e5
var/msg = ""
var/pointsEarned = 0
temp = "Thanks for your request. The cargo team will process it as soon as possible.<BR>"
temp += "<BR><A href='?src=\ref[src];order=[last_viewed_group]'>Back</A> <A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
for(var/atom/movable/AM in areaInstance)
if(AM.anchored)
continue
SSshuttle.sold_atoms += " [AM.name]"
else if (href_list["vieworders"])
temp = "<A href='?src=\ref[src];mainmenu=1'>Main Menu</A><BR><BR>Current approved orders: <BR><BR>"
for(var/datum/supply_order/SO in SSshuttle.shoppinglist)
temp += "[SO.object.name] approved by [SO.orderedby] [SO.comment ? "([SO.comment])":""]<BR>"
else if (href_list["viewrequests"])
temp = "<A href='?src=\ref[src];mainmenu=1'>Main Menu</A><BR><BR>Current requests: <BR><BR>"
for(var/datum/supply_order/SO in SSshuttle.requestlist)
temp += "#[SO.ordernum] - [SO.object.name] requested by [SO.orderedby]<BR>"
else if (href_list["mainmenu"])
temp = null
add_fingerprint(usr)
updateUsrDialog()
return
/obj/machinery/computer/supplycomp/attack_hand(mob/user)
if(!allowed(user))
user << "<span class='warning'>Access Denied.</span>"
return
if(..())
return
user.set_machine(src)
post_signal("supply")
var/dat
if (temp)
dat = temp
else
var/atDepot = (SSshuttle.supply.getDockedId() == "supply_away")
var/inTransit = (SSshuttle.supply.mode != SHUTTLE_IDLE)
var/canOrder = atDepot && !inTransit
dat += {"<div class='statusDisplay'><B>Supply shuttle</B><HR>
Location: [SSshuttle.supply.getStatusText()]<BR>
<HR>\nSupply Points: [SSshuttle.points]<BR>\n</div><BR>
[canOrder ? "\n<A href='?src=\ref[src];order=categories'>Order items</A><BR>\n<BR>" : "\n*Must be away to order items*<BR>\n<BR>"]
[inTransit ? "\n*Shuttle already called*<BR>\n<BR>": atDepot ? "\n<A href='?src=\ref[src];send=1'>Send to station</A><BR>\n<BR>":"\n<A href='?src=\ref[src];send=1'>Send to centcom</A><BR>\n<BR>"]
[SSshuttle.shuttle_loan ? (SSshuttle.shuttle_loan.dispatched ? "\n*Shuttle loaned to Centcom*<BR>\n<BR>" : "\n<A href='?src=\ref[src];send=1;loan=1'>Loan shuttle to Centcom (5 mins duration)</A><BR>\n<BR>") : "\n*No pending external shuttle requests*<BR>\n<BR>"]
\n<A href='?src=\ref[src];viewrequests=1'>View requests</A><BR>\n<BR>
\n<A href='?src=\ref[src];vieworders=1'>View orders</A><BR>\n<BR>
\n<A href='?src=\ref[user];mach_close=computer'>Close</A><BR>
<HR>\n<B>Central Command messages:</B><BR> [SSshuttle.centcom_message ? SSshuttle.centcom_message : "Remember to stamp and send back the supply manifests."]"}
var/datum/browser/popup = new(user, "computer", "Supply Shuttle Console", 700, 455)
popup.set_content(dat)
popup.open()
return
/obj/machinery/computer/supplycomp/emag_act(mob/user)
if(!hacked)
user << "<span class='notice'>Special supplies unlocked.</span>"
hacked = 1
/obj/machinery/computer/supplycomp/Topic(href, href_list)
if(..())
return
if(isturf(loc) && ( in_range(src, usr) || istype(usr, /mob/living/silicon) ) )
usr.set_machine(src)
//Calling the shuttle
if(href_list["send"])
if(SSshuttle.supply.canMove())
if(SSshuttle.shuttle_loan)
temp = "The supply shuttle must be docked to send new commands.<BR><BR><A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
if(istype(AM, /obj/structure/closet/crate) || istype(AM, /obj/structure/closet/critter))
crates++
SSshuttle.sold_atoms += ":"
if(!AM.contents.len)
SSshuttle.sold_atoms += " (empty)"
else
temp = "For safety reasons the automated supply shuttle cannot transport live organisms, classified nuclear weaponry or homing beacons.<BR><BR><A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
var/slip_found = FALSE
for(var/atom/movable/thing in AM)
SSshuttle.sold_atoms += " [thing.name]"
if(!slip_found && istype(thing, /obj/item/weapon/paper/manifest))
var/obj/item/weapon/paper/manifest/slip = thing
if(slip.stamped && slip.stamped.len)
slip_found = TRUE
var/denied = FALSE
for(var/stamp in slip.stamped)
if(stamp == /obj/item/weapon/stamp/denied)
denied = TRUE
break
if(slip.erroneous && denied) // Caught a mistake by Centcom.
pointsEarned = slip.points - SSshuttle.points_per_crate
SSshuttle.points += pointsEarned // Give a full refund (minus the crate).
msg += "[pointsEarned]: Station correctly denied package [slip.ordernumber]: "
if(slip.erroneous & MANIFEST_ERROR_NAME)
msg += "Destination station incorrect. "
else if(slip.erroneous & MANIFEST_ERROR_COUNT)
msg += "Packages incorrectly counted. "
else if(slip.erroneous & MANIFEST_ERROR_ITEM)
msg += "Package incomplete. "
msg += "Points refunded."
else if(!slip.erroneous && !denied) // Approved a slip correctly.
pointsEarned = SSshuttle.points_per_slip
SSshuttle.points += pointsEarned
msg += "+[pointsEarned]: Package [slip.ordernumber] accorded."
else if(slip.erroneous) // You done goofed.
pointsEarned = -SSshuttle.points_per_slip
SSshuttle.points += pointsEarned
msg += "[pointsEarned]: Station erroneously approved package [slip.ordernumber]: "
if(slip.erroneous & MANIFEST_ERROR_NAME)
msg += "Destination station incorrect."
else if(slip.erroneous & MANIFEST_ERROR_COUNT)
msg += "Packages incorrectly counted."
else if(slip.erroneous & MANIFEST_ERROR_ITEM)
msg += "We found unshipped items on our dock."
msg += " Be more vigilant."
else
pointsEarned = round(SSshuttle.points_per_crate - slip.points)
SSshuttle.points += pointsEarned
msg += "[pointsEarned]: Station erroneously denied package [slip.ordernumber]."
else if(SSshuttle.supply.getDockedId() == "supply_home")
if(href_list["loan"] && SSshuttle.shuttle_loan)
if(!SSshuttle.shuttle_loan.dispatched)
SSshuttle.shuttle_loan.loan_shuttle()
temp = "The supply shuttle has been loaned to Centcom.<BR><BR><A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
post_signal("supply")
else
temp = "You can not loan the supply shuttle at this time.<BR><BR><A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
else
temp = "The supply shuttle has departed.<BR><BR><A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
SSshuttle.toggleShuttle("supply", "supply_home", "supply_away", 1)
investigate_log("[usr.key] has sent the supply shuttle away. Remaining points: [SSshuttle.points]. Shuttle contents:[SSshuttle.sold_atoms]", "cargo")
else
if(href_list["loan"] && SSshuttle.shuttle_loan)
if(!SSshuttle.shuttle_loan.dispatched && SSshuttle.supply.mode == SHUTTLE_IDLE) // Must either be at centcom, or at the station. No redirecting off course!
SSshuttle.shuttle_loan.loan_shuttle()
temp = "The supply shuttle has been loaned to Centcom.<BR><BR><A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
post_signal("supply")
else
temp = "You can not loan the supply shuttle at this time.<BR><BR><A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
else
if(!SSshuttle.supply.request(SSshuttle.getDock("supply_home")))
temp = "The supply shuttle has been called and will arrive in [SSshuttle.supply.timeLeft(600)] minutes.<BR><BR><A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
post_signal("supply")
// Sell plasma
if(istype(thing, /obj/item/stack/sheet/mineral/plasma))
var/obj/item/stack/sheet/mineral/plasma/P = thing
plasma += P.amount
else if (href_list["order"])
if(SSshuttle.supply.mode != SHUTTLE_IDLE)
return
if(href_list["order"] == "categories")
//all_supply_groups
//Request what?
last_viewed_group = "categories"
temp = "<div class='statusDisplay'><b>Supply points: [SSshuttle.points]</b><BR>"
temp += "<A href='?src=\ref[src];mainmenu=1'>Main Menu</A><BR></div><BR>"
temp += "<b>Select a category</b><BR><BR>"
for(var/cat in all_supply_groups )
temp += "<A href='?src=\ref[src];order=[cat]'>[get_supply_group_name(cat)]</A><BR>"
else
last_viewed_group = href_list["order"]
var/cat = text2num(last_viewed_group)
temp = "<div class='statusDisplay'><b>Supply points: [SSshuttle.points]</b><BR>"
temp += "<A href='?src=\ref[src];order=categories'>Back to all categories</A><BR></div><BR>"
temp += "<b>Request from: [get_supply_group_name(cat)]</b><BR><BR>"
for(var/supply_type in SSshuttle.supply_packs )
var/datum/supply_packs/N = SSshuttle.supply_packs[supply_type]
if((N.hidden && !hacked) || (N.contraband && !can_order_contraband) || N.group != cat)
continue //Have to send the type instead of a reference to
temp += "<A href='?src=\ref[src];doorder=[supply_type]'>[N.name]</A> Cost: [N.cost]<BR>" //the obj because it would get caught by the garbage
// Sell syndicate intel
if(istype(thing, /obj/item/documents/syndicate))
intel++
/*temp = "Supply points: [supply_shuttle.points]<BR><HR><BR>Request what?<BR><BR>"
// Sell tech levels
if(istype(thing, /obj/item/weapon/disk/tech_disk))
var/obj/item/weapon/disk/tech_disk/disk = thing
if(!disk.stored)
continue
var/datum/tech/tech = disk.stored
for(var/supply_name in supply_shuttle.supply_packs )
var/datum/supply_packs/N = supply_shuttle.supply_packs[supply_name]
if(N.hidden && !hacked) continue
if(N.contraband && !can_order_contraband) continue
temp += "<A href='?src=\ref[src];doorder=[supply_name]'>[supply_name]</A> Cost: [N.cost]<BR>" //the obj because it would get caught by the garbage
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"*/
var/cost = tech.getCost(SSshuttle.techLevels[tech.id])
if(cost)
SSshuttle.techLevels[tech.id] = tech.level
SSshuttle.points += cost
msg += "+[cost]: Data: [tech.name]."
else if (href_list["doorder"])
if(world.time < reqtime)
say("[world.time - reqtime] seconds remaining until another requisition form may be printed.")
return
// Sell max reliablity designs
if(istype(thing, /obj/item/weapon/disk/design_disk))
var/obj/item/weapon/disk/design_disk/disk = thing
if(!disk.blueprint)
continue
var/datum/design/design = disk.blueprint
if(design.id in SSshuttle.researchDesigns)
continue
//Find the correct supply_pack datum
if(!SSshuttle.supply_packs[href_list["doorder"]])
return
if(initial(design.reliability) < 100 && design.reliability >= 100)
// Maxed out reliability designs only.
SSshuttle.points += SSshuttle.points_per_design
SSshuttle.researchDesigns += design.id
msg += "+[SSshuttle.points_per_design]: Design: [design.name]."
var/timeout = world.time + 600
var/reason = stripped_input(usr,"Reason:","Why do you require this item?","")
if(world.time > timeout)
return
// if(!reason)
// return
// Sell exotic plants
if(istype(thing, /obj/item/seeds))
var/obj/item/seeds/S = thing
if(S.rarity == 0) // Mundane species
msg += "+0: We don't need samples of mundane species \"[capitalize(S.species)]\"."
else if(SSshuttle.discoveredPlants[S.type]) // This species has already been sent to CentComm
var/potDiff = S.potency - SSshuttle.discoveredPlants[S.type] // Compare it to the previous best
if(potDiff > 0) // This sample is better
SSshuttle.discoveredPlants[S.type] = S.potency
msg += "+[potDiff]: New sample of \"[capitalize(S.species)]\" is superior. Good work."
SSshuttle.points += potDiff
else // This sample is worthless
msg += "+0: New sample of \"[capitalize(S.species)]\" is not more potent than existing sample ([SSshuttle.discoveredPlants[S.type]] potency)."
else // This is a new discovery!
SSshuttle.discoveredPlants[S.type] = S.potency
msg += "[S.rarity]: New species discovered: \"[capitalize(S.species)]\". Excellent work."
SSshuttle.points += S.rarity // That's right, no bonus for potency. Send a crappy sample first to "show improvement" later
qdel(thing)
qdel(AM)
SSshuttle.sold_atoms += "."
var/idname = "*None Provided*"
var/idrank = "*None Provided*"
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
idname = H.get_authentification_name()
idrank = H.get_assignment()
else if(issilicon(usr))
idname = usr.real_name
if(plasma > 0)
pointsEarned = round(plasma * SSshuttle.points_per_plasma)
msg += "[pointsEarned]: Received [plasma] unit(s) of exotic material."
SSshuttle.points += pointsEarned
var/datum/supply_order/O = SSshuttle.generateSupplyOrder(href_list["doorder"], idname, idrank, reason)
if(!O)
return
O.generateRequisition(loc)
if(intel > 0)
pointsEarned = round(intel * SSshuttle.points_per_intel)
msg += "[pointsEarned]: Received [intel] article(s) of enemy intelligence."
SSshuttle.points += pointsEarned
reqtime = (world.time + 5) % 1e5
if(crates > 0)
pointsEarned = round(crates * SSshuttle.points_per_crate)
msg += "+[pointsEarned]: Received [crates] crate(s)."
SSshuttle.points += pointsEarned
temp = "Order request placed.<BR>"
temp += "<BR><A href='?src=\ref[src];order=[last_viewed_group]'>Back</A> | <A href='?src=\ref[src];mainmenu=1'>Main Menu</A> | <A href='?src=\ref[src];confirmorder=[O.ordernum]'>Authorize Order</A>"
else if(href_list["confirmorder"])
//Find the correct supply_order datum
var/ordernum = text2num(href_list["confirmorder"])
var/datum/supply_order/O
var/datum/supply_packs/P
temp = "Invalid Request"
for(var/i=1, i<=SSshuttle.requestlist.len, i++)
var/datum/supply_order/SO = SSshuttle.requestlist[i]
if(SO && SO.ordernum == ordernum)
O = SO
P = O.object
if(SSshuttle.points >= P.cost)
SSshuttle.requestlist.Cut(i,i+1)
SSshuttle.points -= P.cost
SSshuttle.shoppinglist += O
temp = "Thanks for your order."
investigate_log("[usr.key] has authorized an order for [P.name]. Remaining points: [SSshuttle.points].", "cargo")
else
temp = "Not enough supply points."
break
temp += "<BR><BR><A href='?src=\ref[src];viewrequests=1'>Back</A> <A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
else if (href_list["vieworders"])
temp = "<A href='?src=\ref[src];mainmenu=1'>Main Menu</A><BR><BR>Current approved orders: <BR><BR>"
for(var/datum/supply_order/SO in SSshuttle.shoppinglist)
temp += "#[SO.ordernum] - [SO.object.name] approved by [SO.orderedby][SO.comment ? " ([SO.comment])":""]<BR>"// <A href='?src=\ref[src];cancelorder=[S]'>(Cancel)</A><BR>"
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
/*
else if (href_list["cancelorder"])
var/datum/supply_order/remove_supply = href_list["cancelorder"]
supply_shuttle_shoppinglist -= remove_supply
supply_shuttle_points += remove_supply.object.cost
temp += "Canceled: [remove_supply.object.name]<BR><BR><BR>"
for(var/S in supply_shuttle_shoppinglist)
var/datum/supply_order/SO = S
temp += "[SO.object.name] approved by [SO.orderedby][SO.comment ? " ([SO.comment])":""] <A href='?src=\ref[src];cancelorder=[S]'>(Cancel)</A><BR>"
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
*/
else if (href_list["viewrequests"])
temp = "<A href='?src=\ref[src];mainmenu=1'>Main Menu</A><BR><BR>Current requests: <BR><BR>"
for(var/datum/supply_order/SO in SSshuttle.requestlist)
temp += "#[SO.ordernum] - [SO.object.name] requested by [SO.orderedby] [SSshuttle.supply.getDockedId() == "supply_away" ? "<A href='?src=\ref[src];confirmorder=[SO.ordernum]'>Approve</A> <A href='?src=\ref[src];rreq=[SO.ordernum]'>Remove</A>" : ""]<BR>"
temp += "<BR><A href='?src=\ref[src];clearreq=1'>Clear list</A>"
else if (href_list["rreq"])
var/ordernum = text2num(href_list["rreq"])
temp = "Invalid Request.<BR>"
for(var/i=1, i<=SSshuttle.requestlist.len, i++)
var/datum/supply_order/SO = SSshuttle.requestlist[i]
if(SO && SO.ordernum == ordernum)
SSshuttle.requestlist.Cut(i,i+1)
temp = "Request removed.<BR>"
break
temp += "<BR><A href='?src=\ref[src];viewrequests=1'>Back</A> <A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
else if (href_list["clearreq"])
SSshuttle.requestlist.Cut()
temp = "List cleared.<BR>"
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
else if (href_list["mainmenu"])
temp = null
add_fingerprint(usr)
updateUsrDialog()
return
/obj/machinery/computer/supplycomp/proc/post_signal(command)
var/datum/radio_frequency/frequency = SSradio.return_frequency(1435)
if(!frequency)
return
var/datum/signal/status_signal = new
status_signal.source = src
status_signal.transmission_method = 1
status_signal.data["command"] = command
frequency.post_signal(src, status_signal)
SSshuttle.centcom_message = msg
+1 -1
View File
@@ -63,7 +63,7 @@ var/datum/subsystem/timer/SStimer
event.thingToCall = thingToCall
event.procToCall = procToCall
event.timeToRun = world.time + wait
event.hash = list2text(args)
event.hash = jointext(args, null)
if(args.len > 4)
event.argList = args.Copy(5)