- removed token 'mode' because it isn't used anywhere and clashed with some actor properties.

- fixed uninitialized counter variable in DECORATE parser.
- allow dottable_id of xxx.color so that the property parser can parse 'powerup.color'.
- fixed crash with actor replacement in script compiler.
- add the lump number to tree nodes because parts of the property parser need that to make decisions.
- removed test stuff.
- converted inventory.txt, player.txt and specialspot.txt to ZSCRIPT. These were the minimal files required to allow actor.txt to parse successfully.
- removed the converted files from the DECORATE include list so that these are entirely handled by ZSCRIPT now.
This commit is contained in:
Christoph Oelckers 2016-10-13 20:45:52 +02:00
parent a72fbb771f
commit 433bf46010
18 changed files with 601 additions and 844 deletions

View file

@ -118,7 +118,6 @@ std2:
'void' { RET(TK_Void); }
'struct' { RET(TK_Struct); }
'class' { RET(TK_Class); }
'mode' { RET(TK_Mode); }
'enum' { RET(TK_Enum); }
'name' { RET(TK_Name); }
'string' { RET(TK_String); }

View file

@ -62,7 +62,6 @@ xx(TK_ULong, "'ulong'")
xx(TK_Void, "'void'")
xx(TK_Struct, "'struct'")
xx(TK_Class, "'class'")
xx(TK_Mode, "'mode'")
xx(TK_Enum, "'enum'")
xx(TK_Name, "'name'")
xx(TK_String, "'string'")

View file

