diff --git a/code/modules/mining/abandonedcrates.dm b/code/modules/mining/abandonedcrates.dm
index aa83f359d99..6f9dc2a162c 100644
--- a/code/modules/mining/abandonedcrates.dm
+++ b/code/modules/mining/abandonedcrates.dm
@@ -6,9 +6,9 @@
icon_closed = "securecrate"
var/list/code = list()
var/list/lastattempt = list()
- var/attempts = 10
+ var/attempts = 15
var/codelen = 4
- locked = 1
+ locked = TRUE
/obj/structure/closet/crate/secure/loot/Initialize()
. = ..()
@@ -24,171 +24,170 @@
var/loot = rand(1, 100)
switch(loot)
if(1 to 5) // Common things go, 5%
- new/obj/item/reagent_containers/food/drinks/bottle/rum(src)
- new/obj/item/reagent_containers/food/drinks/bottle/whiskey(src)
- new/obj/item/reagent_containers/food/snacks/grown/ambrosiadeus(src)
- new/obj/item/flame/lighter/zippo(src)
+ new /obj/item/reagent_containers/food/drinks/bottle/rum(src)
+ new /obj/item/reagent_containers/food/drinks/bottle/whiskey(src)
+ new /obj/item/reagent_containers/food/snacks/grown/ambrosiadeus(src)
+ new /obj/item/flame/lighter/zippo(src)
if(6 to 10)
- new/obj/random/custom_ka(src)
- new/obj/random/custom_ka(src)
- new/obj/random/custom_ka(src)
+ new /obj/random/custom_ka(src)
+ new /obj/random/custom_ka(src)
+ new /obj/random/custom_ka(src)
if(11 to 15)
- new/obj/item/reagent_containers/glass/beaker/bluespace(src)
+ new /obj/item/reagent_containers/glass/beaker/bluespace(src)
if(16 to 20)
for(var/i = 0, i < 10, i++)
- new/obj/item/ore/diamond(src)
+ new /obj/item/ore/diamond(src)
if(21 to 25)
for(var/i = 0, i < 3, i++)
- new/obj/machinery/portable_atmospherics/hydroponics(src)
+ new /obj/machinery/portable_atmospherics/hydroponics(src)
if(26 to 30)
for(var/i = 0, i < 3, i++)
- new/obj/item/reagent_containers/glass/beaker/noreact(src)
+ new /obj/item/reagent_containers/glass/beaker/noreact(src)
if(31 to 35)
spawn_money(rand(300,800), src)
if(36 to 40)
- new/obj/item/melee/baton(src)
+ new /obj/item/melee/baton(src)
if(41 to 45)
- new/obj/item/clothing/under/shorts/red(src)
- new/obj/item/clothing/under/shorts/blue(src)
+ new /obj/item/clothing/under/shorts/red(src)
+ new /obj/item/clothing/under/shorts/blue(src)
if(46 to 50)
- new/obj/item/clothing/under/chameleon(src)
+ new /obj/item/clothing/under/chameleon(src)
for(var/i = 0, i < 7, i++)
- new/obj/item/clothing/accessory/horrible(src)
+ new /obj/item/clothing/accessory/horrible(src)
if(51 to 52) // Uncommon, 2% each
- new/obj/item/melee/classic_baton(src)
+ new /obj/item/melee/classic_baton(src)
if(53 to 54)
- new/obj/item/latexballon(src)
+ new /obj/item/latexballon(src)
if(55 to 56)
var/newitem = pick(typesof(/obj/item/toy/prize) - /obj/item/toy/prize)
new newitem(src)
if(57 to 58)
- new/obj/item/toy/syndicateballoon(src)
+ new /obj/item/toy/syndicateballoon(src)
if(59 to 60)
- new/obj/item/rig/eva(src)
+ new /obj/item/rig/eva(src)
if(61 to 62)
for(var/i = 0, i < 12, ++i)
- new/obj/item/clothing/head/kitty(src)
+ new /obj/item/clothing/head/kitty(src)
if(63 to 64)
var/t = rand(4,7)
for(var/i = 0, i < t, ++i)
var/newcoin = pick(/obj/item/coin/silver, /obj/item/coin/silver, /obj/item/coin/silver, /obj/item/coin/iron, /obj/item/coin/iron, /obj/item/coin/iron, /obj/item/coin/gold, /obj/item/coin/diamond, /obj/item/coin/phoron, /obj/item/coin/uranium, /obj/item/coin/platinum)
new newcoin(src)
if(65 to 66)
- new/obj/item/clothing/suit/ianshirt(src)
+ new /obj/item/clothing/suit/ianshirt(src)
if(67 to 68)
var/t = rand(4,7)
for(var/i = 0, i < t, ++i)
var/newitem = pick(typesof(/obj/item/stock_parts) - /obj/item/stock_parts - /obj/item/stock_parts/subspace)
new newitem(src)
if(69 to 70)
- new/obj/item/pickaxe/silver(src)
+ new /obj/item/pickaxe/silver(src)
if(71 to 72)
- new/obj/item/pickaxe/drill(src)
+ new /obj/item/pickaxe/drill(src)
if(73 to 74)
- new/obj/item/pickaxe/jackhammer(src)
+ new /obj/item/pickaxe/jackhammer(src)
if(75 to 76)
- new/obj/item/pickaxe/diamond(src)
+ new /obj/item/pickaxe/diamond(src)
if(77 to 78)
- new/obj/item/pickaxe/diamonddrill(src)
+ new /obj/item/pickaxe/diamonddrill(src)
if(79 to 80)
- new/obj/item/pickaxe/gold(src)
+ new /obj/item/pickaxe/gold(src)
if(81 to 82)
- new/obj/item/gun/energy/plasmacutter(src)
+ new /obj/item/gun/energy/plasmacutter(src)
if(83) // Rarest things, some are unobtainble otherwise, some are just robust, 1% each
- new/obj/random/prebuilt_ka(src)
+ new /obj/random/prebuilt_ka(src)
if(84)
- new/obj/item/toy/katana(src)
+ new /obj/item/toy/katana(src)
if(85)
- new/obj/item/seeds/random(src)
+ new /obj/item/seeds/random(src)
if(86)
- new/obj/item/weed_extract(src)
+ new /obj/item/weed_extract(src)
if(87)
- new/obj/item/xenos_claw(src)
+ new /obj/item/xenos_claw(src)
if(88)
- new/obj/item/gun/projectile/shotgun/pump/rifle(src)
- new/obj/item/ammo_magazine/boltaction(src)
- new/obj/item/clothing/under/soviet(src)
- new/obj/item/clothing/head/ushanka/grey(src)
+ new /obj/item/gun/projectile/shotgun/pump/rifle(src)
+ new /obj/item/ammo_magazine/boltaction(src)
+ new /obj/item/clothing/under/soviet(src)
+ new /obj/item/clothing/head/ushanka/grey(src)
if(89)
- new/obj/item/stack/material/animalhide/xeno(src)
+ new /obj/item/stack/material/animalhide/xeno(src)
if(90)
- new/obj/item/organ/internal/heart(src)
+ new /obj/item/organ/internal/heart(src)
if(91)
- new/obj/item/poppet(src)
+ new /obj/item/poppet(src)
if(92)
- new/obj/item/material/sword/katana(src)
+ new /obj/item/material/sword/katana(src)
if(93)
- new/obj/item/dnainjector/xraymut(src) // Probably the least OP
+ new /obj/item/dnainjector/xraymut(src) // Probably the least OP
if(94) // Why the hell not
- new/obj/item/storage/backpack/clown(src)
- new/obj/item/clothing/under/rank/clown(src)
- new/obj/item/clothing/shoes/clown_shoes(src)
- new/obj/item/device/pda/clown(src)
- new/obj/item/clothing/mask/gas/clown_hat(src)
- new/obj/item/bikehorn(src)
- //new/obj/item/stamp/clown(src) I'd add it, but only clowns can use it
- new/obj/item/pen/crayon/rainbow(src)
- new/obj/item/toy/waterflower(src)
+ new /obj/item/storage/backpack/clown(src)
+ new /obj/item/clothing/under/rank/clown(src)
+ new /obj/item/clothing/shoes/clown_shoes(src)
+ new /obj/item/device/pda/clown(src)
+ new /obj/item/clothing/mask/gas/clown_hat(src)
+ new /obj/item/bikehorn(src)
+ new /obj/item/pen/crayon/rainbow(src)
+ new /obj/item/toy/waterflower(src)
if(95)
- new/obj/item/clothing/under/mime(src)
- new/obj/item/clothing/shoes/black(src)
- new/obj/item/device/pda/mime(src)
- new/obj/item/clothing/gloves/white(src)
- new/obj/item/clothing/mask/gas/mime(src)
- new/obj/item/clothing/head/beret(src)
- new/obj/item/clothing/accessory/suspenders(src)
- new/obj/item/pen/crayon/mime(src)
- new/obj/item/reagent_containers/food/drinks/bottle/bottleofnothing(src)
+ new /obj/item/clothing/under/mime(src)
+ new /obj/item/clothing/shoes/black(src)
+ new /obj/item/device/pda/mime(src)
+ new /obj/item/clothing/gloves/white(src)
+ new /obj/item/clothing/mask/gas/mime(src)
+ new /obj/item/clothing/head/beret(src)
+ new /obj/item/clothing/accessory/suspenders(src)
+ new /obj/item/pen/crayon/mime(src)
+ new /obj/item/reagent_containers/food/drinks/bottle/bottleofnothing(src)
if(96)
new/obj/item/vampiric(src)
if(97)
- new/obj/item/archaeological_find(src)
+ new /obj/item/archaeological_find(src)
if(98)
- new/obj/item/melee/energy/sword(src)
+ new /obj/item/melee/energy/sword(src)
if(99)
- new/obj/item/storage/belt/champion(src)
- new/obj/item/clothing/mask/luchador(src)
+ new /obj/item/storage/belt/champion(src)
+ new /obj/item/clothing/mask/luchador(src)
if(100)
- new/obj/item/gun/projectile/tanto(src)
- new/obj/item/ammo_magazine/mc10mm(src)
- new/obj/item/ammo_magazine/mc10mm(src)
- new/obj/item/ammo_magazine/mc10mm/rubber(src)
- new/obj/item/clothing/under/rank/dispatch(src)
- new/obj/item/clothing/accessory/badge/old(src)
- new/obj/item/clothing/head/helmet/formalcaptain(src)
+ new /obj/item/gun/projectile/tanto(src)
+ new /obj/item/ammo_magazine/mc10mm(src)
+ new /obj/item/ammo_magazine/mc10mm(src)
+ new /obj/item/ammo_magazine/mc10mm/rubber(src)
+ new /obj/item/clothing/under/rank/dispatch(src)
+ new /obj/item/clothing/accessory/badge/old(src)
+ new /obj/item/clothing/head/helmet/formalcaptain(src)
-/obj/structure/closet/crate/secure/loot/togglelock(mob/user as mob)
+/obj/structure/closet/crate/secure/loot/togglelock(mob/user)
if(!locked)
return
- to_chat(user, "The crate is locked with a Deca-code lock.")
+ to_chat(user, SPAN_NOTICE("The crate is locked with a Deca-code lock."))
var/input = input(user, "Enter [codelen] digits.", "Deca-Code Lock", "") as text
if(!Adjacent(user))
return
- if(input == null || length(input) != codelen)
- to_chat(user, "You leave the crate alone.")
+ if(!input || length(input) != codelen)
+ to_chat(user, SPAN_NOTICE("You leave the crate alone."))
else if(check_input(input))
- to_chat(user, "The crate unlocks!")
+ to_chat(user, SPAN_NOTICE("The crate unlocks!"))
playsound(user, 'sound/machines/lockreset.ogg', 50, 1)
- set_locked(0)
+ set_locked(FALSE)
else
- visible_message("A red light on \the [src]'s control panel flashes briefly.")
+ visible_message(SPAN_WARNING("A red light on \the [src]'s control panel flashes briefly."))
attempts--
- if (attempts == 0)
- to_chat(user, "The crate's anti-tamper system activates!")
- var/turf/T = get_turf(src.loc)
+ if(!attempts)
+ to_chat(user, SPAN_DANGER("The crate's anti-tamper system activates!"))
+ var/turf/T = get_turf(src)
explosion(T, 0, 0, 1, 2)
qdel(src)
/obj/structure/closet/crate/secure/loot/emag_act(var/remaining_charges, var/mob/user)
- if (locked)
- to_chat(user, "The crate unlocks!")
- locked = 0
+ if(locked)
+ to_chat(user, SPAN_NOTICE("The crate unlocks!"))
+ locked = FALSE
/obj/structure/closet/crate/secure/loot/proc/check_input(var/input)
if(length(input) != codelen)
- return 0
+ return FALSE
. = 1
lastattempt.Cut()
@@ -198,15 +197,15 @@
if(guesschar != code[i])
. = 0
-/obj/structure/closet/crate/secure/loot/attackby(obj/item/W as obj, mob/user as mob)
+/obj/structure/closet/crate/secure/loot/attackby(obj/item/W, mob/user)
if(locked)
- if (W.ismultitool()) // Greetings Urist McProfessor, how about a nice game of cows and bulls?
- to_chat(user, "DECA-CODE LOCK ANALYSIS:")
- if (attempts == 1)
- to_chat(user, "* Anti-Tamper system will activate on the next failed access attempt.")
+ if(W.ismultitool()) // Greetings Urist McProfessor, how about a nice game of cows and bulls?
+ to_chat(user, SPAN_NOTICE("DECA-CODE LOCK ANALYSIS:"))
+ if(attempts == 1)
+ to_chat(user, SPAN_WARNING("* Anti-Tamper system will activate on the next failed access attempt."))
else
- to_chat(user, "* Anti-Tamper system will activate after [src.attempts] failed access attempts.")
- if(lastattempt.len)
+ to_chat(user, SPAN_NOTICE("* Anti-Tamper system will activate after [src.attempts] failed access attempts."))
+ if(length(lastattempt))
var/bulls = 0
var/cows = 0
@@ -217,6 +216,6 @@
else if(lastattempt[i] in code_contents)
++cows
code_contents -= lastattempt[i]
- to_chat(user, "Last code attempt had [bulls] correct digits at correct positions and [cows] correct digits at incorrect positions.")
+ to_chat(user, SPAN_NOTICE("Last code attempt had [bulls] correct digits at correct positions and [cows] correct digits at incorrect positions."))
return
..()
diff --git a/code/modules/mining/coins.dm b/code/modules/mining/coins.dm
index c9a82d47dc0..0133777251a 100644
--- a/code/modules/mining/coins.dm
+++ b/code/modules/mining/coins.dm
@@ -2,7 +2,7 @@
/obj/item/coin
icon = 'icons/obj/coins.dmi'
- name = "Coin"
+ name = "coin"
icon_state = "coin__heads"
randpixel = 8
desc = "A flat disc or piece of metal with an official stamp. An archaic type of currency."
@@ -64,33 +64,33 @@
icon_state = "coin_battlemonsters_heads"
cmineral = "battlemonsters"
-/obj/item/coin/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/coin/attackby(obj/item/W, mob/user)
if(W.iscoil())
var/obj/item/stack/cable_coil/CC = W
if(string_attached)
- to_chat(user, "There already is a string attached to this coin.")
+ to_chat(user, SPAN_NOTICE("There already is a string attached to this coin."))
return
- if (CC.use(1))
+ if(CC.use(1))
add_overlay("coin_string_overlay")
- string_attached = 1
- to_chat(user, "You attach a string to the coin.")
+ string_attached = TRUE
+ to_chat(user, SPAN_NOTICE("You attach a string to the coin."))
else
- to_chat(user, "This cable coil appears to be empty.")
+ to_chat(user, SPAN_NOTICE("This cable coil appears to be empty."))
return
else if(W.iswirecutter())
if(!string_attached)
..()
return
- var/obj/item/stack/cable_coil/CC = new/obj/item/stack/cable_coil(user.loc)
+ var/obj/item/stack/cable_coil/CC = new /obj/item/stack/cable_coil(get_turf(user))
CC.amount = 1
CC.update_icon()
cut_overlays()
string_attached = null
- to_chat(user, "You detach the string from the coin.")
+ to_chat(user, SPAN_NOTICE("You detach the string from the coin."))
else ..()
-/obj/item/coin/attack_self(mob/user as mob)
+/obj/item/coin/attack_self(mob/user)
var/result = rand(1, sides)
var/comment = ""
if(result == 1)
@@ -99,6 +99,6 @@
comment = "heads"
flick("coin_[cmineral]_flip", src)
icon_state = "coin_[cmineral]_[comment]"
- playsound(src.loc, 'sound/items/coinflip.ogg', 100, 1, -4)
- user.visible_message("[user] has thrown \the [src]. It lands on [comment]! ", \
- "You throw \the [src]. It lands on [comment]! ")
+ playsound(get_turf(src), 'sound/items/coinflip.ogg', 100, 1, -4)
+ user.visible_message(SPAN_NOTICE("\The [user] has thrown \the [src]. It lands on [comment]!"), \
+ SPAN_NOTICE("You throw \the [src]. It lands on [comment]!"))
diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm
index 21f0ca73c7c..75054806b02 100644
--- a/code/modules/mining/drilling/drill.dm
+++ b/code/modules/mining/drilling/drill.dm
@@ -1,9 +1,9 @@
/obj/machinery/mining
icon = 'icons/obj/mining_drill.dmi'
anchored = FALSE
- use_power = FALSE //The drill takes power directly from a cell.
- density = 1
- layer = MOB_LAYER+0.1 //So it draws over mobs in the tile north of it.
+ use_power = 0 //The drill takes power directly from a cell.
+ density = TRUE
+ layer = MOB_LAYER + 0.1 //So it draws over mobs in the tile north of it.
/obj/machinery/mining/drill
name = "mining drill head"
@@ -33,7 +33,7 @@
var/harvest_speed
var/capacity
var/charge_use
- var/obj/item/cell/cell = null
+ var/obj/item/cell/cell
//Flags
var/need_update_field = FALSE
@@ -58,17 +58,16 @@
return ..()
/obj/machinery/mining/drill/machinery_process()
-
if(need_player_check)
return
check_supports()
- if(!active)
+ if(!active)
return
if(!anchored || !use_cell_power())
- system_error("system configuration or charge error")
+ system_error("System configuration or charge error.")
return
if(need_update_field)
@@ -90,10 +89,10 @@
T.ex_act(2.0)
//Dig out the tasty ores.
- if(resource_field.len)
+ if(length(resource_field))
var/turf/harvesting = pick(resource_field)
- while(resource_field.len && !harvesting.resources)
+ while(length(resource_field) && !harvesting.resources)
harvesting.has_resources = FALSE
harvesting.resources = null
resource_field -= harvesting
@@ -105,35 +104,34 @@
var/total_harvest = harvest_speed //Ore harvest-per-tick.
var/found_resource = FALSE //If this doesn't get set, the area is depleted and the drill errors out.
- for(var/metal in ore_types)
-
- if(contents.len >= capacity)
- system_error("insufficient storage space")
+ for(var/ore in ore_types)
+ if(length(contents) >= capacity)
+ system_error("Insufficient storage space.")
active = FALSE
need_player_check = TRUE
update_icon()
return
- if(contents.len + total_harvest >= capacity)
- total_harvest = capacity - contents.len
+ if(length(contents) + total_harvest >= capacity)
+ total_harvest = capacity - length(contents)
- if(total_harvest <= 0) break
- if(harvesting.resources[metal])
-
- found_resource = TRUE
+ if(total_harvest <= 0)
+ break
+ if(harvesting.resources[ore])
+ found_resource = TRUE
var/create_ore = 0
- if(harvesting.resources[metal] >= total_harvest)
- harvesting.resources[metal] -= total_harvest
+ if(harvesting.resources[ore] >= total_harvest)
+ harvesting.resources[ore] -= total_harvest
create_ore = total_harvest
total_harvest = 0
else
- total_harvest -= harvesting.resources[metal]
- create_ore = harvesting.resources[metal]
- harvesting.resources[metal] = 0
+ total_harvest -= harvesting.resources[ore]
+ create_ore = harvesting.resources[ore]
+ harvesting.resources[ore] = 0
- for(var/i=1, i <= create_ore, i++)
- var/oretype = ore_types[metal]
+ for(var/i = 1, i <= create_ore, i++)
+ var/oretype = ore_types[ore]
new oretype(src)
if(!found_resource)
@@ -148,7 +146,7 @@
/obj/machinery/mining/drill/examine(mob/user)
..(user)
if(need_player_check)
- to_chat(user, "The drill error light is flashing. The cell panel is [panel_open ? "open" : "closed"].")
+ to_chat(user, SPAN_WARNING("The drill error light is flashing. The cell panel is [panel_open ? "open" : "closed"]."))
else
to_chat(user, "The drill is [active ? "active" : "inactive"] and the cell panel is [panel_open ? "open" : "closed"].")
if(panel_open)
@@ -175,28 +173,28 @@
if(O.iscrowbar())
if (panel_open)
if(cell)
- to_chat(user, "You wrench out \the [cell].")
+ to_chat(user, SPAN_NOTICE("You wrench out \the [cell]."))
cell.forceMove(get_turf(user))
component_parts -= cell
cell = null
return
else
- to_chat(user, "There's no cell to remove!")
+ to_chat(user, SPAN_WARNING("There's no cell to remove!"))
return
if(istype(O, /obj/item/cell))
if(panel_open)
if(cell)
- to_chat(user, "There is already a power cell inside.")
+ to_chat(user, SPAN_WARNING("There is already a power cell inside."))
return
else
// insert cell
- user.drop_from_inventory(O,src)
+ user.drop_from_inventory(O, src)
cell = O
component_parts += O
O.add_fingerprint(user)
- visible_message(span("notice", "[user] inserts a power cell into [src]."),
- span("notice", "You insert the power cell into [src]."))
+ visible_message(span("notice", "\The [user] inserts a power cell into \the [src]."),
+ span("notice", "You insert the power cell into \the [src]."))
power_change()
else
to_chat(user, span("notice", "The hatch must be open to insert a power cell."))
@@ -209,7 +207,7 @@
check_supports()
if(need_player_check)
- to_chat(user, "You hit the manual override and reset the drill's error checking.")
+ to_chat(user, SPAN_NOTICE("You hit the manual override and reset the drill's error checking."))
need_player_check = FALSE
if(anchored)
get_resource_field()
@@ -219,24 +217,24 @@
if(use_cell_power())
active = !active
if(active)
- visible_message("\The [src] lurches downwards, grinding noisily.")
+ visible_message(SPAN_NOTICE("\The [src] lurches downwards, grinding noisily."))
need_update_field = TRUE
else
- visible_message("\The [src] shudders to a grinding halt.")
+ visible_message(SPAN_NOTICE("\The [src] shudders to a grinding halt."))
else
- to_chat(user, "The drill is unpowered.")
+ to_chat(user, SPAN_NOTICE("\The [src] is unpowered."))
else
if(use_cell_power())
if(!supported && !panel_open)
- system_error("unbraced drill error")
+ system_error("Unbraced drill error.")
sleep(30)
if(!supported) //if you can resolve it manually in three seconds then power to you good-sir.
- visible_message("\icon[src] [src.name] beeps, \"Unbraced drill error automatically corrected. Please brace your drill.\"")
+ visible_message(SPAN_NOTICE("\icon[src] [src.name] beeps, \"Unbraced drill error automatically corrected. Please brace your drill.\""))
else
- visible_message("\icon[src] [src.name] beeps, \"Unbraced drill error manually resolved. Operations may resume normally.\"")
+ visible_message(SPAN_NOTICE("\icon[src] [src.name] beeps, \"Unbraced drill error manually resolved. Operations may resume normally.\""))
if(supported && panel_open)
if(cell)
- system_error("unsealed cell fitting error. Volatile cell discharge may occur if not immediately corrected")
+ system_error("Unsealed cell fitting error. Volatile cell discharge may occur if not immediately corrected.")
spark_system.queue()
sleep(20)
spark_system.queue()
@@ -245,18 +243,18 @@
sleep(10)
if(panel_open)
if(prob(70))
- visible_message("\The [src]'s cell shorts out!")
+ visible_message(SPAN_DANGER("\The [src]'s cell shorts out!"))
cell.use(cell.charge)
else
- visible_message("\The [src]'s cell detonates!")
- explosion(src.loc, -1, -1, 2, 1)
+ visible_message(SPAN_DANGER("\The [src]'s cell detonates!"))
+ explosion(get_turf(src), -1, -1, 2, 1)
qdel(cell)
component_parts -= cell
cell = null
else
- visible_message("\icon[src] [src.name] beeps, \"Unsealed cell fitting error manually resolved. Operations may resume normally.\"")
+ visible_message(SPAN_NOTICE("\icon[src] [src.name] beeps, \"Unsealed cell fitting error manually resolved. Operations may resume normally.\""))
else
- to_chat(user, "The drill is unpowered.")
+ to_chat(user, SPAN_NOTICE("\The [src] is unpowered."))
update_icon()
/obj/machinery/mining/drill/update_icon()
@@ -286,7 +284,6 @@
cell = locate(/obj/item/cell) in component_parts
/obj/machinery/mining/drill/proc/check_supports()
-
supported = FALSE
if((!supports || !supports.len) && initial(anchored) == 0)
@@ -294,18 +291,17 @@
anchored = FALSE
active = FALSE
else
- anchored = 1
+ anchored = TRUE
- if(supports && supports.len >= braces_needed)
- supported = 1
+ if(supports && length(supports) >= braces_needed)
+ supported = TRUE
update_icon()
/obj/machinery/mining/drill/proc/system_error(var/error)
-
if(error)
- visible_message("\icon[src] [src.name] flashes a system warning: [error].")
- playsound(src.loc, 'sound/machines/warning-buzzer.ogg', 100, 1)
+ visible_message(SPAN_WARNING("\icon[src] [src.name] flashes a system warning: [error]"))
+ playsound(get_turf(src), 'sound/machines/warning-buzzer.ogg', 100, 1)
need_player_check = TRUE
active = FALSE
update_icon()
@@ -328,8 +324,8 @@
if(mine_turf && mine_turf.has_resources)
resource_field += mine_turf
- if(!resource_field.len)
- system_error("resources depleted")
+ if(!length(resource_field))
+ system_error("Resources depleted.")
/obj/machinery/mining/drill/proc/use_cell_power()
if(!cell)
@@ -368,8 +364,8 @@
)
/obj/machinery/mining/brace/attackby(obj/item/W, mob/user)
- if(connected && connected.active)
- to_chat(user, "You know you ought not work with the brace of a running drill, but you do anyways.")
+ if(connected?.active)
+ to_chat(user, SPAN_WARNING("You know you ought not work with the brace of a running drill, but you do anyways."))
sleep(5)
if(istype(user, /mob/living/carbon/human))
//Save the users active hand
@@ -379,18 +375,18 @@
var/active_hand = H.hand
if(prob(20))
if(active_hand)
- LA.droplimb(0,DROPLIMB_BLUNT)
+ LA.droplimb(0, DROPLIMB_BLUNT)
else
- RA.droplimb(0,DROPLIMB_BLUNT)
- connected.system_error("unexpected user interface error")
+ RA.droplimb(0, DROPLIMB_BLUNT)
+ connected.system_error("Unexpected user interface error.")
return
else
- H.apply_damage(25,BRUTE, sharp=1, edge=1)
- connected.system_error("unexpected user interface error")
+ H.apply_damage(25, BRUTE, sharp = TRUE, edge = TRUE)
+ connected.system_error("Unexpected user interface error.")
return
else
var/mob/living/M = user
- M.apply_damage(25,BRUTE, sharp=1, edge=1)
+ M.apply_damage(25, BRUTE, sharp = TRUE, edge = TRUE)
if(default_deconstruction_screwdriver(user, W))
return
@@ -398,30 +394,29 @@
return
if(W.iswrench())
-
if(istype(get_turf(src), /turf/space))
- to_chat(user, "You send the [src] careening into space. Idiot.")
- var/inertia = rand(10,30)
+ to_chat(user, SPAN_NOTICE("You send \the [src] careening into space. Idiot."))
+ var/inertia = rand(10, 30)
for(var/i in 1 to inertia)
- step_away(src,user,15,8)
+ step_away(src, user, 15, 8)
if(!(istype(get_turf(src), /turf/space)))
break
sleep(1)
return
- if(connected && connected.active)
+ if(connected?.active)
if(prob(50))
sleep(10)
- connected.system_error("unbraced drill error")
+ connected.system_error("Unbraced drill error.")
sleep(30)
- if(connected && connected.active) //if you can resolve it manually in three seconds then power to you good-sir.
- visible_message("\icon[src] [src.name] beeps, \"Unbraced drill error automatically corrected. Please brace your drill.\"")
+ if(connected?.active) //if you can resolve it manually in three seconds then power to you good-sir.
+ visible_message(SPAN_NOTICE("\icon[src] [src.name] beeps, \"Unbraced drill error automatically corrected. Please brace your drill.\""))
else
- connected.system_error("unexpected user interface error")
+ connected.system_error("Unexpected user interface error.")
return
- playsound(src.loc, W.usesound, 100, 1)
- to_chat(user, "You [anchored ? "un" : ""]anchor the brace.")
+ playsound(get_turf(src), W.usesound, 100, 1)
+ to_chat(user, SPAN_NOTICE("You [anchored ? "un" : ""]anchor the brace."))
anchored = !anchored
if(anchored)
@@ -430,7 +425,6 @@
disconnect()
/obj/machinery/mining/brace/proc/connect()
-
var/turf/T = get_step(get_turf(src), src.dir)
for(var/thing in T.contents)
@@ -450,10 +444,11 @@
connected.check_supports()
/obj/machinery/mining/brace/proc/disconnect()
+ if(!connected)
+ return
- if(!connected) return
-
- if(!connected.supports) connected.supports = list()
+ if(!connected.supports)
+ connected.supports = list()
icon_state = "mining_brace"
diff --git a/code/modules/mining/drilling/scanner.dm b/code/modules/mining/drilling/scanner.dm
index 4ba82d4ebe6..95e036fc566 100644
--- a/code/modules/mining/drilling/scanner.dm
+++ b/code/modules/mining/drilling/scanner.dm
@@ -7,8 +7,8 @@
origin_tech = list(TECH_MAGNET = 1, TECH_ENGINEERING = 1)
matter = list(DEFAULT_WALL_MATERIAL = 150)
-/obj/item/mining_scanner/attack_self(mob/user as mob)
- to_chat(user, "You begin sweeping \the [src] about, scanning for metal deposits.")
+/obj/item/mining_scanner/attack_self(mob/user)
+ to_chat(user, SPAN_NOTICE("You begin sweeping \the [src] about, scanning for metal deposits."))
if(!do_after(user, 50))
return
@@ -21,7 +21,6 @@
)
for(var/turf/T in range(2, get_turf(user)))
-
if(!T.has_resources)
continue
@@ -29,21 +28,29 @@
var/ore_type
switch(metal)
- if("silicates", "carbonaceous rock", "iron") ore_type = "surface minerals"
- if("gold", "silver", "diamond") ore_type = "precious metals"
- if("uranium") ore_type = "nuclear fuel"
- if("phoron", "osmium", "hydrogen") ore_type = "exotic matter"
+ if("silicates", "carbonaceous rock", "iron")
+ ore_type = "surface minerals"
+ if("gold", "silver", "diamond")
+ ore_type = "precious metals"
+ if("uranium")
+ ore_type = "nuclear fuel"
+ if("phoron", "osmium", "hydrogen")
+ ore_type = "exotic matter"
- if(ore_type) metals[ore_type] += T.resources[metal]
+ if(ore_type)
+ metals[ore_type] += T.resources[metal]
- to_chat(user, "\icon[src] The scanner beeps and displays a readout.")
+ to_chat(user, "\icon[src] [SPAN_NOTICE("The scanner beeps and displays a readout:")]")
for(var/ore_type in metals)
var/result = "no sign"
switch(metals[ore_type])
- if(1 to 25) result = "trace amounts"
- if(26 to 75) result = "significant amounts"
- if(76 to INFINITY) result = "huge quantities"
+ if(1 to 25)
+ result = "trace amounts"
+ if(26 to 75)
+ result = "significant amounts"
+ if(76 to INFINITY)
+ result = "huge quantities"
- to_chat(user, "- [result] of [ore_type].")
\ No newline at end of file
+ to_chat(user, SPAN_NOTICE("- [result] of [ore_type]."))
\ No newline at end of file
diff --git a/code/modules/mining/machine_input_output_plates.dm b/code/modules/mining/machine_input_output_plates.dm
index d9e65458569..88b7a6dc635 100644
--- a/code/modules/mining/machine_input_output_plates.dm
+++ b/code/modules/mining/machine_input_output_plates.dm
@@ -3,17 +3,21 @@
/obj/machinery/mineral/input
icon = 'icons/mob/screen/generic.dmi'
icon_state = "x2"
- name = "Input area"
- density = 0
- anchored = 1.0
- New()
- icon_state = "blank"
+ name = "Input Area"
+ density = FALSE
+ anchored = TRUE
+
+/obj/machinery/mineral/input/Initialize()
+ . = ..()
+ icon_state = "blank"
/obj/machinery/mineral/output
icon = 'icons/mob/screen/generic.dmi'
icon_state = "x"
- name = "Output area"
- density = 0
- anchored = 1.0
- New()
- icon_state = "blank"
+ name = "Output Area"
+ density = FALSE
+ anchored = TRUE
+
+/obj/machinery/mineral/output/Initialize()
+ . = ..()
+ icon_state = "blank"
diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm
index f5c1d07d598..1349ac911fc 100644
--- a/code/modules/mining/machine_processing.dm
+++ b/code/modules/mining/machine_processing.dm
@@ -4,14 +4,14 @@
name = "ore redemption console"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "console"
- density = 0
- anchored = 1
+ density = FALSE
+ anchored = TRUE
use_power = 1
idle_power_usage = 15
active_power_usage = 50
- var/obj/machinery/mineral/processing_unit/machine = null
- var/show_all_ores = 0
+ var/obj/machinery/mineral/processing_unit/machine
+ var/show_all_ores = FALSE
var/points = 0
var/obj/item/card/id/inserted_id
@@ -26,13 +26,13 @@
var/area/A = get_area(src)
var/best_distance = INFINITY
for(var/obj/machinery/mineral/processing_unit/checked_machine in SSmachinery.all_machines)
- if(A == get_area(checked_machine) && get_dist_euclidian(checked_machine,src) < best_distance)
+ if(A == get_area(checked_machine) && get_dist_euclidian(checked_machine, src) < best_distance)
machine = checked_machine
- best_distance = get_dist_euclidian(checked_machine,src)
- if (machine)
+ best_distance = get_dist_euclidian(checked_machine, src)
+ if(machine)
machine.console = src
else
- to_chat(user, "ERROR: Linked machine not found!")
+ to_chat(user, SPAN_WARNING("ERROR: Linked machine not found!"))
return machine
@@ -44,14 +44,13 @@
if(istype(I,/obj/item/card/id))
var/obj/item/card/id/C = user.get_active_hand()
if(istype(C) && !istype(inserted_id))
- user.drop_from_inventory(C,src)
+ user.drop_from_inventory(C, src)
inserted_id = C
interact(user)
else
..()
/obj/machinery/mineral/processing_unit_console/interact(mob/user)
-
if(..())
return
@@ -59,7 +58,7 @@
return
if(!allowed(user))
- to_chat(user, "Access denied.")
+ to_chat(user, SPAN_WARNING("Access denied."))
return
user.set_machine(src)
@@ -79,9 +78,11 @@
for(var/ore in machine.ores_processing)
- if(!machine.ores_stored[ore] && !show_all_ores) continue
+ if(!machine.ores_stored[ore] && !show_all_ores)
+ continue
var/ore/O = ore_data[ore]
- if(!O) continue
+ if(!O)
+ continue
dat += "
| [capitalize(O.display_name)] | [machine.ores_stored[ore]] | "
if(machine.ores_processing[ore])
switch(machine.ores_processing[ore])
@@ -106,7 +107,7 @@
/obj/machinery/mineral/processing_unit_console/Topic(href, href_list)
if(..())
- return 1
+ return TRUE
usr.set_machine(src)
src.add_fingerprint(usr)
@@ -122,35 +123,40 @@
if(points >= 0)
inserted_id.mining_points += points
if(points != 0)
- ping( "\The [src] pings, \"Point transfer complete! Transaction total: [points] points!\"" )
+ ping("\The [src] pings, \"Point transfer complete! Transaction total: [points] points!\"")
points = 0
else
- to_chat(usr, "[station_name()]'s mining division is currently indebted to NanoTrasen. Transaction incomplete until debt is cleared.")
+ to_chat(usr, SPAN_WARNING("[station_name()]'s mining division is currently indebted to NanoTrasen. Transaction incomplete until debt is cleared."))
else
- to_chat(usr, "Required access not found.")
+ to_chat(usr, SPAN_WARNING("Required access not found."))
if(href_list["choice"] == "print_report")
if(access_mining_station in inserted_id.access)
print_report(usr)
else
- to_chat(usr, "Required access not found.")
+ to_chat(usr, SPAN_WARNING("Required access not found."))
else if(href_list["choice"] == "insert")
var/obj/item/card/id/I = usr.get_active_hand()
if(istype(I))
usr.drop_from_inventory(I,src)
inserted_id = I
- else to_chat(usr, "No valid ID.")
+ else
+ to_chat(usr, SPAN_WARNING("No valid ID."))
if(href_list["toggle_smelting"])
-
var/choice = input("What setting do you wish to use for processing [href_list["toggle_smelting"]]?") as null|anything in list("Smelting","Compressing","Alloying","Nothing")
- if(!choice) return
+ if(!choice)
+ return
switch(choice)
- if("Nothing") choice = 0
- if("Smelting") choice = 1
- if("Compressing") choice = 2
- if("Alloying") choice = 3
+ if("Nothing")
+ choice = 0
+ if("Smelting")
+ choice = 1
+ if("Compressing")
+ choice = 2
+ if("Alloying")
+ choice = 3
machine.ores_processing[href_list["toggle_smelting"]] = choice
@@ -163,7 +169,6 @@
machine.icon_state = "furnace-off"
if(href_list["toggle_ores"])
-
show_all_ores = !show_all_ores
src.updateUsrDialog()
@@ -250,7 +255,7 @@
P.stamps += " This paper has been stamped by the NT Ore Processing System."
user.visible_message("\The [src] rattles and prints out a sheet of paper.")
- playsound(loc, "sound/bureaucracy/print_short.ogg", 50, 1)
+ playsound(get_turf(src), "sound/bureaucracy/print_short.ogg", 50, 1)
// reset
output_mats = list()
@@ -267,15 +272,15 @@
/obj/machinery/mineral/processing_unit
- name = "industrial smelter" //This isn't actually a goddamn furnace, we're in space and it's processing platinum and flammable phoron... //lol fuk u bay it is //i'm gay
+ name = "industrial smelter" //This isn't actually a goddamn furnace, we're in space and it's processing platinum and flammable phoron... //lol fuk u bay it is //i'm gay // based and redpilled
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "furnace-off"
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
light_range = 3
- var/obj/machinery/mineral/input = null
- var/obj/machinery/mineral/output = null
- var/obj/machinery/mineral/processing_unit_console/console = null
+ var/obj/machinery/mineral/input
+ var/obj/machinery/mineral/output
+ var/obj/machinery/mineral/processing_unit_console/console
var/sheets_per_tick = 20
var/list/ores_processing[0]
var/list/ores_stored[0]
@@ -299,32 +304,36 @@
// initialize static alloy_data list
if(!alloy_data)
alloy_data = list()
- for(var/alloytype in typesof(/datum/alloy)-/datum/alloy)
+ for(var/alloytype in subtypesof(/datum/alloy))
alloy_data += new alloytype()
- for (var/O in ore_data)
+ for(var/O in ore_data)
ores_processing[O] = 0
ores_stored[O] = 0
//Locate our output and input machinery.
- for (var/dir in cardinal)
+ for(var/dir in cardinal)
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
- if(src.input) break
- for (var/dir in cardinal)
+ if(src.input)
+ break
+ for(var/dir in cardinal)
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
- if(src.output) break
+ if(src.output)
+ break
/obj/machinery/mineral/processing_unit/machinery_process()
..()
- if (!src.output || !src.input) return
+ if(!src.output || !src.input)
+ return
var/list/tick_alloys = list()
//Grab some more ore to process this tick.
- for(var/i = 0,i= sheets_per_tick) break
+ if(sheets >= sheets_per_tick)
+ break
if(ores_stored[metal] > 0 && ores_processing[metal] != 0)
-
var/ore/O = ore_data[metal]
-
- if(!O) continue
+ if(!O)
+ continue
if(ores_processing[metal] == 3 && O.alloy) //Alloying.
-
for(var/datum/alloy/A in alloy_data)
-
if(A.metaltag in tick_alloys)
continue
@@ -359,12 +365,12 @@
if(!isnull(A.requires[metal]) && ores_stored[metal] >= A.requires[metal]) //We have enough of our first metal, we're off to a good start.
- enough_metal = 1
+ enough_metal = TRUE
for(var/needs_metal in A.requires)
//Check if we're alloying the needed metal and have it stored.
if(ores_processing[needs_metal] != 3 || ores_stored[needs_metal] < A.requires[needs_metal])
- enough_metal = 0
+ enough_metal = FALSE
break
if(!enough_metal)
@@ -378,63 +384,62 @@
use_power(100)
ores_stored[needs_metal] -= A.requires[needs_metal]
total += A.requires[needs_metal]
- total = max(1,round(total*A.product_mod)) //Always get at least one sheet.
- sheets += total-1
+ total = max(1, round(total * A.product_mod)) //Always get at least one sheet.
+ sheets += total - 1
- for(var/i=0,i0) can_make--
+ var/can_make = Clamp(ores_stored[metal], 0, sheets_per_tick - sheets)
+ if(can_make % 2 > 0)
+ can_make--
var/material/M = get_material_by_name(O.compresses_to)
if(!istype(M) || !can_make || ores_stored[metal] < 1)
continue
- for(var/i=0,iYou start feeding [W] into \the [src]")
- if(do_after(user,30))
- src.visible_message("\The [src] begins to print out a modsuit.")
- pressing = 1
+ to_chat(user, SPAN_NOTICE("You start feeding [W] into \the [src]"))
+ if(do_after(user, 30))
+ src.visible_message(SPAN_NOTICE("\The [src] begins to print out a modsuit."))
+ pressing = TRUE
update_icon()
use_power(500)
qdel(W)
spawn(300)
- ping( "\The [src] pings, \"Module successfuly produced!\"" )
+ ping("\The [src] pings, \"Module successfuly produced!\"")
- new outcome_path(src.loc)
+ new outcome_path(get_turf(src))
use_power(500)
- pressing = 0
+ pressing = FALSE
update_icon()
else
- ..()
\ No newline at end of file
+ ..()
diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm
index fb62abd64d4..c2c71976382 100644
--- a/code/modules/mining/machine_stacking.dm
+++ b/code/modules/mining/machine_stacking.dm
@@ -4,9 +4,9 @@
name = "stacking machine console"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "console"
- density = 0
- anchored = 1
- var/obj/machinery/mineral/stacking_machine/machine = null
+ density = FALSE
+ anchored = TRUE
+ var/obj/machinery/mineral/stacking_machine/machine
use_power = 1
idle_power_usage = 15
active_power_usage = 50
@@ -19,10 +19,10 @@
if(A == get_area(checked_machine) && get_dist_euclidian(checked_machine,src) < best_distance)
machine = checked_machine
best_distance = get_dist_euclidian(checked_machine,src)
- if (machine)
+ if(machine)
machine.console = src
else
- to_chat(user, "ERROR: Linked machine not found!")
+ to_chat(user, SPAN_WARNING("ERROR: Linked machine not found!"))
return machine
@@ -31,7 +31,6 @@
ui_interact(user)
/obj/machinery/mineral/stacking_unit_console/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/topic_state/state = default_state)
-
if(!setup_machine(user))
return
@@ -39,8 +38,8 @@
"stack_amt" = machine.stack_amt,
"contents" = list()
)
- for (var/stacktype in machine.stack_storage)
- if (machine.stack_storage[stacktype] > 0)
+ for(var/stacktype in machine.stack_storage)
+ if(machine.stack_storage[stacktype] > 0)
data["contents"] += list(list(
"path" = stacktype,
"name" = machine.stack_paths[stacktype],
@@ -48,7 +47,7 @@
))
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "stacking_machine.tmpl", "Stacking Machine", 500, 400, state = state)
ui.set_initial_data(data)
ui.open()
@@ -67,7 +66,7 @@
if(href_list["release_stack"])
var/stacktype = text2path(href_list["release_stack"])
- if (!stacktype || !machine.stack_paths[stacktype])
+ if(!stacktype || !machine.stack_paths[stacktype])
return
if(machine.stack_storage[stacktype] > 0)
@@ -85,14 +84,14 @@
name = "stacking machine"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "stacker"
- density = 1
- anchored = 1.0
+ density = TRUE
+ anchored = TRUE
var/obj/machinery/mineral/stacking_unit_console/console
- var/obj/machinery/mineral/input = null
- var/obj/machinery/mineral/output = null
+ var/obj/machinery/mineral/input
+ var/obj/machinery/mineral/output
var/list/stack_storage = list()
var/list/stack_paths = list()
- var/stack_amt = 50; // Amount to stack before releassing
+ var/stack_amt = 50 // Amount to stack before releasing
use_power = 1
idle_power_usage = 15
active_power_usage = 50
@@ -105,12 +104,12 @@
stack_storage[stacktype] = 0
stack_paths[stacktype] = capitalize(initial(S.name))
- for (var/dir in cardinal)
+ for(var/dir in cardinal)
input = locate(/obj/machinery/mineral/input, get_step(src, dir))
if(input)
break
- for (var/dir in cardinal)
+ for(var/dir in cardinal)
output = locate(/obj/machinery/mineral/output, get_step(src, dir))
if(output)
break
@@ -120,19 +119,20 @@
if(!console)
return
- if (output && input)
+ if(output && input)
var/turf/T = get_turf(input)
for(var/obj/item/O in T)
- if(!O) return
+ if(!O)
+ return
var/obj/item/stack/S = O
if(istype(S) && stack_storage[S.type] != null)
stack_storage[S.type] += S.amount
qdel(S)
else
- O.forceMove(output.loc)
+ O.forceMove(get_turf(output))
//Output amounts that are past stack_amt.
for(var/sheet in stack_storage)
if(stack_storage[sheet] >= stack_amt)
new sheet(get_turf(output), stack_amt)
- stack_storage[sheet] -= stack_amt
\ No newline at end of file
+ stack_storage[sheet] -= stack_amt
diff --git a/code/modules/mining/machine_unloading.dm b/code/modules/mining/machine_unloading.dm
index f49f0dc85db..4a3204122ea 100644
--- a/code/modules/mining/machine_unloading.dm
+++ b/code/modules/mining/machine_unloading.dm
@@ -5,43 +5,45 @@
name = "unloading machine"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "unloader"
- density = 1
- anchored = 1.0
+ density = TRUE
+ anchored = TRUE
use_power = 1
idle_power_usage = 15
active_power_usage = 50
- var/obj/machinery/mineral/input = null
- var/obj/machinery/mineral/output = null
+ var/obj/machinery/mineral/input
+ var/obj/machinery/mineral/output
/obj/machinery/mineral/unloading_machine/Initialize()
. = ..()
- for (var/dir in cardinal)
+ for(var/dir in cardinal)
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
- if(src.input) break
- for (var/dir in cardinal)
+ if(src.input)
+ break
+ for(var/dir in cardinal)
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
- if(src.output) break
+ if(src.output)
+ break
/obj/machinery/mineral/unloading_machine/machinery_process()
..()
- if (src.output && src.input)
- if (locate(/obj/structure/ore_box, input.loc))
- var/obj/structure/ore_box/BOX = locate(/obj/structure/ore_box, input.loc)
+ if(src.output && src.input)
+ if(locate(/obj/structure/ore_box, get_turf(input)))
+ var/obj/structure/ore_box/BOX = locate(/obj/structure/ore_box, get_turf(input))
var/i = 0
- for (var/obj/item/ore/O in BOX.contents)
+ for(var/obj/item/ore/O in BOX.contents)
BOX.contents -= O
- O.forceMove(output.loc)
+ O.forceMove(get_turf(output))
i++
- if (i>=10)
+ if(i >= 10)
return
- if (locate(/obj/item, input.loc))
+ if(locate(/obj/item, get_turf(input)))
var/obj/item/O
var/i
- for (i = 0; i<10; i++)
- O = locate(/obj/item, input.loc)
- if (O)
- O.forceMove(src.output.loc)
+ for(i = 0; i < 10; i++)
+ O = locate(/obj/item, get_turf(input))
+ if(O)
+ O.forceMove(get_turf(output))
else
return
return
diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm
index b6b20821fca..41b1061fc6f 100644
--- a/code/modules/mining/machine_vending.dm
+++ b/code/modules/mining/machine_vending.dm
@@ -63,8 +63,8 @@ var/global/list/minevendor_list = list( //keep in order of price
desc = "An equipment vendor for miners, points collected at an ore redemption machine can be spent here."
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "mining"
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
var/obj/item/card/id/inserted_id
/datum/data/mining_equipment
@@ -85,8 +85,7 @@ var/global/list/minevendor_list = list( //keep in order of price
name = "circuit board (Mining Equipment Vendor)"
build_path = /obj/machinery/mineral/equipment_vendor
origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1)
- req_components = list(
- /obj/item/stock_parts/console_screen = 1,
+ req_components = list( /obj/item/stock_parts/console_screen = 1,
/obj/item/stock_parts/matter_bin = 3)
/obj/machinery/mineral/equipment_vendor/power_change()
@@ -146,11 +145,12 @@ var/global/list/minevendor_list = list( //keep in order of price
if(istype(I))
usr.drop_from_inventory(I,src)
inserted_id = I
- else to_chat(usr, "No valid ID.")
+ else
+ to_chat(usr, SPAN_DANGER("No valid ID."))
if(href_list["purchase"])
if(istype(inserted_id))
var/datum/data/mining_equipment/prize = locate(href_list["purchase"])
- if (!prize || !(prize in minevendor_list))
+ if(!prize || !(prize in minevendor_list))
return
if(prize.amount <= 0 && prize.amount != -1)
return
@@ -161,14 +161,15 @@ var/global/list/minevendor_list = list( //keep in order of price
if(shuttle)
var/area/area_shuttle = shuttle.get_location_area()
if(!area_shuttle)
- to_chat(usr, "{ERR Code: NO_SHUTTLE} Order failed! Please try again.")
+ to_chat(usr, SPAN_DANGER("{ERR Code: NO_SHUTTLE} Order failed! Please try again."))
return
var/list/clear_turfs = list()
for(var/turf/T in area_shuttle)
- if(T.density) continue
+ if(T.density)
+ continue
var/contcount
for(var/atom/A in T.contents)
if(!A.simulated)
@@ -178,28 +179,28 @@ var/global/list/minevendor_list = list( //keep in order of price
continue
clear_turfs += T
- if(!clear_turfs.len)
- to_chat(usr, "{ERR Code: NO_SHUTTLE_SPACE} Order failed! Please try again.")
+ if(!length(clear_turfs))
+ to_chat(usr, SPAN_DANGER("{ERR Code: NO_SHUTTLE_SPACE} Order failed! Please try again."))
return
- var/i = rand(1,clear_turfs.len)
+ var/i = rand(1, length(clear_turfs))
var/turf/pickedloc = clear_turfs[i]
if(pickedloc)
inserted_id.mining_points -= prize.cost
new prize.equipment_path(pickedloc)
- to_chat(usr, "Order passed. Your order has been placed on the next available supply shuttle.")
+ to_chat(usr, SPAN_NOTICE("Order passed. Your order has been placed on the next available supply shuttle."))
else
- to_chat(usr, "{ERR Code: NO_SHUTTLE_SPACE} Order failed! Please try again.")
+ to_chat(usr, SPAN_DANGER("{ERR Code: NO_SHUTTLE_SPACE} Order failed! Please try again."))
return
else
- to_chat(usr, "{ERR Code: NO_SHUTTLE} Order failed! Please try again.")
+ to_chat(usr, SPAN_DANGER("{ERR Code: NO_SHUTTLE} Order failed! Please try again."))
return
else
inserted_id.mining_points -= prize.cost
if(prize.amount != -1)
prize.amount--
- new prize.equipment_path(src.loc)
+ new prize.equipment_path(get_turf(src))
updateUsrDialog()
return
@@ -217,4 +218,4 @@ var/global/list/minevendor_list = list( //keep in order of price
return
if(default_deconstruction_crowbar(I))
return
- return ..()
+ return ..()
\ No newline at end of file
diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm
index 60c409c514f..fffedbf6d03 100644
--- a/code/modules/mining/mine_items.dm
+++ b/code/modules/mining/mine_items.dm
@@ -1,7 +1,7 @@
/**********************Miner Lockers**************************/
/obj/structure/closet/secure_closet/miner
- name = "miner's equipment"
+ name = "shaft miner locker"
icon_state = "miningsec1"
icon_closed = "miningsec"
icon_locked = "miningsec1"
@@ -63,63 +63,62 @@
var/drill_sound = "pickaxe"
var/drill_verb = "excavating"
var/autodrill = 0 //pickaxes must be manually swung to mine, drills can mine rocks via bump
- sharp = 1
+ sharp = TRUE
- var/can_wield = 1
+ var/can_wield = TRUE
var/excavation_amount = 40
- var/wielded = 0
+ var/wielded = FALSE
var/force_unwielded = 5.0
var/force_wielded = 15.0
var/digspeed_unwielded = 30
var/digspeed_wielded = 5
- var/drilling = 0
+ var/drilling = FALSE
action_button_name = "Wield pick/drill"
/obj/item/pickaxe/proc/unwield()
- wielded = 0
+ wielded = FALSE
force = force_unwielded
digspeed = digspeed_unwielded
name = initial(name)
update_icon()
/obj/item/pickaxe/proc/wield()
- wielded = 1
+ wielded = TRUE
force = force_wielded
digspeed = digspeed_wielded
update_icon()
/obj/item/pickaxe/update_icon()
- ..()
- if(wielded)
- item_state = "[initial(icon_state)]-wielded"
- else
- item_state = initial(item_state)
- update_held_icon()
+ ..()
+ if(wielded)
+ item_state = "[initial(icon_state)]-wielded"
+ else
+ item_state = initial(item_state)
+ update_held_icon()
-/obj/item/pickaxe/mob_can_equip(M as mob, slot)
+/obj/item/pickaxe/mob_can_equip(M, slot)
//Cannot equip wielded items.
if(wielded)
- to_chat(M, "Unwield the [initial(name)] first!")
- return 0
+ to_chat(M, SPAN_WARNING("Unwield the [initial(name)] first!"))
+ return FALSE
return ..()
-/obj/item/pickaxe/dropped(mob/user as mob)
+/obj/item/pickaxe/dropped(mob/user)
//handles unwielding a twohanded weapon when dropped as well as clearing up the offhand
if(user)
var/obj/item/pickaxe/O = user.get_inactive_hand()
if(istype(O))
O.unwield()
- return unwield()
+ return unwield()
/obj/item/pickaxe/pickup(mob/user)
..()
unwield()
-/obj/item/pickaxe/attack_self(mob/user as mob)
-
+/obj/item/pickaxe/attack_self(mob/user)
..()
if(!can_wield)
@@ -128,18 +127,18 @@
if(istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/H = user
if(issmall(H))
- to_chat(user, "It's too heavy for you to wield fully.")
+ to_chat(user, SPAN_WARNING("It's too heavy for you to wield fully."))
return
else
return
if(!istype(user.get_active_hand(), src))
- to_chat(user, "You need to be holding the [name] in your active hand.")
+ to_chat(user, SPAN_WARNING("You need to be holding \the [src] in your active hand."))
return
if(wielded) //Trying to unwield it
unwield()
- to_chat(user, "You are now carrying the [initial(name)] with one hand.")
+ to_chat(user, SPAN_NOTICE("You are now carrying \the [src] with one hand."))
var/obj/item/pickaxe/offhand/O = user.get_inactive_hand()
if(O && istype(O))
@@ -147,10 +146,10 @@
else //Trying to wield it
if(user.get_inactive_hand())
- to_chat(user, "You need your other hand to be empty")
+ to_chat(user, SPAN_WARNING("Your other hand needs to be empty."))
return
wield()
- to_chat(user, "You grab the [initial(name)] with both hands.")
+ to_chat(user, SPAN_NOTICE("You grab \the [src] with both hands."))
var/obj/item/pickaxe/offhand/O = new(user) ////Let's reserve his other hand~
O.name = "[initial(name)] - offhand"
@@ -192,7 +191,7 @@
force = parent.force_wielded
/obj/item/pickaxe/offhand/unwield()
- if (ismob(loc))
+ if(ismob(loc))
var/mob/living/our_mob = loc
our_mob.remove_from_mob(src)
@@ -230,14 +229,14 @@
origin_tech = list(TECH_MATERIAL = 2, TECH_POWER = 3, TECH_ENGINEERING = 2)
desc = "Yours is the drill that will pierce through the rock walls."
drill_verb = "drilling"
- autodrill = 1
+ autodrill = TRUE
drill_sound = 'sound/weapons/drill.ogg'
digspeed = 10
digspeed_unwielded = 15
force_unwielded = 15.0
excavation_amount = 100
- can_wield = 0
+ can_wield = FALSE
force = 15.0
action_button_name = null
@@ -249,14 +248,14 @@
origin_tech = list(TECH_MATERIAL = 3, TECH_POWER = 2, TECH_ENGINEERING = 2)
desc = "Cracks rocks with sonic blasts, perfect for killing cave lizards."
drill_verb = "hammering"
- autodrill = 1
+ autodrill = TRUE
drill_sound = 'sound/weapons/sonic_jackhammer.ogg'
digspeed = 5
digspeed_unwielded = 10
force_unwielded = 15.0
excavation_amount = 100
- can_wield = 0
+ can_wield = FALSE
force = 25.0
action_button_name = null
@@ -280,7 +279,7 @@
origin_tech = list(TECH_MATERIAL = 6, TECH_ENGINEERING = 4)
desc = "A pickaxe with a diamond pick head."
excavation_amount = 50
- autodrill = 1
+ autodrill = TRUE
digspeed_unwielded = 10
digspeed_wielded = 1
force_wielded = 25.0
@@ -293,7 +292,7 @@
origin_tech = list(TECH_MATERIAL = 6, TECH_POWER = 4, TECH_ENGINEERING = 5)
desc = "Yours is the drill that will pierce the heavens!"
drill_verb = "drilling"
- autodrill = 1
+ autodrill = TRUE
drill_sound = 'sound/weapons/drill.ogg'
excavation_amount = 100
@@ -314,9 +313,9 @@
force_unwielded = 25.0
desc = ""
drill_verb = "drilling"
- autodrill = 1
+ autodrill = TRUE
drill_sound = 'sound/weapons/drill.ogg'
- can_wield = 0
+ can_wield = FALSE
force = 15.0
excavation_amount = 100
@@ -338,8 +337,8 @@
origin_tech = list(TECH_MATERIAL = 1, TECH_ENGINEERING = 1)
matter = list(DEFAULT_WALL_MATERIAL = 50)
attack_verb = list("bashed", "bludgeoned", "thrashed", "whacked")
- sharp = 0
- edge = 1
+ sharp = FALSE
+ edge = TRUE
/obj/item/shovel/spade
name = "spade"
@@ -360,7 +359,7 @@
max_amount = 5
w_class = 2
icon = 'icons/obj/mining.dmi'
- var/upright = 0
+ var/upright = FALSE
var/base_state
light_color = LIGHT_COLOR_TUNGSTEN
@@ -380,8 +379,8 @@
name = "red beacon"
icon_state = "redflag_open"
amount = 1
- upright = 1
- anchored = 1
+ upright = TRUE
+ anchored = TRUE
/obj/item/stack/flag/red/planted/Initialize()
..()
@@ -406,42 +405,41 @@
icon_state = "purpflag"
light_color = LIGHT_COLOR_PURPLE
-/obj/item/stack/flag/attackby(obj/item/W as obj, mob/user as mob)
- if(upright && istype(W,src.type))
+/obj/item/stack/flag/attackby(obj/item/W, mob/user)
+ if(upright && istype(W, src.type))
src.attack_hand(user)
else
..()
-/obj/item/stack/flag/attack_hand(user as mob)
+/obj/item/stack/flag/attack_hand(user)
if(upright)
- upright = 0
+ upright = FALSE
icon_state = base_state
- anchored = 0
+ anchored = FALSE
set_light(0)
- src.visible_message("[user] turns [src] off.")
+ src.visible_message(SPAN_NOTICE("[user] turns \the [src] off."))
else
..()
-/obj/item/stack/flag/attack_self(mob/user as mob)
-
+/obj/item/stack/flag/attack_self(mob/user)
var/obj/item/stack/flag/F = locate() in get_turf(src)
var/turf/T = get_turf(src)
if(!T || !istype(T, /turf/unsimulated/floor/asteroid))
- to_chat(user, "The beacon won't stand up in this terrain.")
+ to_chat(user, SPAN_WARNING("The beacon won't stand up in this terrain."))
return
- if(F && F.upright)
- to_chat(user, "There is already a beacon here.")
+ if(F?.upright)
+ to_chat(user, SPAN_WARNING("There is already a beacon here."))
return
var/obj/item/stack/flag/newflag = new src.type(T)
newflag.amount = 1
- newflag.upright = 1
- newflag.anchored = 1
+ newflag.upright = TRUE
+ newflag.anchored = TRUE
newflag.name = newflag.singular_name
newflag.icon_state = "[newflag.base_state]_open"
- newflag.visible_message("[user] plants [newflag] firmly in the ground.")
+ newflag.visible_message(SPAN_NOTICE("[user] plants \the [newflag] firmly in the ground."))
newflag.set_light(2)
src.use(1)
@@ -454,25 +452,25 @@
desc = "Just like your grandpappy used to lay 'em in 1862."
icon = 'icons/obj/smoothtrack.dmi'
icon_state = "track15"
- density = 0
- anchored = 1.0
+ density = FALSE
+ anchored = TRUE
w_class = 3
layer = 2.44
/obj/structure/track/Initialize()
. = ..()
- var/obj/structure/track/track = locate() in loc
- if (track && track != src)
+ var/obj/structure/track/track = locate() in get_turf(src)
+ if(track && track != src)
qdel(src)
return
updateOverlays()
- for (var/dir in cardinal)
+ for(var/dir in cardinal)
var/obj/structure/track/R = locate(/obj/structure/track, get_step(src, dir))
if(R)
R.updateOverlays()
/obj/structure/track/Destroy()
- for (var/dir in cardinal)
+ for(var/dir in cardinal)
var/obj/structure/track/R = locate(/obj/structure/track, get_step(src, dir))
if(R)
R.updateOverlays()
@@ -486,19 +484,17 @@
qdel(src)
return
-/obj/structure/track/attackby(obj/item/C as obj, mob/user as mob)
-
- if (istype(C, /obj/item/stack/tile/floor))
+/obj/structure/track/attackby(obj/item/C, mob/user)
+ if(istype(C, /obj/item/stack/tile/floor))
var/turf/T = get_turf(src)
T.attackby(C, user)
return
- if (C.iswelder())
+ if(C.iswelder())
var/obj/item/weldingtool/WT = C
if(WT.remove_fuel(0, user))
- to_chat(user, "Slicing apart connectors ...")
- new /obj/item/stack/rods(src.loc)
- qdel(src)
-
+ to_chat(user, SPAN_NOTICE("You slice apart the track."))
+ new /obj/item/stack/rods(get_turf(src))
+ qdel(src)
return
/obj/structure/track/proc/updateOverlays()
@@ -507,7 +503,7 @@
var/dir_sum = 0
- for (var/direction in cardinal)
+ for(var/direction in cardinal)
if(locate(/obj/structure/track, get_step(src, direction)))
dir_sum += direction
@@ -519,11 +515,11 @@
desc = "A ridable electric minecart designed for pulling other mine carts."
icon = 'icons/obj/cart.dmi'
icon_state = "mining_engine"
- on = 0
- powered = 1
+ on = FALSE
+ powered = TRUE
move_delay = -1
- load_item_visible = 1
+ load_item_visible = TRUE
load_offset_x = 0
mob_offset_y = 15
active_engines = 1
@@ -539,12 +535,12 @@
key = null
var/image/I = new(icon = 'icons/obj/cart.dmi', icon_state = "[icon_state]_overlay", layer = src.layer + 0.2) //over mobs
add_overlay(I)
- turn_off() //so engine verbs are correctly set
+ turn_off() //so engine verbs are correctly set
-/obj/vehicle/train/cargo/engine/mining/attackby(obj/item/W as obj, mob/user as mob)
+/obj/vehicle/train/cargo/engine/mining/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/key/minecarts))
if(!key)
- user.drop_from_inventory(W,src)
+ user.drop_from_inventory(W, src)
key = W
verbs += /obj/vehicle/train/cargo/engine/verb/remove_key
return
@@ -561,11 +557,11 @@
desc = "A modern day twist to an ancient classic."
icon = 'icons/obj/cart.dmi'
icon_state = "mining_trailer"
- anchored = 0
- passenger_allowed = 0
+ anchored = FALSE
+ passenger_allowed = FALSE
move_delay = -1
- load_item_visible = 1
+ load_item_visible = TRUE
load_offset_x = 1
load_offset_y = 15
mob_offset_y = 16
@@ -583,7 +579,7 @@
desc = "A keyring with a small steel key, and a pickaxe shaped fob."
icon = 'icons/obj/vehicles.dmi'
icon_state = "mine_keys"
- w_class = 1
+ w_class = ITEMSIZE_TINY
/**********************Pinpointer**********************/
@@ -599,37 +595,37 @@
throw_speed = 4
throw_range = 20
matter = list(DEFAULT_WALL_MATERIAL = 500)
- var/turf/simulated/mineral/random/sonar = null
+ var/turf/simulated/mineral/random/sonar
var/active = 0
/obj/item/ore_radar/attack_self(mob/user)
if(!active)
- active = 1
- to_chat(usr, "You activate the pinpointer")
+ active = TRUE
+ to_chat(user, SPAN_NOTICE("You activate the pinpointer."))
START_PROCESSING(SSfast_process, src)
else
- active = 0
+ active = FALSE
icon_state = "pinoff"
- to_chat(usr, "You deactivate the pinpointer")
+ to_chat(user, SPAN_NOTICE("You deactivate the pinpointer."))
STOP_PROCESSING(SSfast_process, src)
/obj/item/ore_radar/process()
- if (active)
+ if(active)
workdisk()
else
STOP_PROCESSING(SSfast_process, src)
/obj/item/ore_radar/proc/workdisk()
if(!src.loc)
- active = 0
+ active = FALSE
if(!active)
return
var/closest = 15
- for(var/turf/simulated/mineral/random/R in orange(14,loc))
+ for(var/turf/simulated/mineral/random/R in orange(14, loc))
if(!R.mineral)
continue
var/dist = get_dist(loc, R)
@@ -656,7 +652,7 @@
/obj/item/device/wormhole_jaunter
name = "wormhole jaunter"
desc = "A single use device harnessing outdated warp technology. The wormholes it creates are unpleasant to travel through, to say the least."
- contained_sprite = 1
+ contained_sprite = TRUE
icon = 'icons/obj/mining_contained.dmi'
icon_state = "jaunter"
item_state = "jaunter"
@@ -668,14 +664,14 @@
origin_tech = list(TECH_BLUESPACE = 2, TECH_PHORON = 4, TECH_ENGINEERING = 4)
/obj/item/device/wormhole_jaunter/attack_self(mob/user)
- user.visible_message("[user.name] activates the [src.name]!")
+ user.visible_message(SPAN_NOTICE("\The [user] activates \the [src]!"))
feedback_add_details("jaunter", "U") // user activated
activate(user)
/obj/item/device/wormhole_jaunter/proc/turf_check(mob/user)
var/turf/device_turf = get_turf(user)
- if(!device_turf||device_turf.z==0)
- to_chat(user, "You're having difficulties getting the [src.name] to work.")
+ if(!device_turf || device_turf.z == 0)
+ to_chat(user, SPAN_NOTICE("You're having difficulties getting \the [src] to work."))
return FALSE
return TRUE
@@ -694,13 +690,13 @@
return
var/list/L = get_destinations(user)
- if(!L.len)
- to_chat(user, "The [src.name] found no beacons in the world to anchor a wormhole to.")
+ if(!length(L))
+ to_chat(user, SPAN_NOTICE("\The [src] found no beacons in the world to anchor a wormhole to."))
return
var/chosen_beacon = pick(L)
- var/obj/effect/portal/wormhole/jaunt_tunnel/J = new /obj/effect/portal/wormhole/jaunt_tunnel(get_turf(src), chosen_beacon, lifespan=100)
+ var/obj/effect/portal/wormhole/jaunt_tunnel/J = new /obj/effect/portal/wormhole/jaunt_tunnel(get_turf(src), chosen_beacon, lifespan = 100)
J.target = chosen_beacon
- playsound(src,'sound/effects/sparks4.ogg',50,1)
+ playsound(src,'sound/effects/sparks4.ogg', 50, 1)
qdel(src)
/obj/item/device/wormhole_jaunter/emp_act(power)
@@ -711,8 +707,8 @@
triggered = TRUE
if(triggered)
- usr.visible_message("The [src] overloads and activates!")
- feedback_add_details("jaunter","E") // EMP accidental activation
+ usr.visible_message(SPAN_WARNING("\The [src] overloads and activates!"))
+ feedback_add_details("jaunter", "E") // EMP accidental activation
activate(usr)
/obj/effect/portal/wormhole/jaunt_tunnel
@@ -724,10 +720,10 @@
/obj/effect/portal/wormhole/jaunt_tunnel/teleport(atom/movable/M)
if(M.anchored || istype(M, /obj/effect))
return
- single_spark(M.loc)
+ single_spark(get_turf(M))
if(istype(M))
if(do_teleport(M, target, 6))
- single_spark(M.loc)
+ single_spark(get_turf(M))
playsound(M,'sound/weapons/resonator_blast.ogg',50,1)
if(iscarbon(M))
var/mob/living/carbon/L = M
@@ -748,8 +744,8 @@
w_class = 2
throw_speed = 3
throw_range = 5
- var/loaded = 1
- var/malfunctioning = 0
+ var/loaded = TRUE
+ var/malfunctioning = FALSE
var/revive_type = TYPE_ORGANIC //So you can't revive boss monsters or robots with it
origin_tech = list(TECH_BIO = 7, TECH_MATERIAL = 4)
@@ -760,35 +756,35 @@
if(istype(target, /mob/living/simple_animal))
var/mob/living/simple_animal/M = target
if(!(M.find_type() & revive_type))
- to_chat(user, "[src] does not work on this sort of creature.")
+ to_chat(user, span("info", "\The [src] does not work on this sort of creature."))
return
if(M.stat == DEAD)
if(!malfunctioning)
M.faction = "neutral"
M.revive()
M.icon_state = M.icon_living
- loaded = 0
- user.visible_message("[user] injects [M] with [src], reviving it.")
+ loaded = FALSE
+ user.visible_message(SPAN_NOTICE("\The [user] injects \the [M] with \the [src], reviving it."))
feedback_add_details("lazarus_injector", "[M.type]")
- playsound(src,'sound/effects/refill.ogg',50,1)
+ playsound(src, 'sound/effects/refill.ogg', 50, TRUE)
return
else
- to_chat(user, "[src] is only effective on the dead.")
+ to_chat(user, span("info", "\The [src] is only effective on the dead."))
return
else
- to_chat(user, "[src] is only effective on lesser beings.")
+ to_chat(user, span("info", "\The [src] is only effective on lesser beings."))
return
/obj/item/lazarus_injector/emp_act()
if(!malfunctioning)
- malfunctioning = 1
+ malfunctioning = TRUE
/obj/item/lazarus_injector/examine(mob/user)
..()
if(!loaded)
- to_chat(user, "[src] is empty.")
+ to_chat(user, span("info", "\The [src] is empty."))
if(malfunctioning)
- to_chat(user, "The display on [src] seems to be flickering.")
+ to_chat(user, span("info", "The display on \the [src] seems to be flickering."))
/**********************Point Transfer Card**********************/
@@ -803,15 +799,15 @@
if(points)
var/obj/item/card/id/C = I
C.mining_points += points
- to_chat(user, "You transfer [points] points to [C].")
+ to_chat(user, span("info", "You transfer [points] points to \the [C]."))
points = 0
else
- to_chat(user, "There's no points left on [src].")
+ to_chat(user, span("info", "There's no points left on \the [src]."))
..()
/obj/item/card/mining_point_card/examine(mob/user)
..()
- to_chat(user, "There's [points] point\s on the card.")
+ to_chat(user, SPAN_NOTICE("There's [points] point\s on the card."))
/**********************"Fultons"**********************/
@@ -820,7 +816,7 @@ var/list/total_extraction_beacons = list()
/obj/item/extraction_pack
name = "warp extraction pack"
desc = "A complex device that warps nonliving matter to nearby locations."
- contained_sprite = 1
+ contained_sprite = TRUE
icon = 'icons/obj/mining_contained.dmi'
icon_state = "fulton"
w_class = 3
@@ -829,9 +825,9 @@ var/list/total_extraction_beacons = list()
var/uses_left = 3
origin_tech = list(TECH_BLUESPACE = 3, TECH_PHORON = 4, TECH_ENGINEERING = 4)
-/obj/item/extraction_pack/examine()
+/obj/item/extraction_pack/examine(mob/user)
. = ..()
- usr.show_message("It has [uses_left] uses remaining.", 1)
+ to_chat(user, SPAN_NOTICE("It has [uses_left] uses remaining."))
/obj/item/extraction_pack/attack_self(mob/user)
var/list/possible_beacons = list()
@@ -840,50 +836,48 @@ var/list/total_extraction_beacons = list()
if(EP.beacon_network in beacon_networks)
possible_beacons += EP
- if(!possible_beacons.len)
- to_chat(user, "There are no extraction beacons in existence!")
+ if(!length(possible_beacons))
+ to_chat(user, SPAN_NOTICE("There are no extraction beacons in existence!"))
return
else
- var/A
-
- A = input("Select a beacon to connect to", "Warp Extraction Pack", A) in possible_beacons
-
+ var/A = input(user, "Select a beacon to connect to", "Warp Extraction Pack") in possible_beacons
if(!A)
return
beacon = A
/obj/item/extraction_pack/afterattack(atom/movable/A, mob/living/carbon/human/user)
if(!beacon)
- to_chat(user, "[src] is not linked to a beacon, and cannot be used.")
+ to_chat(user, "\The [src] is not linked to a beacon, and cannot be used.")
return
if(!istype(A))
return
else
- if(istype(A,/mob/living))
- to_chat(user, "[src] is not safe for use with living creatures, they wouldn't survive the trip back!")
+ if(istype(A, /mob/living))
+ to_chat(user, SPAN_WARNING("\The [src] is not safe for use with living creatures, they wouldn't survive the trip back!"))
return
if(A.loc == user) // no extracting stuff you're holding
return
if(A.anchored)
return
- to_chat(user, "You start attaching the pack to [A]...")
+ to_chat(user, SPAN_NOTICE("You start attaching the pack to \the [A]..."))
if(do_after(user,50))
- to_chat(user, "You attach the pack to [A] and activate it.")
+ to_chat(user, SPAN_NOTICE("You attach the pack to \the [A] and activate it."))
uses_left--
if(uses_left <= 0)
user.drop_item(src)
- loc = A
- single_spark(A.loc)
+ single_spark(get_turf(A))
var/list/flooring_near_beacon = list()
for(var/turf/simulated/floor/floor in orange(1, beacon))
flooring_near_beacon += floor
- A.forceMove(pick(flooring_near_beacon))
- single_spark(A.loc)
+ if(length(flooring_near_beacon))
+ A.forceMove(pick(flooring_near_beacon))
+ else
+ A.forceMove(get_turf(beacon))
+ single_spark(get_turf(A))
if(uses_left <= 0)
qdel(src)
-
/obj/item/warp_core
name = "warp extraction beacon signaller"
desc = "Emits a signal which Warp-Item recovery devices can lock onto. Activate in hand to create a beacon."
@@ -892,8 +886,9 @@ var/list/total_extraction_beacons = list()
origin_tech = list(TECH_BLUESPACE = 1, TECH_PHORON = 1, TECH_ENGINEERING = 2)
/obj/item/warp_core/attack_self(mob/user)
- to_chat(user, "You start placing down the beacon. . .")
- if(do_after(user,15))
+ to_chat(user, SPAN_NOTICE("You start placing down the beacon..."))
+ if(do_after(user, 15))
+ to_chat(user, SPAN_NOTICE("You successfully deploy the beacon."))
new /obj/structure/extraction_point(get_turf(user))
qdel(src)
@@ -902,11 +897,12 @@ var/list/total_extraction_beacons = list()
desc = "A beacon for the Warp-Item recovery system. Hit a beacon with a pack to link the pack to a beacon."
icon = 'icons/obj/mining.dmi'
icon_state = "extraction_point"
- anchored = 1
- density = 0
+ anchored = TRUE
+ density = FALSE
var/beacon_network = "station"
-/obj/structure/extraction_point/New()
+/obj/structure/extraction_point/Initialize()
+ . = ..()
var/area/area_name = get_area(src)
name += " ([rand(100,999)]) ([area_name.name])"
total_extraction_beacons += src
@@ -920,12 +916,12 @@ var/list/total_extraction_beacons = list()
/obj/item/resonator
name = "resonator"
- contained_sprite = 1
+ contained_sprite = TRUE
icon = 'icons/obj/mining_contained.dmi'
icon_state = "resonator"
item_state = "resonator"
desc = "A handheld device that creates small fields of energy that resonate until they detonate, crushing rock. It can also be activated without a target to create a field at the user's location, to act as a delayed time trap. It's more effective in a vacuum."
- w_class = 3
+ w_class = ITEMSIZE_NORMAL
force = 15
throwforce = 10
var/burst_time = 30
@@ -952,17 +948,17 @@ var/list/total_extraction_beacons = list()
R.burst(T)
return
if(fields.len < fieldlimit)
- playsound(src,'sound/weapons/resonator_fire.ogg',50,1)
+ playsound(src, 'sound/weapons/resonator_fire.ogg', 50, TRUE)
var/obj/effect/resonance/RE = new /obj/effect/resonance(T, creator, burst_time, src)
fields += RE
/obj/item/resonator/attack_self(mob/user)
if(burst_time == 50)
burst_time = 30
- to_chat(user, "You set the resonator's fields to detonate after 3 seconds.")
+ to_chat(user, span("info", "You set the resonator's fields to detonate after 3 seconds."))
else
burst_time = 50
- to_chat(user, "You set the resonator's fields to detonate after 5 seconds.")
+ to_chat(user, span("info", "You set the resonator's fields to detonate after 5 seconds."))
/obj/item/resonator/afterattack(atom/target, mob/user, proximity_flag)
..()
@@ -1010,7 +1006,7 @@ var/list/total_extraction_beacons = list()
for(var/mob/living/L in T)
if(creator)
add_logs(creator, L, "used a resonator field on", "resonator")
- to_chat(L, "The [src.name] ruptured with you in it!")
+ to_chat(L, SPAN_DANGER("\The [src] ruptured with you in it!"))
L.apply_damage(resonance_damage, BRUTE)
qdel(src)
@@ -1018,7 +1014,7 @@ var/list/total_extraction_beacons = list()
/******************************Ore Magnet*******************************/
/obj/item/oremagnet
name = "ore magnet"
- contained_sprite = 1
+ contained_sprite = TRUE
icon = 'icons/obj/mining_contained.dmi'
icon_state = "magneto"
item_state = "magneto"
@@ -1029,26 +1025,23 @@ var/list/total_extraction_beacons = list()
origin_tech = list(TECH_MAGNET = 4, TECH_ENGINEERING = 3)
/obj/item/oremagnet/attack_self(mob/user)
- if (use_check_and_message(user))
+ if(use_check_and_message(user))
return
-
toggle_on(user)
/obj/item/oremagnet/process()
for(var/obj/item/ore/O in oview(7, loc))
if(prob(80))
- step_to(O, src.loc, 0)
-
- if (TICK_CHECK)
+ step_to(O, get_turf(src), 0)
+ if(TICK_CHECK)
return
/obj/item/oremagnet/proc/toggle_on(mob/user)
- if (!isprocessing)
+ if(!isprocessing)
START_PROCESSING(SSprocessing, src)
else
STOP_PROCESSING(SSprocessing, src)
-
- if (user)
+ if(user)
to_chat(user, "You switch [isprocessing ? "on" : "off"] [src].")
/obj/item/oremagnet/Destroy()
@@ -1059,7 +1052,7 @@ var/list/total_extraction_beacons = list()
/obj/item/oreportal
name = "ore summoner"
- contained_sprite = 1
+ contained_sprite = TRUE
icon = 'icons/obj/mining_contained.dmi'
icon_state = "supermagneto"
item_state = "jaunter"
@@ -1072,19 +1065,19 @@ var/list/total_extraction_beacons = list()
/obj/item/oreportal/attack_self(mob/user)
if(world.time - last_oresummon_time >= 25)
- to_chat(user, "You pulse the ore summoner.")
+ to_chat(user, SPAN_NOTICE("You pulse the ore summoner."))
last_oresummon_time = world.time
var/limit = 50
- for(var/obj/item/ore/O in orange(7,user))
+ for(var/obj/item/ore/O in orange(7, user))
if(limit <= 0)
break
- single_spark(O.loc)
+ single_spark(get_turf(O))
do_teleport(O, user, 0)
limit -= 1
CHECK_TICK
else
- to_chat(user, "The ore summoner is in the middle of some calibrations.")
- return 0
+ to_chat(user, SPAN_NOTICE("The ore summoner is in the middle of some calibrations."))
+ return FALSE
/******************************Sculpting*******************************/
/obj/item/autochisel
@@ -1102,9 +1095,9 @@ var/list/total_extraction_beacons = list()
icon_state = "sculpting_block"
density = TRUE
opacity = TRUE
- anchored = 0
+ anchored = FALSE
obj_flags = OBJ_FLAG_ROTATABLE
- var/sculpted = 0
+ var/sculpted = FALSE
var/mob/living/T
var/times_carved = 0
var/last_struck = 0
@@ -1116,38 +1109,39 @@ var/list/total_extraction_beacons = list()
to_chat(user, "You [anchored ? "un" : ""]anchor the [name].")
anchored = !anchored
- if (istype(C, /obj/item/autochisel))
+ if(istype(C, /obj/item/autochisel))
if(!sculpted)
if(last_struck)
return
-
if(!T)
var/list/choices = list()
for(var/mob/living/M in view(7,user))
choices += M
T = input(user,"Who do you wish to sculpt?") as null|anything in choices
- user.visible_message("[user] begins sculpting.",
- "You begin sculpting.")
+ if(!T)
+ to_chat(user, SPAN_NOTICE("You decide against sculpting for now."))
+ user.visible_message(SPAN_NOTICE("\The [user] begins sculpting."),
+ SPAN_NOTICE("You begin sculpting."))
var/sculpting_coefficient = get_dist(user,T)
if(sculpting_coefficient <= 0)
sculpting_coefficient = 1
if(sculpting_coefficient >= 7)
- to_chat(user, "You hardly remember what [T] really looks like! Bah!")
+ to_chat(user, SPAN_WARNING("You hardly remember what \the [T] really looks like! Bah!"))
T = null
- user.visible_message("[user] carves away at the sculpting block!",
- "You continue sculpting.")
+ user.visible_message(SPAN_NOTICE("\The [user] carves away at the sculpting block!"),
+ SPAN_NOTICE("You continue sculpting."))
if(prob(25))
- playsound(user, 'sound/items/Screwdriver.ogg', 20, 1)
+ playsound(user, 'sound/items/Screwdriver.ogg', 20, TRUE)
else
- playsound(user, "sound/weapons/chisel[rand(1,2)].ogg", 20, 1)
+ playsound(user, "sound/weapons/chisel[rand(1,2)].ogg", 20, TRUE)
spawn(3)
- playsound(user, "sound/weapons/chisel[rand(1,2)].ogg", 20, 1)
+ playsound(user, "sound/weapons/chisel[rand(1,2)].ogg", 20, TRUE)
spawn(3)
- playsound(user, "sound/weapons/chisel[rand(1,2)].ogg", 20, 1)
+ playsound(user, "sound/weapons/chisel[rand(1,2)].ogg", 20, TRUE)
last_struck = 1
if(do_after(user,(20)))
@@ -1155,12 +1149,12 @@ var/list/total_extraction_beacons = list()
if(times_carved <= 9)
times_carved += 1
if(times_carved < 1)
- to_chat(user, "You review your work and see there is more to do.")
+ to_chat(user, SPAN_NOTICE("You review your work and see there is more to do."))
return
else
- sculpted = 1
- user.visible_message("[user] finishes sculpting their magnum opus!",
- "You finish sculpting a masterpiece.")
+ sculpted = TRUE
+ user.visible_message(SPAN_NOTICE("\The [user] finishes sculpting their magnum opus!"),
+ SPAN_NOTICE("You finish sculpting a masterpiece."))
src.appearance = T
src.color = list(
0.35, 0.3, 0.25,
@@ -1193,7 +1187,7 @@ var/list/total_extraction_beacons = list()
desc = "A punching bag. Better this than the Quartermaster."
icon = 'icons/obj/mining.dmi'
icon_state = "punchingbag"
- anchored = 1
+ anchored = TRUE
layer = 5.1
var/list/hit_sounds = list('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg',\
'sound/weapons/punch1.ogg', 'sound/weapons/punch2.ogg', 'sound/weapons/punch3.ogg', 'sound/weapons/punch4.ogg')
@@ -1201,15 +1195,15 @@ var/list/total_extraction_beacons = list()
/obj/structure/punching_bag/attack_hand(mob/user as mob)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
flick("[icon_state]2", src)
- playsound(src.loc, pick(src.hit_sounds), 25, 1, -1)
+ playsound(get_turf(src), pick(src.hit_sounds), 25, 1, -1)
/obj/structure/weightlifter
- name = "Weight Machine"
+ name = "weight machine"
desc = "Just looking at this thing makes you feel tired."
icon = 'icons/obj/mining.dmi'
icon_state = "fitnessweight"
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
/obj/structure/weightlifter/attack_hand(var/mob/living/carbon/human/user)
if(!istype(user))
@@ -1218,7 +1212,7 @@ var/list/total_extraction_beacons = list()
to_chat(user, "It's already in use - wait a bit.")
return
else
- in_use = 1
+ in_use = TRUE
icon_state = "fitnessweight-c"
user.dir = SOUTH
user.Stun(4)
@@ -1227,7 +1221,7 @@ var/list/total_extraction_beacons = list()
W.layer = 5.1
add_overlay(W)
var/bragmessage = pick("pushing it to the limit","going into overdrive","burning with determination","rising up to the challenge", "getting strong now","getting ripped")
- user.visible_message("[user] is [bragmessage]!")
+ user.visible_message(SPAN_NOTICE("[user] is [bragmessage]!"))
var/reps = 0
user.pixel_y = 5
while (reps++ < 6)
@@ -1249,7 +1243,7 @@ var/list/total_extraction_beacons = list()
var/finishmessage = pick("You feel stronger!","You feel like you can take on the world!","You feel robust!","You feel indestructible!")
icon_state = "fitnessweight"
cut_overlay(W)
- to_chat(user, "[finishmessage]")
+ to_chat(user, SPAN_NOTICE("[finishmessage]"))
user.adjustNutritionLoss(5)
user.adjustHydrationLoss(5)
diff --git a/code/modules/mining/mine_turf_types.dm b/code/modules/mining/mine_turf_types.dm
index bfce11da8ac..c35f9ad1723 100644
--- a/code/modules/mining/mine_turf_types.dm
+++ b/code/modules/mining/mine_turf_types.dm
@@ -1,13 +1,13 @@
// These are pricey, but damn do they look nice.
/turf/simulated/lava
+ name = "lava"
+ desc = "Toasty."
icon = 'icons/turf/smooth/lava.dmi'
icon_state = "smooth"
gender = PLURAL
smooth = SMOOTH_TRUE | SMOOTH_BORDER
light_color = LIGHT_COLOR_LAVA
light_range = 2
- name = "lava"
- desc = "Toasty."
canSmoothWith = list(
/turf/simulated/lava,
/turf/simulated/mineral
@@ -19,7 +19,7 @@
/turf/simulated/lava/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
underlay_appearance.icon = 'icons/turf/basalt.dmi'
underlay_appearance.icon_state = "basalt"
- if (prob(20))
+ if(prob(20))
underlay_appearance.icon_state += "[rand(0,12)]"
return TRUE
@@ -27,25 +27,25 @@
if(istype(AM, /mob/living))
var/mob/living/L = AM
if(locate(/obj/structure/lattice/catwalk, src)) //should be safe to walk upon
- return 1
+ return TRUE
if(!istype(oldloc,/turf/simulated/lava))
- to_chat(L, "You are covered by fire and heat from entering \the [src]!")
+ to_chat(L, SPAN_WARNING("You are covered by fire and heat from entering \the [src]!"))
if(isanimal(L))
var/mob/living/simple_animal/H = L
if(H.flying) //flying mobs will ignore the lava
- return 1
+ return TRUE
else
L.bodytemperature = min(L.bodytemperature + 150, 1000)
else
L.IgniteMob(15)
- return 1
+ return TRUE
..()
/turf/simulated/lava/Exited(atom/movable/AM, atom/newloc)
if(istype(AM, /mob/living))
var/mob/living/L = AM
if(!istype(newloc, /turf/simulated/lava))
- to_chat(L, "You climb out of \the [src].")
+ to_chat(L, SPAN_WARNING("You climb out of \the [src]."))
..()
// Special asteroid variant that goes with lava better.
diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm
index 8078fa8d359..638b6e12b0c 100644
--- a/code/modules/mining/mine_turfs.dm
+++ b/code/modules/mining/mine_turfs.dm
@@ -3,10 +3,10 @@
name = "impassable rock"
icon = 'icons/turf/walls.dmi'
icon_state = "rock-dark"
- blocks_air = 1
- density = 1
+ blocks_air = TRUE
+ density = TRUE
gender = PLURAL
- opacity = 1
+ opacity = TRUE
// This is a global list so we can share the same list with all mineral turfs; it's the same for all of them anyways.
var/list/mineral_can_smooth_with = list(
@@ -34,9 +34,9 @@ var/list/mineral_can_smooth_with = list(
oxygen = 0
nitrogen = 0
- opacity = 1
- density = 1
- blocks_air = 1
+ opacity = TRUE
+ density = TRUE
+ blocks_air = TRUE
temperature = T0C
var/mined_turf = /turf/unsimulated/floor/asteroid/ash/rocky
var/ore/mineral
@@ -55,7 +55,7 @@ var/list/mineral_can_smooth_with = list(
var/rock_health = 20 //10 to 20, in initialize
- has_resources = 1
+ has_resources = TRUE
/turf/simulated/mineral/proc/kinetic_hit(var/damage,var/direction)
@@ -70,10 +70,10 @@ var/list/mineral_can_smooth_with = list(
// Copypaste parent call for performance.
/turf/simulated/mineral/Initialize(mapload)
- if (initialized)
+ if(initialized)
crash_with("Warning: [src]([type]) initialized multiple times!")
- if (icon != actual_icon)
+ if(icon != actual_icon)
icon = actual_icon
initialized = TRUE
@@ -87,13 +87,13 @@ var/list/mineral_can_smooth_with = list(
has_opaque_atom = TRUE
- if (smooth)
+ if(smooth)
canSmoothWith = mineral_can_smooth_with
pixel_x = -4
pixel_y = -4
queue_smooth(src)
- if (!mapload)
+ if(!mapload)
queue_smooth_neighbors(src)
rock_health = rand(10,20)
@@ -105,22 +105,22 @@ var/list/mineral_can_smooth_with = list(
if(mineral)
switch(mined_ore)
if(0)
- to_chat(user, "It is ripe with [mineral.display_name].")
+ to_chat(user, span("info", "It is ripe with [mineral.display_name]."))
if(1)
- to_chat(user, "Its [mineral.display_name] looks a little depleted.")
+ to_chat(user, span("info", "Its [mineral.display_name] looks a little depleted."))
if(2)
- to_chat(user, "Its [mineral.display_name] looks very depleted!")
+ to_chat(user, span("info", "Its [mineral.display_name] looks very depleted!"))
else
- to_chat(user, "It is devoid of any valuable minerals.")
+ to_chat(user, span("info", "It is devoid of any valuable minerals."))
switch(emitter_blasts_taken)
if(0)
- to_chat(user, "It is in pristine condition.")
+ to_chat(user, span("info", "It is in pristine condition."))
if(1)
- to_chat(user, "It appears a little damaged.")
+ to_chat(user, span("info", "It appears a little damaged."))
if(2)
- to_chat(user, "It is crumbling!")
+ to_chat(user, span("info", "It is crumbling!"))
if(3)
- to_chat(user, "It looks ready to collapse at any moment!")
+ to_chat(user, span("info", "It looks ready to collapse at any moment!"))
/turf/simulated/mineral/ex_act(severity)
switch(severity)
@@ -135,7 +135,6 @@ var/list/mineral_can_smooth_with = list(
GetDrilled()
/turf/simulated/mineral/bullet_act(var/obj/item/projectile/Proj)
-
// Emitter blasts
if(istype(Proj, /obj/item/projectile/beam/emitter))
emitter_blasts_taken++
@@ -168,7 +167,7 @@ var/list/mineral_can_smooth_with = list(
icon = 'icons/turf/map_placeholders.dmi'
icon_state = "rock"
desc = "It's a greyish rock. Exciting."
- opacity = 1
+ opacity = TRUE
var/icon/actual_icon = 'icons/turf/smooth/rock_wall.dmi'
layer = 2.01
var/list/asteroid_can_smooth_with = list(
@@ -179,10 +178,10 @@ var/list/mineral_can_smooth_with = list(
smoothing_hints = SMOOTHHINT_CUT_F | SMOOTHHINT_ONLY_MATCH_TURF | SMOOTHHINT_TARGETS_NOT_UNIQUE
/turf/unsimulated/mineral/asteroid/Initialize(mapload)
- if (initialized)
+ if(initialized)
crash_with("Warning: [src]([type]) initialized multiple times!")
- if (icon != actual_icon)
+ if(icon != actual_icon)
icon = actual_icon
initialized = TRUE
@@ -196,13 +195,13 @@ var/list/mineral_can_smooth_with = list(
has_opaque_atom = TRUE
- if (smooth)
+ if(smooth)
canSmoothWith = asteroid_can_smooth_with
pixel_x = -4
pixel_y = -4
queue_smooth(src)
- if (!mapload)
+ if(!mapload)
queue_smooth_neighbors(src)
return INITIALIZE_HINT_NORMAL
@@ -235,61 +234,57 @@ var/list/mineral_can_smooth_with = list(
name = "\improper [mineral.display_name] deposit"
new /obj/effect/mineral(src, mineral)
-//Not even going to touch this pile of spaghetti
-/turf/simulated/mineral/attackby(obj/item/W as obj, mob/user as mob)
-
- if (!usr.IsAdvancedToolUser())
- to_chat(usr, "You don't have the dexterity to do this!")
+//Not even going to touch this pile of spaghetti //motherfucker - geeves
+/turf/simulated/mineral/attackby(obj/item/W, mob/user)
+ if(!user.IsAdvancedToolUser())
+ to_chat(user, SPAN_WARNING("You don't have the dexterity to do this!"))
return
- if (istype(W, /obj/item/device/core_sampler))
- geologic_data.UpdateNearbyArtifactInfo(src)
+ if(istype(W, /obj/item/device/core_sampler))
+ geologic_data.UpdateNearbyArtifactInfo(src) // good god
var/obj/item/device/core_sampler/C = W
C.sample_item(src, user)
return
- if (istype(W, /obj/item/device/depth_scanner))
+ if(istype(W, /obj/item/device/depth_scanner))
var/obj/item/device/depth_scanner/C = W
C.scan_atom(user, src)
return
- if (istype(W, /obj/item/device/measuring_tape))
+ if(istype(W, /obj/item/device/measuring_tape))
var/obj/item/device/measuring_tape/P = W
- user.visible_message("[user] extends [P] towards [src].","You extend [P] towards [src].")
+ user.visible_message(SPAN_NOTICE("\The [user] extends \the [P] towards \the [src].") , SPAN_NOTICE("You extend \the [P] towards \the [src]."))
if(do_after(user,25))
- if (!istype(src, /turf/simulated/mineral))
+ if(!istype(src, /turf/simulated/mineral))
return
-
- to_chat(user, "\icon[P] [src] has been excavated to a depth of [2*excavation_level]cm.")
+ to_chat(user, SPAN_NOTICE("\icon[P] \The [src] has been excavated to a depth of [2 * excavation_level]cm."))
return
- if (istype(W, /obj/item/pickaxe) && W.simulated) // Pickaxe offhand is not simulated.
+ if(istype(W, /obj/item/pickaxe) && W.simulated) // Pickaxe offhand is not simulated.
var/turf/T = user.loc
- if (!( istype(T, /turf) ))
+ if(!(istype(T, /turf)))
return
-
var/obj/item/pickaxe/P = W
if(last_act + P.digspeed > world.time)//prevents message spam
return
-
if(P.drilling)
return
last_act = world.time
- playsound(user, P.drill_sound, 20, 1)
- P.drilling = 1
+ playsound(user, P.drill_sound, 20, TRUE)
+ P.drilling = TRUE
//handle any archaeological finds we might uncover
var/fail_message
- if(finds && finds.len)
+ if(finds?.len)
var/datum/find/F = finds[1]
if(excavation_level + P.excavation_amount > F.excavation_required)
//Chance to destroy / extract any finds here
fail_message = ". [pick("There is a crunching noise","[W] collides with some different rock","Part of the rock face crumbles away","Something breaks under [W]")]"
if(fail_message)
- to_chat(user, "You start [P.drill_verb][fail_message ? fail_message : ""].")
+ to_chat(user, SPAN_WARNING("You start [P.drill_verb][fail_message ? fail_message : ""]."))
if(fail_message && prob(90))
if(prob(25))
@@ -300,15 +295,15 @@ var/list/mineral_can_smooth_with = list(
artifact_debris()
if(do_after(user,P.digspeed))
- if (!istype(src, /turf/simulated/mineral))
+ if(!istype(src, /turf/simulated/mineral))
return
- P.drilling = 0
+ P.drilling = FALSE
if(prob(50))
var/obj/item/ore/O
if(prob(25) && (mineral) && (P.excavation_amount >= 30))
- O = new mineral.ore (src)
+ O = new mineral.ore(src)
else
O = new /obj/item/ore(src)
if(istype(O))
@@ -316,7 +311,7 @@ var/list/mineral_can_smooth_with = list(
O.geologic_data = geologic_data
addtimer(CALLBACK(O, /atom/movable/.proc/forceMove, user.loc), 1)
- if(finds && finds.len)
+ if(finds?.len)
var/datum/find/F = finds[1]
if(round(excavation_level + P.excavation_amount) == F.excavation_required)
//Chance to extract any items here perfectly, otherwise just pull them out along with the rock surrounding them
@@ -330,11 +325,11 @@ var/list/mineral_can_smooth_with = list(
//just pull the surrounding rock out
excavate_find(0, F)
- if( excavation_level + P.excavation_amount >= 100 )
+ if(excavation_level + P.excavation_amount >= 100)
//if players have been excavating this turf, leave some rocky debris behind
var/obj/structure/boulder/B
if(artifact_find)
- if( excavation_level > 0 || prob(15) )
+ if(excavation_level > 0 || prob(15))
//boulder with an artifact inside
B = new(src)
if(artifact_find)
@@ -353,37 +348,29 @@ var/list/mineral_can_smooth_with = list(
excavation_level += P.excavation_amount
- //archaeo overlays
- /*if(!archaeo_overlay && finds && finds.len)
- var/datum/find/F = finds[1]
- if(F.excavation_required <= excavation_level + F.view_range)
- archaeo_overlay = "overlay_archaeo[rand(1,3)]"
- add_overlay(archaeo_overlay)*/
-
else
- to_chat(user, " You stop [P.drill_verb] [src].")
- P.drilling = 0
-
- if (istype(W, /obj/item/autochisel))
+ to_chat(user, SPAN_NOTICE("You stop [P.drill_verb] \the [src]."))
+ P.drilling = FALSE
+ if(istype(W, /obj/item/autochisel))
if(last_act + 80 > world.time)//prevents message spam
return
last_act = world.time
- to_chat(user, "You start chiselling [src] into a sculptable block.")
+ to_chat(user, SPAN_NOTICE("You start chiselling \the [src] into a sculptable block."))
- if(!do_after(user,80/W.toolspeed))
+ if(!do_after(user, 80 / W.toolspeed))
return
- if (!istype(src, /turf/simulated/mineral))
+ if(!istype(src, /turf/simulated/mineral))
return
- to_chat(user, "You finish chiselling [src] into a sculptable block.")
+ to_chat(user, SPAN_NOTICE("You finish chiselling [src] into a sculptable block."))
new /obj/structure/sculpting_block(src)
GetDrilled(1)
/turf/simulated/mineral/proc/clear_ore_effects()
- if (my_mineral)
+ if(my_mineral)
qdel(my_mineral)
/turf/simulated/mineral/proc/DropMineral()
@@ -391,45 +378,23 @@ var/list/mineral_can_smooth_with = list(
return
clear_ore_effects()
- var/obj/item/ore/O = new mineral.ore (src)
+ var/obj/item/ore/O = new mineral.ore(src)
if(istype(O))
- geologic_data.UpdateNearbyArtifactInfo(src)
+ geologic_data.UpdateNearbyArtifactInfo(src) //whoever named this proc must be shot - geeves
O.geologic_data = geologic_data
return O
/turf/simulated/mineral/proc/GetDrilled(var/artifact_fail = 0)
- //var/destroyed = 0 //used for breaking strange rocks
- if (mineral && mineral.result_amount)
-
+ if(mineral?.result_amount)
//if the turf has already been excavated, some of it's ore has been removed
- for (var/i = 1 to mineral.result_amount - mined_ore)
+ for(var/i = 1 to mineral.result_amount - mined_ore)
DropMineral()
- //destroyed artifacts have weird, unpleasant effects
- //make sure to destroy them before changing the turf though
- if(artifact_find && artifact_fail)
- var/pain = 0
- if(prob(50))
- pain = 1
- for(var/mob/living/M in range(src, 200))
- to_chat(M, "[pick("A high pitched [pick("keening","wailing","whistle")]","A rumbling noise like [pick("thunder","heavy machinery")]")] somehow penetrates your mind before fading away!")
- if(pain)
- flick("pain",M.pain)
- if(prob(50))
- M.adjustBruteLoss(5)
- else
- flick("flash",M.flash)
- if(prob(50))
- M.Stun(5)
- M.apply_effect(25, IRRADIATE, blocked = M.getarmor(null, "rad"))
- if(prob(3))
- excavate_find(prob(5), finds[1])
-
- //Add some rubble, you did just clear out a big chunk of rock.
+ //Add some rubble, you did just clear out a big chunk of rock.
ChangeTurf(mined_turf)
if(rand(1,500) == 1)
- visible_message("An old dusty crate was buried within!")
+ visible_message(SPAN_NOTICE("An old dusty crate was buried within!"))
new /obj/structure/closet/crate/secure/loot(src)
/turf/simulated/mineral/proc/excavate_find(var/prob_clean = 0, var/datum/find/F)
@@ -440,11 +405,11 @@ var/list/mineral_can_smooth_with = list(
X = new /obj/item/archaeological_find(src, new_item_type = F.find_type)
else
X = new /obj/item/ore/strangerock(src, inside_item_type = F.find_type)
- geologic_data.UpdateNearbyArtifactInfo(src)
- X:geologic_data = geologic_data
+ geologic_data.UpdateNearbyArtifactInfo(src) //AAAAAAAAAAAAAAAAAAAAAAAAAA
+ X:geologic_data = geologic_data //AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
//some find types delete the /obj/item/archaeological_find and replace it with something else, this handles when that happens
- //yuck
+ //yuck //yuck indeed.
var/display_name = "something"
if(!X)
X = last_find
@@ -456,7 +421,7 @@ var/list/mineral_can_smooth_with = list(
var/obj/effect/suspension_field/S = locate() in src
if(!S || S.field_type != get_responsive_reagent(F.find_type))
if(X)
- visible_message("[pick("[display_name] crumbles away into dust","[display_name] breaks apart")].")
+ visible_message(SPAN_DANGER("[pick("[display_name] crumbles away into dust","[display_name] breaks apart")]."))
qdel(X)
finds.Remove(F)
@@ -465,42 +430,37 @@ var/list/mineral_can_smooth_with = list(
/turf/simulated/mineral/proc/artifact_debris(var/severity = 0)
//cael's patented random limited drop componentized loot system!
//sky's patented not-fucking-retarded overhaul!
+ //geeves' making this not look like shit!
//Give a random amount of loot from 1 to 3 or 5, varying on severity.
for(var/j in 1 to rand(1, 3 + max(min(severity, 1), 0) * 2))
switch(rand(1,7))
if(1)
var/obj/item/stack/rods/R = new(src)
- R.amount = rand(5,25)
-
+ R.amount = rand(5, 25)
if(2)
var/obj/item/stack/material/plasteel/R = new(src)
- R.amount = rand(5,25)
-
+ R.amount = rand(5, 25)
if(3)
var/obj/item/stack/material/steel/R = new(src)
- R.amount = rand(5,25)
-
+ R.amount = rand(5, 25)
if(4)
var/obj/item/stack/material/plasteel/R = new(src)
- R.amount = rand(5,25)
-
+ R.amount = rand(5, 25)
if(5)
- var/quantity = rand(1,3)
- for(var/i=0, iConstructing support lattice ...")
+ if(R.use(1))
+ to_chat(user, SPAN_NOTICE("Constructing support lattice..."))
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
ReplaceWithLattice()
return
- if (istype(W, /obj/item/stack/tile/floor))
+ if(istype(W, /obj/item/stack/tile/floor))
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
var/obj/item/stack/tile/floor/S = W
- if (S.get_amount() < 1)
+ if(S.get_amount() < 1)
return
qdel(L)
- playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
+ playsound(src, 'sound/weapons/Genhit.ogg', 50, TRUE)
S.use(1)
ChangeTurf(/turf/simulated/floor/airless)
return
else
- to_chat(user, "The plating is going to need some support.")
+ to_chat(user, SPAN_WARNING("The plating is going to need some support.")) //turf psychiatrist lmaooo
return
var/static/list/usable_tools = typecacheof(list(
@@ -694,78 +651,78 @@ var/list/asteroid_floor_smooth = list(
))
if(is_type_in_typecache(W, usable_tools))
- var/turf/T = user.loc
- if (!(istype(T)))
+ var/turf/T = get_turf(user)
+ if(!istype(T))
return
if(digging)
return
if(dug)
if(!GetBelow(src))
return
- to_chat(user, "You start digging deeper.")
- playsound(user.loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
- digging = 1
- if(!do_after(user, 60/W.toolspeed))
- if (istype(src, /turf/unsimulated/floor/asteroid))
- digging = 0
+ to_chat(user, SPAN_NOTICE("You start digging deeper."))
+ playsound(get_turf(user), 'sound/effects/stonedoor_openclose.ogg', 50, TRUE)
+ digging = TRUE
+ if(!do_after(user, 60 / W.toolspeed))
+ if(istype(src, /turf/unsimulated/floor/asteroid))
+ digging = FALSE
return
// Turfs are special. They don't delete. So we need to check if it's
// still the same turf as before the sleep.
- if (!istype(src, /turf/unsimulated/floor/asteroid))
+ if(!istype(src, /turf/unsimulated/floor/asteroid))
return
- playsound(user.loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
+ playsound(get_turf(user), 'sound/effects/stonedoor_openclose.ogg', 50, TRUE)
if(prob(33))
switch(dug)
if(1)
- to_chat(user, "You've made a little progress.")
+ to_chat(user, SPAN_NOTICE("You've made a little progress."))
if(2)
- to_chat(user, "You notice the hole is a little deeper.")
+ to_chat(user, SPAN_NOTICE("You notice the hole is a little deeper."))
if(3)
- to_chat(user, "You think you're about halfway there.")
+ to_chat(user, SPAN_NOTICE("You think you're about halfway there."))
if(4)
- to_chat(user, "You finish up lifting another pile of dirt.")
+ to_chat(user, SPAN_NOTICE("You finish up lifting another pile of dirt."))
if(5)
- to_chat(user, "You dig a bit deeper. You're definitely halfway there now.")
+ to_chat(user, SPAN_NOTICE("You dig a bit deeper. You're definitely halfway there now."))
if(6)
- to_chat(user, "You still have a ways to go.")
+ to_chat(user, SPAN_NOTICE("You still have a ways to go."))
if(7)
- to_chat(user, "The hole looks pretty deep now.")
+ to_chat(user, SPAN_NOTICE("The hole looks pretty deep now."))
if(8)
- to_chat(user, "The ground is starting to feel a lot looser.")
+ to_chat(user, SPAN_NOTICE("The ground is starting to feel a lot looser."))
if(9)
- to_chat(user, "You can almost see the other side.")
+ to_chat(user, SPAN_NOTICE("You can almost see the other side."))
if(10)
- to_chat(user, "Just a little deeper. . .")
+ to_chat(user, SPAN_NOTICE("Just a little deeper..."))
else
- to_chat(user, "You penetrate the virgin earth!")
+ to_chat(user, SPAN_NOTICE("You penetrate the virgin earth!"))
else
if(dug <= 10)
- to_chat(user, "You dig a little deeper.")
+ to_chat(user, SPAN_NOTICE("You dig a little deeper."))
else
- to_chat(user, "You dug a big hole.")
+ to_chat(user, SPAN_NOTICE("You dug a big hole.")) // how ceremonious
gets_dug(user)
digging = 0
return
- to_chat(user, "You start digging.")
- playsound(user.loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
+ to_chat(user, SPAN_WARNING("You start digging."))
+ playsound(get_turf(user), 'sound/effects/stonedoor_openclose.ogg', 50, TRUE)
- digging = 1
- if(!do_after(user,40))
- if (istype(src, /turf/unsimulated/floor/asteroid))
- digging = 0
+ digging = TRUE
+ if(!do_after(user, 40))
+ if(istype(src, /turf/unsimulated/floor/asteroid))
+ digging = FALSE
return
// Turfs are special. They don't delete. So we need to check if it's
// still the same turf as before the sleep.
- if (!istype(src, /turf/unsimulated/floor/asteroid))
+ if(!istype(src, /turf/unsimulated/floor/asteroid))
return
- to_chat(user, " You dug a hole.")
- digging = 0
+ to_chat(user, SPAN_NOTICE("You dug a hole."))
+ digging = FALSE
gets_dug(user)
@@ -773,26 +730,23 @@ var/list/asteroid_floor_smooth = list(
var/obj/item/storage/bag/ore/S = W
if(S.collection_mode)
for(var/obj/item/ore/O in contents)
- O.attackby(W,user)
+ O.attackby(W, user)
return
else if(istype(W,/obj/item/storage/bag/fossils))
var/obj/item/storage/bag/fossils/S = W
if(S.collection_mode)
for(var/obj/item/fossil/F in contents)
- F.attackby(W,user)
+ F.attackby(W, user)
return
-
else
- ..(W,user)
+ ..(W, user)
return
/turf/unsimulated/floor/asteroid/proc/gets_dug(mob/user)
-
add_overlay("asteroid_dug", TRUE)
if(prob(75))
new /obj/item/ore/glass(src)
-
if(prob(25) && has_resources)
var/list/ore = list()
for(var/metal in resources)
@@ -832,7 +786,7 @@ var/list/asteroid_floor_smooth = list(
ore += /obj/item/ore/glass
else
ore += /obj/item/ore/glass
- if (ore.len)
+ if(length(ore))
var/ore_path = pick(ore)
if(ore)
new ore_path(src)
@@ -843,10 +797,10 @@ var/list/asteroid_floor_smooth = list(
else
var/turf/below = GetBelow(src)
if(below)
- var/area/below_area = below.loc // Let's just assume that the turf is not in nullspace.
+ var/area/below_area = get_area(below) // Let's just assume that the turf is not in nullspace.
if(below_area.station_area)
- if (user)
- to_chat(user, "You strike metal!")
+ if(user)
+ to_chat(user, span("alert", "You strike metal!"))
below.spawn_roof(ROOF_FORCE_SPAWN)
else
ChangeTurf(/turf/space)
@@ -855,17 +809,16 @@ var/list/asteroid_floor_smooth = list(
..()
if(istype(M,/mob/living/silicon/robot))
var/mob/living/silicon/robot/R = M
- if(R.module)
- if(istype(R.module_state_1,/obj/item/storage/bag/ore))
- attackby(R.module_state_1,R)
- else if(istype(R.module_state_2,/obj/item/storage/bag/ore))
- attackby(R.module_state_2,R)
- else if(istype(R.module_state_3,/obj/item/storage/bag/ore))
- attackby(R.module_state_3,R)
+ if(R.module) // bro wtf this is criminal
+ if(istype(R.module_state_1, /obj/item/storage/bag/ore))
+ attackby(R.module_state_1, R)
+ else if(istype(R.module_state_2, /obj/item/storage/bag/ore))
+ attackby(R.module_state_2, R)
+ else if(istype(R.module_state_3, /obj/item/storage/bag/ore))
+ attackby(R.module_state_3, R)
else
return
-
/turf/simulated/mineral/Destroy()
clear_ore_effects()
. = ..()
diff --git a/code/modules/mining/mineral_effect.dm b/code/modules/mining/mineral_effect.dm
index 16d92d6247e..a6debb1b281 100644
--- a/code/modules/mining/mineral_effect.dm
+++ b/code/modules/mining/mineral_effect.dm
@@ -14,13 +14,13 @@
ore_key = M.name
icon_state = "rock_[ore_key]"
var/turf/simulated/mineral/T = get_turf(src)
- layer = T.layer+0.1
- if (!istype(T))
+ layer = T.layer + 0.1
+ if(!istype(T))
crash_with("Invalid loc for mineral overlay: [T ? T.type : "NULL"].")
qdel(src)
return
- if (T.my_mineral)
+ if(T.my_mineral)
crash_with("Mineral overlay created on turf that already had one.")
qdel(T.my_mineral)
@@ -28,9 +28,8 @@
/obj/effect/mineral/Destroy()
var/turf/simulated/mineral/T = loc
- if (istype(T))
+ if(istype(T))
T.my_mineral = null
-
return ..()
/obj/effect/mineral/proc/get_scan_overlay()
@@ -43,7 +42,7 @@
return scanner_image
/obj/effect/mineral/singularity_pull()
- return
+ return
/obj/effect/mineral/singuloCanEat()
- return FALSE
+ return FALSE
\ No newline at end of file
diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm
index 6dd33b2c925..269aec73d82 100644
--- a/code/modules/mining/mint.dm
+++ b/code/modules/mining/mint.dm
@@ -2,13 +2,13 @@
/obj/machinery/mineral/mint
- name = "Coin press"
+ name = "coin press"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "coinpress0"
- density = 1
- anchored = 1.0
- var/obj/machinery/mineral/input = null
- var/obj/machinery/mineral/output = null
+ density = TRUE
+ anchored = TRUE
+ var/obj/machinery/mineral/input
+ var/obj/machinery/mineral/output
var/amt_silver = 0 //amount of silver
var/amt_gold = 0 //amount of gold
var/amt_diamond = 0
@@ -22,20 +22,22 @@
/obj/machinery/mineral/mint/Initialize()
. = ..()
- for (var/dir in cardinal)
+ for(var/dir in cardinal)
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
- if(src.input) break
- for (var/dir in cardinal)
+ if(src.input)
+ break
+ for(var/dir in cardinal)
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
- if(src.output) break
+ if(src.output)
+ break
START_PROCESSING(SSprocessing, src)
/obj/machinery/mineral/mint/machinery_process()
- if ( src.input)
+ if(input)
var/obj/item/stack/O
- O = locate(/obj/item/stack, input.loc)
+ O = locate(/obj/item/stack, get_turf(input))
if(O)
- var/processed = 1
+ var/processed = TRUE
switch(O.get_material_name())
if("gold")
amt_gold += 100 * O.get_amount()
@@ -50,54 +52,52 @@
if(DEFAULT_WALL_MATERIAL)
amt_iron += 100 * O.get_amount()
else
- processed = 0
+ processed = FALSE
if(processed)
qdel(O)
-/obj/machinery/mineral/mint/attack_hand(user as mob)
-
+/obj/machinery/mineral/mint/attack_hand(user)
var/dat = "Coin Press "
- if (!input)
+ if(!input)
dat += text("input connection status: ")
dat += text("NOT CONNECTED ")
- if (!output)
+ if(!output)
dat += text(" output connection status: ")
dat += text("NOT CONNECTED ")
dat += text(" Gold inserted: [amt_gold] ")
- if (chosen == "gold")
+ if(chosen == "gold")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Silver inserted: [amt_silver] ")
- if (chosen == "silver")
+ if(chosen == "silver")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Iron inserted: [amt_iron] ")
- if (chosen == DEFAULT_WALL_MATERIAL)
+ if(chosen == DEFAULT_WALL_MATERIAL)
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Diamond inserted: [amt_diamond] ")
- if (chosen == "diamond")
+ if(chosen == "diamond")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Phoron inserted: [amt_phoron] ")
- if (chosen == "phoron")
+ if(chosen == "phoron")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Uranium inserted: [amt_uranium] ")
- if (chosen == "uranium")
+ if(chosen == "uranium")
dat += text("chosen")
else
dat += text("Choose")
dat += text("
Will produce [coinsToProduce] [chosen] coins if enough materials are available. ")
- //dat += text("The dial which controls the number of conins to produce seems to be stuck. A technician has already been dispatched to fix this.")
dat += text("-10 ")
dat += text("-5 ")
dat += text("-1 ")
@@ -111,11 +111,11 @@
/obj/machinery/mineral/mint/Topic(href, href_list)
if(..())
- return 1
+ return TRUE
usr.set_machine(src)
src.add_fingerprint(usr)
- if(processing==1)
- to_chat(usr, "The machine is processing.")
+ if(processing)
+ to_chat(usr, SPAN_WARNING("The machine is busy processing."))
return
if(href_list["choose"])
chosen = href_list["choose"]
@@ -123,77 +123,77 @@
coinsToProduce = between(0, coinsToProduce + text2num(href_list["chooseAmt"]), 1000)
if(href_list["makeCoins"])
var/temp_coins = coinsToProduce
- if (src.output)
- processing = 1;
+ if(output)
+ processing = TRUE
icon_state = "coinpress1"
var/obj/item/storage/bag/money/M
switch(chosen)
if(DEFAULT_WALL_MATERIAL)
- while(amt_iron > 0 && coinsToProduce > 0)
- if (locate(/obj/item/storage/bag/money,output.loc))
- M = locate(/obj/item/storage/bag/money,output.loc)
+ while(amt_iron && coinsToProduce)
+ if(locate(/obj/item/storage/bag/money, get_turf(output)))
+ M = locate(/obj/item/storage/bag/money, get_turf(output))
else
- M = new/obj/item/storage/bag/money(output.loc)
- new/obj/item/coin/iron(M)
+ M = new/obj/item/storage/bag/money(get_turf(output))
+ new /obj/item/coin/iron(M)
amt_iron -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
- sleep(5);
+ sleep(5)
if("gold")
- while(amt_gold > 0 && coinsToProduce > 0)
- if (locate(/obj/item/storage/bag/money,output.loc))
- M = locate(/obj/item/storage/bag/money,output.loc)
+ while(amt_gold && coinsToProduce)
+ if(locate(/obj/item/storage/bag/money, get_turf(output)))
+ M = locate(/obj/item/storage/bag/money, get_turf(output))
else
- M = new/obj/item/storage/bag/money(output.loc)
+ M = new/obj/item/storage/bag/money(get_turf(output))
new /obj/item/coin/gold(M)
amt_gold -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
- sleep(5);
+ sleep(5)
if("silver")
- while(amt_silver > 0 && coinsToProduce > 0)
- if (locate(/obj/item/storage/bag/money,output.loc))
- M = locate(/obj/item/storage/bag/money,output.loc)
+ while(amt_silver && coinsToProduce)
+ if(locate(/obj/item/storage/bag/money, get_turf(output)))
+ M = locate(/obj/item/storage/bag/money, get_turf(output))
else
- M = new/obj/item/storage/bag/money(output.loc)
+ M = new/obj/item/storage/bag/money(get_turf(output))
new /obj/item/coin/silver(M)
amt_silver -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
- sleep(5);
+ sleep(5)
if("diamond")
- while(amt_diamond > 0 && coinsToProduce > 0)
- if (locate(/obj/item/storage/bag/money,output.loc))
- M = locate(/obj/item/storage/bag/money,output.loc)
+ while(amt_diamond && coinsToProduce)
+ if(locate(/obj/item/storage/bag/money, get_turf(output)))
+ M = locate(/obj/item/storage/bag/money, get_turf(output))
else
- M = new/obj/item/storage/bag/money(output.loc)
+ M = new/obj/item/storage/bag/money(get_turf(output))
new /obj/item/coin/diamond(M)
amt_diamond -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
- sleep(5);
+ sleep(5)
if("phoron")
- while(amt_phoron > 0 && coinsToProduce > 0)
- if (locate(/obj/item/storage/bag/money,output.loc))
- M = locate(/obj/item/storage/bag/money,output.loc)
+ while(amt_phoron && coinsToProduce)
+ if(locate(/obj/item/storage/bag/money, get_turf(output)))
+ M = locate(/obj/item/storage/bag/money, get_turf(output))
else
- M = new/obj/item/storage/bag/money(output.loc)
+ M = new/obj/item/storage/bag/money(get_turf(output))
new /obj/item/coin/phoron(M)
amt_phoron -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
- sleep(5);
+ sleep(5)
if("uranium")
- while(amt_uranium > 0 && coinsToProduce > 0)
- if (locate(/obj/item/storage/bag/money,output.loc))
- M = locate(/obj/item/storage/bag/money,output.loc)
+ while(amt_uranium && coinsToProduce)
+ if(locate(/obj/item/storage/bag/money, get_turf(output)))
+ M = locate(/obj/item/storage/bag/money, get_turf(output))
else
- M = new/obj/item/storage/bag/money (output.loc)
+ M = new /obj/item/storage/bag/money(get_turf(output))
new /obj/item/coin/uranium(M)
amt_uranium -= 20
coinsToProduce--
@@ -201,7 +201,7 @@
src.updateUsrDialog()
sleep(5)
icon_state = "coinpress0"
- processing = 0;
+ processing = FALSE
coinsToProduce = temp_coins
src.updateUsrDialog()
- return
+ return
\ No newline at end of file
diff --git a/code/modules/mining/ore.dm b/code/modules/mining/ore.dm
index 598a98bd1bf..6503635f30a 100644
--- a/code/modules/mining/ore.dm
+++ b/code/modules/mining/ore.dm
@@ -38,12 +38,10 @@
..()
var/mob/living/carbon/human/H = hit_atom
if(istype(H) && H.has_eyes() && prob(85))
- to_chat(H, "Some of \the [src] gets in your eyes!")
+ to_chat(H, SPAN_DANGER("Some of \the [src] gets in your eyes!"))
H.eye_blind += 5
H.eye_blurry += 10
- spawn(1)
- if(istype(loc, /turf/)) qdel(src)
-
+ qdel(src)
/obj/item/ore/phoron
name = "phoron crystals"
@@ -79,6 +77,8 @@
icon_state = "ore_hydrogen"
material = ORE_HYDROGEN
+// maybe someone can think of a creative way to use slag
+// and make slagging shit not absolutely bomb mining - geeves
/obj/item/ore/slag
name = "Slag"
desc = "Someone screwed up..."
@@ -89,9 +89,9 @@
if((randpixel_xy()) && icon_state == "ore1")
icon_state = "ore[pick(1,2,3)]"
-/obj/item/ore/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/ore/attackby(obj/item/W, mob/user)
if(istype(W,/obj/item/device/core_sampler))
var/obj/item/device/core_sampler/C = W
C.sample_item(src, user)
else
- return ..()
+ return ..()
\ No newline at end of file
diff --git a/code/modules/mining/ore_datum.dm b/code/modules/mining/ore_datum.dm
index 58791db4c70..9c99d17d53d 100644
--- a/code/modules/mining/ore_datum.dm
+++ b/code/modules/mining/ore_datum.dm
@@ -7,7 +7,7 @@ var/global/list/ore_data = list()
var/smelts_to
var/compresses_to
var/result_amount // How much ore?
- var/spread = 1 // Does this type of deposit spread?
+ var/spread = TRUE // Does this type of deposit spread?
var/spread_chance // Chance of spreading in any direction
var/ore // Path to the ore produced when tile is mined.
var/scan_icon // Overlay for ore scanners.
@@ -43,7 +43,7 @@ var/global/list/ore_data = list()
name = ORE_IRON
display_name = "hematite"
smelts_to = "iron"
- alloy = 1
+ alloy = TRUE
result_amount = 5
spread_chance = 30
ore = /obj/item/ore/iron
@@ -54,7 +54,7 @@ var/global/list/ore_data = list()
name = ORE_COAL
display_name = "raw carbon"
smelts_to = "plastic"
- alloy = 1
+ alloy = TRUE
result_amount = 5
spread_chance = 35
ore = /obj/item/ore/coal
@@ -127,7 +127,7 @@ var/global/list/ore_data = list()
display_name = "raw platinum"
smelts_to = "platinum"
compresses_to = "osmium"
- alloy = 1
+ alloy = TRUE
result_amount = 5
spread_chance = 15
ore = /obj/item/ore/osmium
@@ -140,4 +140,4 @@ var/global/list/ore_data = list()
smelts_to = "tritium"
compresses_to = "mhydrogen"
scan_icon = "mineral_rare"
- worth = 30
+ worth = 30
\ No newline at end of file
diff --git a/code/modules/mining/satchel_ore_boxdm.dm b/code/modules/mining/satchel_ore_boxdm.dm
index 4814066cfeb..3a558977dcf 100644
--- a/code/modules/mining/satchel_ore_boxdm.dm
+++ b/code/modules/mining/satchel_ore_boxdm.dm
@@ -2,107 +2,96 @@
/**********************Ore box**************************/
/obj/structure/ore_box
- icon = 'icons/obj/mining.dmi'
- icon_state = "orebox0"
name = "ore box"
desc = "A heavy box used for storing ore."
- density = 1
+ icon = 'icons/obj/mining.dmi'
+ icon_state = "orebox0"
+ density = TRUE
var/last_update = 0
var/list/stored_ore = list()
-/obj/structure/ore_box/attackby(obj/item/W as obj, mob/user as mob)
- if (istype(W, /obj/item/ore))
+/obj/structure/ore_box/attackby(obj/item/W, mob/user)
+ if(istype(W, /obj/item/ore))
user.remove_from_mob(W)
src.contents += W
- if (istype(W, /obj/item/storage))
+ if(istype(W, /obj/item/storage))
var/obj/item/storage/S = W
S.hide_from(user)
for(var/obj/item/ore/O in S.contents)
S.remove_from_storage_deferred(O, src, user) //This will move the item to this item's contents
-
CHECK_TICK
S.post_remove_from_storage_deferred(loc, user)
-
to_chat(user, span("notice", "You empty the satchel into the box."))
update_ore_count()
-
return
/obj/structure/ore_box/proc/update_ore_count()
-
stored_ore = list()
-
for(var/obj/item/ore/O in contents)
-
if(stored_ore[O.name])
stored_ore[O.name]++
else
stored_ore[O.name] = 1
/obj/structure/ore_box/examine(mob/user)
- to_chat(user, "That's an [src].")
- to_chat(user, desc)
-
+ ..()
// Borgs can now check contents too.
if((!istype(user, /mob/living/carbon/human)) && (!istype(user, /mob/living/silicon/robot)))
return
-
if(!Adjacent(user)) //Can only check the contents of ore boxes if you can physically reach them.
return
add_fingerprint(user)
- if(!contents.len)
- to_chat(user, "It is empty.")
+ if(!length(contents))
+ to_chat(user, SPAN_NOTICE("It is empty."))
return
if(world.time > last_update + 10)
update_ore_count()
last_update = world.time
- to_chat(user, "It holds:")
+ to_chat(user, SPAN_NOTICE("It holds:"))
for(var/ore in stored_ore)
- to_chat(user, "- [stored_ore[ore]] [ore]")
+ to_chat(user, SPAN_NOTICE("- [stored_ore[ore]] [ore]"))
return
-
/obj/structure/ore_box/verb/empty_box()
set name = "Empty Ore Box"
set category = "Object"
set src in view(1)
if(!istype(usr, /mob/living/carbon/human)) //Only living, intelligent creatures with hands can empty ore boxes.
- to_chat(usr, "You are physically incapable of emptying the ore box.")
+ to_chat(usr, SPAN_WARNING("You are physically incapable of emptying \the [src]."))
return
- if( usr.stat || usr.restrained() )
+ if(use_check_and_message(usr))
return
if(!Adjacent(usr)) //You can only empty the box if you can physically reach it
- to_chat(usr, "You cannot reach the ore box.")
+ to_chat(usr, SPAN_NOTICE("You cannot reach \the [src]."))
return
add_fingerprint(usr)
- if(contents.len < 1)
- to_chat(usr, "The ore box is empty")
+ if(!length(contents))
+ to_chat(usr, SPAN_WARNING("\The [src] is empty."))
return
- for (var/obj/item/ore/O in contents)
+ for(var/obj/item/ore/O in contents)
contents -= O
- O.forceMove(src.loc)
- to_chat(usr, "You empty the ore box")
+ O.forceMove(get_turf(src))
+ to_chat(usr, SPAN_NOTICE("You empty \the [src]."))
return
/obj/structure/ore_box/ex_act(severity)
if(severity == 1.0 || (severity < 3.0 && prob(50)))
- for (var/obj/item/ore/O in contents)
+ for(var/obj/item/ore/O in contents)
O.forceMove(src.loc)
O.ex_act(severity++)
-
CHECK_TICK
qdel(src)
- return
+ return
\ No newline at end of file
diff --git a/html/changelogs/geeves-mining_modernization.yml b/html/changelogs/geeves-mining_modernization.yml
new file mode 100644
index 00000000000..1dc0af5a985
--- /dev/null
+++ b/html/changelogs/geeves-mining_modernization.yml
@@ -0,0 +1,8 @@
+author: Geeves
+
+delete-after: True
+
+changes:
+ - backend: "Fixed up a lot of mining-related things in the backend. You might notice some changes in-game."
+ - tweak: "Locked abandoned crates found in the mine now has 15 attempts to hack instead of 10."
+ - tweak: "Destroying artifacts while mining now longer has long range effects on many people."
|