- scriptified Strife's assault gun and missile launcher.
This commit is contained in:
parent
be5ba70ed2
commit
5beebb83b7
10 changed files with 260 additions and 284 deletions
|
|
@ -1717,7 +1717,6 @@ bool AInventory::CallTryPickup (AActor *toucher, AActor **toucher_return)
|
|||
bool res;
|
||||
if (CanPickup(toucher))
|
||||
{
|
||||
bool res;
|
||||
IFVIRTUAL(AInventory, TryPickup)
|
||||
{
|
||||
VMValue params[2] = { (DObject*)this, (void*)&toucher };
|
||||
|
|
|
|||
|
|
@ -30,117 +30,8 @@ void A_Countdown (AActor *);
|
|||
|
||||
// Assault Gun --------------------------------------------------------------
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// P_StrifeGunShot
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
void P_StrifeGunShot (AActor *mo, bool accurate, DAngle pitch)
|
||||
{
|
||||
DAngle angle;
|
||||
int damage;
|
||||
|
||||
damage = 4*(pr_sgunshot()%3+1);
|
||||
angle = mo->Angles.Yaw;
|
||||
|
||||
if (mo->player != NULL && !accurate)
|
||||
{
|
||||
angle += pr_sgunshot.Random2() * (22.5 / 256) * mo->player->mo->AccuracyFactor();
|
||||
}
|
||||
|
||||
P_LineAttack (mo, angle, PLAYERMISSILERANGE, pitch, damage, NAME_Hitscan, NAME_StrifePuff);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// A_FireAssaultGun
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_FireAssaultGun)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE(AActor);
|
||||
|
||||
bool accurate;
|
||||
|
||||
S_Sound (self, CHAN_WEAPON, "weapons/assaultgun", 1, ATTN_NORM);
|
||||
|
||||
if (self->player != NULL)
|
||||
{
|
||||
AWeapon *weapon = self->player->ReadyWeapon;
|
||||
if (weapon != NULL)
|
||||
{
|
||||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return 0;
|
||||
}
|
||||
self->player->mo->PlayAttacking2 ();
|
||||
accurate = !self->player->refire;
|
||||
}
|
||||
else
|
||||
{
|
||||
accurate = true;
|
||||
}
|
||||
|
||||
P_StrifeGunShot (self, accurate, P_BulletSlope (self));
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Mini-Missile Launcher ----------------------------------------------------
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// A_FireMiniMissile
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_FireMiniMissile)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE(AActor);
|
||||
|
||||
player_t *player = self->player;
|
||||
DAngle savedangle;
|
||||
|
||||
if (self->player == NULL)
|
||||
return 0;
|
||||
|
||||
AWeapon *weapon = self->player->ReadyWeapon;
|
||||
if (weapon != NULL)
|
||||
{
|
||||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return 0;
|
||||
}
|
||||
|
||||
savedangle = self->Angles.Yaw;
|
||||
self->Angles.Yaw += pr_minimissile.Random2() * (11.25 / 256) * player->mo->AccuracyFactor();
|
||||
player->mo->PlayAttacking2 ();
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("MiniMissile"));
|
||||
self->Angles.Yaw = savedangle;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// A_RocketInFlight
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_RocketInFlight)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
|
||||
AActor *trail;
|
||||
|
||||
S_Sound (self, CHAN_VOICE, "misc/missileinflight", 1, ATTN_NORM);
|
||||
P_SpawnPuff (self, PClass::FindActor("MiniMissilePuff"), self->Pos(), self->Angles.Yaw - 180, self->Angles.Yaw - 180, 2, PF_HITTHING);
|
||||
trail = Spawn("RocketTrail", self->Vec3Offset(-self->Vel.X, -self->Vel.Y, 0.), ALLOW_REPLACE);
|
||||
if (trail != NULL)
|
||||
{
|
||||
trail->Vel.Z = 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Flame Thrower ------------------------------------------------------------
|
||||
|
||||
//============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue