2008-09-15 14:11:05 +00:00
|
|
|
/*
|
2006-02-24 04:48:15 +00:00
|
|
|
#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"
|
2008-08-10 20:48:55 +00:00
|
|
|
#include "thingdef/thingdef.h"
|
2008-09-15 14:11:05 +00:00
|
|
|
*/
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
static FRandom pr_smoke ("MWandSmoke");
|
|
|
|
|
|
|
|
void A_MWandAttack (AActor *actor);
|
|
|
|
|
|
|
|
// Wand Missile -------------------------------------------------------------
|
|
|
|
|
2008-11-15 09:57:18 +00:00
|
|
|
class AMageWandMissile : public AFastProjectile
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2008-11-15 09:57:18 +00:00
|
|
|
DECLARE_CLASS(AMageWandMissile, AFastProjectile)
|
2006-02-24 04:48:15 +00:00
|
|
|
public:
|
2008-11-15 09:57:18 +00:00
|
|
|
void Effect ();
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
2008-08-07 15:46:52 +00:00
|
|
|
IMPLEMENT_CLASS (AMageWandMissile)
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-11-15 09:57:18 +00:00
|
|
|
void AMageWandMissile::Effect ()
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
fixed_t hitz;
|
|
|
|
|
2008-11-15 09:57:18 +00:00
|
|
|
//if (pr_smoke() < 128) // [RH] I think it looks better if it's consistent
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2008-11-15 09:57:18 +00:00
|
|
|
hitz = z-8*FRACUNIT;
|
|
|
|
if (hitz < floorz)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2008-11-15 09:57:18 +00:00
|
|
|
hitz = floorz;
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
2008-11-15 09:57:18 +00:00
|
|
|
Spawn ("MageWandSmoke", x, y, hitz, ALLOW_REPLACE);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// A_MWandAttack
|
|
|
|
//
|
|
|
|
//============================================================================
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_MWandAttack)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
AActor *mo;
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
mo = P_SpawnPlayerMissile (self, RUNTIME_CLASS(AMageWandMissile));
|
|
|
|
S_Sound (self, CHAN_WEAPON, "MageWandFire", 1, ATTN_NORM);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|