mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 06:53:40 +00:00
- 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:
parent
4add2809a3
commit
3d8d176087
7 changed files with 60 additions and 51 deletions
|
@ -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)
|
||||
- fixed: Savegames stored the global fixed light levels when saving a player.
|
||||
|
||||
|
|
|
@ -208,8 +208,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningClip)
|
|||
DEFINE_ACTION_FUNCTION(AActor, A_LightningZap)
|
||||
{
|
||||
|
||||
const PClass *lightning=PClass::FindClass((ENamedName) self->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_None));
|
||||
if (lightning == NULL) lightning = PClass::FindClass("LightningZap");
|
||||
const PClass *lightning=PClass::FindClass((ENamedName) self->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_LightningZap));
|
||||
AActor *mo;
|
||||
fixed_t deltaZ;
|
||||
|
||||
|
@ -326,8 +325,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ZapMimic)
|
|||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_LastZap)
|
||||
{
|
||||
const PClass *lightning=PClass::FindClass((ENamedName) self->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_None));
|
||||
if (lightning == NULL) lightning = PClass::FindClass("LightningZap");
|
||||
const PClass *lightning=PClass::FindClass((ENamedName) self->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_LightningZap));
|
||||
|
||||
AActor *mo;
|
||||
|
||||
|
|
|
@ -17,32 +17,6 @@ static FRandom pr_smoke ("MWandSmoke");
|
|||
|
||||
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
|
||||
|
|
|
@ -113,5 +113,20 @@ void AFastProjectile::Tick ()
|
|||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
50
src/info.cpp
50
src/info.cpp
|
@ -168,17 +168,22 @@ void FActorInfo::RegisterIDs ()
|
|||
|
||||
FActorInfo *FActorInfo::GetReplacement (bool lookskill)
|
||||
{
|
||||
FName skillrepname = AllSkills[gameskill].GetReplacement(this->Class->TypeName);
|
||||
if (skillrepname != NAME_None && PClass::FindClass(skillrepname) == NULL)
|
||||
FName skillrepname;
|
||||
|
||||
if (lookskill && AllSkills.Size() > (unsigned)gameskill)
|
||||
{
|
||||
Printf("Warning: incorrect actor name in definition of skill %s: \n\
|
||||
class %s is replaced by inexistent class %s\n\
|
||||
Skill replacement will be ignored for this actor.\n",
|
||||
AllSkills[gameskill].Name.GetChars(),
|
||||
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;
|
||||
skillrepname = AllSkills[gameskill].GetReplacement(this->Class->TypeName);
|
||||
if (skillrepname != NAME_None && PClass::FindClass(skillrepname) == NULL)
|
||||
{
|
||||
Printf("Warning: incorrect actor name in definition of skill %s: \n"
|
||||
"class %s is replaced by non-existent class %s\n"
|
||||
"Skill replacement will be ignored for this actor.\n",
|
||||
AllSkills[gameskill].Name.GetChars(),
|
||||
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))
|
||||
{
|
||||
|
@ -211,17 +216,22 @@ FActorInfo *FActorInfo::GetReplacement (bool lookskill)
|
|||
|
||||
FActorInfo *FActorInfo::GetReplacee (bool lookskill)
|
||||
{
|
||||
FName skillrepname = AllSkills[gameskill].GetReplacedBy(this->Class->TypeName);
|
||||
if (skillrepname != NAME_None && PClass::FindClass(skillrepname) == NULL)
|
||||
FName skillrepname;
|
||||
|
||||
if (lookskill && AllSkills.Size() > (unsigned)gameskill)
|
||||
{
|
||||
Printf("Warning: incorrect actor name in definition of skill %s: \
|
||||
inexistent class %s is replaced by class %s\n\
|
||||
Skill replacement will be ignored for this actor.\n",
|
||||
AllSkills[gameskill].Name.GetChars(),
|
||||
skillrepname.GetChars(), this->Class->TypeName.GetChars());
|
||||
AllSkills[gameskill].SetReplacedBy(this->Class->TypeName, NAME_None);
|
||||
AllSkills[gameskill].SetReplacement(skillrepname, NAME_None);
|
||||
lookskill = false;
|
||||
FName skillrepname = AllSkills[gameskill].GetReplacedBy(this->Class->TypeName);
|
||||
if (skillrepname != NAME_None && PClass::FindClass(skillrepname) == NULL)
|
||||
{
|
||||
Printf("Warning: incorrect actor name in definition of skill %s: \n"
|
||||
"non-existent class %s is replaced by class %s\n"
|
||||
"Skill replacement will be ignored for this actor.\n",
|
||||
AllSkills[gameskill].Name.GetChars(),
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -129,6 +129,9 @@ xx(FWeapQuietus)
|
|||
xx(CWeapWraithverge)
|
||||
xx(MWeapBloodscourge)
|
||||
|
||||
// Misc Hexen classes
|
||||
xx(LightningZap)
|
||||
|
||||
// Ammo and weapon names for the Strife status bar
|
||||
xx(ClipOfBullets)
|
||||
xx(PoisonBolts)
|
||||
|
|
|
@ -46,7 +46,7 @@ ACTOR MageWandSmoke
|
|||
|
||||
// Wand Missile -------------------------------------------------------------
|
||||
|
||||
ACTOR MageWandMissile : FastProjectile native
|
||||
ACTOR MageWandMissile : FastProjectile
|
||||
{
|
||||
Speed 184
|
||||
Radius 12
|
||||
|
@ -54,6 +54,7 @@ ACTOR MageWandMissile : FastProjectile native
|
|||
Damage 2
|
||||
+RIPPER +CANNOTPUSH +NODAMAGETHRUST
|
||||
+SPAWNSOUNDSOURCE
|
||||
MissileType "MageWandSmoke"
|
||||
SeeSound "MageWandFire"
|
||||
States
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue