This commit is contained in:
Christoph Oelckers 2014-06-23 09:27:30 +02:00
commit e15f80f640
3 changed files with 19 additions and 4 deletions

View File

@ -1297,6 +1297,11 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireBullets)
// A_FireProjectile // A_FireProjectile
// //
//========================================================================== //==========================================================================
enum FP_Flags
{
FPF_AIMATANGLE = 1,
FPF_TRANSFERTRANSLATION = 2,
};
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireCustomMissile) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireCustomMissile)
{ {
ACTION_PARAM_START(7); ACTION_PARAM_START(7);
@ -1305,11 +1310,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireCustomMissile)
ACTION_PARAM_BOOL(UseAmmo, 2); ACTION_PARAM_BOOL(UseAmmo, 2);
ACTION_PARAM_INT(SpawnOfs_XY, 3); ACTION_PARAM_INT(SpawnOfs_XY, 3);
ACTION_PARAM_FIXED(SpawnHeight, 4); ACTION_PARAM_FIXED(SpawnHeight, 4);
ACTION_PARAM_BOOL(AimAtAngle, 5); ACTION_PARAM_INT(Flags, 5);
ACTION_PARAM_ANGLE(pitch, 6); ACTION_PARAM_ANGLE(pitch, 6);
if (!self->player) return; if (!self->player) return;
player_t *player=self->player; player_t *player=self->player;
AWeapon * weapon=player->ReadyWeapon; AWeapon * weapon=player->ReadyWeapon;
AActor *linetarget; AActor *linetarget;
@ -1327,18 +1333,23 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireCustomMissile)
fixed_t z = SpawnHeight; fixed_t z = SpawnHeight;
fixed_t shootangle = self->angle; fixed_t shootangle = self->angle;
if (AimAtAngle) shootangle+=Angle; if (Flags & FPF_AIMATANGLE) shootangle += Angle;
// Temporarily adjusts the pitch // Temporarily adjusts the pitch
fixed_t SavedPlayerPitch = self->pitch; fixed_t SavedPlayerPitch = self->pitch;
self->pitch -= pitch; self->pitch -= pitch;
AActor * misl=P_SpawnPlayerMissile (self, x, y, z, ti, shootangle, &linetarget); AActor * misl=P_SpawnPlayerMissile (self, x, y, z, ti, shootangle, &linetarget);
self->pitch = SavedPlayerPitch; self->pitch = SavedPlayerPitch;
if (Flags & FPF_TRANSFERTRANSLATION)
{
misl->Translation = self->Translation;
}
// automatic handling of seeker missiles // automatic handling of seeker missiles
if (misl) if (misl)
{ {
if (linetarget && misl->flags2&MF2_SEEKERMISSILE) misl->tracer=linetarget; if (linetarget && misl->flags2&MF2_SEEKERMISSILE) misl->tracer=linetarget;
if (!AimAtAngle) if (!(Flags & FPF_AIMATANGLE))
{ {
// This original implementation is to aim straight ahead and then offset // This original implementation is to aim straight ahead and then offset
// the angle from the resulting direction. // the angle from the resulting direction.

View File

@ -2,7 +2,7 @@
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency> <dependency>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
</dependentAssembly> </dependentAssembly>
</dependency> </dependency>
</assembly> </assembly>

View File

@ -164,6 +164,10 @@ const int CPF_DAGGER = 2;
const int CPF_PULLIN = 4; const int CPF_PULLIN = 4;
const int CPF_NORANDOMPUFFZ = 8; const int CPF_NORANDOMPUFFZ = 8;
// Flags for A_CustomMissile
const int FPF_AIMATANGLE = 1;
const int FPF_TRANSFERTRANSLATION = 2;
// Flags for A_Teleport // Flags for A_Teleport
const int TF_TELEFRAG = 1;const int TF_RANDOMDECIDE = 2; const int TF_TELEFRAG = 1;const int TF_RANDOMDECIDE = 2;