Added nations json schema

This commit is contained in:
Yair Morgenstern
2023-09-24 11:55:54 +03:00
parent 1447056d23
commit fc02ac8825
7 changed files with 106 additions and 65 deletions

View File

@ -35,6 +35,12 @@ Tada! Now Android Studio will recognize all Buildings.json files as belonging to
"*/Units.json"
],
"url": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/units.json"
},
{
"fileMatch": [
"*/Nations.json"
],
"url": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/nations.json"
}
]
```

View File

@ -26,12 +26,12 @@
"percentStatBonus": { "$ref": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/stats.json" },
"specialistSlots": {
"type": "object",
"additionalProperties": {"type": "integer"},
"additionalProperties": { "type": "integer" },
"description": "How many specialists of each type does this building allow for. Key must be name of existing specialist."
},
"greatPersonPoints": {
"type": "object",
"additionalProperties": {"type": "integer"},
"additionalProperties": { "type": "integer" },
"description": "Which Great Person Points this building generates per turn. Key must be name of Great Person unit."
},
"hurryCostModifier": { "type": "number" },
@ -55,7 +55,7 @@
"type": "string",
"description": "For unique units: the name of the original unit that this unit replaces for the uniqueTo nation."
},
"quote": {
"type": "string",
"description": "Quote that will be displayed for Wonders in the 'construction completed' popup"

View File

@ -0,0 +1,11 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"type": "array",
"minLength": 3,
"maxLength": 3,
"items": {
"type": "integer",
"minimum": 0,
"maximum": 255
}
}

View File

@ -0,0 +1,78 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"leaderName": { "type": "string" },
"adjective": {
"type": "array",
"items": { "type": "string" },
"uniqueItems": true,
"description": "Currently not in use"
},
"style": { "type": "string" },
"cityStateType": { "type": "string" },
"outerColor": { "$ref": "#/definitions/color" },
"innerColor": { "$ref": "#/definitions/color" },
"preferredVictoryType": { "type": "string" },
"startBias": {
"type": "array",
"items": { "type": "string" },
"uniqueItems": true,
"description": "Types of tiles where the civ will be more likely to start"
},
"uniques": { "$ref": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/uniques.json" },
// All of these are cosmetic
"introduction": { "type": "string" },
"tradeRequest": { "type": "string" },
"neutralHello": { "type": "string" },
"hateHello": { "type": "string" },
"declaringWar": { "type": "string" },
"attacked": { "type": "string" },
"defeated": { "type": "string" },
"startIntroPart1": { "type": "string" },
"startIntroPart2": { "type": "string" },
"cities": {
"type": "array",
"items": { "type": "string" },
"uniqueItems": true,
},
"spyNames": {
"type": "array",
"items": { "type": "string" },
"uniqueItems": true,
},
"favoredReligion": { "type": "string" },
"uniqueName": { "type": "string" },
"uniqueText": {
"type": "string",
"description": "Freeform text that will be shown to users, overriding the list of uniques."
},
"civilopediaText": { "$ref": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/civilopediaText.json" }
},
"required": [
"name", "outerColor"
],
"additionalProperties": false,
"definitions": {
"color": {
"type": "array",
"minLength": 3,
"maxLength": 3,
"items": {
"type": "integer",
"minimum": 0,
"maximum": 255
}
}
}
}
}

View File

@ -52,11 +52,5 @@
"name", "unitType"
],
"additionalProperties": false
},
"definitions": {
"uniques": {
"type": "array",
"items": { "type": "string" }
}
}
}