- converted a few more DECORATE files.

- started with the AST converter. So far it only deals with direct function calls with simple constants as parameters.
- added an error condition for the defaults block to get rid of some asserts.
This commit is contained in:
Christoph Oelckers 2016-10-14 00:40:20 +02:00
parent 7e8d7eb2ec
commit 7de683f9f5
18 changed files with 881 additions and 681 deletions

View file

@ -3622,12 +3622,19 @@ FxFunctionCall::~FxFunctionCall()
//========================================================================== //==========================================================================
// //
// // Note: This currently only deals with the simple cases and needs some changes.
// //
//========================================================================== //==========================================================================
FxExpression *FxFunctionCall::Resolve(FCompileContext& ctx) FxExpression *FxFunctionCall::Resolve(FCompileContext& ctx)
{ {
// This part is mostly a kludge, it really needs to get the class type from Self.
PFunction *afd = dyn_cast<PFunction>(ctx.Class->Symbols.FindSymbol(MethodName, true));
if (afd != nullptr)
{
return new FxVMFunctionCall(afd, ArgList, ScriptPosition, false);
}
for (size_t i = 0; i < countof(FxFlops); ++i) for (size_t i = 0; i < countof(FxFlops); ++i)
{ {
if (MethodName == FxFlops[i].Name) if (MethodName == FxFlops[i].Name)

View file

@ -565,6 +565,7 @@ default_statement_list(X) ::= default_statement_list(X) default_statement(B).
default_statement(X) ::= SEMICOLON. { X = NULL; } default_statement(X) ::= SEMICOLON. { X = NULL; }
default_statement(X) ::= error SEMICOLON. { X = NULL; }
//default_statement(X) ::= assign_statement(A) SEMICOLON. { X = A; /*X-overwrites-A*/ } //default_statement(X) ::= assign_statement(A) SEMICOLON. { X = A; /*X-overwrites-A*/ }
default_statement(X) ::= property_statement(A). { X = A; /*X-overwrites-A*/ } default_statement(X) ::= property_statement(A). { X = A; /*X-overwrites-A*/ }
default_statement(X) ::= flag_statement(A). { X = A; /*X-overwrites-A*/ } default_statement(X) ::= flag_statement(A). { X = A; /*X-overwrites-A*/ }

View file

@ -45,6 +45,7 @@
#include "zcc_compile.h" #include "zcc_compile.h"
#include "v_text.h" #include "v_text.h"
#include "p_lnspec.h" #include "p_lnspec.h"
#include "i_system.h"
#include "gdtoa.h" #include "gdtoa.h"
#include "codegeneration/thingdef_exp.h" #include "codegeneration/thingdef_exp.h"
#include "vmbuilder.h" #include "vmbuilder.h"
@ -2028,10 +2029,6 @@ FxExpression *ZCCCompiler::SetupActionFunction(PClassActor *cls, ZCC_TreeNode *a
// This is the simple case which doesn't require work on the tree. // This is the simple case which doesn't require work on the tree.
return new FxVMFunctionCall(afd, nullptr, *af, true); return new FxVMFunctionCall(afd, nullptr, *af, true);
} }
else
{
// need to generate a function from the information.
}
} }
else else
{ {
@ -2039,8 +2036,10 @@ FxExpression *ZCCCompiler::SetupActionFunction(PClassActor *cls, ZCC_TreeNode *a
return nullptr; return nullptr;
} }
} }
Error(af, "Complex action functions not supported yet."); return ConvertAST(af);
return nullptr;
//Error(af, "Complex action functions not supported yet.");
//return nullptr;
/* /*
bool hasfinalret; bool hasfinalret;
@ -2264,3 +2263,83 @@ void ZCCCompiler::CompileStates()
} }
} }
} }
//==========================================================================
//
// Convert the AST data for the code generator.
//
//==========================================================================
FxExpression *ZCCCompiler::ConvertAST(ZCC_TreeNode *ast)
{
// FxReturnStatement will have to be done more intelligently, of course.
return new FxReturnStatement(ConvertNode(ast), *ast);
}
FxExpression *ZCCCompiler::ConvertNode(ZCC_TreeNode *ast)
{
// Note: Do not call 'Simplify' here because that function tends to destroy identifiers due to lack of context in which to resolve them.
// The Fx nodes created here will be better suited for that.
switch (ast->NodeType)
{
case AST_ExprFuncCall:
{
auto fcall = static_cast<ZCC_ExprFuncCall *>(ast);
assert(fcall->Function->NodeType == AST_ExprID); // of course this cannot remain. Right now nothing more complex can come along but later this will have to be decomposed into 'self' and the actual function name.
auto fname = static_cast<ZCC_ExprID *>(fcall->Function)->Identifier;
return new FxFunctionCall(nullptr, fname, ConvertNodeList(fcall->Parameters), *ast);
}
case AST_FuncParm:
{
auto fparm = static_cast<ZCC_FuncParm *>(ast);
// ignore the label for now, that's stuff for far later, when a bit more here is working.
return ConvertNode(fparm->Value);
}
case AST_ExprConstant:
{
auto cnst = static_cast<ZCC_ExprConstant *>(ast);
if (cnst->Type->IsKindOf(RUNTIME_CLASS(PInt)))
{
return new FxConstant(cnst->IntVal, *ast);
}
else if (cnst->Type->IsKindOf(RUNTIME_CLASS(PFloat)))
{
return new FxConstant(cnst->DoubleVal, *ast);
}
else if (cnst->Type->IsKindOf(RUNTIME_CLASS(PString)))
{
return new FxConstant(*cnst->StringVal, *ast);
}
else if (cnst->Type->IsKindOf(RUNTIME_CLASS(PName)))
{
return new FxConstant(ENamedName(cnst->IntVal), *ast);
}
else
{
// can there be other types?
Error(cnst, "Unknown constant type");
return new FxConstant(0, *ast);
}
}
default:
// only for development. I_Error is more convenient here than a normal error.
I_Error("ConvertNode encountered unsupported node of type %d", ast->NodeType);
return nullptr;
}
}
FArgumentList *ZCCCompiler::ConvertNodeList(ZCC_TreeNode *head)
{
FArgumentList *list = new FArgumentList;
auto node = head;
do
{
list->Push(ConvertNode(node));
node = node->SiblingNext;
} while (node != head);
return list;
}

View file

@ -5,6 +5,8 @@ struct Baggage;
struct FPropertyInfo; struct FPropertyInfo;
class AActor; class AActor;
class FxExpression; class FxExpression;
typedef TDeletingArray<FxExpression*> FArgumentList;
struct ZCC_StructWork struct ZCC_StructWork
{ {
@ -136,6 +138,10 @@ private:
void Error(ZCC_TreeNode *node, const char *msg, ...); void Error(ZCC_TreeNode *node, const char *msg, ...);
void MessageV(ZCC_TreeNode *node, const char *txtcolor, const char *msg, va_list argptr); void MessageV(ZCC_TreeNode *node, const char *txtcolor, const char *msg, va_list argptr);
FxExpression *ConvertAST(ZCC_TreeNode *ast);
FxExpression *ConvertNode(ZCC_TreeNode *node);
FArgumentList *ConvertNodeList(ZCC_TreeNode *head);
DObject *Outer; DObject *Outer;
PSymbolTable *GlobalTreeNodes; PSymbolTable *GlobalTreeNodes;
PSymbolTable *OutputSymbols; PSymbolTable *OutputSymbols;

View file

@ -1,56 +0,0 @@
//==========================================================================
//
// Ice chunk
//
//==========================================================================
ACTOR IceChunk
{
Radius 3
Height 4
Mass 5
Gravity 0.125
+DROPOFF
+CANNOTPUSH
+FLOORCLIP
+NOTELEPORT
+NOBLOCKMAP
+MOVEWITHSECTOR
action native A_IceSetTics ();
States
{
Spawn:
ICEC A 1
ICEC ABCD 10 A_IceSetTics
Stop
}
}
//==========================================================================
//
// A chunk of ice that is also a player
//
//==========================================================================
ACTOR IceChunkHead : PlayerChunk
{
Radius 3
Height 4
Mass 5
Gravity 0.125
DamageType Ice
+DROPOFF
+CANNOTPUSH
States
{
Spawn:
ICEC A 0
ICEC A 10 A_CheckPlayerDone
wait
}
}

View file

@ -1,69 +0,0 @@
// Blood sprite ------------------------------------------------------------
ACTOR Blood
{
Mass 5
+NOBLOCKMAP
+NOTELEPORT
+ALLOWPARTICLES
States
{
Spawn:
BLUD CBA 8
Stop
Spray:
SPRY ABCDEF 3
SPRY G 2
Stop
}
}
// Blood splatter -----------------------------------------------------------
ACTOR BloodSplatter
{
Radius 2
Height 4
+NOBLOCKMAP
+MISSILE
+DROPOFF
+NOTELEPORT
+CANNOTPUSH
+ALLOWPARTICLES
Mass 5
States
{
Spawn:
BLUD CBA 8
Stop
Death:
BLUD A 6
Stop
}
}
// Axe Blood ----------------------------------------------------------------
ACTOR AxeBlood
{
Radius 2
Height 4
+NOBLOCKMAP
+NOGRAVITY
+DROPOFF
+NOTELEPORT
+CANNOTPUSH
+ALLOWPARTICLES
Mass 5
States
{
Spawn:
FAXE FGHIJ 3
Death:
FAXE K 3
Stop
}
}

View file

@ -1,19 +0,0 @@
ACTOR CajunBodyNode
{
+NOSECTOR
+NOGRAVITY
+INVISIBLE
}
ACTOR CajunTrace
{
Speed 12
Radius 6
Height 8
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOGRAVITY
+NOTELEPORT
}

View file

@ -1,331 +0,0 @@
// Rocks --------------------------------------------------------------------
ACTOR Rock1
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
States
{
Spawn:
ROKK A 20
Loop
Death:
ROKK A 10
Stop
}
}
ACTOR Rock2
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
States
{
Spawn:
ROKK B 20
Loop
Death:
ROKK B 10
Stop
}
}
ACTOR Rock3
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
States
{
Spawn:
ROKK C 20
Loop
Death:
ROKK C 10
Stop
}
}
// Dirt --------------------------------------------------------------------
ACTOR Dirt1
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
States
{
Spawn:
ROKK D 20
Loop
Death:
ROKK D 10
Stop
}
}
ACTOR Dirt2
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
States
{
Spawn:
ROKK E 20
Loop
Death:
ROKK E 10
Stop
}
}
ACTOR Dirt3
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
States
{
Spawn:
ROKK F 20
Loop
Death:
ROKK F 10
Stop
}
}
ACTOR Dirt4
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
States
{
Spawn:
ROKK G 20
Loop
Death:
ROKK G 10
Stop
}
}
ACTOR Dirt5
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
States
{
Spawn:
ROKK H 20
Loop
Death:
ROKK H 10
Stop
}
}
ACTOR Dirt6
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
States
{
Spawn:
ROKK I 20
Loop
Death:
ROKK I 10
Stop
}
}
// Stained glass ------------------------------------------------------------
ACTOR GlassShard native
{
Radius 5
Mass 5
Projectile
-ACTIVATEPCROSS
-ACTIVATEIMPACT
BounceType "HexenCompat"
BounceFactor 0.3
}
ACTOR SGShard1 : GlassShard
{
States
{
Spawn:
SGSA ABCDE 4
Loop
Death:
SGSA E 30
Stop
}
}
ACTOR SGShard2 : GlassShard
{
States
{
Spawn:
SGSA FGHIJ 4
Loop
Death:
SGSA J 30
Stop
}
}
ACTOR SGShard3 : GlassShard
{
States
{
Spawn:
SGSA KLMNO 4
Loop
Death:
SGSA O 30
Stop
}
}
ACTOR SGShard4 : GlassShard
{
States
{
Spawn:
SGSA PQRST 4
Loop
Death:
SGSA T 30
Stop
}
}
ACTOR SGShard5 : GlassShard
{
States
{
Spawn:
SGSA UVWXY 4
Loop
Death:
SGSA Y 30
Stop
}
}
ACTOR SGShard6 : GlassShard
{
States
{
Spawn:
SGSB A 4
Loop
Death:
SGSB A 30
Stop
}
}
ACTOR SGShard7 : GlassShard
{
States
{
Spawn:
SGSB B 4
Loop
Death:
SGSB B 30
Stop
}
}
ACTOR SGShard8 : GlassShard
{
States
{
Spawn:
SGSB C 4
Loop
Death:
SGSB C 30
Stop
}
}
ACTOR SGShard9 : GlassShard
{
States
{
Spawn:
SGSB D 4
Loop
Death:
SGSB D 30
Stop
}
}
ACTOR SGShard0 : GlassShard
{
States
{
Spawn:
SGSB E 4
Loop
Death:
SGSB E 30
Stop
}
}
ACTOR GlassJunk
{
+NOCLIP
+NOBLOCKMAP
RenderStyle Translucent
Alpha 0.4
Health 3 // Number of different shards
States
{
// Are the first three frames used anywhere?
SHAR A 128
Goto Death
SHAR B 128
Goto Death
SHAR C 128
Goto Death
Spawn:
SHAR D 128
Goto Death
SHAR E 128
Goto Death
SHAR F 128
Goto Death
Death:
"----" A 1 A_FadeOut(0.03)
Wait
}
}

View file

@ -1,15 +0,0 @@
ACTOR MorphProjectile native
{
Damage 1
Projectile
-ACTIVATEIMPACT
-ACTIVATEPCROSS
}
ACTOR MorphedMonster native
{
Monster
-COUNTKILL
+FLOORCLIP
}

View file

@ -1,178 +0,0 @@
// Default actor for unregistered doomednums -------------------------------
ACTOR Unknown
{
Radius 32
Height 56
+NOGRAVITY
+NOBLOCKMAP
+DONTSPLASH
States
{
Spawn:
UNKN A -1
Stop
}
}
// Route node for monster patrols -------------------------------------------
ACTOR PatrolPoint
{
Radius 8
Height 8
Mass 10
+NOGRAVITY
+NOBLOCKMAP
+DONTSPLASH
RenderStyle None
}
// A special to execute when a monster reaches a matching patrol point ------
ACTOR PatrolSpecial
{
Radius 8
Height 8
Mass 10
+NOGRAVITY
+NOBLOCKMAP
+DONTSPLASH
RenderStyle None
}
// Map spot ----------------------------------------------------------------
ACTOR MapSpot
{
+NOBLOCKMAP
+NOSECTOR
+NOGRAVITY
+DONTSPLASH
RenderStyle None
CameraHeight 0
}
// same with different editor number for Legacy maps -----------------------
ACTOR FS_Mapspot : Mapspot
{
}
// Map spot with gravity ---------------------------------------------------
ACTOR MapSpotGravity : MapSpot
{
-NOBLOCKMAP
-NOSECTOR
-NOGRAVITY
}
// Point Pushers -----------------------------------------------------------
ACTOR PointPusher
{
+NOBLOCKMAP
+INVISIBLE
+NOCLIP
}
ACTOR PointPuller
{
+NOBLOCKMAP
+INVISIBLE
+NOCLIP
}
// Bloody gibs -------------------------------------------------------------
ACTOR RealGibs
{
+DROPOFF
+CORPSE
+NOTELEPORT
+DONTGIB
States
{
Spawn:
goto GenericCrush
}
}
// Gibs that can be placed on a map. ---------------------------------------
//
// These need to be a separate class from the above, in case someone uses
// a deh patch to change the gibs, since ZDoom actually creates a gib actor
// for actors that get crushed instead of changing their state as Doom did.
ACTOR Gibs : RealGibs
{
ClearFlags
}
// Needed for loading Build maps -------------------------------------------
ACTOR CustomSprite native
{
+NOBLOCKMAP
+NOGRAVITY
States
{
Spawn:
TNT1 A -1
Stop
}
}
// SwitchableDecoration: Activate and Deactivate change state --------------
ACTOR SwitchableDecoration native
{
}
ACTOR SwitchingDecoration : SwitchableDecoration native
{
}
// Random spawner ----------------------------------------------------------
ACTOR RandomSpawner native
{
+NOBLOCKMAP
+NOSECTOR
+NOGRAVITY
+THRUACTORS
}
// Fast projectiles --------------------------------------------------------
ACTOR FastProjectile native
{
Projectile
MissileHeight 0
}
// Sector flag setter ------------------------------------------------------
ACTOR SectorFlagSetter native
{
+NOBLOCKMAP
+NOGRAVITY
+DONTSPLASH
RenderStyle None
}
// Marker for sounds -------------------------------------------------------
ACTOR SpeakerIcon : Unknown
{
States
{
Spawn:
SPKR A -1 BRIGHT
Stop
}
Scale 0.125
}

View file

@ -2,11 +2,11 @@
//#include "actors/shared/inventory.txt" //#include "actors/shared/inventory.txt"
//#include "actors/shared/player.txt" //#include "actors/shared/player.txt"
#include "actors/shared/morph.txt" //#include "actors/shared/morph.txt"
#include "actors/shared/botstuff.txt" //#include "actors/shared/botstuff.txt"
#include "actors/shared/sharedmisc.txt" //#include "actors/shared/sharedmisc.txt"
#include "actors/shared/blood.txt" //#include "actors/shared/blood.txt"
#include "actors/shared/debris.txt" //#include "actors/shared/debris.txt"
#include "actors/shared/decal.txt" #include "actors/shared/decal.txt"
#include "actors/shared/splashes.txt" #include "actors/shared/splashes.txt"
#include "actors/shared/pickups.txt" #include "actors/shared/pickups.txt"
@ -26,7 +26,7 @@
#include "actors/shared/secrettrigger.txt" #include "actors/shared/secrettrigger.txt"
#include "actors/shared/setcolor.txt" #include "actors/shared/setcolor.txt"
#include "actors/shared/sectoraction.txt" #include "actors/shared/sectoraction.txt"
#include "actors/shared/action.txt" //#include "actors/shared/action.txt"
#include "actors/shared/dog.txt" #include "actors/shared/dog.txt"
#include "actors/shared/damagetypes.txt" #include "actors/shared/damagetypes.txt"

View file

@ -3,6 +3,12 @@ zscript/actor.txt
zscript/shared/inventory.txt zscript/shared/inventory.txt
zscript/shared/player.txt zscript/shared/player.txt
zscript/shared/morph.txt
zscript/shared/botstuff.txt
zscript/shared/sharedmisc.txt
zscript/shared/blood.txt
zscript/shared/ice.txt
zscript/shared/debris.txt
zscript/shared/specialspot.txt zscript/shared/specialspot.txt
//zscript/test1.txt //zscript/test1.txt

View file

@ -0,0 +1,78 @@
// Blood sprite ------------------------------------------------------------
class Blood : Actor
{
Default
{
Mass 5;
+NOBLOCKMAP
+NOTELEPORT
+ALLOWPARTICLES
}
States
{
Spawn:
BLUD CBA 8;
Stop;
Spray:
SPRY ABCDEF 3;
SPRY G 2;
Stop;
}
}
// Blood splatter -----------------------------------------------------------
class BloodSplatter : Actor
{
Default
{
Radius 2;
Height 4;
+NOBLOCKMAP
+MISSILE
+DROPOFF
+NOTELEPORT
+CANNOTPUSH
+ALLOWPARTICLES
Mass 5;
}
States
{
Spawn:
BLUD CBA 8;
Stop;
Death:
BLUD A 6;
Stop;
}
}
// Axe Blood ----------------------------------------------------------------
class AxeBlood : Actor
{
Default
{
Radius 2;
Height 4;
+NOBLOCKMAP
+NOGRAVITY
+DROPOFF
+NOTELEPORT
+CANNOTPUSH
+ALLOWPARTICLES
Mass 5;
}
States
{
Spawn:
FAXE FGHIJ 3;
Death:
FAXE K 3;
Stop;
}
}

View file

@ -0,0 +1,25 @@
class CajunBodyNode : Actor
{
Default
{
+NOSECTOR
+NOGRAVITY
+INVISIBLE
}
}
class CajunTrace : Actor
{
Default
{
Speed 12;
Radius 6;
Height 8;
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOGRAVITY
+NOTELEPORT
}
}

View file

@ -0,0 +1,364 @@
// Rocks --------------------------------------------------------------------
class Rock1 : Actor
{
Default
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
}
States
{
Spawn:
ROKK A 20;
Loop;
Death:
ROKK A 10;
Stop;
}
}
class Rock2 : Actor
{
Default
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
}
States
{
Spawn:
ROKK B 20;
Loop;
Death:
ROKK B 10;
Stop;
}
}
class Rock3 : Actor
{
Default
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
}
States
{
Spawn:
ROKK C 20;
Loop;
Death:
ROKK C 10;
Stop;
}
}
// Dirt --------------------------------------------------------------------
class Dirt1 : Actor
{
Default
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
}
States
{
Spawn:
ROKK D 20;
Loop;
Death:
ROKK D 10;
Stop;
}
}
class Dirt2 : Actor
{
Default
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
}
States
{
Spawn:
ROKK E 20;
Loop;
Death:
ROKK E 10;
Stop;
}
}
class Dirt3 : Actor
{
Default
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
}
States
{
Spawn:
ROKK F 20;
Loop;
Death:
ROKK F 10;
Stop;
}
}
class Dirt4 : Actor
{
Default
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
}
States
{
Spawn:
ROKK G 20;
Loop;
Death:
ROKK G 10;
Stop;
}
}
class Dirt5 : Actor
{
Default
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
}
States
{
Spawn:
ROKK H 20;
Loop;
Death:
ROKK H 10;
Stop;
}
}
class Dirt6 : Actor
{
Default
{
+NOBLOCKMAP
+DROPOFF
+MISSILE
+NOTELEPORT
}
States
{
Spawn:
ROKK I 20;
Loop;
Death:
ROKK I 10;
Stop;
}
}
// Stained glass ------------------------------------------------------------
class GlassShard : Actor native
{
Default
{
Radius 5;
Mass 5;
Projectile;
-ACTIVATEPCROSS
-ACTIVATEIMPACT
BounceType "HexenCompat";
BounceFactor 0.3;
}
}
class SGShard1 : GlassShard
{
States
{
Spawn:
SGSA ABCDE 4;
Loop;
Death:
SGSA E 30;
Stop;
}
}
class SGShard2 : GlassShard
{
States
{
Spawn:
SGSA FGHIJ 4;
Loop;
Death:
SGSA J 30;
Stop;
}
}
class SGShard3 : GlassShard
{
States
{
Spawn:
SGSA KLMNO 4;
Loop;
Death:
SGSA O 30;
Stop;
}
}
class SGShard4 : GlassShard
{
States
{
Spawn:
SGSA PQRST 4;
Loop;
Death:
SGSA T 30;
Stop;
}
}
class SGShard5 : GlassShard
{
States
{
Spawn:
SGSA UVWXY 4;
Loop;
Death:
SGSA Y 30;
Stop;
}
}
class SGShard6 : GlassShard
{
States
{
Spawn:
SGSB A 4;
Loop;
Death:
SGSB A 30;
Stop;
}
}
class SGShard7 : GlassShard
{
States
{
Spawn:
SGSB B 4;
Loop;
Death:
SGSB B 30;
Stop;
}
}
class SGShard8 : GlassShard
{
States
{
Spawn:
SGSB C 4;
Loop;
Death:
SGSB C 30;
Stop;
}
}
class SGShard9 : GlassShard
{
States
{
Spawn:
SGSB D 4;
Loop;
Death:
SGSB D 30;
Stop;
}
}
class SGShard0 : GlassShard
{
States
{
Spawn:
SGSB E 4;
Loop;
Death:
SGSB E 30;
Stop;
}
}
class GlassJunk : Actor
{
Default
{
+NOCLIP
+NOBLOCKMAP
RenderStyle "Translucent";
Alpha 0.4;
Health 3; // Number of different shards
}
States
{
// Are the first three frames used anywhere?
SHAR A 128;
Goto Death;
SHAR B 128;
Goto Death;
SHAR C 128;
Goto Death;
Spawn:
SHAR D 128;
Goto Death;
SHAR E 128;
Goto Death;
SHAR F 128;
Goto Death;
Death:
"----" A 1 A_FadeOut(0.03);
Wait;
}
}

View file

@ -0,0 +1,61 @@
//==========================================================================
//
// Ice chunk
//
//==========================================================================
class IceChunk : Actor
{
Default
{
Radius 3;
Height 4;
Mass 5;
Gravity 0.125;
+DROPOFF
+CANNOTPUSH
+FLOORCLIP
+NOTELEPORT
+NOBLOCKMAP
+MOVEWITHSECTOR
}
action native void A_IceSetTics ();
States
{
Spawn:
ICEC A 1;
ICEC ABCD 10 A_IceSetTics;
Stop;
}
}
//==========================================================================
//
// A chunk of ice that is also a player
//
//==========================================================================
class IceChunkHead : PlayerChunk
{
Default
{
Radius 3;
Height 4;
Mass 5;
Gravity 0.125;
DamageType "Ice";
+DROPOFF
+CANNOTPUSH
}
States
{
Spawn:
ICEC A 0;
ICEC A 10 A_CheckPlayerDone;
wait;
}
}

View file

@ -0,0 +1,21 @@
class MorphProjectile : Actor native
{
Default
{
Damage 1;
Projectile;
-ACTIVATEIMPACT
-ACTIVATEPCROSS
}
}
class MorphedMonster : Actor native
{
Default
{
Monster;
-COUNTKILL
+FLOORCLIP
}
}

View file

@ -0,0 +1,220 @@
// Default class for unregistered doomednums -------------------------------
class Unknown : Actor
{
Default
{
Radius 32;
Height 56;
+NOGRAVITY
+NOBLOCKMAP
+DONTSPLASH
}
States
{
Spawn:
UNKN A -1;
Stop;
}
}
// Route node for monster patrols -------------------------------------------
class PatrolPoint : Actor
{
Default
{
Radius 8;
Height 8;
Mass 10;
+NOGRAVITY
+NOBLOCKMAP
+DONTSPLASH
RenderStyle "None";
}
}
// A special to execute when a monster reaches a matching patrol point ------
class PatrolSpecial : Actor
{
Default
{
Radius 8;
Height 8;
Mass 10;
+NOGRAVITY
+NOBLOCKMAP
+DONTSPLASH
RenderStyle "None";
}
}
// Map spot ----------------------------------------------------------------
class MapSpot : Actor
{
Default
{
+NOBLOCKMAP
+NOSECTOR
+NOGRAVITY
+DONTSPLASH
RenderStyle "None";
CameraHeight 0;
}
}
// same with different editor number for Legacy maps -----------------------
class FS_Mapspot : Mapspot
{
}
// Map spot with gravity ---------------------------------------------------
class MapSpotGravity : MapSpot
{
Default
{
-NOBLOCKMAP
-NOSECTOR
-NOGRAVITY
}
}
// Point Pushers -----------------------------------------------------------
class PointPusher : Actor
{
Default
{
+NOBLOCKMAP
+INVISIBLE
+NOCLIP
}
}
class PointPuller : Actor
{
Default
{
+NOBLOCKMAP
+INVISIBLE
+NOCLIP
}
}
// Bloody gibs -------------------------------------------------------------
class RealGibs : Actor
{
Default
{
+DROPOFF
+CORPSE
+NOTELEPORT
+DONTGIB
}
States
{
Spawn:
goto GenericCrush;
}
}
// Gibs that can be placed on a map. ---------------------------------------
//
// These need to be a separate class from the above, in case someone uses
// a deh patch to change the gibs, since ZDoom actually creates a gib class
// for actors that get crushed instead of changing their state as Doom did.
class Gibs : RealGibs
{
Default
{
ClearFlags;
}
}
// Needed for loading Build maps -------------------------------------------
class CustomSprite : Actor native
{
Default
{
+NOBLOCKMAP
+NOGRAVITY
}
States
{
Spawn:
TNT1 A -1;
Stop;
}
}
// SwitchableDecoration: Activate and Deactivate change state --------------
class SwitchableDecoration : Actor native
{
}
class SwitchingDecoration : SwitchableDecoration native
{
}
// Random spawner ----------------------------------------------------------
class RandomSpawner : Actor native
{
Default
{
+NOBLOCKMAP
+NOSECTOR
+NOGRAVITY
+THRUACTORS
}
}
// Fast projectiles --------------------------------------------------------
class FastProjectile : Actor native
{
Default
{
Projectile;
MissileHeight 0;
}
}
// Sector flag setter ------------------------------------------------------
class SectorFlagSetter : Actor native
{
Default
{
+NOBLOCKMAP
+NOGRAVITY
+DONTSPLASH
RenderStyle "None";
}
}
// Marker for sounds : Actor -------------------------------------------------------
class SpeakerIcon : Unknown
{
States
{
Spawn:
SPKR A -1 BRIGHT;
Stop;
}
Default
{
Scale 0.125;
}
}