Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions code/game/objects/items/grenades/chameleonbomb.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/obj/item/chameleonbomb
name = "chameleon bomb"
desc = "A devious device that can disguise itself as any object \
and detonate a charge on the poor sod that tries to use it."
icon = 'icons/obj/weapons/grenade.dmi'
icon_state = "plastic-explosive0"
inhand_icon_state = "plastic-explosive"
lefthand_file = 'icons/mob/inhands/weapons/bombs_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/bombs_righthand.dmi'
w_class = WEIGHT_CLASS_TINY
///explosion size as devast, heavy, light
var/explosive_size = list(0,0,3)
///has at any point been disguised, to hide the examine
var/disguised = FALSE
///locked from being redisguised
var/disguiselock = FALSE
var/blowingup

/obj/item/chameleonbomb/examine(mob/user)
. = ..()
if(!disguised)
. += span_notice("You can click an object to set a disguise.")
. += span_notice("Alt-clicking the bomb when disguised will lock the disguise from being changed.")
. += span_danger("Attempting to use the bomb inhand will explode it immediately!")

/obj/item/chameleonbomb/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
. = ..()
if(!can_copy(interacting_with) || disguiselock || SHOULD_SKIP_INTERACTION(interacting_with, src, user))
return NONE
make_copy(interacting_with, user)
return ITEM_INTERACT_SUCCESS

/obj/item/chameleonbomb/proc/can_copy(atom/target)
if(!icon_exists(target.icon, target.icon_state))
return FALSE
if(!isitem(target))
return FALSE
var/obj/item/itemtarget = target
if(itemtarget.w_class >= WEIGHT_CLASS_GIGANTIC)
return FALSE //too big to hold
if(target.alpha != 255)
return FALSE
if(target.invisibility != 0)
Comment thread
Tractor-Maam marked this conversation as resolved.
Outdated
return FALSE
return TRUE

/obj/item/chameleonbomb/proc/make_copy(obj/item/target, mob/user)
disguised = TRUE
playsound(get_turf(src), 'sound/weapons/flash.ogg', 100, TRUE, -6)
to_chat(user, span_notice("Scanned [target]."))
var/obj/item/temp = new /obj/item()
temp.appearance = target.appearance
temp.layer = initial(target.layer) // scanning things in your inventory
SET_PLANE_EXPLICIT(temp, src.plane, src)
appearance = temp.appearance
name = target.name
desc = target.desc
w_class = target.w_class
inhand_icon_state = target.inhand_icon_state
lefthand_file = target.lefthand_file
righthand_file = target.righthand_file
log_bomber(user, "set chameleon bomb disguise to", src, message_admins = FALSE) //dont message admins, its spammable and not actually blowing up yet

/obj/item/chameleonbomb/attack_self(mob/user, modifiers)
Comment thread
Tractor-Maam marked this conversation as resolved.
. = ..()
if(blowingup)
return
blowingup = TRUE
to_chat(user, span_userdanger("\The [src] loses it's decoy, it's a bomb!"))
visible_message(span_danger("The disguise on \the [src] [user] is holding falls! It's a bomb!"), span_userdanger("\The [src] loses it's disguise, it's a bomb!"), span_hear("A warbling sound rings out with a few beeps!"))
playsound(src, 'sound/machines/triple_beep.ogg', 50, FALSE)
log_bomber(user, "activated a chameleon bomb disguised as ", src)
explosion(src, explosive_size[1], explosive_size[2], explosive_size[3])
if(iscarbon(user))
var/mob/living/carbon/carbonuser = user
var/obj/item/bodypart/unluckyarm = carbonuser.get_holding_bodypart_of_item(src)
if(istype(unluckyarm)) //telekinesis bullshit? whatever!
unluckyarm?.dismember(silent = FALSE)
qdel(src)

/obj/item/chameleonbomb/click_alt(mob/user)
. = ..()
if(disguised && !disguiselock)
to_chat(user, span_danger("You activate the disguise lock on the bomb, it is now locked as \the [name]."))
log_bomber(user, "activated chameleonbomb disguise lock on", src)
disguiselock = TRUE
return CLICK_ACTION_SUCCESS
6 changes: 6 additions & 0 deletions code/modules/uplink/uplink_items/explosive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@
cost = 2
item = /obj/item/assembly/flash/explosive

/datum/uplink_item/explosives/chameleonbomb
name = "Chameleon Explosive"
desc = "A stick of C4 with a rudimentary chameleon projector attached to it. Scan an object with it, activate the disguise lock, then give it to your target to use in hand to detonate a small charge on them."
cost = 2
item = /obj/item/chameleonbomb

/datum/uplink_item/explosives/door_charge
name = "Door Charge"
desc = "A small charge that can be rigged to a door, causing it to explode when the handle is moved. Tiny OS and microphone installed for taunting your victims."
Expand Down
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2602,6 +2602,7 @@
#include "code\game\objects\items\grenades\_grenade.dm"
#include "code\game\objects\items\grenades\antigravity.dm"
#include "code\game\objects\items\grenades\atmos_grenades.dm"
#include "code\game\objects\items\grenades\chameleonbomb.dm"
#include "code\game\objects\items\grenades\chem_grenade.dm"
#include "code\game\objects\items\grenades\clusterbuster.dm"
#include "code\game\objects\items\grenades\emgrenade.dm"
Expand Down
Loading