[READY FOR MERGE] The Giant Combat Reworks - Part 1: Goodbye stuns, hello staminacrit (#5463)

* part 1 - resist out of resting, move and interact with the world while resting, and stamina regen nerf

* makes beepsky check for stuns instead of knockdowns, adds message for getting up, makes gravity reduce standup time, and more

* sprinting, staminacrit, balance changes, and more

* adds stamina modifier to clickdelay, makes items deal stamina damage to the user when attacking, buffs resting stamina regen

* combat mode, ability to toggle right-click context menu on/off, basic combat mode QOL, lays groundwork for 2-handing any item

combat mode toggle sound is from Interbay.

* commits dme changes

* unarmed combat stamina, ability to right click in combat mode, balance changes

* tosses in the HUD icons for later-ish

* rolls back admin.txt

* lotsa UI stuff

* stamina checks, some balance stuff

* adds support for best ui, adds right click to flush disposals, removes aggressive grab pinning in favor of neckgrab chokeholding

* quick dogborg patch while i figure out what do do with them

* oops - fixes prefbreaking for screenshake

* trying to sprint from an elevated surface onto lower ground will now knock you down

* right click to pull fire alarm, lets you bully people by pulling chairs out form under them, makes attacking objects cost stamina

* makes accidents during slipping less likely to occur while combat mode is active, makes tripping off elevated surfaces cause accidents

* makes pumping shotguns cost a tiiiny bit of stamina

* makes eyestabbing and batoning cost stamina

* makes failing stamina checks error out properly, adds stamina check to shotgun pumping

* adds stamina check for chair pulling

* readds aggressive grab pinning

* fixes bug with being buckled preventing interaction

* adds recoveringstam check to incapacitated

* reduces stamina cost for attacking

* oh this too

* fixes bug where you can get stuck in recoveringstam if your stamina suddenly becomes 0 while you're in staminacrit

* makes monkey transformation inherit staminaloss

* adds the ability to wave or shake your fist at someone via right click

* grammar and span closing

* 99 annoying little bugs on the wall, 99 annoying little bugs. take one down, pass it around, 864 gamebreaking bugs on the wall

* more distant right-click emotes.

* buffs standing stamina regen a tiiiiiiny bit

* adds aiming down sights for guns, makes firing guns cause trace amounts of staminaloss

* crusher powercreep - gives crushers the ability to heal staminaloss

* item throwing buff

* adds 1:1 HUD layout

* hopefully fixes issue with recoveringstamcrit not updating

* giant hipfire nerf

* halves the effect of staminaloss on movement speed

* makes stamina recover faster in staminacrit, makes it easier to get disarmed out of combat mode

* get_weight(), movedelay health_deficiency tweaking, combat and resting checks for item attacking

* makes staminacrit automatically disable combat mode, it's now impossible to enter combat mode while in stamcrit

* adds stamina buffer, halves the time needed to stand up after resting, increases stam penalty for firing weapons, and more

* tweaks stamina buffer drain rate a little

* makes buffered staminaloss redirect stamina to the actual stamloss proc when empty, makes stamina buffer stat() more precise

* removes stamina modifier for clickdelays, makes stunbatons deal extra staminaloss

* makes electrodes deal a lil extra staminaloss

* drones cannot resist a rest, so now only carbons are forced to rest

* restricts aiming down sights to carbon mobs, adds stamina display to stat()

* makes gun accuracy and stamcosts more flexible, decreases base inaccuracy penalty, makes borgs immune to inaccuracy penalties

* nerfs inaccuracy penalties just a lil more, fixes blooddrunk miner eye depleting all your stamina

* getting used to tortoisegit

* readds temp dogborg buff

* stamina and stamina buffer HUD displays. Stamina sprite from hippiestation

* makes afterattack call properly again

* decreases stamina buffer regen time to 3 seconds

* Yknow what? decreases it to 2 seconds. That's 3 entire attacks worth of waiting

* makes stamina buffer influence movespeed a lil

* nerfs compiling errors

* tweaks the icons a little

* adds autostanding, adds delimiters to attempts to stand

* makes automatic standup attempts a little clearer

* rest button now toggles intent to rest, fixes perma rest

* oop - quick fixes

* Makes crushers ignore recoil stamina on lavaland, makes burstfiring weapons deal less staminaloss

* buffs highlander sword

* makes stamina have less of an impact on the health display

* fixes dogborgs shoving other borgs into infinite stuns

* You can no longer shoot over tables or shoot through windows while resting. Also buffs turrets
This commit is contained in:
deathride58
2018-03-11 20:32:44 +00:00
committed by kevinz000
parent b4f5279580
commit 1c0b13ecfb
73 changed files with 936 additions and 63 deletions
@@ -12,3 +12,11 @@
/client/proc/is_mentor() // admins are mentors too.
if(mentor_datum || check_rights_for(src, R_ADMIN,0))
return TRUE
/client/verb/togglerightclickstuff()
set category = "OOC"
set name = "Toggle Rightclick"
set desc = "Did the context menu get stuck on or off? Press this button."
show_popup_menus = !show_popup_menus
to_chat(src, "<span class='notice'>The right-click context menu is now [show_popup_menus ? "enabled" : "disabled"].</span>")
@@ -11,6 +11,7 @@
var/damagescreenshake = 2
var/arousable = TRUE
var/widescreenpref = TRUE
var/autostand = TRUE
/datum/preferences/New(client/C)
..()
@@ -0,0 +1,6 @@
/mob/living/carbon/key_down(_key, client/user)
switch(_key)
if("C")
toggle_combat_mode()
return
return ..()
@@ -0,0 +1,13 @@
/mob/living/carbon/human/key_down(_key, client/user)
switch(_key)
if("Shift")
togglesprint()
return
return ..()
/mob/living/carbon/human/key_up(_key, client/user)
switch(_key)
if("Shift")
togglesprint()
return
return ..()
@@ -0,0 +1,17 @@
/mob/living/carbon
var/combatmode = FALSE //literally lifeweb
/mob/living/carbon/proc/toggle_combat_mode()
if(recoveringstam)
return TRUE
combatmode = !combatmode
if(combatmode)
playsound_local(src, 'modular_citadel/sound/misc/ui_toggle.ogg', 50, FALSE, pressure_affected = FALSE) //Sound from interbay!
else
playsound_local(src, 'modular_citadel/sound/misc/ui_toggleoff.ogg', 50, FALSE, pressure_affected = FALSE) //Slightly modified version of the above!
if(client)
client.show_popup_menus = !combatmode // So we can right-click for alternate actions and all that other good shit. Also moves examine to shift+rightclick to make it possible to attack while sprinting
if(hud_used && hud_used.static_inventory)
for(var/obj/screen/combattoggle/selector in hud_used.static_inventory)
selector.rebasetointerbay(src)
return TRUE
@@ -0,0 +1,10 @@
/mob/living/carbon/adjustStaminaLossBuffered(amount, updating_stamina = 1)
if(status_flags & GODMODE)
return 0
var/directstamloss = (bufferedstam + amount) - stambuffer
if(directstamloss > 0)
adjustStaminaLoss(directstamloss)
bufferedstam = CLAMP(bufferedstam + amount, 0, stambuffer)
stambufferregentime = world.time + 2 SECONDS
if(updating_stamina)
update_health_hud()
@@ -2,4 +2,13 @@
if(user == src && pulling && !pulling.anchored && grab_state >= GRAB_AGGRESSIVE && isliving(pulling))
vore_attack(user, pulling)
else
..()
..()
/mob/living/carbon/human/alt_attack_hand(mob/user)
if(..())
return
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(!dna.species.alt_spec_attack_hand(H, src))
dna.species.spec_attack_hand(H, src)
return TRUE
@@ -0,0 +1,31 @@
/mob/living/carbon/human
var/sprinting = FALSE
/mob/living/carbon/human/Move(NewLoc, direct)
var/oldpseudoheight = pseudo_z_axis
. = ..()
if(. && sprinting && !resting && m_intent == MOVE_INTENT_RUN)
adjustStaminaLossBuffered(0.3)
if((oldpseudoheight - pseudo_z_axis) >= 8)
to_chat(src, "<span class='warning'>You trip off of the elevated surface!</span>")
for(var/obj/item/I in held_items)
accident(I)
Knockdown(80)
/mob/living/carbon/human/movement_delay()
. = 0
if(!resting && m_intent == MOVE_INTENT_RUN && !sprinting)
. += 1
. += ..()
/mob/living/carbon/human/proc/togglesprint() // If you call this proc outside of hotkeys or clicking the HUD button, I'll be disappointed in you.
sprinting = !sprinting
if(!resting && m_intent == MOVE_INTENT_RUN && canmove)
if(sprinting)
playsound_local(src, 'modular_citadel/sound/misc/sprintactivate.ogg', 50, FALSE, pressure_affected = FALSE)
else
playsound_local(src, 'modular_citadel/sound/misc/sprintdeactivate.ogg', 50, FALSE, pressure_affected = FALSE)
if(hud_used && hud_used.static_inventory)
for(var/obj/screen/sprintbutton/selector in hud_used.static_inventory)
selector.insert_witty_toggle_joke_here(src)
return TRUE
@@ -3,10 +3,19 @@
if(stat != DEAD)
handle_arousal()
. = ..()
/mob/living/carbon/human/calculate_affecting_pressure(pressure)
if(ismob(loc))
return ONE_ATMOSPHERE
if(istype(loc, /obj/item/device/dogborg/sleeper))
return ONE_ATMOSPHERE
. = ..()
. = ..()
/mob/living/carbon/human/update_health_hud(shown_health_amount)
. = ..()
if(!client || !hud_used)
return
if(hud_used.staminas)
hud_used.staminas.icon_state = staminahudamount()
if(hud_used.staminabuffer)
hud_used.staminabuffer.icon_state = staminabufferhudamount()
@@ -0,0 +1,57 @@
/datum/species/proc/alt_spec_attack_hand(mob/living/carbon/human/M, mob/living/carbon/human/H, datum/martial_art/attacker_style)
if(!istype(M))
return TRUE
CHECK_DNA_AND_SPECIES(M)
CHECK_DNA_AND_SPECIES(H)
if(!istype(M)) //sanity check for drones.
return TRUE
if(M.mind)
attacker_style = M.mind.martial_art
if((M != H) && M.a_intent != INTENT_HELP && H.check_shields(M, 0, M.name, attack_type = UNARMED_ATTACK))
add_logs(M, H, "attempted to touch")
H.visible_message("<span class='warning'>[M] attempted to touch [H]!</span>")
return TRUE
switch(M.a_intent)
if("disarm")
altdisarm(M, H, attacker_style)
return TRUE
return FALSE
/datum/species/proc/altdisarm(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
if(user.staminaloss >= STAMINA_SOFTCRIT)
to_chat(user, "<span class='warning'>You're too exhausted.</span>")
return FALSE
else if(target.check_block())
target.visible_message("<span class='warning'>[target] blocks [user]'s disarm attempt!</span>")
return 0
if(attacker_style && attacker_style.disarm_act(user,target))
return 1
else
user.do_attack_animation(target, ATTACK_EFFECT_DISARM)
user.adjustStaminaLossBuffered(4) //CITADEL CHANGE - makes disarmspam cause staminaloss
if(target.w_uniform)
target.w_uniform.add_fingerprint(user)
var/randomized_zone = ran_zone(user.zone_selected)
target.SendSignal(COMSIG_HUMAN_DISARM_HIT, user, user.zone_selected)
var/obj/item/bodypart/affecting = target.get_bodypart(randomized_zone)
var/randn = rand(1, 100)
if(user.resting)
randn += 20 //Makes it plausible, but unlikely, to push someone over while resting
if(!user.combatmode)
randn += 25 //Makes it impossible to push actually push someone outside of combat mode
if(randn <= 25)
playsound(target, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
target.visible_message("<span class='danger'>[user] has pushed [target]!</span>",
"<span class='userdanger'>[user] has pushed [target]!</span>", null, COMBAT_MESSAGE_RANGE)
target.apply_effect(40, KNOCKDOWN, target.run_armor_check(affecting, "melee", "Your armor prevents your fall!", "Your armor softens your fall!"))
target.forcesay(GLOB.hit_appends)
add_logs(user, target, "disarmed", " pushing them to the ground")
return
playsound(target, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
target.visible_message("<span class='danger'>[user] attempted to push [target]!</span>", \
"<span class='userdanger'>[user] attemped to push [target]!</span>", null, COMBAT_MESSAGE_RANGE)
@@ -0,0 +1,2 @@
/mob/living/proc/adjustStaminaLossBuffered(amount, updating_stamina = TRUE, forced = FALSE)
return
@@ -0,0 +1,122 @@
/mob/living
var/recoveringstam = FALSE
var/bufferedstam = 0
var/stambuffer = 20
var/stambufferregentime
var/aimingdownsights = FALSE
var/attemptingstandup = FALSE
var/intentionalresting = FALSE
/mob/living/movement_delay(ignorewalk = 0)
. = ..()
if(resting)
. += 6
/atom
var/pseudo_z_axis
/atom/proc/get_fake_z()
return pseudo_z_axis
/obj/structure/table
pseudo_z_axis = 8
/turf/open/get_fake_z()
var/objschecked
for(var/obj/structure/structurestocheck in contents)
objschecked++
if(structurestocheck.pseudo_z_axis)
return structurestocheck.pseudo_z_axis
if(objschecked >= 25)
break
return pseudo_z_axis
/mob/living/Move(atom/newloc, direct)
. = ..()
if(.)
if(makesfootstepsounds)
CitFootstep(newloc)
pseudo_z_axis = newloc.get_fake_z()
pixel_z = pseudo_z_axis
if(aimingdownsights)
aimingdownsights = FALSE
to_chat(src, "<span class='notice'>You are no longer aiming down your weapon's sights.</span>")
/mob/living/proc/lay_down()
set name = "Rest"
set category = "IC"
if(client && client.prefs && client.prefs.autostand)
intentionalresting = !intentionalresting
to_chat(src, "<span class='notice'>You are now attempting to [intentionalresting ? "[!resting ? "lay down and ": ""]stay down" : "[resting ? "get up and ": ""]stay up"].</span>")
if(intentionalresting && !resting)
resting = TRUE
update_canmove()
else
resist_a_rest()
else
if(!resting)
resting = TRUE
to_chat(src, "<span class='notice'>You are now laying down.</span>")
update_canmove()
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.
if(!resting || stat || attemptingstandup)
return FALSE
if(ignoretimer)
resting = FALSE
update_canmove()
return TRUE
else
var/totaldelay = 3 //A little bit less than half of a second as a baseline for getting up from a rest
if(staminaloss >= STAMINA_SOFTCRIT)
to_chat(src, "<span class='warning'>You're too exhausted to get up!")
return FALSE
attemptingstandup = TRUE
var/health_deficiency = max((maxHealth - (health - staminaloss))*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 class='notice'>You are now getting up. (Auto)</span>" : "<span class='notice'>You are now getting up.</span>"
visible_message("<span class='notice'>[standupwarning]</span>", usernotice, vision_distance = 5)
if(do_after(src, totaldelay, target = src))
resting = FALSE
attemptingstandup = FALSE
update_canmove()
return TRUE
else
visible_message("<span class='notice'>[src] falls right back down.</span>", "<span class='notice'>You fall right back down.</span>")
attemptingstandup = FALSE
if(has_gravity())
playsound(src, "bodyfall", 20, 1)
return FALSE
/mob/living/carbon/proc/update_stamina()
var/total_health = (min(health*2,100) - staminaloss)
if(staminaloss)
if(!recoveringstam && total_health <= STAMINA_CRIT_TRADITIONAL && !stat)
to_chat(src, "<span class='notice'>You're too exhausted to keep going...</span>")
resting = TRUE
if(combatmode)
toggle_combat_mode()
recoveringstam = TRUE
update_canmove()
if(recoveringstam && total_health >= STAMINA_SOFTCRIT_TRADITIONAL)
to_chat(src, "<span class='notice'>You don't feel nearly as exhausted anymore.</span>")
recoveringstam = FALSE
update_canmove()
update_health_hud()
@@ -379,7 +379,7 @@ SLEEPER CODE IS IN game/objects/items/devices/dogborg_sleeper.dm !
blocked = 1
if(!blocked)
L.visible_message("<span class ='danger'>[src] pounces on [L]!</span>", "<span class ='userdanger'>[src] pounces on you!</span>")
L.Knockdown(45)
L.Knockdown(iscarbon(L) ? 450 : 45) // Temporary. If someone could rework how dogborg pounces work to accomodate for combat changes, that'd be nice.
playsound(src, 'sound/weapons/Egloves.ogg', 50, 1)
sleep(2)//Runtime prevention (infinite bump() calls on hulks)
step_towards(src,L)
+2
View File
@@ -0,0 +1,2 @@
/mob/proc/use_that_empty_hand() //currently unused proc so i can implement 2-handing any item a lot easier in the future.
return
@@ -0,0 +1,36 @@
/obj/item/gun/pre_altattackby(atom/A, mob/living/user, params)
altafterattack(A, user, TRUE, params)
return TRUE
/obj/item/gun/altafterattack(atom/target, mob/living/carbon/user, proximity_flag, click_parameters)
if(istype(user))
if(!user.aimingdownsights)
user.visible_message("<span class='warning'>[user] brings [src]'s sights up to [user.p_their()] eyes, aiming directly at [target].</span>", "<span class='warning'>You bring [src]'s sights up to your eyes, aiming directly at [target].</span>")
user.adjustStaminaLossBuffered(1)
else
user.visible_message("<span class='notice'>[user] lowers [src].</span>", "<span class='notice'>You lower [src].</span>")
user.aimingdownsights = !user.aimingdownsights
return TRUE
/obj/item/gun/dropped(mob/living/user)
. = ..()
if(istype(user))
user.aimingdownsights = FALSE
/obj/item/gun/proc/getstamcost(mob/living/carbon/user)
if(user && user.has_gravity())
return recoil
else
return recoil*5
/obj/item/gun/energy/kinetic_accelerator/getstamcost(mob/living/carbon/user)
if(user && !lavaland_equipment_pressure_check(get_turf(user)))
return 0
else
return ..()
/obj/item/gun/proc/getinaccuracy(mob/living/user)
if(!iscarbon(user) || user.aimingdownsights)
return 0
else
return weapon_weight * 25
@@ -0,0 +1,2 @@
/obj/item/projectile/energy/electrode
stamina = 30
@@ -0,0 +1,6 @@
/obj/machinery/disposal/bin/alt_attack_hand(mob/user)
if(is_interactable() && !user.stat)
flush = !flush
update_icon()
return TRUE
return FALSE