d (#1)
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
|
||||
#define GIBTONITE_QUALITY_HIGH 3
|
||||
#define GIBTONITE_QUALITY_MEDIUM 2
|
||||
#define GIBTONITE_QUALITY_LOW 1
|
||||
|
||||
/**********************Mineral ores**************************/
|
||||
|
||||
/obj/item/weapon/ore
|
||||
@@ -184,10 +189,11 @@
|
||||
item_state = "Gibtonite ore"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
throw_range = 0
|
||||
var/primed = 0
|
||||
var/primed = FALSE
|
||||
var/det_time = 100
|
||||
var/quality = 1 //How pure this gibtonite is, determines the explosion produced by it and is derived from the det_time of the rock wall it was taken from, higher value = better
|
||||
var/quality = GIBTONITE_QUALITY_LOW //How pure this gibtonite is, determines the explosion produced by it and is derived from the det_time of the rock wall it was taken from, higher value = better
|
||||
var/attacher = "UNKNOWN"
|
||||
var/det_timer
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/Destroy()
|
||||
qdel(wires)
|
||||
@@ -213,10 +219,12 @@
|
||||
return
|
||||
if(primed)
|
||||
if(istype(I, /obj/item/device/mining_scanner) || istype(I, /obj/item/device/t_scanner/adv_mining_scanner) || istype(I, /obj/item/device/multitool))
|
||||
primed = 0
|
||||
primed = FALSE
|
||||
if(det_timer)
|
||||
deltimer(det_timer)
|
||||
user.visible_message("The chain reaction was stopped! ...The ore's quality looks diminished.", "<span class='notice'>You stopped the chain reaction. ...The ore's quality looks diminished.</span>")
|
||||
icon_state = "Gibtonite ore"
|
||||
quality = 1
|
||||
quality = GIBTONITE_QUALITY_LOW
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -237,8 +245,8 @@
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/proc/GibtoniteReaction(mob/user, triggered_by = 0)
|
||||
if(!primed)
|
||||
primed = TRUE
|
||||
playsound(src,'sound/effects/hit_on_shattered_glass.ogg',50,1)
|
||||
primed = 1
|
||||
icon_state = "Gibtonite active"
|
||||
var/turf/bombturf = get_turf(src)
|
||||
var/area/A = get_area(bombturf)
|
||||
@@ -260,14 +268,18 @@
|
||||
else
|
||||
user.visible_message("<span class='warning'>[user] strikes \the [src], causing a chain reaction!</span>", "<span class='danger'>You strike \the [src], causing a chain reaction.</span>")
|
||||
log_game("[key_name(user)] has primed a [name] for detonation at [A][COORD(bombturf)]")
|
||||
if(primed)
|
||||
if(quality == 3)
|
||||
explosion(src.loc,2,4,9,adminlog = notify_admins)
|
||||
if(quality == 2)
|
||||
explosion(src.loc,1,2,5,adminlog = notify_admins)
|
||||
if(quality == 1)
|
||||
explosion(src.loc,-1,1,3,adminlog = notify_admins)
|
||||
qdel(src)
|
||||
det_timer = addtimer(CALLBACK(src, .proc/detonate, notify_admins), det_time, TIMER_STOPPABLE)
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/proc/detonate(notify_admins)
|
||||
if(primed)
|
||||
switch(quality)
|
||||
if(GIBTONITE_QUALITY_HIGH)
|
||||
explosion(src,2,4,9,adminlog = notify_admins)
|
||||
if(GIBTONITE_QUALITY_MEDIUM)
|
||||
explosion(src,1,2,5,adminlog = notify_admins)
|
||||
if(GIBTONITE_QUALITY_LOW)
|
||||
explosion(src,0,1,3,adminlog = notify_admins)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/ore/Initialize()
|
||||
..()
|
||||
|
||||
@@ -28,6 +28,11 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/ore_box/examine(mob/living/user)
|
||||
if(Adjacent(user) && istype(user))
|
||||
show_contents(user)
|
||||
. = ..()
|
||||
|
||||
/obj/structure/ore_box/attack_hand(mob/user)
|
||||
if(Adjacent(user))
|
||||
show_contents(user)
|
||||
|
||||
Reference in New Issue
Block a user