From 9b8261fe1176b061e69365f3f5d5bba8809cf058 Mon Sep 17 00:00:00 2001 From: Erika Fox <94164348+Erikafox@users.noreply.github.com> Date: Sun, 5 Jan 2025 23:02:29 -0500 Subject: [PATCH] Mildly refactors jittering (#3936) ## About The Pull Request adds a proc for jittering so its less hacked together around the place. makes it enforce a max jitter value that should rarely if ever get hit. ## Why It's Good For The Game i dislike the mega jittering from weird edgecases. ## Changelog :cl: del: honkbots code: jittering has been mildly refactored. please report any weird jitterings. /:cl: --- check_regex.yaml | 2 +- code/datums/brain_damage/phobia.dm | 8 +- code/datums/brain_damage/severe.dm | 4 +- code/datums/components/spooky.dm | 6 +- code/datums/diseases/anxiety.dm | 2 +- code/datums/martial/cqc.dm | 2 +- code/datums/mutations/body.dm | 2 +- code/datums/status_effects/buffs.dm | 2 +- code/datums/status_effects/debuffs.dm | 2 +- code/datums/traits/negative.dm | 2 +- code/game/objects/items/defib.dm | 6 +- code/game/objects/items/melee/stunbaton.dm | 4 +- code/game/objects/items/robot/robot_items.dm | 4 +- .../items/stacks/sheets/sheet_types.dm | 7 - code/game/objects/items/storage/boxes.dm | 21 - code/game/objects/structures/flora.dm | 2 +- code/modules/antagonists/borer/borer.dm | 2 +- .../antagonists/changeling/powers/shriek.dm | 2 +- code/modules/cargo/bounties/assistant.dm | 6 - code/modules/flufftext/Hallucination.dm | 2 +- code/modules/mining/abandoned_crates.dm | 2 - .../modules/mob/living/carbon/alien/organs.dm | 2 +- .../mob/living/carbon/carbon_defense.dm | 4 +- .../mob/living/carbon/human/examine.dm | 10 +- .../mob/living/carbon/human/species.dm | 2 +- code/modules/mob/living/carbon/life.dm | 4 +- code/modules/mob/living/living.dm | 2 +- .../living/simple_animal/bot/construction.dm | 35 -- .../mob/living/simple_animal/bot/honkbot.dm | 370 ------------------ .../hostile/mining_mobs/basilisk.dm | 2 +- code/modules/mob/mob_defines.dm | 2 +- code/modules/mob/status_procs.dm | 14 +- .../reagents/alcohol_reagents/base_drinks.dm | 2 +- .../reagents/alcohol_reagents/mixed_drinks.dm | 30 +- .../reagents/cat2_medicine_reagents.dm | 2 +- .../chemistry/reagents/drink_reagents.dm | 18 +- .../chemistry/reagents/drug_reagents.dm | 32 +- .../chemistry/reagents/food_reagents.dm | 6 +- .../chemistry/reagents/medicine_reagents.dm | 81 ++-- .../chemistry/reagents/other_reagents.dm | 8 +- .../chemistry/reagents/trickwine_reagents.dm | 2 +- .../nanites/nanite_programs/healing.dm | 2 +- code/modules/surgery/organs/ears.dm | 4 +- code/modules/surgery/organs/heart.dm | 2 +- code/modules/surgery/organs/stomach.dm | 2 +- shiptest.dme | 1 - 46 files changed, 132 insertions(+), 597 deletions(-) delete mode 100644 code/modules/mob/living/simple_animal/bot/honkbot.dm diff --git a/check_regex.yaml b/check_regex.yaml index 335b1b005c74..ac3252bc9cdf 100644 --- a/check_regex.yaml +++ b/check_regex.yaml @@ -38,7 +38,7 @@ standards: - exactly: [ - 262, + 261, "non-bitwise << uses", '(?You are paralyzed with fear!") owner.Stun(70) - owner.Jitter(8) + owner.set_jitter(8) if(2) owner.emote("scream") - owner.Jitter(5) + owner.set_jitter(5) owner.say("AAAAH!!", forced = "phobia") if(reason) owner.pointed(reason) if(3) to_chat(owner, "You shut your eyes in terror!") - owner.Jitter(5) + owner.set_jitter(5) owner.blind_eyes(10) if(4) owner.dizziness += 10 owner.confused += 10 - owner.Jitter(10) + owner.set_jitter(10) owner.stuttering += 10 // Defined phobia types for badminry, not included in the RNG trauma pool to avoid diluting. diff --git a/code/datums/brain_damage/severe.dm b/code/datums/brain_damage/severe.dm index 979c43e8e13e..eab457ddb0c6 100644 --- a/code/datums/brain_damage/severe.dm +++ b/code/datums/brain_damage/severe.dm @@ -191,12 +191,12 @@ to_chat(owner, "You can't stop shaking...") owner.dizziness += 20 owner.confused += 20 - owner.Jitter(20) + owner.set_jitter(20) else to_chat(owner, "You feel weak and scared! If only you weren't alone...") owner.dizziness += 20 owner.confused += 20 - owner.Jitter(20) + owner.set_jitter(20) owner.adjustStaminaLoss(50) if(3, 4) diff --git a/code/datums/components/spooky.dm b/code/datums/components/spooky.dm index 9e75259536ef..11e90afd10bb 100644 --- a/code/datums/components/spooky.dm +++ b/code/datums/components/spooky.dm @@ -15,7 +15,7 @@ var/mob/living/carbon/human/U = user if(!istype(U.dna.species, /datum/species/skeleton)) U.adjustStaminaLoss(35) //Extra Damage - U.Jitter(35) + U.set_jitter(35) U.stuttering = 20 if(U.getStaminaLoss() > 95) to_chat(U, "Your ears weren't meant for this spectral sound.") @@ -29,7 +29,7 @@ if(istype(H.dna.species, /datum/species/zombie)) H.adjustStaminaLoss(25) H.Paralyze(15) //zombies can't resist the doot - C.Jitter(35) + C.set_jitter(35) C.stuttering = 20 if((!istype(H.dna.species, /datum/species/skeleton)) && (!istype(H.dna.species, /datum/species/android)) && (!istype(H.dna.species, /datum/species/jelly))) C.adjustStaminaLoss(25) //boneless humanoids don't lose the will to live @@ -37,7 +37,7 @@ spectral_change(H) else //the sound will spook monkeys. - C.Jitter(15) + C.set_jitter(15) C.stuttering = 20 /datum/component/spooky/proc/spectral_change(mob/living/carbon/human/H, mob/user) diff --git a/code/datums/diseases/anxiety.dm b/code/datums/diseases/anxiety.dm index cf810b9fdbe2..ea6cbe22d4a5 100644 --- a/code/datums/diseases/anxiety.dm +++ b/code/datums/diseases/anxiety.dm @@ -32,7 +32,7 @@ affected_mob.visible_message("[affected_mob] stumbles around in a panic.", \ "You have a panic attack!") affected_mob.confused += (rand(6,8)) - affected_mob.jitteriness += (rand(6,8)) + affected_mob.adjust_jitter(rand(6,8)) if(prob(2)) affected_mob.visible_message("[affected_mob] coughs up butterflies!", \ "You cough up butterflies!") diff --git a/code/datums/martial/cqc.dm b/code/datums/martial/cqc.dm index 8a1557f4909e..01730aa9f598 100644 --- a/code/datums/martial/cqc.dm +++ b/code/datums/martial/cqc.dm @@ -186,7 +186,7 @@ playsound(get_turf(D), 'sound/weapons/cqchit1.ogg', 50, TRUE, -1) if(I && D.temporarilyRemoveItemFromInventory(I)) A.put_in_hands(I) - D.Jitter(2) + D.adjust_jitter(2) D.apply_damage(5, A.dna.species.attack_type) else D.visible_message("[A] fails to disarm [D]!", \ diff --git a/code/datums/mutations/body.dm b/code/datums/mutations/body.dm index 4b885412165a..0954c2a35bc8 100644 --- a/code/datums/mutations/body.dm +++ b/code/datums/mutations/body.dm @@ -13,7 +13,7 @@ if(prob(1 * GET_MUTATION_SYNCHRONIZER(src)) && owner.stat == CONSCIOUS) owner.visible_message("[owner] starts having a seizure!", "You have a seizure!") owner.Unconscious(200 * GET_MUTATION_POWER(src)) - owner.Jitter(1000 * GET_MUTATION_POWER(src)) + owner.adjust_jitter(1000 * GET_MUTATION_POWER(src), 0, 1500) SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, "epilepsy", /datum/mood_event/epilepsy) addtimer(CALLBACK(src, PROC_REF(jitter_less)), 90) diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index 6ffd5f403966..6cdde64c5fa6 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -389,7 +389,7 @@ /datum/status_effect/good_music/tick() if(owner.can_hear()) owner.dizziness = max(0, owner.dizziness - 2) - owner.jitteriness = max(0, owner.jitteriness - 2) + owner.adjust_jitter(owner.jitteriness - 2, max = 0) owner.confused = max(0, owner.confused - 1) SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, "goodmusic", /datum/mood_event/goodmusic) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 6d803d98ec47..cd79111d52f0 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -568,7 +568,7 @@ var/obj/item/I = H.get_active_held_item() if(I && H.dropItemToGround(I)) H.visible_message("[H]'s hand convulses, and they drop their [I.name]!","Your hand convulses violently, and you drop what you were holding!") - H.jitteriness += 5 + H.adjust_jitter(5) /atom/movable/screen/alert/status_effect/convulsing name = "Shaky Hands" diff --git a/code/datums/traits/negative.dm b/code/datums/traits/negative.dm index 306c3d6b8d50..8673e7aa135f 100644 --- a/code/datums/traits/negative.dm +++ b/code/datums/traits/negative.dm @@ -490,7 +490,7 @@ switch(rand(1,3)) if(1) - quirk_holder.Jitter(10) + quirk_holder.set_jitter(10) msg += "causing you to start fidgeting!" if(2) quirk_holder.stuttering = max(3, quirk_holder.stuttering) diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index 89b73a0ffa9b..46a74a617954 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -453,7 +453,7 @@ "[user] touches [M] with [src]!") M.adjustStaminaLoss(60) M.Knockdown(75) - M.Jitter(50) + M.adjust_jitter(50) M.apply_status_effect(STATUS_EFFECT_CONVULSING) playsound(src, 'sound/machines/defib_zap.ogg', 50, TRUE, -1) if(HAS_TRAIT(M,MOB_ORGANIC)) @@ -511,7 +511,7 @@ H.apply_damage(50, BURN, BODY_ZONE_CHEST) log_combat(user, H, "overloaded the heart of", defib) H.Paralyze(100) - H.Jitter(100) + H.adjust_jitter(100) if(req_defib) defib.deductcharge(revivecost) cooldown = TRUE @@ -590,7 +590,7 @@ H.grab_ghost() H.revive(full_heal = FALSE, admin_revive = FALSE) H.emote("gasp") - H.Jitter(100) + H.adjust_jitter(100) SEND_SIGNAL(H, COMSIG_LIVING_MINOR_SHOCK) log_combat(user, H, "revived", defib) if(req_defib) diff --git a/code/game/objects/items/melee/stunbaton.dm b/code/game/objects/items/melee/stunbaton.dm index 152bc76d5f80..e51bcdc059b9 100644 --- a/code/game/objects/items/melee/stunbaton.dm +++ b/code/game/objects/items/melee/stunbaton.dm @@ -217,7 +217,7 @@ return FALSE /// After a target is hit, we do a chunk of stamina damage, along with other effects. /// After a period of time, we then check to see what stun duration we give. - L.Jitter(20) + L.set_jitter(20) L.confused = max(confusion_amt, L.confused) L.stuttering = max(8, L.stuttering) L.apply_damage(stamina_loss_amt, STAMINA, BODY_ZONE_CHEST) @@ -561,5 +561,5 @@ return span_danger("The baton is still charging!") /obj/item/melee/classic_baton/telescopic/contractor_baton/additional_effects_carbon(mob/living/target, mob/living/user) - target.Jitter(20) + target.adjust_jitter(20) target.stuttering += 20 diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index 0b83489ed8c5..84f4ffa1f0a1 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -321,12 +321,12 @@ if(1) C.confused += 5 C.stuttering += 10 - C.Jitter(10) + C.set_jitter(10) if(2) C.Paralyze(40) C.confused += 10 C.stuttering += 15 - C.Jitter(25) + C.set_jitter(25) playsound(get_turf(src), 'sound/machines/warning-buzzer.ogg', 130, 3) cooldown = world.time + 600 user.log_message("used an emagged Cyborg Harm Alarm in [AREACOORD(user)]", LOG_ATTACK) diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 48dc33b79c3d..daa7f529d84f 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -422,13 +422,6 @@ GLOBAL_LIST_INIT(cardboard_recipes, list ( \ amount = 50 /obj/item/stack/sheet/cardboard/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/stamp/clown) && !istype(loc, /obj/item/storage)) - var/atom/droploc = drop_location() - if(use(1)) - playsound(I, 'sound/items/bikehorn.ogg', 50, TRUE, -1) - to_chat(user, "You stamp the cardboard! It's a clown box! Honk!") - if (amount >= 0) - new/obj/item/storage/box/clown(droploc) //bugfix if(istype(I, /obj/item/stamp/chameleon) && !istype(loc, /obj/item/storage)) var/atom/droploc = drop_location() if(use(1)) diff --git a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm index ef5e5cb31195..a43109109235 100644 --- a/code/game/objects/items/storage/boxes.dm +++ b/code/game/objects/items/storage/boxes.dm @@ -803,27 +803,6 @@ playsound(loc, "rustle", 50, TRUE, -5) user.visible_message("[user] hugs \the [src].","You hug \the [src].") -/////clown box & honkbot assembly -/obj/item/storage/box/clown - name = "clown box" - desc = "A colorful cardboard box for the clown" - illustration = "clown" - -/obj/item/storage/box/clown/attackby(obj/item/I, mob/user, params) - if((istype(I, /obj/item/bodypart/l_arm/robot)) || (istype(I, /obj/item/bodypart/r_arm/robot))) - if(contents.len) //prevent accidently deleting contents - to_chat(user, "You need to empty [src] out first!") - return - if(!user.temporarilyRemoveItemFromInventory(I)) - return - qdel(I) - to_chat(user, "You add some wheels to the [src]! You've got a honkbot assembly now! Honk!") - var/obj/item/bot_assembly/honkbot/A = new - qdel(src) - user.put_in_hands(A) - else - return ..() - ////// /obj/item/storage/box/hug/medical/PopulateContents() new /obj/item/stack/medical/bruise_pack(src) diff --git a/code/game/objects/structures/flora.dm b/code/game/objects/structures/flora.dm index 1698f90ec7cd..6e4fe25167c1 100644 --- a/code/game/objects/structures/flora.dm +++ b/code/game/objects/structures/flora.dm @@ -883,7 +883,7 @@ else if (isliving(user)) var/mob/living/L = user L.Immobilize(100, TRUE) - L.jitteriness += 50 + L.adjust_jitter(50) L.adjustToxLoss(66) return 1 else ..() diff --git a/code/modules/antagonists/borer/borer.dm b/code/modules/antagonists/borer/borer.dm index 4a3f73da57c5..26a597977614 100644 --- a/code/modules/antagonists/borer/borer.dm +++ b/code/modules/antagonists/borer/borer.dm @@ -637,7 +637,7 @@ GLOBAL_VAR_INIT(total_borer_hosts_needed, 3) to_chat(src, "You send a jolt of energy to your host, reviving them!") victim.grab_ghost(force = TRUE) //brings the host back, no eggscape C.emote("gasp") - C.Jitter(100) + C.set_jitter(100) /mob/living/simple_animal/borer/verb/bond_brain() set category = "Borer" diff --git a/code/modules/antagonists/changeling/powers/shriek.dm b/code/modules/antagonists/changeling/powers/shriek.dm index 2a3b2e1fbe35..d0ca0721c374 100644 --- a/code/modules/antagonists/changeling/powers/shriek.dm +++ b/code/modules/antagonists/changeling/powers/shriek.dm @@ -16,7 +16,7 @@ if(!C.mind || !C.mind.has_antag_datum(/datum/antagonist/changeling)) C.adjustEarDamage(0, 30) C.confused += 25 - C.Jitter(50) + C.set_jitter(50) else SEND_SOUND(C, sound('sound/effects/screech.ogg')) diff --git a/code/modules/cargo/bounties/assistant.dm b/code/modules/cargo/bounties/assistant.dm index 37507132a865..ca0e77585195 100644 --- a/code/modules/cargo/bounties/assistant.dm +++ b/code/modules/cargo/bounties/assistant.dm @@ -50,12 +50,6 @@ reward = 2000 wanted_types = list(/obj/structure/statue) -/datum/bounty/item/assistant/clown_box - name = "Clown Box" - description = "The universe needs laughter. Stamp cardboard with a clown stamp and ship it out." - reward = 1500 - wanted_types = list(/obj/item/storage/box/clown) - /datum/bounty/item/assistant/cheesiehonkers name = "Cheesie Honkers" description = "Apparently the company that makes Cheesie Honkers is going out of business soon. CentCom wants to stock up before it happens!" diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 30b768e702b0..111ce9a321ab 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -1265,7 +1265,7 @@ GLOBAL_LIST_INIT(hallucination_list, list( target.playsound_local(get_turf(src), "sparks", 100, 1) target.staminaloss += 50 target.Stun(40) - target.jitteriness += 1000 + target.adjust_jitter(1000, max = 1500) target.do_jitter_animation(target.jitteriness) addtimer(CALLBACK(src, PROC_REF(shock_drop)), 20) diff --git a/code/modules/mining/abandoned_crates.dm b/code/modules/mining/abandoned_crates.dm index 1166a0db0db5..339f17342f8a 100644 --- a/code/modules/mining/abandoned_crates.dm +++ b/code/modules/mining/abandoned_crates.dm @@ -141,8 +141,6 @@ new /obj/item/clothing/mask/cigarette/rollie(src) if(6 to 10) new /obj/item/skateboard/pro(src) - if(11 to 15) - new /mob/living/simple_animal/bot/honkbot(src) if(16 to 20) new /obj/item/stack/ore/diamond(src, 10) if(21 to 25) diff --git a/code/modules/mob/living/carbon/alien/organs.dm b/code/modules/mob/living/carbon/alien/organs.dm index 3ae9bbb5b250..74304378bcd9 100644 --- a/code/modules/mob/living/carbon/alien/organs.dm +++ b/code/modules/mob/living/carbon/alien/organs.dm @@ -137,7 +137,7 @@ owner.force_scream() owner.Paralyze(100) - owner.jitteriness += 30 + owner.adjust_jitter(30) owner.confused += 30 owner.stuttering += 30 diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 12a40a456f15..51815282406d 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -387,8 +387,8 @@ var/should_stun = (!(flags & SHOCK_TESLA) || siemens_coeff > 0.5) && !(flags & SHOCK_NOSTUN) if(should_stun) Paralyze(40) - //Jitter and other fluff. - jitteriness += 1000 + //jitter and other fluff. + adjust_jitter(1000, max = 1500) do_jitter_animation(jitteriness) stuttering += 2 addtimer(CALLBACK(src, PROC_REF(secondary_shock), should_stun), 20) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index c462eb294f77..fae17b35d706 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -113,14 +113,16 @@ if (length(status_examines)) . += status_examines - //Jitters + //jitters switch(jitteriness) if(300 to INFINITY) - . += "[t_He] [t_is] convulsing violently!" + . += span_boldwarning("[t_He] [t_is] convulsing violently!") if(200 to 300) - . += "[t_He] [t_is] extremely jittery." + . += span_warning("[t_He] [t_is] extremely jittery.") if(100 to 200) - . += "[t_He] [t_is] twitching ever so slightly." + . += span_warning("[t_He] [t_is] twitching ever so slightly.") + if(50 to 100) + . += span_warning("[t_He] [t_is] flinching lightly") var/appears_dead = FALSE var/just_sleeping = FALSE diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index cbacb2099a0d..43e764561272 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1352,7 +1352,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) else if(H.satiety < 0) H.satiety++ if(prob(round(-H.satiety/40))) - H.Jitter(5) + H.adjust_jitter(5, max = 100) hunger_rate = 3 * HUNGER_FACTOR hunger_rate *= H.physiology.hunger_mod H.adjust_nutrition(-hunger_rate) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 45145704a4a1..9ab3bd9cd98a 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -441,7 +441,7 @@ All effects don't start immediately, but rather get worse over time; the rate is if(prob(5)) AdjustSleeping(100) - //Jitteriness + //jitteriness if(jitteriness) do_jitter_animation(jitteriness) jitteriness = max(jitteriness - restingpwr, 0) @@ -474,7 +474,7 @@ All effects don't start immediately, but rather get worse over time; the rate is drunkenness = max(drunkenness - (drunkenness * 0.04) - 0.01, 0) if(drunkenness >= 11) SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "drunk", /datum/mood_event/drunk) - jitteriness = max(jitteriness - 3, 0) + adjust_jitter(max(jitteriness -3,0), max = 200) throw_alert("drunk", /atom/movable/screen/alert/drunk) sound_environment_override = SOUND_ENVIRONMENT_PSYCHOTIC else diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 5e3442ba039a..b51c748151b8 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1866,7 +1866,7 @@ GLOBAL_VAR_INIT(ssd_indicator_overlay, mutable_appearance('icons/mob/ssd_indicat var/howfuck = rand(8,16) AdjustParalyzed(howfuck) AdjustKnockdown(howfuck) - Jitter(rand(150,200)) + set_jitter(rand(150,200)) /** * Sets the mob's speed variable and then calls update_living_varspeed(). diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm index 1f3c2ba24aa7..4c539433a21a 100644 --- a/code/modules/mob/living/simple_animal/bot/construction.dm +++ b/code/modules/mob/living/simple_animal/bot/construction.dm @@ -260,41 +260,6 @@ S.healthanalyzer = healthanalyzer qdel(src) - -//Honkbot Assembly -/obj/item/bot_assembly/honkbot - name = "incomplete honkbot assembly" - desc = "The clown's up to no good once more" - icon_state = "honkbot_arm" - created_name = "Honkbot" - -/obj/item/bot_assembly/honkbot/attackby(obj/item/I, mob/user, params) - ..() - switch(build_step) - if(ASSEMBLY_FIRST_STEP) - if(isprox(I)) - if(!user.temporarilyRemoveItemFromInventory(I)) - return - to_chat(user, "You add the [I] to [src]!") - icon_state = "honkbot_proxy" - name = "incomplete Honkbot assembly" - qdel(I) - build_step++ - - if(ASSEMBLY_SECOND_STEP) - if(istype(I, /obj/item/bikehorn)) - if(!can_finish_build(I, user)) - return - to_chat(user, "You add the [I] to [src]! Honk!") - var/mob/living/simple_animal/bot/honkbot/S = new(drop_location()) - S.name = created_name - S.spam_flag = TRUE // only long enough to hear the first ping. - addtimer(CALLBACK (S, .mob/living/simple_animal/bot/honkbot/proc/react_ping), 5) - S.bikehorn = I.type - qdel(I) - qdel(src) - - //Secbot Assembly /obj/item/bot_assembly/secbot name = "incomplete securitron assembly" diff --git a/code/modules/mob/living/simple_animal/bot/honkbot.dm b/code/modules/mob/living/simple_animal/bot/honkbot.dm deleted file mode 100644 index 34ce788c53c5..000000000000 --- a/code/modules/mob/living/simple_animal/bot/honkbot.dm +++ /dev/null @@ -1,370 +0,0 @@ -/mob/living/simple_animal/bot/honkbot - name = "\improper honkbot" - desc = "A little robot. It looks happy with its bike horn." - icon = 'icons/mob/aibots.dmi' - icon_state = "honkbot" - density = FALSE - anchored = FALSE - health = 25 - maxHealth = 25 - damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0) - pass_flags = PASSMOB - - radio_key = /obj/item/encryptionkey //doesn't have security key - bot_type = HONK_BOT - model = "Honkbot" - bot_core_type = /obj/machinery/bot_core/honkbot - window_id = "autohonk" - window_name = "Honkomatic Bike Horn Unit v1.0.7" - data_hud_type = DATA_HUD_SECURITY_BASIC // show jobs - path_image_color = "#FF69B4" - - var/honksound = 'sound/items/bikehorn.ogg' //customizable sound - var/spam_flag = FALSE - var/cooldowntime = 30 - var/cooldowntimehorn = 10 - var/mob/living/carbon/target - var/oldtarget_name - var/target_lastloc = FALSE //Loc of target when arrested. - var/last_found = FALSE //There's a delay - var/threatlevel = FALSE - var/declare_arrests = FALSE // speak, you shall not, unless to Honk - var/idcheck = TRUE - var/fcheck = TRUE - var/check_records = TRUE - var/arrest_type = FALSE - var/weaponscheck = TRUE - var/bikehorn = /obj/item/bikehorn - -/mob/living/simple_animal/bot/honkbot/Initialize() - . = ..() - update_appearance() - auto_patrol = TRUE - var/datum/job/clown/J = new/datum/job/clown - access_card.access += J.get_access() - prev_access = access_card.access - -/mob/living/simple_animal/bot/honkbot/proc/spam_flag_false() //used for addtimer - spam_flag = FALSE - -/mob/living/simple_animal/bot/honkbot/proc/sensor_blink() - icon_state = "honkbot-c" - addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, update_icon)), 5, TIMER_OVERRIDE|TIMER_UNIQUE) - -//honkbots react with sounds. -/mob/living/simple_animal/bot/honkbot/proc/react_ping() - playsound(src, 'sound/machines/ping.ogg', 50, TRUE, -1) //the first sound upon creation! - spam_flag = TRUE - sensor_blink() - addtimer(CALLBACK(src, PROC_REF(spam_flag_false)), 18) // calibrates before starting the honk - -/mob/living/simple_animal/bot/honkbot/proc/react_buzz() - playsound(src, 'sound/machines/buzz-sigh.ogg', 50, TRUE, -1) - sensor_blink() - -/mob/living/simple_animal/bot/honkbot/bot_reset() - ..() - target = null - oldtarget_name = null - anchored = FALSE - walk_to(src,0) - last_found = world.time - spam_flag = FALSE - -/mob/living/simple_animal/bot/honkbot/set_custom_texts() - - text_hack = "You overload [name]'s sound control system" - text_dehack = "You reboot [name] and restore the sound control system." - text_dehack_fail = "[name] refuses to accept your authority!" - -/mob/living/simple_animal/bot/honkbot/get_controls(mob/user) - var/dat - dat += hack(user) - dat += showpai(user) - dat += text({" -Honkomatic Bike Horn Unit v1.0.7 controls

-Status: []
-Behaviour controls are [locked ? "locked" : "unlocked"]
-Maintenance panel panel is [open ? "opened" : "closed"]"}, - -"[on ? "On" : "Off"]" ) - - if(!locked || issilicon(user) || isAdminGhostAI(user)) - dat += text({"
Auto Patrol: []"}, - -"[auto_patrol ? "On" : "Off"]" ) - return dat - -/mob/living/simple_animal/bot/honkbot/proc/judgement_criteria() - var/final = NONE - if(check_records) - final = final|JUDGE_RECORDCHECK - if(emagged == 2) - final = final|JUDGE_EMAGGED - return final - -/mob/living/simple_animal/bot/honkbot/proc/retaliate(mob/living/carbon/human/H) - var/judgement_criteria = judgement_criteria() - threatlevel = H.assess_threat(judgement_criteria) - threatlevel += 6 - if(threatlevel >= 4) - target = H - mode = BOT_HUNT - -/mob/living/simple_animal/bot/honkbot/attack_hand(mob/living/carbon/human/H) - if(H.a_intent == "harm") - retaliate(H) - addtimer(CALLBACK(src, PROC_REF(react_buzz)), 5) - return ..() - - -/mob/living/simple_animal/bot/honkbot/attackby(obj/item/W, mob/user, params) - if(W.tool_behaviour != TOOL_SCREWDRIVER && (W.force) && (!target) && (W.damtype != STAMINA)) - retaliate(user) - addtimer(CALLBACK(src, PROC_REF(react_buzz)), 5) - ..() - -/mob/living/simple_animal/bot/honkbot/emag_act(mob/user) - ..() - if(emagged == 2) - if(user) - user << "You short out [src]'s sound control system. It gives out an evil laugh!!" - oldtarget_name = user.name - audible_message("[src] gives out an evil laugh!") - playsound(src, 'sound/machines/honkbot_evil_laugh.ogg', 75, TRUE, -1) // evil laughter - update_appearance() - -/mob/living/simple_animal/bot/honkbot/bullet_act(obj/projectile/Proj) - if((istype(Proj,/obj/projectile/beam)) || (istype(Proj,/obj/projectile/bullet) && (Proj.damage_type == BURN))||(Proj.damage_type == BRUTE) && (!Proj.nodamage && Proj.damage < health && ishuman(Proj.firer))) - retaliate(Proj.firer) - return ..() - -/mob/living/simple_animal/bot/honkbot/UnarmedAttack(atom/A) - if(!on) - return - if(iscarbon(A)) - var/mob/living/carbon/C = A - if (emagged <= 1) - honk_attack(A) - else - if(!C.IsParalyzed() || arrest_type) - stun_attack(A) - ..() - else if (!spam_flag) //honking at the ground - bike_horn(A) - - -/mob/living/simple_animal/bot/honkbot/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) - if(istype(AM, /obj/item)) - playsound(src, honksound, 50, TRUE, -1) - var/obj/item/I = AM - var/mob/thrown_by = I.thrownby?.resolve() - if(I.throwforce < health && thrown_by && (istype(thrown_by, /mob/living/carbon/human))) - var/mob/living/carbon/human/H = thrown_by - retaliate(H) - ..() - -/mob/living/simple_animal/bot/honkbot/proc/bike_horn() //use bike_horn - if (emagged <= 1) - if (!spam_flag) - playsound(src, honksound, 50, TRUE, -1) - spam_flag = TRUE //prevent spam - sensor_blink() - addtimer(CALLBACK(src, PROC_REF(spam_flag_false)), cooldowntimehorn) - else if (emagged == 2) //emagged honkbots will spam short and memorable sounds. - if (!spam_flag) - playsound(src, "honkbot_e", 50, FALSE) - spam_flag = TRUE // prevent spam - icon_state = "honkbot-e" - addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, update_icon)), 30, TIMER_OVERRIDE|TIMER_UNIQUE) - addtimer(CALLBACK(src, PROC_REF(spam_flag_false)), cooldowntimehorn) - -/mob/living/simple_animal/bot/honkbot/proc/honk_attack(mob/living/carbon/C) // horn attack - if(!spam_flag) - playsound(loc, honksound, 50, TRUE, -1) - spam_flag = TRUE // prevent spam - sensor_blink() - addtimer(CALLBACK(src, PROC_REF(spam_flag_false)), cooldowntimehorn) - -/mob/living/simple_animal/bot/honkbot/proc/stun_attack(mob/living/carbon/C) // airhorn stun - if(!spam_flag) - playsound(src, 'sound/items/AirHorn.ogg', 100, TRUE, -1) //HEEEEEEEEEEEENK!! - sensor_blink() - if(spam_flag == 0) - if(ishuman(C)) - C.stuttering = 20 - C.adjustEarDamage(0, 5) //far less damage than the H.O.N.K. - C.Jitter(50) - C.Paralyze(60) - var/mob/living/carbon/human/H = C - if(client) //prevent spam from players.. - spam_flag = TRUE - if (emagged <= 1) //HONK once, then leave - var/judgement_criteria = judgement_criteria() - threatlevel = H.assess_threat(judgement_criteria) - threatlevel -= 6 - target = oldtarget_name - else // you really don't want to hit an emagged honkbot - threatlevel = 6 // will never let you go - addtimer(CALLBACK(src, PROC_REF(spam_flag_false)), cooldowntime) - - log_combat(src,C,"honked") - - C.visible_message("[src] honks [C]!",\ - "[src] honks you!") - else - C.stuttering = 20 - C.Paralyze(80) - addtimer(CALLBACK(src, PROC_REF(spam_flag_false)), cooldowntime) - - -/mob/living/simple_animal/bot/honkbot/handle_automated_action() - if(!..()) - return - - switch(mode) - - if(BOT_IDLE) // idle - - walk_to(src,0) - look_for_perp() - if(!mode && auto_patrol) - mode = BOT_START_PATROL - - if(BOT_HUNT) - - // if can't reach perp for long enough, go idle - if(frustration >= 5) //gives up easier than beepsky - walk_to(src,0) - back_to_idle() - return - - if(target) // make sure target exists - if(Adjacent(target) && isturf(target.loc)) - - if(threatlevel <= 4) - honk_attack(target) - else - if(threatlevel >= 6) - set waitfor = 0 - stun_attack(target) - set_anchored(FALSE) - target_lastloc = target.loc - return - - else // not next to perp - var/turf/olddist = get_dist(src, target) - walk_to(src, target,1,4) - if((get_dist(src, target)) >= (olddist)) - frustration++ - else - frustration = 0 - else - back_to_idle() - - - if(BOT_START_PATROL) - look_for_perp() - start_patrol() - - if(BOT_PATROL) - look_for_perp() - bot_patrol() - - return - -/mob/living/simple_animal/bot/honkbot/proc/back_to_idle() - anchored = FALSE - mode = BOT_IDLE - target = null - last_found = world.time - frustration = 0 - INVOKE_ASYNC(src, PROC_REF(handle_automated_action)) //responds quickly - -/mob/living/simple_animal/bot/honkbot/proc/back_to_hunt() - anchored = FALSE - frustration = 0 - mode = BOT_HUNT - INVOKE_ASYNC(src, PROC_REF(handle_automated_action)) // responds quickly - -/mob/living/simple_animal/bot/honkbot/proc/look_for_perp() - anchored = FALSE - for (var/mob/living/carbon/C in view(7,src)) - if((C.stat) || (C.handcuffed)) - continue - - if((C.name == oldtarget_name) && (world.time < last_found + 100)) - continue - - var/judgement_criteria = judgement_criteria() - threatlevel = C.assess_threat(judgement_criteria) - - if(threatlevel <= 3) - if(C in view(4,src)) //keep the range short for patrolling - if(!spam_flag) - bike_horn() - - else if(threatlevel >= 10) - bike_horn() //just spam the shit outta this - - else if(threatlevel >= 4) - if(!spam_flag) - target = C - oldtarget_name = C.name - bike_horn() - speak("Honk!") - visible_message("[src] starts chasing [C.name]!") - mode = BOT_HUNT - INVOKE_ASYNC(src, PROC_REF(handle_automated_action)) - break - else - continue - -/mob/living/simple_animal/bot/honkbot/explode() - - walk_to(src,0) - visible_message("[src] blows apart!") - var/atom/Tsec = drop_location() - //doesn't drop cardboard nor its assembly, since its a very frail material. - if(prob(50)) - drop_part(robot_arm, Tsec) - new bikehorn(Tsec) - new /obj/item/assembly/prox_sensor(Tsec) - - var/datum/effect_system/spark_spread/s = new - s.set_up(3, 1, src) - s.start() - - new /obj/effect/decal/cleanable/oil(loc) - ..() - -/mob/living/simple_animal/bot/honkbot/attack_alien(mob/living/carbon/alien/user as mob) - ..() - if(!isalien(target)) - target = user - mode = BOT_HUNT - -/mob/living/simple_animal/bot/honkbot/on_entered(datum/source, atom/movable/AM) - if(ismob(AM) && (on)) //only if its online - if(prob(30)) //you're far more likely to trip on a honkbot - var/mob/living/carbon/C = AM - if(!istype(C) || !C || in_range(src, target)) - return - C.visible_message( - "[pick( \ - "[C] dives out of [src]'s way!", \ - "[C] stumbles over [src]!", \ - "[C] jumps out of [src]'s path!", \ - "[C] trips over [src] and falls!", \ - "[C] topples over [src]!", \ - "[C] leaps out of [src]'s way!")]") - C.Paralyze(10) - playsound(loc, 'sound/misc/sadtrombone.ogg', 50, TRUE, -1) - if(!client) - INVOKE_ASYNC(src, PROC_REF(speak), "Honk!") - sensor_blink() - return - . = ..() - -/obj/machinery/bot_core/honkbot - req_one_access = list(ACCESS_THEATRE, ACCESS_ROBOTICS) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm index 5e953c74119a..c2a09fb80b65 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm @@ -55,7 +55,7 @@ . = ..() if(isliving(target)) var/mob/living/living_target = target - living_target.Jitter(5) + living_target.adjust_jitter(5) /obj/projectile/temp/basilisk/heated name = "energy blast" diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index def2bde930e0..9a2d1d60c0c3 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -92,7 +92,7 @@ var/drowsyness = 0//Carbon /// Dizziness level of the mob var/dizziness = 0//Carbon - /// Jitteryness level of the mob + /// jitteryness level of the mob var/jitteriness = 0//Carbon /// Hunger level of the mob var/nutrition = NUTRITION_LEVEL_START_MIN // randomised in Initialize diff --git a/code/modules/mob/status_procs.dm b/code/modules/mob/status_procs.dm index 5dc04346255a..6b82aa09770e 100644 --- a/code/modules/mob/status_procs.dm +++ b/code/modules/mob/status_procs.dm @@ -4,8 +4,20 @@ // eye damage, eye_blind, eye_blurry, druggy, TRAIT_BLIND trait, and TRAIT_NEARSIGHT trait. ///Set the jitter of a mob -/mob/proc/Jitter(amount) +/mob/proc/set_jitter(amount) jitteriness = max(jitteriness,amount,0) + return TRUE + +/mob/proc/adjust_jitter(amount, min = 0, max = 1000) + if((jitteriness+amount > max) && jitteriness+amount <= max*1.6) + jitteriness = max + return TRUE + if(jitteriness+amount < min && jitteriness+amount < min * 1.6) + jitteriness = min + return TRUE + jitteriness = clamp(jitteriness+amount, 0, max) + return TRUE + /** * Set the dizzyness of a mob to a passed in amount diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents/base_drinks.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents/base_drinks.dm index cd2d0bc4764c..7280876643c6 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents/base_drinks.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents/base_drinks.dm @@ -32,7 +32,7 @@ M.drowsyness = max(0,M.drowsyness-3) M.AdjustSleeping(-40) if(!HAS_TRAIT(M, TRAIT_ALCOHOL_TOLERANCE)) - M.Jitter(5) + M.adjust_jitter(5, max = 100) ..() . = 1 diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents/mixed_drinks.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents/mixed_drinks.dm index b2de221caf41..1f25ef513cf7 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents/mixed_drinks.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents/mixed_drinks.dm @@ -50,12 +50,12 @@ M.AdjustSleeping(-40) M.adjust_bodytemperature(-1 * TEMPERATURE_DAMAGE_COEFFICIENT, M.get_body_temp_normal()) if(!HAS_TRAIT(M, TRAIT_ALCOHOL_TOLERANCE)) - M.Jitter(5) + M.adjust_jitter(5, max = 100) return ..() /datum/reagent/consumable/ethanol/vimukti/overdose_start(mob/living/M) - to_chat(M, "Your entire body violently jitters as you start to feel queasy. You really shouldn't have drank all of that [name]!") - M.Jitter(20) + to_chat(M, span_userdanger("Your entire body violently jitters as you start to feel queasy. You really shouldn't have drank all of that [name]!")) + M.adjust_jitter(20, max = 500) M.Stun(15) /datum/reagent/consumable/ethanol/vimukti/overdose_process(mob/living/M) @@ -63,11 +63,11 @@ var/obj/item/I = M.get_active_held_item() if(I) M.dropItemToGround(I) - to_chat(M, "Your hands jitter and you drop what you were holding!") - M.Jitter(10) + to_chat(M, span_notice("Your hands flinch and you drop what you were holding!")) + M.adjust_jitter(10, max = 500) if(prob(7)) - to_chat(M, "[pick("You have a really bad headache.", "Your eyes hurt.", "You find it hard to stay still.", "You feel your heart practically beating out of your chest.")]") + to_chat(M, span_warning("[pick("You have a really bad headache.", "Your eyes hurt.", "You find it hard to stay still.", "You feel your heart practically beating out of your chest.")]")) if(prob(5) && iscarbon(M)) var/obj/item/organ/eyes/eyes = M.getorganslot(ORGAN_SLOT_EYES) @@ -84,9 +84,7 @@ M.emote("scream") if(prob(3) && iscarbon(M)) - M.visible_message("[M] starts having a seizure!", "You have a seizure!") - M.Unconscious(100) - M.Jitter(350) + M.seizure() if(prob(1) && iscarbon(M)) var/datum/disease/D = new /datum/disease/heart_failure @@ -360,7 +358,7 @@ ..() /datum/reagent/consumable/ethanol/beepsky_smash/on_mob_life(mob/living/carbon/M) - M.Jitter(2) + M.adjust_jitter(2, max = 100) if(HAS_TRAIT(M.mind, TRAIT_LAW_ENFORCEMENT_METABOLISM)) M.adjustStaminaLoss(-10, 0) if(prob(20)) @@ -1036,16 +1034,16 @@ if(1 to 5) M.Dizzy(10) M.set_drugginess(30) - if(5 to 10) - M.Jitter(20) + if(5 to 20) + M.adjust_jitter(20, max = 200) M.Dizzy(20) M.set_drugginess(45) - if (10 to 200) - M.Jitter(40) + if (20 to 200) + M.adjust_jitter(40, max = 400) M.Dizzy(40) M.set_drugginess(60) if(200 to INFINITY) - M.Jitter(60) + M.adjust_jitter(60, max = 600) M.Dizzy(60) M.set_drugginess(75) if(prob(30)) @@ -1682,7 +1680,7 @@ /datum/reagent/consumable/ethanol/spriters_bane/on_mob_life(mob/living/carbon/C) switch(current_cycle) if(5 to 40) - C.jitteriness += 3 + C.adjust_jitter(3, max = 200) if(prob(10) && !C.eye_blurry) C.blur_eyes(6) to_chat(C, "That outline is so distracting, it's hard to look at anything else!") diff --git a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm index e84cc952c5b9..f94c143823ae 100644 --- a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm @@ -478,7 +478,7 @@ WS End*/ H.adjustOrganLoss(ORGAN_SLOT_HEART,max(1,volume/10)) // your heart is barely keeping up! - H.Jitter(rand(0,2)) + H.adjust_jitter(rand(0,2)) H.Dizzy(rand(0,2)) diff --git a/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drink_reagents.dm index 281b15d2e6b5..1bcd05798a03 100644 --- a/code/modules/reagents/chemistry/reagents/drink_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drink_reagents.dm @@ -249,7 +249,7 @@ glass_desc = "Black coffee, served straight. It'll be pretty bitter without anything else in it!" /datum/reagent/consumable/coffee/overdose_process(mob/living/M) - M.Jitter(5) + M.adjust_jitter(5, max = 200) ..() /datum/reagent/consumable/coffee/on_mob_life(mob/living/carbon/M) @@ -276,7 +276,7 @@ /datum/reagent/consumable/tea/on_mob_life(mob/living/carbon/M) M.dizziness = max(0,M.dizziness-2) M.drowsyness = max(0,M.drowsyness-1) - M.jitteriness = max(0,M.jitteriness-3) + M.adjust_jitter(max(0,M.jitteriness-3)) M.AdjustSleeping(-20) if(M.getToxLoss() && prob(20)) M.adjustToxLoss(-1, 0) @@ -323,7 +323,7 @@ glass_desc = "Iced black coffee. It's still going to be pretty bitter on it's own, though!" /datum/reagent/consumable/icecoffee/overdose_process(mob/living/M) - M.Jitter(5) + M.adjust_jitter(5) ..() /datum/reagent/consumable/icecoffee/on_mob_life(mob/living/carbon/M) @@ -347,7 +347,7 @@ glass_desc = "The wonders of fusion mixed into a cup of coffee, resulting in an extremely hot-cold drink." /datum/reagent/consumable/hot_ice_coffee/overdose_process(mob/living/M) - M.Jitter(5) + M.adjust_jitter(5, max = 200) ..() /datum/reagent/consumable/hot_ice_coffee/on_mob_life(mob/living/carbon/M) @@ -412,7 +412,7 @@ ..() /datum/reagent/consumable/crosstalk/on_mob_life(mob/living/carbon/M) - M.Jitter(20) + M.adjust_jitter(10, max = 200) M.dizziness +=1 M.drowsyness = 0 M.AdjustSleeping(-40) @@ -432,7 +432,7 @@ M.drowsyness = max(0,M.drowsyness-7) M.AdjustSleeping(-20) M.adjust_bodytemperature(-1 * TEMPERATURE_DAMAGE_COEFFICIENT, M.get_body_temp_normal()) - M.Jitter(5) + M.adjust_jitter(5, max = 100) ..() . = 1 @@ -590,7 +590,7 @@ glass_desc = "A glass of Xeno Energy. It seems to swirl and roil outside of the can..." /datum/reagent/consumable/xeno_energy/on_mob_life(mob/living/carbon/M) - M.Jitter(20) + M.adjust_jitter(10, max = 200) M.dizziness +=1 M.drowsyness = 0 M.AdjustSleeping(-40) @@ -632,7 +632,7 @@ glass_desc = "A nice and refreshing beverage. It goes well with a book, if you have the time to read." /datum/reagent/consumable/soy_latte/overdose_process(mob/living/M) - M.Jitter(5) + M.adjust_jitter(2, max = 100) ..() /datum/reagent/consumable/soy_latte/on_mob_life(mob/living/carbon/M) @@ -657,7 +657,7 @@ glass_desc = "A nice, strong and refreshing beverage. It goes well with a book, if you have the time to read." /datum/reagent/consumable/cafe_latte/overdose_process(mob/living/M) - M.Jitter(5) + M.adjust_jitter(5, max = 200) ..() /datum/reagent/consumable/cafe_latte/on_mob_life(mob/living/carbon/M) diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm index a62dfc53b63b..92a367e87c4c 100644 --- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm @@ -190,7 +190,7 @@ M.AdjustParalyzed(-40) M.AdjustImmobilized(-40) M.adjustStaminaLoss(-2, 0) - M.Jitter(2) + M.adjust_jitter(2) M.adjustOrganLoss(ORGAN_SLOT_BRAIN, rand(1,4)) ..() . = 1 @@ -208,11 +208,11 @@ . = 1 /datum/reagent/drug/methamphetamine/addiction_act_stage1(mob/living/M) - M.Jitter(5) + M.adjust_jitter(5, max = 150) ..() /datum/reagent/drug/methamphetamine/addiction_act_stage2(mob/living/M) - M.Jitter(10) + M.adjust_jitter(10, max = 300) M.Dizzy(10) ..() @@ -220,7 +220,7 @@ if(!HAS_TRAIT(M, TRAIT_IMMOBILIZED) && !ismovable(M.loc)) for(var/i = 0, i < 4, i++) step(M, pick(GLOB.cardinals)) - M.Jitter(15) + M.adjust_jitter(15, max = 600) M.Dizzy(15) ..() @@ -228,7 +228,7 @@ if(!HAS_TRAIT(M, TRAIT_IMMOBILIZED) && !ismovable(M.loc)) for(var/i = 0, i < 8, i++) step(M, pick(GLOB.cardinals)) - M.Jitter(20) + M.adjust_jitter(20) M.Dizzy(20) M.adjustToxLoss(5, 0) ..() @@ -288,7 +288,7 @@ if(!HAS_TRAIT(M, TRAIT_IMMOBILIZED) && !ismovable(M.loc)) for(var/i = 0, i < 8, i++) step(M, pick(GLOB.cardinals)) - M.Jitter(5) + M.adjust_jitter(5, max = 150) M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10) ..() @@ -297,7 +297,7 @@ if(!HAS_TRAIT(M, TRAIT_IMMOBILIZED) && !ismovable(M.loc)) for(var/i = 0, i < 8, i++) step(M, pick(GLOB.cardinals)) - M.Jitter(10) + M.adjust_jitter(10, max = 300) M.Dizzy(10) M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10) ..() @@ -307,7 +307,7 @@ if(!HAS_TRAIT(M, TRAIT_IMMOBILIZED) && !ismovable(M.loc)) for(var/i = 0, i < 12, i++) step(M, pick(GLOB.cardinals)) - M.Jitter(15) + M.adjust_jitter(15, max = 600) M.Dizzy(15) M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10) ..() @@ -317,7 +317,7 @@ if(!HAS_TRAIT(M, TRAIT_IMMOBILIZED) && !ismovable(M.loc)) for(var/i = 0, i < 16, i++) step(M, pick(GLOB.cardinals)) - M.Jitter(50) + M.adjust_jitter(50) M.Dizzy(50) M.adjustToxLoss(5, 0) M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10) @@ -362,7 +362,7 @@ ..() /datum/reagent/drug/happiness/on_mob_life(mob/living/carbon/M) - M.jitteriness = 0 + M.adjust_jitter(-20) M.confused = 0 M.disgust = 0 M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.2) @@ -386,25 +386,25 @@ /datum/reagent/drug/happiness/addiction_act_stage1(mob/living/M)// all work and no play makes jack a dull boy var/datum/component/mood/mood = M.GetComponent(/datum/component/mood) mood.setSanity(min(mood.sanity, SANITY_DISTURBED)) - M.Jitter(5) + M.adjust_jitter(5, max = 150) ..() /datum/reagent/drug/happiness/addiction_act_stage2(mob/living/M) var/datum/component/mood/mood = M.GetComponent(/datum/component/mood) mood.setSanity(min(mood.sanity, SANITY_UNSTABLE)) - M.Jitter(10) + M.adjust_jitter(10, max = 300) ..() /datum/reagent/drug/happiness/addiction_act_stage3(mob/living/M) var/datum/component/mood/mood = M.GetComponent(/datum/component/mood) mood.setSanity(min(mood.sanity, SANITY_CRAZY)) - M.Jitter(15) + M.adjust_jitter(15, max = 500) ..() /datum/reagent/drug/happiness/addiction_act_stage4(mob/living/carbon/human/M) var/datum/component/mood/mood = M.GetComponent(/datum/component/mood) mood.setSanity(SANITY_INSANE) - M.Jitter(20) + M.adjust_jitter(20) ..() . = 1 @@ -425,7 +425,7 @@ ..() /datum/reagent/drug/pumpup/on_mob_life(mob/living/carbon/M) - M.Jitter(5) + M.adjust_jitter(5) if(prob(5)) to_chat(M, "[pick("Go! Go! GO!", "You feel ready...", "You feel invincible...")]") @@ -439,7 +439,7 @@ to_chat(M, "You can't stop shaking, your heart beats faster and faster...") /datum/reagent/drug/pumpup/overdose_process(mob/living/M) - M.Jitter(5) + M.adjust_jitter(5) if(prob(5)) M.drop_all_held_items() if(prob(20)) diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 8b06736dbce2..b72d8f2e4fc2 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -340,11 +340,11 @@ M.Dizzy(5) M.set_drugginess(30) if(5 to 10) - M.Jitter(10) + M.adjust_jitter(10) M.Dizzy(10) M.set_drugginess(35) if (10 to INFINITY) - M.Jitter(20) + M.adjust_jitter(20) M.Dizzy(20) M.set_drugginess(40) ..() @@ -361,7 +361,7 @@ if(prob(min(25,current_cycle))) to_chat(M, "You can't get the scent of garlic out of your nose! You can barely think...") M.Paralyze(10) - M.Jitter(10) + M.adjust_jitter(10) else if(ishuman(M)) var/mob/living/carbon/human/H = M if(H.job == "Cook") diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 1ae9386b41f6..e952526bb94c 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -223,7 +223,7 @@ /datum/reagent/medicine/rezadone/overdose_process(mob/living/M) M.adjustToxLoss(1, 0) M.Dizzy(5) - M.Jitter(5) + M.adjust_jitter(5) ..() . = 1 @@ -668,7 +668,7 @@ var/obj/item/I = M.get_active_held_item() if(I && M.dropItemToGround(I)) to_chat(M, "Your hands spaz out and you drop what you were holding!") - M.Jitter(10) + M.adjust_jitter(10) M.AdjustAllImmobility(-20) M.adjustStaminaLoss(-1*REM, FALSE) @@ -695,7 +695,7 @@ if(prob(3) && iscarbon(M)) M.visible_message("[M] starts having a seizure!", "You have a seizure!") M.Unconscious(100) - M.Jitter(350) + M.set_jitter(200) if(prob(33)) M.adjustToxLoss(2*REM, 0) @@ -707,7 +707,7 @@ if(prob(6) && iscarbon(M)) M.visible_message("[M] starts having a seizure!", "You have a seizure!") M.Unconscious(100) - M.Jitter(350) + M.set_jitter(400) if(prob(33)) M.adjustToxLoss(3*REM, 0) @@ -719,7 +719,7 @@ if(prob(12) && iscarbon(M)) M.visible_message("[M] starts having a seizure!", "You have a seizure!") M.Unconscious(100) - M.Jitter(350) + M.set_jitter(600) if(prob(33)) M.adjustToxLoss(4*REM, 0) @@ -731,7 +731,7 @@ if(prob(24) && iscarbon(M)) M.visible_message("[M] starts having a seizure!", "You have a seizure!") M.Unconscious(100) - M.Jitter(350) + M.set_jitter(1000) if(prob(33)) M.adjustToxLoss(5*REM, 0) @@ -749,7 +749,7 @@ /datum/reagent/medicine/diphenhydramine/on_mob_life(mob/living/carbon/M) if(prob(10)) M.drowsyness += 1 - M.jitteriness -= 1 + M.adjust_jitter(-6) M.reagents.remove_reagent(/datum/reagent/toxin/histamine,3) ..() @@ -789,13 +789,13 @@ if(prob(33)) M.drop_all_held_items() M.Dizzy(2) - M.Jitter(2) + M.adjust_jitter(2) ..() /datum/reagent/medicine/morphine/addiction_act_stage1(mob/living/M) if(prob(33)) M.drop_all_held_items() - M.Jitter(2) + M.adjust_jitter(2) ..() /datum/reagent/medicine/morphine/addiction_act_stage2(mob/living/M) @@ -804,7 +804,7 @@ M.adjustToxLoss(1*REM, 0) . = 1 M.Dizzy(3) - M.Jitter(3) + M.adjust_jitter(3) ..() /datum/reagent/medicine/morphine/addiction_act_stage3(mob/living/M) @@ -813,7 +813,7 @@ M.adjustToxLoss(2*REM, 0) . = 1 M.Dizzy(4) - M.Jitter(4) + M.adjust_jitter(4) ..() /datum/reagent/medicine/morphine/addiction_act_stage4(mob/living/M) @@ -822,7 +822,7 @@ M.adjustToxLoss(3*REM, 0) . = 1 M.Dizzy(5) - M.Jitter(5) + M.adjust_jitter(5) ..() /datum/reagent/medicine/oculine @@ -881,14 +881,14 @@ M.losebreath = 0 if(prob(20)) M.Dizzy(5) - M.Jitter(5) + M.adjust_jitter(5) ..() /datum/reagent/medicine/atropine/overdose_process(mob/living/M) M.adjustToxLoss(0.5*REM, 0) . = 1 M.Dizzy(1) - M.Jitter(1) + M.adjust_jitter(1) ..() /datum/reagent/medicine/epinephrine @@ -1002,7 +1002,7 @@ taste_description = "acid" /datum/reagent/medicine/mutadone/on_mob_life(mob/living/carbon/M) - M.jitteriness = 0 + M.adjust_jitter(-50) if(M.has_dna()) M.dna.remove_all_mutations(list(MUT_NORMAL, MUT_EXTRA), TRUE) if(!QDELETED(M)) //We were a monkey, now a human @@ -1373,8 +1373,7 @@ for(var/datum/reagent/drug/R in M.reagents.reagent_list) M.reagents.remove_reagent(R.type,5) M.drowsyness += 2 - if(M.jitteriness >= 3) - M.jitteriness -= 3 + M.adjust_jitter(-3) if (M.hallucination >= 5) M.hallucination -= 5 if(prob(20)) @@ -1415,7 +1414,7 @@ ..() M.AdjustAllImmobility(-20) M.adjustStaminaLoss(-10, 0) - M.Jitter(10) + M.adjust_jitter(10, max = 300) M.Dizzy(10) return TRUE @@ -1431,7 +1430,7 @@ REMOVE_TRAIT(L, TRAIT_STUNRESISTANCE, type) L.remove_movespeed_mod_immunities(type, /datum/movespeed_modifier/damage_slowdown) L.Dizzy(0) - L.Jitter(0) + L.set_jitter(0) /datum/reagent/medicine/changelingadrenaline/overdose_process(mob/living/M as mob) M.adjustToxLoss(1, 0) @@ -1527,7 +1526,7 @@ overdose_threshold = overdose_threshold + rand(-10,10)/10 // for extra fun M.AdjustAllImmobility(-5) M.adjustStaminaLoss(-0.5*REM, 0) - M.Jitter(1) + M.adjust_jitter(1) metabolization_rate = 0.01 * REAGENTS_METABOLISM * rand(5,20) // randomizes metabolism between 0.02 and 0.08 per tick . = TRUE ..() @@ -1540,7 +1539,7 @@ overdose_progress++ switch(overdose_progress) if(1 to 40) - M.jitteriness = min(M.jitteriness+1, 10) + M.adjust_jitter(min(M.jitteriness+1, 10)) M.stuttering = min(M.stuttering+1, 10) M.Dizzy(5) if(prob(50)) @@ -1548,7 +1547,7 @@ if(41 to 80) M.adjustOxyLoss(0.1*REM, 0) M.adjustStaminaLoss(0.1*REM, 0) - M.jitteriness = min(M.jitteriness+1, 20) + M.adjust_jitter(min(M.jitteriness+1, 20)) M.stuttering = min(M.stuttering+1, 20) M.Dizzy(10) if(prob(50)) @@ -1584,7 +1583,7 @@ ..() /datum/reagent/medicine/psicodine/on_mob_life(mob/living/carbon/M) - M.jitteriness = max(0, M.jitteriness-6) + M.adjust_jitter(-6) M.dizziness = max(0, M.dizziness-6) M.confused = max(0, M.confused-6) M.disgust = max(0, M.disgust-6) @@ -1689,40 +1688,6 @@ ..() . = 1 -/* /datum/reagent/medicine/hepanephrodaxon //WS edit: Temporary removal of overloaded chem - name = "Hepanephrodaxon" - description = "Used to repair the common tissues involved in filtration." - taste_description = "glue" - reagent_state = LIQUID - color = "#D2691E" - metabolization_rate = REM * 1.5 - overdose_threshold = 10 - -/datum/reagent/medicine/hepanephrodaxon/on_mob_life(mob/living/carbon/M) - var/repair_strength = 1 - var/obj/item/organ/liver/L = M.getorganslot(ORGAN_SLOT_LIVER) - if(L.damage > 0) - L.damage = max(L.damage - 4 * repair_strength, 0) - M.confused = (2) - M.adjustToxLoss(-12) - ..() - if(prob(30) && iscarbon(M)) - var/obj/item/I = M.get_active_held_item() - if(I && M.dropItemToGround(I)) - to_chat(M, "Your hands spaz out and you drop what you were holding!") - M.adjustStaminaLoss(-10, 0) - M.Jitter(10) - M.Dizzy(15) - -/datum/reagent/medicine/hepanephrodaxon/overdose_process(mob/living/M) - var/obj/item/organ/liver/L = M.getorganslot(ORGAN_SLOT_LIVER) - L.damage = max(L.damage + 4, 0) - M.confused = (2) - ..() - ADD_TRAIT(L, TRAIT_SLEEPIMMUNE, type) - ADD_TRAIT(L, TRAIT_STUNRESISTANCE, type) - M.add_movespeed_modifier(/datum/movespeed_modifier/reagent/hepanephrodaxon) */ - /datum/reagent/medicine/bonefixingjuice name = "C4L-Z1UM Agent" description = "A peculiar substance capable of instantly regenerating live tissue." @@ -1962,7 +1927,7 @@ /datum/reagent/medicine/soulus/expose_mob(mob/living/M, method=TOUCH, reac_volume, show_message = 1) if(iscarbon(M) && M.stat != DEAD) if(method in list(INGEST, INJECT)) - M.jitteriness += reac_volume + M.adjust_jitter(reac_volume) if(M.getFireLoss()) M.adjustFireLoss(-reac_volume*1.2) if(M.getBruteLoss()) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index b246a81f364e..4aaf6970f28e 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -883,7 +883,7 @@ /datum/reagent/bluespace/on_mob_life(mob/living/carbon/M) if(current_cycle > 10 && prob(15)) to_chat(M, "You feel unstable...") - M.Jitter(2) + M.adjust_jitter(2) current_cycle = 1 addtimer(CALLBACK(M, TYPE_PROC_REF(/mob/living, bluespace_shuffle)), 30) ..() @@ -1011,7 +1011,7 @@ taste_description = "numbness" /datum/reagent/impedrezene/on_mob_life(mob/living/carbon/M) - M.jitteriness = max(M.jitteriness-5,0) + M.adjust_jitter(5) if(prob(80)) M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2*REM) if(prob(50)) @@ -2250,7 +2250,7 @@ H.adjustOrganLoss(ORGAN_SLOT_HEART,max(1,volume/10)) // your heart is barely keeping up! - H.Jitter(rand(0,2)) + H.adjust_jitter(rand(0,2)) H.Dizzy(rand(0,2)) @@ -2364,7 +2364,7 @@ for(var/datum/reagent/medicine/mannitol/chem in M.reagents.reagent_list) M.reagents.remove_reagent(chem.type, chem.volume) - M.Jitter(3) + M.adjust_jitter(3) M.Dizzy(3) if(prob(0.1) && ishuman(M)) var/mob/living/carbon/human/H = M diff --git a/code/modules/reagents/chemistry/reagents/trickwine_reagents.dm b/code/modules/reagents/chemistry/reagents/trickwine_reagents.dm index 380c049adcb0..b48aefddcc62 100644 --- a/code/modules/reagents/chemistry/reagents/trickwine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/trickwine_reagents.dm @@ -28,7 +28,7 @@ var/hostile_ai_status = hostile_target.AIStatus hostile_target.toggle_ai(AI_OFF) addtimer(VARSET_CALLBACK(hostile_target, AIStatus, hostile_ai_status),reac_volume) - M.Jitter(3 * reac_volume) + M.adjust_jitter(3 * reac_volume) M.Dizzy(2 * reac_volume) M.set_drugginess(3 * reac_volume) return ..() diff --git a/code/modules/research/nanites/nanite_programs/healing.dm b/code/modules/research/nanites/nanite_programs/healing.dm index 11b862e4a751..9fb4d37688f7 100644 --- a/code/modules/research/nanites/nanite_programs/healing.dm +++ b/code/modules/research/nanites/nanite_programs/healing.dm @@ -237,7 +237,7 @@ C.set_heartattack(FALSE) C.revive(full_heal = FALSE, admin_revive = FALSE) C.emote("gasp") - C.Jitter(100) + C.adjust_jitter(100) SEND_SIGNAL(C, COMSIG_LIVING_MINOR_SHOCK) log_game("[C] has been successfully defibrillated by nanites.") else diff --git a/code/modules/surgery/organs/ears.dm b/code/modules/surgery/organs/ears.dm index 6f057c88d23d..7118b5b5c8e1 100644 --- a/code/modules/surgery/organs/ears.dm +++ b/code/modules/surgery/organs/ears.dm @@ -295,13 +295,13 @@ /obj/item/organ/ears/robot/emp_act(severity) switch(severity) if(1) - owner.Jitter(30) + owner.adjust_jitter(30) owner.Dizzy(30) owner.Knockdown(200) deaf = 30 to_chat(owner, "Your robotic ears are ringing, uselessly.") if(2) - owner.Jitter(15) + owner.adjust_jitter(15) owner.Dizzy(15) owner.Knockdown(100) to_chat(owner, "Your robotic ears buzz.") diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index 6ba9ce69d700..973c17204eae 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -77,7 +77,7 @@ H.stop_sound_channel(CHANNEL_HEARTBEAT) beat = BEAT_NONE - if(H.jitteriness) + if(H.jitteriness > 100) if(H.health > HEALTH_THRESHOLD_FULLCRIT && (!beat || beat == BEAT_SLOW)) H.playsound_local(get_turf(H),fastbeat,40,0, channel = CHANNEL_HEARTBEAT, use_reverb = FALSE) beat = BEAT_FAST diff --git a/code/modules/surgery/organs/stomach.dm b/code/modules/surgery/organs/stomach.dm index bf229226e25c..42bf9f5adeae 100644 --- a/code/modules/surgery/organs/stomach.dm +++ b/code/modules/surgery/organs/stomach.dm @@ -59,7 +59,7 @@ H.confused += 2 if(!H.stat) to_chat(H, span_warning("You feel queasy...")) - H.jitteriness = max(H.jitteriness - 3, 0) + H.adjust_jitter(-3) if(DISGUST_LEVEL_GROSS to DISGUST_LEVEL_VERYGROSS) //throw alerts H.throw_alert("disgust", /atom/movable/screen/alert/gross) diff --git a/shiptest.dme b/shiptest.dme index 8d06ec6b4e6a..c4df90c81e85 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -2687,7 +2687,6 @@ #include "code\modules\mob\living\simple_animal\bot\ed209bot.dm" #include "code\modules\mob\living\simple_animal\bot\firebot.dm" #include "code\modules\mob\living\simple_animal\bot\floorbot.dm" -#include "code\modules\mob\living\simple_animal\bot\honkbot.dm" #include "code\modules\mob\living\simple_animal\bot\hygienebot.dm" #include "code\modules\mob\living\simple_animal\bot\medbot.dm" #include "code\modules\mob\living\simple_animal\bot\mulebot.dm"