@ -1526,7 +1526,7 @@ void ParseDecorate (FScanner &sc)
void ParseAllDecorate()
{
int lastlump, lump;
int lastlump = 0, lump;
while ((lump = Wads.FindLump("DECORATE", &lastlump)) != -1)
{

View file

@ -658,7 +658,7 @@ VMFunction *FFunctionBuildList::AddFunction(PClass *cls, FxExpression *code, con
return func;
}
Printf("Adding %s\n", name.GetChars());
//Printf("Adding %s\n", name.GetChars());
Item it;
it.Class = cls;

View file

@ -211,6 +211,16 @@ dottable_id(X) ::= dottable_id(A) DOT IDENTIFIER(B).
A->AppendSibling(id2);
X = A; /*X-overwrites-A*/
}
// a bit of a hack to allow the 'color' token to be used inside default properties.
// as a variable name it is practically meaningless because it cannot defined
// as such anywhere so it will always produce an error during processing.
dottable_id(X) ::= dottable_id(A) DOT COLOR.
{
NEW_AST_NODE(Identifier,id2,A);
id2->Id = NAME_Color;
A->AppendSibling(id2);
X = A; /*X-overwrites-A*/
}
/*------ Class Body ------*/
// Body is a list of:

View file

@ -70,7 +70,7 @@ void ZCCCompiler::ProcessClass(ZCC_Class *cnode, PSymbolTreeNode *treenode)
name << "nodes - " << FName(cnode->NodeName);
cls->TreeNodes.SetName(name);
if (!static_cast<PClassActor *>(cnode->Type)->SetReplacement(cnode->Replaces->Id))
if (cnode->Replaces != nullptr && !static_cast<PClassActor *>(cnode->Type)->SetReplacement(cnode->Replaces->Id))
{
Warn(cnode, "Replaced type '%s' not found for %s", FName(cnode->Replaces->Id).GetChars(), cnode->Type->TypeName.GetChars());
}
@ -1565,7 +1565,9 @@ void ZCCCompiler::DispatchProperty(FPropertyInfo *prop, ZCC_PropertyStmt *proper
if (exp->NodeType != AST_ExprConstant)
{
Error(exp, "%s: non-constant parameter", prop->name);
// If we get TypeError, there has already been a message from deeper down so do not print another one.
if (exp->Type != TypeError) Error(exp, "%s: non-constant parameter", prop->name);
return;
}
conv.s = nullptr;
pref.s = nullptr;
@ -1654,6 +1656,7 @@ void ZCCCompiler::DispatchProperty(FPropertyInfo *prop, ZCC_PropertyStmt *proper
if (exp != property->Values)
{
Error(property, "Too many values for '%s'", prop->name);
return;
}
break;
}
@ -1662,6 +1665,7 @@ void ZCCCompiler::DispatchProperty(FPropertyInfo *prop, ZCC_PropertyStmt *proper
if (*p < 'a')
{
Error(property, "Insufficient parameters for %s", prop->name);
return;
}
break;
}
@ -1816,7 +1820,7 @@ void ZCCCompiler::InitDefaults()
bag.StateSet = false;
bag.fromZScript = true;
bag.CurrentState = 0;
bag.Lumpnum = Wads.CheckNumForFullName(*c->cls->SourceName, true);
bag.Lumpnum = c->cls->SourceLump;
bag.DropItemList = nullptr;
bag.ScriptPosition.StrictErrors = true;
// The actual script position needs to be set per property.
@ -2061,6 +2065,8 @@ void ZCCCompiler::CompileStates()
}
FString statename; // The state builder wants the label as one complete string, not separated into tokens.
FStateDefinitions statedef;
statedef.MakeStateDefines(dyn_cast<PClassActor>(c->Type()->ParentClass));
for (auto s : c->States)
{
auto st = s->Body;

View file

@ -399,6 +399,7 @@ ZCC_TreeNode *ZCC_AST::InitNode(size_t size, EZCCTreeNodeType type, ZCC_TreeNode
if (basis != NULL)
{
node->SourceName = basis->SourceName;
node->SourceLump = basis->SourceLump;
node->SourceLoc = basis->SourceLoc;
}
return node;
@ -408,5 +409,6 @@ ZCC_TreeNode *ZCCParseState::InitNode(size_t size, EZCCTreeNodeType type)
{
ZCC_TreeNode *node = ZCC_AST::InitNode(size, type, NULL);
node->SourceName = Strings.Alloc(sc->ScriptName);
node->SourceLump = sc->LumpNum;
return node;
}

View file

@ -149,6 +149,7 @@ struct ZCC_TreeNode
// can't use FScriptPosition, because the string wouldn't have a chance to
// destruct if we did that.
FString *SourceName;
int SourceLump;
int SourceLoc;
// Node type is one of the node types above, which corresponds with

View file

@ -1,393 +0,0 @@
ACTOR Actor native //: Thinker
{
Scale 1
Health 1000
Reactiontime 8
Radius 20
Height 16
Mass 100
RenderStyle Normal
Alpha 1
MinMissileChance 200
MeleeRange 44
MaxDropoffHeight 24
MaxStepHeight 24
BounceFactor 0.7
WallBounceFactor 0.75
BounceCount -1
FloatSpeed 4
FloatBobPhase -1 // randomly initialize by default
Gravity 1
Friction 1
DamageFactor 1.0
PushFactor 0.25
WeaveIndexXY 0
WeaveIndexZ 16
DesignatedTeam 255
PainType Normal
DeathType Normal
TeleFogSourceType "TeleportFog"
TeleFogDestType "TeleportFog"
RipperLevel 0
RipLevelMin 0
RipLevelMax 0
DefThreshold 100
BloodType "Blood", "BloodSplatter", "AxeBlood"
ExplosionDamage 128
MissileHeight 32
SpriteAngle 0
SpriteRotation 0
StencilColor "00 00 00"
VisibleAngles 0, 0
VisiblePitch 0, 0
// Functions
native bool CheckClass(class<Actor> checkclass, int ptr_select = AAPTR_DEFAULT, bool match_superclass = false);
native bool IsPointerEqual(int ptr_select1, int ptr_select2);
native int CountInv(class<Inventory> itemtype, int ptr_select = AAPTR_DEFAULT);
native float GetDistance(bool checkz, int ptr = AAPTR_DEFAULT);
native float GetAngle(int flags, int ptr = AAPTR_DEFAULT);
native float GetZAt(float px = 0, float py = 0, float angle = 0, int flags = 0, int pick_pointer = AAPTR_DEFAULT);
native int GetSpawnHealth();
native int GetGibHealth();
native float GetCrouchFactor(int ptr = AAPTR_PLAYER1);
native float GetCVar(string cvar);
native int GetPlayerInput(int inputnum, int ptr = AAPTR_DEFAULT);
native int CountProximity(class<Actor> classname, float distance, int flags = 0, int ptr = AAPTR_DEFAULT);
native float GetSpriteAngle(int ptr = AAPTR_DEFAULT);
native float GetSpriteRotation(int ptr = AAPTR_DEFAULT);
native int GetMissileDamage(int mask, int add, int ptr = AAPTR_DEFAULT);
action native int OverlayID();
action native float OverlayX(int layer = 0);
action native float OverlayY(int layer = 0);
// Action functions
// Meh, MBF redundant functions. Only for DeHackEd support.
action native A_Turn(float angle = 0);
action native bool A_LineEffect(int boomspecial = 0, int tag = 0);
// End of MBF redundant functions.
action native A_MonsterRail();
action native A_BFGSpray(class<Actor> spraytype = "BFGExtra", int numrays = 40, int damagecount = 15, float/*angle*/ angle = 90, float distance = 16*64, float/*angle*/ vrange = 32, int damage = 0, int flags = 0);
action native A_Pain();
action native A_NoBlocking();
action native A_XScream();
action native A_Look();
action native A_Chase(state melee = "*", state missile = "none", int flags = 0);
action native A_FaceTarget(float max_turn = 0, float max_pitch = 270, float ang_offset = 0, float pitch_offset = 0, int flags = 0, float z_ofs = 0);
action native A_FaceTracer(float max_turn = 0, float max_pitch = 270, float ang_offset = 0, float pitch_offset = 0, int flags = 0, float z_ofs = 0);
action native A_FaceMaster(float max_turn = 0, float max_pitch = 270, float ang_offset = 0, float pitch_offset = 0, int flags = 0, float z_ofs = 0);
action native A_PosAttack();
action native A_Scream();
action native A_SPosAttack();
action native A_SPosAttackUseAtkSound();
action native A_VileChase();
action native A_VileStart();
action native A_VileTarget(class<Actor> fire = "ArchvileFire");
action native A_VileAttack(sound snd = "vile/stop", int initialdmg = 20, int blastdmg = 70, int blastradius = 70, float thrustfac = 1.0, name damagetype = "Fire", int flags = 0);
action native A_StartFire();
action native A_Fire(float spawnheight = 0);
action native A_FireCrackle();
action native A_Tracer();
action native A_SkelWhoosh();
action native A_SkelFist();
action native A_SkelMissile();
action native A_FatRaise();
action native A_FatAttack1(class<Actor> spawntype = "FatShot");
action native A_FatAttack2(class<Actor> spawntype = "FatShot");
action native A_FatAttack3(class<Actor> spawntype = "FatShot");
action native A_BossDeath();
action native A_CPosAttack();
action native A_CPosRefire();
action native A_TroopAttack();
action native A_SargAttack();
action native A_HeadAttack();
action native A_BruisAttack();
action native A_SkullAttack(float speed = 20);
action native A_BetaSkullAttack();
action native A_Metal();
action native A_SpidRefire();
action native A_BabyMetal();
action native A_BspiAttack();
action native A_Hoof();
action native A_CyberAttack();
action native A_PainAttack(class<Actor> spawntype = "LostSoul", float angle = 0, int flags = 0, int limit = -1);
action native A_DualPainAttack(class<Actor> spawntype = "LostSoul");
action native A_PainDie(class<Actor> spawntype = "LostSoul");
action native A_KeenDie(int doortag = 666);
action native A_BrainPain();
action native A_BrainScream();
action native A_BrainDie();
action native A_BrainAwake();
action native A_BrainSpit(class<Actor> spawntype = "none"); // needs special treatment for default
action native A_SpawnSound();
action native A_SpawnFly(class<Actor> spawntype = "none"); // needs special treatment for default
action native A_BrainExplode();
action native A_Die(name damagetype = "none");
action native A_Detonate();
action native A_Mushroom(class<Actor> spawntype = "FatShot", int numspawns = 0, int flags = 0, float vrange = 4.0, float hrange = 0.5);
native bool A_CallSpecial(int special, int arg1=0, int arg2=0, int arg3=0, int arg4=0, int arg5=0);
action native A_SetFloorClip();
action native A_UnSetFloorClip();
action native A_HideThing();
action native A_UnHideThing();
action native A_SetInvulnerable();
action native A_UnSetInvulnerable();
action native A_SetReflective();
action native A_UnSetReflective();
action native A_SetReflectiveInvulnerable();
action native A_UnSetReflectiveInvulnerable();
action native A_SetShootable();
action native A_UnSetShootable();
action native A_NoGravity();
action native A_Gravity();
action native A_LowGravity();
native void A_SetGravity(float gravity);
action native A_Fall();
action native A_SetSolid();
action native A_UnsetSolid();
action native A_SetFloat();
action native A_UnsetFloat();
action native A_M_Saw(sound fullsound = "weapons/sawfull", sound hitsound = "weapons/sawhit", int damage = 2, class<Actor> pufftype = "BulletPuff");
action native A_ScreamAndUnblock();
action native A_ActiveAndUnblock();
action native A_ActiveSound();
action native A_FastChase();
action native A_FreezeDeath();
action native A_FreezeDeathChunks();
action native A_GenericFreezeDeath();
action native A_IceGuyDie();
action native A_CentaurDefend();
action native A_BishopMissileWeave();
action native A_CStaffMissileSlither();
action native A_PlayerScream();
action native A_SkullPop(class<PlayerChunk> skulltype = "BloodySkull");
action native A_CheckPlayerDone();
action native A_Wander(int flags = 0);
action native A_Look2();
action native A_TossGib();
action native A_SentinelBob();
action native A_SentinelRefire();
action native A_Tracer2();
action native A_SetShadow();
action native A_ClearShadow();
action native A_GetHurt();
action native A_TurretLook();
action native A_KlaxonBlare();
action native A_Countdown();
action native A_AlertMonsters(float maxdist = 0, int flags = 0);
action native A_ClearSoundTarget();
action native A_FireAssaultGun();
action native A_CheckTerrain();
action native A_FaceConsolePlayer(float MaxTurnAngle = 0); // [TP] no-op
action native A_MissileAttack();
action native A_MeleeAttack();
action native A_ComboAttack();
action native A_BulletAttack();
action native A_WolfAttack(int flags = 0, sound whattoplay = "weapons/pistol", float snipe = 1.0, int maxdamage = 64, int blocksize = 128, int pointblank = 2, int longrange = 4, float runspeed = 160.0, class<Actor> pufftype = "BulletPuff");
action native A_PlaySound(sound whattoplay = "weapons/pistol", int slot = CHAN_BODY, float volume = 1.0, bool looping = false, float attenuation = ATTN_NORM);
native void A_PlayWeaponSound(sound whattoplay);
action native A_FLoopActiveSound();
action native A_LoopActiveSound();
action native A_StopSound(int slot = CHAN_VOICE); // Bad default but that's what is originally was...
native void A_PlaySoundEx(sound whattoplay, coerce name slot, bool looping = false, int attenuation = 0);
native void A_StopSoundEx(coerce name slot);
native void A_SeekerMissile(int threshold, int turnmax, int flags = 0, int chance = 50, int distance = 10);
native state A_Jump(int chance = 256, state label, ...);
native void A_CustomMissile(class<Actor> missiletype, float spawnheight = 32, float spawnofs_xy = 0, float angle = 0, int flags = 0, float pitch = 0, int ptr = AAPTR_TARGET);
native void A_CustomBulletAttack(float/*angle*/ spread_xy, float/*angle*/ spread_z, int numbullets, int damageperbullet, class<Actor> pufftype = "BulletPuff", float range = 0, int flags = 0, int ptr = AAPTR_TARGET, class<Actor> missile = "", float Spawnheight = 32, float Spawnofs_xy = 0);
native void A_CustomRailgun(int damage, int spawnofs_xy = 0, color color1 = "", color color2 = "", int flags = 0, int aim = 0, float maxdiff = 0, class<Actor> pufftype = "BulletPuff", float/*angle*/ spread_xy = 0, float/*angle*/ spread_z = 0, float range = 0, int duration = 0, float sparsity = 1.0, float driftspeed = 1.0, class<Actor> spawnclass = "none", float spawnofs_z = 0, int spiraloffset = 270, int limit = 0);
native state A_JumpIfHealthLower(int health, state label, int ptr_selector = AAPTR_DEFAULT);
native state A_JumpIfCloser(float distance, state label, bool noz = false);
native state A_JumpIfTracerCloser(float distance, state label, bool noz = false);
native state A_JumpIfMasterCloser(float distance, state label, bool noz = false);
native state A_JumpIfTargetOutsideMeleeRange(state label);
native state A_JumpIfTargetInsideMeleeRange(state label);
native state A_JumpIfInventory(class<Inventory> itemtype, int itemamount, state label, int owner = AAPTR_DEFAULT);
native state A_JumpIfArmorType(name Type, state label, int amount = 1);
action native bool A_SetInventory(class<Inventory> itemtype, int amount, int ptr = AAPTR_DEFAULT, bool beyondMax = false);
native bool A_GiveInventory(class<Inventory> itemtype, int amount = 0, int giveto = AAPTR_DEFAULT);
native bool A_TakeInventory(class<Inventory> itemtype, int amount = 0, int flags = 0, int giveto = AAPTR_DEFAULT);
action native bool A_SpawnItem(class<Actor> itemtype = "Unknown", float distance = 0, float zheight = 0, bool useammo = true, bool transfer_translation = false);
native bool A_SpawnItemEx(class<Actor> itemtype, float xofs = 0, float yofs = 0, float zofs = 0, float xvel = 0, float yvel = 0, float zvel = 0, float angle = 0, int flags = 0, int failchance = 0, int tid=0);
native void A_Print(string whattoprint, float time = 0, name fontname = "");
native void A_PrintBold(string whattoprint, float time = 0, name fontname = "");
native void A_Log(string whattoprint);
native void A_LogInt(int whattoprint);
native void A_LogFloat(float whattoprint);
native void A_SetTranslucent(float alpha, int style = 0);
native void A_SetRenderStyle(float alpha, int style);
action native A_FadeIn(float reduce = 0.1, int flags = 0);
action native A_FadeOut(float reduce = 0.1, int flags = 1); //bool remove == true
native void A_FadeTo(float target, float amount = 0.1, int flags = 0);
native void A_SetScale(float scalex, float scaley = 0, int ptr = AAPTR_DEFAULT, bool usezero = false);
native void A_SetMass(int mass);
native void A_SpawnDebris(class<Actor> spawntype, bool transfer_translation = false, float mult_h = 1, float mult_v = 1);
native void A_SpawnParticle(color color1, int flags = 0, int lifetime = 35, float size = 1, float angle = 0, float xoff = 0, float yoff = 0, float zoff = 0, float velx = 0, float vely = 0, float velz = 0, float accelx = 0, float accely = 0, float accelz = 0, float startalphaf = 1, float fadestepf = -1, float sizestep = 0);
native state A_CheckSight(state label);
native void A_ExtChase(bool usemelee, bool usemissile, bool playactive = true, bool nightmarefast = false);
native void A_DropInventory(class<Inventory> itemtype);
native void A_SetBlend(color color1, float alpha, int tics, color color2 = "");
native void A_ChangeFlag(string flagname, bool value);
native state A_CheckFlag(string flagname, state label, int check_pointer = AAPTR_DEFAULT);
native state A_JumpIf(bool expression, state label);
action native A_RaiseMaster(bool copy = 0);
action native A_RaiseChildren(bool copy = 0);
action native A_RaiseSiblings(bool copy = 0);
native state A_CheckFloor(state label);
native state A_CheckCeiling(state label);
native state A_PlayerSkinCheck(state label);
native void A_BasicAttack(int meleedamage, sound meleesound, class<actor> missiletype, float missileheight);
action native state, bool A_Teleport(state teleportstate = "", class<SpecialSpot> targettype = "BossSpot", class<Actor> fogtype = "TeleportFog", int flags = 0, float mindist = 0, float maxdist = 0, int ptr = AAPTR_DEFAULT);
action native state, bool A_Warp(int ptr_destination, float xofs = 0, float yofs = 0, float zofs = 0, float angle = 0, int flags = 0, state success_state = "", float heightoffset = 0, float radiusoffset = 0, float pitch = 0);
action native bool A_ThrowGrenade(class<Actor> itemtype, float zheight = 0, float xyvel = 0, float zvel = 0, bool useammo = true);
native void A_Weave(int xspeed, int yspeed, float xdist, float ydist);
native void A_Recoil(float xyvel);
native state A_JumpIfInTargetInventory(class<Inventory> itemtype, int amount, state label, int forward_ptr = AAPTR_DEFAULT);
native bool A_GiveToTarget(class<Inventory> itemtype, int amount = 0, int forward_ptr = AAPTR_DEFAULT);
native bool A_TakeFromTarget(class<Inventory> itemtype, int amount = 0, int flags = 0, int forward_ptr = AAPTR_DEFAULT);
native int A_RadiusGive(class<Inventory> itemtype, float distance, int flags, int amount = 0, class<Actor> filter = "None", name species = "None", float mindist = 0, int limit = 0);
native state A_CheckSpecies(state jump, name species = "", int ptr = AAPTR_DEFAULT);
native void A_CountdownArg(int argnum, state targstate = "");
action native A_CustomMeleeAttack(int damage = 0, sound meleesound = "", sound misssound = "", name damagetype = "none", bool bleed = true);
native void A_CustomComboAttack(class<Actor> missiletype, float spawnheight, int damage, sound meleesound = "", name damagetype = "none", bool bleed = true);
native void A_Burst(class<Actor> chunktype);
action native A_Blast(int flags = 0, float strength = 255, float radius = 255, float speed = 20, class<Actor> blasteffect = "BlastEffect", sound blastsound = "BlastRadius");
action native A_RadiusThrust(int force = 128, int distance = -1, int flags = RTF_AFFECTSOURCE, int fullthrustdistance = 0);
action native A_RadiusDamageSelf(int damage = 128, float distance = 128, int flags = 0, class<Actor> flashtype = "None");
action native int A_Explode(int damage = -1, int distance = -1, int flags = XF_HURTSOURCE, bool alert = false, int fulldamagedistance = 0, int nails = 0, int naildamage = 10, class<Actor> pufftype = "BulletPuff", name damagetype = "none");
action native A_Stop();
action native A_Respawn(int flags = 1);
action native A_BarrelDestroy();
action native A_QueueCorpse();
action native A_DeQueueCorpse();
action native A_LookEx(int flags = 0, float minseedist = 0, float maxseedist = 0, float maxheardist = 0, float fov = 0, state label = "");
action native A_ClearLastHeard();
action native A_ClearTarget();
native state A_CheckLOF(state jump, int flags = 0, float range = 0, float minrange = 0, float angle = 0, float pitch = 0, float offsetheight = 0, float offsetwidth = 0, int ptr_target = AAPTR_DEFAULT, float offsetforward = 0);
native state A_JumpIfTargetInLOS (state label, float/*angle*/ fov = 0, int flags = 0, float dist_max = 0, float dist_close = 0);
native state A_JumpIfInTargetLOS (state label, float/*angle*/ fov = 0, int flags = 0, float dist_max = 0, float dist_close = 0);
native bool A_SelectWeapon(class<Weapon> whichweapon, int flags = 0);
action native A_Punch();
action native A_Feathers();
action native A_ClassBossHealth();
action native A_ShootGun();
action native A_RocketInFlight();
action native A_Bang4Cloud();
action native A_DropFire();
native void A_GiveQuestItem(int itemno);
action native A_RemoveForcefield();
native void A_DropWeaponPieces(class<Actor> p1, class<Actor> p2, class<Actor> p3);
action native A_PigPain ();
native state A_MonsterRefire(int chance, state label);
action native A_SetAngle(float angle = 0, int flags = 0, int ptr = AAPTR_DEFAULT);
native void A_SetPitch(float pitch, int flags = 0, int ptr = AAPTR_DEFAULT);
native void A_SetRoll(float/*angle*/ roll, int flags = 0, int ptr = AAPTR_DEFAULT);
native void A_ScaleVelocity(float scale, int ptr = AAPTR_DEFAULT);
action native A_ChangeVelocity(float x = 0, float y = 0, float z = 0, int flags = 0, int ptr = AAPTR_DEFAULT);
native void A_SetArg(int pos, int value);
native void A_SetUserVar(name varname, int value);
native void A_SetUserArray(name varname, int index, int value);
native void A_SetUserVarFloat(name varname, float value);
native void A_SetUserArrayFloat(name varname, int index, float value);
native void A_SetSpecial(int spec, int arg0 = 0, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0);
native void A_Quake(int intensity, int duration, int damrad, int tremrad, sound sfx = "world/quake");
native void A_QuakeEx(int intensityX, int intensityY, int intensityZ, int duration, int damrad, int tremrad, sound sfx = "world/quake", int flags = 0, float mulWaveX = 1, float mulWaveY = 1, float mulWaveZ = 1, int falloff = 0, int highpoint = 0, float rollIntensity = 0, float rollWave = 0);
action native A_SetTics(int tics);
native void A_SetDamageType(name damagetype);
native void A_DropItem(class<Actor> item, int dropamount = -1, int chance = 256);
native void A_SetSpeed(float speed, int ptr = AAPTR_DEFAULT);
native void A_SetFloatSpeed(float speed, int ptr = AAPTR_DEFAULT);
native void A_SetPainThreshold(int threshold, int ptr = AAPTR_DEFAULT);
native void A_DamageSelf(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
native void A_DamageTarget(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
native void A_DamageMaster(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
native void A_DamageTracer(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
native void A_DamageChildren(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
native void A_DamageSiblings(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
action native A_KillTarget(name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
action native A_KillMaster(name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
action native A_KillTracer(name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
action native A_KillChildren(name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
action native A_KillSiblings(name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
action native A_RemoveTarget(int flags = 0, class<Actor> filter = "None", name species = "None");
action native A_RemoveMaster(int flags = 0, class<Actor> filter = "None", name species = "None");
action native A_RemoveTracer(int flags = 0, class<Actor> filter = "None", name species = "None");
action native A_RemoveChildren(bool removeall = false, int flags = 0, class<Actor> filter = "None", name species = "None");
action native A_RemoveSiblings(bool removeall = false, int flags = 0, class<Actor> filter = "None", name species = "None");
native void A_Remove(int removee, int flags = 0, class<Actor> filter = "None", name species = "None");
native int A_GiveToChildren(class<Inventory> itemtype, int amount = 0);
native int A_GiveToSiblings(class<Inventory> itemtype, int amount = 0);
native int A_TakeFromChildren(class<Inventory> itemtype, int amount = 0);
native int A_TakeFromSiblings(class<Inventory> itemtype, int amount = 0);
native void A_SetTeleFog(class<Actor> oldpos, class<Actor> newpos);
action native A_SwapTeleFog();
native void A_SetFloatBobPhase(int bob);
native void A_SetHealth(int health, int ptr = AAPTR_DEFAULT);
action native A_ResetHealth(int ptr = AAPTR_DEFAULT);
native state A_JumpIfHigherOrLower(state high, state low, float offsethigh = 0, float offsetlow = 0, bool includeHeight = true, int ptr = AAPTR_TARGET);
native void A_SetSpecies(name species, int ptr = AAPTR_DEFAULT);
native void A_SetRipperLevel(int level);
native void A_SetRipMin(int mininum);
native void A_SetRipMax(int maximum);
native void A_SetChaseThreshold(int threshold, bool def = false, int ptr = AAPTR_DEFAULT);
native state A_CheckProximity(state jump, class<Actor> classname, float distance, int count = 1, int flags = 0, int ptr = AAPTR_DEFAULT);
native state A_CheckBlock(state block, int flags = 0, int ptr = AAPTR_DEFAULT, float xofs = 0, float yofs = 0, float zofs = 0, float angle = 0);
native state A_CheckSightOrRange(float distance, state label, bool two_dimension = false);
native state A_CheckRange(float distance, state label, bool two_dimension = false);
action native bool A_FaceMovementDirection(float offset = 0, float anglelimit = 0, float pitchlimit = 0, int flags = 0, int ptr = AAPTR_DEFAULT);
action native int A_ClearOverlays(int sstart = 0, int sstop = 0, bool safety = true);
action native bool A_CopySpriteFrame(int from, int to, int flags = 0);
action native bool A_SetSpriteAngle(float angle = 0, int ptr = AAPTR_DEFAULT);
action native bool A_SetSpriteRotation(float angle = 0, int ptr = AAPTR_DEFAULT);
action native bool A_SetVisibleRotation(float anglestart = 0, float angleend = 0, float pitchstart = 0, float pitchend = 0, int flags = 0, int ptr = AAPTR_DEFAULT);
native void A_SetTranslation(string transname);
native void A_RearrangePointers(int newtarget, int newmaster = AAPTR_DEFAULT, int newtracer = AAPTR_DEFAULT, int flags=0);
native void A_TransferPointer(int ptr_source, int ptr_recepient, int sourcefield, int recepientfield=AAPTR_DEFAULT, int flags=0);
action native A_CopyFriendliness(int ptr_source = AAPTR_MASTER);
action native bool A_Overlay(int layer, state start = "", bool nooverride = false);
action native A_WeaponOffset(float wx = 0, float wy = 32, int flags = 0);
action native A_OverlayOffset(int layer = PSP_WEAPON, float wx = 0, float wy = 32, int flags = 0);
action native A_OverlayFlags(int layer, int flags, bool set);
native int ACS_NamedExecute(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0);
native int ACS_NamedSuspend(name script, int mapnum=0);
native int ACS_NamedTerminate(name script, int mapnum=0);
native int ACS_NamedLockedExecute(name script, int mapnum=0, int arg1=0, int arg2=0, int lock=0);
native int ACS_NamedLockedExecuteDoor(name script, int mapnum=0, int arg1=0, int arg2=0, int lock=0);
native int ACS_NamedExecuteWithResult(name script, int arg1=0, int arg2=0, int arg3=0, int arg4=0);
native void ACS_NamedExecuteAlways(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0);
States
{
Spawn:
TNT1 A -1
Stop
Null:
TNT1 A 1
Stop
GenericFreezeDeath:
// Generic freeze death frames. Woo!
"####" "#" 5 A_GenericFreezeDeath
"----" A 1 A_FreezeDeathChunks
Wait
GenericCrush:
POL5 A -1
Stop
}
// Internal functions
native state __decorate_internal_state__(state);
native int __decorate_internal_int__(int);
native bool __decorate_internal_bool__(bool);
native float __decorate_internal_float__(float);
}

View file

@ -1,376 +0,0 @@
ACTOR Inventory native
{
Inventory.Amount 1
Inventory.MaxAmount 1
Inventory.InterHubAmount 1
Inventory.UseSound "misc/invuse"
Inventory.PickupSound "misc/i_pkup"
Inventory.PickupMessage "$TXT_DEFAULTPICKUPMSG"
action native state A_JumpIfNoAmmo(state label);
action native A_CustomPunch(int damage, bool norandom = false, int flags = CPF_USEAMMO, class<Actor> pufftype = "BulletPuff", float range = 0, float lifesteal = 0, int lifestealmax = 0, class<BasicArmorBonus> armorbonustype = "ArmorBonus", sound MeleeSound = "", sound MissSound = "");
action native A_FireBullets(float/*angle*/ spread_xy, float/*angle*/ spread_z, int numbullets, int damageperbullet, class<Actor> pufftype = "BulletPuff", int flags = 1, float range = 0, class<Actor> missile = "", float Spawnheight = 32, float Spawnofs_xy = 0);
action native A_FireCustomMissile(class<Actor> missiletype, float angle = 0, bool useammo = true, float spawnofs_xy = 0, float spawnheight = 0, int flags = 0, float pitch = 0);
action native A_RailAttack(int damage, int spawnofs_xy = 0, bool useammo = true, color color1 = "", color color2 = "", int flags = 0, float maxdiff = 0, class<Actor> pufftype = "BulletPuff", float/*angle*/ spread_xy = 0, float/*angle*/ spread_z = 0, float range = 0, int duration = 0, float sparsity = 1.0, float driftspeed = 1.0, class<Actor> spawnclass = "none", float spawnofs_z = 0, int spiraloffset = 270, int limit = 0);
action native A_Light(int extralight);
action native A_Light0();
action native A_Light1();
action native A_Light2();
action native A_LightInverse();
action native A_WeaponReady(int flags = 0);
action native A_Lower();
action native A_Raise();
action native A_FirePistol();
action native A_FireShotgun();
action native A_FireShotgun2();
action native A_OpenShotgun2();
action native A_LoadShotgun2();
action native A_CloseShotgun2();
action native A_FireCGun();
action native A_FireSTGrenade(class<Actor> grenadetype = "Grenade");
action native A_FireMissile();
action native A_FirePlasma();
action native A_FireRailgun();
action native A_FireRailgunLeft();
action native A_FireRailgunRight();
action native A_RailWait();
action native A_BFGsound();
action native A_FireBFG();
action native A_FireOldBFG();
action native A_ReFire(state flash = "");
action native A_ClearReFire();
action native A_CheckReload();
action native A_GunFlash(state flash = "", int flags = 0);
action native A_Saw(sound fullsound = "weapons/sawfull", sound hitsound = "weapons/sawhit", int damage = 2, class<Actor> pufftype = "BulletPuff", int flags = 0, float range = 0, float/*angle*/ spread_xy = 2.8125, float/*angle*/ spread_z = 0, float lifesteal = 0, int lifestealmax = 0, class<BasicArmorBonus> armorbonustype = "ArmorBonus");
action native state A_CheckForReload(int counter, state label, bool dontincrement = false);
action native A_ResetReloadCounter();
action native A_RestoreSpecialPosition();
action native A_RestoreSpecialDoomThing();
action native A_RestoreSpecialThing1();
action native A_RestoreSpecialThing2();
States
{
HideDoomish:
TNT1 A 1050
TNT1 A 0 A_RestoreSpecialPosition
TNT1 A 1 A_RestoreSpecialDoomThing
Stop
HideSpecial:
ACLO E 1400
ACLO A 0 A_RestoreSpecialPosition
ACLO A 4 A_RestoreSpecialThing1
ACLO BABCBCDC 4
ACLO D 4 A_RestoreSpecialThing2
Stop
Held:
TNT1 A -1
Stop
HoldAndDestroy:
TNT1 A 1
Stop
}
}
Actor ScoreItem : Inventory native
{
Height 10
+COUNTITEM
Inventory.Amount 1
+Inventory.ALWAYSPICKUP
}
Actor Ammo : Inventory native
{
+INVENTORY.KEEPDEPLETED
Inventory.PickupSound "misc/ammo_pkup"
}
Actor BackpackItem : Inventory native
{
}
ACTOR Armor : Inventory native
{
Inventory.PickupSound "misc/armor_pkup"
}
ACTOR BasicArmor : Armor native
{
+Inventory.KEEPDEPLETED
}
ACTOR BasicArmorBonus : Armor native
{
+Inventory.AUTOACTIVATE
+Inventory.ALWAYSPICKUP
Inventory.MaxAmount 0
Armor.SavePercent 33.335
}
ACTOR BasicArmorPickup : Armor native
{
+Inventory.AUTOACTIVATE
Inventory.MaxAmount 0
}
ACTOR HexenArmor : Armor native
{
+Inventory.KEEPDEPLETED
+Inventory.UNDROPPABLE
}
ACTOR DehackedPickup : Inventory native {}
ACTOR FakeInventory : Inventory native {}
ACTOR CustomInventory : Inventory native {}
Actor Health : Inventory native
{
Inventory.Amount 1
Inventory.MaxAmount 0
Inventory.PickupSound "misc/health_pkup"
}
Actor HealthPickup : Inventory native
{
Inventory.DefMaxAmount
+INVENTORY.INVBAR
}
Actor Key : Inventory native
{
+DONTGIB // Don't disappear due to a crusher
+INVENTORY.INTERHUBSTRIP
Inventory.PickupSound "misc/k_pkup"
}
ACTOR PowerupGiver : Inventory native
{
Inventory.DefMaxAmount
+INVENTORY.INVBAR
+INVENTORY.FANCYPICKUPSOUND
Inventory.PickupSound "misc/p_pkup"
}
ACTOR Powerup : Inventory native {}
ACTOR PowerInvulnerable : Powerup native
{
Powerup.Duration -30
inventory.icon "SPSHLD0"
}
ACTOR PowerStrength : Powerup native
{
Powerup.Duration 1
Powerup.Color 255,0,0,0.5
+INVENTORY.HUBPOWER
}
ACTOR PowerInvisibility : Powerup native
{
+SHADOW
Powerup.Duration -60
Powerup.Strength 80
Powerup.Mode "Fuzzy"
}
ACTOR PowerGhost : PowerInvisibility
{
+GHOST
Powerup.Duration -60
Powerup.Strength 60
Powerup.Mode "None"
}
ACTOR PowerShadow : PowerInvisibility
{
+INVENTORY.HUBPOWER
Powerup.Duration -55
Powerup.Strength 75
Powerup.Mode "Cumulative"
}
ACTOR PowerIronFeet : Powerup native
{
Powerup.Duration -60
Powerup.Color 0, 255, 0, 0.125
}
ACTOR PowerMask : PowerIronFeet native
{
Powerup.Duration -80
Powerup.Color 0,0,0,0
+INVENTORY.HUBPOWER
Inventory.Icon "I_MASK"
}
ACTOR PowerLightAmp : Powerup native
{
Powerup.Duration -120
}
ACTOR PowerTorch : PowerLightAmp native {}
ACTOR PowerFlight : Powerup native
{
Powerup.Duration -60
+INVENTORY.HUBPOWER
}
ACTOR PowerWeaponLevel2 : Powerup native
{
Powerup.Duration -40
Inventory.Icon "SPINBK0"
+INVENTORY.NOTELEPORTFREEZE
}
ACTOR PowerSpeed : Powerup native
{
Powerup.Duration -45
Speed 1.5
Inventory.Icon "SPBOOT0"
+INVENTORY.NOTELEPORTFREEZE
}
// Player Speed Trail (used by the Speed Powerup) ----------------------------
ACTOR PlayerSpeedTrail native
{
+NOBLOCKMAP
+NOGRAVITY
Alpha 0.6
RenderStyle Translucent
}
ACTOR PowerMinotaur : Powerup native
{
Powerup.Duration -25
Inventory.Icon "SPMINO0"
}
ACTOR PowerTargeter : Powerup native
{
Powerup.Duration -160
+INVENTORY.HUBPOWER
States
{
Targeter:
TRGT A -1
Stop
TRGT B -1
Stop
TRGT C -1
Stop
}
}
ACTOR PowerFrightener : Powerup native
{
Powerup.Duration -60
}
ACTOR PowerBuddha : Powerup native
{
Powerup.Duration -60
}
ACTOR PowerScanner : Powerup native
{
Powerup.Duration -80
+INVENTORY.HUBPOWER
}
ACTOR PowerTimeFreezer : Powerup native
{
Powerup.Duration -12
}
ACTOR PowerDamage : Powerup native
{
Powerup.Duration -25
}
ACTOR PowerProtection : Powerup native
{
Powerup.Duration -25
}
ACTOR PowerDrain : Powerup native
{
Powerup.Duration -60
}
ACTOR PowerRegeneration : Powerup native
{
Powerup.Duration -120
Powerup.Strength 5
}
ACTOR PowerHighJump : Powerup native {}
ACTOR PowerDoubleFiringSpeed : Powerup native {}
ACTOR PowerMorph : Powerup native
{
Powerup.Duration -40
}
ACTOR PowerInfiniteAmmo : Powerup native
{
Powerup.Duration -30
}
ACTOR MapRevealer : Inventory native {}
ACTOR PuzzleItem : Inventory native
{
+NOGRAVITY
+INVENTORY.INVBAR
Inventory.DefMaxAmount
Inventory.UseSound "PuzzleSuccess"
Inventory.PickupSound "misc/i_pkup"
}
Actor Weapon : Inventory native
{
Inventory.PickupSound "misc/w_pkup"
Weapon.DefaultKickback
Weapon.BobSpeed 1.0
Weapon.BobRangeX 1.0
Weapon.BobRangeY 1.0
+WEAPONSPAWN
States
{
LightDone:
SHTG E 0 A_Light0
Stop
}
action native A_ZoomFactor(float scale = 1, int flags = 0);
const int ZOOM_INSTANT = 1;
const int ZOOM_NOSCALETURNING = 2;
action native A_SetCrosshair(int xhair);
}
ACTOR WeaponGiver : Weapon native
{
Weapon.AmmoGive1 -1
Weapon.AmmoGive2 -1
}
Actor WeaponHolder : Inventory native
{
+NOBLOCKMAP
+NOSECTOR
+INVENTORY.UNDROPPABLE
}
Actor WeaponPiece : Inventory native
{
+WEAPONSPAWN
}

View file

@ -1,52 +0,0 @@
Actor PlayerPawn : Actor native
{
Health 100
Radius 16
Height 56
Mass 100
Painchance 255
Speed 1
+SOLID
+SHOOTABLE
+DROPOFF
+PICKUP
+NOTDMATCH
+FRIENDLY
+SLIDESONWALLS
+CANPASS
+CANPUSHWALLS
+FLOORCLIP
+WINDTHRUST
+TELESTOMP
+NOBLOCKMONST
Player.AttackZOffset 8
Player.JumpZ 8
Player.GruntSpeed 12
Player.FallingScreamSpeed 35,40
Player.ViewHeight 41
Player.UseRange 64
Player.ForwardMove 1,1
Player.SideMove 1,1
Player.ColorRange 0,0
Player.SoundClass "player"
Player.DamageScreenColor "ff 00 00"
Player.MugShotMaxHealth 0
Player.FlechetteType "ArtiPoisonBag3"
Player.AirCapacity 1
Obituary "$OB_MPDEFAULT"
}
Actor PlayerChunk : PlayerPawn native
{
+NOSKIN
-SOLID
-SHOOTABLE
-PICKUP
-NOTDMATCH
-FRIENDLY
-SLIDESONWALLS
-CANPUSHWALLS
-FLOORCLIP
-WINDTHRUST
-TELESTOMP
}

View file

@ -1,5 +0,0 @@
ACTOR SpecialSpot native
{
action native A_SpawnSingleItem(class<Actor> type, int fail_sp = 0, int fail_co = 0, int fail_dm = 0);
}

View file

@ -1,7 +1,7 @@
#include "actors/actor.txt"
//#include "actors/actor.txt"
#include "actors/shared/inventory.txt"
#include "actors/shared/player.txt"
//#include "actors/shared/inventory.txt"
//#include "actors/shared/player.txt"
#include "actors/shared/morph.txt"
#include "actors/shared/botstuff.txt"
#include "actors/shared/sharedmisc.txt"
@ -15,7 +15,7 @@
#include "actors/shared/soundsequence.txt"
#include "actors/shared/soundenvironment.txt"
#include "actors/shared/bridge.txt"
#include "actors/shared/specialspot.txt"
//#include "actors/shared/specialspot.txt"
#include "actors/shared/teleport.txt"
#include "actors/shared/camera.txt"
#include "actors/shared/movingcamera.txt"

View file

@ -0,0 +1,9 @@
zscript/constants.txt
zscript/actor.txt
zscript/shared/inventory.txt
zscript/shared/player.txt
zscript/shared/specialspot.txt
//zscript/test1.txt

View file

@ -387,13 +387,6 @@ class Actor : Thinker native
GenericCrush:
POL5 A -1;
Stop;
Test.State:
&&&& A[\] 5 offset(4,4*2);
&&&& A[\] DEFAULT_HEALTH;
abcd efgh random(3, 6);
lght blahblah 5*3 light("furz", "bläh", "rülps");
lght blahblah 5 light("boing");
goto Actor::Spawn+1;
}
// Internal functions

View file

@ -0,0 +1,501 @@
class Inventory : Actor native
{
Default
{
Inventory.Amount 1;
Inventory.MaxAmount 1;
Inventory.InterHubAmount 1;
Inventory.UseSound "misc/invuse";
Inventory.PickupSound "misc/i_pkup";
Inventory.PickupMessage "$TXT_DEFAULTPICKUPMSG";
}
// functions that can be used from weapons and CustomInventory. These require that 'self' is of type class and be treated as such in the scripts.
/*inventory*/ action native state A_JumpIfNoAmmo(state label);
/*inventory*/ action native void A_CustomPunch(int damage, bool norandom = false, int flags = CPF_USEAMMO, class<Actor> pufftype = "BulletPuff", float range = 0, float lifesteal = 0, int lifestealmax = 0, class<BasicArmorBonus> armorbonustype = "ArmorBonus", sound MeleeSound = "", sound MissSound = "");
/*inventory*/ action native void A_FireBullets(float spread_xy, float spread_z, int numbullets, int damageperbullet, class<Actor> pufftype = "BulletPuff", int flags = 1, float range = 0, class<Actor> missile = "", float Spawnheight = 32, float Spawnofs_xy = 0);
/*inventory*/ action native void A_FireCustomMissile(class<Actor> missiletype, float angle = 0, bool useammo = true, float spawnofs_xy = 0, float spawnheight = 0, int flags = 0, float pitch = 0);
/*inventory*/ action native void A_RailAttack(int damage, int spawnofs_xy = 0, bool useammo = true, color color1 = "", color color2 = "", int flags = 0, float maxdiff = 0, class<Actor> pufftype = "BulletPuff", float spread_xy = 0, float spread_z = 0, float range = 0, int duration = 0, float sparsity = 1.0, float driftspeed = 1.0, class<Actor> spawnclass = "none", float spawnofs_z = 0, int spiraloffset = 270, int limit = 0);
/*inventory*/ action native void A_Light(int extralight);
/*inventory*/ action native void A_Light0();
/*inventory*/ action native void A_Light1();
/*inventory*/ action native void A_Light2();
/*inventory*/ action native void A_LightInverse();
/*inventory*/ action native void A_WeaponReady(int flags = 0);
/*inventory*/ action native void A_Lower();
/*inventory*/ action native void A_Raise();
/*inventory*/ action native void A_FirePistol();
/*inventory*/ action native void A_FireShotgun();
/*inventory*/ action native void A_FireShotgun2();
/*inventory*/ action native void A_OpenShotgun2();
/*inventory*/ action native void A_LoadShotgun2();
/*inventory*/ action native void A_CloseShotgun2();
/*inventory*/ action native void A_FireCGun();
/*inventory*/ action native void A_FireSTGrenade(class<Actor> grenadetype = "Grenade");
/*inventory*/ action native void A_FireMissile();
/*inventory*/ action native void A_FirePlasma();
/*inventory*/ action native void A_FireRailgun();
/*inventory*/ action native void A_FireRailgunLeft();
/*inventory*/ action native void A_FireRailgunRight();
/*inventory*/ action native void A_RailWait();
/*inventory*/ action native void A_BFGsound();
/*inventory*/ action native void A_FireBFG();
/*inventory*/ action native void A_FireOldBFG();
/*inventory*/ action native void A_ReFire(state flash = "");
/*inventory*/ action native void A_ClearReFire();
/*inventory*/ action native void A_CheckReload();
/*inventory*/ action native void A_GunFlash(state flash = "", int flags = 0);
/*inventory*/ action native void A_Saw(sound fullsound = "weapons/sawfull", sound hitsound = "weapons/sawhit", int damage = 2, class<Actor> pufftype = "BulletPuff", int flags = 0, float range = 0, float spread_xy = 2.8125, float spread_z = 0, float lifesteal = 0, int lifestealmax = 0, class<BasicArmorBonus> armorbonustype = "ArmorBonus");
/*inventory*/ action native state A_CheckForReload(int counter, state label, bool dontincrement = false);
/*inventory*/ action native void A_ResetReloadCounter();
// These are regular functions for the item itself.
action native void A_RestoreSpecialPosition();
action native void A_RestoreSpecialDoomThing();
action native void A_RestoreSpecialThing1();
action native void A_RestoreSpecialThing2();
States
{
HideDoomish:
TNT1 A 1050;
TNT1 A 0 A_RestoreSpecialPosition;
TNT1 A 1 A_RestoreSpecialDoomThing;
Stop;
HideSpecial:
ACLO E 1400;
ACLO A 0 A_RestoreSpecialPosition;
ACLO A 4 A_RestoreSpecialThing1;
ACLO BABCBCDC 4;
ACLO D 4 A_RestoreSpecialThing2;
Stop;
Held:
TNT1 A -1;
Stop;
HoldAndDestroy:
TNT1 A 1;
Stop;
}
}
class ScoreItem : Inventory native
{
Default
{
Height 10;
+COUNTITEM;
Inventory.Amount 1;
+Inventory.ALWAYSPICKUP;
}
}
class Ammo : Inventory native
{
Default
{
+INVENTORY.KEEPDEPLETED;
Inventory.PickupSound "misc/ammo_pkup";
}
}
class BackpackItem : Inventory native
{
}
class Armor : Inventory native
{
Default
{
Inventory.PickupSound "misc/armor_pkup";
}
}
class BasicArmor : Armor native
{
Default
{
+Inventory.KEEPDEPLETED;
}
}
class BasicArmorBonus : Armor native
{
Default
{
+Inventory.AUTOACTIVATE;
+Inventory.ALWAYSPICKUP;
Inventory.MaxAmount 0;
Armor.SavePercent 33.335;
}
}
class BasicArmorPickup : Armor native
{
Default
{
+Inventory.AUTOACTIVATE;
Inventory.MaxAmount 0;
}
}
class HexenArmor : Armor native
{
Default
{
+Inventory.KEEPDEPLETED;
+Inventory.UNDROPPABLE;
}
}
class DehackedPickup : Inventory native {}
class FakeInventory : Inventory native {}
class CustomInventory : Inventory native {}
class Health : Inventory native
{
Default
{
Inventory.Amount 1;
Inventory.MaxAmount 0;
Inventory.PickupSound "misc/health_pkup";
}
}
class HealthPickup : Inventory native
{
Default
{
Inventory.DefMaxAmount;
+INVENTORY.INVBAR;
}
}
class Key : Inventory native
{
Default
{
+DONTGIB; // Don't disappear due to a crusher
Inventory.InterHubAmount 0;
Inventory.PickupSound "misc/k_pkup";
}
}
class PowerupGiver : Inventory native
{
Default
{
Inventory.DefMaxAmount;
+INVENTORY.INVBAR;
+INVENTORY.FANCYPICKUPSOUND;
Inventory.PickupSound "misc/p_pkup";
}
}
class Powerup : Inventory native {}
class PowerInvulnerable : Powerup native
{
Default
{
Powerup.Duration -30;
inventory.icon "SPSHLD0";
}
}
class PowerStrength : Powerup native
{
Default
{
Powerup.Duration 1;
Powerup.Color "ff 00 00", 0.5;
+INVENTORY.HUBPOWER;
}
}
class PowerInvisibility : Powerup native
{
Default
{
+SHADOW;
Powerup.Duration -60;
Powerup.Strength 80;
Powerup.Mode "Fuzzy";
}
}
class PowerGhost : PowerInvisibility
{
Default
{
+GHOST;
Powerup.Duration -60;
Powerup.Strength 60;
Powerup.Mode "None";
}
}
class PowerShadow : PowerInvisibility
{
Default
{
+INVENTORY.HUBPOWER;
Powerup.Duration -55;
Powerup.Strength 75;
Powerup.Mode "Cumulative";
}
}
class PowerIronFeet : Powerup native
{
Default
{
Powerup.Duration -60;
Powerup.Color "00 ff 00", 0.125;
}
}
class PowerMask : PowerIronFeet native
{
Default
{
Powerup.Duration -80;
Powerup.Color "00 00 00", 0;
+INVENTORY.HUBPOWER;
Inventory.Icon "I_MASK";
}
}
class PowerLightAmp : Powerup native
{
Default
{
Powerup.Duration -120;
}
}
class PowerTorch : PowerLightAmp native {}
class PowerFlight : Powerup native
{
Default
{
Powerup.Duration -60;
+INVENTORY.HUBPOWER;
}
}
class PowerWeaponLevel2 : Powerup native
{
Default
{
Powerup.Duration -40;
Inventory.Icon "SPINBK0";
+INVENTORY.NOTELEPORTFREEZE;
}
}
class PowerSpeed : Powerup native
{
Default
{
Powerup.Duration -45;
Speed 1.5;
Inventory.Icon "SPBOOT0";
+INVENTORY.NOTELEPORTFREEZE;
}
}
// Player Speed Trail (used by the Speed Powerup) ----------------------------
class PlayerSpeedTrail native
{
Default
{
+NOBLOCKMAP;
+NOGRAVITY;
Alpha 0.6;
RenderStyle "Translucent";
}
}
class PowerMinotaur : Powerup native
{
Default
{
Powerup.Duration -25;
Inventory.Icon "SPMINO0";
}
}
class PowerTargeter : Powerup native
{
Default
{
Powerup.Duration -160;
+INVENTORY.HUBPOWER;
}
States
{
Targeter:
TRGT A -1;
Stop;
TRGT B -1;
Stop;
TRGT C -1;
Stop;
}
}
class PowerFrightener : Powerup native
{
Default
{
Powerup.Duration -60;
}
}
class PowerBuddha : Powerup native
{
Default
{
Powerup.Duration -60;
}
}
class PowerScanner : Powerup native
{
Default
{
Powerup.Duration -80;
+INVENTORY.HUBPOWER;
}
}
class PowerTimeFreezer : Powerup native
{
Default
{
Powerup.Duration -12;
}
}
class PowerDamage : Powerup native
{
Default
{
Powerup.Duration -25;
}
}
class PowerProtection : Powerup native
{
Default
{
Powerup.Duration -25;
}
}
class PowerDrain : Powerup native
{
Default
{
Powerup.Duration -60;
}
}
class PowerRegeneration : Powerup native
{
Default
{
Powerup.Duration -120;
Powerup.Strength 5;
}
}
class PowerHighJump : Powerup native {}
class PowerDoubleFiringSpeed : Powerup native {}
class PowerMorph : Powerup native
{
Default
{
Powerup.Duration -40;
}
}
class PowerInfiniteAmmo : Powerup native
{
Default
{
Powerup.Duration -30;
}
}
class MapRevealer : Inventory native {}
class PuzzleItem : Inventory native
{
Default
{
+NOGRAVITY;
+INVENTORY.INVBAR;
Inventory.DefMaxAmount;
Inventory.UseSound "PuzzleSuccess";
Inventory.PickupSound "misc/i_pkup";
}
}
class Weapon : Inventory native
{
Default
{
Inventory.PickupSound "misc/w_pkup";
Weapon.DefaultKickback;
Weapon.BobSpeed 1.0;
Weapon.BobRangeX 1.0;
Weapon.BobRangeY 1.0;
+WEAPONSPAWN;
}
States
{
LightDone:
SHTG E 0 A_Light0;
Stop;
}
/*inventory*/ action native void A_ZoomFactor(float scale = 1, int flags = 0);
const ZOOM_INSTANT = 1;
const ZOOM_NOSCALETURNING = 2;
/*inventory*/ action native void A_SetCrosshair(int xhair);
}
class WeaponGiver : Weapon native
{
Default
{
Weapon.AmmoGive1 -1;
Weapon.AmmoGive2 -1;
}
}
class WeaponHolder : Inventory native
{
Default
{
+NOBLOCKMAP;
+NOSECTOR;
+INVENTORY.UNDROPPABLE;
}
}
class WeaponPiece : Inventory native
{
Default
{
+WEAPONSPAWN;
}
}

View file

@ -0,0 +1,58 @@
class PlayerPawn : Actor native
{
Default
{
Health 100;
Radius 16;
Height 56;
Mass 100;
Painchance 255;
Speed 1;
+SOLID
+SHOOTABLE
+DROPOFF
+PICKUP
+NOTDMATCH
+FRIENDLY
+SLIDESONWALLS
+CANPASS
+CANPUSHWALLS
+FLOORCLIP
+WINDTHRUST
+TELESTOMP
+NOBLOCKMONST
Player.AttackZOffset 8;
Player.JumpZ 8;
Player.GruntSpeed 12;
Player.FallingScreamSpeed 35,40;
Player.ViewHeight 41;
Player.UseRange 64;
Player.ForwardMove 1,1;
Player.SideMove 1,1;
Player.ColorRange 0,0;
Player.SoundClass "player";
Player.DamageScreenColor "ff 00 00";
Player.MugShotMaxHealth 0;
Player.FlechetteType "ArtiPoisonBag3";
Player.AirCapacity 1;
Obituary "$OB_MPDEFAULT";
}
}
class PlayerChunk : PlayerPawn native
{
Default
{
+NOSKIN
-SOLID
-SHOOTABLE
-PICKUP
-NOTDMATCH
-FRIENDLY
-SLIDESONWALLS
-CANPUSHWALLS
-FLOORCLIP
-WINDTHRUST
-TELESTOMP
}
}

View file

@ -0,0 +1,5 @@
class SpecialSpot : Actor native
{
action native void A_SpawnSingleItem(class<Actor> type, int fail_sp = 0, int fail_co = 0, int fail_dm = 0);
}