- Added Gez's MageWandMissile customization patch but moved the new functionality

into the FastProjectile base class and removed the native MageWandMissile
  class, using the generic functionality instead.
- Fixed: GetReplacement and GetReplacee always checked the skill definitions,
  even if they weren't supposed to be used. It was also missing a range check
  for 'gameskill'.


SVN r1894 (trunk)
This commit is contained in:
Christoph Oelckers 2009-10-03 17:07:11 +00:00
parent 4add2809a3
commit 3d8d176087
7 changed files with 60 additions and 51 deletions

View file

@ -1,3 +1,11 @@
October 3, 2009 (Changes by Graf Zahl)
- Added Gez's MageWandMissile customization patch but moved the new functionality
into the FastProjectile base class and removed the native MageWandMissile
class, using the generic functionality instead.
- Fixed: GetReplacement and GetReplacee always checked the skill definitions,
even if they weren't supposed to be used. It was also missing a range check
for 'gameskill'.
October 2, 2009 (Changes by Graf Zahl) October 2, 2009 (Changes by Graf Zahl)
- fixed: Savegames stored the global fixed light levels when saving a player. - fixed: Savegames stored the global fixed light levels when saving a player.

View file

@ -208,8 +208,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningClip)
DEFINE_ACTION_FUNCTION(AActor, A_LightningZap) DEFINE_ACTION_FUNCTION(AActor, A_LightningZap)
{ {
const PClass *lightning=PClass::FindClass((ENamedName) self->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_None)); const PClass *lightning=PClass::FindClass((ENamedName) self->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_LightningZap));
if (lightning == NULL) lightning = PClass::FindClass("LightningZap");
AActor *mo; AActor *mo;
fixed_t deltaZ; fixed_t deltaZ;
@ -326,8 +325,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ZapMimic)
DEFINE_ACTION_FUNCTION(AActor, A_LastZap) DEFINE_ACTION_FUNCTION(AActor, A_LastZap)
{ {
const PClass *lightning=PClass::FindClass((ENamedName) self->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_None)); const PClass *lightning=PClass::FindClass((ENamedName) self->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_LightningZap));
if (lightning == NULL) lightning = PClass::FindClass("LightningZap");
AActor *mo; AActor *mo;

View file

@ -17,32 +17,6 @@ static FRandom pr_smoke ("MWandSmoke");
void A_MWandAttack (AActor *actor); void A_MWandAttack (AActor *actor);
// Wand Missile -------------------------------------------------------------
class AMageWandMissile : public AFastProjectile
{
DECLARE_CLASS(AMageWandMissile, AFastProjectile)
public:
void Effect ();
};
IMPLEMENT_CLASS (AMageWandMissile)
void AMageWandMissile::Effect ()
{
fixed_t hitz;
//if (pr_smoke() < 128) // [RH] I think it looks better if it's consistent
{
hitz = z-8*FRACUNIT;
if (hitz < floorz)
{
hitz = floorz;
}
Spawn ("MageWandSmoke", x, y, hitz, ALLOW_REPLACE);
}
}
//============================================================================ //============================================================================
// //
// A_MWandAttack // A_MWandAttack

View file

@ -113,5 +113,20 @@ void AFastProjectile::Tick ()
void AFastProjectile::Effect() void AFastProjectile::Effect()
{ {
//if (pr_smoke() < 128) // [RH] I think it looks better if it's consistent
{
FName name = (ENamedName) this->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_None);
if (name != NAME_None)
{
fixed_t hitz = z-8*FRACUNIT;
if (hitz < floorz)
{
hitz = floorz;
}
const PClass *trail = PClass::FindClass(name);
Spawn (trail, x, y, hitz, ALLOW_REPLACE);
}
}
} }

View file

