Merge pull request #11340 from Ghommie/Ghommie-cit605
Porting movespeed modifiers code updates.
This commit is contained in:
@@ -17,6 +17,9 @@
|
|||||||
//ids
|
//ids
|
||||||
|
|
||||||
#define MOVESPEED_ID_MOB_WALK_RUN_CONFIG_SPEED "MOB_WALK_RUN"
|
#define MOVESPEED_ID_MOB_WALK_RUN_CONFIG_SPEED "MOB_WALK_RUN"
|
||||||
|
#define MOVESPEED_ID_MOB_GRAB_STATE "MOB_GRAB_STATE"
|
||||||
|
#define MOVESPEED_ID_MOB_EQUIPMENT "MOB_EQUIPMENT"
|
||||||
|
#define MOVESPEED_ID_MOB_GRAVITY "MOB_GRAVITY"
|
||||||
#define MOVESPEED_ID_CONFIG_SPEEDMOD "MOB_CONFIG_MODIFIER"
|
#define MOVESPEED_ID_CONFIG_SPEEDMOD "MOB_CONFIG_MODIFIER"
|
||||||
|
|
||||||
#define MOVESPEED_ID_SLIME_REAGENTMOD "SLIME_REAGENT_MODIFIER"
|
#define MOVESPEED_ID_SLIME_REAGENTMOD "SLIME_REAGENT_MODIFIER"
|
||||||
@@ -28,6 +31,7 @@
|
|||||||
#define MOVESPEED_ID_TARANTULA_WEB "TARANTULA_WEB"
|
#define MOVESPEED_ID_TARANTULA_WEB "TARANTULA_WEB"
|
||||||
|
|
||||||
#define MOVESPEED_ID_LIVING_TURF_SPEEDMOD "LIVING_TURF_SPEEDMOD"
|
#define MOVESPEED_ID_LIVING_TURF_SPEEDMOD "LIVING_TURF_SPEEDMOD"
|
||||||
|
#define MOVESPEED_ID_LIVING_LIMBLESS "LIVING_LIMBLESS"
|
||||||
|
|
||||||
#define MOVESPEED_ID_CARBON_SOFTCRIT "CARBON_SOFTCRIT"
|
#define MOVESPEED_ID_CARBON_SOFTCRIT "CARBON_SOFTCRIT"
|
||||||
#define MOVESPEED_ID_CARBON_OLDSPEED "CARBON_DEPRECATED_SPEED"
|
#define MOVESPEED_ID_CARBON_OLDSPEED "CARBON_DEPRECATED_SPEED"
|
||||||
@@ -59,15 +63,19 @@
|
|||||||
#define MOVESPEED_ID_HUMAN_CARRYING "HUMAN_CARRY"
|
#define MOVESPEED_ID_HUMAN_CARRYING "HUMAN_CARRY"
|
||||||
#define MOVESPEED_ID_SHRINK_RAY "SHRUNKEN_SPEED_MODIFIER"
|
#define MOVESPEED_ID_SHRINK_RAY "SHRUNKEN_SPEED_MODIFIER"
|
||||||
|
|
||||||
#define MOVESPEED_ID_TASED_STATUS "TASED"
|
|
||||||
|
|
||||||
#define MOVESPEED_ID_SLAUGHTER "SLAUGHTER"
|
#define MOVESPEED_ID_SLAUGHTER "SLAUGHTER"
|
||||||
|
|
||||||
#define MOVESPEED_ID_CYBER_THRUSTER "CYBER_IMPLANT_THRUSTER"
|
#define MOVESPEED_ID_CYBER_THRUSTER "CYBER_IMPLANT_THRUSTER"
|
||||||
#define MOVESPEED_ID_JETPACK "JETPACK"
|
#define MOVESPEED_ID_JETPACK "JETPACK"
|
||||||
|
|
||||||
#define MOVESPEED_ID_SHOVE "SHOVE"
|
|
||||||
|
|
||||||
#define MOVESPEED_ID_MKULTRA "MKULTRA"
|
#define MOVESPEED_ID_MKULTRA "MKULTRA"
|
||||||
|
|
||||||
#define MOVESPEED_ID_ELECTROSTAFF "ELECTROSTAFF"
|
#define MOVESPEED_ID_TASED_STATUS "TASED"
|
||||||
|
#define MOVESPEED_ID_ELECTROSTAFF "ELECTROSTAFF"
|
||||||
|
|
||||||
|
#define MOVESPEED_ID_SHOVE "SHOVE"
|
||||||
|
#define MOVESPEED_ID_FAT "FAT"
|
||||||
|
#define MOVESPEED_ID_COLD "COLD"
|
||||||
|
#define MOVESPEED_ID_HUNGRY "HUNGRY"
|
||||||
|
#define MOVESPEED_ID_DAMAGE_SLOWDOWN "DAMAGE"
|
||||||
|
#define MOVESPEED_ID_DAMAGE_SLOWDOWN_FLYING "FLYING"
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
D.grabbedby(A, 1)
|
D.grabbedby(A, 1)
|
||||||
if(old_grab_state == GRAB_PASSIVE)
|
if(old_grab_state == GRAB_PASSIVE)
|
||||||
D.drop_all_held_items()
|
D.drop_all_held_items()
|
||||||
A.grab_state = GRAB_AGGRESSIVE //Instant agressive grab if on grab intent
|
A.setGrabState(GRAB_AGGRESSIVE) //Instant agressive grab if on grab intent
|
||||||
log_combat(A, D, "grabbed", addition="aggressively")
|
log_combat(A, D, "grabbed", addition="aggressively")
|
||||||
D.visible_message("<span class='warning'>[A] violently grabs [D]!</span>", \
|
D.visible_message("<span class='warning'>[A] violently grabs [D]!</span>", \
|
||||||
"<span class='userdanger'>[A] violently grabs you!</span>")
|
"<span class='userdanger'>[A] violently grabs you!</span>")
|
||||||
@@ -185,7 +185,7 @@
|
|||||||
D.SetSleeping(400)
|
D.SetSleeping(400)
|
||||||
restraining = FALSE
|
restraining = FALSE
|
||||||
if(A.grab_state < GRAB_NECK)
|
if(A.grab_state < GRAB_NECK)
|
||||||
A.grab_state = GRAB_NECK
|
A.setGrabState(GRAB_NECK)
|
||||||
else
|
else
|
||||||
restraining = FALSE
|
restraining = FALSE
|
||||||
return FALSE
|
return FALSE
|
||||||
|
|||||||
@@ -34,10 +34,10 @@
|
|||||||
log_combat(A, D, "grabbed", addition="aggressively")
|
log_combat(A, D, "grabbed", addition="aggressively")
|
||||||
D.visible_message("<span class='warning'>[A] violently grabs [D]!</span>", \
|
D.visible_message("<span class='warning'>[A] violently grabs [D]!</span>", \
|
||||||
"<span class='userdanger'>[A] violently grabs you!</span>")
|
"<span class='userdanger'>[A] violently grabs you!</span>")
|
||||||
A.grab_state = GRAB_AGGRESSIVE //Instant aggressive grab
|
A.setGrabState(GRAB_AGGRESSIVE) //Instant aggressive grab
|
||||||
else
|
else
|
||||||
log_combat(A, D, "grabbed", addition="passively")
|
log_combat(A, D, "grabbed", addition="passively")
|
||||||
A.grab_state = GRAB_PASSIVE
|
A.setGrabState(GRAB_PASSIVE)
|
||||||
if(4)
|
if(4)
|
||||||
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
|
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
|
||||||
atk_verb = "headbutts"
|
atk_verb = "headbutts"
|
||||||
|
|||||||
@@ -115,7 +115,7 @@
|
|||||||
D.grabbedby(A, 1)
|
D.grabbedby(A, 1)
|
||||||
if(old_grab_state == GRAB_PASSIVE)
|
if(old_grab_state == GRAB_PASSIVE)
|
||||||
D.drop_all_held_items()
|
D.drop_all_held_items()
|
||||||
A.grab_state = GRAB_AGGRESSIVE //Instant agressive grab if on grab intent
|
A.setGrabState(GRAB_AGGRESSIVE) //Instant agressive grab if on grab intent
|
||||||
log_combat(A, D, "grabbed", addition="aggressively")
|
log_combat(A, D, "grabbed", addition="aggressively")
|
||||||
D.visible_message("<span class='warning'>[A] violently grabs [D]!</span>", \
|
D.visible_message("<span class='warning'>[A] violently grabs [D]!</span>", \
|
||||||
"<span class='userdanger'>[A] violently grabs you!</span>")
|
"<span class='userdanger'>[A] violently grabs you!</span>")
|
||||||
|
|||||||
@@ -514,39 +514,6 @@ GLOBAL_LIST_EMPTY(teleportlocs)
|
|||||||
/client/proc/ResetAmbiencePlayed()
|
/client/proc/ResetAmbiencePlayed()
|
||||||
played = FALSE
|
played = FALSE
|
||||||
|
|
||||||
/atom/proc/has_gravity(turf/T)
|
|
||||||
if(!T || !isturf(T))
|
|
||||||
T = get_turf(src)
|
|
||||||
|
|
||||||
if(!T)
|
|
||||||
return 0
|
|
||||||
|
|
||||||
var/list/forced_gravity = list()
|
|
||||||
SEND_SIGNAL(src, COMSIG_ATOM_HAS_GRAVITY, T, forced_gravity)
|
|
||||||
if(!forced_gravity.len)
|
|
||||||
SEND_SIGNAL(T, COMSIG_TURF_HAS_GRAVITY, src, forced_gravity)
|
|
||||||
if(forced_gravity.len)
|
|
||||||
var/max_grav
|
|
||||||
for(var/i in forced_gravity)
|
|
||||||
max_grav = max(max_grav, i)
|
|
||||||
if(max_grav)
|
|
||||||
return max_grav
|
|
||||||
|
|
||||||
if(isspaceturf(T)) // Turf never has gravity
|
|
||||||
return 0
|
|
||||||
|
|
||||||
var/area/A = get_area(T)
|
|
||||||
if(A.has_gravity) // Areas which always has gravity
|
|
||||||
return A.has_gravity
|
|
||||||
else
|
|
||||||
// There's a gravity generator on our z level
|
|
||||||
if(GLOB.gravity_generators["[T.z]"])
|
|
||||||
var/max_grav = 0
|
|
||||||
for(var/obj/machinery/gravity_generator/main/G in GLOB.gravity_generators["[T.z]"])
|
|
||||||
max_grav = max(G.setting,max_grav)
|
|
||||||
return max_grav
|
|
||||||
return SSmapping.level_trait(T.z, ZTRAIT_GRAVITY)
|
|
||||||
|
|
||||||
/area/proc/setup(a_name)
|
/area/proc/setup(a_name)
|
||||||
name = a_name
|
name = a_name
|
||||||
power_equip = FALSE
|
power_equip = FALSE
|
||||||
|
|||||||
@@ -918,3 +918,49 @@ Proc for attack log creation, because really why not
|
|||||||
if(!(material_flags & MATERIAL_NO_EFFECTS))
|
if(!(material_flags & MATERIAL_NO_EFFECTS))
|
||||||
custom_material.on_applied(src, materials[custom_material] * multiplier * material_modifier, material_flags)
|
custom_material.on_applied(src, materials[custom_material] * multiplier * material_modifier, material_flags)
|
||||||
custom_materials[custom_material] += materials[x] * multiplier
|
custom_materials[custom_material] += materials[x] * multiplier
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this atom has gravity for the passed in turf
|
||||||
|
*
|
||||||
|
* Sends signals COMSIG_ATOM_HAS_GRAVITY and COMSIG_TURF_HAS_GRAVITY, both can force gravity with
|
||||||
|
* the forced gravity var
|
||||||
|
*
|
||||||
|
* Gravity situations:
|
||||||
|
* * No gravity if you're not in a turf
|
||||||
|
* * No gravity if this atom is in is a space turf
|
||||||
|
* * Gravity if the area it's in always has gravity
|
||||||
|
* * Gravity if there's a gravity generator on the z level
|
||||||
|
* * Gravity if the Z level has an SSMappingTrait for ZTRAIT_GRAVITY
|
||||||
|
* * otherwise no gravity
|
||||||
|
*/
|
||||||
|
/atom/proc/has_gravity(turf/T)
|
||||||
|
if(!T || !isturf(T))
|
||||||
|
T = get_turf(src)
|
||||||
|
|
||||||
|
if(!T)
|
||||||
|
return 0
|
||||||
|
|
||||||
|
var/list/forced_gravity = list()
|
||||||
|
SEND_SIGNAL(src, COMSIG_ATOM_HAS_GRAVITY, T, forced_gravity)
|
||||||
|
if(!forced_gravity.len)
|
||||||
|
SEND_SIGNAL(T, COMSIG_TURF_HAS_GRAVITY, src, forced_gravity)
|
||||||
|
if(forced_gravity.len)
|
||||||
|
var/max_grav
|
||||||
|
for(var/i in forced_gravity)
|
||||||
|
max_grav = max(max_grav, i)
|
||||||
|
return max_grav
|
||||||
|
|
||||||
|
if(isspaceturf(T)) // Turf never has gravity
|
||||||
|
return 0
|
||||||
|
|
||||||
|
var/area/A = get_area(T)
|
||||||
|
if(A.has_gravity) // Areas which always has gravity
|
||||||
|
return A.has_gravity
|
||||||
|
else
|
||||||
|
// There's a gravity generator on our z level
|
||||||
|
if(GLOB.gravity_generators["[T.z]"])
|
||||||
|
var/max_grav = 0
|
||||||
|
for(var/obj/machinery/gravity_generator/main/G in GLOB.gravity_generators["[T.z]"])
|
||||||
|
max_grav = max(G.setting,max_grav)
|
||||||
|
return max_grav
|
||||||
|
return SSmapping.level_trait(T.z, ZTRAIT_GRAVITY)
|
||||||
|
|||||||
@@ -131,7 +131,7 @@
|
|||||||
return FALSE
|
return FALSE
|
||||||
// Are we trying to pull something we are already pulling? Then enter grab cycle and end.
|
// Are we trying to pull something we are already pulling? Then enter grab cycle and end.
|
||||||
if(AM == pulling)
|
if(AM == pulling)
|
||||||
grab_state = state
|
setGrabState(state)
|
||||||
if(istype(AM,/mob/living))
|
if(istype(AM,/mob/living))
|
||||||
var/mob/living/AMob = AM
|
var/mob/living/AMob = AM
|
||||||
AMob.grabbedby(src)
|
AMob.grabbedby(src)
|
||||||
@@ -142,7 +142,7 @@
|
|||||||
AM.pulledby.stop_pulling() //an object can't be pulled by two mobs at once.
|
AM.pulledby.stop_pulling() //an object can't be pulled by two mobs at once.
|
||||||
pulling = AM
|
pulling = AM
|
||||||
AM.pulledby = src
|
AM.pulledby = src
|
||||||
grab_state = state
|
setGrabState(state)
|
||||||
if(ismob(AM))
|
if(ismob(AM))
|
||||||
var/mob/M = AM
|
var/mob/M = AM
|
||||||
log_combat(src, M, "grabbed", addition="passive grab")
|
log_combat(src, M, "grabbed", addition="passive grab")
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
pulling.pulledby = null
|
pulling.pulledby = null
|
||||||
var/mob/living/ex_pulled = pulling
|
var/mob/living/ex_pulled = pulling
|
||||||
pulling = null
|
pulling = null
|
||||||
grab_state = 0
|
setGrabState(0)
|
||||||
if(isliving(ex_pulled))
|
if(isliving(ex_pulled))
|
||||||
var/mob/living/L = ex_pulled
|
var/mob/living/L = ex_pulled
|
||||||
L.update_mobility()// mob gets up if it was lyng down in a chokehold
|
L.update_mobility()// mob gets up if it was lyng down in a chokehold
|
||||||
@@ -563,6 +563,11 @@
|
|||||||
return FALSE
|
return FALSE
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
|
/// Updates the grab state of the movable
|
||||||
|
/// This exists to act as a hook for behaviour
|
||||||
|
/atom/movable/proc/setGrabState(newstate)
|
||||||
|
grab_state = newstate
|
||||||
|
|
||||||
/obj/item/proc/do_pickup_animation(atom/target)
|
/obj/item/proc/do_pickup_animation(atom/target)
|
||||||
set waitfor = FALSE
|
set waitfor = FALSE
|
||||||
if(!istype(loc, /turf))
|
if(!istype(loc, /turf))
|
||||||
|
|||||||
@@ -377,6 +377,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
|
|||||||
qdel(src)
|
qdel(src)
|
||||||
item_flags &= ~IN_INVENTORY
|
item_flags &= ~IN_INVENTORY
|
||||||
SEND_SIGNAL(src, COMSIG_ITEM_DROPPED,user)
|
SEND_SIGNAL(src, COMSIG_ITEM_DROPPED,user)
|
||||||
|
user.update_equipment_speed_mods()
|
||||||
|
|
||||||
// called just as an item is picked up (loc is not yet changed)
|
// called just as an item is picked up (loc is not yet changed)
|
||||||
/obj/item/proc/pickup(mob/user)
|
/obj/item/proc/pickup(mob/user)
|
||||||
@@ -422,6 +423,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
|
|||||||
if(item_action_slot_check(slot, user, A)) //some items only give their actions buttons when in a specific slot.
|
if(item_action_slot_check(slot, user, A)) //some items only give their actions buttons when in a specific slot.
|
||||||
A.Grant(user)
|
A.Grant(user)
|
||||||
item_flags |= IN_INVENTORY
|
item_flags |= IN_INVENTORY
|
||||||
|
user.update_equipment_speed_mods()
|
||||||
|
|
||||||
//sometimes we only want to grant the item's action if it's equipped in a specific slot.
|
//sometimes we only want to grant the item's action if it's equipped in a specific slot.
|
||||||
/obj/item/proc/item_action_slot_check(slot, mob/user, datum/action/A)
|
/obj/item/proc/item_action_slot_check(slot, mob/user, datum/action/A)
|
||||||
|
|||||||
@@ -1,15 +1,3 @@
|
|||||||
/mob/living/carbon/movement_delay()
|
|
||||||
. = ..()
|
|
||||||
. += grab_state * 3 //can't go fast while grabbing something.
|
|
||||||
|
|
||||||
if(!get_leg_ignore()) //ignore the fact we lack legs
|
|
||||||
var/leg_amount = get_num_legs()
|
|
||||||
. += 6 - 3*leg_amount //the fewer the legs, the slower the mob
|
|
||||||
if(!leg_amount)
|
|
||||||
. += 6 - 3*get_num_arms() //crawling is harder with fewer arms
|
|
||||||
if(legcuffed)
|
|
||||||
. += legcuffed.slowdown
|
|
||||||
|
|
||||||
/mob/living/carbon/slip(knockdown_amount, obj/O, lube)
|
/mob/living/carbon/slip(knockdown_amount, obj/O, lube)
|
||||||
if(movement_type & FLYING && !(lube & FLYING_DOESNT_HELP))
|
if(movement_type & FLYING && !(lube & FLYING_DOESNT_HELP))
|
||||||
return FALSE
|
return FALSE
|
||||||
|
|||||||
@@ -948,6 +948,22 @@
|
|||||||
if(is_type_in_typecache(active_item, GLOB.shove_disarming_types))
|
if(is_type_in_typecache(active_item, GLOB.shove_disarming_types))
|
||||||
visible_message("<span class='warning'>[src.name] regains their grip on \the [active_item]!</span>", "<span class='warning'>You regain your grip on \the [active_item]</span>", null, COMBAT_MESSAGE_RANGE)
|
visible_message("<span class='warning'>[src.name] regains their grip on \the [active_item]!</span>", "<span class='warning'>You regain your grip on \the [active_item]</span>", null, COMBAT_MESSAGE_RANGE)
|
||||||
|
|
||||||
|
/mob/living/carbon/human/updatehealth()
|
||||||
|
. = ..()
|
||||||
|
|
||||||
|
if(HAS_TRAIT(src, TRAIT_IGNORESLOWDOWN))
|
||||||
|
remove_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN)
|
||||||
|
remove_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN_FLYING)
|
||||||
|
return
|
||||||
|
var/stambufferinfluence = (bufferedstam*(100/stambuffer))*0.2 //CIT CHANGE - makes stamina buffer influence movedelay
|
||||||
|
var/health_deficiency = ((100 + stambufferinfluence) - health + (getStaminaLoss()*0.75))//CIT CHANGE - reduces the impact of staminaloss and makes stamina buffer influence it
|
||||||
|
if(health_deficiency >= 40)
|
||||||
|
add_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN, override = TRUE, multiplicative_slowdown = ((health_deficiency-39) / 75), blacklisted_movetypes = FLOATING|FLYING)
|
||||||
|
add_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN_FLYING, override = TRUE, multiplicative_slowdown = ((health_deficiency-39) / 25), movetypes = FLOATING)
|
||||||
|
else
|
||||||
|
remove_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN)
|
||||||
|
remove_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN_FLYING)
|
||||||
|
|
||||||
/mob/living/carbon/human/do_after_coefficent()
|
/mob/living/carbon/human/do_after_coefficent()
|
||||||
. = ..()
|
. = ..()
|
||||||
. *= physiology.do_after_speed
|
. *= physiology.do_after_speed
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
/mob/living/carbon/human/movement_delay()
|
/mob/living/carbon/human/movement_delay()
|
||||||
. = ..()
|
. = ..()
|
||||||
if(dna && dna.species)
|
if (m_intent == MOVE_INTENT_WALK && HAS_TRAIT(src, TRAIT_SPEEDY_STEP))
|
||||||
. += dna.species.movement_delay(src)
|
. -= 1.5
|
||||||
|
|
||||||
/mob/living/carbon/human/slip(knockdown_amount, obj/O, lube)
|
/mob/living/carbon/human/slip(knockdown_amount, obj/O, lube)
|
||||||
if(HAS_TRAIT(src, TRAIT_NOSLIPALL))
|
if(HAS_TRAIT(src, TRAIT_NOSLIPALL))
|
||||||
|
|||||||
@@ -145,6 +145,12 @@
|
|||||||
|
|
||||||
return not_handled //For future deeper overrides
|
return not_handled //For future deeper overrides
|
||||||
|
|
||||||
|
/mob/living/carbon/human/equipped_speed_mods()
|
||||||
|
. = ..()
|
||||||
|
for(var/sloties in get_all_slots())
|
||||||
|
var/obj/item/thing = sloties
|
||||||
|
. += thing?.slowdown
|
||||||
|
|
||||||
/mob/living/carbon/human/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE)
|
/mob/living/carbon/human/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE)
|
||||||
var/index = get_held_index_of_item(I)
|
var/index = get_held_index_of_item(I)
|
||||||
. = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should.
|
. = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should.
|
||||||
|
|||||||
@@ -1296,12 +1296,14 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
|||||||
if(H.overeatduration < 100)
|
if(H.overeatduration < 100)
|
||||||
to_chat(H, "<span class='notice'>You feel fit again!</span>")
|
to_chat(H, "<span class='notice'>You feel fit again!</span>")
|
||||||
REMOVE_TRAIT(H, TRAIT_FAT, OBESITY)
|
REMOVE_TRAIT(H, TRAIT_FAT, OBESITY)
|
||||||
|
H.remove_movespeed_modifier(MOVESPEED_ID_FAT)
|
||||||
H.update_inv_w_uniform()
|
H.update_inv_w_uniform()
|
||||||
H.update_inv_wear_suit()
|
H.update_inv_wear_suit()
|
||||||
else
|
else
|
||||||
if(H.overeatduration >= 100)
|
if(H.overeatduration >= 100)
|
||||||
to_chat(H, "<span class='danger'>You suddenly feel blubbery!</span>")
|
to_chat(H, "<span class='danger'>You suddenly feel blubbery!</span>")
|
||||||
ADD_TRAIT(H, TRAIT_FAT, OBESITY)
|
ADD_TRAIT(H, TRAIT_FAT, OBESITY)
|
||||||
|
H.add_movespeed_modifier(MOVESPEED_ID_FAT, multiplicative_slowdown = 1.5)
|
||||||
H.update_inv_w_uniform()
|
H.update_inv_w_uniform()
|
||||||
H.update_inv_wear_suit()
|
H.update_inv_wear_suit()
|
||||||
|
|
||||||
@@ -1352,6 +1354,15 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
|||||||
to_chat(H, "<span class='notice'>You no longer feel vigorous.</span>")
|
to_chat(H, "<span class='notice'>You no longer feel vigorous.</span>")
|
||||||
H.metabolism_efficiency = 1
|
H.metabolism_efficiency = 1
|
||||||
|
|
||||||
|
//Hunger slowdown for if mood isn't enabled
|
||||||
|
if(CONFIG_GET(flag/disable_human_mood))
|
||||||
|
if(!HAS_TRAIT(H, TRAIT_NOHUNGER))
|
||||||
|
var/hungry = (500 - H.nutrition) / 5 //So overeat would be 100 and default level would be 80
|
||||||
|
if(hungry >= 70)
|
||||||
|
H.add_movespeed_modifier(MOVESPEED_ID_HUNGRY, override = TRUE, multiplicative_slowdown = (hungry / 50))
|
||||||
|
else
|
||||||
|
H.remove_movespeed_modifier(MOVESPEED_ID_HUNGRY)
|
||||||
|
|
||||||
switch(H.nutrition)
|
switch(H.nutrition)
|
||||||
if(NUTRITION_LEVEL_FULL to INFINITY)
|
if(NUTRITION_LEVEL_FULL to INFINITY)
|
||||||
H.throw_alert("nutrition", /obj/screen/alert/fat)
|
H.throw_alert("nutrition", /obj/screen/alert/fat)
|
||||||
@@ -1401,59 +1412,6 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
|||||||
H.hair_style = "Bald"
|
H.hair_style = "Bald"
|
||||||
H.update_hair()
|
H.update_hair()
|
||||||
|
|
||||||
////////////////
|
|
||||||
// MOVE SPEED //
|
|
||||||
////////////////
|
|
||||||
|
|
||||||
/datum/species/proc/movement_delay(mob/living/carbon/human/H)
|
|
||||||
. = 0 //We start at 0.
|
|
||||||
var/flight = 0 //Check for flight and flying items
|
|
||||||
var/gravity = 0
|
|
||||||
if(H.movement_type & FLYING)
|
|
||||||
flight = 1
|
|
||||||
|
|
||||||
gravity = H.has_gravity()
|
|
||||||
|
|
||||||
if (H.m_intent == MOVE_INTENT_WALK && HAS_TRAIT(H, TRAIT_SPEEDY_STEP))
|
|
||||||
. -= 1.5
|
|
||||||
|
|
||||||
if(!HAS_TRAIT(H, TRAIT_IGNORESLOWDOWN) && gravity)
|
|
||||||
if(H.wear_suit)
|
|
||||||
. += H.wear_suit.slowdown
|
|
||||||
if(H.shoes)
|
|
||||||
. += H.shoes.slowdown
|
|
||||||
if(H.back)
|
|
||||||
. += H.back.slowdown
|
|
||||||
for(var/obj/item/I in H.held_items)
|
|
||||||
if(I.item_flags & SLOWS_WHILE_IN_HAND)
|
|
||||||
. += I.slowdown
|
|
||||||
var/stambufferinfluence = (H.bufferedstam*(100/H.stambuffer))*0.2 //CIT CHANGE - makes stamina buffer influence movedelay
|
|
||||||
var/health_deficiency = ((100 + stambufferinfluence) - H.health + (H.getStaminaLoss()*0.75))//CIT CHANGE - reduces the impact of staminaloss on movement speed and makes stamina buffer influence movedelay
|
|
||||||
if(health_deficiency >= 40)
|
|
||||||
if(flight)
|
|
||||||
. += ((health_deficiency-39) / 75) // CIT CHANGE - adds -39 to health deficiency penalty to make the transition to low health movement a little less jarring
|
|
||||||
else
|
|
||||||
. += ((health_deficiency-39) / 25) // CIT CHANGE - ditto
|
|
||||||
if(CONFIG_GET(flag/disable_human_mood))
|
|
||||||
var/hungry = (500 - H.nutrition) / 5 //So overeat would be 100 and default level would be 80
|
|
||||||
if((hungry >= 70) && !flight) //Being hungry will still allow you to use a flightsuit/wings.
|
|
||||||
. += hungry / 50
|
|
||||||
|
|
||||||
//Moving in high gravity is very slow (Flying too)
|
|
||||||
if(gravity > STANDARD_GRAVITY)
|
|
||||||
var/grav_force = min(gravity - STANDARD_GRAVITY,3)
|
|
||||||
. += 1 + grav_force
|
|
||||||
|
|
||||||
if(HAS_TRAIT(H, TRAIT_FAT))
|
|
||||||
. += (1.5 - flight)
|
|
||||||
if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !HAS_TRAIT(H, TRAIT_RESISTCOLD))
|
|
||||||
. += (BODYTEMP_COLD_DAMAGE_LIMIT - H.bodytemperature) / COLD_SLOWDOWN_FACTOR
|
|
||||||
return .
|
|
||||||
|
|
||||||
//////////////////
|
|
||||||
// ATTACK PROCS //
|
|
||||||
//////////////////
|
|
||||||
|
|
||||||
//////////////////
|
//////////////////
|
||||||
// ATTACK PROCS //
|
// ATTACK PROCS //
|
||||||
//////////////////
|
//////////////////
|
||||||
@@ -2070,6 +2028,8 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
|||||||
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "cold")
|
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "cold")
|
||||||
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "hot", /datum/mood_event/hot)
|
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "hot", /datum/mood_event/hot)
|
||||||
|
|
||||||
|
H.remove_movespeed_modifier(MOVESPEED_ID_COLD)
|
||||||
|
|
||||||
var/burn_damage
|
var/burn_damage
|
||||||
var/firemodifier = H.fire_stacks / 50
|
var/firemodifier = H.fire_stacks / 50
|
||||||
if (H.on_fire)
|
if (H.on_fire)
|
||||||
@@ -2085,6 +2045,8 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
|||||||
else if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !HAS_TRAIT(H, TRAIT_RESISTCOLD))
|
else if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !HAS_TRAIT(H, TRAIT_RESISTCOLD))
|
||||||
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "hot")
|
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "hot")
|
||||||
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "cold", /datum/mood_event/cold)
|
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "cold", /datum/mood_event/cold)
|
||||||
|
//Sorry for the nasty oneline but I don't want to assign a variable on something run pretty frequently
|
||||||
|
H.add_movespeed_modifier(MOVESPEED_ID_COLD, override = TRUE, multiplicative_slowdown = ((BODYTEMP_COLD_DAMAGE_LIMIT - H.bodytemperature) / COLD_SLOWDOWN_FACTOR))
|
||||||
switch(H.bodytemperature)
|
switch(H.bodytemperature)
|
||||||
if(200 to BODYTEMP_COLD_DAMAGE_LIMIT)
|
if(200 to BODYTEMP_COLD_DAMAGE_LIMIT)
|
||||||
H.apply_damage(COLD_DAMAGE_LEVEL_1*coldmod*H.physiology.cold_mod, BURN)
|
H.apply_damage(COLD_DAMAGE_LEVEL_1*coldmod*H.physiology.cold_mod, BURN)
|
||||||
@@ -2094,6 +2056,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
|||||||
H.apply_damage(COLD_DAMAGE_LEVEL_3*coldmod*H.physiology.cold_mod, BURN)
|
H.apply_damage(COLD_DAMAGE_LEVEL_3*coldmod*H.physiology.cold_mod, BURN)
|
||||||
|
|
||||||
else
|
else
|
||||||
|
H.remove_movespeed_modifier(MOVESPEED_ID_COLD)
|
||||||
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "cold")
|
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "cold")
|
||||||
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "hot")
|
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "hot")
|
||||||
|
|
||||||
|
|||||||
@@ -727,6 +727,7 @@
|
|||||||
return name
|
return name
|
||||||
|
|
||||||
/mob/living/update_gravity(has_gravity,override = 0)
|
/mob/living/update_gravity(has_gravity,override = 0)
|
||||||
|
. = ..()
|
||||||
if(!SSticker.HasRoundStarted())
|
if(!SSticker.HasRoundStarted())
|
||||||
return
|
return
|
||||||
if(has_gravity)
|
if(has_gravity)
|
||||||
|
|||||||
@@ -250,7 +250,7 @@
|
|||||||
return 0
|
return 0
|
||||||
if(user.voremode && user.grab_state == GRAB_AGGRESSIVE)
|
if(user.voremode && user.grab_state == GRAB_AGGRESSIVE)
|
||||||
return 0
|
return 0
|
||||||
user.grab_state++
|
user.setGrabState(user.grab_state + 1)
|
||||||
switch(user.grab_state)
|
switch(user.grab_state)
|
||||||
if(GRAB_AGGRESSIVE)
|
if(GRAB_AGGRESSIVE)
|
||||||
var/add_log = ""
|
var/add_log = ""
|
||||||
|
|||||||
@@ -152,4 +152,17 @@
|
|||||||
if(CHECK_MOBILITY(src, MOBILITY_MOVE) && !intentionalresting && canstand_involuntary && iscarbon(src) && client?.prefs?.autostand)//CIT CHANGE - adds autostanding as a preference
|
if(CHECK_MOBILITY(src, MOBILITY_MOVE) && !intentionalresting && canstand_involuntary && iscarbon(src) && client?.prefs?.autostand)//CIT CHANGE - adds autostanding as a preference
|
||||||
addtimer(CALLBACK(src, .proc/resist_a_rest, TRUE), 0) //CIT CHANGE - ditto
|
addtimer(CALLBACK(src, .proc/resist_a_rest, TRUE), 0) //CIT CHANGE - ditto
|
||||||
|
|
||||||
|
// Movespeed mods based on arms/legs quantity
|
||||||
|
if(!get_leg_ignore())
|
||||||
|
var/limbless_slowdown = 0
|
||||||
|
// These checks for <2 should be swapped out for something else if we ever end up with a species with more than 2
|
||||||
|
if(has_legs < 2)
|
||||||
|
limbless_slowdown += 6 - (has_legs * 3)
|
||||||
|
if(!has_legs && has_arms < 2)
|
||||||
|
limbless_slowdown += 6 - (has_arms * 3)
|
||||||
|
if(limbless_slowdown)
|
||||||
|
add_movespeed_modifier(MOVESPEED_ID_LIVING_LIMBLESS, update=TRUE, priority=100, override=TRUE, multiplicative_slowdown=limbless_slowdown, movetypes=GROUND)
|
||||||
|
else
|
||||||
|
remove_movespeed_modifier(MOVESPEED_ID_LIVING_LIMBLESS, update=TRUE)
|
||||||
|
|
||||||
return mobility_flags
|
return mobility_flags
|
||||||
|
|||||||
@@ -952,3 +952,25 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
|
|||||||
/mob/setMovetype(newval)
|
/mob/setMovetype(newval)
|
||||||
. = ..()
|
. = ..()
|
||||||
update_movespeed(FALSE)
|
update_movespeed(FALSE)
|
||||||
|
|
||||||
|
/// Updates the grab state of the mob and updates movespeed
|
||||||
|
/mob/setGrabState(newstate)
|
||||||
|
. = ..()
|
||||||
|
if(grab_state == GRAB_PASSIVE)
|
||||||
|
remove_movespeed_modifier(MOVESPEED_ID_MOB_GRAB_STATE, update=TRUE)
|
||||||
|
else
|
||||||
|
add_movespeed_modifier(MOVESPEED_ID_MOB_GRAB_STATE, update=TRUE, priority=100, override=TRUE, multiplicative_slowdown=grab_state*3, blacklisted_movetypes=FLOATING)
|
||||||
|
|
||||||
|
/mob/proc/update_equipment_speed_mods()
|
||||||
|
var/speedies = equipped_speed_mods()
|
||||||
|
if(!speedies)
|
||||||
|
remove_movespeed_modifier(MOVESPEED_ID_MOB_EQUIPMENT, update=TRUE)
|
||||||
|
else
|
||||||
|
add_movespeed_modifier(MOVESPEED_ID_MOB_EQUIPMENT, update=TRUE, priority=100, override=TRUE, multiplicative_slowdown=speedies, blacklisted_movetypes=FLOATING)
|
||||||
|
|
||||||
|
/// Gets the combined speed modification of all worn items
|
||||||
|
/// Except base mob type doesnt really wear items
|
||||||
|
/mob/proc/equipped_speed_mods()
|
||||||
|
for(var/obj/item/I in held_items)
|
||||||
|
if(I.item_flags & SLOWS_WHILE_IN_HAND)
|
||||||
|
. += I.slowdown
|
||||||
@@ -249,8 +249,12 @@
|
|||||||
/mob/proc/slip(s_amount, w_amount, obj/O, lube)
|
/mob/proc/slip(s_amount, w_amount, obj/O, lube)
|
||||||
return
|
return
|
||||||
|
|
||||||
/mob/proc/update_gravity()
|
/mob/proc/update_gravity(has_gravity, override=FALSE)
|
||||||
return
|
var/speed_change = max(0, has_gravity - STANDARD_GRAVITY)
|
||||||
|
if(!speed_change)
|
||||||
|
remove_movespeed_modifier(MOVESPEED_ID_MOB_GRAVITY, update=TRUE)
|
||||||
|
else
|
||||||
|
add_movespeed_modifier(MOVESPEED_ID_MOB_GRAVITY, update=TRUE, priority=100, override=TRUE, multiplicative_slowdown=speed_change, blacklisted_movetypes=FLOATING)
|
||||||
|
|
||||||
//bodypart selection - Cyberboss
|
//bodypart selection - Cyberboss
|
||||||
//8 toggles through head - eyes - mouth
|
//8 toggles through head - eyes - mouth
|
||||||
|
|||||||
Reference in New Issue
Block a user