Merge pull request #410 from MajorCooke/CloserZDisable

A_JumpIfCloser Z Check Toggle
This commit is contained in:
coelckers 2015-10-10 23:11:06 +02:00
commit ba651ebff7
2 changed files with 11 additions and 9 deletions

View file

@ -660,18 +660,20 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfTargetInsideMeleeRange)
//========================================================================== //==========================================================================
void DoJumpIfCloser(AActor *target, DECLARE_PARAMINFO) void DoJumpIfCloser(AActor *target, DECLARE_PARAMINFO)
{ {
ACTION_PARAM_START(2); ACTION_PARAM_START(3);
ACTION_PARAM_FIXED(dist, 0); ACTION_PARAM_FIXED(dist, 0);
ACTION_PARAM_STATE(jump, 1); ACTION_PARAM_STATE(jump, 1);
ACTION_PARAM_BOOL(noz, 2);
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains! ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
// No target - no jump // No target - no jump
if (target != NULL && P_AproxDistance(self->x-target->x, self->y-target->y) < dist && if (!target)
( (self->z > target->z && self->z - (target->z + target->height) < dist) || return;
(self->z <=target->z && target->z - (self->z + self->height) < dist) if (P_AproxDistance(self->x-target->x, self->y-target->y) < dist &&
) (noz ||
) ((self->z > target->z && self->z - (target->z + target->height) < dist) ||
(self->z <= target->z && target->z - (self->z + self->height) < dist))))
{ {
ACTION_JUMP(jump); ACTION_JUMP(jump);
} }

View file

@ -212,9 +212,9 @@ ACTOR Actor native //: Thinker
action native A_CustomBulletAttack(float spread_xy, float spread_z, int numbullets, int damageperbullet, class<Actor> pufftype = "BulletPuff", float range = 0, int flags = 0, int ptr = AAPTR_TARGET); action native A_CustomBulletAttack(float spread_xy, float spread_z, int numbullets, int damageperbullet, class<Actor> pufftype = "BulletPuff", float range = 0, int flags = 0, int ptr = AAPTR_TARGET);
action native A_CustomRailgun(int damage, int spawnofs_xy = 0, color color1 = "", color color2 = "", int flags = 0, bool aim = false, float maxdiff = 0, class<Actor> pufftype = "BulletPuff", float spread_xy = 0, float spread_z = 0, float range = 0, int duration = 0, float sparsity = 1.0, float driftspeed = 1.0, class<Actor> spawnclass = "none", float spawnofs_z = 0, int spiraloffset = 270); action native A_CustomRailgun(int damage, int spawnofs_xy = 0, color color1 = "", color color2 = "", int flags = 0, bool aim = false, float maxdiff = 0, class<Actor> pufftype = "BulletPuff", float spread_xy = 0, float spread_z = 0, float range = 0, int duration = 0, float sparsity = 1.0, float driftspeed = 1.0, class<Actor> spawnclass = "none", float spawnofs_z = 0, int spiraloffset = 270);
action native A_JumpIfHealthLower(int health, state label, int ptr_selector = AAPTR_DEFAULT); action native A_JumpIfHealthLower(int health, state label, int ptr_selector = AAPTR_DEFAULT);
action native A_JumpIfCloser(float distance, state label); action native A_JumpIfCloser(float distance, state label, bool noz = false);
action native A_JumpIfTracerCloser(float distance, state label); action native A_JumpIfTracerCloser(float distance, state label, bool noz = false);
action native A_JumpIfMasterCloser(float distance, state label); action native A_JumpIfMasterCloser(float distance, state label, bool noz = false);
action native A_JumpIfTargetOutsideMeleeRange(state label); action native A_JumpIfTargetOutsideMeleeRange(state label);
action native A_JumpIfTargetInsideMeleeRange(state label); action native A_JumpIfTargetInsideMeleeRange(state label);
action native A_JumpIfInventory(class<Inventory> itemtype, int itemamount, state label, int owner = AAPTR_DEFAULT); action native A_JumpIfInventory(class<Inventory> itemtype, int itemamount, state label, int owner = AAPTR_DEFAULT);