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

Changes to adrenal implants, aggro grabs, and melee perks #2560

Merged
Merged
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
2 changes: 2 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@
#define TRAIT_AUTOBREW "autobrewery-syndrome"
#define TRAIT_ZOOMIES "zoomies"
#define TRAIT_SUPER_ZOOMIES "super zoomies"
#define TRAIT_ENDLESS_RUNNER "endless_runner"
#define TRAIT_PANICKED_ATTACKER "panicked_attacker"

// mobility flag traits
// IN THE FUTURE, IT WOULD BE NICE TO DO SOMETHING SIMILAR TO https://github.com/tgstation/tgstation/pull/48923/files (ofcourse not nearly the same because I have my.. thoughts on it)
Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_CANNIBAL" = TRAIT_LONGPORKLOVER,
"TRAIT_ZOOMIES" = TRAIT_ZOOMIES,
"TRAIT_SUPER_ZOOMIES" = TRAIT_SUPER_ZOOMIES,
"TRAIT_ENDLESS_RUNNER" = TRAIT_ENDLESS_RUNNER,
"TRAIT_PANICKED_ATTACKER" = TRAIT_PANICKED_ATTACKER,
"TRAIT_EXPLOSIVE_CRAFTING" = TRAIT_EXPLOSIVE_CRAFTING,
"TRAIT_ADVANCED_EXPLOSIVE_CRAFTING" = TRAIT_ADVANCED_EXPLOSIVE_CRAFTING,
"TRAIT_HEAL_TONGUE" = TRAIT_HEAL_TONGUE,
Expand Down
41 changes: 18 additions & 23 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,29 +110,24 @@

var/force_modifier = 0
if(force >= 5)
if(HAS_TRAIT(user, TRAIT_BIG_LEAGUES))
force_modifier += 10

if(HAS_TRAIT(user, TRAIT_LITTLE_LEAGUES))
force_modifier += 5

if(HAS_TRAIT(user, TRAIT_GENTLE))
force_modifier += -5

if(HAS_TRAIT(user, TRAIT_WIMPY))
force_modifier += -10

if(HAS_TRAIT(user, TRAIT_BUFFOUT_BUFF))
force_modifier += (force * 0.25)

if(HAS_TRAIT(user, TRAIT_FEV))
force_modifier += (force * 0.35)

if(HAS_TRAIT(user, TRAIT_SMUTANT))
force_modifier += (force * 0.25)

if(HAS_TRAIT(user, TRAIT_GHOULMELEE)) //negative trait
force_modifier += (-force * 0.25)
if(HAS_TRAIT(user, TRAIT_PANICKED_ATTACKER) || HAS_TRAIT(user, TRAIT_GHOULMELEE))
force_modifier = (-force * 0.8) // You do 20% damage cus ur scared
else
if(HAS_TRAIT(user, TRAIT_BIG_LEAGUES))
force_modifier += 5
if(HAS_TRAIT(user, TRAIT_LITTLE_LEAGUES))
force_modifier += 3
if(HAS_TRAIT(user, TRAIT_GENTLE))
force_modifier += -5
if(HAS_TRAIT(user, TRAIT_WIMPY))
force_modifier += -10
if(HAS_TRAIT(user, TRAIT_BUFFOUT_BUFF))
force_modifier += (force * 0.25) // maxes out your damage
if(HAS_TRAIT(user, TRAIT_FEV))
force_modifier += (force * 0.1)
if(HAS_TRAIT(user, TRAIT_SMUTANT))
force_modifier += (force * 0.1)
force_modifier = clamp(force_modifier, -force, force * 0.25)

