diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index b186d9c9ae6..4042c64df78 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -786,6 +786,15 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item)) item = /obj/item/CQC_manual cost = 9 +/datum/uplink_item/stealthy_weapons/cameraflash + name = "Camera Flash" + desc = "A flash disguised as a camera with a self-charging safety system preventing the flash from burning out.\ + Due to its design, this flash cannot be overcharged like regular flashes can.\ + Useful for stunning borgs and individuals without eye protection or blinding a crowd for a get away." + reference = "CF" + item = /obj/item/flash/cameraflash + cost = 2 + /datum/uplink_item/stealthy_weapons/throwingweapons name = "Box of Throwing Weapons" desc = "A box of shurikens and reinforced bolas from ancient Earth martial arts. They are highly effective \ diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index c24fcc3c68a..d0b8637b280 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -17,7 +17,8 @@ var/last_used = 0 //last world.time it was used. var/battery_panel = 0 //whether the flash can be modified with a cell or not var/overcharged = 0 //if overcharged the flash will set people on fire then immediately burn out (does so even if it doesn't blind them). - + var/can_overcharge = TRUE //set this to FALSE if you don't want your flash to be overcharge capable + var/use_sound = 'sound/weapons/flash.ogg' /obj/item/flash/proc/clown_check(mob/user) if(user && (CLUMSY in user.mutations) && prob(50)) @@ -26,19 +27,20 @@ return 1 /obj/item/flash/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/screwdriver)) - if(battery_panel) - to_chat(user, "You close the battery compartment on the [src].") - battery_panel = 0 - else - to_chat(user, "You open the battery compartment on the [src].") - battery_panel = 1 - if(battery_panel && !overcharged) - if(istype(W, /obj/item/stock_parts/cell)) - to_chat(user, "You jam the cell into battery compartment on the [src].") - qdel(W) - overcharged = 1 - overlays += "overcharge" + if(can_overcharge) + if(istype(W, /obj/item/screwdriver)) + if(battery_panel) + to_chat(user, "You close the battery compartment on the [src].") + battery_panel = 0 + else + to_chat(user, "You open the battery compartment on the [src].") + battery_panel = 1 + if(battery_panel && !overcharged) + if(istype(W, /obj/item/stock_parts/cell)) + to_chat(user, "You jam the cell into battery compartment on the [src].") + qdel(W) + overcharged = 1 + overlays += "overcharge" /obj/item/flash/random/New() ..() @@ -71,7 +73,7 @@ if(broken) return 0 - playsound(src.loc, 'sound/weapons/flash.ogg', 100, 1) + playsound(src.loc, use_sound, 100, 1) flick("[initial(icon_state)]2", src) times_used++ @@ -186,6 +188,57 @@ ..() new /obj/effect/temp_visual/borgflash(get_turf(src)) +/obj/item/flash/cameraflash + name = "camera" + icon = 'icons/obj/items.dmi' + desc = "A polaroid camera. 10 photos left." + icon_state = "camera" + item_state = "electropack" //spelling, a coders worst enemy. This part gave me trouble for a while. + w_class = WEIGHT_CLASS_SMALL + slot_flags = SLOT_BELT + can_overcharge = FALSE + var/flash_max_charges = 5 + var/flash_cur_charges = 5 + var/charge_tick = 0 + use_sound = 'sound/items/polaroid1.ogg' + +/obj/item/flash/cameraflash/burn_out() //stops from burning out + return + +/obj/item/flash/cameraflash/New() + ..() + processing_objects.Add(src) + +/obj/item/flash/cameraflash/Destroy() + processing_objects.Remove(src) + return ..() + +/obj/item/flash/cameraflash/process() //this and the two parts above are part of the charge system. + charge_tick++ + if(charge_tick < 10) + return FALSE + charge_tick = 0 + flash_cur_charges = min(flash_cur_charges+1, flash_max_charges) + return TRUE + +/obj/item/flash/cameraflash/attack(mob/living/M, mob/user) + if(flash_cur_charges > 0) + flash_cur_charges -= 1 + to_chat(user, "[src] now has [flash_cur_charges] charge\s.") + ..() + else + to_chat(user, "\The [src] needs time to recharge!") + return + +/obj/item/flash/cameraflash/attack_self(mob/living/carbon/user, flag = 0) + if(flash_cur_charges > 0) + flash_cur_charges -= 1 + to_chat(user, "[src] now has [flash_cur_charges] charge\s.") + ..() + else + to_chat(user, "\The [src] needs time to recharge!") + return + /obj/item/flash/memorizer name = "memorizer" desc = "If you see this, you're not likely to remember it any time soon."