From 000ce96c1c0d3d090a3bbb9824e7fc3118aab840 Mon Sep 17 00:00:00 2001 From: Darkmight9 <45213755+Darkmight9@users.noreply.github.com> Date: Tue, 4 Dec 2018 12:20:16 -0500 Subject: [PATCH 1/4] updates my work folder --- code/game/objects/items/stacks/nanopaste.dm | 34 ++++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm index aaaa0dbc579..08e871c66a4 100644 --- a/code/game/objects/items/stacks/nanopaste.dm +++ b/code/game/objects/items/stacks/nanopaste.dm @@ -22,16 +22,42 @@ else to_chat(user, "All [R]'s systems are nominal.") - if(istype(M,/mob/living/carbon/human)) //Repairing robolimbs + if(istype(M,/mob/living/carbon/human)) //Repairing robotic limbs and IPCs var/mob/living/carbon/human/H = M var/obj/item/organ/external/S = H.get_organ(user.zone_sel.selecting) if(S && S.is_robotic()) if(S.get_damage()) - S.heal_damage(15, 15, robo_repair = 1) use(1) - user.visible_message("\The [user] applies some nanite paste at[user != M ? " \the [M]'s" : " \the"][S.name] with \the [src].",\ - "You apply some nanite paste at [user == M ? "your" : "[M]'s"] [S.name].") + var/remheal = 15 + var/nremheal = 0 + S.heal_damage(robo_repair = 1) //should in, theory, heal the robotic organs in just the targeted area with it being S instead of E + var/childlist + if(!isnull(S.children)) + childlist = S.children.Copy() + var/parenthealed = FALSE + while(remheal > 0) + var/obj/item/organ/external/E + if(S.get_damage()) + E = S + else if(LAZYLEN(childlist)) + E = pick_n_take(childlist) + if(!E.get_damage() || !E.is_robotic()) + continue + else if(S.parent && !parenthealed) + E = S.parent + parenthealed = TRUE + if(!E.get_damage() || !E.is_robotic()) + break + else + break + nremheal = max(remheal - E.get_damage(), 0) + E.heal_damage(remheal, 0, 0, 1) //Healing Brute + E.heal_damage(0, remheal, 0, 1) //Healing Burn + remheal = nremheal + user.visible_message("\The [user] applies some nanite paste at \the [M]'s [E.name] with \the [src].") + if(H.bleed_rate && H.isSynthetic()) + H.bleed_rate = 0 else to_chat(user, "Nothing to fix here.") else From 8f5f3d44c62456eaf101bd3055eddc1e06c21097 Mon Sep 17 00:00:00 2001 From: Darkmight9 <45213755+Darkmight9@users.noreply.github.com> Date: Sun, 6 Jan 2019 19:05:24 -0500 Subject: [PATCH 2/4] The High Powered Camera a flash disgusied as a camera --- code/datums/uplink_item.dm | 7 ++ code/game/objects/items/devices/flash.dm | 115 ++++++++++++++++++++--- 2 files changed, 107 insertions(+), 15 deletions(-) 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." From c16124a24c8517f6a871b190f99a96b5a56949e7 Mon Sep 17 00:00:00 2001 From: Darkmight9 <45213755+Darkmight9@users.noreply.github.com> Date: Fri, 25 Jan 2019 09:46:31 -0500 Subject: [PATCH 3/4] Some final clean up --- code/datums/uplink_item.dm | 10 ++++++---- code/game/objects/items/devices/flash.dm | 15 +++++---------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index 44f07416978..51ca956757a 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -787,10 +787,12 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item)) 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 + 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 diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index 44ba0949ca3..eda883c0f84 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -188,12 +188,12 @@ ..() new /obj/effect/temp_visual/borgflash(get_turf(src)) -/obj/item/flash/cameraflash //todo list give it charges, (change the sound to camera sound?) +/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 + 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 @@ -213,7 +213,7 @@ processing_objects.Remove(src) return ..() -/obj/item/flash/cameraflash/process() //charging works now +/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 @@ -230,12 +230,7 @@ return 0 if(iscarbon(M)) - flash_carbon(M, user, 5, 1) - if(overcharged) - M.adjust_fire_stacks(6) - M.IgniteMob() - burn_out() - return 1 + flash_carbon(M, user, 5, 1)//removed the overcharge check to trim code else if(issilicon(M)) if(isrobot(M)) @@ -263,7 +258,7 @@ 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) From 6827be92fced9b0f055dc1babfaaac5ff264a2d4 Mon Sep 17 00:00:00 2001 From: Darkmight9 <45213755+Darkmight9@users.noreply.github.com> Date: Sat, 26 Jan 2019 18:48:48 -0500 Subject: [PATCH 4/4] Now with 100% less c+p! --- code/game/objects/items/devices/flash.dm | 55 ++++++------------------ 1 file changed, 14 insertions(+), 41 deletions(-) diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index eda883c0f84..d0b8637b280 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -221,50 +221,23 @@ 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)//removed the overcharge check to trim code - - 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 + 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.") - 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 + 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"