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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user