From 2cc74f4a8fae1c8db4f48a8cd442f6556f58232c Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sat, 27 May 2017 20:55:04 -0500 Subject: [PATCH] Changes incorporeal movement to use defines --- code/__DEFINES/mobs.dm | 5 +++++ code/game/gamemodes/miniantags/revenant/revenant.dm | 12 ++++++------ code/modules/clothing/suits/miscellaneous.dm | 2 +- code/modules/mob/living/living_defines.dm | 3 ++- .../living/simple_animal/guardian/types/ranged.dm | 4 ++-- code/modules/mob/living/simple_animal/parrot.dm | 2 +- code/modules/mob/mob_movement.dm | 6 +++--- 7 files changed, 20 insertions(+), 14 deletions(-) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 2d36d72ee3..e5d1f4c19e 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -124,3 +124,8 @@ #define MAX_CHICKENS 50 #define UNHEALING_EAR_DAMAGE 100 + + +#define INCORPOREAL_MOVE_BASIC 1 +#define INCORPOREAL_MOVE_SHADOW 2 // leaves a trail of shadows +#define INCORPOREAL_MOVE_JAUNT 3 // is blocked by holy water/salt \ No newline at end of file diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm index 293b114b36..da7cdee931 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant.dm @@ -15,7 +15,7 @@ var/icon_stun = "revenant_stun" var/icon_drain = "revenant_draining" var/stasis = FALSE - incorporeal_move = 3 + incorporeal_move = INCORPOREAL_MOVE_JAUNT invisibility = INVISIBILITY_REVENANT health = INFINITY //Revenants don't use health, they use essence instead maxHealth = INFINITY @@ -102,7 +102,7 @@ if(unreveal_time && world.time >= unreveal_time) unreveal_time = 0 revealed = FALSE - incorporeal_move = 3 + incorporeal_move = INCORPOREAL_MOVE_JAUNT invisibility = INVISIBILITY_REVENANT to_chat(src, "You are once more concealed.") if(unstun_time && world.time >= unstun_time) @@ -222,7 +222,7 @@ R.essence = max(reforming_essence - 15 * perfectsouls, 75) //minus any perfect souls R.client_to_revive = client //If the essence reforms, the old revenant is put back in the body R.revenant = src - invisibility = INVISIBILITY_ABSTRACT + invisibility = INVISIBILITY_ABSTRACT revealed = FALSE ghostize(0)//Don't re-enter invisible corpse return @@ -236,7 +236,7 @@ return revealed = TRUE invisibility = 0 - incorporeal_move = 0 + incorporeal_move = FALSE if(!unreveal_time) to_chat(src, "You have been revealed!") unreveal_time = world.time + time @@ -309,12 +309,12 @@ /mob/living/simple_animal/revenant/proc/death_reset() revealed = FALSE - unreveal_time = 0 + unreveal_time = 0 notransform = 0 unstun_time = 0 inhibited = FALSE draining = FALSE - incorporeal_move = 3 + incorporeal_move = INCORPOREAL_MOVE_JAUNT invisibility = INVISIBILITY_REVENANT alpha=255 stasis = FALSE diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index bc1f25cfa7..02040b4469 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -541,5 +541,5 @@ name = "spooky ghost" desc = "this is obviously just a bedsheet, but maybe try it on?" icon_state = "bedsheet" - user_vars_to_edit = list("name" = "Spooky Ghost", "real_name" = "Spooky Ghost" , "incorporeal_move" = 1, "appearance_flags" = KEEP_TOGETHER|TILE_BOUND, "alpha" = 150) + user_vars_to_edit = list("name" = "Spooky Ghost", "real_name" = "Spooky Ghost" , "incorporeal_move" = INCORPOREAL_MOVE_BASIC, "appearance_flags" = KEEP_TOGETHER|TILE_BOUND, "alpha" = 150) alternate_worn_layer = ABOVE_BODY_FRONT_LAYER //so the bedsheet goes over everything but fire diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index fbf9c35303..83cc990a52 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -24,7 +24,8 @@ var/last_special = 0 //Used by the resist verb, likely used to prevent players from bypassing next_move by logging in/out. //Allows mobs to move through dense areas without restriction. For instance, in space or out of holder objects. - var/incorporeal_move = 0 //0 is off, 1 is normal, 2 is for ninjas. + var/incorporeal_move = FALSE //FALSE is off, INCORPOREAL_MOVE_BASIC is normal, INCORPOREAL_MOVE_SHADOW is for ninjas + //and INCORPOREAL_MOVE_JAUNT is blocked by holy water/salt var/list/surgeries = list() //a list of surgery datums. generally empty, they're added when the player wants them. diff --git a/code/modules/mob/living/simple_animal/guardian/types/ranged.dm b/code/modules/mob/living/simple_animal/guardian/types/ranged.dm index 37777a5ead..e3792d40ba 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/ranged.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/ranged.dm @@ -37,7 +37,7 @@ environment_smash = initial(environment_smash) alpha = 255 range = initial(range) - incorporeal_move = 0 + incorporeal_move = FALSE to_chat(src, "You switch to combat mode.") toggle = FALSE else @@ -48,7 +48,7 @@ environment_smash = ENVIRONMENT_SMASH_NONE alpha = 45 range = 255 - incorporeal_move = 1 + incorporeal_move = INCORPOREAL_MOVE_BASIC to_chat(src, "You switch to scout mode.") toggle = TRUE else diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index e5dc99ea27..a0c1fe9fbe 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -948,7 +948,7 @@ color = "#FFFFFF77" speak_chance = 20 status_flags = GODMODE - incorporeal_move = 1 + incorporeal_move = INCORPOREAL_MOVE_BASIC butcher_results = list(/obj/item/weapon/ectoplasm = 1) /mob/living/simple_animal/parrot/Poly/ghost/Initialize() diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index e85dca9cad..43d8a924a1 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -209,10 +209,10 @@ return var/mob/living/L = mob switch(L.incorporeal_move) - if(1) + if(INCORPOREAL_MOVE_BASIC) L.loc = get_step(L, direct) L.setDir(direct) - if(2) + if(INCORPOREAL_MOVE_SHADOW) if(prob(50)) var/locx var/locy @@ -250,7 +250,7 @@ new /obj/effect/temp_visual/dir_setting/ninja/shadow(mobloc, L.dir) L.loc = get_step(L, direct) L.setDir(direct) - if(3) //Incorporeal move, but blocked by holy-watered tiles and salt piles. + if(INCORPOREAL_MOVE_JAUNT) //Incorporeal move, but blocked by holy-watered tiles and salt piles. var/turf/open/floor/stepTurf = get_step(L, direct) for(var/obj/effect/decal/cleanable/salt/S in stepTurf) to_chat(L, "[S] bars your passage!")