···11-MIT License
22-33-Copyright (c) 2021 Ambrosius
44-55-Permission is hereby granted, free of charge, to any person obtaining a copy
66-of this software and associated documentation files (the "Software"), to deal
77-in the Software without restriction, including without limitation the rights
88-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99-copies of the Software, and to permit persons to whom the Software is
1010-furnished to do so, subject to the following conditions:
1111-1212-The above copyright notice and this permission notice shall be included in all
1313-copies or substantial portions of the Software.
1414-1515-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121-SOFTWARE.
···11-/**
22- * A Kingdom structure.
33- * @typedef {Object} Kingdom
44- * @property {string} name - The name of the Kingdom
55- * @property {string} charter - The id of the charter
66- * @property {string} government - The id of the government
77- * @property {string} heartland - The id of the heartland
88- * @property {string[]} boosts - An array of free boosts for the Kingdom
99- * @property {object} leaders - Leaders of the kingdom.
1010- * @property {string[]} feats - An array of feats for the Kingdom
1111- * @property {number} size - The size of the Kingdom
1212- * @property {object} resourceDice - The resource dice for the Kingdom
1313- * @property {object} commodities - The commodities for the Kingdom
1414- * @property {object} resourcePoints - The resource points for the Kingdom
1515- * @property {object} unrest - The unrest for the Kingdom
1616- * @property {object} ruin - The ruin for the Kingdom
1717- * @property {object[]} groups - Other groups the Kingdom has relations with
1818- * @property {object} krp - The Kingdom Reputation Points
1919- * @property {string[]} settlements - An array of Scene IDs for the Kingdom's settlements
2020- * @property {number} level - The level of the Kingdom
2121- */
2222-2323-export class Kingdom {
2424- name: string;
2525- charter: string;
2626- government: string;
2727- heartland: string;
2828- boosts: string[];
2929- leaders: LeaderInfo;
3030- feats: string[];
3131- size: number;
3232- resourceDice: ResourceInfo;
3333- commodities: CommodityInfo;
3434- unrest: ResourceLimitInfo;
3535- ruin: RuinInfo;
3636- groups: Relation[];
3737- krp: ResourceLimitInfo;
3838- settlements: string[];
3939- level: number;
4040-}
4141-4242-/**
4343- * Information about a Kingdom's leaders.
4444- * @typedef {Object} LeaderInfo
4545- * @property {string} ruler - The actor ID of the ruler
4646- * @property {string} counselor - The actor ID of the counselor
4747- * @property {string} viceroy - The actor ID of the viceroy
4848- * @property {string} emissary - The actor ID of the emissary
4949- * @property {string} warden - The actor ID of the warden
5050- * @property {stirng} general - The actor ID of the general
5151- * @property {string} magister - The actor ID of the magister
5252- * @property {string} treasurer - The actor ID of the treasurer
5353- */
5454-5555-export interface LeaderInfo {
5656- ruler: string;
5757- counselor: string;
5858- viceroy: string;
5959- emissary: string;
6060- warden: string;
6161- general: string;
6262- magister: string;
6363- treasurer: string;
6464-}
6565-6666-/**
6767- * Information about a resource. This resource has a Next and Current value.
6868- * @typedef {Object} ResourceInfo
6969- * @property {number} next - The amount to add on the next turn.
7070- * @property {number} current - The current value of this resource.
7171- */
7272-7373-export interface ResourceInfo {
7474- next: number;
7575- current: number;
7676-}
7777-7878-/**
7979- * Information about the Kingdom's commodities
8080- * @typedef {Object} CommodityInfo
8181- * @property {object} ore - The amount of Ore the Kingdom has
8282- * @property {object} lumber - The amount of Lumber the Kingdom has
8383- * @property {object} stone - The amount of Stone the Kingdom has
8484- * @property {object} food - The amount of Food the Kingdom has
8585- * @property {object} luxuries - The amount of Luxuries the Kingdom has
8686- */
8787-8888-export interface CommodityInfo {
8989- ore: ResourceInfo;
9090- lumber: ResourceInfo;
9191- stone: ResourceInfo;
9292- food: ResourceInfo;
9393- luxuries: ResourceInfo;
9494-}
9595-9696-/**
9797- * Information about a resource. This resource has Next, Current, and Threshold values.
9898- * @typedef {Object} ResourceLimitInfo
9999- * @property {number} next - The amount to add on the next turn.
100100- * @property {number} current - The current value of this resource.
101101- * @property {number} threshold - The maximum value of this resource.
102102- */
103103-104104-export interface ResourceLimitInfo {
105105- next: number;
106106- current: number;
107107- threshold: number;
108108-}
109109-110110-/**
111111- * Information about the Kingdom's Ruin values.
112112- * @typedef {Object} RuinInfo
113113- * @property {object} corruption - The amount of Corruption a Kingdom has
114114- * @property {object} crime - The amount of Crime a Kingdom has
115115- * @property {object} decay - The amount of Decay a Kingdom has
116116- * @property {object} strife - The amount of Strife a Kingdom has
117117- */
118118-119119-export interface RuinInfo {
120120- corruption: ResourceLimitInfo;
121121- crime: ResourceLimitInfo;
122122- decay: ResourceLimitInfo;
123123- strife: ResourceLimitInfo;
124124-}
125125-126126-/**
127127- * Information about a relation with another group the Kingdom has.
128128- * @typedef {Object} Relation
129129- * @property {string} name - The name of the group
130130- * @property {string} relation - The type of relation the Kingdom has with this group
131131- * @property {number} dc - The base Negotiation DC for this group
132132- * @property {boolean} atWar - Is the Kingdom at war with this group?
133133- */
134134-135135-export interface Relation {
136136- name: string;
137137- relation: RelationType;
138138- dc: number;
139139- atWar: boolean;
140140-}
141141-142142-export enum RelationType {
143143- None = "none",
144144- TradeAgreement = "tradeAgreement",
145145- DiplomaticRelations = "diplomaticRelations",
146146-}