- scriptified the teleport fog.

This commit is contained in:
Christoph Oelckers 2017-01-13 23:17:04 +01:00
parent a8beb51ca3
commit f759b6757a
5 changed files with 30 additions and 38 deletions

View file

@ -116,7 +116,7 @@ bool P_MorphPlayer (player_t *activator, player_t *p, PClassPlayerPawn *spawntyp
morphed->flags |= actor->flags & (MF_SHADOW|MF_NOGRAVITY);
morphed->flags2 |= actor->flags2 & MF2_FLY;
morphed->flags3 |= actor->flags3 & MF3_GHOST;
AActor *eflash = Spawn(((enter_flash) ? enter_flash : RUNTIME_CLASS(ATeleportFog)), actor->PosPlusZ(TELEFOGHEIGHT), ALLOW_REPLACE);
AActor *eflash = Spawn(((enter_flash) ? enter_flash : PClass::FindActor("TeleportFog")), actor->PosPlusZ(TELEFOGHEIGHT), ALLOW_REPLACE);
actor->player = nullptr;
actor->alternative = morphed;
actor->flags &= ~(MF_SOLID|MF_SHOOTABLE);
@ -128,7 +128,7 @@ bool P_MorphPlayer (player_t *activator, player_t *p, PClassPlayerPawn *spawntyp
p->MorphedPlayerClass = spawntype;
p->MorphStyle = style;
p->MorphExitFlash = (exit_flash) ? exit_flash : RUNTIME_CLASS(ATeleportFog);
p->MorphExitFlash = (exit_flash) ? exit_flash : PClass::FindActor("TeleportFog");
p->health = morphed->health;
p->mo = morphed;
p->Vel.X = p->Vel.Y = 0;
@ -416,7 +416,7 @@ bool P_MorphMonster (AActor *actor, PClassActor *spawntype, int duration, int st
morphed->UnmorphTime = level.time + ((duration) ? duration : MORPHTICS) + pr_morphmonst();
morphed->MorphStyle = style;
morphed->MorphExitFlash = (exit_flash) ? exit_flash : RUNTIME_CLASS(ATeleportFog);
morphed->MorphExitFlash = (exit_flash) ? exit_flash : PClass::FindActor("TeleportFog");
morphed->FlagsSave = actor->flags & ~MF_JUSTHIT;
morphed->special = actor->special;
memcpy (morphed->args, actor->args, sizeof(actor->args));
@ -434,7 +434,7 @@ bool P_MorphMonster (AActor *actor, PClassActor *spawntype, int duration, int st
actor->flags &= ~(MF_SOLID|MF_SHOOTABLE);
actor->flags |= MF_UNMORPHED;
actor->renderflags |= RF_INVISIBLE;
AActor *eflash = Spawn(((enter_flash) ? enter_flash : RUNTIME_CLASS(ATeleportFog)), actor->PosPlusZ(TELEFOGHEIGHT), ALLOW_REPLACE);
AActor *eflash = Spawn(((enter_flash) ? enter_flash : PClass::FindActor("TeleportFog")), actor->PosPlusZ(TELEFOGHEIGHT), ALLOW_REPLACE);
if (eflash)
eflash->target = morphed;
return true;

View file

@ -76,13 +76,6 @@ private:
DImpactDecal();
};
class ATeleportFog : public AActor
{
DECLARE_CLASS (ATeleportFog, AActor)
public:
void PostBeginPlay ();
};
class ASkyViewpoint : public AActor
{
DECLARE_CLASS (ASkyViewpoint, AActor)

View file

@ -109,10 +109,10 @@ DEFINE_CLASS_PROPERTY(type, S, DynamicLight)
// which is controlled by flags
//
//==========================================================================
IMPLEMENT_CLASS (ADynamicLight, false, false)
IMPLEMENT_CLASS (AVavoomLight, false, false)
IMPLEMENT_CLASS (AVavoomLightWhite, false, false)
IMPLEMENT_CLASS (AVavoomLightColor, false, false)
IMPLEMENT_CLASS(ADynamicLight, false, false)
IMPLEMENT_CLASS(AVavoomLight, false, false)
IMPLEMENT_CLASS(AVavoomLightWhite, false, false)
IMPLEMENT_CLASS(AVavoomLightColor, false, false)
void AVavoomLight::BeginPlay ()
{

View file

@ -48,28 +48,6 @@ extern void P_CalcHeight (player_t *player);
CVAR (Bool, telezoom, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
IMPLEMENT_CLASS(ATeleportFog, false, false)
void ATeleportFog::PostBeginPlay ()
{
Super::PostBeginPlay ();
S_Sound (this, CHAN_BODY, "misc/teleport", 1, ATTN_NORM);
switch (gameinfo.gametype)
{
case GAME_Hexen:
case GAME_Heretic:
SetState(FindState(NAME_Raven));
break;
case GAME_Strife:
SetState(FindState(NAME_Strife));
break;
default:
break;
}
}
//==========================================================================
//
// P_SpawnTeleportFog

View file

@ -1,5 +1,5 @@
class TeleportFog : Actor native
class TeleportFog : Actor
{
default
{
@ -22,6 +22,27 @@ class TeleportFog : Actor native
TFOG ABCDEFEDCB 6 Bright;
Stop;
}
override void PostBeginPlay ()
{
Super.PostBeginPlay ();
A_PlaySound ("misc/teleport", CHAN_BODY);
switch (gametype())
{
case GAME_Hexen:
case GAME_Heretic:
SetStateLabel("Raven");
break;
case GAME_Strife:
SetStateLabel("Strife");
break;
default:
break;
}
}
}