- scriptified the Mauler, completing Strife.
This commit is contained in:
parent
b625156df6
commit
e01f680b72
8 changed files with 296 additions and 383 deletions
|
|
@ -861,7 +861,6 @@ set( NOT_COMPILED_SOURCE_FILES
|
|||
sc_man_scanner.re
|
||||
g_hexen/a_heresiarch.cpp
|
||||
g_hexen/a_spike.cpp
|
||||
g_strife/a_strifeweapons.cpp
|
||||
g_shared/sbarinfo_commands.cpp
|
||||
xlat/xlat_parser.y
|
||||
xlat_parser.c
|
||||
|
|
@ -1111,7 +1110,6 @@ set (PCH_SOURCES
|
|||
wi_stuff.cpp
|
||||
zstrformat.cpp
|
||||
g_hexen/a_hexenmisc.cpp
|
||||
g_strife/a_strifestuff.cpp
|
||||
g_strife/strife_sbar.cpp
|
||||
g_shared/a_action.cpp
|
||||
g_shared/a_armor.cpp
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
#ifndef __A_STRIFEGLOBAL_H__
|
||||
#define __A_STRIFEGLOBAL_H__
|
||||
|
||||
#include "info.h"
|
||||
#include "a_pickups.h"
|
||||
|
||||
#endif
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
#include "actor.h"
|
||||
#include "g_level.h"
|
||||
#include "gi.h"
|
||||
#include "m_random.h"
|
||||
#include "s_sound.h"
|
||||
#include "d_player.h"
|
||||
#include "a_action.h"
|
||||
#include "p_local.h"
|
||||
#include "p_enemy.h"
|
||||
#include "p_lnspec.h"
|
||||
#include "c_console.h"
|
||||
#include "vm.h"
|
||||
#include "doomstat.h"
|
||||
#include "gstrings.h"
|
||||
#include "a_keys.h"
|
||||
#include "a_sharedglobal.h"
|
||||
#include "templates.h"
|
||||
#include "d_event.h"
|
||||
#include "v_font.h"
|
||||
#include "serializer.h"
|
||||
#include "p_spec.h"
|
||||
#include "portal.h"
|
||||
#include "vm.h"
|
||||
|
||||
// Include all the other Strife stuff here to reduce compile time
|
||||
#include "a_strifeweapons.cpp"
|
||||
|
||||
// Notes so I don't forget them:
|
||||
//
|
||||
// When shooting missiles at something, if MF_SHADOW is set, the angle is adjusted with the formula:
|
||||
// angle += pr_spawnmissile.Random2() << 21
|
||||
// When MF_STRIFEx4000000 is set, the angle is adjusted similarly:
|
||||
// angle += pr_spawnmissile.Random2() << 22
|
||||
// Note that these numbers are different from those used by all the other Doom engine games.
|
||||
|
||||
|
|
@ -1,165 +0,0 @@
|
|||
/*
|
||||
#include "a_pickups.h"
|
||||
#include "p_local.h"
|
||||
#include "m_random.h"
|
||||
#include "a_strifeglobal.h"
|
||||
#include "s_sound.h"
|
||||
#include "p_enemy.h"
|
||||
#include "templates.h"
|
||||
#include "vm.h"
|
||||
#include "doomstat.h"
|
||||
*/
|
||||
|
||||
// Note: Strife missiles do 1-4 times their damage amount.
|
||||
// Doom missiles do 1-8 times their damage amount, so to
|
||||
// make the strife missiles do proper damage without
|
||||
// hacking more stuff in the executable, be sure to give
|
||||
// all Strife missiles the MF4_STRIFEDAMAGE flag.
|
||||
|
||||
static FRandom pr_electric ("FireElectric");
|
||||
static FRandom pr_sgunshot ("StrifeGunShot");
|
||||
static FRandom pr_minimissile ("MiniMissile");
|
||||
static FRandom pr_flamethrower ("FlameThrower");
|
||||
static FRandom pr_flamedie ("FlameDie");
|
||||
static FRandom pr_mauler1 ("Mauler1");
|
||||
static FRandom pr_mauler2 ("Mauler2");
|
||||
static FRandom pr_phburn ("PhBurn");
|
||||
|
||||
void A_LoopActiveSound (AActor *);
|
||||
void A_Countdown (AActor *);
|
||||
|
||||
// Assault Gun --------------------------------------------------------------
|
||||
|
||||
// Mini-Missile Launcher ----------------------------------------------------
|
||||
|
||||
// Flame Thrower ------------------------------------------------------------
|
||||
|
||||
// Mauler -------------------------------------------------------------------
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// A_FireMauler1
|
||||
//
|
||||
// Hey! This is exactly the same as a super shotgun except for the sound
|
||||
// and the bullet puffs and the disintegration death.
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_FireMauler1)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE(AActor);
|
||||
|
||||
if (self->player != NULL)
|
||||
{
|
||||
AWeapon *weapon = self->player->ReadyWeapon;
|
||||
if (weapon != NULL)
|
||||
{
|
||||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return 0;
|
||||
}
|
||||
// Strife apparently didn't show the player shooting. Let's fix that.
|
||||
self->player->mo->PlayAttacking2 ();
|
||||
}
|
||||
|
||||
S_Sound (self, CHAN_WEAPON, "weapons/mauler1", 1, ATTN_NORM);
|
||||
|
||||
|
||||
DAngle bpitch = P_BulletSlope (self);
|
||||
|
||||
for (int i = 0; i < 20; ++i)
|
||||
{
|
||||
int damage = 5 * (pr_mauler1() % 3 + 1);
|
||||
DAngle angle = self->Angles.Yaw + pr_mauler1.Random2() * (11.25 / 256);
|
||||
DAngle pitch = bpitch + pr_mauler1.Random2() * (7.097 / 256);
|
||||
|
||||
// Strife used a range of 2112 units for the mauler to signal that
|
||||
// it should use a different puff. ZDoom's default range is longer
|
||||
// than this, so let's not handicap it by being too faithful to the
|
||||
// original.
|
||||
P_LineAttack (self, angle, PLAYERMISSILERANGE, pitch, damage, NAME_Hitscan, NAME_MaulerPuff);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// A_FireMauler2Pre
|
||||
//
|
||||
// Makes some noise and moves the psprite.
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2Pre)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE(AActor);
|
||||
|
||||
S_Sound (self, CHAN_WEAPON, "weapons/mauler2charge", 1, ATTN_NORM);
|
||||
|
||||
if (self->player != nullptr)
|
||||
{
|
||||
self->player->GetPSprite(PSP_WEAPON)->x += pr_mauler2.Random2() / 64.;
|
||||
self->player->GetPSprite(PSP_WEAPON)->y += pr_mauler2.Random2() / 64.;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// A_FireMauler2Pre
|
||||
//
|
||||
// Fires the torpedo.
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE(AActor);
|
||||
|
||||
if (self->player != NULL)
|
||||
{
|
||||
AWeapon *weapon = self->player->ReadyWeapon;
|
||||
if (weapon != NULL)
|
||||
{
|
||||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return 0;
|
||||
}
|
||||
self->player->mo->PlayAttacking2 ();
|
||||
}
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("MaulerTorpedo"));
|
||||
P_DamageMobj (self, self, NULL, 20, self->DamageType);
|
||||
self->Thrust(self->Angles.Yaw+180., 7.8125);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// A_MaulerTorpedoWave
|
||||
//
|
||||
// Launches lots of balls when the torpedo hits something.
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_MaulerTorpedoWave)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
|
||||
AActor *wavedef = GetDefaultByName("MaulerTorpedoWave");
|
||||
double savedz;
|
||||
self->Angles.Yaw += 180.;
|
||||
|
||||
// If the torpedo hit the ceiling, it should still spawn the wave
|
||||
savedz = self->Z();
|
||||
if (wavedef && self->ceilingz < self->Z() + wavedef->Height)
|
||||
{
|
||||
self->SetZ(self->ceilingz - wavedef->Height);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 80; ++i)
|
||||
{
|
||||
self->Angles.Yaw += 4.5;
|
||||
P_SpawnSubMissile (self, PClass::FindActor("MaulerTorpedoWave"), self->target);
|
||||
}
|
||||
self->SetZ(savedz);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue