rework chameleon flag

Moved to Stealthy Tools from Explosives
Cost reduced from 7 TC to 1
Now start without an explosive, but can be boobytrapped with any
grenade. Buying a syndicate minibomb and boobytrapping results in the
same behaviour and TC as the old chameleon flag. The grenade can only be
removed by the person who installed it.
The flag's hidden explosive still explodes once the flag is done
burning, not immediately.
This commit is contained in:
datlo
2019-01-23 17:13:50 +00:00
parent 2b67df988a
commit 12f100a7b8
2 changed files with 42 additions and 9 deletions
+34 -2
View File
@@ -205,6 +205,8 @@
origin_tech = "syndicate=4;magnets=4"
var/updated_icon_state = null
var/used = FALSE
var/obj/item/grenade/boobytrap = null
var/mob/trapper = null
/obj/item/flag/chameleon/New()
updated_icon_state = icon_state
@@ -236,9 +238,39 @@
desc = chosen_flag.desc
used = TRUE
/obj/item/flag/chameleon/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/grenade) && !boobytrap)
if(user.drop_item())
boobytrap = I
trapper = user
I.forceMove(src)
to_chat(user, "<span class='notice'>You hide [I] in the [src]. It will detonate some time after the flag is lit on fire.</span>")
var/turf/bombturf = get_turf(src)
var/area/A = get_area(bombturf)
message_admins("[key_name_admin(user)] has hidden [I] in the [src] ready for detonation at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>.")
log_game("[key_name(user)] has hidden [I] in the [src] ready for detonation at [A.name] ([bombturf.x],[bombturf.y],[bombturf.z]).")
investigate_log("[key_name(user)] has hidden [I] in the [src] ready for detonation at [A.name] ([bombturf.x],[bombturf.y],[bombturf.z]).", INVESTIGATE_BOMB)
else if(isscrewdriver(I) && boobytrap && user == trapper)
to_chat(user, "<span class='notice'>You remove [boobytrap] from the [src].</span>")
boobytrap.forceMove(get_turf(src))
boobytrap = null
trapper = null
else
..()
/obj/item/flag/chameleon/attackby(obj/item/W, mob/user, params)
if(is_hot(W) && burn_state != ON_FIRE && boobytrap && trapper)
var/turf/bombturf = get_turf(src)
var/area/A = get_area(bombturf)
message_admins("[key_name_admin(user)] has lit the [src] trapped with [boobytrap] by [key_name_admin(trapper)] at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>.")
log_game("[key_name_admin(user)] has lit the [src] trapped with [boobytrap] by [key_name_admin(trapper)] at [A.name] ([bombturf.x],[bombturf.y],[bombturf.z]).")
investigate_log("[key_name_admin(user)] has lit the [src] trapped with [boobytrap] by [key_name_admin(trapper)] at [A.name] ([bombturf.x],[bombturf.y],[bombturf.z]).", INVESTIGATE_BOMB)
..()
/obj/item/flag/chameleon/burn()
explosion(loc,1,2,4,4, flame_range = 4)
qdel(src)
if(boobytrap)
boobytrap.prime()
..()
/obj/item/flag/chameleon/updateFlagIcon()
icon_state = updated_icon_state