Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NTstation13.dme
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,9 @@
#include "code\modules\mining\laborcamp\laborminerals.dm"
#include "code\modules\mining\laborcamp\laborshuttle.dm"
#include "code\modules\mining\laborcamp\laborstacker.dm"
#include "code\modules\mining\oremagnet\ore_mag.dm"
#include "code\modules\mining\oremagnet\ore_mag_abandoned_crates.dm"
#include "code\modules\mining\oremagnet\ore_mag_computer.dm"
#include "code\modules\mob\death.dm"
#include "code\modules\mob\inventory.dm"
#include "code\modules\mob\login.dm"
Expand Down
176 changes: 96 additions & 80 deletions _maps/map_files/MetaStation.v39L.dmm

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions code/game/area/Space Station 13 areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,16 @@ proc/process_ghost_teleport_locs()
/area/awaycontent/a30
icon_state = "awaycontent30"

/area/oremag/controls
name = "Scrap Magnet Controls"
icon_state = "ore_mag"
requires_power = 0

/area/oremag/scrap
name = "Scrap Magnet"
icon_state = "ore_mag_attract"
requires_power = 0

// CENTCOM

/area/centcom
Expand Down
32 changes: 32 additions & 0 deletions code/modules/mining/oremagnet/ore_mag.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/obj/machinery/oremagpull
name = "Scrap Magnet"
desc = "You pull 16 tons of scrap a day, you get another day older and deeper in scrap."
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "ore_mag_off"
density = 1
anchored = 1
var/obj/machinery/oremagcomputer/controller_computer = null

/obj/machinery/oremagpull/attack_hand(mob/user as mob)
if(controller_computer)
if(controller_computer.on)
user << "Please wait for the magnet to finish pulling."
else
if(!controller_computer.haspulled)
user << "There is no scrap to repel!"
return
user << "You use the magnet to repel the currently pulled scrap, sending it off into the vast uncharted regions of space."

for(var/turf/simulated/T in controller_computer.scraparea)
T.ChangeTurf(/turf/space/)
for(var/obj/O in controller_computer.scraparea)
qdel(O)
for(var/mob/living/carbon/human/poor_fellow in controller_computer.scraparea)
poor_fellow << "You watch as the scrap you are standing on suddenly jets off. Your body is smashed to smithereens in seconds from the impact, with your last thoughts being 'Oh shi-'"
qdel(poor_fellow)
for(var/mob/living/simple_animal/M in controller_computer.scraparea)
M.Die()

controller_computer.haspulled = FALSE
user << "Magnet has finished repelling."
return
112 changes: 112 additions & 0 deletions code/modules/mining/oremagnet/ore_mag_abandoned_crates.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/obj/structure/closet/crate/secure/loot
name = "abandoned crate"
desc = "What could be inside?"
icon_state = "securecrate"
icon_opened = "securecrateopen"
icon_closed = "securecrate"
var/code = null
var/lastattempt = null
var/attempts = 3
locked = 1
var/min = 1
var/max = 10

