diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index 8d871447cd3..7cc2fd9a69e 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -826,6 +826,13 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item)) item = /obj/item/CQC_manual cost = 9 +/datum/uplink_item/stealthy_weapons/cameraflash + name = "High Powered Camera" + desc = "A flash disguised as a camera. This flash has charges but it won't burn out like a regular flash." + reference = "HPC" + item = /obj/item/flash/cameraflash //this part has you buy a regular flash for now + 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 5056c90793f..3ec3ad263ef 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,89 @@ ..() new /obj/effect/temp_visual/borgflash(get_turf(src)) +/obj/item/flash/cameraflash //todo list give it charges, (change the sound to camera sound?) + 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 + 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() //charging works now + 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.") + if(!try_use_flash(user)) + return 0 + + if(iscarbon(M)) + flash_carbon(M, user, 5, 1) + if(overcharged) + M.adjust_fire_stacks(6) + M.IgniteMob() + burn_out() + return 1 + + else if(issilicon(M)) + if(isrobot(M)) + var/mob/living/silicon/robot/R = M + if(R.module) // Perhaps they didn't choose a module yet + for(var/obj/item/borg/combat/shield/S in R.module.modules) + if(R.activated(S)) + add_attack_logs(user, M, "Flashed with [src]") + user.visible_message("[user] tries to overloads [M]'s sensors with the [src.name], but is blocked by [M]'s shield!", "You try to overload [M]'s sensors with the [src.name], but are blocked by [M.p_their()] shield!") + return 1 + add_attack_logs(user, M, "Flashed with [src]") + if(M.flash_eyes(affect_silicon = 1)) + M.Weaken(rand(5,10)) + user.visible_message("[user] overloads [M]'s sensors with the [src.name]!", "You overload [M]'s sensors with the [src.name]!") + return 1 + + user.visible_message("[user] fails to blind [M] with the [src.name]!", "You fail to blind [M] with the [src.name]!") + 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.") + if(!try_use_flash(user)) + return 0 + + user.visible_message("[user]'s [src.name] emits a blinding light!", "Your [src.name] emits a blinding light!") + for(var/mob/living/carbon/M in oviewers(3, null)) + flash_carbon(M, user, 3, 0) + 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."