mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 12:32:34 +00:00
Merge branch 'MajorCooke-custommissileptr'
This commit is contained in:
commit
748973a67f
3 changed files with 20 additions and 10 deletions
|
@ -72,7 +72,8 @@ DECLARE_ACTION(A_FreezeDeathChunks)
|
|||
DECLARE_ACTION(A_BossDeath)
|
||||
|
||||
void A_Chase(AActor *self);
|
||||
void A_FaceTarget (AActor *actor, angle_t max_turn = 0, angle_t max_pitch = ANGLE_270);
|
||||
void A_FaceTarget(AActor *actor, angle_t max_turn = 0, angle_t max_pitch = ANGLE_270);
|
||||
void A_Face(AActor *self, AActor *other, angle_t max_turn = 0, angle_t max_pitch = ANGLE_270);
|
||||
|
||||
bool A_RaiseMobj (AActor *, fixed_t speed);
|
||||
bool A_SinkMobj (AActor *, fixed_t speed);
|
||||
|
|
|
@ -907,20 +907,23 @@ enum CM_Flags
|
|||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMissile)
|
||||
{
|
||||
ACTION_PARAM_START(6);
|
||||
ACTION_PARAM_START(7);
|
||||
ACTION_PARAM_CLASS(ti, 0);
|
||||
ACTION_PARAM_FIXED(SpawnHeight, 1);
|
||||
ACTION_PARAM_INT(Spawnofs_XY, 2);
|
||||
ACTION_PARAM_ANGLE(Angle, 3);
|
||||
ACTION_PARAM_INT(flags, 4);
|
||||
ACTION_PARAM_ANGLE(pitch, 5);
|
||||
ACTION_PARAM_INT(ptr, 6);
|
||||
|
||||
AActor *ref = COPY_AAPTR(self, ptr);
|
||||
|
||||
int aimmode = flags & CMF_AIMMODE;
|
||||
|
||||
AActor * targ;
|
||||
AActor * missile;
|
||||
|
||||
if (self->target != NULL || aimmode==2)
|
||||
if (ref != NULL || aimmode==2)
|
||||
{
|
||||
if (ti)
|
||||
{
|
||||
|
@ -937,14 +940,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMissile)
|
|||
self->x += x;
|
||||
self->y += y;
|
||||
self->z += z;
|
||||
missile = P_SpawnMissileXYZ(self->x, self->y, self->z + 32*FRACUNIT, self, self->target, ti, false);
|
||||
missile = P_SpawnMissileXYZ(self->x, self->y, self->z + 32*FRACUNIT, self, ref, ti, false);
|
||||
self->x -= x;
|
||||
self->y -= y;
|
||||
self->z -= z;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
missile = P_SpawnMissileXYZ(self->x+x, self->y+y, self->z + self->GetBobOffset() + SpawnHeight, self, self->target, ti, false);
|
||||
missile = P_SpawnMissileXYZ(self->x+x, self->y+y, self->z + self->GetBobOffset() + SpawnHeight, self, ref, ti, false);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
@ -1056,7 +1059,7 @@ enum CBA_Flags
|
|||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomBulletAttack)
|
||||
{
|
||||
ACTION_PARAM_START(7);
|
||||
ACTION_PARAM_START(8);
|
||||
ACTION_PARAM_ANGLE(Spread_XY, 0);
|
||||
ACTION_PARAM_ANGLE(Spread_Z, 1);
|
||||
ACTION_PARAM_INT(NumBullets, 2);
|
||||
|
@ -1064,6 +1067,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomBulletAttack)
|
|||
ACTION_PARAM_CLASS(pufftype, 4);
|
||||
ACTION_PARAM_FIXED(Range, 5);
|
||||
ACTION_PARAM_INT(Flags, 6);
|
||||
ACTION_PARAM_INT(ptr, 7);
|
||||
|
||||
AActor *ref = COPY_AAPTR(self, ptr);
|
||||
|
||||
if(Range==0) Range=MISSILERANGE;
|
||||
|
||||
|
@ -1072,9 +1078,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomBulletAttack)
|
|||
int bslope = 0;
|
||||
int laflags = (Flags & CBAF_NORANDOMPUFFZ)? LAF_NORANDOMPUFFZ : 0;
|
||||
|
||||
if (self->target || (Flags & CBAF_AIMFACING))
|
||||
if (ref || (Flags & CBAF_AIMFACING))
|
||||
{
|
||||
if (!(Flags & CBAF_AIMFACING)) A_FaceTarget (self);
|
||||
if (!(Flags & CBAF_AIMFACING))
|
||||
{
|
||||
A_Face(self, ref);
|
||||
}
|
||||
bangle = self->angle;
|
||||
|
||||
if (!pufftype) pufftype = PClass::FindClass(NAME_BulletPuff);
|
||||
|
|
|
@ -204,8 +204,8 @@ ACTOR Actor native //: Thinker
|
|||
action native A_StopSoundEx(coerce name slot);
|
||||
action native A_SeekerMissile(int threshold, int turnmax, int flags = 0, int chance = 50, int distance = 10);
|
||||
action native A_Jump(int chance = 256, state label, ...);
|
||||
action native A_CustomMissile(class<Actor> missiletype, float spawnheight = 32, int spawnofs_xy = 0, float angle = 0, int flags = 0, float pitch = 0);
|
||||
action native A_CustomBulletAttack(float spread_xy, float spread_z, int numbullets, int damageperbullet, class<Actor> pufftype = "BulletPuff", float range = 0, int flags = 0);
|
||||
action native A_CustomMissile(class<Actor> missiletype, float spawnheight = 32, int spawnofs_xy = 0, float angle = 0, int flags = 0, float pitch = 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);
|
||||
action native A_JumpIfHealthLower(int health, state label, int ptr_selector = AAPTR_DEFAULT);
|
||||
action native A_JumpIfCloser(float distance, state label);
|
||||
|
|
Loading…
Reference in a new issue