mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Update documentation
This commit is contained in:
@@ -3,7 +3,116 @@
|
||||
Reward types for clearing creature bank are limited to resources, creatures, artifacts and spell.
|
||||
Format of rewards is same as in [Rewardable Objects](Rewardable.md)
|
||||
|
||||
``` javascript
|
||||
Deprecated in 1.6. Please use [Rewardable Objects](Rewardable.md) instead. See Conversion from 1.5 format section below for help with migration
|
||||
|
||||
### Example
|
||||
This example defines a rewardable object with functionality similar of H3 creature bank.
|
||||
See [Rewardable Objects](Rewardable.md) for detailed documentation of these properties.
|
||||
```jsonc
|
||||
{
|
||||
"name" : "Cyclops Stockpile",
|
||||
|
||||
// Generic message to ask player whether he wants to attack a creature bank, can be replaced with custom string
|
||||
"onGuardedMessage" : 32,
|
||||
|
||||
// Generic message to inform player that bank was already cleared
|
||||
"onVisitedMessage" : 33,
|
||||
|
||||
// As an alternative to a generic message you can define 'reward'
|
||||
// that will be granted for visiting already cleared bank, such as morale debuff
|
||||
"onVisited" : [
|
||||
{
|
||||
"message" : 123, // "Such a despicable act reduces your army's morale."
|
||||
"bonuses" : [ { "type" : "MORALE", "val" : -1, "duration" : "ONE_BATTLE", "description" : 99 } ]
|
||||
}
|
||||
],
|
||||
"visitMode" : "once", // Banks never reset
|
||||
// Defines layout of guards. To emulate H3 logic,
|
||||
// use 'creatureBankNarrow' if guardian units are narrow (1-tile units)
|
||||
// or, 'creatureBankWide' if defenders are double-hex units
|
||||
"guardsLayout" : "creatureBankNarrow",
|
||||
"rewards" : [
|
||||
{
|
||||
"message" : 34,
|
||||
"appearChance" : { "min" : 0, "max" : 30 },
|
||||
"guards" : [
|
||||
{ "amount" : 4, "type" : "cyclop" },
|
||||
{ "amount" : 4, "type" : "cyclop" },
|
||||
{ "amount" : 4, "type" : "cyclop", "upgradeChance" : 50 },
|
||||
{ "amount" : 4, "type" : "cyclop" },
|
||||
{ "amount" : 4, "type" : "cyclop" }
|
||||
],
|
||||
"resources" : {
|
||||
"gold" : 4000
|
||||
}
|
||||
},
|
||||
{
|
||||
"message" : 34,
|
||||
"appearChance" : { "min" : 30, "max" : 60 },
|
||||
"guards" : [
|
||||
{ "amount" : 6, "type" : "cyclop" },
|
||||
{ "amount" : 6, "type" : "cyclop" },
|
||||
{ "amount" : 6, "type" : "cyclop", "upgradeChance" : 50 },
|
||||
{ "amount" : 6, "type" : "cyclop" },
|
||||
{ "amount" : 6, "type" : "cyclop" }
|
||||
],
|
||||
"resources" : {
|
||||
"gold" : 6000
|
||||
}
|
||||
},
|
||||
{
|
||||
"message" : 34,
|
||||
"appearChance" : { "min" : 60, "max" : 90 },
|
||||
"guards" : [
|
||||
{ "amount" : 8, "type" : "cyclop" },
|
||||
{ "amount" : 8, "type" : "cyclop" },
|
||||
{ "amount" : 8, "type" : "cyclop", "upgradeChance" : 50 },
|
||||
{ "amount" : 8, "type" : "cyclop" },
|
||||
{ "amount" : 8, "type" : "cyclop" }
|
||||
],
|
||||
"resources" : {
|
||||
"gold" : 8000
|
||||
}
|
||||
},
|
||||
{
|
||||
"message" : 34,
|
||||
"appearChance" : { "min" : 90, "max" : 100 },
|
||||
"guards" : [
|
||||
{ "amount" : 10, "type" : "cyclop" },
|
||||
{ "amount" : 10, "type" : "cyclop" },
|
||||
{ "amount" : 10, "type" : "cyclop", "upgradeChance" : 50 },
|
||||
{ "amount" : 10, "type" : "cyclop" },
|
||||
{ "amount" : 10, "type" : "cyclop" }
|
||||
],
|
||||
"resources" : {
|
||||
"gold" : 10000
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
```
|
||||
|
||||
### Conversion from 1.5 format
|
||||
This is a list of changes that needs to be done to bank config to migrate it to 1.6 system. See [Rewardable Objects](Rewardable.md) documentation for description of new fields
|
||||
|
||||
- If your object type has defined `handler`, change its value from `bank` to `configurable`
|
||||
|
||||
- If your object has non-zero `resetDuration`, replace with `resetParameters` entry
|
||||
|
||||
- For each possible level, replace `chance` with `appearChance` entry
|
||||
|
||||
- If you have `combat_value` or `field` entries inside 'reward' - remove them. These fields are unused in both 1.5 and in 1.6
|
||||
|
||||
- Rename `levels` entry to `rewards`
|
||||
|
||||
- Add property `"visitMode" : "once"`
|
||||
- Add property `"onGuardedMessage" : 119`, optionally - replace with custom message for object visit
|
||||
- Add property `"onVisitedMessage" : 33`, optionally - custom message or morale debuff
|
||||
- Add property `"message" : 34`, to every level of your reward, optionally - replace with custom message
|
||||
|
||||
### Old format (1.5 or earlier)
|
||||
|
||||
``` jsonc
|
||||
{
|
||||
/// If true, battle setup will be like normal - Attacking player on the left, enemy on the right
|
||||
"regularUnitPlacement" : true,
|
||||
@@ -63,4 +172,4 @@ Format of rewards is same as in [Rewardable Objects](Rewardable.md)
|
||||
]
|
||||
}
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
@@ -117,6 +117,9 @@ Rewardable object is defined similarly to other objects, with key difference bei
|
||||
// Message that will be shown if there are multiple selectable awards to choose from
|
||||
"onSelectMessage" : "",
|
||||
|
||||
// Message that will be shown if object has undefeated guards
|
||||
"onGuardedMessage" : "",
|
||||
|
||||
// Message that will be shown if this object has been already visited before
|
||||
"onVisitedMessage" : "{Warehouse of Crystal}\r\n\r\nThe owner of the storage is apologising: 'I am sorry Milord, no crystal here. Please, return next week!'",
|
||||
|
||||
@@ -125,10 +128,22 @@ Rewardable object is defined similarly to other objects, with key difference bei
|
||||
"onVisited" : [
|
||||
]
|
||||
|
||||
// Layout of units in the battle (only used if guards are present)
|
||||
// Predefined values:
|
||||
// "default" - attacker is on the left, defender is on the right, war machine, tactics, and battlefield obstacles are present
|
||||
// "creatureBankNarrow" - emulates H3 logic for banks with narrow (1-tile wide) units
|
||||
// "creatureBankWide" - emulates H3 logic for banks with wide units that take 2 hexes
|
||||
// Additionally, it is possible to define new layouts, see "layouts" field in (vcmi install)/config/gameConfig.json file
|
||||
"guardsLayout" : "default"
|
||||
|
||||
// if true, then player can refuse from reward and don't select anything
|
||||
// Note that in this case object will not become "visited" and can still be revisited later
|
||||
"canRefuse": true,
|
||||
|
||||
// If set to true, then this object can be visited from land when placed next to a coast.
|
||||
// NOTE: make sure that object also has "blockedVisitable" set to true. Othervice, behavior is undefined
|
||||
"coastVisitable" : true
|
||||
|
||||
// Controls when object state will be reset, allowing potential revisits. See Reset Parameters definition section
|
||||
"resetParameters" : {
|
||||
}
|
||||
@@ -479,8 +494,6 @@ Keep in mind, that all randomization is performed on map load and on object rese
|
||||
],
|
||||
```
|
||||
|
||||
canLearnSpells
|
||||
|
||||
### Creatures
|
||||
- Can be used as limiter
|
||||
- Can be used as reward, to give new creatures to a hero
|
||||
@@ -496,6 +509,21 @@ canLearnSpells
|
||||
],
|
||||
```
|
||||
|
||||
### Guards
|
||||
- When used in a reward, these creatures will be added to guards of the objects
|
||||
- Hero must defeat all guards before being able to receive rewards
|
||||
- Guards are only reset when object rewards are reset
|
||||
- Requires `guardsLayout` property to be set in main part of object configuration
|
||||
- It is possible to add up to 7 slots of creatures
|
||||
- Guards of the same creature type will never merge or rearrange their stacks
|
||||
```jsonc
|
||||
"guards" : [
|
||||
{ "type" : "archer", "amount" : 20 },
|
||||
{ "type" : "archer", "amount" : 20, "upgradeChance" : 30 },
|
||||
{ "type" : "archer", "amount" : 20 }
|
||||
],
|
||||
```
|
||||
|
||||
### Creatures Change
|
||||
- Can NOT be used as limiter
|
||||
- Can be used as reward, to replace creatures in hero army. It is possible to use this parameter both for upgrades of creatures as well as for changing them into completely unrelated creature, e.g. similar to Skeleton Transformer
|
||||
|
||||
Reference in New Issue
Block a user