Skip to content

Commit

Permalink
refactor: dir_slash is every mob/living parametr (#3841)
Browse files Browse the repository at this point in the history
  • Loading branch information
ROdenFL authored Nov 9, 2023
1 parent 983240d commit fd5cc33
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
10 changes: 0 additions & 10 deletions code/_onclick/other_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,6 @@
/mob/living/carbon/alien/RestrainedClickOn(atom/A)
return

/mob/living/carbon/alien/RangedAttack(atom/A, params)
. = ..()
if(dirslash_enabled && a_intent != INTENT_HELP)
var/turf/turf_attacking = get_step(src, get_compass_dir(src, A))
if(turf_attacking)
var/mob/living/target = locate() in turf_attacking
if(target && Adjacent(target))
changeNext_move(CLICK_CD_MELEE)
return UnarmedAttack(target, TRUE)

// Babby aliens
/mob/living/carbon/alien/larva/UnarmedAttack(atom/A)
A.attack_larva(src)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/alien/alien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
var/large = FALSE
var/heat_protection = 0.5
var/leaping = FALSE
var/dirslash_enabled = TRUE
dirslash_enabled = TRUE
ventcrawler = 1
var/death_message = "lets out a waning guttural screech, green blood bubbling from its maw..."
var/death_sound = 'sound/voice/hiss6.ogg'
Expand Down
12 changes: 12 additions & 0 deletions code/modules/mob/living/living_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -394,3 +394,15 @@

/mob/living/proc/cult_self_harm(damage)
return FALSE

/mob/living/RangedAttack(atom/A, params) //Player firing
if(GLOB.pacifism_after_gt)
return
else if(dirslash_enabled && a_intent != INTENT_HELP)
var/turf/turf_attacking = get_step(src, get_compass_dir(src, A))
if(turf_attacking)
var/mob/living/target = locate() in turf_attacking
if(target && Adjacent(target))
changeNext_move(CLICK_CD_MELEE)
return UnarmedAttack(target, TRUE)
return ..()
2 changes: 2 additions & 0 deletions code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@

///if this exists AND the normal sprite is bigger than 32x32, this is the replacement icon state (because health doll size limitations). the icon will always be screen_gen.dmi
var/health_doll_icon

var/dirslash_enabled = FALSE
9 changes: 1 addition & 8 deletions code/modules/mob/living/simple_animal/hostile/hostile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

tts_seed = "Vort_e2"

var/dirslash_enabled = TRUE
dirslash_enabled = TRUE

/mob/living/simple_animal/hostile/Initialize(mapload)
. = ..()
Expand Down Expand Up @@ -557,13 +557,6 @@
target = A
OpenFire(A)
return
else if(dirslash_enabled && a_intent != INTENT_HELP)
var/turf/turf_attacking = get_step(src, get_compass_dir(src, A))
if(turf_attacking)
var/mob/living/target = locate() in turf_attacking
if(target && Adjacent(target))
changeNext_move(CLICK_CD_MELEE)
return UnarmedAttack(target, TRUE)
return ..()


Expand Down

0 comments on commit fd5cc33

Please sign in to comment.