- scriptified the Rocket launcher.
This commit is contained in:
parent
814493b68d
commit
fdab994fcb
7 changed files with 212 additions and 186 deletions
|
|
@ -22,61 +22,6 @@ static FRandom pr_bfgspray ("BFGSpray");
|
|||
static FRandom pr_oldbfg ("OldBFG");
|
||||
|
||||
|
||||
//
|
||||
// A_FireMissile
|
||||
//
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_FireMissile)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE(AActor);
|
||||
|
||||
player_t *player;
|
||||
|
||||
if (NULL == (player = self->player))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
AWeapon *weapon = self->player->ReadyWeapon;
|
||||
if (weapon != NULL && ACTION_CALL_FROM_PSPRITE())
|
||||
{
|
||||
if (!weapon->DepleteAmmo (weapon->bAltFire, true, 1))
|
||||
return 0;
|
||||
}
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("Rocket"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
//
|
||||
// A_FireSTGrenade: not exactly backported from ST, but should work the same
|
||||
//
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_FireSTGrenade)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE(AActor);
|
||||
PARAM_CLASS_DEF(grenade, AActor);
|
||||
|
||||
player_t *player;
|
||||
|
||||
if (grenade == NULL)
|
||||
return 0;
|
||||
|
||||
if (NULL == (player = self->player))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
AWeapon *weapon = self->player->ReadyWeapon;
|
||||
if (weapon != NULL && ACTION_CALL_FROM_PSPRITE())
|
||||
{
|
||||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Temporarily raise the pitch to send the grenade slightly upwards
|
||||
DAngle SavedPlayerPitch = self->Angles.Pitch;
|
||||
self->Angles.Pitch -= 6.328125; //(1152 << F RACBITS);
|
||||
P_SpawnPlayerMissile(self, grenade);
|
||||
self->Angles.Pitch = SavedPlayerPitch;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//
|
||||
// A_FirePlasma
|
||||
//
|
||||
|
|
|
|||
|
|
@ -6463,6 +6463,27 @@ AActor *P_SpawnPlayerMissile (AActor *source, double x, double y, double z,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, SpawnPlayerMissile)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_CLASS(type, AActor);
|
||||
PARAM_ANGLE_DEF(angle);
|
||||
PARAM_FLOAT_DEF(x);
|
||||
PARAM_FLOAT_DEF(y);
|
||||
PARAM_FLOAT_DEF(z);
|
||||
PARAM_POINTER_DEF(lt, FTranslatedLineTarget);
|
||||
PARAM_BOOL_DEF(nofreeaim);
|
||||
PARAM_BOOL_DEF(noautoaim);
|
||||
PARAM_INT_DEF(aimflags);
|
||||
AActor *missileactor;
|
||||
if (numparam == 2) angle = self->Angles.Yaw;
|
||||
AActor *misl = P_SpawnPlayerMissile(self, x, y, z, type, angle, lt, &missileactor, nofreeaim, noautoaim, aimflags);
|
||||
if (numret > 0) ret[0].SetPointer(misl, ATAG_OBJECT);
|
||||
if (numret > 1) ret[1].SetPointer(missileactor, ATAG_OBJECT), numret = 2;
|
||||
return numret;
|
||||
}
|
||||
|
||||
|
||||
int AActor::GetTeam()
|
||||
{
|
||||
if (player)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue