-
Notifications
You must be signed in to change notification settings - Fork 199
[DONUT MERGE] Adds the Scrap Magnet to Mining #839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Iamgoofball
wants to merge
3
commits into
NTStation:master
Choose a base branch
from
Iamgoofball:scrapmag
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| /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/hi = FALSE | ||
| var/obj/machinery/oremagcomputer/controller_computer = null | ||
|
|
||
| /obj/machinery/oremagpull/attack_hand(mob/user as mob) | ||
| if(hi) | ||
| user << "sdaA" | ||
| 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
112
code/modules/mining/oremagnet/ore_mag_abandoned_crates.dm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/ambrosiadeus(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 ..() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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,50) | ||
| switch(turf_chance) | ||
| if(1 to 29) | ||
| T.ChangeTurf(/turf/simulated/mineral/random) | ||
| if(30) | ||
| T.ChangeTurf(/turf/simulated/floor/airless) | ||
| if(31) | ||
| T.ChangeTurf(/turf/simulated/floor/plating/airless) | ||
| if(32) | ||
| T.ChangeTurf(/turf/simulated/floor/plating/airless) | ||
| if(33) | ||
| T.ChangeTurf(/turf/simulated/floor/airless) | ||
| if(34) | ||
| T.ChangeTurf(/turf/simulated/wall/r_wall) | ||
| if(35) | ||
| T.ChangeTurf(/turf/simulated/wall/mineral/gold) | ||
| if(36) | ||
| T.ChangeTurf(/turf/simulated/wall/mineral/diamond) | ||
| if(37) | ||
| T.ChangeTurf(/turf/simulated/wall/mineral/clown) | ||
| if(38) | ||
| T.ChangeTurf(/turf/simulated/wall/mineral/sandstone) | ||
| if(39) | ||
| T.ChangeTurf(/turf/simulated/wall/mineral/plasma) | ||
| if(40) | ||
| T.ChangeTurf(/turf/simulated/wall) | ||
| if(41) | ||
| T.ChangeTurf(/turf/simulated/wall/mineral/silver) | ||
| if(42) | ||
| T.ChangeTurf(/turf/simulated/wall/mineral/uranium) | ||
| if(43 to 50) | ||
| 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(src) | ||
| if(23) | ||
| for(var/i = 0, i < 10, i++) | ||
| new/obj/item/weapon/ore/clown(src) | ||
| if(24) | ||
| for(var/i = 0, i < 10, i++) | ||
| new/obj/item/weapon/ore/plasma(src) | ||
|
|
||
| for(var/turf/simulated/floor/F in scraparea) // Begin generation of pulled mobs | ||
| var/mob_chance = rand(1,64) | ||
| switch(mob_chance) | ||
| if(1 to 59) | ||
| continue | ||
| if(60) | ||
| new /mob/living/simple_animal/hostile/asteroid/basilisk(F.loc) | ||
| if(61) | ||
| new /mob/living/simple_animal/hostile/asteroid/goldgrub(F.loc) | ||
| if(62) | ||
| new /mob/living/simple_animal/hostile/asteroid/hivelord(F.loc) | ||
| if(63) | ||
| new /mob/living/simple_animal/hostile/asteroid/hivelordbrood(F.loc) | ||
| if(64) | ||
| 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 not shown.
Binary file not shown.
Binary file not shown.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
icons/ass? :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clickdrag yourself onto a photocopier sometime, then hit the scan button on the photocopier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah thats already in the game ike dont worry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I knew about the photocopier thing I just didn't know it was literally just icons/ass...