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

Movement fixes and adjustments. #47

Merged
merged 6 commits into from
Jul 29, 2024
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: 1 addition & 1 deletion code/datums/components/bump_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
if(TIMER_COOLDOWN_CHECK(src, COOLDOWN_BUMP_ATTACK))
return NONE
var/mob/living/bumper = parent
if(!(target.flags_atom & BUMP_ATTACKABLE) || bumper.throwing || bumper.incapacitated() || HAS_TRAIT(target, TRAIT_TURRET_HIDDEN)) //RU TGMC EDIT
if(!(target.flags_atom & BUMP_ATTACKABLE) || bumper.throwing || bumper.incapacitated() || HAS_TRAIT(target, TRAIT_TURRET_HIDDEN))
return NONE

///Handles carbon bump action checks before actually doing the attack checks.
Expand Down
25 changes: 14 additions & 11 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -359,17 +359,18 @@

if(!L.buckled && !L.anchored)
var/mob_swap_mode = NO_SWAP
//the puller can always swap with its victim if on grab intent
// the puller can always swap with its victim if on grab intent
if(L.pulledby == src && a_intent == INTENT_GRAB)
mob_swap_mode = SWAPPING
//restrained people act if they were on 'help' intent to prevent a person being pulled from being seperated from their puller
else if((L.restrained() || L.a_intent == INTENT_HELP) && (restrained() || a_intent == INTENT_HELP) && L.move_force < MOVE_FORCE_VERY_STRONG)
mob_swap_mode = SWAPPING
else if(get_xeno_hivenumber() == L.get_xeno_hivenumber() && (L.pass_flags & PASS_XENO || pass_flags & PASS_XENO))
mob_swap_mode = PHASING
else if((move_resist >= MOVE_FORCE_VERY_STRONG || move_resist > L.move_force) && a_intent == INTENT_HELP) //Larger mobs can shove aside smaller ones. Xenos can always shove xenos
mob_swap_mode = SWAPPING
///if we're moving diagonally, but the mob isn't on the diagonal destination turf we have no reason to shuffle/push them
// Restrained people act if they were on 'help' intent to prevent a person being pulled from being seperated from their puller
else if(a_intent == INTENT_HELP || restrained())
// xenos swap with xenos and almost whoever they want
if(isxeno(src) && (isxeno(L) || move_force > L.move_resist))
mob_swap_mode = SWAPPING
// if target isn't xeno and both are on help intents, but we don't want xenos to move petrified humans ,then we swap
else if(!isxeno(L) && move_force > L.move_resist && (L.a_intent == INTENT_HELP || L.restrained()))
mob_swap_mode = SWAPPING
/// if we're moving diagonally, but the mob isn't on the diagonal destination turf we have no reason to shuffle/push them
if(moving_diagonally && (get_dir(src, L) in GLOB.cardinals) && get_step(src, dir).Enter(src, loc))
mob_swap_mode = PHASING
if(mob_swap_mode)
Expand Down Expand Up @@ -407,14 +408,16 @@

if(ismovableatom(A))
if(isxeno(src) && ishuman(A))
var/datum/action/bump_attack_toggle/bump_action = actions_by_path[/datum/action/bump_attack_toggle] // there should be a better way to do this
if(a_intent != INTENT_DISARM && !bump_action.attacking)
return
var/mob/living/carbon/human/H = A
if(!COOLDOWN_CHECK(H, xeno_push_delay))
if(!COOLDOWN_CHECK(H, xeno_push_delay))
return
COOLDOWN_START(H, xeno_push_delay, XENO_HUMAN_PUSHED_DELAY)
if(PushAM(A))
return TURF_ENTER_ALREADY_MOVED


//Called when we want to push an atom/movable
/mob/living/proc/PushAM(atom/movable/AM, force = move_force)
if(AM.anchored)
Expand Down
5 changes: 2 additions & 3 deletions code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@
var/disabilities = NONE

var/restrained_flags = NONE

var/now_pushing

/// Will we bump into stuff right now?
var/now_pushing = FALSE

var/cameraFollow

Expand Down
10 changes: 6 additions & 4 deletions code/modules/mob/living/silicon/ai/ai_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,14 @@
if(stat == DEAD)
return

src.anchored = !anchored
anchored = !anchored
if(!anchored)
move_resist = MOVE_RESIST_DEFAULT
else
move_resist = initial(move_resist)
playsound(loc,'sound/mecha/mechanical_toggle.ogg', 20)


to_chat(src, "<b>You are now [anchored ? "" : "un"]anchored.</b>")

to_chat(src, span_notice("<b>You are now [anchored ? "" : "un"]anchored.</b>"))

/mob/living/silicon/ai/verb/show_laws()
set category = "Silicon"
Expand Down
Loading