diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index c4a20fbd29b..2b3e6cc8690 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -914,13 +914,6 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item)) cost = 5 surplus = 8 -/datum/uplink_item/explosives/chameleonflag - name = "Chameleon Flag" - desc = "A flag that can be disguised as any other known flag. There is a heat sensitive bomb loaded into the pole that will be detonated if the flag is lit on fire." - reference = "CHFLAG" - item = /obj/item/flag/chameleon - cost = 7 - /datum/uplink_item/explosives/grenadier name = "Grenadier's belt" desc = "A belt containing 25 lethally dangerous and destructive grenades." @@ -984,6 +977,14 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item)) cost = 1 surplus = 35 +/datum/uplink_item/stealthy_tools/chameleonflag + name = "Chameleon Flag" + desc = "A flag that can be disguised as any other known flag. There is a hidden spot in the pole to boobytrap the flag with a grenade or minibomb, which will detonate some time after the flag is set on fire." + reference = "CHFLAG" + item = /obj/item/flag/chameleon + cost = 1 + surplus = 35 + /datum/uplink_item/stealthy_tools/syndigaloshes name = "No-Slip Syndicate Shoes" desc = "These allow you to run on wet floors. They do not work on lubricated surfaces." diff --git a/code/game/objects/items/flag.dm b/code/game/objects/items/flag.dm index 4aadebe0dcc..6359f2e9d7a 100644 --- a/code/game/objects/items/flag.dm +++ b/code/game/objects/items/flag.dm @@ -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, "You hide [I] in the [src]. It will detonate some time after the flag is lit on fire.") + 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.name] (JMP).") + 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, "You remove [boobytrap] from the [src].") + 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.name] (JMP).") + 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