mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- float stuff in g_raven.
- fixed some problems in previous commits.
This commit is contained in:
parent
f3d6ca04fc
commit
5a4b974187
4 changed files with 37 additions and 43 deletions
|
@ -1401,7 +1401,7 @@ void FParser::SF_PointToAngle(void)
|
||||||
double x2 = floatvalue(t_argv[2]);
|
double x2 = floatvalue(t_argv[2]);
|
||||||
double y2 = floatvalue(t_argv[3]);
|
double y2 = floatvalue(t_argv[3]);
|
||||||
|
|
||||||
t_return.setDouble(DVector2(x2 - x1, y2 - y1).Angle().BAMs);
|
t_return.setDouble(DVector2(x2 - x1, y2 - y1).Angle().Normalized360().Degrees);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDecide)
|
||||||
|
|
||||||
bool friendly = !!(self->flags5 & MF5_SUMMONEDMONSTER);
|
bool friendly = !!(self->flags5 & MF5_SUMMONEDMONSTER);
|
||||||
AActor *target;
|
AActor *target;
|
||||||
int dist;
|
double dist;
|
||||||
|
|
||||||
target = self->target;
|
target = self->target;
|
||||||
if (!target)
|
if (!target)
|
||||||
|
@ -194,11 +194,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDecide)
|
||||||
{
|
{
|
||||||
S_Sound (self, CHAN_WEAPON, "minotaur/sight", 1, ATTN_NORM);
|
S_Sound (self, CHAN_WEAPON, "minotaur/sight", 1, ATTN_NORM);
|
||||||
}
|
}
|
||||||
dist = self->AproxDistance (target);
|
dist = self->Distance2D(target);
|
||||||
if (target->Top() > self->Z()
|
if (target->Top() > self->Z()
|
||||||
&& target->Top() < self->Top()
|
&& target->Top() < self->Top()
|
||||||
&& dist < (friendly ? 16*64*FRACUNIT : 8*64*FRACUNIT)
|
&& dist < (friendly ? 16*64. : 8*64.)
|
||||||
&& dist > 1*64*FRACUNIT
|
&& dist > 1*64.
|
||||||
&& pr_minotaurdecide() < 150)
|
&& pr_minotaurdecide() < 150)
|
||||||
{ // Charge attack
|
{ // Charge attack
|
||||||
// Don't call the state function right away
|
// Don't call the state function right away
|
||||||
|
@ -213,7 +213,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDecide)
|
||||||
self->special1 = TICRATE/2; // Charge duration
|
self->special1 = TICRATE/2; // Charge duration
|
||||||
}
|
}
|
||||||
else if (target->Z() == target->floorz
|
else if (target->Z() == target->floorz
|
||||||
&& dist < 9*64*FRACUNIT
|
&& dist < 9*64.
|
||||||
&& pr_minotaurdecide() < (friendly ? 100 : 220))
|
&& pr_minotaurdecide() < (friendly ? 100 : 220))
|
||||||
{ // Floor fire attack
|
{ // Floor fire attack
|
||||||
self->SetState (self->FindState ("Hammer"));
|
self->SetState (self->FindState ("Hammer"));
|
||||||
|
@ -282,9 +282,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2)
|
||||||
PARAM_ACTION_PROLOGUE;
|
PARAM_ACTION_PROLOGUE;
|
||||||
|
|
||||||
AActor *mo;
|
AActor *mo;
|
||||||
angle_t angle;
|
DAngle angle;
|
||||||
fixed_t vz;
|
double vz;
|
||||||
fixed_t z;
|
double z;
|
||||||
bool friendly = !!(self->flags5 & MF5_SUMMONEDMONSTER);
|
bool friendly = !!(self->flags5 & MF5_SUMMONEDMONSTER);
|
||||||
|
|
||||||
if (self->target == NULL)
|
if (self->target == NULL)
|
||||||
|
@ -300,7 +300,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2)
|
||||||
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
|
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
z = self->_f_Z() + 40*FRACUNIT;
|
z = self->Z() + 40;
|
||||||
PClassActor *fx = PClass::FindActor("MinotaurFX1");
|
PClassActor *fx = PClass::FindActor("MinotaurFX1");
|
||||||
if (fx)
|
if (fx)
|
||||||
{
|
{
|
||||||
|
@ -308,12 +308,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2)
|
||||||
if (mo != NULL)
|
if (mo != NULL)
|
||||||
{
|
{
|
||||||
// S_Sound (mo, CHAN_WEAPON, "minotaur/attack2", 1, ATTN_NORM);
|
// S_Sound (mo, CHAN_WEAPON, "minotaur/attack2", 1, ATTN_NORM);
|
||||||
vz = mo->_f_velz();
|
vz = mo->Vel.Z;
|
||||||
angle = mo->_f_angle();
|
angle = mo->Angles.Yaw;
|
||||||
P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/8), vz);
|
P_SpawnMissileAngleZ (self, z, fx, angle-(45./8), vz);
|
||||||
P_SpawnMissileAngleZ (self, z, fx, angle+(ANG45/8), vz);
|
P_SpawnMissileAngleZ (self, z, fx, angle+(45./8), vz);
|
||||||
P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/16), vz);
|
P_SpawnMissileAngleZ (self, z, fx, angle-(45./16), vz);
|
||||||
P_SpawnMissileAngleZ (self, z, fx, angle+(ANG45/16), vz);
|
P_SpawnMissileAngleZ (self, z, fx, angle+(45./16), vz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -486,7 +486,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurRoam)
|
||||||
//
|
//
|
||||||
// Look for enemy of player
|
// Look for enemy of player
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
#define MINOTAUR_LOOK_DIST (16*54*FRACUNIT)
|
#define MINOTAUR_LOOK_DIST (16*54.)
|
||||||
|
|
||||||
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurLook)
|
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurLook)
|
||||||
{
|
{
|
||||||
|
@ -500,7 +500,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurLook)
|
||||||
|
|
||||||
AActor *mo = NULL;
|
AActor *mo = NULL;
|
||||||
player_t *player;
|
player_t *player;
|
||||||
fixed_t dist;
|
double dist;
|
||||||
int i;
|
int i;
|
||||||
AActor *master = self->tracer;
|
AActor *master = self->tracer;
|
||||||
|
|
||||||
|
@ -514,7 +514,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurLook)
|
||||||
mo = player->mo;
|
mo = player->mo;
|
||||||
if (mo == master) continue;
|
if (mo == master) continue;
|
||||||
if (mo->health <= 0) continue;
|
if (mo->health <= 0) continue;
|
||||||
dist = self->AproxDistance(mo);
|
dist = self->Distance2D(mo);
|
||||||
if (dist > MINOTAUR_LOOK_DIST) continue;
|
if (dist > MINOTAUR_LOOK_DIST) continue;
|
||||||
self->target = mo;
|
self->target = mo;
|
||||||
break;
|
break;
|
||||||
|
@ -539,7 +539,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurLook)
|
||||||
if (!(mo->flags3 & MF3_ISMONSTER)) continue;
|
if (!(mo->flags3 & MF3_ISMONSTER)) continue;
|
||||||
if (mo->health <= 0) continue;
|
if (mo->health <= 0) continue;
|
||||||
if (!(mo->flags & MF_SHOOTABLE)) continue;
|
if (!(mo->flags & MF_SHOOTABLE)) continue;
|
||||||
dist = self->AproxDistance(mo);
|
dist = self->Distance2D(mo);
|
||||||
if (dist > MINOTAUR_LOOK_DIST) continue;
|
if (dist > MINOTAUR_LOOK_DIST) continue;
|
||||||
if ((mo == master) || (mo == self)) continue;
|
if ((mo == master) || (mo == self)) continue;
|
||||||
if ((mo->flags5 & MF5_SUMMONEDMONSTER) && (mo->tracer == master)) continue;
|
if ((mo->flags5 & MF5_SUMMONEDMONSTER) && (mo->tracer == master)) continue;
|
||||||
|
|
|
@ -28,7 +28,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightningTail)
|
||||||
{
|
{
|
||||||
PARAM_ACTION_PROLOGUE;
|
PARAM_ACTION_PROLOGUE;
|
||||||
|
|
||||||
AActor *foo = Spawn("SpectralLightningHTail", self->Vec3Offset(-self->_f_velx(), -self->_f_vely(), 0), ALLOW_REPLACE);
|
AActor *foo = Spawn("SpectralLightningHTail", self->Vec3Offset(-self->Vel.X, -self->Vel.Y, 0.), ALLOW_REPLACE);
|
||||||
|
|
||||||
foo->Angles.Yaw = self->Angles.Yaw;
|
foo->Angles.Yaw = self->Angles.Yaw;
|
||||||
foo->FriendPlayer = self->FriendPlayer;
|
foo->FriendPlayer = self->FriendPlayer;
|
||||||
|
@ -66,21 +66,20 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightning)
|
||||||
self->Vel.X += pr_zap5.Random2(3);
|
self->Vel.X += pr_zap5.Random2(3);
|
||||||
self->Vel.Y += pr_zap5.Random2(3);
|
self->Vel.Y += pr_zap5.Random2(3);
|
||||||
|
|
||||||
fixedvec2 pos = self->Vec2Offset(
|
double xo = pr_zap5.Random2(3) * 50.;
|
||||||
pr_zap5.Random2(3) * FRACUNIT * 50,
|
double yo = pr_zap5.Random2(3) * 50.;
|
||||||
pr_zap5.Random2(3) * FRACUNIT * 50);
|
|
||||||
|
|
||||||
flash = Spawn (self->threshold > 25 ? PClass::FindActor(NAME_SpectralLightningV2) :
|
flash = Spawn (self->threshold > 25 ? PClass::FindActor(NAME_SpectralLightningV2) :
|
||||||
PClass::FindActor(NAME_SpectralLightningV1), pos.x, pos.y, ONCEILINGZ, ALLOW_REPLACE);
|
PClass::FindActor(NAME_SpectralLightningV1), self->Vec2OffsetZ(xo, yo, ONCEILINGZ), ALLOW_REPLACE);
|
||||||
|
|
||||||
flash->target = self->target;
|
flash->target = self->target;
|
||||||
flash->Vel.Z = -18*FRACUNIT;
|
flash->Vel.Z = -18;
|
||||||
flash->FriendPlayer = self->FriendPlayer;
|
flash->FriendPlayer = self->FriendPlayer;
|
||||||
|
|
||||||
flash = Spawn(NAME_SpectralLightningV2, self->_f_X(), self->_f_Y(), ONCEILINGZ, ALLOW_REPLACE);
|
flash = Spawn(NAME_SpectralLightningV2, self->PosAtZ(ONCEILINGZ), ALLOW_REPLACE);
|
||||||
|
|
||||||
flash->target = self->target;
|
flash->target = self->target;
|
||||||
flash->Vel.Z = -18 * FRACUNIT;
|
flash->Vel.Z = -18;
|
||||||
flash->FriendPlayer = self->FriendPlayer;
|
flash->FriendPlayer = self->FriendPlayer;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -94,8 +93,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer2)
|
||||||
PARAM_ACTION_PROLOGUE;
|
PARAM_ACTION_PROLOGUE;
|
||||||
|
|
||||||
AActor *dest;
|
AActor *dest;
|
||||||
fixed_t dist;
|
double dist;
|
||||||
fixed_t slope;
|
double slope;
|
||||||
|
|
||||||
dest = self->tracer;
|
dest = self->tracer;
|
||||||
|
|
||||||
|
@ -123,21 +122,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer2)
|
||||||
if (!(self->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
if (!(self->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
||||||
{
|
{
|
||||||
// change slope
|
// change slope
|
||||||
dist = self->AproxDistance (dest) / self->_f_speed();
|
dist = self->DistanceBySpeed (dest, self->Speed);
|
||||||
|
if (dest->Height >= 56)
|
||||||
if (dist < 1)
|
|
||||||
{
|
{
|
||||||
dist = 1;
|
slope = (dest->Z()+40 - self->Z()) / dist;
|
||||||
}
|
|
||||||
if (dest->_f_height() >= 56*FRACUNIT)
|
|
||||||
{
|
|
||||||
slope = (dest->_f_Z()+40*FRACUNIT - self->_f_Z()) / dist;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
slope = (dest->_f_Z() + self->_f_height()*2/3 - self->_f_Z()) / dist;
|
slope = (dest->Z() + self->Height*(2./3) - self->Z()) / dist;
|
||||||
}
|
}
|
||||||
if (slope < self->_f_velz())
|
if (slope < self->Vel.Z)
|
||||||
{
|
{
|
||||||
self->Vel.Z -= 1 / 8.;
|
self->Vel.Z -= 1 / 8.;
|
||||||
}
|
}
|
||||||
|
|
|
@ -568,7 +568,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaulerTorpedoWave)
|
||||||
|
|
||||||
AActor *P_SpawnSubMissile (AActor *source, PClassActor *type, AActor *target)
|
AActor *P_SpawnSubMissile (AActor *source, PClassActor *type, AActor *target)
|
||||||
{
|
{
|
||||||
AActor *other = Spawn (type, source->_f_Pos(), ALLOW_REPLACE);
|
AActor *other = Spawn (type, source->Pos(), ALLOW_REPLACE);
|
||||||
|
|
||||||
if (other == NULL)
|
if (other == NULL)
|
||||||
{
|
{
|
||||||
|
@ -594,7 +594,7 @@ AActor *P_SpawnSubMissile (AActor *source, PClassActor *type, AActor *target)
|
||||||
if (P_CheckMissileSpawn (other, source->radius))
|
if (P_CheckMissileSpawn (other, source->radius))
|
||||||
{
|
{
|
||||||
DAngle pitch = P_AimLineAttack (source, source->Angles.Yaw, 1024.);
|
DAngle pitch = P_AimLineAttack (source, source->Angles.Yaw, 1024.);
|
||||||
other->Vel.Z = -other->Speed * pitch.Cos();
|
other->Vel.Z = -other->Speed * pitch.Sin();
|
||||||
return other;
|
return other;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1058,7 +1058,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil3)
|
||||||
spot = P_SpawnSubMissile (self, PClass::FindActor("SpectralLightningBall1"), self);
|
spot = P_SpawnSubMissile (self, PClass::FindActor("SpectralLightningBall1"), self);
|
||||||
if (spot != NULL)
|
if (spot != NULL)
|
||||||
{
|
{
|
||||||
spot->_f_SetZ(self->_f_Z() + 32*FRACUNIT);
|
spot->SetZ(self->Z() + 32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self->Angles.Yaw -= 90.;
|
self->Angles.Yaw -= 90.;
|
||||||
|
|
Loading…
Reference in a new issue