var/force_out = force + force_modifier
if(force_out <= 0)
Expand Down
2 changes: 2 additions & 0 deletions code/datums/martial/_martial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
if(!isliving(defender))
return
var/armormult = clamp(defender.getarmor(zone, armor_type), 0, 1)
if(HAS_TRAIT(attacker, TRAIT_PANICKED_ATTACKER))
damage *= 0.2
defender.apply_damage(damage, damage_type, BODY_ZONE_CHEST, blocked = armormult, wound_bonus = woundbonus)
log_combat(attacker, defender, "martial art ([src])")

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/instruments.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
/obj/item/instrument/violin/golden
name = "golden violin"
desc = "A golden musical instrument with four strings and a bow."
force_wielded = 45
force_wielded = 45
icon_state = "golden_violin"
item_state = "golden_violin"
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
Expand Down
8 changes: 6 additions & 2 deletions code/game/objects/items/implants/implant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
/mob/living/simple_animal/can_be_implanted()
return healable //Applies to robots and most non-organics, exceptions can override.

/obj/item/implant/proc/post_implant(mob/living/target, mob/living/user, silent = FALSE)
return

/obj/item/implant/proc/post_removed(mob/living/source, silent = FALSE, special = 0)
return

//What does the implant do upon injection?
//return 1 if the implant injects
Expand Down Expand Up @@ -85,7 +89,7 @@

if(user)
log_combat(user, target, "implanted", "\a [name]")

post_implant(target, user, silent)
return TRUE

/obj/item/implant/proc/removed(mob/living/source, silent = FALSE, special = 0)
Expand All @@ -98,7 +102,7 @@
if(ishuman(source))
var/mob/living/carbon/human/H = source
H.sec_hud_set_implants()

post_removed(source, silent, special)
return 1

/obj/item/implant/Destroy()
Expand Down
58 changes: 45 additions & 13 deletions code/game/objects/items/implants/implant_misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,60 @@


/obj/item/implant/adrenalin
name = "adrenal implant"
desc = "Removes all stuns."
name = "FighterFlight adrenal implant"
desc = "An implantable device that delivers a potent mix of rescue drugs when it detects critical injuries. May cause weakness, muscle spasms, and the complete inability to shoot straight. \
<br><br><b>WARNING:</b> This implant is not intended for use by the elderly, the infirm, or the pregnant. Multiple implants may have unintended effects. No refunds."
icon_state = "adrenal"
uses = 1
actions_types = list()
var/juicing


/obj/item/implant/adrenalin/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
<b>Name:</b> Cybersun Industries Adrenaline Implant<BR>
<b>Life:</b> Five days.<BR>
<b>Important Notes:</b> <font color='red'>Illegal</font><BR>
<b>Name:</b> Nash Salvage and Research Endogenous Rescue Implant<BR>
<b>Life:</b> 48 hours.<BR>
<HR>
<b>Implant Details:</b> Subjects injected with implant can activate an injection of medical cocktails.<BR>
<b>Implant Details:</b> Delivers a dose of rescue drugs to the host upon critial injury.<BR>
<b>Contents:</b> Epinephrine, Coagulant, Water, Adrenaline.<BR>
<b>Function:</b> Removes stuns, increases speed, and has a mild healing effect.<BR>
<b>Integrity:</b> Implant can only be used three times before reserves are depleted."}
<b>Integrity:</b> Implant is destroyed on use."}
return dat

/obj/item/implant/adrenalin/activate()
. = ..()
uses--
imp_in.do_adrenaline(150, TRUE, 0, 0, TRUE, list(/datum/reagent/medicine/inaprovaline = 1, /datum/reagent/medicine/synaptizine = 1, /datum/reagent/medicine/regen_jelly = 1, /datum/reagent/medicine/stimulants = 1, /datum/reagent/drug/jet = 3), span_boldnotice("You feel a sudden surge of energy!"))
to_chat(imp_in, span_notice("You feel a sudden surge of energy!"))
if(!uses)
/obj/item/implant/adrenalin/post_implant(mob/living/target, mob/living/user, silent = FALSE)
RegisterSignal(target, COMSIG_MOB_STATCHANGE, .proc/prejuice)
return

