Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jabbing other people with overloaders #20463

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
38 changes: 35 additions & 3 deletions code/game/objects/items/ipc_overloaders.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
icon_state = "classic"
w_class = WEIGHT_CLASS_TINY
contained_sprite = TRUE
/// Total number of times an overloader can be used.
var/uses = 2
var/effect_time = 90 SECONDS
var/effects = 4
/// Total length of time between effects.
var/effect_time = 30 SECONDS
/// Determines how many midway overloader effects are experienced.
var/effects = 12

var/static/list/step_up_effects = list(
TRAIT_OVERLOADER_OD_INITIAL = TRAIT_OVERLOADER_OD_MEDIUM,
Expand Down Expand Up @@ -39,12 +42,14 @@
else
. += SPAN_WARNING("It's totally spent.")

// Jabbing yourself with an overloader.
/obj/item/ipc_overloader/attack_self(mob/user)
if(!uses)
to_chat(user, SPAN_WARNING("\The [src] is totally spent."))
return
if(isipc(user))
user.visible_message("<b>[user]</b> jabs themselves with \the [src].", SPAN_NOTICE("You jab yourself with \the [src]."))
user.do_attack_animation(user)
handle_overloader_effect(user)
if(effect_time)
addtimer(CALLBACK(src, PROC_REF(midway_overloader_effect), user, effects), effect_time)
Expand All @@ -53,9 +58,35 @@
return
to_chat(user, SPAN_WARNING("\The [src] has no use for you!"))

// Jabbing someone else with an overloader.
/obj/item/ipc_overloader/attack(mob/living/carbon/human/target_mob, mob/user, target_zone)
if(isliving(target_mob))
user.visible_message(SPAN_WARNING("\The [user] is trying to jab \the [target_mob] with \the [src]!"), SPAN_NOTICE("You are trying to jab \the [target_mob] with \the [src]."))

if(do_mob(user, target_mob, 2 SECONDS))
var/obj/item/organ/external/organ = target_mob.get_organ(target_zone)
user.visible_message(SPAN_WARNING("\The [user] jabs \the [target_mob] with \the [src]!"), SPAN_NOTICE("You jab \the [target_mob] with \the [src]."))

// If synthetic, they receive the overloader effects.
// There are no overt indications to the user that the target mob is synthetic, so this can't be used to check for secret shells.
if(isipc(target_mob))
user.do_attack_animation(target_mob)
handle_overloader_effect(target_mob)
if(effect_time)
addtimer(CALLBACK(src, PROC_REF(midway_overloader_effect), target_mob, effects), effect_time)
uses--
update_icon()

// If not synthetic, and the targeted organ can feel pain, the target feels pain because they just got jabbed with a thumb drive.
else if (organ && ORGAN_CAN_FEEL_PAIN(organ))
to_chat(target_mob, SPAN_DANGER("You feel a sharp prick!"))
target_mob.apply_damage(2, DAMAGE_PAIN, target_zone)

/// Procs immediately after using the overloader.
/obj/item/ipc_overloader/proc/handle_overloader_effect(var/mob/living/carbon/human/target)
handle_overdose(target)

/// Procs as many times as the effect_amount variable, with a time between effects determined by effect_time.
/obj/item/ipc_overloader/proc/midway_overloader_effect(var/mob/living/carbon/human/target, var/effect_amount)
if(effect_amount)
addtimer(CALLBACK(src, PROC_REF(midway_overloader_effect), target, effect_amount - 1), effect_time)
Expand All @@ -64,10 +95,11 @@
finish_overloader_effect(target)
return FALSE

/// Procs once all effects are expended.
/obj/item/ipc_overloader/proc/finish_overloader_effect(var/mob/living/carbon/human/target)
handle_overdose_stepdown(target)

// use traits to step up and down from the overdose effects
/// Uses traits to step up and down from the overdose effects.
/obj/item/ipc_overloader/proc/handle_overdose(var/mob/living/carbon/human/target)
var/added_trait = FALSE
for(var/trait in step_up_effects)
Expand Down
60 changes: 60 additions & 0 deletions html/changelogs/hazelmouse-overloaders.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# - (fixes bugs)
# wip
# - (work in progress)
# qol
# - (quality of life)
# soundadd
# - (adds a sound)
# sounddel
# - (removes a sound)
# rscadd
# - (adds a feature)
# rscdel
# - (removes a feature)
# imageadd
# - (adds an image or sprite)
# imagedel
# - (removes an image or sprite)
# spellcheck
# - (fixes spelling or grammar)
# experiment
# - (experimental change)
# balance
# - (balance changes)
# code_imp
# - (misc internal code change)
# refactor
# - (refactors code)
# config
# - (makes a change to the config files)
# admin
# - (makes changes to administrator tools)
# server
# - (miscellaneous changes to server)
#################################

# Your name.
author: hazelmouse

# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True

# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
changes:
- rscadd: "You can now jab other people with overloaders, after a short delay."
- rscadd: "Overloaders now provide more messages to the user than before."
- code_imp: "Expanded documentation in overloader code."
Loading