Merge branch 'master' into upstream-merge-26760

This commit is contained in:
LetterJay
2017-05-14 01:02:26 -04:00
committed by GitHub
531 changed files with 5863 additions and 3439 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also
/obj/machinery/computer/auxillary_base/onShuttleMove(turf/T1, rotation)
..()
if(z == ZLEVEL_MINING) //Avoids double logging and landing on other Z-levels due to badminnery
feedback_add_details("colonies_dropped", "[x]|[y]|[z]") //Number of times a base has been dropped!
SSblackbox.add_details("colonies_dropped", "[x]|[y]|[z]") //Number of times a base has been dropped!
/obj/machinery/computer/auxillary_base/proc/set_mining_mode()
if(z == ZLEVEL_MINING) //The console switches to controlling the mining shuttle once landed.
+4 -4
View File
@@ -68,7 +68,7 @@
/obj/item/device/wormhole_jaunter/attack_self(mob/user)
user.visible_message("<span class='notice'>[user.name] activates the [src.name]!</span>")
feedback_add_details("jaunter", "User") // user activated
SSblackbox.add_details("jaunter", "User") // user activated
activate(user)
/obj/item/device/wormhole_jaunter/proc/turf_check(mob/user)
@@ -124,13 +124,13 @@
if(triggered)
usr.visible_message("<span class='warning'>The [src] overloads and activates!</span>")
feedback_add_details("jaunter","EMP") // EMP accidental activation
SSblackbox.add_details("jaunter","EMP") // EMP accidental activation
activate(usr)
/obj/item/device/wormhole_jaunter/proc/chasm_react(mob/user)
if(user.get_item_by_slot(slot_belt) == src)
to_chat(user, "Your [src] activates, saving you from the chasm!</span>")
feedback_add_details("jaunter","Chasm") // chasm automatic activation
SSblackbox.add_details("jaunter","Chasm") // chasm automatic activation
activate(user)
else
to_chat(user, "The [src] is not attached to your belt, preventing it from saving you from the chasm. RIP.</span>")
@@ -320,7 +320,7 @@
H.attack_same = 0
loaded = 0
user.visible_message("<span class='notice'>[user] injects [M] with [src], reviving it.</span>")
feedback_add_details("lazarus_injector", "[M.type]")
SSblackbox.add_details("lazarus_injector", "[M.type]")
playsound(src,'sound/effects/refill.ogg',50,1)
icon_state = "lazarus_empty"
return
@@ -10,7 +10,7 @@
desc = "It's watching you suspiciously."
/obj/structure/closet/crate/necropolis/tendril/PopulateContents()
var/loot = rand(1,25)
var/loot = rand(1,26)
switch(loot)
if(1)
new /obj/item/device/shared_storage/red(src)
@@ -33,7 +33,7 @@
if(9)
new /obj/item/organ/brain/alien(src)
if(10)
new /obj/item/organ/heart/cursed(src)
new /obj/item/organ/heart/cursed/wizard(src)
if(11)
new /obj/item/ship_in_a_bottle(src)
if(12)
@@ -65,6 +65,8 @@
new /obj/item/clothing/suit/space/hardsuit/ert/paranormal/inquisitor(src)
if(25)
new /obj/item/weapon/spellbook/oneuse/summonitem(src)
if(26)
new /obj/item/book_of_babel(src)
@@ -86,7 +88,7 @@
user.sight |= SEE_MOBS
icon_state = "lantern"
wisp.orbit(user, 20)
feedback_add_details("wisp_lantern","Freed")
SSblackbox.add_details("wisp_lantern","Freed")
else
to_chat(user, "<span class='notice'>You return the wisp to the lantern.</span>")
@@ -101,7 +103,7 @@
wisp.stop_orbit()
wisp.loc = src
icon_state = "lantern-blue"
feedback_add_details("wisp_lantern","Returned")
SSblackbox.add_details("wisp_lantern","Returned")
/obj/item/device/wisp_lantern/Initialize()
..()
@@ -140,7 +142,7 @@
return
new /obj/effect/particle_effect/smoke(user.loc)
user.forceMove(get_turf(linked))
feedback_add_details("warp_cube","[src.type]")
SSblackbox.add_details("warp_cube","[src.type]")
new /obj/effect/particle_effect/smoke(user.loc)
/obj/item/device/warp_cube/red
@@ -228,7 +230,7 @@
/obj/item/device/immortality_talisman/attack_self(mob/user)
if(cooldown < world.time)
feedback_add_details("immortality_talisman","Activated") // usage
SSblackbox.add_details("immortality_talisman","Activated") // usage
cooldown = world.time + 600
user.visible_message("<span class='danger'>[user] vanishes from reality, leaving a a hole in [user.p_their()] place!</span>")
var/obj/effect/immortality_talisman/Z = new(get_turf(src.loc))
@@ -343,6 +345,24 @@
add_fingerprint(usr)
//Book of Babel
/obj/item/book_of_babel
name = "Book of Babel"
desc = "An ancient tome written in countless tongues."
icon = 'icons/obj/library.dmi'
icon_state = "book1"
w_class = 2
/obj/item/book_of_babel/attack_self(mob/user)
to_chat(user, "You flip through the pages of the book, quickly and conveniently learning every language in existence. Somewhat less conveniently, the aging book crumbles to dust in the process. Whoops.")
user.grant_all_languages(omnitongue=TRUE)
new /obj/effect/decal/cleanable/ash(get_turf(user))
qdel(src)
//Boat
/obj/vehicle/lavaboat
+2 -2
View File
@@ -71,7 +71,6 @@
var/selected_material = MAT_METAL
var/selected_alloy = null
var/datum/research/files
var/list/categories = list("Alloys")
/obj/machinery/mineral/processing_unit/Initialize()
. = ..()
@@ -81,7 +80,8 @@
/obj/machinery/mineral/processing_unit/Destroy()
CONSOLE = null
qdel(materials)
QDEL_NULL(materials)
QDEL_NULL(files)
return ..()
/obj/machinery/mineral/processing_unit/HasProximity(atom/movable/AM)
+121 -102
View File
@@ -12,9 +12,6 @@
output_dir = SOUTH
req_access = list(GLOB.access_mineral_storeroom)
var/req_access_reclaim = GLOB.access_mining_station
var/stk_types = list()
var/stk_amt = list()
var/stack_list = list() //Key: Type. Value: Instance of type.
var/obj/item/weapon/card/id/inserted_id
var/points = 0
var/ore_pickup_rate = 15
@@ -24,11 +21,20 @@
speed_process = 1
var/message_sent = FALSE
var/list/ore_buffer = list()
var/datum/material_container/materials
var/datum/research/files
/obj/machinery/mineral/ore_redemption/New()
..()
/obj/machinery/mineral/ore_redemption/Initialize()
. = ..()
var/obj/item/weapon/circuitboard/machine/ore_redemption/B = new
B.apply_default_parts(src)
materials = new(src, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE),INFINITY)
files = new /datum/research/smelter(src)
/obj/machinery/mineral/ore_redemption/Destroy()
QDEL_NULL(materials)
QDEL_NULL(files)
return ..()
/obj/item/weapon/circuitboard/machine/ore_redemption
name = "Ore Redemption (Machine Board)"
@@ -55,35 +61,75 @@
point_upgrade = point_upgrade_temp
sheet_per_ore = sheet_per_ore_temp
/obj/machinery/mineral/ore_redemption/proc/process_sheet(obj/item/weapon/ore/O)
var/obj/item/stack/sheet/processed_sheet = SmeltMineral(O)
if(processed_sheet)
var/obj/item/stack/sheet/s
if(!stack_list[processed_sheet])
s = new processed_sheet(src, FALSE)
s.amount = 0
stack_list[processed_sheet] = s
s = stack_list[processed_sheet]
s.amount += sheet_per_ore //Stack the sheets
ore_buffer -= O
qdel(O) //... garbage collect
/obj/machinery/mineral/ore_redemption/proc/smelt_ore(obj/item/weapon/ore/O)
ore_buffer -= O
if(O && O.refined_type)
points += O.points * point_upgrade
var/material_amount = materials.get_item_material_amount(O)
if(!material_amount)
qdel(O) //no materials, incinerate it
else if(!materials.has_space(material_amount)) //if there is no space, eject it
unload_mineral(O)
else
materials.insert_item(O) //insert it
qdel(O)
/obj/machinery/mineral/ore_redemption/proc/can_smelt_alloy(datum/design/D)
if(D.make_reagents.len)
return 0
var/build_amount = 0
for(var/mat_id in D.materials)
var/M = D.materials[mat_id]
var/datum/material/redemption_mat = materials.materials[mat_id]
if(!M || !redemption_mat)
return 0
var/smeltable_sheets = round(redemption_mat.amount / M)
if(!smeltable_sheets)
return 0
if(!build_amount)
build_amount = smeltable_sheets
build_amount = min(build_amount, smeltable_sheets)
return build_amount
/obj/machinery/mineral/ore_redemption/proc/process_ores(list/ores_to_process)
var/current_amount = 0
for(var/ore in ores_to_process)
if(current_amount >= ore_pickup_rate)
break
process_sheet(ore)
smelt_ore(ore)
/obj/machinery/mineral/ore_redemption/proc/send_console_message()
if(z != ZLEVEL_STATION || !LAZYLEN(stack_list))
if(z != ZLEVEL_STATION)
return
message_sent = TRUE
var/area/A = get_area(src)
var/msg = "Now available in [A]:<br>"
for(var/s in stack_list)
var/obj/item/stack/sheet/sheet = stack_list[s]
msg += "[capitalize(sheet.name)]: [sheet.amount] sheets<br>"
var/has_minerals = FALSE
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
var/mineral_amount = M.amount / MINERAL_MATERIAL_AMOUNT
if(mineral_amount)
has_minerals = TRUE
msg += "[capitalize(M.name)]: [mineral_amount] sheets<br>"
if(!has_minerals)
return
for(var/obj/machinery/requests_console/D in GLOB.allConsoles)
if(D.receive_ore_updates)
@@ -114,6 +160,7 @@
if(exchange_parts(user, W))
return
if(default_pry_open(W))
materials.retrieve_all()
return
if(default_unfasten_wrench(user, W))
return
@@ -144,15 +191,8 @@
return ..()
/obj/machinery/mineral/ore_redemption/on_deconstruction()
empty_content()
/obj/machinery/mineral/ore_redemption/proc/SmeltMineral(obj/item/weapon/ore/O)
if(O && O.refined_type)
var/obj/item/stack/sheet/M = O.refined_type
points += O.points * point_upgrade
return M
qdel(O)//No refined type? Purge it.
return
materials.retrieve_all()
..()
/obj/machinery/mineral/ore_redemption/attack_hand(mob/user)
if(..())
@@ -169,30 +209,26 @@
else
dat += "No ID inserted. <A href='?src=\ref[src];insert_id=1'>Insert ID.</A><br><br>"
for(var/O in stack_list)
var/obj/item/stack/sheet/s = stack_list[O]
if(s.amount)
dat += "[capitalize(s.name)]: [s.amount] <A href='?src=\ref[src];release=[s.type]'>Release</A><br>"
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
if(M.amount)
var/sheet_amount = M.amount / MINERAL_MATERIAL_AMOUNT
dat += "[capitalize(M.name)]: [sheet_amount] "
if(sheet_amount >= 1)
dat += "<A href='?src=\ref[src];release=[mat_id]'>Release</A><br>"
else
dat += "<span class='linkOff'>Release</span><br>"
var/obj/item/stack/sheet/metalstack
if(/obj/item/stack/sheet/metal in stack_list)
metalstack = stack_list[/obj/item/stack/sheet/metal]
for(var/v in files.known_designs)
var/datum/design/D = files.known_designs[v]
if(can_smelt_alloy(D))
dat += "[D.name]: <A href='?src=\ref[src];alloy=[D.id]'>Smelt</A><br>"
else
dat += "[D.name]: <span class='linkOff'>Smelt</span><br>"
var/obj/item/stack/sheet/plasmastack
if((/obj/item/stack/sheet/mineral/plasma in stack_list))
plasmastack = stack_list[/obj/item/stack/sheet/mineral/plasma]
dat += "<br><div class='statusDisplay'><b>Mineral Value List:</b><br>[get_ore_values()]</div>"
var/obj/item/stack/sheet/mineral/titaniumstack
if((/obj/item/stack/sheet/mineral/titanium in stack_list))
titaniumstack = stack_list[/obj/item/stack/sheet/mineral/titanium]
if(metalstack && plasmastack && min(metalstack.amount, plasmastack.amount))
dat += "Plasteel Alloy (Metal + Plasma): <A href='?src=\ref[src];alloytype1=/obj/item/stack/sheet/metal;alloytype2=/obj/item/stack/sheet/mineral/plasma;alloytypeout=/obj/item/stack/sheet/plasteel'>Smelt</A><BR>"
if(titaniumstack && plasmastack && min(titaniumstack.amount, plasmastack.amount))
dat += "Plastitanium Alloy (Titanium + Plasma): <A href='?src=\ref[src];alloytype1=/obj/item/stack/sheet/mineral/titanium;alloytype2=/obj/item/stack/sheet/mineral/plasma;alloytypeout=/obj/item/stack/sheet/mineral/plastitanium'>Smelt</A><BR>"
dat += "<br><div class='statusDisplay'><b>Mineral Value List:</b><BR>[get_ore_values()]</div>"
var/datum/browser/popup = new(user, "console_stacking_machine", "Ore Redemption Machine", 400, 500)
var/datum/browser/popup = new(user, "ore_redemption_machine", "Ore Redemption Machine", 400, 500)
popup.set_content(dat)
popup.open()
return
@@ -228,69 +264,52 @@
else
to_chat(usr, "<span class='warning'>Not a valid ID!</span>")
if(href_list["release"])
if(check_access(inserted_id) || allowed(usr)) //Check the ID inside, otherwise check the user.
if(!(text2path(href_list["release"]) in stack_list))
if(check_access(inserted_id) || allowed(usr)) //Check the ID inside, otherwise check the user
var/mat_id = href_list["release"]
if(!materials.materials[mat_id])
return
var/obj/item/stack/sheet/inp = stack_list[text2path(href_list["release"])]
var/obj/item/stack/sheet/out = new inp.type(src, 0, FALSE)
var/datum/material/mat = materials.materials[mat_id]
var/stored_amount = mat.amount / MINERAL_MATERIAL_AMOUNT
if(!stored_amount)
return
var/desired = input("How many sheets?", "How many sheets to eject?", 1) as null|num
out.amount = round(min(desired,50,inp.amount))
if(out.amount >= 1)
inp.amount -= out.amount
unload_mineral(out)
if(inp.amount < 1)
stack_list -= text2path(href_list["release"])
qdel(inp)
var/sheets_to_remove = round(min(desired,50,stored_amount))
var/out = get_step(src, output_dir)
materials.retrieve_sheets(sheets_to_remove, mat_id, out)
else
to_chat(usr, "<span class='warning'>Required access not found.</span>")
if(href_list["alloytype1"] && href_list["alloytype2"] && href_list["alloytypeout"])
var/alloytype1 = text2path(href_list["alloytype1"])
var/alloytype2 = text2path(href_list["alloytype2"])
var/alloytypeout = text2path(href_list["alloytypeout"])
if(check_access(inserted_id) || allowed(usr))
if(!(alloytype1 in stack_list))
return
if(!(alloytype2 in stack_list))
return
var/obj/item/stack/sheet/stack1 = stack_list[alloytype1]
var/obj/item/stack/sheet/stack2 = stack_list[alloytype2]
if(href_list["alloy"])
var/alloy_id = href_list["alloy"]
var/datum/design/alloy = files.FindDesignByID(alloy_id)
if((check_access(inserted_id) || allowed(usr)) && alloy)
var/desired = input("How many sheets?", "How many sheets would you like to smelt?", 1) as null|num
var/obj/item/stack/sheet/alloyout = new alloytypeout
alloyout.amount = round(min(desired,50,stack1.amount,stack2.amount))
if(alloyout.amount >= 1)
stack1.amount -= alloyout.amount
stack2.amount -= alloyout.amount
unload_mineral(alloyout)
if(stack1.amount < 1)
stack_list -= stack1
qdel(stack1)
if(stack2.amount < 1)
stack_list -= stack2
qdel(stack2)
var/smelt_amount = can_smelt_alloy(alloy)
var/amount = round(min(desired,50,smelt_amount))
materials.use_amount(alloy.materials, amount)
var/output = new alloy.build_path(src)
if(istype(output, /obj/item/stack/sheet))
var/obj/item/stack/sheet/mineral/produced_alloy = output
produced_alloy.amount = amount
unload_mineral(produced_alloy)
else
unload_mineral(output)
else
to_chat(usr, "<span class='warning'>Required access not found.</span>")
updateUsrDialog()
return
/obj/machinery/mineral/ore_redemption/ex_act(severity, target)
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(5, 1, src)
s.start()
do_sparks(5, TRUE, src)
..()
//empty the redemption machine by stacks of at most max_amount (50 at this time) size
/obj/machinery/mineral/ore_redemption/proc/empty_content()
var/obj/item/stack/sheet/s
for(var/O in stack_list)
s = stack_list[O]
while(s.amount > s.max_amount)
new s.type(loc,s.max_amount)
s.use(s.max_amount)
s.forceMove(get_turf(src))
s.layer = initial(s.layer)
s.plane = initial(s.plane)
/obj/machinery/mineral/ore_redemption/power_change()
..()
update_icon()
+3 -5
View File
@@ -136,7 +136,7 @@
else
inserted_id.mining_points -= prize.cost
new prize.equipment_path(src.loc)
feedback_add_details("mining_equipment_bought",
SSblackbox.add_details("mining_equipment_bought",
"[src.type]|[prize.equipment_path]")
// Add src.type to keep track of free golem purchases
// seperately.
@@ -189,13 +189,11 @@
if("Mining Conscription Kit")
new /obj/item/weapon/storage/backpack/dufflebag/mining_conscript(loc)
feedback_add_details("mining_voucher_redeemed", selection)
SSblackbox.add_details("mining_voucher_redeemed", selection)
qdel(voucher)
/obj/machinery/mineral/equipment_vendor/ex_act(severity, target)
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(5, 1, src)
s.start()
do_sparks(5, TRUE, src)
if(prob(50 / severity) && severity < 3)
qdel(src)