mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-08 05:51:09 +00:00
4d991de92d
called FastProjectile. This base class doesn't have any effects attached so that it can be used for user defined fast projectiles. SVN r1290 (trunk)
58 lines
1.3 KiB
C++
58 lines
1.3 KiB
C++
/*
|
|
#include "actor.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 "a_action.h"
|
|
#include "p_pspr.h"
|
|
#include "gstrings.h"
|
|
#include "a_hexenglobal.h"
|
|
#include "thingdef/thingdef.h"
|
|
*/
|
|
|
|
static FRandom pr_smoke ("MWandSmoke");
|
|
|
|
void A_MWandAttack (AActor *actor);
|
|
|
|
// Wand Missile -------------------------------------------------------------
|
|
|
|
class AMageWandMissile : public AFastProjectile
|
|
{
|
|
DECLARE_CLASS(AMageWandMissile, AFastProjectile)
|
|
public:
|
|
void Effect ();
|
|
};
|
|
|
|
IMPLEMENT_CLASS (AMageWandMissile)
|
|
|
|
void AMageWandMissile::Effect ()
|
|
{
|
|
fixed_t hitz;
|
|
|
|
//if (pr_smoke() < 128) // [RH] I think it looks better if it's consistent
|
|
{
|
|
hitz = z-8*FRACUNIT;
|
|
if (hitz < floorz)
|
|
{
|
|
hitz = floorz;
|
|
}
|
|
Spawn ("MageWandSmoke", x, y, hitz, ALLOW_REPLACE);
|
|
}
|
|
}
|
|
|
|
//============================================================================
|
|
//
|
|
// A_MWandAttack
|
|
//
|
|
//============================================================================
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_MWandAttack)
|
|
{
|
|
AActor *mo;
|
|
|
|
mo = P_SpawnPlayerMissile (self, RUNTIME_CLASS(AMageWandMissile));
|
|
S_Sound (self, CHAN_WEAPON, "MageWandFire", 1, ATTN_NORM);
|
|
}
|