diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 49f3f5149c73c..b629ccd856b53 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -570,3 +570,61 @@ GLOBAL_LIST_INIT(click_catchers, create_click_catcher()) /obj/screen/click_catcher/IsAutoclickable() return TRUE + +// [SIERRA-ADD] +/mob/living/carbon/human/AltClickOn(atom/A) + if(get_dist(src, A) > 1) + return + if(!stat && mind && ismob(A) && (A != src) && (src.species.name == SPECIES_ADHERENT)) + var/mob/living/carbon/human/adherent = src + var/obj/item/organ/internal/cell/adherent/adherent_core = adherent.internal_organs_by_name[BP_CELL] + if(adherent_core.ready_to_charge) + var/mob/living/carbon/human/target_human = A + var/mob/living/target = A + var/obj/item/cell/target_cell + var/obj/item/cell/adherent_cell + var/obj/item/organ/internal/cell/acell = locate() in adherent.internal_organs + if(acell && acell.cell) + adherent_cell = acell.cell + + if(adherent_cell && adherent_cell.charge <= 2000) + to_chat(src, SPAN_WARNING("Your cell charge is too low for this action.")) + return + + if(ishuman(target_human)) + var/obj/item/organ/internal/cell/cell = locate() in target_human.internal_organs + if(cell && cell.cell) + target_cell = cell.cell + else if(isrobot(target)) + var/mob/living/silicon/robot/robot = target + target_cell = robot.get_cell() + + target.visible_message(SPAN_WARNING("There is a loud crack and the smell of ozone as \the [adherent] touches \the [target].")) + playsound(loc, 'sound/effects/snap.ogg', 50, 1) + + if(target_cell) + if(target_cell.maxcharge > (target_cell.charge + 2000)) + target_cell.charge += 2000 + else + target_cell.charge = target_cell.maxcharge + to_chat(target, SPAN_NOTICE("Your [target_cell] has been charged.")) + adherent_cell.charge -= 2000 + if(istype(target_human) && target_human.species.name == SPECIES_ADHERENT) + next_click = world.time + 2 SECONDS + return + if(isrobot(target)) + target.apply_damage(100, DAMAGE_BURN, def_zone = src.zone_sel.selecting) + visible_message(SPAN_DANGER("[adherent] touches [target] with bright electrical arc connecting them.")) + to_chat(target, SPAN_DANGER("You detect damage to your components!")) + else if(ishuman(target)) + target.electrocute_act(100, src, def_zone = src.zone_sel.selecting) + visible_message(SPAN_DANGER("With bright electrical flash [adherent] touches [target] using it's tentacles.")) + else + target.apply_damage(100, DAMAGE_BURN, def_zone = src.zone_sel.selecting) + visible_message(SPAN_DANGER("With bright electrical flash [adherent] touches [target] using it's tentacles.")) + admin_attack_log(src, target, "Has electrocuted", "Has been electrocuted", "electrocuted") + target.throw_at(get_step(target,get_dir(src,target)), 5, 10) + next_click = world.time + 2 SECONDS + return + ..() +// [SIERRA-ADD] diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index 93acd91315fb4..94635a8dce8ff 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -114,3 +114,23 @@ return var/list/rgb = rgb2num(new_skin) change_skin_color(rgb[1], rgb[2], rgb[3]) + +// [SIERRA-ADD] +/mob/living/carbon/human/proc/toggle_emergency_discharge() + set category = "Abilities" + set name = "Toggle emergency discharge" + set desc = "Allows you to overload your piezo capacitors." + + var/mob/living/carbon/human/adherent = src + var/obj/item/organ/internal/cell/adherent/adherent_core = adherent.internal_organs_by_name[BP_CELL] + if(!adherent_core.ready_to_charge) + adherent_core.ready_to_charge = TRUE + to_chat(src, SPAN_WARNING("The emergency discharge is ready for use.")) + to_chat(src, SPAN_GOOD("You are ready to discharge, use alt+click on target to electrocute them.")) + adherent.visible_message(SPAN_WARNING("You hear silent crackle sounds from [adherent] tentacles")) + playsound(loc, 'sound/effects/discharge_on.ogg', 40, 1) + return + + adherent_core.ready_to_charge = FALSE + to_chat(src, SPAN_WARNING("You have relieved the tension of your tentacles.")) +// [SIERRA-ADD] diff --git a/code/modules/organs/internal/species/adherent.dm b/code/modules/organs/internal/species/adherent.dm index 523541e488dcf..0c135e0d02217 100644 --- a/code/modules/organs/internal/species/adherent.dm +++ b/code/modules/organs/internal/species/adherent.dm @@ -126,7 +126,9 @@ icon = 'icons/mob/human_races/species/adherent/organs.dmi' icon_state = "cell" cell = /obj/item/cell/hyper - +// [SIERRA-ADD] + var/ready_to_charge +// [SIERRA-ADD] /obj/item/organ/internal/powered/cooling_fins name = "cooling fins" gender = PLURAL diff --git a/code/modules/species/station/adherent.dm b/code/modules/species/station/adherent.dm index 1fc2b6131d135..dcc1e2a54e4a9 100644 --- a/code/modules/species/station/adherent.dm +++ b/code/modules/species/station/adherent.dm @@ -109,6 +109,12 @@ "Jet" = "_black" ) +// [SIERRA-ADD] + inherent_verbs = list( + /mob/living/carbon/human/proc/toggle_emergency_discharge + ) +// [SIERRA-ADD] + /datum/species/adherent/New() equip_adjust = list( "[slot_l_hand_str]" = list("[NORTH]" = list("x" = 0, "y" = 14), "[EAST]" = list("x" = 0, "y" = 14), "[SOUTH]" = list("x" = 0, "y" = 14), "[WEST]" = list("x" = 0, "y" = 14)), diff --git a/sound/effects/discharge_on.ogg b/sound/effects/discharge_on.ogg new file mode 100644 index 0000000000000..dcb9e407eb65c Binary files /dev/null and b/sound/effects/discharge_on.ogg differ