mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-20 03:01:31 +00:00
bc63b70d88
Conflicts: src/actor.h src/fragglescript/t_func.cpp src/g_doom/a_bossbrain.cpp src/g_doom/a_revenant.cpp src/g_heretic/a_hereticartifacts.cpp src/g_heretic/a_hereticweaps.cpp src/g_heretic/a_knight.cpp src/g_hexen/a_bishop.cpp src/g_hexen/a_clericholy.cpp src/g_hexen/a_dragon.cpp src/g_hexen/a_firedemon.cpp src/g_hexen/a_flechette.cpp src/g_hexen/a_heresiarch.cpp src/g_hexen/a_hexenspecialdecs.cpp src/g_hexen/a_iceguy.cpp src/g_hexen/a_korax.cpp src/g_hexen/a_magelightning.cpp src/g_hexen/a_serpent.cpp src/g_hexen/a_spike.cpp src/g_hexen/a_wraith.cpp src/g_raven/a_minotaur.cpp src/g_shared/a_bridge.cpp src/g_shared/a_pickups.cpp src/g_shared/a_randomspawner.cpp src/g_strife/a_alienspectres.cpp src/g_strife/a_crusader.cpp src/g_strife/a_entityboss.cpp src/g_strife/a_inquisitor.cpp src/g_strife/a_loremaster.cpp src/g_strife/a_programmer.cpp src/g_strife/a_sentinel.cpp src/g_strife/a_spectral.cpp src/g_strife/a_strifestuff.cpp src/g_strife/a_strifeweapons.cpp src/g_strife/a_thingstoblowup.cpp src/p_local.h src/r_utility.cpp
52 lines
1,004 B
C++
52 lines
1,004 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 (velz) < (FRACUNIT/2))
|
|
{
|
|
Destroy ();
|
|
}
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
};
|
|
|
|
IMPLEMENT_CLASS(AGlassShard)
|
|
|
|
// Dirt stuff
|
|
|
|
void P_SpawnDirt (AActor *actor, fixed_t radius)
|
|
{
|
|
fixed_t x,y,z;
|
|
PClassActor *dtype = NULL;
|
|
AActor *mo;
|
|
angle_t angle;
|
|
|
|
fixedvec3 pos = actor->Vec3Angle(radius, pr_dirt() << 24, (pr_dirt() << 9) + FRACUNIT);
|
|
|
|
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->velz = pr_dirt()<<10;
|
|
}
|
|
}
|
|
}
|