Porting the twohanded component.
This commit is contained in:
@@ -194,7 +194,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
|
||||
item_state = "slag"
|
||||
singular_name = "slag chunk"
|
||||
|
||||
/obj/item/twohanded/required/gibtonite
|
||||
/obj/item/gibtonite
|
||||
name = "gibtonite ore"
|
||||
desc = "Extremely explosive if struck with mining equipment, Gibtonite is often used by miners to speed up their work by using it as a mining charge. This material is illegal to possess by unauthorized personnel under space law."
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
@@ -208,12 +208,16 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
|
||||
var/attacher = "UNKNOWN"
|
||||
var/det_timer
|
||||
|
||||
/obj/item/twohanded/required/gibtonite/Destroy()
|
||||
/obj/item/gibtonite/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/two_handed, require_twohands=TRUE)
|
||||
|
||||
/obj/item/gibtonite/Destroy()
|
||||
qdel(wires)
|
||||
wires = null
|
||||
return ..()
|
||||
|
||||
/obj/item/twohanded/required/gibtonite/attackby(obj/item/I, mob/user, params)
|
||||
/obj/item/gibtonite/attackby(obj/item/I, mob/user, params)
|
||||
if(!wires && istype(I, /obj/item/assembly/igniter))
|
||||
user.visible_message("[user] attaches [I] to [src].", "<span class='notice'>You attach [I] to [src].</span>")
|
||||
wires = new /datum/wires/explosive/gibtonite(src)
|
||||
@@ -241,22 +245,22 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/twohanded/required/gibtonite/attack_self(user)
|
||||
/obj/item/gibtonite/attack_self(user)
|
||||
if(wires)
|
||||
wires.interact(user)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/twohanded/required/gibtonite/bullet_act(obj/item/projectile/P)
|
||||
/obj/item/gibtonite/bullet_act(obj/item/projectile/P)
|
||||
GibtoniteReaction(P.firer)
|
||||
return ..()
|
||||
|
||||
/obj/item/twohanded/required/gibtonite/ex_act()
|
||||
/obj/item/gibtonite/ex_act()
|
||||
GibtoniteReaction(null, 1)
|
||||
|
||||
|
||||
|
||||
/obj/item/twohanded/required/gibtonite/proc/GibtoniteReaction(mob/user, triggered_by = 0)
|
||||
/obj/item/gibtonite/proc/GibtoniteReaction(mob/user, triggered_by = 0)
|
||||
if(!primed)
|
||||
primed = TRUE
|
||||
playsound(src,'sound/effects/hit_on_shattered_glass.ogg',50,1)
|
||||
@@ -282,7 +286,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
|
||||
log_game("[key_name(user)] has primed a [name] for detonation at [AREACOORD(bombturf)]")
|
||||
det_timer = addtimer(CALLBACK(src, .proc/detonate, notify_admins), det_time, TIMER_STOPPABLE)
|
||||
|
||||
/obj/item/twohanded/required/gibtonite/proc/detonate(notify_admins)
|
||||
/obj/item/gibtonite/proc/detonate(notify_admins)
|
||||
if(primed)
|
||||
switch(quality)
|
||||
if(GIBTONITE_QUALITY_HIGH)
|
||||
|
||||
Reference in New Issue
Block a user