mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 15:22:16 +00:00
- 4 more Hexen files processed.
This commit is contained in:
parent
61b66904da
commit
c8052ce1b8
4 changed files with 40 additions and 39 deletions
|
@ -60,14 +60,14 @@ static void DragonSeek (AActor *actor, angle_t thresh, angle_t turnMax)
|
||||||
actor->velx = FixedMul (actor->Speed, finecosine[angle]);
|
actor->velx = FixedMul (actor->Speed, finecosine[angle]);
|
||||||
actor->vely = FixedMul (actor->Speed, finesine[angle]);
|
actor->vely = FixedMul (actor->Speed, finesine[angle]);
|
||||||
dist = actor->AproxDistance (target) / actor->Speed;
|
dist = actor->AproxDistance (target) / actor->Speed;
|
||||||
if (actor->z+actor->height < target->z ||
|
if (actor->Top() < target->Z() ||
|
||||||
target->z+target->height < actor->z)
|
target->Top() < actor->Z())
|
||||||
{
|
{
|
||||||
if (dist < 1)
|
if (dist < 1)
|
||||||
{
|
{
|
||||||
dist = 1;
|
dist = 1;
|
||||||
}
|
}
|
||||||
actor->velz = (target->z - actor->z)/dist;
|
actor->velz = (target->Z() - actor->Z())/dist;
|
||||||
}
|
}
|
||||||
if (target->flags&MF_SHOOTABLE && pr_dragonseek() < 64)
|
if (target->flags&MF_SHOOTABLE && pr_dragonseek() < 64)
|
||||||
{ // attack the destination mobj if it's attackable
|
{ // attack the destination mobj if it's attackable
|
||||||
|
@ -252,11 +252,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonFX2)
|
||||||
delay = 16+(pr_dragonfx2()>>3);
|
delay = 16+(pr_dragonfx2()>>3);
|
||||||
for (i = 1+(pr_dragonfx2()&3); i; i--)
|
for (i = 1+(pr_dragonfx2()&3); i; i--)
|
||||||
{
|
{
|
||||||
fixed_t x = self->x+((pr_dragonfx2()-128)<<14);
|
fixedvec3 pos = self->Vec3Offset(
|
||||||
fixed_t y = self->y+((pr_dragonfx2()-128)<<14);
|
((pr_dragonfx2()-128)<<14),
|
||||||
fixed_t z = self->z+((pr_dragonfx2()-128)<<12);
|
((pr_dragonfx2()-128)<<14),
|
||||||
|
((pr_dragonfx2()-128)<<12));
|
||||||
|
|
||||||
mo = Spawn ("DragonExplosion", x, y, z, ALLOW_REPLACE);
|
mo = Spawn ("DragonExplosion", pos, ALLOW_REPLACE);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->tics = delay+(pr_dragonfx2()&3)*i*2;
|
mo->tics = delay+(pr_dragonfx2()&3)*i*2;
|
||||||
|
@ -288,7 +289,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonPain)
|
||||||
|
|
||||||
DEFINE_ACTION_FUNCTION(AActor, A_DragonCheckCrash)
|
DEFINE_ACTION_FUNCTION(AActor, A_DragonCheckCrash)
|
||||||
{
|
{
|
||||||
if (self->z <= self->floorz)
|
if (self->Z() <= self->floorz)
|
||||||
{
|
{
|
||||||
self->SetState (self->FindState ("Crash"));
|
self->SetState (self->FindState ("Crash"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropWeaponPieces)
|
||||||
const PClass *cls = j==0? p1 : j==1? p2 : p3;
|
const PClass *cls = j==0? p1 : j==1? p2 : p3;
|
||||||
if (cls)
|
if (cls)
|
||||||
{
|
{
|
||||||
AActor *piece = Spawn (cls, self->x, self->y, self->z, ALLOW_REPLACE);
|
AActor *piece = Spawn (cls, self->Pos(), ALLOW_REPLACE);
|
||||||
if (piece != NULL)
|
if (piece != NULL)
|
||||||
{
|
{
|
||||||
piece->velx = self->velx + finecosine[fineang];
|
piece->velx = self->velx + finecosine[fineang];
|
||||||
|
@ -112,10 +112,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_FSwordFlames)
|
||||||
|
|
||||||
for (i = 1+(pr_fswordflame()&3); i; i--)
|
for (i = 1+(pr_fswordflame()&3); i; i--)
|
||||||
{
|
{
|
||||||
fixed_t x = self->x+((pr_fswordflame()-128)<<12);
|
fixedvec3 pos = self->Vec3Offset(
|
||||||
fixed_t y = self->y+((pr_fswordflame()-128)<<12);
|
((pr_fswordflame()-128)<<12),
|
||||||
fixed_t z = self->z+((pr_fswordflame()-128)<<11);
|
((pr_fswordflame()-128)<<12),
|
||||||
Spawn ("FSwordFlame", x, y, z, ALLOW_REPLACE);
|
((pr_fswordflame()-128)<<11));
|
||||||
|
Spawn ("FSwordFlame", pos, ALLOW_REPLACE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ static FRandom pr_firedemonsplotch ("FiredSplotch");
|
||||||
void A_FiredSpawnRock (AActor *actor)
|
void A_FiredSpawnRock (AActor *actor)
|
||||||
{
|
{
|
||||||
AActor *mo;
|
AActor *mo;
|
||||||
int x,y,z;
|
|
||||||
const PClass *rtype;
|
const PClass *rtype;
|
||||||
|
|
||||||
switch (pr_firedemonrock() % 5)
|
switch (pr_firedemonrock() % 5)
|
||||||
|
@ -55,10 +54,11 @@ void A_FiredSpawnRock (AActor *actor)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
x = actor->x + ((pr_firedemonrock() - 128) << 12);
|
fixedvec3 pos = actor->Vec3Offset(
|
||||||
y = actor->y + ((pr_firedemonrock() - 128) << 12);
|
((pr_firedemonrock() - 128) << 12),
|
||||||
z = actor->z + ( pr_firedemonrock() << 11);
|
((pr_firedemonrock() - 128) << 12),
|
||||||
mo = Spawn (rtype, x, y, z, ALLOW_REPLACE);
|
( pr_firedemonrock() << 11));
|
||||||
|
mo = Spawn (rtype, pos, ALLOW_REPLACE);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->target = actor;
|
mo->target = actor;
|
||||||
|
@ -97,7 +97,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredRocks)
|
||||||
DEFINE_ACTION_FUNCTION(AActor, A_SmBounce)
|
DEFINE_ACTION_FUNCTION(AActor, A_SmBounce)
|
||||||
{
|
{
|
||||||
// give some more velocity (x,y,&z)
|
// give some more velocity (x,y,&z)
|
||||||
self->z = self->floorz + FRACUNIT;
|
self->SetZ(self->floorz + FRACUNIT);
|
||||||
self->velz = (2*FRACUNIT) + (pr_smbounce() << 10);
|
self->velz = (2*FRACUNIT) + (pr_smbounce() << 10);
|
||||||
self->velx = pr_smbounce()%3<<FRACBITS;
|
self->velx = pr_smbounce()%3<<FRACBITS;
|
||||||
self->vely = pr_smbounce()%3<<FRACBITS;
|
self->vely = pr_smbounce()%3<<FRACBITS;
|
||||||
|
@ -134,13 +134,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredChase)
|
||||||
if (self->threshold) self->threshold--;
|
if (self->threshold) self->threshold--;
|
||||||
|
|
||||||
// Float up and down
|
// Float up and down
|
||||||
self->z += finesine[weaveindex << BOBTOFINESHIFT] * 8;
|
self->SetZ(self->Z() + finesine[weaveindex << BOBTOFINESHIFT] * 8);
|
||||||
self->special1 = (weaveindex + 2) & 63;
|
self->special1 = (weaveindex + 2) & 63;
|
||||||
|
|
||||||
// Ensure it stays above certain height
|
// Ensure it stays above certain height
|
||||||
if (self->z < self->floorz + (64*FRACUNIT))
|
if (self->Z() < self->floorz + (64*FRACUNIT))
|
||||||
{
|
{
|
||||||
self->z += 2*FRACUNIT;
|
self->SetZ(self->Z() + 2*FRACUNIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!self->target || !(self->target->flags&MF_SHOOTABLE))
|
if(!self->target || !(self->target->flags&MF_SHOOTABLE))
|
||||||
|
@ -219,14 +219,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredSplotch)
|
||||||
{
|
{
|
||||||
AActor *mo;
|
AActor *mo;
|
||||||
|
|
||||||
mo = Spawn ("FireDemonSplotch1", self->x, self->y, self->z, ALLOW_REPLACE);
|
mo = Spawn ("FireDemonSplotch1", self->Pos(), ALLOW_REPLACE);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->velx = (pr_firedemonsplotch() - 128) << 11;
|
mo->velx = (pr_firedemonsplotch() - 128) << 11;
|
||||||
mo->vely = (pr_firedemonsplotch() - 128) << 11;
|
mo->vely = (pr_firedemonsplotch() - 128) << 11;
|
||||||
mo->velz = (pr_firedemonsplotch() << 10) + FRACUNIT*3;
|
mo->velz = (pr_firedemonsplotch() << 10) + FRACUNIT*3;
|
||||||
}
|
}
|
||||||
mo = Spawn ("FireDemonSplotch2", self->x, self->y, self->z, ALLOW_REPLACE);
|
mo = Spawn ("FireDemonSplotch2", self->Pos(), ALLOW_REPLACE);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->velx = (pr_firedemonsplotch() - 128) << 11;
|
mo->velx = (pr_firedemonsplotch() - 128) << 11;
|
||||||
|
|
|
@ -51,10 +51,10 @@ bool AArtiPoisonBag1::Use (bool pickup)
|
||||||
angle_t angle = Owner->angle >> ANGLETOFINESHIFT;
|
angle_t angle = Owner->angle >> ANGLETOFINESHIFT;
|
||||||
AActor *mo;
|
AActor *mo;
|
||||||
|
|
||||||
mo = Spawn ("PoisonBag",
|
mo = Spawn ("PoisonBag", Owner->Vec3Offset(
|
||||||
Owner->x+16*finecosine[angle],
|
16*finecosine[angle],
|
||||||
Owner->y+24*finesine[angle], Owner->z-
|
24*finesine[angle],
|
||||||
Owner->floorclip+8*FRACUNIT, ALLOW_REPLACE);
|
-Owner->floorclip+8*FRACUNIT), ALLOW_REPLACE);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->target = Owner;
|
mo->target = Owner;
|
||||||
|
@ -79,10 +79,10 @@ bool AArtiPoisonBag2::Use (bool pickup)
|
||||||
angle_t angle = Owner->angle >> ANGLETOFINESHIFT;
|
angle_t angle = Owner->angle >> ANGLETOFINESHIFT;
|
||||||
AActor *mo;
|
AActor *mo;
|
||||||
|
|
||||||
mo = Spawn ("FireBomb",
|
mo = Spawn ("FireBomb", Owner->Vec3Offset(
|
||||||
Owner->x+16*finecosine[angle],
|
16*finecosine[angle],
|
||||||
Owner->y+24*finesine[angle], Owner->z-
|
24*finesine[angle],
|
||||||
Owner->floorclip+8*FRACUNIT, ALLOW_REPLACE);
|
-Owner->floorclip+8*FRACUNIT), ALLOW_REPLACE);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->target = Owner;
|
mo->target = Owner;
|
||||||
|
@ -106,8 +106,7 @@ bool AArtiPoisonBag3::Use (bool pickup)
|
||||||
{
|
{
|
||||||
AActor *mo;
|
AActor *mo;
|
||||||
|
|
||||||
mo = Spawn("ThrowingBomb", Owner->x, Owner->y,
|
mo = Spawn("ThrowingBomb", Owner->PosPlusZ(-Owner->floorclip+35*FRACUNIT + (Owner->player? Owner->player->crouchoffset : 0)), ALLOW_REPLACE);
|
||||||
Owner->z-Owner->floorclip+35*FRACUNIT + (Owner->player? Owner->player->crouchoffset : 0), ALLOW_REPLACE);
|
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->angle = Owner->angle + (((pr_poisonbag()&7) - 4) << 24);
|
mo->angle = Owner->angle + (((pr_poisonbag()&7) - 4) << 24);
|
||||||
|
@ -133,7 +132,7 @@ bool AArtiPoisonBag3::Use (bool pickup)
|
||||||
mo->velz = FixedMul(speed, finesine[modpitch]);
|
mo->velz = FixedMul(speed, finesine[modpitch]);
|
||||||
mo->velx = FixedMul(xyscale, finecosine[angle]) + (Owner->velx >> 1);
|
mo->velx = FixedMul(xyscale, finecosine[angle]) + (Owner->velx >> 1);
|
||||||
mo->vely = FixedMul(xyscale, finesine[angle]) + (Owner->vely >> 1);
|
mo->vely = FixedMul(xyscale, finesine[angle]) + (Owner->vely >> 1);
|
||||||
mo->z += FixedMul(mo->Speed, finesine[orgpitch]);
|
mo->SetZ(mo->Z() + FixedMul(mo->Speed, finesine[orgpitch]));
|
||||||
|
|
||||||
mo->target = Owner;
|
mo->target = Owner;
|
||||||
mo->tics -= pr_poisonbag()&3;
|
mo->tics -= pr_poisonbag()&3;
|
||||||
|
@ -159,7 +158,7 @@ bool AArtiPoisonBagGiver::Use (bool pickup)
|
||||||
const PClass *MissileType = PClass::FindClass((ENamedName) this->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_None));
|
const PClass *MissileType = PClass::FindClass((ENamedName) this->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_None));
|
||||||
if (MissileType != NULL)
|
if (MissileType != NULL)
|
||||||
{
|
{
|
||||||
AActor *mo = Spawn (MissileType, Owner->x, Owner->y, Owner->z, ALLOW_REPLACE);
|
AActor *mo = Spawn (MissileType, Owner->Pos(), ALLOW_REPLACE);
|
||||||
if (mo != NULL)
|
if (mo != NULL)
|
||||||
{
|
{
|
||||||
if (mo->IsKindOf(RUNTIME_CLASS(AInventory)))
|
if (mo->IsKindOf(RUNTIME_CLASS(AInventory)))
|
||||||
|
@ -385,7 +384,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagInit)
|
||||||
{
|
{
|
||||||
AActor *mo;
|
AActor *mo;
|
||||||
|
|
||||||
mo = Spawn<APoisonCloud> (self->x, self->y, self->z+28*FRACUNIT, ALLOW_REPLACE);
|
mo = Spawn<APoisonCloud> (self->PosPlusZ(28*FRACUNIT), ALLOW_REPLACE);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->target = self->target;
|
mo->target = self->target;
|
||||||
|
@ -422,7 +421,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagDamage)
|
||||||
|
|
||||||
P_RadiusAttack (self, self->target, 4, 40, self->DamageType, RADF_HURTSOURCE);
|
P_RadiusAttack (self, self->target, 4, 40, self->DamageType, RADF_HURTSOURCE);
|
||||||
bobIndex = self->special2;
|
bobIndex = self->special2;
|
||||||
self->z += finesine[bobIndex << BOBTOFINESHIFT] >> 1;
|
self->SetZ(self->Z() + finesine[bobIndex << BOBTOFINESHIFT] >> 1);
|
||||||
self->special2 = (bobIndex + 1) & 63;
|
self->special2 = (bobIndex + 1) & 63;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -456,7 +455,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb2)
|
||||||
< (3*3)/(2*2))
|
< (3*3)/(2*2))
|
||||||
{
|
{
|
||||||
self->SetState (self->SpawnState + 6);
|
self->SetState (self->SpawnState + 6);
|
||||||
self->z = self->floorz;
|
self->SetZ(self->floorz);
|
||||||
self->velz = 0;
|
self->velz = 0;
|
||||||
self->BounceFlags = BOUNCE_None;
|
self->BounceFlags = BOUNCE_None;
|
||||||
self->flags &= ~MF_MISSILE;
|
self->flags &= ~MF_MISSILE;
|
||||||
|
|
Loading…
Reference in a new issue