/obj/structure/closet/crate/secure/loot/New()
..()
code = rand(min,max)
var/loot = rand(1,30)
switch(loot)
if(1)
new/obj/item/weapon/reagent_containers/food/drinks/bottle/rum(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/blazeit(src)
new/obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey(src)
new/obj/item/weapon/lighter/zippo(src)
if(2)
new/obj/item/weapon/pickaxe/drill(src)
new/obj/item/device/taperecorder(src)
new/obj/item/clothing/suit/space(src)
new/obj/item/clothing/head/helmet/space(src)
if(3)
return
if(4)
new/obj/item/weapon/reagent_containers/glass/beaker/bluespace(src)
if(5 to 6)
for(var/i = 0, i < 10, i++)
new/obj/item/weapon/ore/diamond(src)
if(7)
return
if(8)
return
if(9)
for(var/i = 0, i < 3, i++)
new/obj/machinery/hydroponics(src)
if(10)
for(var/i = 0, i < 3, i++)
new/obj/item/weapon/reagent_containers/glass/beaker/noreact(src)
if(11 to 13)
new/obj/item/weapon/melee/classic_baton(src)
if(14)
return
if(15)
new/obj/item/clothing/under/chameleon(src)
if(16)
new/obj/item/clothing/under/shorts(src)
new/obj/item/clothing/under/shorts/red(src)
new/obj/item/clothing/under/shorts/blue(src)
//Dummy crates start here.
if(17 to 29)
return
//Dummy crates end here.
if(30)
new/obj/item/weapon/melee/baton(src)

/obj/structure/closet/crate/secure/loot/attack_hand(mob/user as mob)
if(locked)
user << "<span class='notice'>The crate is locked with a Deca-code lock.</span>"
var/input = input(usr, "Enter digit from [min] to [max].", "Deca-Code Lock", "") as num
if(in_range(src, user))
input = Clamp(input, 0, 10)
if (input == code)
user << "<span class='notice'>The crate unlocks!</span>"
locked = 0
overlays.Cut()
overlays += greenlight
else if (input == null || input > max || input < min)
user << "<span class='notice'>You leave the crate alone.</span>"
else
user << "<span class='warning'>A red light flashes.</span>"
lastattempt = input
attempts--
if (attempts == 0)
user << "<span class='danger'>The crate's anti-tamper system activates!</span>"
var/turf/T = get_turf(src.loc)
explosion(T, 0, 0, 0, 1)
del(src)
return
else
user << "<span class='notice'>You attempt to interact with the device using a hand gesture, but it appears this crate is from before the DECANECT came out.</span>"
return
else
return ..()

/obj/structure/closet/crate/secure/loot/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(locked)
if (istype(W, /obj/item/weapon/card/emag))
user << "<span class='notice'>The crate unlocks!</span>"
locked = 0
if (istype(W, /obj/item/device/multitool))
user << "<span class='notice'>DECA-CODE LOCK REPORT:</span>"
if (attempts == 1)
user << "<span class='warning'>* Anti-Tamper Bomb will activate on next failed access attempt.</span>"
else
user << "<span class='notice'>* Anti-Tamper Bomb will activate after [src.attempts] failed access attempts.</span>"
if (lastattempt == null)
user << "<span class='notice'> has been made to open the crate thus far.</span>"
return
// hot and cold
if (code > lastattempt)
user << "<span class='notice'>* Last access attempt lower than expected code.</span>"
else
user << "<span class='notice'>* Last access attempt higher than expected code.</span>"
else ..()
else ..()
116 changes: 116 additions & 0 deletions code/modules/mining/oremagnet/ore_mag_computer.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/obj/machinery/oremagcomputer
name = "scrap magnet console"
desc = "Used to activate the Scrap Magnet."
icon = 'icons/obj/computer.dmi'
var/obj/machinery/oremagpull/oremag = null
var/area/oremag/scrap/scraparea = null
var/on = FALSE
var/haspulled = FALSE
icon_state = "ore_mag"
anchored = 1
density = 1


/obj/machinery/oremagcomputer/attack_hand(mob/user as mob)
if(on)
user << "Please wait for the magnet to finish processing."
if(!oremag)
user << "No scrap magnet linked. Linking to closest available scrap magnet."
for(var/obj/machinery/oremagpull/M in world)
oremag = M
M.controller_computer = src
if(oremag)
user << "Linking complete."
else
user << "Error: No Scrap Magnet Detected."
return
for(var/area/oremag/scrap/A in world)
scraparea = A
if(scraparea)
return
else
user << "No Scrap Magnet Area found. Contact a coder."// there's no scrap magnet area for some reason.
return
else
on = TRUE
oremag.icon_state = "ore_mag_on"
user << "Scrap Magnet now pulling."
sleep(200)

for(var/turf/space/T in scraparea) // Begin generation of pulled turfs.
var/turf_chance = rand(1,60)
switch(turf_chance)
if(1 to 39)
T.ChangeTurf(/turf/simulated/mineral/random)
if(40)
T.ChangeTurf(/turf/simulated/floor/airless)
if(41)
T.ChangeTurf(/turf/simulated/floor/plating/airless)
if(42)
T.ChangeTurf(/turf/simulated/floor/plating/airless)
if(43)
T.ChangeTurf(/turf/simulated/floor/airless)
if(44)
T.ChangeTurf(/turf/simulated/wall/r_wall)
if(45)
T.ChangeTurf(/turf/simulated/wall/mineral/gold)
if(46)
T.ChangeTurf(/turf/simulated/wall/mineral/diamond)
if(47)
T.ChangeTurf(/turf/simulated/wall/mineral/clown)
if(48)
T.ChangeTurf(/turf/simulated/wall/mineral/sandstone)
if(49)
T.ChangeTurf(/turf/simulated/wall/mineral/plasma)
if(50)
T.ChangeTurf(/turf/simulated/wall)
if(51)
T.ChangeTurf(/turf/simulated/wall/mineral/silver)
if(52)
T.ChangeTurf(/turf/simulated/wall/mineral/uranium)
if(53 to 60)
T.ChangeTurf(/turf/simulated/floor/plating/asteroid)

for(var/turf/simulated/floor/F in scraparea) // Begin generation of pulled objects
var/obj_chance = rand(1,24)
switch(obj_chance)
if(1 to 19)
continue
if(20)
new /obj/structure/closet/crate/secure/loot(F.loc)
if(21)
new /obj/item/weapon/reagent_containers/glass/beaker/slime(F.loc)
if(22)
for(var/i = 0, i < 10, i++)
new /obj/item/weapon/ore/diamond(F.loc)
if(23)
for(var/i = 0, i < 10, i++)
new /obj/item/weapon/ore/clown(F.loc)
if(24)
for(var/i = 0, i < 10, i++)
new /obj/item/weapon/ore/plasma(F.loc)

for(var/turf/simulated/floor/F in scraparea) // Begin generation of pulled mobs
var/mob_chance = rand(1,84)
switch(mob_chance)
if(1 to 79)
continue
if(80)
new /mob/living/simple_animal/hostile/asteroid/basilisk(F.loc)
if(81)
new /mob/living/simple_animal/hostile/asteroid/goldgrub(F.loc)
if(82)
new /mob/living/simple_animal/hostile/asteroid/hivelord(F.loc)
if(83)
new /mob/living/simple_animal/hostile/asteroid/hivelordbrood(F.loc)
if(84)
new /mob/living/simple_animal/hostile/asteroid/goliath(F.loc)

user << "Pull complete."
on = FALSE
haspulled = TRUE
oremag.icon_state = "ore_mag_off"
return



Binary file modified icons/obj/computer.dmi
Binary file not shown.
Binary file modified icons/obj/machines/mining_machines.dmi
Binary file not shown.
Binary file modified icons/turf/areas.dmi
Binary file not shown.