/obj/item/implant/adrenalin/post_removed(mob/living/source, silent = FALSE, special = 0)
UnregisterSignal(source, COMSIG_MOB_STATCHANGE)
return

/obj/item/implant/adrenalin/proc/prejuice(datum/source, newstat)
if(juicing)
return
if(newstat == CONSCIOUS)
return
playsound(imp_in, 'sound/effects/autoinjector_beeps.ogg', 75, TRUE)
addtimer(CALLBACK(src, .proc/juice), 2 SECONDS)


/obj/item/implant/adrenalin/proc/juice()
playsound(imp_in, 'sound/effects/bamf.ogg', 75, TRUE)
imp_in.do_adrenaline(
stamina_boost = 75,
put_on_feet = TRUE,
clamp_unconscious_to = 0,
clamp_immobility_to = 0,
reset_misc = TRUE,
healing_chems = list(
/datum/reagent/medicine/epinephrine = 10,
/datum/reagent/medicine/coagulant = 19,
/datum/reagent/water = 100,
/datum/reagent/medicine/adrenaline = 100
)
)
to_chat(imp_in, span_userdanger("You feel your adrenal implant burst!"))
if(uses-- <= 0)
qdel(src)

/obj/item/implant/warp
Expand Down
1 change: 0 additions & 1 deletion code/modules/fallout/reagents/drugs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@
M.AdjustStun(-25, 0)
M.AdjustKnockdown(-25, 0)
M.AdjustUnconscious(-25, 0)
M.adjustStaminaLoss(-5, 0)
M.Jitter(2)
if(M.mind)
var/datum/job/job = SSjob.GetJob(M.mind.assigned_role)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
thrown_thing.safe_throw_at(target, thrown_thing.throw_range, thrown_thing.throw_speed + power_throw, src, null, null, null, move_force, random_turn)

/mob/living/carbon/restrained(ignore_grab)
. = (handcuffed || (!ignore_grab && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE))
. = (handcuffed || (!ignore_grab && pulledby && pulledby.grab_state >= GRAB_NECK))

/mob/living/carbon/proc/canBeHandcuffed()
return 0
Expand Down
22 changes: 11 additions & 11 deletions code/modules/mob/living/carbon/carbon_sprint.dm
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
/// Sprint buffer ///
/mob/living/carbon/doSprintLossTiles(tiles)
doSprintBufferRegen(FALSE) //first regen.
if(sprint_buffer)
if(sprint_buffer && !HAS_TRAIT(src, TRAIT_ENDLESS_RUNNER))
var/use = min(tiles, sprint_buffer)
if(HAS_TRAIT(src, TRAIT_ZOOMIES))
sprint_buffer -= use * 1.3
if(HAS_TRAIT(src, TRAIT_SUPER_ZOOMIES))
sprint_buffer -= use * 2
else
sprint_buffer -= use
use *= 0.65
else if(HAS_TRAIT(src, TRAIT_SUPER_ZOOMIES))
use *= 0.35
sprint_buffer -= use
tiles -= use
update_hud_sprint_bar()
if(!tiles) //we had enough, we're done!
Expand All @@ -18,11 +17,12 @@
if(!client || !((client in sprint_bind.is_down) || (client in sprint_hold_bind.is_down))) // there are two keybinds, apparently
disable_intentional_sprint_mode()
return // if you're not holding it, you stop sprinting when you run out
if(HAS_TRAIT(src, TRAIT_ZOOMIES))
adjustStaminaLoss(tiles * sprint_stamina_cost * -0.7)
if(HAS_TRAIT(src, TRAIT_SUPER_ZOOMIES))
adjustStaminaLoss(tiles * sprint_stamina_cost * -0.5)
return
if(HAS_TRAIT(src, TRAIT_ENDLESS_RUNNER))
return // you don't stop sprinting if you have this trait
else if(HAS_TRAIT(src, TRAIT_ZOOMIES))
adjustStaminaLoss(tiles * sprint_stamina_cost * 0.7)
else if(HAS_TRAIT(src, TRAIT_SUPER_ZOOMIES))
adjustStaminaLoss(tiles * sprint_stamina_cost * 0.5)
else
adjustStaminaLoss(tiles * sprint_stamina_cost) //use stamina to cover deficit.

