diff --git a/docs/rh-log.txt b/docs/rh-log.txt index a27f31067..0a6ac35db 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,6 @@ August 11, 2008 (Changes by Graf Zahl) +- Removed 'eval' modifier from DECORATE. All int, float and bool parameters are + 'eval' now by default. - Did a thorough check of all DECORATE conversions and fixed the errors I found. August 10, 2008 (Changes by Graf Zahl) diff --git a/src/thingdef/thingdef.cpp b/src/thingdef/thingdef.cpp index 4fbbb228a..c956c287c 100644 --- a/src/thingdef/thingdef.cpp +++ b/src/thingdef/thingdef.cpp @@ -159,7 +159,6 @@ void ParseEnum (FScanner &sc, PSymbolTable *symt, PClass *cls) static void ParseActionDef (FScanner &sc, PClass *cls) { #define OPTIONAL 1 -#define EVAL 2 #define EVALNOT 4 AFuncDesc *afd; @@ -194,10 +193,6 @@ static void ParseActionDef (FScanner &sc, PClass *cls) { flags |= OPTIONAL; } - else if (sc.CheckToken(TK_Eval)) - { - flags |= EVAL; - } else if (sc.CheckToken(TK_EvalNot)) { flags |= EVALNOT; @@ -214,9 +209,12 @@ static void ParseActionDef (FScanner &sc, PClass *cls) sc.MustGetAnyToken(); switch (sc.TokenType) { - case TK_Bool: type = 'i'; break; - case TK_Int: type = 'i'; break; - case TK_Float: type = 'f'; break; + case TK_Bool: + case TK_Int: + case TK_Float: + type = (flags & EVALNOT)? 'y' : 'x'; + break; + case TK_Sound: type = 's'; break; case TK_String: type = 't'; break; case TK_Name: type = 't'; break; @@ -246,15 +244,6 @@ static void ParseActionDef (FScanner &sc, PClass *cls) { sc.UnGet(); } - // If eval or evalnot were a flag, hey the decorate parser doesn't actually care about the type. - if (flags & EVALNOT) - { - type = 'y'; - } - else if (flags & EVAL) - { - type = 'x'; - } if (!(flags & OPTIONAL) && type != '+') { type -= 'a' - 'A'; diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 13e7d00f0..07744821c 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -210,10 +210,10 @@ static void DoAttack (AActor *self, bool domelee, bool domissile) if (index > 0) { - MeleeDamage=StateParameters[index]; + MeleeDamage=EvalExpressionI(StateParameters[index], self); MeleeSound=StateParameters[index+1]; MissileName=(ENamedName)StateParameters[index+2]; - MissileHeight=StateParameters[index+3]; + MissileHeight=fixed_t(EvalExpressionF(StateParameters[index+3], self)/65536.f); } else { diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 1a23595b4..c1a8cecd4 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -19,12 +19,12 @@ ACTOR Actor native //: Thinker Gravity 1 action native A_MonsterRail(); - action native A_BFGSpray(optional class spraytype, optional eval int numrays, optional eval int damagecount); + action native A_BFGSpray(optional class spraytype, optional int numrays, optional int damagecount); action native A_Pain(); action native A_NoBlocking(); action native A_XScream(); action native A_Look(); - action native A_Chase(optional state melee, optional state missile, optional eval int flags); + action native A_Chase(optional state melee, optional state missile, optional int flags); action native A_FaceTarget(); action native A_PosAttack(); action native A_Scream(); @@ -52,7 +52,7 @@ ACTOR Actor native //: Thinker action native A_SargAttack(); action native A_HeadAttack(); action native A_BruisAttack(); - action native A_SkullAttack(optional eval float speed); + action native A_SkullAttack(optional float speed); action native A_Metal(); action native A_SpidRefire(); action native A_BabyMetal(); @@ -73,7 +73,7 @@ ACTOR Actor native //: Thinker action native A_BrainExplode(); action native A_Die(optional name damagetype); action native A_Detonate(); - action native A_Mushroom(optional class spawntype, optional eval int numspawns); + action native A_Mushroom(optional class spawntype, optional int numspawns); action native A_SetFloorClip(); action native A_UnSetFloorClip(); @@ -90,7 +90,7 @@ ACTOR Actor native //: Thinker action native A_NoGravity(); action native A_Gravity(); action native A_LowGravity(); - action native A_SetGravity(eval float gravity); + action native A_SetGravity(float gravity); action native A_Fall(); action native A_SetSolid(); action native A_UnsetSolid(); @@ -141,58 +141,58 @@ ACTOR Actor native //: Thinker action native A_FLoopActiveSound(); action native A_LoopActiveSound(); action native A_StopSound(); - action native A_PlaySoundEx(sound whattoplay, coerce name slot, optional eval bool looping, optional eval int attenuation); + action native A_PlaySoundEx(sound whattoplay, coerce name slot, optional bool looping, optional int attenuation); action native A_StopSoundEx(coerce name slot); - action native A_SeekerMissile(eval int threshold, eval int turnmax); - action native A_Jump(eval int chance, state label, ...); - action native A_CustomMissile(class missiletype, eval float spawnheight, eval int spawnofs_xy, optional eval float angle, optional eval int flags, optional eval float pitch); - action native A_CustomBulletAttack(eval float spread_xy, eval float spread_z, eval int numbullets, eval int damageperbullet, optional class pufftype, optional eval float range, optional eval bool aimfacing); - action native A_CustomRailgun(eval int damage, optional eval int spawnofs_xy, optional color color1, optional color color2, optional eval bool silent, optional eval bool aim, optional eval float maxdiff, optional class pufftype); - action native A_JumpIfHealthLower(eval int health, state label); - action native A_JumpIfCloser(eval float distance, state label); - action native A_JumpIfInventory(class itemtype, eval int itemamount, state label); - action native A_GiveInventory(class itemtype, optional eval int amount); - action native A_TakeInventory(class itemtype, optional eval int amount); - action native A_SpawnItem(class itemtype, optional eval float distance, optional eval float zheight, optional evalnot bool useammo, optional eval bool transfer_translation); - action native A_SpawnItemEx(class itemtype, optional eval float xofs, optional eval float yofs, optional eval float zofs, optional eval float xmom, optional eval float ymom, optional eval float zmom, optional eval float angle, optional eval int flags, optional eval int chance); - action native A_Print(string whattoprint, optional eval float time, optional string fontname); - action native A_SetTranslucent(eval float alpha, optional eval int style); - action native A_FadeIn(optional eval float reduce); - action native A_FadeOut(optional eval float reduce); - action native A_SpawnDebris(class spawntype, optional eval bool transfer_translation, optional eval float mult_h, optional eval float mult_v); + action native A_SeekerMissile(int threshold, int turnmax); + action native A_Jump(int chance, state label, ...); + action native A_CustomMissile(class missiletype, float spawnheight, int spawnofs_xy, optional float angle, optional int flags, optional float pitch); + action native A_CustomBulletAttack(float spread_xy, float spread_z, int numbullets, int damageperbullet, optional class pufftype, optional float range, optional bool aimfacing); + action native A_CustomRailgun(int damage, optional int spawnofs_xy, optional color color1, optional color color2, optional bool silent, optional bool aim, optional float maxdiff, optional class pufftype); + action native A_JumpIfHealthLower(int health, state label); + action native A_JumpIfCloser(float distance, state label); + action native A_JumpIfInventory(class itemtype, int itemamount, state label); + action native A_GiveInventory(class itemtype, optional int amount); + action native A_TakeInventory(class itemtype, optional int amount); + action native A_SpawnItem(class itemtype, optional float distance, optional float zheight, optional evalnot bool useammo, optional bool transfer_translation); + action native A_SpawnItemEx(class itemtype, optional float xofs, optional float yofs, optional float zofs, optional float xmom, optional float ymom, optional float zmom, optional float angle, optional int flags, optional int chance); + action native A_Print(string whattoprint, optional float time, optional string fontname); + action native A_SetTranslucent(float alpha, optional int style); + action native A_FadeIn(optional float reduce); + action native A_FadeOut(optional float reduce); + action native A_SpawnDebris(class spawntype, optional bool transfer_translation, optional float mult_h, optional float mult_v); action native A_CheckSight(state label); - action native A_ExtChase(eval bool usemelee, eval bool usemissile, optional evalnot bool playactive, optional eval bool nightmarefast); + action native A_ExtChase(bool usemelee, bool usemissile, optional evalnot bool playactive, optional bool nightmarefast); action native A_DropInventory(class itemtype); - action native A_SetBlend(color color1, eval float alpha, eval int tics, optional color color2); - action native A_ChangeFlag(string flagname, eval bool value); - action native A_JumpIf(eval bool expression, state label); + action native A_SetBlend(color color1, float alpha, int tics, optional color color2); + action native A_ChangeFlag(string flagname, bool value); + action native A_JumpIf(bool expression, state label); action native A_KillMaster(); action native A_KillChildren(); action native A_CheckFloor(state label); action native A_PlayerSkinCheck(state label); action native A_BasicAttack(int meleedamage, sound meleesound, class missiletype, float missileheight); - action native A_ThrowGrenade(class itemtype, optional eval float zheight, optional eval float xymom, optional eval float zmom, optional evalnot bool useammo); + action native A_ThrowGrenade(class itemtype, optional float zheight, optional float xymom, optional float zmom, optional evalnot bool useammo); - action native A_Recoil(eval float xymom); - action native A_JumpIfInTargetInventory(class itemtype, eval int amount, state label); - action native A_GiveToTarget(class itemtype, optional eval int amount); - action native A_TakeFromTarget(class itemtype, optional eval int amount); - action native A_CountdownArg(eval int argnum); - action native A_CustomMeleeAttack(eval int damage, optional sound meleesound, optional sound misssound, optional name damagetype, optional evalnot bool bleed); - action native A_CustomComboAttack(class missiletype, eval float spawnheight, eval int damage, optional sound meleesound, optional name damagetype, optional evalnot bool bleed); + action native A_Recoil(float xymom); + action native A_JumpIfInTargetInventory(class itemtype, int amount, state label); + action native A_GiveToTarget(class itemtype, optional int amount); + action native A_TakeFromTarget(class itemtype, optional int amount); + action native A_CountdownArg(int argnum); + action native A_CustomMeleeAttack(int damage, optional sound meleesound, optional sound misssound, optional name damagetype, optional evalnot bool bleed); + action native A_CustomComboAttack(class missiletype, float spawnheight, int damage, optional sound meleesound, optional name damagetype, optional evalnot bool bleed); action native A_Burst(class chunktype); - action native A_RadiusThrust(optional eval int force, optional eval int distance, optional evalnot bool affectsource); - action native A_Explode(optional eval int damage, optional eval int distance, optional evalnot bool hurtsource, optional eval bool alert); + action native A_RadiusThrust(optional int force, optional int distance, optional evalnot bool affectsource); + action native A_Explode(optional int damage, optional int distance, optional evalnot bool hurtsource, optional bool alert); action native A_Stop(); action native A_Respawn(optional evalnot bool fog); action native A_BarrelDestroy(); action native A_QueueCorpse(); action native A_DeQueueCorpse(); - action native A_LookEx(optional eval int flags, optional eval float minseedist, optional eval float maxseedist, optional eval float maxheardist, optional eval float fov, optional state label); + action native A_LookEx(optional int flags, optional float minseedist, optional float maxseedist, optional float maxheardist, optional float fov, optional state label); action native A_ClearTarget(); - action native A_JumpIfTargetInLOS (state label, optional eval float fov, optional eval bool projectiletarget); - action native A_DamageMaster(eval int amount, optional name damagetype); - action native A_DamageChildren(eval int amount, optional name damagetype); + action native A_JumpIfTargetInLOS (state label, optional float fov, optional bool projectiletarget); + action native A_DamageMaster(int amount, optional name damagetype); + action native A_DamageChildren(int amount, optional name damagetype); action native A_SelectWeapon(class whichweapon); action native A_Punch(); action native A_Feathers(); @@ -201,7 +201,7 @@ ACTOR Actor native //: Thinker action native A_RocketInFlight(); action native A_Bang4Cloud(); action native A_DropFire(); - action native A_GiveQuestItem(eval int itemno); + action native A_GiveQuestItem(int itemno); action native A_RemoveForcefield(); action native A_DropWeaponPieces(class p1, class p2, class p3); action native A_PigPain (); diff --git a/wadsrc/static/actors/heretic/hereticweaps.txt b/wadsrc/static/actors/heretic/hereticweaps.txt index 0e7087591..425a319d0 100644 --- a/wadsrc/static/actors/heretic/hereticweaps.txt +++ b/wadsrc/static/actors/heretic/hereticweaps.txt @@ -15,7 +15,7 @@ ACTOR Staff : HereticWeapon +MELEEWEAPON Weapon.sisterweapon "StaffPowered" - action native A_StaffAttack (eval int damage, class puff); + action native A_StaffAttack (int damage, class puff); States { @@ -390,7 +390,7 @@ ACTOR Gauntlets : Weapon 2005 Weapon.SisterWeapon "GauntletsPowered" Inventory.PickupMessage "$TxT_WPNGAUNTLETS" - action native A_GauntletAttack (eval int power); + action native A_GauntletAttack (int power); States { diff --git a/wadsrc/static/actors/shared/inventory.txt b/wadsrc/static/actors/shared/inventory.txt index 93fcae59e..b64be02b8 100644 --- a/wadsrc/static/actors/shared/inventory.txt +++ b/wadsrc/static/actors/shared/inventory.txt @@ -6,11 +6,11 @@ ACTOR Inventory native Inventory.PickupSound "misc/i_pkup" action native A_JumpIfNoAmmo(state label); - action native A_CustomPunch(eval int damage, optional eval bool norandom, optional evalnot bool useammo, optional class pufftype, optional eval float range); - action native A_FireBullets(eval float spread_xy, eval float spread_z, eval int numbullets, eval int damageperbullet, optional class pufftype, optional evalnot bool useammo, optional eval float range); - action native A_FireCustomMissile(class missiletype, optional eval float angle, optional evalnot bool useammo, optional eval int spawnofs_xy, optional eval float spawnheight, optional eval bool aimatangle); - action native A_RailAttack(eval int damage, optional eval int spawnofs_xy, optional evalnot int useammo, optional color color1, optional color color2, optional eval bool silent, optional eval float maxdiff, optional class pufftype); - action native A_Light(eval int extralight); + action native A_CustomPunch(int damage, optional bool norandom, optional evalnot bool useammo, optional class pufftype, optional float range); + action native A_FireBullets(float spread_xy, float spread_z, int numbullets, int damageperbullet, optional class pufftype, optional evalnot bool useammo, optional float range); + action native A_FireCustomMissile(class missiletype, optional float angle, optional evalnot bool useammo, optional int spawnofs_xy, optional float spawnheight, optional bool aimatangle); + action native A_RailAttack(int damage, optional int spawnofs_xy, optional evalnot int useammo, optional color color1, optional color color2, optional bool silent, optional float maxdiff, optional class pufftype); + action native A_Light(int extralight); action native A_Light0(); action native A_Light1(); action native A_Light2(); @@ -37,8 +37,8 @@ ACTOR Inventory native action native A_ClearReFire(); action native A_CheckReload(); action native A_GunFlash(); - action native A_Saw(optional coerce sound fullsound, optional coerce sound hitsound, optional eval int damage, optional class pufftype); - action native A_CheckForReload(eval int counter, state label); + action native A_Saw(optional coerce sound fullsound, optional coerce sound hitsound, optional int damage, optional class pufftype); + action native A_CheckForReload(int counter, state label); action native A_ResetReloadCounter(); action native A_RestoreSpecialPosition(); action native A_RestoreSpecialDoomThing(); diff --git a/wadsrc/static/actors/shared/specialspot.txt b/wadsrc/static/actors/shared/specialspot.txt index 12803e597..0e5810150 100644 --- a/wadsrc/static/actors/shared/specialspot.txt +++ b/wadsrc/static/actors/shared/specialspot.txt @@ -1,5 +1,5 @@ ACTOR SpecialSpot native { - action native A_SpawnSingleItem(class type, optional eval int fail_sp, optional eval int fail_co, optional eval int fail_dm); + action native A_SpawnSingleItem(class type, optional int fail_sp, optional int fail_co, optional int fail_dm); } diff --git a/wadsrc/static/actors/strife/strifeweapons.txt b/wadsrc/static/actors/strife/strifeweapons.txt index a6cdd324f..2b3876dfb 100644 --- a/wadsrc/static/actors/strife/strifeweapons.txt +++ b/wadsrc/static/actors/strife/strifeweapons.txt @@ -744,7 +744,7 @@ ACTOR StrifeGrenadeLauncher : StrifeWeapon 154 Tag "Grenade_launcher" Inventory.PickupMessage "$TXT_GLAUNCHER" - action native A_FireGrenade (class grenadetype, eval int angleofs, state flash); + action native A_FireGrenade (class grenadetype, int angleofs, state flash); States {