Removes ADS + other combat mode tweaks, makes adjuststaminabuffer() affect borg cells, adds sprinting for borgs (#6498)
* adjuststaminabuffer() now drains borg cells, borgs can now sprint, removes aiming down sights, combat mode now makes you face your cursor * forgot to ctrl+s here
This commit is contained in:
@@ -107,6 +107,8 @@
|
||||
if(mob && LAZYLEN(mob.mousemove_intercept_objects))
|
||||
for(var/datum/D in mob.mousemove_intercept_objects)
|
||||
D.onMouseMove(object, location, control, params)
|
||||
if(mob) //CIT CHANGE - passes onmousemove() to mobs
|
||||
mob.onMouseMove(object, location, control, params) //CIT CHANGE - ditto
|
||||
|
||||
/datum/proc/onMouseMove(object, location, control, params)
|
||||
return
|
||||
@@ -138,4 +140,4 @@
|
||||
if (middragatom == src_object)
|
||||
middragtime = 0
|
||||
middragatom = null
|
||||
..()
|
||||
..()
|
||||
|
||||
@@ -328,10 +328,8 @@
|
||||
//this updates all special effects: stun, sleeping, knockdown, druggy, stuttering, etc..
|
||||
/mob/living/carbon/handle_status_effects()
|
||||
..()
|
||||
if(getStaminaLoss() && !combatmode && !aimingdownsights)//CIT CHANGE - prevents stamina regen while combat mode is active
|
||||
if(getStaminaLoss() && !combatmode)//CIT CHANGE - prevents stamina regen while combat mode is active
|
||||
adjustStaminaLoss(resting ? (recoveringstam ? -7.5 : -3) : -1.5)//CIT CHANGE - decreases adjuststaminaloss to stop stamina damage from being such a joke
|
||||
else if(aimingdownsights)//CIT CHANGE - makes aiming down sights drain stamina
|
||||
adjustStaminaLoss(resting ? 0.2 : 0.5)//CIT CHANGE - ditto. Raw spaghetti
|
||||
|
||||
//CIT CHANGES START HERE. STAMINA BUFFER STUFF
|
||||
if(bufferedstam && world.time > stambufferregentime)
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
if(recoil)
|
||||
shake_camera(user, recoil + 1, recoil)
|
||||
|
||||
if(iscarbon(user)) //CIT CHANGE - makes gun recoil cause staminaloss
|
||||
if(isliving(user)) //CIT CHANGE - makes gun recoil cause staminaloss
|
||||
user.adjustStaminaLossBuffered(getstamcost(user)*(firing_burst && burst_size >= 2 ? 1/burst_size : 1)) //CIT CHANGE - ditto
|
||||
|
||||
if(suppressed)
|
||||
|
||||
@@ -72,3 +72,30 @@
|
||||
|
||||
/mob/proc/AltRangedAttack(atom/A, params)
|
||||
return FALSE
|
||||
|
||||
/mob/proc/mouse_face_atom(atom/A) //Basically a copy of face_atom but with ismousemovement set to TRUE
|
||||
if( buckled || stat != CONSCIOUS || !A || !x || !y || !A.x || !A.y )
|
||||
return
|
||||
var/dx = A.x - x
|
||||
var/dy = A.y - y
|
||||
if(!dx && !dy) // Wall items are graphically shifted but on the floor
|
||||
if(A.pixel_y > 16)
|
||||
setDir(NORTH, ismousemovement = TRUE)
|
||||
else if(A.pixel_y < -16)
|
||||
setDir(SOUTH, ismousemovement = TRUE)
|
||||
else if(A.pixel_x > 16)
|
||||
setDir(EAST, ismousemovement = TRUE)
|
||||
else if(A.pixel_x < -16)
|
||||
setDir(WEST, ismousemovement = TRUE)
|
||||
return
|
||||
|
||||
if(abs(dx) < abs(dy))
|
||||
if(dy > 0)
|
||||
setDir(NORTH, ismousemovement = TRUE)
|
||||
else
|
||||
setDir(SOUTH, ismousemovement = TRUE)
|
||||
else
|
||||
if(dx > 0)
|
||||
setDir(EAST, ismousemovement = TRUE)
|
||||
else
|
||||
setDir(WEST, ismousemovement = TRUE)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/mob/living/silicon/robot/key_down(_key, client/user)
|
||||
switch(_key)
|
||||
if("Shift")
|
||||
togglesprint()
|
||||
return
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/robot/key_up(_key, client/user)
|
||||
switch(_key)
|
||||
if("Shift")
|
||||
togglesprint()
|
||||
return
|
||||
return ..()
|
||||
@@ -1,5 +1,8 @@
|
||||
/mob/living/carbon
|
||||
var/combatmode = FALSE //literally lifeweb
|
||||
var/lastmousedir
|
||||
var/wrongdirmovedelay
|
||||
var/lastdirchange
|
||||
|
||||
/mob/living/carbon/CanPass(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
@@ -25,3 +28,29 @@
|
||||
for(var/obj/screen/combattoggle/selector in hud_used.static_inventory)
|
||||
selector.rebasetointerbay(src)
|
||||
return TRUE
|
||||
|
||||
/mob/living/carbon/Move(atom/newloc, direct = 0)
|
||||
var/currentdirection = dir
|
||||
. = ..()
|
||||
wrongdirmovedelay = FALSE
|
||||
if(combatmode && client && lastmousedir)
|
||||
if(lastmousedir != dir)
|
||||
wrongdirmovedelay = TRUE
|
||||
setDir(lastmousedir, ismousemovement = TRUE)
|
||||
if(currentdirection != dir)
|
||||
lastdirchange = world.time
|
||||
|
||||
|
||||
/mob/living/carbon/onMouseMove(object, location, control, params)
|
||||
if(!combatmode)
|
||||
return
|
||||
mouse_face_atom(object)
|
||||
lastmousedir = dir
|
||||
|
||||
/mob/living/carbon/setDir(newdir, ismousemovement = FALSE)
|
||||
if(!combatmode || ismousemovement)
|
||||
if(dir != newdir)
|
||||
lastdirchange = world.time
|
||||
. = ..()
|
||||
else
|
||||
return
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/mob/living/carbon/human/Move(NewLoc, direct)
|
||||
var/oldpseudoheight = pseudo_z_axis
|
||||
. = ..()
|
||||
if(. && sprinting && !resting && m_intent == MOVE_INTENT_RUN)
|
||||
if(. && sprinting && !(movement_type & FLYING) && canmove && !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>")
|
||||
@@ -16,6 +16,8 @@
|
||||
. = 0
|
||||
if(!resting && m_intent == MOVE_INTENT_RUN && !sprinting)
|
||||
. += 1
|
||||
if(wrongdirmovedelay)
|
||||
. += 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.
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
var/bufferedstam = 0
|
||||
var/stambuffer = 20
|
||||
var/stambufferregentime
|
||||
var/aimingdownsights = FALSE
|
||||
var/attemptingstandup = FALSE
|
||||
var/intentionalresting = FALSE
|
||||
var/attemptingcrawl = FALSE
|
||||
@@ -39,9 +38,6 @@
|
||||
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"
|
||||
|
||||
@@ -16,4 +16,8 @@ mob/living/silicon
|
||||
icon_state = "[module.cyborg_base_icon]-rest"
|
||||
else
|
||||
icon_state = "[module.cyborg_base_icon]"
|
||||
update_icons()
|
||||
update_icons()
|
||||
|
||||
/mob/living/silicon/robot/adjustStaminaLossBuffered(amount, updating_stamina = 1)
|
||||
if(istype(cell))
|
||||
cell.charge -= amount*5
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/mob/living/silicon/robot
|
||||
var/sprinting = FALSE
|
||||
|
||||
/mob/living/silicon/robot/Move(NewLoc, direct)
|
||||
. = ..()
|
||||
if(. && sprinting && !(movement_type & FLYING) && canmove && !resting)
|
||||
if(istype(cell))
|
||||
cell.charge -= 25
|
||||
|
||||
/mob/living/silicon/robot/movement_delay()
|
||||
. = ..()
|
||||
if(!resting && !sprinting)
|
||||
. += 1
|
||||
|
||||
/mob/living/silicon/robot/proc/togglesprint() //Basically a copypaste of the proc from /mob/living/carbon/human
|
||||
sprinting = !sprinting
|
||||
if(!resting && 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
|
||||
@@ -1,22 +1,3 @@
|
||||
/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
|
||||
@@ -30,7 +11,11 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/gun/proc/getinaccuracy(mob/living/user)
|
||||
if(!iscarbon(user) || user.aimingdownsights)
|
||||
if(!iscarbon(user))
|
||||
return 0
|
||||
else
|
||||
return weapon_weight * 25
|
||||
var/mob/living/carbon/holdingdude = user
|
||||
if(istype(holdingdude) && holdingdude.combatmode)
|
||||
return max((holdingdude.lastdirchange + weapon_weight * 25) - world.time,0)
|
||||
else
|
||||
return weapon_weight * 25
|
||||
|
||||
@@ -2772,6 +2772,7 @@
|
||||
#include "modular_citadel\code\modules\jobs\job_types\security.dm"
|
||||
#include "modular_citadel\code\modules\keybindings\bindings_carbon.dm"
|
||||
#include "modular_citadel\code\modules\keybindings\bindings_human.dm"
|
||||
#include "modular_citadel\code\modules\keybindings\bindings_robot.dm"
|
||||
#include "modular_citadel\code\modules\mentor\follow.dm"
|
||||
#include "modular_citadel\code\modules\mentor\mentor.dm"
|
||||
#include "modular_citadel\code\modules\mentor\mentor_memo.dm"
|
||||
@@ -2798,6 +2799,7 @@
|
||||
#include "modular_citadel\code\modules\mob\living\silicon\robot\dogborg_equipment.dm"
|
||||
#include "modular_citadel\code\modules\mob\living\silicon\robot\robot.dm"
|
||||
#include "modular_citadel\code\modules\mob\living\silicon\robot\robot_modules.dm"
|
||||
#include "modular_citadel\code\modules\mob\living\silicon\robot\robot_movement.dm"
|
||||
#include "modular_citadel\code\modules\mob\living\simple_animal\banana_spider.dm"
|
||||
#include "modular_citadel\code\modules\mob\living\simple_animal\kiwi.dm"
|
||||
#include "modular_citadel\code\modules\power\lighting.dm"
|
||||
|
||||
Reference in New Issue
Block a user