Merge pull request #1138 from Citadel-Station-13/upstream-merge-27545

[MIRROR] Gibtonite now uses defines
This commit is contained in:
LetterJay
2017-05-25 09:43:50 -05:00
committed by GitHub
2 changed files with 18 additions and 12 deletions
+6
View File
@@ -411,3 +411,9 @@ GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
#define NO_FIELD 0
#define FIELD_TURF 1
#define FIELD_EDGE 2
//gibtonite state defines
#define GIBTONITE_UNSTRUCK 0
#define GIBTONITE_ACTIVE 1
#define GIBTONITE_STABLE 2
#define GIBTONITE_DETONATE 3
+12 -12
View File
@@ -379,7 +379,7 @@
spread = 0
scan_state = "rock_Gibtonite"
var/det_time = 8 //Countdown till explosion, but also rewards the player for how close you were to detonation when you defuse it
var/stage = 0 //How far into the lifecycle of gibtonite we are, 0 is untouched, 1 is active and attempting to detonate, 2 is benign and ready for extraction
var/stage = GIBTONITE_UNSTRUCK //How far into the lifecycle of gibtonite we are
var/activated_ckey = null //These are to track who triggered the gibtonite deposit for logging purposes
var/activated_name = null
var/mutable_appearance/activated_overlay
@@ -395,12 +395,12 @@
..()
/turf/closed/mineral/gibtonite/proc/explosive_reaction(mob/user = null, triggered_by_explosion = 0)
if(stage == 0)
if(stage == GIBTONITE_UNSTRUCK)
activated_overlay = mutable_appearance('icons/turf/smoothrocks.dmi', "rock_Gibtonite_active", ON_EDGED_TURF_LAYER)
add_overlay(activated_overlay)
name = "gibtonite deposit"
desc = "An active gibtonite reserve. Run!"
stage = 1
stage = GIBTONITE_ACTIVE
visible_message("<span class='danger'>There was gibtonite inside! It's going to explode!</span>")
var/turf/bombturf = get_turf(src)
var/area/A = get_area(bombturf)
@@ -422,38 +422,38 @@
/turf/closed/mineral/gibtonite/proc/countdown(notify_admins = 0)
set waitfor = 0
while(istype(src, /turf/closed/mineral/gibtonite) && stage == 1 && det_time > 0 && mineralAmt >= 1)
while(istype(src, /turf/closed/mineral/gibtonite) && stage == GIBTONITE_ACTIVE && det_time > 0 && mineralAmt >= 1)
det_time--
sleep(5)
if(istype(src, /turf/closed/mineral/gibtonite))
if(stage == 1 && det_time <= 0 && mineralAmt >= 1)
if(stage == GIBTONITE_ACTIVE && det_time <= 0 && mineralAmt >= 1)
var/turf/bombturf = get_turf(src)
mineralAmt = 0
stage = 3
stage = GIBTONITE_DETONATE
explosion(bombturf,1,3,5, adminlog = notify_admins)
/turf/closed/mineral/gibtonite/proc/defuse()
if(stage == 1)
if(stage == GIBTONITE_ACTIVE)
cut_overlay(activated_overlay)
activated_overlay.icon_state = "rock_Gibtonite_inactive"
add_overlay(activated_overlay)
desc = "An inactive gibtonite reserve. The ore can be extracted."
stage = 2
stage = GIBTONITE_STABLE
if(det_time < 0)
det_time = 0
visible_message("<span class='notice'>The chain reaction was stopped! The gibtonite had [src.det_time] reactions left till the explosion!</span>")
/turf/closed/mineral/gibtonite/gets_drilled(mob/user, triggered_by_explosion = 0)
if(stage == 0 && mineralAmt >= 1) //Gibtonite deposit is activated
if(stage == GIBTONITE_UNSTRUCK && mineralAmt >= 1) //Gibtonite deposit is activated
playsound(src,'sound/effects/hit_on_shattered_glass.ogg',50,1)
explosive_reaction(user, triggered_by_explosion)
return
if(stage == 1 && mineralAmt >= 1) //Gibtonite deposit goes kaboom
if(stage == GIBTONITE_ACTIVE && mineralAmt >= 1) //Gibtonite deposit goes kaboom
var/turf/bombturf = get_turf(src)
mineralAmt = 0
stage = 3
stage = GIBTONITE_DETONATE
explosion(bombturf,1,2,5, adminlog = 0)
if(stage == 2) //Gibtonite deposit is now benign and extractable. Depending on how close you were to it blowing up before defusing, you get better quality ore.
if(stage == GIBTONITE_STABLE) //Gibtonite deposit is now benign and extractable. Depending on how close you were to it blowing up before defusing, you get better quality ore.
var/obj/item/weapon/twohanded/required/gibtonite/G = new /obj/item/weapon/twohanded/required/gibtonite/(src)
if(det_time <= 0)
G.quality = 3