1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-15 11:46:56 +02:00

Introduced new spell configuration options (not used yet)

This commit is contained in:
AlexVinS 2014-11-13 13:37:42 +03:00
parent c7480e7fe5
commit ce8fa33efc
9 changed files with 118 additions and 38 deletions

View File

@ -53,7 +53,17 @@
"smart":{ "smart":{
"type": "boolean", "type": "boolean",
"description": "true: friendly/hostile based on positiveness; false: all targets" "description": "true: friendly/hostile based on positiveness; false: all targets"
} },
"clearTarget":
{
"type": "boolean",
"description": "LOCATION target only. Target hex/tile must be clear"
},
"clearAffected":
{
"type": "boolean",
"description": "LOCATION target only. All affected hexes/tile must be clear"
}
} }
} }
} }
@ -120,7 +130,8 @@
}, },
"targetType":{ "targetType":{
"type": "string", "type": "string",
"enum": ["NO_TARGET","CREATURE","OBSTACLE"] "description": "NO_TARGET - instant cast no aiming, default; CREATURE - target is unit; OBSTACLE - target is OBSTACLE; LOCATION - target is location",
"enum": ["NO_TARGET","CREATURE","OBSTACLE","LOCATION"]
}, },
"anim":{ "anim":{
"type": "number", "type": "number",

View File

@ -1,6 +1,7 @@
{ {
"stoneGaze" : { "stoneGaze" : {
"index" : 70, "index" : 70,
"targetType": "NO_TARGET",
"anim" : 70, "anim" : 70,
"sounds": { "sounds": {
"cast": "PARALYZE" "cast": "PARALYZE"
@ -33,6 +34,7 @@
}, },
"poison" : { "poison" : {
"index" : 71, "index" : 71,
"targetType": "NO_TARGET",
"anim" : 67, "anim" : 67,
"sounds": { "sounds": {
"cast": "POISON" "cast": "POISON"
@ -67,6 +69,7 @@
}, },
"bind" : { "bind" : {
"index" : 72, "index" : 72,
"targetType": "NO_TARGET",
"anim" : 68, "anim" : 68,
"sounds": { "sounds": {
"cast": "BIND" "cast": "BIND"
@ -90,6 +93,7 @@
}, },
"disease" : { "disease" : {
"index" : 73, "index" : 73,
"targetType": "NO_TARGET",
"anim" : 69, "anim" : 69,
"sounds": { "sounds": {
"cast": "DISEASE" "cast": "DISEASE"
@ -124,6 +128,7 @@
}, },
"paralyze" : { "paralyze" : {
"index" : 74, "index" : 74,
"targetType": "NO_TARGET",
"anim" : 70, "anim" : 70,
"sounds": { "sounds": {
"cast": "PARALYZE" "cast": "PARALYZE"
@ -156,6 +161,7 @@
}, },
"age" : { "age" : {
"index" : 75, "index" : 75,
"targetType": "NO_TARGET",
"anim" : 71, "anim" : 71,
"sounds": { "sounds": {
"cast": "AGE" "cast": "AGE"
@ -184,6 +190,7 @@
}, },
"deathCloud" : { "deathCloud" : {
"index" : 76, "index" : 76,
"targetType": "NO_TARGET",
"anim" : 72, "anim" : 72,
"sounds": { "sounds": {
"cast": "DEATHCLD" "cast": "DEATHCLD"
@ -203,6 +210,7 @@
}, },
"thunderbolt" : { "thunderbolt" : {
"index" : 77, "index" : 77,
"targetType": "NO_TARGET",
"anim" : 38, "anim" : 38,
"sounds": { "sounds": {
"cast": "LIGHTBLT" "cast": "LIGHTBLT"
@ -220,6 +228,7 @@
}, },
"dispelHelpful" : { "dispelHelpful" : {
"index" : 78, "index" : 78,
"targetType": "NO_TARGET",
"anim" : 41, "anim" : 41,
"sounds": { "sounds": {
"cast": "DISPELL" "cast": "DISPELL"
@ -236,6 +245,7 @@
}, },
"deathStare" : { "deathStare" : {
"index" : 79, "index" : 79,
"targetType": "NO_TARGET",
"anim" : 80, "anim" : 80,
"sounds": { "sounds": {
"cast": "DEATHSTR" "cast": "DEATHSTR"
@ -255,6 +265,7 @@
}, },
"acidBreath" : { "acidBreath" : {
"index" : 80, "index" : 80,
"targetType": "NO_TARGET",
"anim" : 81, "anim" : 81,
"sounds": { "sounds": {
"cast": "ACID" "cast": "ACID"
@ -280,6 +291,7 @@
}, },
"acidBreathDamage" : { "acidBreathDamage" : {
"index" : 81, "index" : 81,
"targetType": "NO_TARGET",
"anim" : 81, "anim" : 81,
"sounds": { "sounds": {
"cast": "ACID" "cast": "ACID"

View File

@ -2,6 +2,7 @@
"summonBoat" : { "summonBoat" : {
"index" : 0, "index" : 0,
"anim" : -1, "anim" : -1,
"targetType": "NO_TARGET",
"sounds": { "sounds": {
"cast": "SUMMBOAT" "cast": "SUMMBOAT"
}, },
@ -16,6 +17,7 @@
}, },
"scuttleBoat" : { "scuttleBoat" : {
"index" : 1, "index" : 1,
"targetType": "NO_TARGET",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "SCUTBOAT" "cast": "SCUTBOAT"
@ -31,6 +33,7 @@
}, },
"visions" : { "visions" : {
"index" : 2, "index" : 2,
"targetType": "NO_TARGET",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "VISIONS" "cast": "VISIONS"
@ -46,6 +49,7 @@
}, },
"viewEarth" : { "viewEarth" : {
"index" : 3, "index" : 3,
"targetType": "NO_TARGET",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "VIEW" "cast": "VIEW"
@ -61,6 +65,7 @@
}, },
"disguise" : { "disguise" : {
"index" : 4, "index" : 4,
"targetType": "NO_TARGET",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "DISGUISE" "cast": "DISGUISE"
@ -76,6 +81,7 @@
}, },
"viewAir" : { "viewAir" : {
"index" : 5, "index" : 5,
"targetType": "NO_TARGET",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "VIEW" "cast": "VIEW"
@ -91,6 +97,7 @@
}, },
"fly" : { "fly" : {
"index" : 6, "index" : 6,
"targetType": "NO_TARGET",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "FLYSPELL" "cast": "FLYSPELL"
@ -106,6 +113,7 @@
}, },
"waterWalk" : { "waterWalk" : {
"index" : 7, "index" : 7,
"targetType": "NO_TARGET",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "WATRWALK" "cast": "WATRWALK"
@ -121,6 +129,7 @@
}, },
"dimensionDoor" : { "dimensionDoor" : {
"index" : 8, "index" : 8,
"targetType": "LOCATION",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "TELPTOUT" "cast": "TELPTOUT"
@ -136,6 +145,7 @@
}, },
"townPortal" : { "townPortal" : {
"index" : 9, "index" : 9,
"targetType": "NO_TARGET",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "TELPTOUT" "cast": "TELPTOUT"

View File

@ -1,6 +1,7 @@
{ {
"magicArrow" : { "magicArrow" : {
"index" : 15, "index" : 15,
"targetType": "CREATURE",
"anim" : 64, "anim" : 64,
"sounds": { "sounds": {
"cast": "MAGICBLT" "cast": "MAGICBLT"
@ -22,6 +23,7 @@
}, },
"iceBolt" : { "iceBolt" : {
"index" : 16, "index" : 16,
"targetType": "CREATURE",
"anim" : 46, "anim" : 46,
"sounds": { "sounds": {
"cast": "ICERAY" "cast": "ICERAY"
@ -43,6 +45,7 @@
}, },
"lightningBolt" : { "lightningBolt" : {
"index" : 17, "index" : 17,
"targetType": "CREATURE",
"anim" : 38, "anim" : 38,
"sounds": { "sounds": {
"cast": "LIGHTBLT" "cast": "LIGHTBLT"
@ -64,6 +67,7 @@
}, },
"implosion" : { "implosion" : {
"index" : 18, "index" : 18,
"targetType": "CREATURE",
"anim" : 10, "anim" : 10,
"sounds": { "sounds": {
"cast": "DECAY" "cast": "DECAY"
@ -86,6 +90,7 @@
}, },
"chainLightning" : { "chainLightning" : {
"index" : 19, "index" : 19,
"targetType": "CREATURE",
"anim" : 38, "anim" : 38,
"sounds": { "sounds": {
"cast": "CHAINLTE" "cast": "CHAINLTE"
@ -104,6 +109,7 @@
}, },
"frostRing" : { "frostRing" : {
"index" : 20, "index" : 20,
"targetType": "LOCATION",
"anim" : 45, "anim" : 45,
"sounds": { "sounds": {
"cast": "FROSTING" "cast": "FROSTING"
@ -125,6 +131,7 @@
}, },
"fireball" : { "fireball" : {
"index" : 21, "index" : 21,
"targetType": "LOCATION",
"anim" : 53, "anim" : 53,
"sounds": { "sounds": {
"cast": "FIREBALL" "cast": "FIREBALL"
@ -146,6 +153,7 @@
}, },
"inferno" : { "inferno" : {
"index" : 22, "index" : 22,
"targetType": "LOCATION",
"anim" : 9, "anim" : 9,
"sounds": { "sounds": {
"cast": "FIREBLST" "cast": "FIREBLST"
@ -167,6 +175,7 @@
}, },
"meteorShower" : { "meteorShower" : {
"index" : 23, "index" : 23,
"targetType": "LOCATION",
"anim" : 16, "anim" : 16,
"sounds": { "sounds": {
"cast": "METEOR" "cast": "METEOR"
@ -261,6 +270,7 @@
}, },
"titanBolt" : { "titanBolt" : {
"index" : 57, "index" : 57,
"targetType" : "CREATURE",
"anim" : 38, "anim" : 38,
"sounds": { "sounds": {
"cast": "LIGHTBLT" "cast": "LIGHTBLT"
@ -277,5 +287,5 @@
"negative": true, "negative": true,
"special": true "special": true
} }
}, }
} }

View File

@ -1,6 +1,7 @@
{ {
"quicksand" : { "quicksand" : {
"index" : 10, "index" : 10,
"targetType" : "NO_TARGET",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "QUIKSAND" "cast": "QUIKSAND"
@ -16,6 +17,7 @@
}, },
"landMine" : { "landMine" : {
"index" : 11, "index" : 11,
"targetType" : "NO_TARGET",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "" "cast": ""
@ -35,13 +37,17 @@
}, },
"forceField" : { "forceField" : {
"index" : 12, "index" : 12,
"targetType" : "LOCATION",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "FORCEFLD" "cast": "FORCEFLD"
}, },
"levels" : { "levels" : {
"base":{ "base":{
"range" : "0" "range" : "0",
"targetModifier":{
"clearAffected": true
}
} }
}, },
"flags" : { "flags" : {
@ -50,13 +56,17 @@
}, },
"fireWall" : { "fireWall" : {
"index" : 13, "index" : 13,
"targetType" : "LOCATION",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "FIREWALL" "cast": "FIREWALL"
}, },
"levels" : { "levels" : {
"base":{ "base":{
"range" : "0" "range" : "0",
"targetModifier":{
"clearAffected": true
}
} }
}, },
"flags" : { "flags" : {
@ -69,6 +79,7 @@
}, },
"earthquake" : { "earthquake" : {
"index" : 14, "index" : 14,
"targetType" : "NO_TARGET",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "ERTHQUAK" "cast": "ERTHQUAK"
@ -85,6 +96,7 @@
"dispel" : { "dispel" : {
"index" : 35, "index" : 35,
"targetType" : "CREATURE",
"anim" : 41, "anim" : 41,
"sounds": { "sounds": {
"cast": "DISPELL" "cast": "DISPELL"
@ -103,6 +115,7 @@
}, },
"cure" : { "cure" : {
"index" : 37, "index" : 37,
"targetType" : "CREATURE",
"anim" : 39, "anim" : 39,
"sounds": { "sounds": {
"cast": "CURE" "cast": "CURE"
@ -122,6 +135,7 @@
}, },
"resurrection" : { "resurrection" : {
"index" : 38, "index" : 38,
"targetType" : "CREATURE",
"anim" : 79, "anim" : 79,
"sounds": { "sounds": {
"cast": "RESURECT" "cast": "RESURECT"
@ -143,6 +157,7 @@
}, },
"animateDead" : { "animateDead" : {
"index" : 39, "index" : 39,
"targetType" : "CREATURE",
"anim" : 79, "anim" : 79,
"sounds": { "sounds": {
"cast": "ANIMDEAD" "cast": "ANIMDEAD"
@ -163,6 +178,7 @@
}, },
"sacrifice" : { "sacrifice" : {
"index" : 40, "index" : 40,
"targetType" : "CREATURE",
"anim" : 79, "anim" : 79,
"sounds": { "sounds": {
"cast": "SACRIF1" "cast": "SACRIF1"
@ -184,6 +200,7 @@
}, },
"teleport" : { "teleport" : {
"index" : 63, "index" : 63,
"targetType" : "CREATURE",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "TELPTOUT" "cast": "TELPTOUT"
@ -203,6 +220,7 @@
}, },
"removeObstacle" : { "removeObstacle" : {
"index" : 64, "index" : 64,
"targetType" : "OBSTACLE",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "REMOVEOB" "cast": "REMOVEOB"
@ -218,6 +236,7 @@
}, },
"clone" : { "clone" : {
"index" : 65, "index" : 65,
"targetType" : "CREATURE",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "CLONE" "cast": "CLONE"
@ -237,6 +256,7 @@
}, },
"fireElemental" : { "fireElemental" : {
"index" : 66, "index" : 66,
"targetType" : "NO_TARGET",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "SUMNELM" "cast": "SUMNELM"
@ -252,6 +272,7 @@
}, },
"earthElemental" : { "earthElemental" : {
"index" : 67, "index" : 67,
"targetType" : "NO_TARGET",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "SUMNELM" "cast": "SUMNELM"
@ -267,6 +288,7 @@
}, },
"waterElemental" : { "waterElemental" : {
"index" : 68, "index" : 68,
"targetType" : "NO_TARGET",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "SUMNELM" "cast": "SUMNELM"
@ -282,6 +304,7 @@
}, },
"airElemental" : { "airElemental" : {
"index" : 69, "index" : 69,
"targetType" : "NO_TARGET",
"anim" : -1, "anim" : -1,
"sounds": { "sounds": {
"cast": "SUMNELM" "cast": "SUMNELM"

View File

@ -1,6 +1,7 @@
{ {
"shield" : { "shield" : {
"index" : 27, "index" : 27,
"targetType" : "CREATURE",
"anim" : 27, "anim" : 27,
"sounds": { "sounds": {
"cast": "SHIELD" "cast": "SHIELD"
@ -27,6 +28,7 @@
}, },
"airShield" : { "airShield" : {
"index" : 28, "index" : 28,
"targetType" : "CREATURE",
"anim" : 2, "anim" : 2,
"sounds": { "sounds": {
"cast": "AIRSHELD" "cast": "AIRSHELD"
@ -53,6 +55,7 @@
}, },
"fireShield" : { "fireShield" : {
"index" : 29, "index" : 29,
"targetType" : "CREATURE",
"anim" : 11, "anim" : 11,
"sounds": { "sounds": {
"cast": "FIRESHIE" "cast": "FIRESHIE"
@ -81,6 +84,7 @@
}, },
"protectAir" : { "protectAir" : {
"index" : 30, "index" : 30,
"targetType" : "CREATURE",
"anim" : 22, "anim" : 22,
"sounds": { "sounds": {
"cast": "PROTECTA" "cast": "PROTECTA"
@ -107,6 +111,7 @@
}, },
"protectFire" : { "protectFire" : {
"index" : 31, "index" : 31,
"targetType" : "CREATURE",
"anim" : 24, "anim" : 24,
"sounds": { "sounds": {
"cast": "PROTECTF" "cast": "PROTECTF"
@ -133,6 +138,7 @@
}, },
"protectWater" : { "protectWater" : {
"index" : 32, "index" : 32,
"targetType" : "CREATURE",
"anim" : 23, "anim" : 23,
"sounds": { "sounds": {
"cast": "PROTECTW" "cast": "PROTECTW"
@ -159,6 +165,7 @@
}, },
"protectEarth" : { "protectEarth" : {
"index" : 33, "index" : 33,
"targetType" : "CREATURE",
"anim" : 26, "anim" : 26,
"sounds": { "sounds": {
"cast": "PROTECTE" "cast": "PROTECTE"
@ -185,6 +192,7 @@
}, },
"antiMagic" : { "antiMagic" : {
"index" : 34, "index" : 34,
"targetType" : "CREATURE",
"anim" : 5, "anim" : 5,
"sounds": { "sounds": {
"cast": "ANTIMAGK" "cast": "ANTIMAGK"
@ -224,6 +232,7 @@
"magicMirror" : { "magicMirror" : {
"index" : 36, "index" : 36,
"targetType" : "CREATURE",
"anim" : 3, "anim" : 3,
"sounds": { "sounds": {
"cast": "BACKLASH" "cast": "BACKLASH"
@ -248,6 +257,7 @@
"bless" : { "bless" : {
"index" : 41, "index" : 41,
"targetType" : "CREATURE",
"anim" : 36, "anim" : 36,
"sounds": { "sounds": {
"cast": "BLESS" "cast": "BLESS"
@ -282,6 +292,7 @@
}, },
"curse" : { "curse" : {
"index" : 42, "index" : 42,
"targetType" : "CREATURE",
"anim" : 40, "anim" : 40,
"sounds": { "sounds": {
"cast": "CURSE" "cast": "CURSE"
@ -317,6 +328,7 @@
}, },
"bloodlust" : { "bloodlust" : {
"index" : 43, "index" : 43,
"targetType" : "CREATURE",
"anim" : 4, "anim" : 4,
"sounds": { "sounds": {
"cast": "BLOODLUS" "cast": "BLOODLUS"
@ -360,6 +372,7 @@
}, },
"precision" : { "precision" : {
"index" : 44, "index" : 44,
"targetType" : "CREATURE",
"anim" : 25, "anim" : 25,
"sounds": { "sounds": {
"cast": "PRECISON" "cast": "PRECISON"
@ -403,6 +416,7 @@
}, },
"weakness" : { "weakness" : {
"index" : 45, "index" : 45,
"targetType" : "CREATURE",
"anim" : 56, "anim" : 56,
"sounds": { "sounds": {
"cast": "WEAKNESS" "cast": "WEAKNESS"
@ -446,6 +460,7 @@
}, },
"stoneSkin" : { "stoneSkin" : {
"index" : 46, "index" : 46,
"targetType" : "CREATURE",
"anim" : 54, "anim" : 54,
"sounds": { "sounds": {
"cast": "TUFFSKIN" "cast": "TUFFSKIN"
@ -485,7 +500,7 @@
}, },
"disruptingRay" : { "disruptingRay" : {
"index" : 47, "index" : 47,
"targetType" : "CREATURE", //fix, dont remove "targetType" : "CREATURE",
"anim" : 14, "anim" : 14,
"sounds": { "sounds": {
"cast": "DISRUPTR" "cast": "DISRUPTR"
@ -525,6 +540,7 @@
}, },
"prayer" : { "prayer" : {
"index" : 48, "index" : 48,
"targetType" : "CREATURE",
"anim" : 0, "anim" : 0,
"sounds": { "sounds": {
"cast": "PRAYER" "cast": "PRAYER"
@ -588,6 +604,7 @@
}, },
"mirth" : { "mirth" : {
"index" : 49, "index" : 49,
"targetType" : "CREATURE",
"anim" : 20, "anim" : 20,
"sounds": { "sounds": {
"cast": "MIRTH" "cast": "MIRTH"
@ -636,6 +653,7 @@
}, },
"sorrow" : { "sorrow" : {
"index" : 50, "index" : 50,
"targetType" : "CREATURE",
"anim" : 30, "anim" : 30,
"sounds": { "sounds": {
"cast": "SORROW" "cast": "SORROW"
@ -684,6 +702,7 @@
}, },
"fortune" : { "fortune" : {
"index" : 51, "index" : 51,
"targetType" : "CREATURE",
"anim" : 18, "anim" : 18,
"sounds": { "sounds": {
"cast": "FORTUNE" "cast": "FORTUNE"
@ -725,6 +744,7 @@
}, },
"misfortune" : { "misfortune" : {
"index" : 52, "index" : 52,
"targetType" : "CREATURE",
"anim" : 48, "anim" : 48,
"sounds": { "sounds": {
"cast": "MISFORT" "cast": "MISFORT"
@ -766,6 +786,7 @@
}, },
"haste" : { "haste" : {
"index" : 53, "index" : 53,
"targetType" : "CREATURE",
"anim" : 31, "anim" : 31,
"sounds": { "sounds": {
"cast": "HASTE" "cast": "HASTE"
@ -811,6 +832,7 @@
}, },
"slow" : { "slow" : {
"index" : 54, "index" : 54,
"targetType" : "CREATURE",
"anim" : 19, "anim" : 19,
"sounds": { "sounds": {
"cast": "MUCKMIRE" "cast": "MUCKMIRE"
@ -858,6 +880,7 @@
}, },
"slayer" : { "slayer" : {
"index" : 55, "index" : 55,
"targetType" : "CREATURE",
"anim" : 28, "anim" : 28,
"sounds": { "sounds": {
"cast": "SLAYER" "cast": "SLAYER"
@ -908,6 +931,7 @@
}, },
"frenzy" : { "frenzy" : {
"index" : 56, "index" : 56,
"targetType" : "CREATURE",
"anim" : 17, "anim" : 17,
"sounds": { "sounds": {
"cast": "FRENZY" "cast": "FRENZY"
@ -946,6 +970,7 @@
"counterstrike" : { "counterstrike" : {
"index" : 58, "index" : 58,
"targetType" : "CREATURE",
"anim" : 7, "anim" : 7,
"sounds": { "sounds": {
"cast": "CNTRSTRK" "cast": "CNTRSTRK"
@ -984,6 +1009,7 @@
}, },
"berserk" : { "berserk" : {
"index" : 59, "index" : 59,
"targetType" : "CREATURE",
"anim" : 35, "anim" : 35,
"sounds": { "sounds": {
"cast": "BERSERK" "cast": "BERSERK"
@ -1042,6 +1068,7 @@
}, },
"hypnotize" : { "hypnotize" : {
"index" : 60, "index" : 60,
"targetType" : "CREATURE",
"anim" : 21, "anim" : 21,
"sounds": { "sounds": {
"cast": "HYPNOTIZ" "cast": "HYPNOTIZ"
@ -1158,6 +1185,7 @@
}, },
"blind" : { "blind" : {
"index" : 62, "index" : 62,
"targetType" : "CREATURE",
"anim" : 6, "anim" : 6,
"sounds": { "sounds": {
"cast": "BLIND" "cast": "BLIND"

View File

@ -35,7 +35,7 @@ namespace SpellConfig
///CSpell::LevelInfo ///CSpell::LevelInfo
CSpell::LevelInfo::LevelInfo() CSpell::LevelInfo::LevelInfo()
:description(""),cost(0),power(0),AIValue(0),smartTarget(true),range("0") :description(""),cost(0),power(0),AIValue(0),smartTarget(true), clearTarget(false), clearAffected(false), range("0")
{ {
} }
@ -587,17 +587,7 @@ std::vector<JsonNode> CSpellHandler::loadLegacyData(size_t dataSize)
for(size_t i = 0; i < GameConstants::SPELL_SCHOOL_LEVELS ; i++) for(size_t i = 0; i < GameConstants::SPELL_SCHOOL_LEVELS ; i++)
descriptions.push_back(parser.readString()); descriptions.push_back(parser.readString());
std::string attributes = parser.readString(); parser.readString(); //ignore attributes. All data present in JSON
std::string targetType = "NO_TARGET";
if(attributes.find("CREATURE_TARGET_1") != std::string::npos
|| attributes.find("CREATURE_TARGET_2") != std::string::npos)
targetType = "CREATURE_EXPERT_MASSIVE";
else if(attributes.find("CREATURE_TARGET") != std::string::npos)
targetType = "CREATURE";
else if(attributes.find("OBSTACLE_TARGET") != std::string::npos)
targetType = "OBSTACLE";
//save parsed level specific data //save parsed level specific data
for(size_t i = 0; i < GameConstants::SPELL_SCHOOL_LEVELS; i++) for(size_t i = 0; i < GameConstants::SPELL_SCHOOL_LEVELS; i++)
@ -609,16 +599,6 @@ std::vector<JsonNode> CSpellHandler::loadLegacyData(size_t dataSize)
level["aiValue"].Float() = AIVals[i]; level["aiValue"].Float() = AIVals[i];
} }
if(targetType == "CREATURE_EXPERT_MASSIVE")
{
lineNode["targetType"].String() = "CREATURE";
getLevel(3)["range"].String() = "X";
}
else
{
lineNode["targetType"].String() = targetType;
}
legacyData.push_back(lineNode); legacyData.push_back(lineNode);
@ -708,6 +688,8 @@ CSpell * CSpellHandler::loadFromJson(const JsonNode& json)
spell->targetType = CSpell::CREATURE; spell->targetType = CSpell::CREATURE;
else if(targetType == "OBSTACLE") else if(targetType == "OBSTACLE")
spell->targetType = CSpell::OBSTACLE; spell->targetType = CSpell::OBSTACLE;
else if(targetType == "LOCATION")
spell->targetType = CSpell::LOCATION;
else else
logGlobal->warnStream() << "Spell " << spell->name << ". Target type " << (targetType.empty() ? "empty" : "unknown ("+targetType+")") << ". Assumed NO_TARGET."; logGlobal->warnStream() << "Spell " << spell->name << ". Target type " << (targetType.empty() ? "empty" : "unknown ("+targetType+")") << ". Assumed NO_TARGET.";
@ -812,14 +794,15 @@ CSpell * CSpellHandler::loadFromJson(const JsonNode& json)
CSpell::LevelInfo & levelObject = spell->levels[levelIndex]; CSpell::LevelInfo & levelObject = spell->levels[levelIndex];
const si32 levelPower = levelNode["power"].Float(); const si32 levelPower = levelObject.power = levelNode["power"].Float();
levelObject.description = levelNode["description"].String(); levelObject.description = levelNode["description"].String();
levelObject.cost = levelNode["cost"].Float(); levelObject.cost = levelNode["cost"].Float();
levelObject.power = levelPower; levelObject.AIValue = levelNode["aiValue"].Float();
levelObject.AIValue = levelNode["aiValue"].Float(); levelObject.smartTarget = levelNode["targetModifier"]["smart"].Bool();
levelObject.smartTarget = levelNode["targetModifier"]["smart"].Bool(); levelObject.clearTarget = levelNode["targetModifier"]["clearTarget"].Bool();
levelObject.range = levelNode["range"].String(); levelObject.clearAffected = levelNode["targetModifier"]["clearAffected"].Bool();
levelObject.range = levelNode["range"].String();
for(const auto & elem : levelNode["effects"].Struct()) for(const auto & elem : levelNode["effects"].Struct())
{ {

View File

@ -103,6 +103,8 @@ public:
si32 AIValue; //AI values: per skill level: 0 - none, 1 - basic, etc si32 AIValue; //AI values: per skill level: 0 - none, 1 - basic, etc
bool smartTarget; bool smartTarget;
bool clearTarget;
bool clearAffected;
std::string range; std::string range;
std::vector<Bonus> effects; std::vector<Bonus> effects;
@ -113,6 +115,7 @@ public:
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {
h & description & cost & power & AIValue & smartTarget & range & effects; h & description & cost & power & AIValue & smartTarget & range & effects;
h & clearTarget & clearAffected;
} }
}; };
@ -124,7 +127,7 @@ public:
*/ */
const CSpell::LevelInfo& getLevelInfo(const int level) const; const CSpell::LevelInfo& getLevelInfo(const int level) const;
public: public:
enum ETargetType {NO_TARGET, CREATURE, OBSTACLE}; enum ETargetType {NO_TARGET, CREATURE, OBSTACLE, LOCATION};
enum ESpellPositiveness {NEGATIVE = -1, NEUTRAL = 0, POSITIVE = 1}; enum ESpellPositiveness {NEGATIVE = -1, NEUTRAL = 0, POSITIVE = 1};
struct TargetInfo struct TargetInfo

View File

@ -27,7 +27,7 @@
#include "mapping/CCampaignHandler.h" //for CCampaignState #include "mapping/CCampaignHandler.h" //for CCampaignState
#include "rmg/CMapGenerator.h" // for CMapGenOptions #include "rmg/CMapGenerator.h" // for CMapGenOptions
const ui32 version = 750; const ui32 version = 751;
const ui32 minSupportedVersion = version; const ui32 minSupportedVersion = version;
class CConnection; class CConnection;