mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-20 11:11:34 +00:00
651817fad7
(This commit is 95% search & replace with only a few places where velz was used as a local variable changed.)
51 lines
940 B
C++
51 lines
940 B
C++
#include "actor.h"
|
|
#include "info.h"
|
|
#include "m_random.h"
|
|
#include "m_fixed.h"
|
|
|
|
static FRandom pr_dirt ("SpawnDirt");
|
|
|
|
// Stained glass ------------------------------------------------------------
|
|
|
|
class AGlassShard : public AActor
|
|
{
|
|
DECLARE_CLASS (AGlassShard, AActor)
|
|
public:
|
|
bool FloorBounceMissile (secplane_t &plane)
|
|
{
|
|
if (!Super::FloorBounceMissile (plane))
|
|
{
|
|
if (abs (vel.z) < (FRACUNIT/2))
|
|
{
|
|
Destroy ();
|
|
}
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
};
|
|
|
|
IMPLEMENT_CLASS(AGlassShard)
|
|
|
|
// Dirt stuff
|
|
|
|
void P_SpawnDirt (AActor *actor, fixed_t radius)
|
|
{
|
|
PClassActor *dtype = NULL;
|
|
AActor *mo;
|
|
|
|
fixed_t zo = (pr_dirt() << 9) + FRACUNIT;
|
|
fixedvec3 pos = actor->Vec3Angle(radius, pr_dirt() << 24, zo);
|
|
|
|
char fmt[8];
|
|
mysnprintf(fmt, countof(fmt), "Dirt%d", 1 + pr_dirt()%6);
|
|
dtype = PClass::FindActor(fmt);
|
|
if (dtype)
|
|
{
|
|
mo = Spawn (dtype, pos, ALLOW_REPLACE);
|
|
if (mo)
|
|
{
|
|
mo->vel.z = pr_dirt()<<10;
|
|
}
|
|
}
|
|
}
|