@ -168,17 +168,22 @@ void FActorInfo::RegisterIDs ()
FActorInfo *FActorInfo::GetReplacement (bool lookskill) FActorInfo *FActorInfo::GetReplacement (bool lookskill)
{ {
FName skillrepname = AllSkills[gameskill].GetReplacement(this->Class->TypeName); FName skillrepname;
if (skillrepname != NAME_None && PClass::FindClass(skillrepname) == NULL)
if (lookskill && AllSkills.Size() > (unsigned)gameskill)
{ {
Printf("Warning: incorrect actor name in definition of skill %s: \n\ skillrepname = AllSkills[gameskill].GetReplacement(this->Class->TypeName);
class %s is replaced by inexistent class %s\n\ if (skillrepname != NAME_None && PClass::FindClass(skillrepname) == NULL)
Skill replacement will be ignored for this actor.\n", {
AllSkills[gameskill].Name.GetChars(), Printf("Warning: incorrect actor name in definition of skill %s: \n"
this->Class->TypeName.GetChars(), skillrepname.GetChars()); "class %s is replaced by non-existent class %s\n"
AllSkills[gameskill].SetReplacement(this->Class->TypeName, NAME_None); "Skill replacement will be ignored for this actor.\n",
AllSkills[gameskill].SetReplacedBy(skillrepname, NAME_None); AllSkills[gameskill].Name.GetChars(),
lookskill = false; skillrepname = NAME_None; this->Class->TypeName.GetChars(), skillrepname.GetChars());
AllSkills[gameskill].SetReplacement(this->Class->TypeName, NAME_None);
AllSkills[gameskill].SetReplacedBy(skillrepname, NAME_None);
lookskill = false; skillrepname = NAME_None;
}
} }
if (Replacement == NULL && (!lookskill || skillrepname == NAME_None)) if (Replacement == NULL && (!lookskill || skillrepname == NAME_None))
{ {
@ -211,17 +216,22 @@ FActorInfo *FActorInfo::GetReplacement (bool lookskill)
FActorInfo *FActorInfo::GetReplacee (bool lookskill) FActorInfo *FActorInfo::GetReplacee (bool lookskill)
{ {
FName skillrepname = AllSkills[gameskill].GetReplacedBy(this->Class->TypeName); FName skillrepname;
if (skillrepname != NAME_None && PClass::FindClass(skillrepname) == NULL)
if (lookskill && AllSkills.Size() > (unsigned)gameskill)
{ {
Printf("Warning: incorrect actor name in definition of skill %s: \ FName skillrepname = AllSkills[gameskill].GetReplacedBy(this->Class->TypeName);
inexistent class %s is replaced by class %s\n\ if (skillrepname != NAME_None && PClass::FindClass(skillrepname) == NULL)
Skill replacement will be ignored for this actor.\n", {
AllSkills[gameskill].Name.GetChars(), Printf("Warning: incorrect actor name in definition of skill %s: \n"
skillrepname.GetChars(), this->Class->TypeName.GetChars()); "non-existent class %s is replaced by class %s\n"
AllSkills[gameskill].SetReplacedBy(this->Class->TypeName, NAME_None); "Skill replacement will be ignored for this actor.\n",
AllSkills[gameskill].SetReplacement(skillrepname, NAME_None); AllSkills[gameskill].Name.GetChars(),
lookskill = false; skillrepname.GetChars(), this->Class->TypeName.GetChars());
AllSkills[gameskill].SetReplacedBy(this->Class->TypeName, NAME_None);
AllSkills[gameskill].SetReplacement(skillrepname, NAME_None);
lookskill = false;
}
} }
if (Replacee == NULL && (!lookskill || skillrepname == NAME_None)) if (Replacee == NULL && (!lookskill || skillrepname == NAME_None))
{ {

View file

@ -129,6 +129,9 @@ xx(FWeapQuietus)
xx(CWeapWraithverge) xx(CWeapWraithverge)
xx(MWeapBloodscourge) xx(MWeapBloodscourge)
// Misc Hexen classes
xx(LightningZap)
// Ammo and weapon names for the Strife status bar // Ammo and weapon names for the Strife status bar
xx(ClipOfBullets) xx(ClipOfBullets)
xx(PoisonBolts) xx(PoisonBolts)

View file

@ -46,7 +46,7 @@ ACTOR MageWandSmoke
// Wand Missile ------------------------------------------------------------- // Wand Missile -------------------------------------------------------------
ACTOR MageWandMissile : FastProjectile native ACTOR MageWandMissile : FastProjectile
{ {
Speed 184 Speed 184
Radius 12 Radius 12
@ -54,6 +54,7 @@ ACTOR MageWandMissile : FastProjectile native
Damage 2 Damage 2
+RIPPER +CANNOTPUSH +NODAMAGETHRUST +RIPPER +CANNOTPUSH +NODAMAGETHRUST
+SPAWNSOUNDSOURCE +SPAWNSOUNDSOURCE
MissileType "MageWandSmoke"
SeeSound "MageWandFire" SeeSound "MageWandFire"
States States
{ {