Add prefix Spell_ to specific spell class.
This commit is contained in:
parent
5f54853efe
commit
e9996ad4ce
21 changed files with 51 additions and 51 deletions
|
@ -65,11 +65,11 @@ public:
|
|||
};
|
||||
|
||||
|
||||
class AdjustVariable : public SpellActionType
|
||||
class Spell_AdjustVariable : public SpellActionType
|
||||
{
|
||||
public:
|
||||
AdjustVariable() : Var(NULL) {};
|
||||
~AdjustVariable() { delete [](this->Var); };
|
||||
Spell_AdjustVariable() : Var(NULL) {};
|
||||
~Spell_AdjustVariable() { delete [](this->Var); };
|
||||
virtual int Cast(CUnit &caster, const SpellType &spell,
|
||||
CUnit *target, const Vec2i &goalPos);
|
||||
virtual void Parse(lua_State *l, int startIndex, int endIndex);
|
||||
|
|
|
@ -38,10 +38,10 @@
|
|||
|
||||
#include "spells.h"
|
||||
|
||||
class AdjustVital : public SpellActionType
|
||||
class Spell_AdjustVital : public SpellActionType
|
||||
{
|
||||
public:
|
||||
AdjustVital() : SpellActionType(1), HP(0), Mana(0), MaxMultiCast(0) {};
|
||||
Spell_AdjustVital() : SpellActionType(1), HP(0), Mana(0), MaxMultiCast(0) {};
|
||||
virtual int Cast(CUnit &caster, const SpellType &spell,
|
||||
CUnit *target, const Vec2i &goalPos);
|
||||
virtual void Parse(lua_State *l, int startIndex, int endIndex);
|
||||
|
|
|
@ -38,10 +38,10 @@
|
|||
|
||||
#include "spells.h"
|
||||
|
||||
class AreaAdjustVital : public SpellActionType
|
||||
class Spell_AreaAdjustVital : public SpellActionType
|
||||
{
|
||||
public:
|
||||
AreaAdjustVital() : HP(0), Mana(0) {};
|
||||
Spell_AreaAdjustVital() : HP(0), Mana(0) {};
|
||||
virtual int Cast(CUnit &caster, const SpellType &spell,
|
||||
CUnit *target, const Vec2i &goalPos);
|
||||
virtual void Parse(lua_State *l, int startIndex, int endIndex);
|
||||
|
|
|
@ -38,10 +38,10 @@
|
|||
|
||||
#include "spells.h"
|
||||
|
||||
class AreaBombardment : public SpellActionType
|
||||
class Spell_AreaBombardment : public SpellActionType
|
||||
{
|
||||
public:
|
||||
AreaBombardment() : Fields(0), Shards(0), Damage(0),
|
||||
Spell_AreaBombardment() : Fields(0), Shards(0), Damage(0),
|
||||
StartOffsetX(0), StartOffsetY(0), Missile(NULL) {};
|
||||
virtual int Cast(CUnit &caster, const SpellType &spell,
|
||||
CUnit *target, const Vec2i &goalPos);
|
||||
|
|
|
@ -38,10 +38,10 @@
|
|||
|
||||
#include "spells.h"
|
||||
|
||||
class Capture : public SpellActionType
|
||||
class Spell_Capture : public SpellActionType
|
||||
{
|
||||
public:
|
||||
Capture() : SacrificeEnable(0), Damage(0), DamagePercent(0) {};
|
||||
Spell_Capture() : SacrificeEnable(0), Damage(0), DamagePercent(0) {};
|
||||
virtual int Cast(CUnit &caster, const SpellType &spell,
|
||||
CUnit *target, const Vec2i &goalPos);
|
||||
virtual void Parse(lua_State *l, int startIndex, int endIndex);
|
||||
|
|
|
@ -38,10 +38,10 @@
|
|||
|
||||
#include "spells.h"
|
||||
|
||||
class Demolish : public SpellActionType
|
||||
class Spell_Demolish : public SpellActionType
|
||||
{
|
||||
public:
|
||||
Demolish() : Damage(0), Range(0) {};
|
||||
Spell_Demolish() : Damage(0), Range(0) {};
|
||||
virtual int Cast(CUnit &caster, const SpellType &spell,
|
||||
CUnit *target, const Vec2i &goalPos);
|
||||
virtual void Parse(lua_State *l, int startIndex, int endIndex);
|
||||
|
|
|
@ -38,10 +38,10 @@
|
|||
|
||||
#include "spells.h"
|
||||
|
||||
class Polymorph : public SpellActionType
|
||||
class Spell_Polymorph : public SpellActionType
|
||||
{
|
||||
public:
|
||||
Polymorph() : SpellActionType(1), NewForm(NULL), PlayerNeutral(0) {};
|
||||
Spell_Polymorph() : SpellActionType(1), NewForm(NULL), PlayerNeutral(0) {};
|
||||
virtual int Cast(CUnit &caster, const SpellType &spell,
|
||||
CUnit *target, const Vec2i &goalPos);
|
||||
virtual void Parse(lua_State *l, int startIndex, int endIndex);
|
||||
|
|
|
@ -65,10 +65,10 @@ public:
|
|||
int AddRandY; /// Random add to the X coordinate
|
||||
};
|
||||
|
||||
class SpawnMissile : public SpellActionType
|
||||
class Spell_SpawnMissile : public SpellActionType
|
||||
{
|
||||
public:
|
||||
SpawnMissile() : Damage(0), TTL(-1), Delay(0), UseUnitVar(false),
|
||||
Spell_SpawnMissile() : Damage(0), TTL(-1), Delay(0), UseUnitVar(false),
|
||||
StartPoint(LocBaseCaster), EndPoint(LocBaseTarget), Missile(0) {}
|
||||
virtual int Cast(CUnit &caster, const SpellType &spell,
|
||||
CUnit *target, const Vec2i &goalPos);
|
||||
|
|
|
@ -38,10 +38,10 @@
|
|||
|
||||
#include "spells.h"
|
||||
|
||||
class SpawnPortal : public SpellActionType
|
||||
class Spell_SpawnPortal : public SpellActionType
|
||||
{
|
||||
public:
|
||||
SpawnPortal() : PortalType(0) {};
|
||||
Spell_SpawnPortal() : PortalType(0) {};
|
||||
virtual int Cast(CUnit &caster, const SpellType &spell,
|
||||
CUnit *target, const Vec2i &goalPos);
|
||||
virtual void Parse(lua_State *l, int startIndex, int endIndex);
|
||||
|
|
|
@ -38,10 +38,10 @@
|
|||
|
||||
#include "spells.h"
|
||||
|
||||
class Summon : public SpellActionType
|
||||
class Spell_Summon : public SpellActionType
|
||||
{
|
||||
public:
|
||||
Summon() : SpellActionType(1), UnitType(NULL), TTL(0), RequireCorpse(0) {};
|
||||
Spell_Summon() : SpellActionType(1), UnitType(NULL), TTL(0), RequireCorpse(0) {};
|
||||
virtual int Cast(CUnit &caster, const SpellType &spell,
|
||||
CUnit *target, const Vec2i &goalPos);
|
||||
virtual void Parse(lua_State *l, int startIndex, int endIndex);
|
||||
|
|
|
@ -74,25 +74,25 @@ static SpellActionType *CclSpellAction(lua_State *l)
|
|||
|
||||
SpellActionType *spellaction = NULL;
|
||||
if (!strcmp(value, "adjust-variable")) {
|
||||
spellaction = new AdjustVariable;
|
||||
spellaction = new Spell_AdjustVariable;
|
||||
} else if (!strcmp(value, "adjust-vitals")) {
|
||||
spellaction = new AdjustVital;
|
||||
spellaction = new Spell_AdjustVital;
|
||||
} else if (!strcmp(value, "area-adjust-vitals")) {
|
||||
spellaction = new AreaAdjustVital;
|
||||
spellaction = new Spell_AreaAdjustVital;
|
||||
} else if (!strcmp(value, "area-bombardment")) {
|
||||
spellaction = new AreaBombardment;
|
||||
spellaction = new Spell_AreaBombardment;
|
||||
} else if (!strcmp(value, "capture")) {
|
||||
spellaction = new Capture;
|
||||
spellaction = new Spell_Capture;
|
||||
} else if (!strcmp(value, "demolish")) {
|
||||
spellaction = new Demolish;
|
||||
spellaction = new Spell_Demolish;
|
||||
} else if (!strcmp(value, "polymorph")) {
|
||||
spellaction = new Polymorph;
|
||||
spellaction = new Spell_Polymorph;
|
||||
} else if (!strcmp(value, "spawn-missile")) {
|
||||
spellaction = new SpawnMissile;
|
||||
spellaction = new Spell_SpawnMissile;
|
||||
} else if (!strcmp(value, "spawn-portal")) {
|
||||
spellaction = new SpawnPortal;
|
||||
spellaction = new Spell_SpawnPortal;
|
||||
} else if (!strcmp(value, "summon")) {
|
||||
spellaction = new Summon;
|
||||
spellaction = new Spell_Summon;
|
||||
} else {
|
||||
LuaError(l, "Unsupported action type: %s" _C_ value);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include "unit.h"
|
||||
|
||||
|
||||
/* virtual */ void AdjustVariable::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
/* virtual */ void Spell_AdjustVariable::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
{
|
||||
int j = startIndex;
|
||||
lua_rawgeti(l, -1, j + 1);
|
||||
|
@ -116,7 +116,7 @@
|
|||
**
|
||||
** @return =!0 if spell should be repeated, 0 if not
|
||||
*/
|
||||
/* virtual */ int AdjustVariable::Cast(CUnit &caster, const SpellType &, CUnit *target, const Vec2i &/*goalPos*/)
|
||||
/* virtual */ int Spell_AdjustVariable::Cast(CUnit &caster, const SpellType &, CUnit *target, const Vec2i &/*goalPos*/)
|
||||
{
|
||||
for (unsigned int i = 0; i < UnitTypeVar.GetNumberVariable(); ++i) {
|
||||
CUnit *unit = (this->Var[i].TargetIsCaster) ? &caster : target;
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include "script.h"
|
||||
#include "unit.h"
|
||||
|
||||
/* virtual */ void AdjustVital::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
/* virtual */ void Spell_AdjustVital::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
{
|
||||
for (int j = startIndex; j < endIndex; ++j) {
|
||||
lua_rawgeti(l, -1, j + 1);
|
||||
|
@ -73,7 +73,7 @@
|
|||
**
|
||||
** @return =!0 if spell should be repeated, 0 if not
|
||||
*/
|
||||
/* virtual */ int AdjustVital::Cast(CUnit &caster, const SpellType &spell, CUnit *target, const Vec2i &/*goalPos*/)
|
||||
/* virtual */ int Spell_AdjustVital::Cast(CUnit &caster, const SpellType &spell, CUnit *target, const Vec2i &/*goalPos*/)
|
||||
{
|
||||
if (!target) {
|
||||
return 0;
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include "script.h"
|
||||
#include "unit.h"
|
||||
|
||||
/* virtual */ void AreaAdjustVital::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
/* virtual */ void Spell_AreaAdjustVital::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
{
|
||||
for (int j = startIndex; j < endIndex; ++j) {
|
||||
lua_rawgeti(l, -1, j + 1);
|
||||
|
@ -69,7 +69,7 @@
|
|||
**
|
||||
** @return =!0 if spell should be repeated, 0 if not
|
||||
*/
|
||||
/* virtual */ int AreaAdjustVital::Cast(CUnit &caster, const SpellType &spell, CUnit *target, const Vec2i &goalPos)
|
||||
/* virtual */ int Spell_AreaAdjustVital::Cast(CUnit &caster, const SpellType &spell, CUnit *target, const Vec2i &goalPos)
|
||||
{
|
||||
const Vec2i range(spell.Range, spell.Range);
|
||||
const Vec2i typeSize(caster.Type->Width, caster.Type->Height);
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include "script.h"
|
||||
#include "unit.h"
|
||||
|
||||
/* virtual */ void AreaBombardment::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
/* virtual */ void Spell_AreaBombardment::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
{
|
||||
for (int j = startIndex; j < endIndex; ++j) {
|
||||
lua_rawgeti(l, -1, j + 1);
|
||||
|
@ -97,7 +97,7 @@
|
|||
** @internal: vladi: blizzard differs than original in this way:
|
||||
** original: launches 50 shards at 5 random spots x 10 for 25 mana.
|
||||
*/
|
||||
/* virtual */ int AreaBombardment::Cast(CUnit &caster, const SpellType &, CUnit *, const Vec2i &goalPos)
|
||||
/* virtual */ int Spell_AreaBombardment::Cast(CUnit &caster, const SpellType &, CUnit *, const Vec2i &goalPos)
|
||||
{
|
||||
int fields = this->Fields;
|
||||
const int shards = this->Shards;
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include "script.h"
|
||||
#include "unit.h"
|
||||
|
||||
/* virtual */ void Capture::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
/* virtual */ void Spell_Capture::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
{
|
||||
for (int j = startIndex; j < endIndex; ++j) {
|
||||
lua_rawgeti(l, -1, j + 1);
|
||||
|
@ -70,7 +70,7 @@
|
|||
**
|
||||
** @return =!0 if spell should be repeated, 0 if not
|
||||
*/
|
||||
/* virtual */ int Capture::Cast(CUnit &caster, const SpellType &spell, CUnit *target, const Vec2i &/*goalPos*/)
|
||||
/* virtual */ int Spell_Capture::Cast(CUnit &caster, const SpellType &spell, CUnit *target, const Vec2i &/*goalPos*/)
|
||||
{
|
||||
if (!target || caster.Player == target->Player) {
|
||||
return 0;
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include "script.h"
|
||||
#include "map.h"
|
||||
|
||||
/* virtual */ void Demolish::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
/* virtual */ void Spell_Demolish::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
{
|
||||
for (int j = startIndex; j < endIndex; ++j) {
|
||||
lua_rawgeti(l, -1, j + 1);
|
||||
|
@ -67,7 +67,7 @@
|
|||
**
|
||||
** @return =!0 if spell should be repeated, 0 if not
|
||||
*/
|
||||
/* virtual */ int Demolish::Cast(CUnit &caster, const SpellType &, CUnit *, const Vec2i &goalPos)
|
||||
/* virtual */ int Spell_Demolish::Cast(CUnit &caster, const SpellType &, CUnit *, const Vec2i &goalPos)
|
||||
{
|
||||
// Allow error margins. (Lame, I know)
|
||||
const Vec2i offset(this->Range + 2, this->Range + 2);
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include "script.h"
|
||||
#include "unit.h"
|
||||
|
||||
/* virtual */ void Polymorph::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
/* virtual */ void Spell_Polymorph::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
{
|
||||
for (int j = startIndex; j < endIndex; ++j) {
|
||||
lua_rawgeti(l, -1, j + 1);
|
||||
|
@ -81,7 +81,7 @@
|
|||
**
|
||||
** @return =!0 if spell should be repeated, 0 if not
|
||||
*/
|
||||
/* virtual */ int Polymorph::Cast(CUnit &caster, const SpellType &spell, CUnit *target, const Vec2i &goalPos)
|
||||
/* virtual */ int Spell_Polymorph::Cast(CUnit &caster, const SpellType &spell, CUnit *target, const Vec2i &goalPos)
|
||||
{
|
||||
if (!target) {
|
||||
return 0;
|
||||
|
|
|
@ -94,7 +94,7 @@ static void CclSpellMissileLocation(lua_State *l, SpellActionMissileLocation *lo
|
|||
}
|
||||
}
|
||||
|
||||
/* virtual */ void SpawnMissile::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
/* virtual */ void Spell_SpawnMissile::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
{
|
||||
for (int j = startIndex; j < endIndex; ++j) {
|
||||
lua_rawgeti(l, -1, j + 1);
|
||||
|
@ -183,7 +183,7 @@ static void EvaluateMissileLocation(const SpellActionMissileLocation &location,
|
|||
**
|
||||
** @return =!0 if spell should be repeated, 0 if not
|
||||
*/
|
||||
/* virtual */ int SpawnMissile::Cast(CUnit &caster, const SpellType &, CUnit *target, const Vec2i &goalPos)
|
||||
/* virtual */ int Spell_SpawnMissile::Cast(CUnit &caster, const SpellType &, CUnit *target, const Vec2i &goalPos)
|
||||
{
|
||||
PixelPos startPos;
|
||||
PixelPos endPos;
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include "script.h"
|
||||
#include "unit.h"
|
||||
|
||||
/* virtual */ void SpawnPortal::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
/* virtual */ void Spell_SpawnPortal::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
{
|
||||
for (int j = startIndex; j < endIndex; ++j) {
|
||||
lua_rawgeti(l, -1, j + 1);
|
||||
|
@ -73,7 +73,7 @@
|
|||
**
|
||||
** @return =!0 if spell should be repeated, 0 if not
|
||||
*/
|
||||
/* virtual */ int SpawnPortal::Cast(CUnit &caster, const SpellType &, CUnit *, const Vec2i &goalPos)
|
||||
/* virtual */ int Spell_SpawnPortal::Cast(CUnit &caster, const SpellType &, CUnit *, const Vec2i &goalPos)
|
||||
{
|
||||
// FIXME: vladi: cop should be placed only on explored land
|
||||
CUnit *portal = caster.Goal;
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include "script.h"
|
||||
#include "unit.h"
|
||||
|
||||
/* virtual */ void Summon::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
/* virtual */ void Spell_Summon::Parse(lua_State *l, int startIndex, int endIndex)
|
||||
{
|
||||
for (int j = startIndex; j < endIndex; ++j) {
|
||||
lua_rawgeti(l, -1, j + 1);
|
||||
|
@ -91,7 +91,7 @@ public:
|
|||
**
|
||||
** @return =!0 if spell should be repeated, 0 if not
|
||||
*/
|
||||
/* virtual */ int Summon::Cast(CUnit &caster, const SpellType &spell, CUnit *target, const Vec2i &goalPos)
|
||||
/* virtual */ int Spell_Summon::Cast(CUnit &caster, const SpellType &spell, CUnit *target, const Vec2i &goalPos)
|
||||
{
|
||||
Vec2i pos = goalPos;
|
||||
bool cansummon;
|
||||
|
|
Loading…
Add table
Reference in a new issue