mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 23:23:28 +01:00
Merge pull request #9343 from variableundefined/OreTGPort
Port over tg ore stack and stack merging
This commit is contained in:
@@ -36,8 +36,7 @@
|
||||
if(11 to 15)
|
||||
new /obj/item/reagent_containers/glass/beaker/bluespace(src)
|
||||
if(16 to 20)
|
||||
for(var/i in 1 to 10)
|
||||
new /obj/item/ore/diamond(src)
|
||||
new /obj/item/stack/ore/diamond(src, 10)
|
||||
if(21 to 25)
|
||||
for(var/i in 1 to 5)
|
||||
new /obj/item/poster/random_contraband(src)
|
||||
@@ -83,8 +82,7 @@
|
||||
var /newitem = pick(subtypesof(/obj/item/stock_parts) - /obj/item/stock_parts/subspace)
|
||||
new newitem(src)
|
||||
if(69 to 70)
|
||||
for(var/i in 1 to 5)
|
||||
new /obj/item/ore/bluespace_crystal(src)
|
||||
new /obj/item/stack/ore/bluespace_crystal(src, 5)
|
||||
if(71 to 72)
|
||||
new /obj/item/pickaxe/drill(src)
|
||||
if(73 to 74)
|
||||
@@ -184,7 +182,7 @@
|
||||
if(attempts == 1)
|
||||
to_chat(user, "<span class='warning'>* Anti-Tamper Bomb will activate on next failed access attempt.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>* Anti-Tamper Bomb will activate after [src.attempts] failed access attempts.</span>")
|
||||
to_chat(user, "<span class='notice'>* Anti-Tamper Bomb will activate after [attempts] failed access attempts.</span>")
|
||||
if(lastattempt != null)
|
||||
var/bulls = 0
|
||||
var/cows = 0
|
||||
|
||||
@@ -70,12 +70,12 @@
|
||||
point_upgrade = point_upgrade_temp
|
||||
sheet_per_ore = sheet_per_ore_temp
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/proc/smelt_ore(obj/item/ore/O)
|
||||
/obj/machinery/mineral/ore_redemption/proc/smelt_ore(obj/item/stack/ore/O)
|
||||
|
||||
ore_buffer -= O
|
||||
|
||||
if(O && O.refined_type)
|
||||
points += O.points * point_upgrade
|
||||
points += O.points * point_upgrade * O.amount
|
||||
|
||||
GET_COMPONENT(materials, /datum/component/material_container)
|
||||
var/material_amount = materials.get_item_material_amount(O)
|
||||
@@ -83,7 +83,7 @@
|
||||
if(!material_amount)
|
||||
qdel(O) //no materials, incinerate it
|
||||
|
||||
else if(!materials.has_space(material_amount * sheet_per_ore)) //if there is no space, eject it
|
||||
else if(!materials.has_space(material_amount * sheet_per_ore * O.amount)) //if there is no space, eject it
|
||||
unload_mineral(O)
|
||||
|
||||
else
|
||||
@@ -157,7 +157,7 @@
|
||||
if(OB)
|
||||
input = OB
|
||||
|
||||
for(var/obj/item/ore/O in input)
|
||||
for(var/obj/item/stack/ore/O in input)
|
||||
if(QDELETED(O))
|
||||
continue
|
||||
ore_buffer |= O
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
/obj/machinery/mineral/processing_unit/process()
|
||||
var/turf/T = get_step(src, input_dir)
|
||||
if(T)
|
||||
for(var/obj/item/ore/O in T)
|
||||
for(var/obj/item/stack/ore/O in T)
|
||||
process_ore(O)
|
||||
CHECK_TICK
|
||||
if(on)
|
||||
@@ -111,7 +111,7 @@
|
||||
CONSOLE.updateUsrDialog()
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit/proc/process_ore(obj/item/ore/O)
|
||||
/obj/machinery/mineral/processing_unit/proc/process_ore(obj/item/stack/ore/O)
|
||||
GET_COMPONENT(materials, /datum/component/material_container)
|
||||
var/material_amount = materials.get_item_material_amount(O)
|
||||
if(!materials.has_space(material_amount))
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
if(T)
|
||||
var/limit
|
||||
for(var/obj/structure/ore_box/B in T)
|
||||
for(var/obj/item/ore/O in B)
|
||||
for(var/obj/item/stack/ore/O in B)
|
||||
B.contents -= O
|
||||
unload_mineral(O)
|
||||
limit++
|
||||
|
||||
@@ -187,7 +187,7 @@ var/global/list/rockTurfEdgeCache = list(
|
||||
/turf/simulated/mineral/iron
|
||||
name = "iron deposit"
|
||||
icon_state = "rock_Iron"
|
||||
mineralType = /obj/item/ore/iron
|
||||
mineralType = /obj/item/stack/ore/iron
|
||||
mineralName = "Iron"
|
||||
spreadChance = 20
|
||||
spread = 1
|
||||
@@ -195,7 +195,7 @@ var/global/list/rockTurfEdgeCache = list(
|
||||
|
||||
/turf/simulated/mineral/uranium
|
||||
name = "uranium deposit"
|
||||
mineralType = /obj/item/ore/uranium
|
||||
mineralType = /obj/item/stack/ore/uranium
|
||||
mineralName = "Uranium"
|
||||
spreadChance = 5
|
||||
spread = 1
|
||||
@@ -204,7 +204,7 @@ var/global/list/rockTurfEdgeCache = list(
|
||||
|
||||
/turf/simulated/mineral/diamond
|
||||
name = "diamond deposit"
|
||||
mineralType = /obj/item/ore/diamond
|
||||
mineralType = /obj/item/stack/ore/diamond
|
||||
mineralName = "Diamond"
|
||||
spreadChance = 0
|
||||
spread = 1
|
||||
@@ -213,7 +213,7 @@ var/global/list/rockTurfEdgeCache = list(
|
||||
|
||||
/turf/simulated/mineral/gold
|
||||
name = "gold deposit"
|
||||
mineralType = /obj/item/ore/gold
|
||||
mineralType = /obj/item/stack/ore/gold
|
||||
mineralName = "Gold"
|
||||
spreadChance = 5
|
||||
spread = 1
|
||||
@@ -222,7 +222,7 @@ var/global/list/rockTurfEdgeCache = list(
|
||||
|
||||
/turf/simulated/mineral/silver
|
||||
name = "silver deposit"
|
||||
mineralType = /obj/item/ore/silver
|
||||
mineralType = /obj/item/stack/ore/silver
|
||||
mineralName = "Silver"
|
||||
spreadChance = 5
|
||||
spread = 1
|
||||
@@ -231,7 +231,7 @@ var/global/list/rockTurfEdgeCache = list(
|
||||
|
||||
/turf/simulated/mineral/titanium
|
||||
name = "titanium deposit"
|
||||
mineralType = /obj/item/ore/titanium
|
||||
mineralType = /obj/item/stack/ore/titanium
|
||||
spreadChance = 5
|
||||
spread = 1
|
||||
hidden = 1
|
||||
@@ -240,7 +240,7 @@ var/global/list/rockTurfEdgeCache = list(
|
||||
/turf/simulated/mineral/plasma
|
||||
name = "plasma deposit"
|
||||
icon_state = "rock_Plasma"
|
||||
mineralType = /obj/item/ore/plasma
|
||||
mineralType = /obj/item/stack/ore/plasma
|
||||
mineralName = "Plasma"
|
||||
spreadChance = 8
|
||||
spread = 1
|
||||
@@ -250,7 +250,7 @@ var/global/list/rockTurfEdgeCache = list(
|
||||
/turf/simulated/mineral/clown
|
||||
name = "bananium deposit"
|
||||
icon_state = "rock_Clown"
|
||||
mineralType = /obj/item/ore/bananium
|
||||
mineralType = /obj/item/stack/ore/bananium
|
||||
mineralName = "Bananium"
|
||||
mineralAmt = 3
|
||||
spreadChance = 0
|
||||
@@ -260,7 +260,7 @@ var/global/list/rockTurfEdgeCache = list(
|
||||
/turf/simulated/mineral/mime
|
||||
name = "tranquillite deposit"
|
||||
icon_state = "rock_Mime"
|
||||
mineralType = /obj/item/ore/tranquillite
|
||||
mineralType = /obj/item/stack/ore/tranquillite
|
||||
mineralAmt = 3
|
||||
spreadChance = 0
|
||||
spread = 0
|
||||
@@ -269,7 +269,7 @@ var/global/list/rockTurfEdgeCache = list(
|
||||
/turf/simulated/mineral/bscrystal
|
||||
name = "bluespace crystal deposit"
|
||||
icon_state = "rock_BScrystal"
|
||||
mineralType = /obj/item/ore/bluespace_crystal
|
||||
mineralType = /obj/item/stack/ore/bluespace_crystal
|
||||
mineralName = "Bluespace crystal"
|
||||
mineralAmt = 1
|
||||
spreadChance = 0
|
||||
@@ -518,7 +518,7 @@ var/global/list/rockTurfEdgeCache = list(
|
||||
if(istype(W,/obj/item/storage/bag/ore))
|
||||
var/obj/item/storage/bag/ore/S = W
|
||||
if(S.collection_mode == 1)
|
||||
for(var/obj/item/ore/O in src.contents)
|
||||
for(var/obj/item/stack/ore/O in src.contents)
|
||||
O.attackby(W,user)
|
||||
return
|
||||
|
||||
@@ -531,11 +531,7 @@ var/global/list/rockTurfEdgeCache = list(
|
||||
/turf/simulated/floor/plating/airless/asteroid/proc/gets_dug()
|
||||
if(dug)
|
||||
return
|
||||
new/obj/item/ore/glass(src)
|
||||
new/obj/item/ore/glass(src)
|
||||
new/obj/item/ore/glass(src)
|
||||
new/obj/item/ore/glass(src)
|
||||
new/obj/item/ore/glass(src)
|
||||
new/obj/item/stack/ore/glass(src, 5)
|
||||
dug = 1
|
||||
playsound(src, 'sound/effects/shovel_dig.ogg', 50, 1) //FUCK YO RUSTLE I GOT'S THE DIGS SOUND HERE
|
||||
icon_plating = "asteroid_dug"
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
projectiletype = /obj/item/projectile/kinetic
|
||||
projectilesound = 'sound/weapons/Gunshot4.ogg'
|
||||
speak_emote = list("states")
|
||||
wanted_objects = list(/obj/item/ore/diamond, /obj/item/ore/gold, /obj/item/ore/silver,
|
||||
/obj/item/ore/plasma, /obj/item/ore/uranium, /obj/item/ore/iron,
|
||||
/obj/item/ore/bananium, /obj/item/ore/tranquillite, /obj/item/ore/glass,
|
||||
/obj/item/ore/titanium)
|
||||
wanted_objects = list(/obj/item/stack/ore/diamond, /obj/item/stack/ore/gold, /obj/item/stack/ore/silver,
|
||||
/obj/item/stack/ore/plasma, /obj/item/stack/ore/uranium, /obj/item/stack/ore/iron,
|
||||
/obj/item/stack/ore/bananium, /obj/item/stack/ore/tranquillite, /obj/item/stack/ore/glass,
|
||||
/obj/item/stack/ore/titanium)
|
||||
healable = 0
|
||||
var/mode = MINEDRONE_COLLECT
|
||||
var/light_on = 0
|
||||
@@ -97,7 +97,7 @@
|
||||
if(!.)
|
||||
return FALSE
|
||||
visible_message("<span class='danger'>[src] is destroyed!</span>")
|
||||
new /obj/effect/decal/cleanable/blood/gibs/robot(src.loc)
|
||||
new /obj/effect/decal/cleanable/blood/gibs/robot(loc)
|
||||
DropOre(0)
|
||||
qdel(src)
|
||||
|
||||
@@ -135,20 +135,14 @@
|
||||
to_chat(src, "<span class='info'>You are set to attack mode. You can now attack from range.</span>")
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/AttackingTarget()
|
||||
if(istype(target, /obj/item/ore) && mode == MINEDRONE_COLLECT)
|
||||
if(istype(target, /obj/item/stack/ore) && mode == MINEDRONE_COLLECT)
|
||||
CollectOre()
|
||||
return
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/proc/CollectOre()
|
||||
var/obj/item/ore/O
|
||||
for(O in src.loc)
|
||||
for(var/obj/item/stack/ore/O in range(1, src))
|
||||
O.forceMove(src)
|
||||
for(var/dir in alldirs)
|
||||
var/turf/T = get_step(src,dir)
|
||||
for(O in T)
|
||||
O.forceMove(src)
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/proc/DropOre(message = 1)
|
||||
if(!contents.len)
|
||||
@@ -157,7 +151,7 @@
|
||||
return
|
||||
if(message)
|
||||
to_chat(src, "<span class='notice'>You dump your stored ore.</span>")
|
||||
for(var/obj/item/ore/O in contents)
|
||||
for(var/obj/item/stack/ore/O in contents)
|
||||
contents -= O
|
||||
O.forceMove(loc)
|
||||
return
|
||||
|
||||
+104
-58
@@ -1,22 +1,37 @@
|
||||
/obj/item/ore
|
||||
#define GIBTONITE_QUALITY_LOW 1
|
||||
#define GIBTONITE_QUALITY_MEDIUM 2
|
||||
#define GIBTONITE_QUALITY_HIGH 3
|
||||
#define PROBABILITY_REFINE_BY_FIRE 50
|
||||
#define ORESTACK_OVERLAYS_MAX 10
|
||||
/**********************Mineral ores**************************/
|
||||
|
||||
/obj/item/stack/ore
|
||||
name = "rock"
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "ore"
|
||||
max_amount = 50
|
||||
singular_name = "ore chunk"
|
||||
var/points = 0 //How many points this ore gets you from the ore redemption machine
|
||||
var/refined_type = null //What this ore defaults to being refined into
|
||||
var/datum/geosample/geologic_data
|
||||
|
||||
/obj/item/ore/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
/obj/item/stack/ore/New()
|
||||
..()
|
||||
pixel_x = rand(0, 16) - 8
|
||||
pixel_y = rand(0, 8) - 8
|
||||
if(is_mining_level(z))
|
||||
score_oremined++ //When ore spawns, increment score. Only include ore spawned on mining asteroid (No Clown Planet)
|
||||
|
||||
/obj/item/stack/ore/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(istype(I, /obj/item/weldingtool))
|
||||
var/obj/item/weldingtool/W = I
|
||||
if(W.remove_fuel(15) && refined_type)
|
||||
new refined_type(get_turf(src.loc))
|
||||
new refined_type(get_turf(src.loc), amount)
|
||||
qdel(src)
|
||||
else if(W.isOn())
|
||||
to_chat(user, "<span class='info'>Not enough fuel to smelt [src].</span>")
|
||||
..()
|
||||
|
||||
/obj/item/ore/Crossed(AM as mob|obj)
|
||||
/obj/item/stack/ore/Crossed(atom/movable/AM)
|
||||
var/obj/item/storage/bag/ore/OB
|
||||
var/turf/simulated/floor/F = get_turf(src)
|
||||
if(loc != F)
|
||||
@@ -37,64 +52,88 @@
|
||||
F.attackby(OB, AM)
|
||||
return ..()
|
||||
|
||||
/obj/item/stack/ore/fire_act()
|
||||
..()
|
||||
if(isnull(refined_type))
|
||||
return
|
||||
else
|
||||
var/amountrefined = round((PROBABILITY_REFINE_BY_FIRE / 100) * amount, 1)
|
||||
if(amountrefined < 1)
|
||||
qdel(src)
|
||||
else
|
||||
new refined_type(get_turf(loc), amountrefined)
|
||||
qdel(src)
|
||||
|
||||
|
||||
/obj/item/ore/uranium
|
||||
/obj/item/stack/ore/uranium
|
||||
name = "uranium ore"
|
||||
icon_state = "Uranium ore"
|
||||
origin_tech = "materials=5"
|
||||
singular_name = "uranium ore chunk"
|
||||
points = 30
|
||||
refined_type = /obj/item/stack/sheet/mineral/uranium
|
||||
materials = list(MAT_URANIUM=MINERAL_MATERIAL_AMOUNT)
|
||||
|
||||
/obj/item/ore/iron
|
||||
/obj/item/stack/ore/iron
|
||||
name = "iron ore"
|
||||
icon_state = "Iron ore"
|
||||
origin_tech = "materials=1"
|
||||
singular_name = "iron ore chunk"
|
||||
points = 1
|
||||
refined_type = /obj/item/stack/sheet/metal
|
||||
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT)
|
||||
|
||||
/obj/item/ore/glass
|
||||
/obj/item/stack/ore/glass
|
||||
name = "sand pile"
|
||||
icon_state = "Glass ore"
|
||||
origin_tech = "materials=1"
|
||||
singular_name = "sand pile"
|
||||
points = 1
|
||||
refined_type = /obj/item/stack/sheet/glass
|
||||
materials = list(MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
|
||||
|
||||
/obj/item/ore/glass/basalt
|
||||
GLOBAL_LIST_INIT(sand_recipes, list(\
|
||||
new /datum/stack_recipe("sandstone", /obj/item/stack/sheet/mineral/sandstone, 1, 1, 50)\
|
||||
))
|
||||
|
||||
/obj/item/stack/ore/glass/Initialize(mapload, new_amount, merge = TRUE)
|
||||
recipes = GLOB.sand_recipes
|
||||
. = ..()
|
||||
|
||||
/obj/item/stack/ore/glass/throw_impact(atom/hit_atom)
|
||||
if(..() || !ishuman(hit_atom))
|
||||
return
|
||||
var/mob/living/carbon/human/C = hit_atom
|
||||
if(C.head && C.head.flags_cover & HEADCOVERSEYES)
|
||||
visible_message("<span class='danger'>[C]'s headgear blocks the sand!</span>")
|
||||
return
|
||||
if(C.wear_mask && C.wear_mask.flags_cover & MASKCOVERSEYES)
|
||||
visible_message("<span class='danger'>[C]'s mask blocks the sand!</span>")
|
||||
return
|
||||
if(C.glasses && C.glasses.flags_cover & GLASSESCOVERSEYES)
|
||||
visible_message("<span class='danger'>[C]'s glasses block the sand!</span>")
|
||||
return
|
||||
C.EyeBlurry(6)
|
||||
C.adjustStaminaLoss(15)//the pain from your eyes burning does stamina damage
|
||||
C.AdjustConfused(5)
|
||||
to_chat(C, "<span class='userdanger'>[src] gets into your eyes! The pain, it burns!</span>")
|
||||
qdel(src)
|
||||
|
||||
/obj/item/stack/ore/glass/basalt
|
||||
name = "volcanic ash"
|
||||
icon_state = "volcanic_sand"
|
||||
icon_state = "volcanic_sand"
|
||||
singular_name = "volcanic ash pile"
|
||||
|
||||
/obj/item/ore/glass/attack_self(mob/living/user as mob)
|
||||
to_chat(user, "<span class='notice'>You use the sand to make sandstone.</span>")
|
||||
var/sandAmt = 1
|
||||
for(var/obj/item/ore/glass/G in user.loc) // The sand on the floor
|
||||
sandAmt += 1
|
||||
qdel(G)
|
||||
while(sandAmt > 0)
|
||||
var/obj/item/stack/sheet/mineral/sandstone/SS = new /obj/item/stack/sheet/mineral/sandstone(user.loc)
|
||||
if(sandAmt >= SS.max_amount)
|
||||
SS.amount = SS.max_amount
|
||||
else
|
||||
SS.amount = sandAmt
|
||||
for(var/obj/item/stack/sheet/mineral/sandstone/SA in user.loc)
|
||||
if(SA != SS && SA.amount < SA.max_amount)
|
||||
SA.attackby(SS, user) //we try to transfer all old unfinished stacks to the new stack we created.
|
||||
sandAmt -= SS.max_amount
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/item/ore/plasma
|
||||
/obj/item/stack/ore/plasma
|
||||
name = "plasma ore"
|
||||
icon_state = "Plasma ore"
|
||||
origin_tech = "plasmatech=2;materials=2"
|
||||
singular_name = "plasma ore chunk"
|
||||
points = 15
|
||||
refined_type = /obj/item/stack/sheet/mineral/plasma
|
||||
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT)
|
||||
|
||||
/obj/item/ore/plasma/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
/obj/item/stack/ore/plasma/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
if(istype(I, /obj/item/weldingtool))
|
||||
var/obj/item/weldingtool/W = I
|
||||
if(W.welding)
|
||||
@@ -102,57 +141,64 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/ore/silver
|
||||
/obj/item/stack/ore/silver
|
||||
name = "silver ore"
|
||||
icon_state = "Silver ore"
|
||||
origin_tech = "materials=3"
|
||||
singular_name = "silver ore chunk"
|
||||
points = 16
|
||||
refined_type = /obj/item/stack/sheet/mineral/silver
|
||||
materials = list(MAT_SILVER=MINERAL_MATERIAL_AMOUNT)
|
||||
|
||||
/obj/item/ore/gold
|
||||
/obj/item/stack/ore/gold
|
||||
name = "gold ore"
|
||||
icon_state = "Gold ore"
|
||||
origin_tech = "materials=4"
|
||||
singular_name = "gold ore chunk"
|
||||
points = 18
|
||||
refined_type = /obj/item/stack/sheet/mineral/gold
|
||||
materials = list(MAT_GOLD=MINERAL_MATERIAL_AMOUNT)
|
||||
|
||||
/obj/item/ore/diamond
|
||||
/obj/item/stack/ore/diamond
|
||||
name = "diamond ore"
|
||||
icon_state = "Diamond ore"
|
||||
origin_tech = "materials=6"
|
||||
singular_name = "diamond ore chunk"
|
||||
points = 50
|
||||
refined_type = /obj/item/stack/sheet/mineral/diamond
|
||||
materials = list(MAT_DIAMOND=MINERAL_MATERIAL_AMOUNT)
|
||||
|
||||
/obj/item/ore/bananium
|
||||
/obj/item/stack/ore/bananium
|
||||
name = "bananium ore"
|
||||
icon_state = "Clown ore"
|
||||
origin_tech = "materials=4"
|
||||
singular_name = "bananium ore chunk"
|
||||
points = 60
|
||||
refined_type = /obj/item/stack/sheet/mineral/bananium
|
||||
materials = list(MAT_BANANIUM=MINERAL_MATERIAL_AMOUNT)
|
||||
|
||||
/obj/item/ore/tranquillite
|
||||
/obj/item/stack/ore/tranquillite
|
||||
name = "tranquillite ore"
|
||||
icon_state = "Mime ore"
|
||||
origin_tech = "materials=4"
|
||||
singular_name = "transquillite ore chunk"
|
||||
points = 60
|
||||
refined_type = /obj/item/stack/sheet/mineral/tranquillite
|
||||
materials = list(MAT_TRANQUILLITE=MINERAL_MATERIAL_AMOUNT)
|
||||
|
||||
/obj/item/ore/titanium
|
||||
/obj/item/stack/ore/titanium
|
||||
name = "titanium ore"
|
||||
icon_state = "Titanium ore"
|
||||
singular_name = "titanium ore chunk"
|
||||
points = 50
|
||||
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT)
|
||||
refined_type = /obj/item/stack/sheet/mineral/titanium
|
||||
|
||||
/obj/item/ore/slag
|
||||
/obj/item/stack/ore/slag
|
||||
name = "slag"
|
||||
desc = "Completely useless"
|
||||
icon_state = "slag"
|
||||
singular_name = "slag chunk"
|
||||
|
||||
/obj/item/twohanded/required/gibtonite
|
||||
name = "gibtonite ore"
|
||||
@@ -165,7 +211,7 @@
|
||||
anchored = 1 //Forces people to carry it by hand, no pulling!
|
||||
var/primed = 0
|
||||
var/det_time = 100
|
||||
var/quality = 1 //How pure this gibtonite is, determines the explosion produced by it and is derived from the det_time of the rock wall it was taken from, higher value = better
|
||||
var/quality = GIBTONITE_QUALITY_LOW //How pure this gibtonite is, determines the explosion produced by it and is derived from the det_time of the rock wall it was taken from, higher value = better
|
||||
var/attacher = "UNKNOWN"
|
||||
var/datum/wires/explosive/gibtonite/wires
|
||||
|
||||
@@ -195,7 +241,7 @@
|
||||
primed = 0
|
||||
user.visible_message("The chain reaction was stopped! ...The ore's quality looks diminished.", "<span class='notice'>You stopped the chain reaction. ...The ore's quality looks diminished.</span>")
|
||||
icon_state = "Gibtonite ore"
|
||||
quality = 1
|
||||
quality = GIBTONITE_QUALITY_LOW
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -222,40 +268,40 @@
|
||||
primed = 1
|
||||
icon_state = "Gibtonite active"
|
||||
var/turf/bombturf = get_turf(src)
|
||||
var/area/A = get_area(bombturf)
|
||||
var/notify_admins = 0
|
||||
if(z != 5)//Only annoy the admins ingame if we're triggered off the mining zlevel
|
||||
notify_admins = 1
|
||||
|
||||
if(notify_admins)
|
||||
if(triggered_by == 1)
|
||||
message_admins("An explosion has triggered a [name] to detonate at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>.")
|
||||
message_admins("An explosion has triggered a [name] to detonate at [ADMIN_COORDJMP(bombturf)].")
|
||||
else if(triggered_by == 2)
|
||||
message_admins("A signal has triggered a [name] to detonate at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>. Igniter attacher: [key_name_admin(attacher)]")
|
||||
message_admins("A signal has triggered a [name] to detonate at [ADMIN_COORDJMP(bombturf)]. Igniter attacher: [key_name_admin(attacher)]")
|
||||
else
|
||||
message_admins("[key_name_admin(user)] has triggered a [name] to detonate at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>.")
|
||||
message_admins("[key_name_admin(user)] has triggered a [name] to detonate at [ADMIN_COORDJMP(bombturf)].")
|
||||
if(triggered_by == 1)
|
||||
log_game("An explosion has primed a [name] for detonation at [A.name]([bombturf.x],[bombturf.y],[bombturf.z])")
|
||||
log_game("An explosion has primed a [name] for detonation at [AREACOORD(bombturf)]")
|
||||
else if(triggered_by == 2)
|
||||
log_game("A signal has primed a [name] for detonation at [A.name]([bombturf.x],[bombturf.y],[bombturf.z]). Igniter attacher: [key_name(attacher)].")
|
||||
log_game("A signal has primed a [name] for detonation at [AREACOORD(bombturf)]). Igniter attacher: [key_name(attacher)].")
|
||||
else
|
||||
user.visible_message("<span class='warning'>[user] strikes \the [src], causing a chain reaction!</span>", "<span class='danger'>You strike \the [src], causing a chain reaction.</span>")
|
||||
log_game("[key_name(user)] has primed a [name] for detonation at [A.name]([bombturf.x],[bombturf.y],[bombturf.z])")
|
||||
log_game("[key_name(user)] has primed a [name] for detonation at [AREACOORD(bombturf)])")
|
||||
spawn(det_time)
|
||||
if(primed)
|
||||
if(quality == 3)
|
||||
if(quality == GIBTONITE_QUALITY_HIGH)
|
||||
explosion(src.loc,2,4,9,adminlog = notify_admins)
|
||||
if(quality == 2)
|
||||
if(quality == GIBTONITE_QUALITY_MEDIUM)
|
||||
explosion(src.loc,1,2,5,adminlog = notify_admins)
|
||||
if(quality == 1)
|
||||
if(quality == GIBTONITE_QUALITY_LOW)
|
||||
explosion(src.loc,-1,1,3,adminlog = notify_admins)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/ore/New()
|
||||
pixel_x = rand(0,16)-8
|
||||
pixel_y = rand(0,8)-8
|
||||
if(is_mining_level(src.z))
|
||||
score_oremined++ //When ore spawns, increment score. Only include ore spawned on mining asteroid (No Clown Planet)
|
||||
|
||||
/obj/item/ore/ex_act()
|
||||
return
|
||||
/obj/item/stack/ore/ex_act()
|
||||
return
|
||||
|
||||
#undef GIBTONITE_QUALITY_LOW
|
||||
#undef GIBTONITE_QUALITY_MEDIUM
|
||||
#undef GIBTONITE_QUALITY_HIGH
|
||||
#undef PROBABILITY_REFINE_BY_FIRE
|
||||
#undef ORESTACK_OVERLAYS_MAX
|
||||
|
||||
@@ -13,78 +13,40 @@
|
||||
if(istype(W, /obj/item/t_scanner/adv_mining_scanner))
|
||||
attack_hand(user)
|
||||
return
|
||||
if(istype(W, /obj/item/ore))
|
||||
else if(istype(W, /obj/item/stack/ore))
|
||||
if(!user.drop_item())
|
||||
return
|
||||
W.forceMove(src)
|
||||
if(istype(W, /obj/item/storage))
|
||||
else if(istype(W, /obj/item/storage))
|
||||
var/obj/item/storage/S = W
|
||||
S.hide_from(usr)
|
||||
for(var/obj/item/ore/O in S.contents)
|
||||
for(var/obj/item/stack/ore/O in S.contents)
|
||||
S.remove_from_storage(O, src) //This will move the item to this item's contents
|
||||
CHECK_TICK
|
||||
to_chat(user, "<span class='notice'>You empty the satchel into the box.</span>")
|
||||
else if(istype(W, /obj/item/crowbar))
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
var/obj/item/crowbar/C = W
|
||||
if(do_after(user, 50 * C.toolspeed, target = src))
|
||||
user.visible_message("<span class='notice'>[user] pries [src] apart.</span>", "<span class='notice'>You pry apart [src].</span>", "<span class='italics'>You hear splitting wood.</span>")
|
||||
deconstruct(TRUE, user)
|
||||
|
||||
/obj/structure/ore_box/attack_hand(mob/user)
|
||||
var/amt_gold = 0
|
||||
var/amt_silver = 0
|
||||
var/amt_diamond = 0
|
||||
var/amt_glass = 0
|
||||
var/amt_iron = 0
|
||||
var/amt_plasma = 0
|
||||
var/amt_uranium = 0
|
||||
var/amt_titanium = 0
|
||||
var/amt_clown = 0
|
||||
var/amt_mime = 0
|
||||
var/amt_bluespace = 0
|
||||
if(Adjacent(user))
|
||||
show_contents(user)
|
||||
|
||||
for(var/obj/item/ore/C in contents)
|
||||
if(istype(C,/obj/item/ore/diamond))
|
||||
amt_diamond++
|
||||
if(istype(C,/obj/item/ore/glass))
|
||||
amt_glass++
|
||||
if(istype(C,/obj/item/ore/plasma))
|
||||
amt_plasma++
|
||||
if(istype(C,/obj/item/ore/iron))
|
||||
amt_iron++
|
||||
if(istype(C,/obj/item/ore/silver))
|
||||
amt_silver++
|
||||
if(istype(C,/obj/item/ore/gold))
|
||||
amt_gold++
|
||||
if(istype(C,/obj/item/ore/uranium))
|
||||
amt_uranium++
|
||||
if(istype(C,/obj/item/ore/bananium))
|
||||
amt_clown++
|
||||
if(istype(C,/obj/item/ore/tranquillite))
|
||||
amt_mime++
|
||||
if(istype(C, /obj/item/ore/titanium))
|
||||
amt_titanium++
|
||||
if(istype(C,/obj/item/ore/bluespace_crystal))
|
||||
amt_bluespace++
|
||||
/obj/structure/ore_box/attack_robot(mob/user)
|
||||
if(Adjacent(user))
|
||||
show_contents(user)
|
||||
|
||||
/obj/structure/ore_box/proc/show_contents(mob/user)
|
||||
var/dat = text("<b>The contents of the ore box reveal...</b><br>")
|
||||
if(amt_gold)
|
||||
dat += text("Gold ore: [amt_gold]<br>")
|
||||
if(amt_silver)
|
||||
dat += text("Silver ore: [amt_silver]<br>")
|
||||
if(amt_iron)
|
||||
dat += text("Metal ore: [amt_iron]<br>")
|
||||
if(amt_glass)
|
||||
dat += text("Sand: [amt_glass]<br>")
|
||||
if(amt_diamond)
|
||||
dat += text("Diamond ore: [amt_diamond]<br>")
|
||||
if(amt_plasma)
|
||||
dat += text("Plasma ore: [amt_plasma]<br>")
|
||||
if(amt_uranium)
|
||||
dat += text("Uranium ore: [amt_uranium]<br>")
|
||||
if(amt_titanium)
|
||||
dat += text("Titanium ore: [amt_titanium]<br>")
|
||||
if(amt_clown)
|
||||
dat += text("Bananium ore: [amt_clown]<br>")
|
||||
if(amt_mime)
|
||||
dat += text("Tranquillite ore: [amt_mime]<br>")
|
||||
if(amt_bluespace)
|
||||
dat += text("Bluespace crystals: [amt_bluespace]<br>")
|
||||
var/list/assembled = list()
|
||||
for(var/obj/item/stack/ore/O in src)
|
||||
assembled[O.type] += O.amount
|
||||
for(var/type in assembled)
|
||||
var/obj/item/stack/ore/O = type
|
||||
dat += "[initial(O.name)] - [assembled[type]]<br>"
|
||||
|
||||
dat += text("<br><br><A href='?src=[UID()];removeall=1'>Empty box</A>")
|
||||
var/datum/browser/popup = new(user, "orebox", name, 400, 400)
|
||||
@@ -97,10 +59,7 @@
|
||||
usr.set_machine(src)
|
||||
add_fingerprint(usr)
|
||||
if(href_list["removeall"])
|
||||
for(var/obj/item/ore/O in contents)
|
||||
contents -= O
|
||||
O.forceMove(loc)
|
||||
CHECK_TICK
|
||||
dump_box_contents()
|
||||
to_chat(usr, "<span class='notice'>You empty the box.</span>")
|
||||
updateUsrDialog()
|
||||
|
||||
@@ -108,20 +67,31 @@ obj/structure/ore_box/ex_act(severity, target)
|
||||
if(prob(100 / severity) && severity < 3)
|
||||
qdel(src) //nothing but ores can get inside unless its a bug and ores just return nothing on ex_act, not point in calling it on them
|
||||
|
||||
/obj/structure/ore_box/deconstruct(disassembled = TRUE, mob/user)
|
||||
var/obj/item/stack/sheet/wood/W = new (loc, 4)
|
||||
if(user)
|
||||
W.add_fingerprint(user)
|
||||
dump_box_contents()
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/ore_box/proc/dump_box_contents()
|
||||
for(var/obj/item/stack/ore/O in src)
|
||||
if(QDELETED(O))
|
||||
continue
|
||||
if(QDELETED(src))
|
||||
break
|
||||
O.forceMove(loc)
|
||||
CHECK_TICK
|
||||
|
||||
/obj/structure/ore_box/verb/empty_box()
|
||||
set name = "Empty Ore Box"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(!ishuman(usr)) //Only living, intelligent creatures with hands can empty ore boxes.
|
||||
to_chat(usr, "<span class='warning'>You are physically incapable of emptying the ore box.</span>")
|
||||
return
|
||||
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
|
||||
if(!Adjacent(usr)) //You can only empty the box if you can physically reach it
|
||||
if(!Adjacent(usr))
|
||||
to_chat(usr, "You cannot reach the ore box.")
|
||||
return
|
||||
|
||||
@@ -131,8 +101,5 @@ obj/structure/ore_box/ex_act(severity, target)
|
||||
to_chat(usr, "<span class='warning'>The ore box is empty.</span>")
|
||||
return
|
||||
|
||||
for(var/obj/item/ore/O in contents)
|
||||
contents -= O
|
||||
O.forceMove(loc)
|
||||
CHECK_TICK
|
||||
to_chat(usr, "<span class='notice'>You empty the ore box.</span>")
|
||||
dump_box_contents()
|
||||
to_chat(usr, "<span class='notice'>You empty the ore box.</span>")
|
||||
|
||||
Reference in New Issue
Block a user