Expand Down
40 changes: 22 additions & 18 deletions code/modules/mob/living/carbon/human/human_mobility.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/mob/living/carbon/human/resist_a_rest(automatic = FALSE, ignoretimer = FALSE)
/mob/living/carbon/human/resist_a_rest(automatic = FALSE, ignoretimer = FALSE, silent = FALSE)
if(!resting || stat || (combat_flags & COMBAT_FLAG_RESISTING_REST))
return FALSE
if(ignoretimer)
Expand All @@ -8,33 +8,36 @@
set_resting(FALSE, FALSE)
return TRUE
else if(!CHECK_MOBILITY(src, MOBILITY_RESIST))
if(!automatic)
if(!automatic && !silent)
to_chat(src, span_warning("You are unable to stand up right now."))
return FALSE
else
var/totaldelay = 3 //A little bit less than half of a second as a baseline for getting up from a rest
if(IS_STAMCRIT(src))
if(IS_STAMCRIT(src) && !silent)
to_chat(src, "<span class='warning'>You're too exhausted to get up!")
return FALSE
combat_flags |= COMBAT_FLAG_RESISTING_REST
var/health_deficiency = max((maxHealth - (health - getStaminaLoss()))*0.5, 0)
if(!has_gravity())
health_deficiency = health_deficiency*0.2
totaldelay += health_deficiency
var/standupwarning = "[src] and everyone around them should probably yell at the dev team"
switch(health_deficiency)
if(-INFINITY to 10)
standupwarning = "[src] stands right up!"
if(10 to 35)
standupwarning = "[src] tries to stand up."
if(35 to 60)
standupwarning = "[src] slowly pushes [p_them()]self upright."
if(60 to 80)
standupwarning = "[src] weakly attempts to stand up."
if(80 to INFINITY)
standupwarning = "[src] struggles to stand up."
var/usernotice = automatic ? span_notice("You are now getting up. (Auto)") : span_notice("You are now getting up.")
visible_message(span_notice("[standupwarning]"), usernotice, vision_distance = 5)
if(!silent)
var/standupwarning = "[src] and everyone around them should probably yell at the dev team"
switch(health_deficiency)
if(-INFINITY to 10)
standupwarning = "[src] stands right up!"
if(10 to 35)
standupwarning = "[src] tries to stand up."
if(35 to 60)
standupwarning = "[src] slowly pushes [p_them()]self upright."
if(60 to 80)
standupwarning = "[src] weakly attempts to stand up."
if(80 to INFINITY)
standupwarning = "[src] struggles to stand up."
var/usernotice = automatic ? span_notice("You are now getting up. (Auto)") : span_notice("You are now getting up.")
visible_message(span_notice("[standupwarning]"), usernotice, vision_distance = 5)
if(HAS_TRAIT(src, TRAIT_ENDLESS_RUNNER))
totaldelay = 0.1 SECONDS // =3
if(do_after(src, totaldelay, target = src, required_mobility_flags = MOBILITY_RESIST))
set_resting(FALSE, TRUE)

Expand All @@ -43,7 +46,8 @@
else
combat_flags &= ~COMBAT_FLAG_RESISTING_REST
if(resting) //we didn't shove ourselves up or something
visible_message(span_notice("[src] falls right back down."), span_notice("You fall right back down."))
if(!silent)
visible_message(span_notice("[src] falls right back down."), span_notice("You fall right back down."))
if(has_gravity())
playsound(src, "bodyfall", 20, 1)
return FALSE
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/human/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,8 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/damage = rand(user.dna.species.punchdamagelow, user.dna.species.punchdamagehigh)
if(HAS_TRAIT(user, TRAIT_PERFECT_ATTACKER)) // unit test no-miss trait
damage = user.dna.species.punchdamagehigh
if(HAS_TRAIT(user, TRAIT_PANICKED_ATTACKER))
damage *= 0.2 // too scared!
var/punchedstam = target.getStaminaLoss()
var/punchedbrute = target.getBruteLoss()

Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,7 @@
update_stamina()
update_mobility()
if(healing_chems)
reagents.remove_all(999)
reagents.add_reagent_list(healing_chems)

