1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

First draft of spell animation configuration

This commit is contained in:
AlexVinS 2014-11-26 22:25:13 +03:00
parent b31ed0e4ea
commit 16d08b062a
7 changed files with 328 additions and 64 deletions

View File

@ -30,66 +30,66 @@
// WoG_Ac_format_to_def_names_mapping
"ac_mapping": [
{ "id": 0, "defnames": [ "C10SPW.DEF" ] },
{ "id": 1, "defnames": [ "C03SPA0.DEF" ] },
{ "id": 2, "defnames": [ "C01SPA0.DEF" ] },
{ "id": 3, "defnames": [ "C02SPA0.DEF" ] },
{ "id": 4, "defnames": [ "SP12_.DEF" ] },
{ "id": 5, "defnames": [ "C02SPE0.DEF" ] },
{ "id": 6, "defnames": [ "C02SPF0.DEF" ] },
{ "id": 7, "defnames": [ "C04SPA0.DEF" ] },
{ "id": 8, "defnames": [ "C04SPE0.DEF" ] },
{ "id": 9, "defnames": [ "C04SPF0.DEF" ] },
{ "id": 10, "defnames": [ "C05SPE0.DEF" ] },
{ "id": 11, "defnames": [ "C05SPF0.DEF" ] },
{ "id": 12, "defnames": [ "C06SPF0.DEF" ] },
{ "id": 13, "defnames": [ "C07SPA0.DEF" ] },
{ "id": 14, "defnames": [ "C07SPA1.DEF" ] },
{ "id": 0, "defnames": [ "C10SPW.DEF" ] },//merged
{ "id": 1, "defnames": [ "C03SPA0.DEF" ] },//merged
{ "id": 2, "defnames": [ "C01SPA0.DEF" ] },//merged
{ "id": 3, "defnames": [ "C02SPA0.DEF" ] },//merged
{ "id": 4, "defnames": [ "SP12_.DEF" ] },//merged (?)
{ "id": 5, "defnames": [ "C02SPE0.DEF" ] },//merged
{ "id": 6, "defnames": [ "C02SPF0.DEF" ] },//merged
{ "id": 7, "defnames": [ "C04SPA0.DEF" ] },//merged
{ "id": 8, "defnames": [ "C04SPE0.DEF" ] },//merged
{ "id": 9, "defnames": [ "C04SPF0.DEF" ] },//merged
{ "id": 10, "defnames": [ "C05SPE0.DEF" ] },//merged
{ "id": 11, "defnames": [ "C05SPF0.DEF" ] },//merged
{ "id": 12, "defnames": [ "C06SPF0.DEF" ] },//merged (?)
{ "id": 13, "defnames": [ "C07SPA0.DEF" ] },//merged (?)
{ "id": 14, "defnames": [ "C07SPA1.DEF" ] },//merged
{ "id": 15, "defnames": [ "C0FEAR.DEF" ] },
{ "id": 16, "defnames": [ "C08SPE0.DEF" ] },
{ "id": 17, "defnames": [ "C08SPF0.DEF" ] },
{ "id": 18, "defnames": [ "C09SPA0.DEF" ] },
{ "id": 19, "defnames": [ "C09SPE0.DEF" ] },
{ "id": 20, "defnames": [ "C09SPW0.DEF" ] },
{ "id": 21, "defnames": [ "C10SPA0.DEF" ] },
{ "id": 22, "defnames": [ "C11SPE0.DEF" ] },
{ "id": 23, "defnames": [ "C11SPF0.DEF" ] },
{ "id": 24, "defnames": [ "C11SPW0.DEF" ] },
{ "id": 25, "defnames": [ "C12SPA0.DEF" ] },
{ "id": 26, "defnames": [ "C13SPA0.DEF" ] },
{ "id": 27, "defnames": [ "C13SPE0.DEF" ] },
{ "id": 28, "defnames": [ "C13SPW0.DEF" ] },
{ "id": 29, "defnames": [ "C14SPA0.DEF" ] },
{ "id": 30, "defnames": [ "C14SPE0.DEF" ] },
{ "id": 31, "defnames": [ "C15SPA0.DEF" ] },
{ "id": 17, "defnames": [ "C08SPF0.DEF" ] },//merged
{ "id": 18, "defnames": [ "C09SPA0.DEF" ] },//merged
{ "id": 19, "defnames": [ "C09SPE0.DEF" ] },//merged
{ "id": 20, "defnames": [ "C09SPW0.DEF" ] },//merged
{ "id": 21, "defnames": [ "C10SPA0.DEF" ] },//merged
{ "id": 22, "defnames": [ "C11SPE0.DEF" ] },//merged
{ "id": 23, "defnames": [ "C11SPF0.DEF" ] },//merged
{ "id": 24, "defnames": [ "C11SPW0.DEF" ] },//merged
{ "id": 25, "defnames": [ "C12SPA0.DEF" ] },//merged
{ "id": 26, "defnames": [ "C13SPA0.DEF" ] },//merged
{ "id": 27, "defnames": [ "C13SPE0.DEF" ] },//merged
{ "id": 28, "defnames": [ "C13SPW0.DEF" ] },//merged
{ "id": 29, "defnames": [ "C14SPA0.DEF" ] },//merged
{ "id": 30, "defnames": [ "C14SPE0.DEF" ] },//merged
{ "id": 31, "defnames": [ "C15SPA0.DEF" ] },//merged
{ "id": 32, "defnames": [ "C15SPE0.DEF", "C15SPE1.DEF", "C15SPE2.DEF" ] },
{ "id": 33, "defnames": [ "C15SPE3.DEF", "C15SPE6.DEF", "C15SPE7.DEF", "C15SPE8.DEF", "C15SPE9.DEF", "C15SPE10.DEF", "C15SPE11.DEF" ] },
{ "id": 35, "defnames": [ "C01SPF.DEF", "C01SPF0.DEF" ] },
{ "id": 36, "defnames": [ "C01SPW.DEF", "C01SPW0.DEF" ] },
{ "id": 38, "defnames": [ "C11SPA1.DEF" ] },
{ "id": 39, "defnames": [ "C03SPW.DEF", "C03SPW0.DEF" ] },
{ "id": 40, "defnames": [ "C04SPW.DEF", "C04SPW0.DEF" ] },
{ "id": 41, "defnames": [ "C05SPW.DEF", "C05SPW0.DEF" ] },
{ "id": 42, "defnames": [ "C06SPW.DEF", "C06SPW0.DEF" ] },
{ "id": 35, "defnames": [ "C01SPF.DEF", "C01SPF0.DEF" ] },//merged
{ "id": 36, "defnames": [ "C01SPW.DEF", "C01SPW0.DEF" ] },//merged
{ "id": 38, "defnames": [ "C11SPA1.DEF" ] },//merged
{ "id": 39, "defnames": [ "C03SPW.DEF", "C03SPW0.DEF" ] },//merged
{ "id": 40, "defnames": [ "C04SPW.DEF", "C04SPW0.DEF" ] },//merged
{ "id": 41, "defnames": [ "C05SPW.DEF", "C05SPW0.DEF" ] },//merged
{ "id": 42, "defnames": [ "C06SPW.DEF", "C06SPW0.DEF" ] },//merged
{ "id": 43, "defnames": [ "C07SPF0.DEF", "C07SPF1.DEF", "C07SPF2.DEF", "C07SPF6.DEF", "C07SPF7.DEF", "C07SPF8.DEF" ] },
{ "id": 44, "defnames": [ "C07SPF0.DEF", "C07SPF4.DEF", "C07SPF5.DEF", "C07SPF9.DEF", "C07SPF10.DEF", "C07SPF11.DEF" ] },
{ "id": 45, "defnames": [ "C07SPW.DEF", "C07SPW0.DEF" ] },
{ "id": 46, "defnames": [ "C08SPW5.DEF" ] },
{ "id": 45, "defnames": [ "C07SPW.DEF", "C07SPW0.DEF" ] },//merged
{ "id": 46, "defnames": [ "C08SPW5.DEF" ] },//merged (?)
{ "id": 47, "defnames": [ "C09SPF0.DEF" ] },
{ "id": 48, "defnames": [ "C10SPF0.DEF" ] },
{ "id": 48, "defnames": [ "C10SPF0.DEF" ] },//merged
{ "id": 49, "defnames": [ "C11SPA1.DEF" ] },
{ "id": 50, "defnames": [ "C12SPE0.DEF" ] },
{ "id": 51, "defnames": [ "C12SPF0.DEF" ] },
{ "id": 52, "defnames": [ "SP06_.DEF" ] },
{ "id": 53, "defnames": [ "C13SPF.DEF", "C13SPF0.DEF" ] },
{ "id": 54, "defnames": [ "C16SPE.DEF", "C16SPE0.DEF" ] },
{ "id": 53, "defnames": [ "C13SPF.DEF", "C13SPF0.DEF" ] }, //merged
{ "id": 54, "defnames": [ "C16SPE.DEF", "C16SPE0.DEF" ] }, //merged
{ "id": 55, "defnames": [ "C17SPE0.DEF" ] },
{ "id": 56, "defnames": [ "C0ACID.DEF" ] },
{ "id": 56, "defnames": [ "C0ACID.DEF" ] },//merged
{ "id": 57, "defnames": [ "C09SPF1.DEF", "C09SPF2.DEF" ] },
{ "id": 58, "defnames": [ "C17SPE2.DEF" ] },
{ "id": 59, "defnames": [ "C09SPF0.DEF" ] },
{ "id": 62, "defnames": [ "C07SPF60.DEF", "C07SPF61.DEF", "C07SPF62.DEF" ] },
{ "id": 64, "defnames": [ "C20SPX.DEF" ] },
{ "id": 64, "defnames": [ "C20SPX.DEF" ] }, //merged
{ "id": 67, "defnames": [ "SP11_.DEF" ] },
{ "id": 68, "defnames": [ "SP02_.DEF" ] },
{ "id": 69, "defnames": [ "SP05_.DEF" ] },
@ -101,7 +101,7 @@
{ "id": 76, "defnames": [ "SP07_B.DEF" ] },
{ "id": 77, "defnames": [ "SP08_.DEF" ] },
{ "id": 78, "defnames": [ "SP09_.DEF" ] },
{ "id": 79, "defnames": [ "C01SPE0.DEF" ] },
{ "id": 79, "defnames": [ "C01SPE0.DEF" ] },//merged
{ "id": 80, "defnames": [ "C07SPE0.DEF" ] },
{ "id": 81, "defnames": [ "C17SPW0.DEF" ] },
{ "id": 82, "defnames": [ "C09SPF3.DEF" ] },

View File

@ -8,6 +8,33 @@
"definitions" : {
"animationQueue":{
"type": "array",
"items":{
"type": "string",
"format": "defFile"
}
},
"animation":{
"type": "object",
"additionalProperties" : false,
"properties":{
"affect":{"$ref" : "#/definitions/animationQueue"},
"hit":{"$ref" : "#/definitions/animationQueue"},
"cast":{"$ref" : "#/definitions/animationQueue"},
"projectile":{
"type":"array",
"items":{
"type": "object",
"properties":{
"minimumAngle": {"type":"number", "minimum" : 0},
"defName": {"type":"string", "format": "defFile"}
},
"additionalProperties" : false
}
}
}
},
"flags" :{
"type" : "object",
"additionalProperties" : {
@ -124,9 +151,9 @@
"type": "object",
"description": "Chance in % to gain for faction. NOTE: this field is merged with faction config",
"additionalProperties" : {
"type": "number",
"minimum" : 0
}
"type": "number",
"minimum" : 0
}
},
"targetType":{
"type": "string",
@ -193,6 +220,9 @@
"$ref" : "#/definitions/flags",
"description": "flags structure of bonus names, presence of all bonuses required to be affected by, can't be negated."
},
"animation":{"$ref": "#/definitions/animation"},
"graphics":{
"type": "object",
"additionalProperties" : false,

View File

@ -3,6 +3,16 @@
"index" : 15,
"targetType": "CREATURE",
"anim" : 64,
"animation":{
"projectile": [
{"minimumAngle": 0 ,"defName":"C20SPX4"},
{"minimumAngle": 0.60 ,"defName":"C20SPX3"},
{"minimumAngle": 0.90 ,"defName":"C20SPX2"},
{"minimumAngle": 1.20 ,"defName":"C20SPX1"},
{"minimumAngle": 1.50 ,"defName":"C20SPX0"}
],
"hit":["C20SPX"]
},
"sounds": {
"cast": "MAGICBLT"
},
@ -25,6 +35,16 @@
"index" : 16,
"targetType": "CREATURE",
"anim" : 46,
"animation":{
"projectile": [
{"minimumAngle": 0 ,"defName":"C08SPW4"},
{"minimumAngle": 0.60 ,"defName":"C08SPW3"},
{"minimumAngle": 0.90 ,"defName":"C08SPW2"},
{"minimumAngle": 1.20 ,"defName":"C08SPW1"},
{"minimumAngle": 1.50 ,"defName":"C08SPW0"}
],
"hit":["C08SPW5"]
},
"sounds": {
"cast": "ICERAY"
},
@ -47,6 +67,9 @@
"index" : 17,
"targetType": "CREATURE",
"anim" : 38,
"animation":{
"hit":["C03SPA0", "C11SPA1"]
},
"sounds": {
"cast": "LIGHTBLT"
},
@ -69,6 +92,9 @@
"index" : 18,
"targetType": "CREATURE",
"anim" : 10,
"animation":{
"affect":["C05SPE0"]
},
"sounds": {
"cast": "DECAY"
},
@ -92,6 +118,9 @@
"index" : 19,
"targetType": "CREATURE",
"anim" : 38,
"animation":{
"affect":["C03SPA0", "C11SPA1"]
},
"sounds": {
"cast": "CHAINLTE"
},
@ -111,6 +140,9 @@
"index" : 20,
"targetType": "LOCATION",
"anim" : 45,
"animation":{
"hit":["C07SPW"] //C07SPW0 ???
},
"sounds": {
"cast": "FROSTING"
},
@ -133,6 +165,9 @@
"index" : 21,
"targetType": "LOCATION",
"anim" : 53,
"animation":{
"hit":["C13SPF"] //C13SPF0 ???
},
"sounds": {
"cast": "FIREBALL"
},
@ -155,6 +190,9 @@
"index" : 22,
"targetType": "LOCATION",
"anim" : 9,
"animation":{
"hit":["C04SPF0"]
},
"sounds": {
"cast": "FIREBLST"
},
@ -177,6 +215,9 @@
"index" : 23,
"targetType": "LOCATION",
"anim" : 16,
"animation":{
"hit":["C08SPE0"]
},
"sounds": {
"cast": "METEOR"
},
@ -199,6 +240,9 @@
"index" : 24,
"targetType" : "CREATURE",
"anim" : 8,
"animation":{
"affect":["C04SPE0"]
},
"sounds": {
"cast": "DEATHRIP"
},
@ -225,6 +269,9 @@
"index" : 25,
"targetType" : "CREATURE",
"anim" : 29,
"animation":{
"affect":["C14SPA0"]
},
"sounds": {
"cast": "COLDRING"
},
@ -250,6 +297,9 @@
"index" : 26,
"targetType" : "CREATURE",
"anim" : 12,
"animation":{
"hit":["C06SPF0"]
},
"sounds": {
"cast": "ARMGEDN"
},
@ -272,6 +322,9 @@
"index" : 57,
"targetType" : "CREATURE",
"anim" : 38,
"animation":{
"hit":["C03SPA0", "C11SPA1"]
},
"sounds": {
"cast": "LIGHTBLT"
},

View File

@ -98,6 +98,9 @@
"index" : 35,
"targetType" : "CREATURE",
"anim" : 41,
"animation":{
"affect":["C05SPW"] //C05SPW0
},
"sounds": {
"cast": "DISPELL"
},
@ -116,6 +119,9 @@
"cure" : {
"index" : 37,
"targetType" : "CREATURE",
"animation":{
"affect":["C03SPW"]//C03SPW0
},
"anim" : 39,
"sounds": {
"cast": "CURE"
@ -137,6 +143,9 @@
"index" : 38,
"targetType" : "CREATURE",
"anim" : 79,
"animation":{
"affect":["C01SPE0"]
},
"sounds": {
"cast": "RESURECT"
},
@ -159,6 +168,9 @@
"index" : 39,
"targetType" : "CREATURE",
"anim" : 79,
"animation":{
"affect":["C01SPE0"]
},
"sounds": {
"cast": "ANIMDEAD"
},
@ -180,6 +192,9 @@
"index" : 40,
"targetType" : "CREATURE",
"anim" : 79,
"animation":{
"affect":["C01SPE0"]
},
"sounds": {
"cast": "SACRIF1"
},

View File

@ -3,6 +3,9 @@
"index" : 27,
"targetType" : "CREATURE",
"anim" : 27,
"animation":{
"affect":["C13SPE0"]
},
"sounds": {
"cast": "SHIELD"
},
@ -30,6 +33,9 @@
"index" : 28,
"targetType" : "CREATURE",
"anim" : 2,
"animation":{
"affect":["C01SPA0"]
},
"sounds": {
"cast": "AIRSHELD"
},
@ -57,6 +63,9 @@
"index" : 29,
"targetType" : "CREATURE",
"anim" : 11,
"animation":{
"affect":["C05SPF0"]
},
"sounds": {
"cast": "FIRESHIE"
},
@ -86,6 +95,9 @@
"index" : 30,
"targetType" : "CREATURE",
"anim" : 22,
"animation":{
"affect":["C11SPE0"]
},
"sounds": {
"cast": "PROTECTA"
},
@ -113,6 +125,9 @@
"index" : 31,
"targetType" : "CREATURE",
"anim" : 24,
"animation":{
"affect":["C11SPW0"]
},
"sounds": {
"cast": "PROTECTF"
},
@ -140,6 +155,9 @@
"index" : 32,
"targetType" : "CREATURE",
"anim" : 23,
"animation":{
"affect":["C11SPF0"]
},
"sounds": {
"cast": "PROTECTW"
},
@ -167,6 +185,9 @@
"index" : 33,
"targetType" : "CREATURE",
"anim" : 26,
"animation":{
"affect":["C13SPA0"]
},
"sounds": {
"cast": "PROTECTE"
},
@ -194,6 +215,9 @@
"index" : 34,
"targetType" : "CREATURE",
"anim" : 5,
"animation":{
"affect":["C02SPE0"]
},
"sounds": {
"cast": "ANTIMAGK"
},
@ -234,6 +258,9 @@
"index" : 36,
"targetType" : "CREATURE",
"anim" : 3,
"animation":{
"affect":["C02SPA0"]
},
"sounds": {
"cast": "BACKLASH"
},
@ -254,11 +281,13 @@
"positive": true
}
},
"bless" : {
"index" : 41,
"targetType" : "CREATURE",
"anim" : 36,
"animation":{
"affect":["C01SPW"] //C01SPW0
},
"sounds": {
"cast": "BLESS"
},
@ -294,6 +323,9 @@
"index" : 42,
"targetType" : "CREATURE",
"anim" : 40,
"animation":{
"affect":["C04SPW"]//C04SPW0
},
"sounds": {
"cast": "CURSE"
},
@ -330,6 +362,9 @@
"index" : 43,
"targetType" : "CREATURE",
"anim" : 4,
"animation":{
"affect":["SP12_"] //???
},
"sounds": {
"cast": "BLOODLUS"
},
@ -374,6 +409,9 @@
"index" : 44,
"targetType" : "CREATURE",
"anim" : 25,
"animation":{
"affect":["C12SPA0"]
},
"sounds": {
"cast": "PRECISON"
},
@ -418,6 +456,9 @@
"index" : 45,
"targetType" : "CREATURE",
"anim" : 56,
"animation":{
"affect":["C0ACID"]
},
"sounds": {
"cast": "WEAKNESS"
},
@ -462,6 +503,9 @@
"index" : 46,
"targetType" : "CREATURE",
"anim" : 54,
"animation":{
"affect":["C16SPE"] //C16SPE0
},
"sounds": {
"cast": "TUFFSKIN"
},
@ -502,6 +546,10 @@
"index" : 47,
"targetType" : "CREATURE",
"anim" : 14,
"animation":{
"affect":["C07SPA1"],
"projectile":[{"defName":"C07SPA0"}]//???
},
"sounds": {
"cast": "DISRUPTR"
},
@ -542,6 +590,9 @@
"index" : 48,
"targetType" : "CREATURE",
"anim" : 0,
"animation":{
"affect":["C10SPW"]
},
"sounds": {
"cast": "PRAYER"
},
@ -606,6 +657,9 @@
"index" : 49,
"targetType" : "CREATURE",
"anim" : 20,
"animation":{
"affect":["C09SPW0"]
},
"sounds": {
"cast": "MIRTH"
},
@ -655,6 +709,9 @@
"index" : 50,
"targetType" : "CREATURE",
"anim" : 30,
"animation":{
"affect":["C14SPE0"]
},
"sounds": {
"cast": "SORROW"
},
@ -704,6 +761,9 @@
"index" : 51,
"targetType" : "CREATURE",
"anim" : 18,
"animation":{
"affect":["C09SPA0"]
},
"sounds": {
"cast": "FORTUNE"
},
@ -746,6 +806,9 @@
"index" : 52,
"targetType" : "CREATURE",
"anim" : 48,
"animation":{
"affect":["C10SPF0"]
},
"sounds": {
"cast": "MISFORT"
},
@ -788,6 +851,9 @@
"index" : 53,
"targetType" : "CREATURE",
"anim" : 31,
"animation":{
"affect":["C15SPA0"]
},
"sounds": {
"cast": "HASTE"
},
@ -834,6 +900,9 @@
"index" : 54,
"targetType" : "CREATURE",
"anim" : 19,
"animation":{
"affect":["C09SPE0"]
},
"sounds": {
"cast": "MUCKMIRE"
},
@ -882,6 +951,9 @@
"index" : 55,
"targetType" : "CREATURE",
"anim" : 28,
"animation":{
"affect":["C13SPW0"]
},
"sounds": {
"cast": "SLAYER"
},
@ -933,6 +1005,9 @@
"index" : 56,
"targetType" : "CREATURE",
"anim" : 17,
"animation":{
"affect":["C08SPF0"]
},
"sounds": {
"cast": "FRENZY"
},
@ -972,6 +1047,9 @@
"index" : 58,
"targetType" : "CREATURE",
"anim" : 7,
"animation":{
"affect":["C04SPA0"]
},
"sounds": {
"cast": "CNTRSTRK"
},
@ -1011,6 +1089,9 @@
"index" : 59,
"targetType" : "CREATURE",
"anim" : 35,
"animation":{
"affect":["C01SPF"] //C01SPF0
},
"sounds": {
"cast": "BERSERK"
},
@ -1070,6 +1151,9 @@
"index" : 60,
"targetType" : "CREATURE",
"anim" : 21,
"animation":{
"affect":["C10SPA0"]
},
"sounds": {
"cast": "HYPNOTIZ"
},
@ -1127,6 +1211,9 @@
"index" : 61,
"targetType" : "CREATURE",
"anim" : 42,
"animation":{
"affect":["C06SPW"]//C06SPW0
},
"sounds": {
"cast": "FORGET"
},
@ -1187,6 +1274,9 @@
"index" : 62,
"targetType" : "CREATURE",
"anim" : 6,
"animation":{
"affect":["C02SPF0"]
},
"sounds": {
"cast": "BLIND"
},

View File

@ -549,6 +549,35 @@ void CSpell::setupMechanics()
mechanics = ISpellMechanics::createMechanics(this);
}
///CSpell::AnimationInfo
CSpell::AnimationInfo::AnimationInfo()
{
}
CSpell::AnimationInfo::~AnimationInfo()
{
}
std::string CSpell::AnimationInfo::selectProjectile(const double angle) const
{
std::string res;
double maximum = 0.0;
for(const auto & info : projectile)
{
if(info.minimumAngle < angle && info.minimumAngle > maximum)
{
maximum = info.minimumAngle;
res = info.defName;
}
}
return std::move(res);
}
///CSpell::TargetInfo
CSpell::TargetInfo::TargetInfo(const CSpell * spell, const int level)
{

View File

@ -68,15 +68,58 @@ public:
int usedSpellPower;
ECastingMode::ECastingMode mode;
const CStack * casterStack;
const CStack * selectedStack;
const BattleInfo * cb;
const CStack * selectedStack;
const BattleInfo * cb;
};
class DLL_LINKAGE CSpell
{
public:
struct ProjectileInfo
{
///in radians. Only positive value. Negative angle is handled by vertical flip
double minimumAngle;
///resource name
std::string defName;
template <typename Handler> void serialize(Handler &h, const int version)
{
h & minimumAngle & defName;
}
};
typedef std::string TAnimation;
typedef std::vector<TAnimation> TAnimationQueue;
struct AnimationInfo
{
AnimationInfo();
~AnimationInfo();
///displayed on all affected targets.
TAnimationQueue affect;
///displayed on caster.
TAnimationQueue cast;
///displayed on target hex. If spell was casted with no target selection displayed on entire battlefield (f.e. ARMAGEDDON)
TAnimationQueue hit;
///displayed "between" caster and (first) target. Ignored if spell was casted with no target selection.
///use selectProjectile to access
std::vector<ProjectileInfo> projectile;
template <typename Handler> void serialize(Handler &h, const int version)
{
h & projectile & hit & cast;
}
std::string selectProjectile(const double angle) const;
} animationInfo;
public:
struct LevelInfo
{
@ -157,13 +200,10 @@ public:
CSpell();
~CSpell();
//void adventureCast() const;
void battleCast(const SpellCastEnvironment * env, BattleSpellCastParameters & parameters) const;
bool isCastableBy(const IBonusBearer * caster, bool hasSpellBook, const std::set<SpellID> & spellBook) const;
std::vector<BattleHex> rangeInHexes(BattleHex centralHex, ui8 schoolLvl, ui8 side, bool *outDroppedHexes = nullptr ) const; //convert range to specific hexes; last optional out parameter is set to true, if spell would cover unavailable hexes (that are not included in ret)
si16 mainEffectAnim; //main spell effect animation, in AC format (or -1 when none)
si16 mainEffectAnim; //main spell effect animation, in AC format (or -1 when none) DEPRECATED
ETargetType getTargetType() const; //deprecated
CSpell::TargetInfo getTargetInfo(const int level) const;
@ -243,22 +283,29 @@ public:
h & immunities & limiters & absoluteImmunities & absoluteLimiters;
h & iconImmune;
h & defaultProbability;
h & isSpecial;
h & castSound & iconBook & iconEffect & iconScenarioBonus & iconScroll;
h & levels;
h & school;
h & animationInfo;
h & levels;
h & school;
if(!h.saving)
setup();
}
friend class CSpellHandler;
friend class Graphics;
public:
///Server logic. Has write access to GameState via packets.
///May be executed on client side by (future) non-cheat-proof scripts.
//void adventureCast() const;
void battleCast(const SpellCastEnvironment * env, BattleSpellCastParameters & parameters) const;
public:
///Client-Server events. Shall be called only when applying packets
///Client-server logic. Has direct write access to GameState.
///Shall be called (only) when applying packets on BOTH SIDES
///implementation of BattleSpellCast applying
void afterCast(BattleInfo * battle, const BattleSpellCast * packet) const;
private: