IMPORTANT NOTE: I uncommented some code depending on the missing x86.cpp file to allow this to compile, These changes must be reverted as soon as this file is added (see v_palette.cpp and win32/i_system.cpp.)

- Removed AT_GAME_SET because it's no longer used anywhere.
- Converted the last remaining global classes to DECORATE.
- Fixed: Inventory.PickupFlash requires an class name as parameter not an
  integer. Some Hexen definitions got it wrong.
- Converted Hexen's Pig to DECORATE.
- Replaced the ActorInfo definitions of all internal inventory classes with 
  DECORATE definitions.
- Added option to specify a powerup's duration in second by using a negative
  number.


SVN r1137 (trunk)
This commit is contained in:
Christoph Oelckers 2008-08-09 11:35:42 +00:00
commit ae54e13428
50 changed files with 866 additions and 638 deletions

View file

@ -2079,6 +2079,14 @@ static void WeaponKickback (FScanner &sc, AWeapon *defaults, Baggage &bag)
defaults->Kickback=sc.Number;
}
//==========================================================================
//
//==========================================================================
static void WeaponDefKickback (FScanner &sc, AWeapon *defaults, Baggage &bag)
{
defaults->Kickback = gameinfo.defKickback;
}
//==========================================================================
//
//==========================================================================
@ -2151,6 +2159,20 @@ static void PowerupColor (FScanner &sc, APowerupGiver *defaults, Baggage &bag)
int g;
int b;
int alpha;
PalEntry * pBlendColor;
if (bag.Info->Class->IsDescendantOf(RUNTIME_CLASS(APowerup)))
{
pBlendColor = &((APowerup*)defaults)->BlendColor;
}
else if (bag.Info->Class->IsDescendantOf(RUNTIME_CLASS(APowerupGiver)))
{
pBlendColor = &((APowerupGiver*)defaults)->BlendColor;
}
else
{
sc.ScriptError("\"%s\" requires an actor of type \"Powerup\"\n", sc.String);
}
if (sc.CheckNumber())
{
@ -2197,8 +2219,8 @@ static void PowerupColor (FScanner &sc, APowerupGiver *defaults, Baggage &bag)
sc.MustGetFloat();
alpha=int(sc.Float*255);
alpha=clamp<int>(alpha, 0, 255);
if (alpha!=0) defaults->BlendColor = MAKEARGB(alpha, r, g, b);
else defaults->BlendColor = 0;
if (alpha!=0) *pBlendColor = MAKEARGB(alpha, r, g, b);
else *pBlendColor = 0;
}
//==========================================================================
@ -2206,8 +2228,23 @@ static void PowerupColor (FScanner &sc, APowerupGiver *defaults, Baggage &bag)
//==========================================================================
static void PowerupDuration (FScanner &sc, APowerupGiver *defaults, Baggage &bag)
{
int *pEffectTics;
if (bag.Info->Class->IsDescendantOf(RUNTIME_CLASS(APowerup)))
{
pEffectTics = &((APowerup*)defaults)->EffectTics;
}
else if (bag.Info->Class->IsDescendantOf(RUNTIME_CLASS(APowerupGiver)))
{
pEffectTics = &((APowerupGiver*)defaults)->EffectTics;
}
else
{
sc.ScriptError("\"%s\" requires an actor of type \"Powerup\"\n", sc.String);
}
sc.MustGetNumber();
defaults->EffectTics = sc.Number;
*pEffectTics = sc.Number>=0? sc.Number : -sc.Number*TICRATE;
}
//==========================================================================
@ -2748,8 +2785,8 @@ static const ActorProps props[] =
{ "powermorph.morphstyle", (apf)PowerMorphMorphStyle, RUNTIME_CLASS(APowerMorph) },
{ "powermorph.playerclass", (apf)PowerMorphPlayerClass, RUNTIME_CLASS(APowerMorph) },
{ "powermorph.unmorphflash", (apf)PowerMorphUnMorphFlash, RUNTIME_CLASS(APowerMorph) },
{ "powerup.color", (apf)PowerupColor, RUNTIME_CLASS(APowerupGiver) },
{ "powerup.duration", (apf)PowerupDuration, RUNTIME_CLASS(APowerupGiver) },
{ "powerup.color", (apf)PowerupColor, RUNTIME_CLASS(AInventory) },
{ "powerup.duration", (apf)PowerupDuration, RUNTIME_CLASS(AInventory) },
{ "powerup.mode", (apf)PowerupMode, RUNTIME_CLASS(APowerupGiver) },
{ "powerup.type", (apf)PowerupType, RUNTIME_CLASS(APowerupGiver) },
{ "projectile", ActorProjectile, RUNTIME_CLASS(AActor) },
@ -2782,6 +2819,7 @@ static const ActorProps props[] =
{ "weapon.ammouse", (apf)WeaponAmmoUse1, RUNTIME_CLASS(AWeapon) },
{ "weapon.ammouse1", (apf)WeaponAmmoUse1, RUNTIME_CLASS(AWeapon) },
{ "weapon.ammouse2", (apf)WeaponAmmoUse2, RUNTIME_CLASS(AWeapon) },
{ "weapon.defaultkickback", (apf)WeaponDefKickback, RUNTIME_CLASS(AWeapon) },
{ "weapon.kickback", (apf)WeaponKickback, RUNTIME_CLASS(AWeapon) },
{ "weapon.readysound", (apf)WeaponReadySound, RUNTIME_CLASS(AWeapon) },
{ "weapon.selectionorder", (apf)WeaponSelectionOrder, RUNTIME_CLASS(AWeapon) },