/mob/living/canface()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/living_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@

if(user.grab_state) //only the first upgrade is instantaneous
var/old_grab_state = user.grab_state
var/grab_upgrade_time = instant ? 0 : 30
var/grab_upgrade_time = instant ? 0 : 3 SECONDS
visible_message(span_danger("[user] starts to tighten [user.p_their()] grip on [src]!"), \
span_userdanger("[user] starts to tighten [user.p_their()] grip on you!"), target = user,
target_message = span_danger("You start to tighten your grip on [src]!"))
Expand All @@ -264,7 +264,7 @@
log_combat(user, src, "attempted to neck grab", addition="neck grab")
if(GRAB_NECK)
log_combat(user, src, "attempted to strangle", addition="kill grab")
if(!do_mob(user, src, grab_upgrade_time))
if(!do_mob(user, src, grab_upgrade_time, allow_movement = TRUE, public_progbar = TRUE))
return 0
if(!user.pulling || user.pulling != src || user.grab_state != old_grab_state || user.a_intent != INTENT_GRAB)
return 0
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/living_mobility.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
else
resist_a_rest()

/mob/living/proc/resist_a_rest(automatic = FALSE, ignoretimer = FALSE) //Lets mobs resist out of resting. Major QOL change with combat reworks.
/mob/living/proc/resist_a_rest(automatic = FALSE, ignoretimer = FALSE, silent = FALSE) //Lets mobs resist out of resting. Major QOL change with combat reworks.
set_resting(FALSE, TRUE)
return TRUE

Expand All @@ -81,7 +81,7 @@

var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK
var/restrained = restrained()
var/pinned = resting && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE // Cit change - adds pinning for aggressive-grabbing people on the ground
var/pinned = resting && pulledby && pulledby.grab_state >= GRAB_NECK // Cit change - adds pinning for aggressive-grabbing people on the ground
var/has_limbs = has_arms || ignore_legs || has_legs
var/canmove = !immobilize && !stun && conscious && !paralyze && (!stat_softcrit || !pulledby) && !chokehold && !IsFrozen() && has_limbs && !pinned && !(combat_flags & COMBAT_FLAG_HARD_STAMCRIT)
var/canresist = !stun && conscious && !stat_softcrit && !paralyze && has_limbs && !(combat_flags & COMBAT_FLAG_HARD_STAMCRIT)
Expand Down
6 changes: 5 additions & 1 deletion code/modules/projectiles/ammunition/_firing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
gun_bullet_spread += distro || 0 // gun's inaccuracy
gun_bullet_spread += variance || 0 // cartridge's inaccuracy
var/player_spread = spread // spread is the player's recoil
if(HAS_TRAIT(user,TRAIT_INSANE_AIM))
if(HAS_TRAIT(user,TRAIT_PANICKED_ATTACKER))
player_spread = 100 // lol
else if(HAS_TRAIT(user,TRAIT_INSANE_AIM))
player_spread = 0 // nice shot
else
if(HAS_TRAIT(user,TRAIT_FEV)) //You really shouldn't try this at home.
Expand All @@ -66,6 +68,8 @@
BB.def_zone = user.zone_selected
BB.suppressed = quiet
BB.damage_threshold_penetration = damage_threshold_penetration
if(HAS_TRAIT(user,TRAIT_PANICKED_ATTACKER))
BB.damage *= 0.2 // lol

if(isgun(fired_from))
var/obj/item/gun/G = fired_from
Expand Down
Loading
Loading