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

View File

@ -8,6 +8,33 @@
"definitions" : { "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" :{ "flags" :{
"type" : "object", "type" : "object",
"additionalProperties" : { "additionalProperties" : {
@ -124,9 +151,9 @@
"type": "object", "type": "object",
"description": "Chance in % to gain for faction. NOTE: this field is merged with faction config", "description": "Chance in % to gain for faction. NOTE: this field is merged with faction config",
"additionalProperties" : { "additionalProperties" : {
"type": "number", "type": "number",
"minimum" : 0 "minimum" : 0
} }
}, },
"targetType":{ "targetType":{
"type": "string", "type": "string",
@ -193,6 +220,9 @@
"$ref" : "#/definitions/flags", "$ref" : "#/definitions/flags",
"description": "flags structure of bonus names, presence of all bonuses required to be affected by, can't be negated." "description": "flags structure of bonus names, presence of all bonuses required to be affected by, can't be negated."
}, },
"animation":{"$ref": "#/definitions/animation"},
"graphics":{ "graphics":{
"type": "object", "type": "object",
"additionalProperties" : false, "additionalProperties" : false,

View File

@ -3,6 +3,16 @@
"index" : 15, "index" : 15,
"targetType": "CREATURE", "targetType": "CREATURE",
"anim" : 64, "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": { "sounds": {
"cast": "MAGICBLT" "cast": "MAGICBLT"
}, },
@ -25,6 +35,16 @@
"index" : 16, "index" : 16,
"targetType": "CREATURE", "targetType": "CREATURE",
"anim" : 46, "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": { "sounds": {
"cast": "ICERAY" "cast": "ICERAY"
}, },
@ -47,6 +67,9 @@
"index" : 17, "index" : 17,
"targetType": "CREATURE", "targetType": "CREATURE",
"anim" : 38, "anim" : 38,
"animation":{
"hit":["C03SPA0", "C11SPA1"]
},
"sounds": { "sounds": {
"cast": "LIGHTBLT" "cast": "LIGHTBLT"
}, },
@ -69,6 +92,9 @@
"index" : 18, "index" : 18,
"targetType": "CREATURE", "targetType": "CREATURE",
"anim" : 10, "anim" : 10,
"animation":{
"affect":["C05SPE0"]
},
"sounds": { "sounds": {
"cast": "DECAY" "cast": "DECAY"
}, },
@ -92,6 +118,9 @@
"index" : 19, "index" : 19,
"targetType": "CREATURE", "targetType": "CREATURE",
"anim" : 38, "anim" : 38,
"animation":{
"affect":["C03SPA0", "C11SPA1"]
},
"sounds": { "sounds": {
"cast": "CHAINLTE" "cast": "CHAINLTE"
}, },
@ -111,6 +140,9 @@
"index" : 20, "index" : 20,
"targetType": "LOCATION", "targetType": "LOCATION",
"anim" : 45, "anim" : 45,
"animation":{
"hit":["C07SPW"] //C07SPW0 ???
},
"sounds": { "sounds": {
"cast": "FROSTING" "cast": "FROSTING"
}, },
@ -133,6 +165,9 @@
"index" : 21, "index" : 21,
"targetType": "LOCATION", "targetType": "LOCATION",
"anim" : 53, "anim" : 53,
"animation":{
"hit":["C13SPF"] //C13SPF0 ???
},
"sounds": { "sounds": {
"cast": "FIREBALL" "cast": "FIREBALL"
}, },
@ -155,6 +190,9 @@
"index" : 22, "index" : 22,
"targetType": "LOCATION", "targetType": "LOCATION",
"anim" : 9, "anim" : 9,
"animation":{
"hit":["C04SPF0"]
},
"sounds": { "sounds": {
"cast": "FIREBLST" "cast": "FIREBLST"
}, },
@ -177,6 +215,9 @@
"index" : 23, "index" : 23,
"targetType": "LOCATION", "targetType": "LOCATION",
"anim" : 16, "anim" : 16,
"animation":{
"hit":["C08SPE0"]
},
"sounds": { "sounds": {
"cast": "METEOR" "cast": "METEOR"
}, },
@ -199,6 +240,9 @@
"index" : 24, "index" : 24,
"targetType" : "CREATURE", "targetType" : "CREATURE",
"anim" : 8, "anim" : 8,
"animation":{
"affect":["C04SPE0"]
},
"sounds": { "sounds": {
"cast": "DEATHRIP" "cast": "DEATHRIP"
}, },
@ -225,6 +269,9 @@
"index" : 25, "index" : 25,
"targetType" : "CREATURE", "targetType" : "CREATURE",
"anim" : 29, "anim" : 29,
"animation":{
"affect":["C14SPA0"]
},
"sounds": { "sounds": {
"cast": "COLDRING" "cast": "COLDRING"
}, },
@ -250,6 +297,9 @@
"index" : 26, "index" : 26,
"targetType" : "CREATURE", "targetType" : "CREATURE",
"anim" : 12, "anim" : 12,
"animation":{
"hit":["C06SPF0"]
},
"sounds": { "sounds": {
"cast": "ARMGEDN" "cast": "ARMGEDN"
}, },
@ -272,6 +322,9 @@
"index" : 57, "index" : 57,
"targetType" : "CREATURE", "targetType" : "CREATURE",
"anim" : 38, "anim" : 38,
"animation":{
"hit":["C03SPA0", "C11SPA1"]
},
"sounds": { "sounds": {
"cast": "LIGHTBLT" "cast": "LIGHTBLT"
}, },

View File

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

View File

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

View File

@ -549,6 +549,35 @@ void CSpell::setupMechanics()
mechanics = ISpellMechanics::createMechanics(this); 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
CSpell::TargetInfo::TargetInfo(const CSpell * spell, const int level) CSpell::TargetInfo::TargetInfo(const CSpell * spell, const int level)
{ {

View File

@ -68,15 +68,58 @@ public:
int usedSpellPower; int usedSpellPower;
ECastingMode::ECastingMode mode; ECastingMode::ECastingMode mode;
const CStack * casterStack; const CStack * casterStack;
const CStack * selectedStack; const CStack * selectedStack;
const BattleInfo * cb;
const BattleInfo * cb;
}; };
class DLL_LINKAGE CSpell 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: public:
struct LevelInfo struct LevelInfo
{ {
@ -157,13 +200,10 @@ public:
CSpell(); CSpell();
~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; 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) 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 ETargetType getTargetType() const; //deprecated
CSpell::TargetInfo getTargetInfo(const int level) const; CSpell::TargetInfo getTargetInfo(const int level) const;
@ -243,22 +283,29 @@ public:
h & immunities & limiters & absoluteImmunities & absoluteLimiters; h & immunities & limiters & absoluteImmunities & absoluteLimiters;
h & iconImmune; h & iconImmune;
h & defaultProbability; h & defaultProbability;
h & isSpecial; h & isSpecial;
h & castSound & iconBook & iconEffect & iconScenarioBonus & iconScroll; h & castSound & iconBook & iconEffect & iconScenarioBonus & iconScroll;
h & levels;
h & school;
h & animationInfo;
h & levels;
h & school;
if(!h.saving) if(!h.saving)
setup(); setup();
} }
friend class CSpellHandler; friend class CSpellHandler;
friend class Graphics; 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: 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; void afterCast(BattleInfo * battle, const BattleSpellCast * packet) const;
private: private: