|
21 | 21 | var/spreadChance = 0 //the percentual chance of an ore spreading to the neighbouring tiles |
22 | 22 | var/scan_state = "" //Holder for the image we display when we're pinged by a mining scanner |
23 | 23 | var/defer_change = FALSE |
| 24 | + var/hardness = 1 //how hard the material is, we'll have to have more powerful stuff if we want to blast harder materials. |
24 | 25 |
|
25 | 26 | /turf/closed/mineral/Initialize() |
26 | 27 | if (!canSmoothWith) |
|
62 | 63 | if(I.use_tool(src, user, 40, volume=50)) |
63 | 64 | if(ismineralturf(src)) |
64 | 65 | to_chat(user, span_notice("You finish cutting into the rock.")) |
65 | | - gets_drilled(user) |
| 66 | + attempt_drill(user) |
66 | 67 | SSblackbox.record_feedback("tally", "pick_used_mining", 1, I.type) |
67 | 68 | else |
68 | 69 | return attack_hand(user) |
69 | 70 |
|
70 | | -/turf/closed/mineral/proc/gets_drilled() |
| 71 | +/turf/closed/mineral/proc/gets_drilled(mob/user, triggered_by_explosion = FALSE, override_bonus = FALSE) |
71 | 72 | if (mineralType && (mineralAmt > 0)) |
| 73 | + if(triggered_by_explosion && !override_bonus) |
| 74 | + mineralAmt += 2 //bonus if it was exploded, USE EXPLOSIVES WOOO |
72 | 75 | new mineralType(src, mineralAmt) |
73 | 76 | SSblackbox.record_feedback("tally", "ore_mined", mineralAmt, mineralType) |
74 | 77 | for(var/obj/effect/temp_visual/mining_overlay/M in src) |
|
80 | 83 | addtimer(CALLBACK(src, .proc/AfterChange), 1, TIMER_UNIQUE) |
81 | 84 | playsound(src, 'sound/effects/break_stone.ogg', 50, 1) //beautiful destruction |
82 | 85 |
|
| 86 | +/turf/closed/mineral/proc/attempt_drill(mob/user,triggered_by_explosion = FALSE, power = 1) |
| 87 | + hardness -= power |
| 88 | + if(hardness <= 0) |
| 89 | + gets_drilled(user,triggered_by_explosion) |
| 90 | + else |
| 91 | + update_icon() |
| 92 | + |
| 93 | +/turf/closed/mineral/proc/update_icon() |
| 94 | + if(hardness != initial(hardness)) |
| 95 | + var/mutable_appearance/cracks = mutable_appearance('icons/turf/mining.dmi',"rock_cracks",ON_EDGED_TURF_LAYER) |
| 96 | + var/matrix/M = new |
| 97 | + M.Translate(4,4) |
| 98 | + cracks.transform = M |
| 99 | + add_overlay(cracks) |
| 100 | + |
| 101 | + |
83 | 102 | /turf/closed/mineral/attack_animal(mob/living/simple_animal/user) |
84 | 103 | if((user.environment_smash & ENVIRONMENT_SMASH_WALLS) || (user.environment_smash & ENVIRONMENT_SMASH_RWALLS)) |
85 | | - gets_drilled() |
| 104 | + attempt_drill() |
86 | 105 | ..() |
87 | 106 |
|
88 | 107 | /turf/closed/mineral/attack_alien(mob/living/carbon/alien/M) |
89 | 108 | to_chat(M, span_notice("You start digging into the rock...")) |
90 | 109 | playsound(src, 'sound/effects/break_stone.ogg', 50, 1) |
91 | 110 | if(do_after(M, 4 SECONDS, target = src)) |
92 | 111 | to_chat(M, span_notice("You tunnel into the rock.")) |
93 | | - gets_drilled(M) |
| 112 | + attempt_drill(M) |
94 | 113 |
|
95 | 114 | /turf/closed/mineral/Bumped(atom/movable/AM) |
96 | 115 | ..() |
|
116 | 135 | switch(severity) |
117 | 136 | if(3) |
118 | 137 | if (prob(75)) |
119 | | - gets_drilled(null, 1) |
| 138 | + attempt_drill(null,TRUE,2) |
| 139 | + else if(prob(90)) |
| 140 | + attempt_drill(null,TRUE,1) |
120 | 141 | if(2) |
121 | 142 | if (prob(90)) |
122 | | - gets_drilled(null, 1) |
| 143 | + attempt_drill(null,TRUE,2) |
| 144 | + else |
| 145 | + attempt_drill(null,TRUE,1) |
123 | 146 | if(1) |
124 | | - gets_drilled(null, 1) |
| 147 | + attempt_drill(null,TRUE,3) |
125 | 148 | return |
126 | 149 |
|
127 | 150 | /turf/closed/mineral/Spread(turf/T) |
|
153 | 176 |
|
154 | 177 | if(T && ismineralturf(T)) |
155 | 178 | var/turf/closed/mineral/M = T |
156 | | - M.mineralAmt = rand(1, 5) |
| 179 | + M.mineralAmt = rand(1, 5) + max(0,((hardness - 1) * 2)) //2 bonus ore for every hardness above 1 |
157 | 180 | M.environment_type = src.environment_type |
158 | 181 | M.turf_type = src.turf_type |
159 | 182 | M.baseturfs = src.baseturfs |
|
243 | 266 | baseturfs = /turf/open/floor/plating/asteroid/basalt/icemoon |
244 | 267 | initial_gas_mix = ICEMOON_DEFAULT_ATMOS |
245 | 268 |
|
| 269 | +/turf/closed/mineral/random/volcanic/hard |
| 270 | + name = "hardened basalt" |
| 271 | + icon_state = "rock_hard" |
| 272 | + smooth_icon = 'icons/turf/smoothrocks_hard.dmi' |
| 273 | + mineralChance = 15 |
| 274 | + hardness = 2 |
| 275 | + |
| 276 | + mineralSpawnChanceList = list( |
| 277 | + /turf/closed/mineral/uranium/volcanic/hard = 5, /turf/closed/mineral/diamond/volcanic/hard = 1, /turf/closed/mineral/gold/volcanic/hard = 10, /turf/closed/mineral/titanium/volcanic/hard = 11, /turf/closed/mineral/magmite/volcanic/hard = 0.5, |
| 278 | + /turf/closed/mineral/silver/volcanic/hard = 12, /turf/closed/mineral/plasma/volcanic/hard = 20, /turf/closed/mineral/iron/volcanic/hard = 20, /turf/closed/mineral/dilithium/volcanic/hard = 2, /turf/closed/mineral/gibtonite/volcanic/hard = 4, /turf/closed/mineral/bscrystal/volcanic/hard = 2, /turf/open/floor/plating/asteroid/airless/cave/volcanic = 1) |
| 279 | + |
246 | 280 | /turf/closed/mineral/random/snow |
247 | 281 | name = "snowy mountainside" |
248 | 282 | icon = 'icons/turf/mining.dmi' |
|
308 | 342 | initial_gas_mix = LAVALAND_DEFAULT_ATMOS |
309 | 343 | defer_change = TRUE |
310 | 344 |
|
| 345 | +/turf/closed/mineral/iron/volcanic/hard |
| 346 | + smooth_icon = 'icons/turf/smoothrocks_hard.dmi' |
| 347 | + hardness = 2 |
| 348 | + |
311 | 349 | /turf/closed/mineral/iron/ice |
312 | 350 | environment_type = "snow_cavern" |
313 | 351 | icon_state = "icerock_iron" |
|
336 | 374 | initial_gas_mix = LAVALAND_DEFAULT_ATMOS |
337 | 375 | defer_change = TRUE |
338 | 376 |
|
| 377 | +/turf/closed/mineral/uranium/volcanic/hard |
| 378 | + smooth_icon = 'icons/turf/smoothrocks_hard.dmi' |
| 379 | + hardness = 2 |
| 380 | + |
339 | 381 | /turf/closed/mineral/uranium/ice |
340 | 382 | environment_type = "snow_cavern" |
341 | 383 | icon_state = "icerock_Uranium" |
|
364 | 406 | initial_gas_mix = LAVALAND_DEFAULT_ATMOS |
365 | 407 | defer_change = TRUE |
366 | 408 |
|
| 409 | +/turf/closed/mineral/diamond/volcanic/hard |
| 410 | + smooth_icon = 'icons/turf/smoothrocks_hard.dmi' |
| 411 | + hardness = 2 |
| 412 | + |
367 | 413 | /turf/closed/mineral/diamond/ice |
368 | 414 | environment_type = "snow_cavern" |
369 | 415 | icon_state = "icerock_diamond" |
|
392 | 438 | initial_gas_mix = LAVALAND_DEFAULT_ATMOS |
393 | 439 | defer_change = TRUE |
394 | 440 |
|
| 441 | +/turf/closed/mineral/gold/volcanic/hard |
| 442 | + smooth_icon = 'icons/turf/smoothrocks_hard.dmi' |
| 443 | + hardness = 2 |
| 444 | + |
395 | 445 | /turf/closed/mineral/gold/ice |
396 | 446 | environment_type = "snow_cavern" |
397 | 447 | icon_state = "icerock_gold" |
|
420 | 470 | initial_gas_mix = LAVALAND_DEFAULT_ATMOS |
421 | 471 | defer_change = TRUE |
422 | 472 |
|
| 473 | +/turf/closed/mineral/silver/volcanic/hard |
| 474 | + smooth_icon = 'icons/turf/smoothrocks_hard.dmi' |
| 475 | + hardness = 2 |
| 476 | + |
423 | 477 | /turf/closed/mineral/silver/ice |
424 | 478 | environment_type = "snow_cavern" |
425 | 479 | icon_state = "icerock_silver" |
|
448 | 502 | initial_gas_mix = LAVALAND_DEFAULT_ATMOS |
449 | 503 | defer_change = TRUE |
450 | 504 |
|
| 505 | +/turf/closed/mineral/titanium/volcanic/hard |
| 506 | + smooth_icon = 'icons/turf/smoothrocks_hard.dmi' |
| 507 | + hardness = 2 |
| 508 | + |
451 | 509 | /turf/closed/mineral/titanium/ice |
452 | 510 | environment_type = "snow_cavern" |
453 | 511 | icon_state = "icerock_titanium" |
|
476 | 534 | initial_gas_mix = LAVALAND_DEFAULT_ATMOS |
477 | 535 | defer_change = TRUE |
478 | 536 |
|
| 537 | +/turf/closed/mineral/plasma/volcanic/hard |
| 538 | + smooth_icon = 'icons/turf/smoothrocks_hard.dmi' |
| 539 | + hardness = 2 |
| 540 | + |
479 | 541 | /turf/closed/mineral/plasma/ice |
480 | 542 | environment_type = "snow_cavern" |
481 | 543 | icon_state = "icerock_plasma" |
|
528 | 590 | initial_gas_mix = LAVALAND_DEFAULT_ATMOS |
529 | 591 | defer_change = TRUE |
530 | 592 |
|
| 593 | +/turf/closed/mineral/bscrystal/volcanic/hard |
| 594 | + smooth_icon = 'icons/turf/smoothrocks_hard.dmi' |
| 595 | + hardness = 2 |
| 596 | + |
531 | 597 | /turf/closed/mineral/bscrystal/ice |
532 | 598 | environment_type = "snow_cavern" |
533 | 599 | icon_state = "icerock_BScrystal" |
|
555 | 621 | baseturfs = /turf/open/floor/plating/asteroid/basalt/lava_land_surface |
556 | 622 | defer_change = TRUE |
557 | 623 |
|
| 624 | +/turf/closed/mineral/volcanic/lava_land_surface/hard |
| 625 | + smooth_icon = 'icons/turf/smoothrocks_hard.dmi' |
| 626 | + |
558 | 627 | /turf/closed/mineral/ash_rock //wall piece |
559 | 628 | name = "rock" |
560 | 629 | icon = 'icons/turf/mining.dmi' |
|
674 | 743 | det_time = 0 |
675 | 744 | visible_message(span_notice("The chain reaction was stopped! The gibtonite had [det_time] reactions left till the explosion!")) |
676 | 745 |
|
677 | | -/turf/closed/mineral/gibtonite/gets_drilled(mob/user, triggered_by_explosion = 0) |
| 746 | +/turf/closed/mineral/gibtonite/attempt_drill(mob/user, triggered_by_explosion = 0) |
678 | 747 | if(stage == GIBTONITE_UNSTRUCK && mineralAmt >= 1) //Gibtonite deposit is activated |
679 | 748 | playsound(src,'sound/effects/hit_on_shattered_glass.ogg',50,1) |
680 | 749 | explosive_reaction(user, triggered_by_explosion) |
|
707 | 776 | initial_gas_mix = LAVALAND_DEFAULT_ATMOS |
708 | 777 | defer_change = TRUE |
709 | 778 |
|
| 779 | +/turf/closed/mineral/gibtonite/volcanic/hard |
| 780 | + smooth_icon = 'icons/turf/smoothrocks_hard.dmi' |
| 781 | + hardness = 2 |
| 782 | + |
710 | 783 | /turf/closed/mineral/gibtonite/ice |
711 | 784 | environment_type = "snow_cavern" |
712 | 785 | icon_state = "icerock_Gibtonite" |
|
720 | 793 | turf_type = /turf/open/floor/plating/asteroid/snow/ice/icemoon |
721 | 794 | baseturfs = /turf/open/floor/plating/asteroid/snow/ice/icemoon |
722 | 795 | initial_gas_mix = ICEMOON_DEFAULT_ATMOS |
| 796 | + |
| 797 | +/turf/closed/mineral/magmite |
| 798 | + mineralType = /obj/item/magmite |
| 799 | + spread = 0 |
| 800 | + scan_state = "rock_Magmite" |
| 801 | + |
| 802 | +/turf/closed/mineral/magmite/gets_drilled(mob/user, triggered_by_explosion = FALSE) |
| 803 | + if(!triggered_by_explosion) |
| 804 | + mineralAmt = 0 |
| 805 | + ..(user,triggered_by_explosion,TRUE) |
| 806 | + |
| 807 | +/turf/closed/mineral/magmite/volcanic |
| 808 | + environment_type = "basalt" |
| 809 | + turf_type = /turf/open/floor/plating/asteroid/basalt/lava_land_surface |
| 810 | + baseturfs = /turf/open/floor/plating/asteroid/basalt/lava_land_surface |
| 811 | + initial_gas_mix = LAVALAND_DEFAULT_ATMOS |
| 812 | + defer_change = TRUE |
| 813 | + |
| 814 | +/turf/closed/mineral/magmite/volcanic/hard |
| 815 | + smooth_icon = 'icons/turf/smoothrocks_hard.dmi' |
| 816 | + hardness = 2 |
| 817 | + |
0 commit comments