1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Deprecate previously hardcoded buildings

This commit is contained in:
Ivan Savenko 2024-08-17 10:13:55 +00:00
parent 22a126cf2d
commit 6fa2bb7e91
11 changed files with 147 additions and 22 deletions

View File

@ -50,7 +50,6 @@
// Previously hardcoded buildings that might be used by mods
// Section 1 - building with bonuses during sieges
"brotherhoodOfSword" : {
"upgradeReplacesBonuses" : true,
"bonuses": [
{
"type": "MORALE",
@ -63,7 +62,6 @@
"bonuses": [
{
"type": "LUCK",
"subtype": "primarySkill.knowledge",
"val": 2
}
]
@ -73,7 +71,7 @@
"bonuses": [
{
"type": "PRIMARY_SKILL",
"subtype": "primarySkill.knowledge",
"subtype": "primarySkill.spellpower",
"val": 2
}
]
@ -83,7 +81,7 @@
"bonuses": [
{
"type": "PRIMARY_SKILL",
"subtype": "primarySkill.knowledge",
"subtype": "primarySkill.attack",
"val": 2
}
]
@ -93,7 +91,7 @@
"bonuses": [
{
"type": "PRIMARY_SKILL",
"subtype": "primarySkill.knowledge",
"subtype": "primarySkill.defence",
"val": 2
}
]

View File

@ -170,13 +170,43 @@
"resourceSilo": { "produce": { "ore": 1, "wood": 1 } },
"blacksmith": { },
"special1": { "type" : "lighthouse", "requires" : [ "shipyard" ] },
"special1": {
"bonuses": [
{
"propagator": "PLAYER_PROPAGATOR",
"type": "MOVEMENT",
"subtype": "heroMovementSea",
"val": 500
}
],
"requires" : [ "shipyard" ]
},
"horde1": { "id" : 18, "upgrades" : "dwellingLvl3" },
"horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl3", "requires" : [ "horde1" ], "mode" : "auto" },
"ship": { "id" : 20, "upgrades" : "shipyard" },
"special2": { "type" : "stables", "requires" : [ "dwellingLvl4" ],
"special2": {
"requires" : [ "dwellingLvl4" ],
"configuration" : {
"visitMode" : "bonus",
"rewards" : [
{
"message" : "@core.genrltxt.580",
"movePoints" : 400,
"bonuses" : [ { "type" : "MOVEMENT", "subtype" : "heroMovementLand", "val" : 400, "valueType" : "ADDITIVE_VALUE", "duration" : "ONE_WEEK"} ]
}
]
}
},
"special3": {
"upgradeReplacesBonuses" : true,
"bonuses": [
{
"type": "MORALE",
"val": 2
}
],
"upgrades" : "tavern"
},
"special3": { "type" : "brotherhoodOfSword", "upgrades" : "tavern" },
"grail": { "id" : 26, "mode" : "grail", "produce": { "gold": 5000 }, "bonuses": [ { "type": "MORALE", "val": 2, "propagator": "PLAYER_PROPAGATOR" } ] },
"dwellingLvl1": { "id" : 30, "requires" : [ "fort" ] },

View File

@ -174,9 +174,37 @@
"special1": { "type" : "artifactMerchant", "requires" : [ "marketplace" ] },
"horde1": { "id" : 18, "upgrades" : "dwellingLvl1" },
"horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl1", "requires" : [ "horde1" ], "mode" : "auto" },
"special2": { "type" : "manaVortex", "requires" : [ "mageGuild1" ] },
"special2": {
"requires" : [ "mageGuild1" ],
"configuration" : {
"resetParameters" : {
"period" : 7,
"visitors" : true
},
"visitMode" : "hero", // Should be 'once' to match (somewhat buggy) H3 logic
"rewards" : [
{
"limiter" : {
"noneOf" : [ { "manaPercentage" : 200 } ]
},
"message" : "@core.genrltxt.579",
"manaPercentage" : 200
}
]
}
},
"special3": { "type" : "portalOfSummoning" },
"special4": { "type" : "experienceVisitingBonus" },
"special4": {
"configuration" : {
"visitMode" : "hero",
"rewards" : [
{
"message" : "@core.genrltxt.583",
"heroExperience" : 1000
}
]
}
},
"grail": { "id" : 26, "mode" : "grail", "produce": { "gold": 5000 },
"bonuses": [ { "type": "PRIMARY_SKILL", "subtype": "primarySkill.spellpower", "val": 12 } ] },

View File

@ -169,12 +169,41 @@
"resourceSilo": { "produce": { "wood": 1, "ore": 1 } },
"blacksmith": { },
"special1": { "type" : "defenceVisitingBonus", "requires" : [ "allOf", [ "townHall" ], [ "special2" ] ] },
"special1": {
"requires" : [ "allOf", [ "townHall" ], [ "special2" ] ],
"configuration" : {
"visitMode" : "hero",
"rewards" : [
{
"message" : "@core.genrltxt.585",
"primary" : { "defence" : 1 }
}
]
}
},
"horde1": { "id" : 18, "upgrades" : "dwellingLvl1" },
"horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl1", "requires" : [ "horde1" ], "mode" : "auto" },
"ship": { "id" : 20, "upgrades" : "shipyard" },
"special2": { "type" : "defenseGarrisonBonus", "requires" : [ "fort" ] },
"special3": { "type" : "attackGarrisonBonus", "requires" : [ "special2" ] },
"special2": {
"bonuses": [
{
"type": "PRIMARY_SKILL",
"subtype": "primarySkill.defence",
"val": 2
}
],
"requires" : [ "fort" ]
},
"special3": {
"bonuses": [
{
"type": "PRIMARY_SKILL",
"subtype": "primarySkill.defence",
"val": 2
}
],
"requires" : [ "special2" ]
},
"grail": { "id" : 26, "mode" : "grail", "produce": { "gold": 5000 },
"bonuses": [
{ "type": "PRIMARY_SKILL", "subtype": "primarySkill.attack", "val": 10 },

View File

@ -173,9 +173,29 @@
"horde1": { "id" : 18, "upgrades" : "dwellingLvl1" },
"horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl1", "requires" : [ "horde1" ], "mode" : "auto" },
"special2": { "type" : "spellPowerGarrisonBonus", "requires" : [ "fort" ] },
"special2": {
"bonuses": [
{
"type": "PRIMARY_SKILL",
"subtype": "primarySkill.spellpower",
"val": 2
}
],
"requires" : [ "fort" ]
},
"special3": { "type" : "castleGate", "requires" : [ "citadel" ] },
"special4": { "type" : "spellPowerVisitingBonus", "requires" : [ "mageGuild1" ] },
"special4": {
"requires" : [ "mageGuild1" ],
"configuration" : {
"visitMode" : "hero",
"rewards" : [
{
"message" : "@core.genrltxt.582",
"primary" : { "spellpower" : 1 }
}
]
}
},
"horde2": { "id" : 24, "upgrades" : "dwellingLvl3" },
"horde2Upgr": { "id" : 25, "upgrades" : "dwellingUpLvl3", "requires" : [ "horde2" ], "mode" : "auto" },
"grail": { "id" : 26, "mode" : "grail", "produce": { "gold": 5000 }},

View File

@ -177,7 +177,15 @@
"special1": { "type" : "mysticPond" },
"horde1": { "id" : 18, "upgrades" : "dwellingLvl2" },
"horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl2", "requires" : [ "horde1" ], "mode" : "auto" },
"special2": { "type" : "fountainOfFortune", "upgrades" : "special1" },
"special2": {
"bonuses": [
{
"type": "LUCK",
"val": 2
}
],
"upgrades" : "special1"
},
"special3": { "type" : "treasury", "requires" : [ "horde1" ] },
"horde2": { "id" : 24, "upgrades" : "dwellingLvl5" },
"horde2Upgr": { "id" : 25, "upgrades" : "dwellingUpLvl5", "requires" : [ "horde2" ], "mode" : "auto" },

View File

@ -172,7 +172,6 @@
"special2": { "type" : "freelancersGuild", "requires" : [ "marketplace" ] },
"special3": { "type" : "ballistaYard", "requires" : [ "blacksmith" ] },
"special4": {
"type" : "configurable",
"requires" : [ "fort" ],
"configuration" : {
"visitMode" : "hero",

View File

@ -172,9 +172,20 @@
"special1": { "type" : "artifactMerchant", "requires" : [ "marketplace" ] },
"horde1": { "id" : 18, "upgrades" : "dwellingLvl2" },
"horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl2", "requires" : [ "horde1" ], "mode" : "auto" },
"special2": { "type" : "lookoutTower", "height" : "high", "requires" : [ "fort" ] },
"special2": { "height" : "high", "requires" : [ "fort" ] },
"special3": { "type" : "library", "requires" : [ "mageGuild1" ] },
"special4": { "type" : "knowledgeVisitingBonus", "requires" : [ "mageGuild1" ] },
"special4": {
"requires" : [ "mageGuild1" ],
"configuration" : {
"visitMode" : "hero",
"rewards" : [
{
"message" : "@core.genrltxt.581",
"primary" : { "knowledge" : 1 }
}
]
}
},
"grail": { "height" : "skyship", "produce" : { "gold": 5000 }, "bonuses": [ { "type": "PRIMARY_SKILL", "subtype": "primarySkill.knowledge", "val": 15 } ] },
"dwellingLvl1": { "id" : 30, "requires" : [ "fort" ] },

View File

@ -36,7 +36,7 @@
},
"type" : {
"type" : "string",
"enum" : [ "mysticPond", "artifactMerchant", "freelancersGuild", "magicUniversity", "castleGate", "creatureTransformer", "portalOfSummoning", "ballistaYard", "lookoutTower", "library", "brotherhoodOfSword", "fountainOfFortune", "spellPowerGarrisonBonus", "attackGarrisonBonus", "defenseGarrisonBonus", "escapeTunnel", "lighthouse", "treasury", "thievesGuild", "bank", "configurable", "stables", "manaVortex", "attackVisitingBonus", "defenceVisitingBonus", "spellPowerVisitingBonus", "knowledgeVisitingBonus", "experienceVisitingBonus" ],
"enum" : [ "mysticPond", "artifactMerchant", "freelancersGuild", "magicUniversity", "castleGate", "creatureTransformer", "portalOfSummoning", "ballistaYard", "library", "escapeTunnel", "treasury", "thievesGuild", "bank" ],
"description" : "Subtype for some special buildings"
},
"mode" : {
@ -57,6 +57,10 @@
"description" : "Optional, indicates that this building upgrades another base building",
"type" : "string"
},
"upgradeReplacesBonuses" : {
"description" : "If set to true, this building will replace all bonuses from base building, leaving only bonuses defined by this building",
"type" : "boolean"
},
"configuration" : {
"description" : "Optional, configuration of building that can be activated by visiting hero",
"$ref" : "rewardable.json"

View File

@ -30,7 +30,6 @@ namespace BuildingSubID
MYSTIC_POND,
FOUNTAIN_OF_FORTUNE,
ARTIFACT_MERCHANT,
LOOKOUT_TOWER,
LIBRARY,
PORTAL_OF_SUMMONING,
ESCAPE_TUNNEL,

View File

@ -185,7 +185,6 @@ namespace MappedKeys
{ "creatureTransformer", BuildingSubID::CREATURE_TRANSFORMER },//only skeleton transformer yet
{ "portalOfSummoning", BuildingSubID::PORTAL_OF_SUMMONING },
{ "ballistaYard", BuildingSubID::BALLISTA_YARD },
{ "lookoutTower", BuildingSubID::LOOKOUT_TOWER },
{ "library", BuildingSubID::LIBRARY },
{ "fountainOfFortune", BuildingSubID::FOUNTAIN_OF_FORTUNE },//luck garrison bonus
{ "escapeTunnel", BuildingSubID::ESCAPE_TUNNEL },