diff --git a/lang/en.json b/lang/en.json index 8444e82b..34515115 100644 --- a/lang/en.json +++ b/lang/en.json @@ -19,6 +19,7 @@ "ITEM.TypeLoot": "Loot", "ITEM.TypePower": "Power", "ITEM.TypeSpecies": "Species", + "ITEM.TypeStarship": "Starship", "ITEM.TypeStarshipfeature": "Starship Feature", "ITEM.TypeStarshipfeaturePl": "Starship Features", "ITEM.TypeStarshipmod": "Starship Modification", @@ -576,6 +577,7 @@ "SW5E.ItemTypePowerPl": "Powers", "SW5E.ItemTypeSpecies": "Species", "SW5E.ItemTypeSpeciesPl": "Species", + "SW5E.ItemTypeStarship": "Starship", "SW5E.ItemTypeStarshipMod": "Starship Modification", "SW5E.ItemTypeStarshipModPl": "Starship Modifications", "SW5E.ItemTypeTool": "Tool", @@ -1009,7 +1011,7 @@ "SW5E.StarshipSkillDat": "Data", "SW5E.StarshipSkillHid": "Hide", "SW5E.StarshipSkillImp": "Impress", - "SW5E.StarshipSkillInt": "Interfere", + "SW5E.StarshipSkillInf": "Interfere", "SW5E.StarshipSkillMan": "Maneuvering", "SW5E.StarshipSkillMen": "Menace", "SW5E.StarshipSkillPat": "Patch", diff --git a/module/actor/entity.js b/module/actor/entity.js index 203958b2..647f7c61 100644 --- a/module/actor/entity.js +++ b/module/actor/entity.js @@ -323,6 +323,29 @@ export default class Actor5e extends Actor { // Proficiency data.attributes.prof = Math.floor((Math.max(data.details.tier, 1) + 7) / 4); + // Determine Starship Tier and available Hull/Shield dice based on owned starship items + const size = actorData.items.filter(i => i.type === "starship"); + if (size.length === 0) return; + const sizeData = size[0].data; + const tiers = parseInt(sizeData.tier) || 0; + data.details.tier = tiers; + data.traits.size = sizeData.size; + data.attributes.cargcap = (parseInt(sizeData.cargoCap) || 0); + data.attributes.crewcap = (parseInt(sizeData.minCrew) || 1); + data.attributes.fuel.cap = (parseInt(sizeData.fuelCap) || 5); + data.attributes.fuel.cost = sizeData.fuelCost; + data.attributes.hsm = sizeData.hardpointSizeMod; + data.attributes.hull.die = sizeData.hullDice; + data.attributes.hull.dicemax = sizeData.hullDiceStart + tiers; + data.attributes.hull.dice = sizeData.hullDiceStart + tiers - (parseInt(sizeData.hullDiceUsed) || 0); + // if hull.value .max = null then calculate them out + data.attributes.shld.die = sizeData.shldDice; + data.attributes.shld.dicemax = sizeData.shldDiceStart + tiers; + data.attributes.shld.dice = sizeData.shldDiceStart + tiers - (parseInt(sizeData.shldDiceUsed) || 0); + // if shld.value .max = null then calculate them out + data.attributes.mods.max = sizeData.modBaseCap; + data.attributes.pwrdice.die = SW5E.powerDieTypes[tiers]; + // Link hull to hp and shields to temp hp //data.attributes.hull.value = data.attributes.hp.value; //data.attributes.hull.max = data.attributes.hp.max; diff --git a/module/actor/sheets/newSheet/starship.js b/module/actor/sheets/newSheet/starship.js index c5b5dc1d..973dcbbd 100644 --- a/module/actor/sheets/newSheet/starship.js +++ b/module/actor/sheets/newSheet/starship.js @@ -169,7 +169,7 @@ export default class ActorSheet5eStarship extends ActorSheet5e { const refuel = this.actor.data.effect.changes[fuelcappos].value; this.actor.update({"data.attributes.fuel.value": refuel}); } - +} function engineSliderUpdate(num) { var symbol; var coefficient; @@ -232,4 +232,3 @@ export default class ActorSheet5eStarship extends ActorSheet5e { document.querySelector('#weaponslideroutput').value = slideroutput; this.actor.update({"data.attributes.weaponpow": coefficient}); } -} \ No newline at end of file diff --git a/module/config.js b/module/config.js index d4179de9..016e27d7 100644 --- a/module/config.js +++ b/module/config.js @@ -468,7 +468,6 @@ SW5E.healingTypes = { "temphp": "SW5E.HealingTemp" }; - /* -------------------------------------------- */ @@ -648,7 +647,7 @@ SW5E.starshipSkills = { "dat": "SW5E.StarshipSkillDat", "hid": "SW5E.StarshipSkillHid", "imp": "SW5E.StarshipSkillImp", - "int": "SW5E.StarshipSkillInt", + "inf": "SW5E.StarshipSkillInf", "man": "SW5E.StarshipSkillMan", "men": "SW5E.StarshipSkillMen", "pat": "SW5E.StarshipSkillPat", diff --git a/packs/packs/starships.db b/packs/packs/starships.db new file mode 100644 index 00000000..d4a2feda --- /dev/null +++ b/packs/packs/starships.db @@ -0,0 +1,6 @@ +{"name":"Small Starship","permission":{"default":0,"yXqD5rPwgjXHtqeZ":3},"type":"starship","data":{"description":{"value":""},"size":"Small","tier":0,"hullDice":"d6","hullDiceStart":3,"hullDiceRolled":[6],"hullDiceUsed":0,"shldDice":"d6","shldDiceStart":3,"shldDiceRolled":[6],"shldDiceUsed":0,"modMaxSuitesBase":1,"modBaseCap":20,"modSizeCostMult":1,"modMinWorkforce":2,"suiteCap":1,"equipCostMult":1,"equipMinWorkforce":1,"cargoCap":2,"fuelCost":50,"fuelCap":10,"foodCap":10,"baseTurnSpeed":250,"hardpointSizeMod":2,"minCrew":1,"pwrDice":"1","source":"SotG"},"flags":{},"img":"systems/sw5e/packs/Icons/Starship%20Features/Small.webp","effects":[],"_id":"6BN8l5E8QtYt103T"} +{"name":"Medium Starship","permission":{"default":0,"yXqD5rPwgjXHtqeZ":3},"type":"starship","data":{"description":{"value":""},"size":"Medium","tier":0,"hullDice":"d8","hullDiceStart":5,"hullDiceRolled":[8],"hullDiceUsed":0,"shldDice":"d8","shldDiceStart":5,"shldDiceRolled":[8],"shldDiceUsed":0,"modMaxSuitesBase":1,"modBaseCap":30,"modSizeCostMult":2,"modMinWorkforce":4,"suiteCap":4,"equipCostMult":2,"equipMinWorkforce":2,"cargoCap":25,"fuelCost":100,"fuelCap":30,"foodCap":120,"baseTurnSpeed":200,"hardpointSizeMod":3,"minCrew":1,"pwrDice":"1","source":"SotG"},"flags":{},"img":"systems/sw5e/packs/Icons/Starship%20Features/Medium.webp","effects":[],"_id":"6liD1m4hqKSeS5sp"} +{"_id":"FH8iBT4uujRUR0j7","name":"Gargantuan Starship","permission":{"default":0,"yXqD5rPwgjXHtqeZ":3},"type":"starship","data":{"description":{"value":null},"size":"Gargantuan","tier":0,"hullDice":"d20","hullDiceStart":11,"hullDiceRolled":[20],"hullDiceUsed":0,"shldDice":"d20","shldDiceStart":11,"shldDiceRolled":[20],"shldDiceUsed":0,"modMaxSuitesBase":4,"modBaseCap":70,"modSizeCostMult":500,"modMinWorkforce":1000,"suiteCap":40000,"equipCostMult":500,"equipMinWorkforce":500,"cargoCap":200000,"fuelCost":100000,"fuelCap":1800,"foodCap":576000000,"baseTurnSpeed":50,"hardpointSizeMod":3,"minCrew":80000,"pwrDice":"1","source":"SotG"},"flags":{},"img":"systems/sw5e/packs/Icons/Starship%20Features/Gargantuan.webp","effects":[]} +{"name":"Large Starship","permission":{"default":0,"yXqD5rPwgjXHtqeZ":3},"type":"starship","data":{"description":{"value":""},"size":"Large","tier":0,"hullDice":"d10","hullDiceStart":7,"hullDiceRolled":[10],"hullDiceUsed":0,"shldDice":"d10","shldDiceStart":7,"shldDiceRolled":[10],"shldDiceUsed":0,"modMaxSuitesBase":2,"modBaseCap":50,"modSizeCostMult":5,"modMinWorkforce":10,"suiteCap":400,"equipCostMult":5,"equipMinWorkforce":5,"cargoCap":500,"fuelCost":1000,"fuelCap":300,"foodCap":240000,"baseTurnSpeed":150,"hardpointSizeMod":4,"minCrew":200,"pwrDice":"1","source":"SotG"},"flags":{},"img":"systems/sw5e/packs/Icons/Starship%20Features/Large.webp","effects":[],"_id":"RFKvLuqE13INBxqd"} +{"name":"Huge Starship","permission":{"default":0,"yXqD5rPwgjXHtqeZ":3},"type":"starship","data":{"description":{"value":null},"size":"Huge","tier":0,"hullDice":"d12","hullDiceStart":9,"hullDiceRolled":[12],"hullDiceUsed":0,"shldDice":"d12","shldDiceStart":9,"shldDiceRolled":[12],"shldDiceUsed":0,"modMaxSuitesBase":3,"modBaseCap":60,"modSizeCostMult":50,"modMinWorkforce":100,"suiteCap":4000,"equipCostMult":50,"equipMinWorkforce":50,"cargoCap":10000,"fuelCost":10000,"fuelCap":600,"foodCap":9600000,"baseTurnSpeed":100,"hardpointSizeMod":2,"minCrew":4000,"pwrDice":"1","source":"SotG"},"flags":{},"img":"systems/sw5e/packs/Icons/Starship%20Features/Huge.webp","effects":[],"_id":"pgmf0rMYLt4LQtfN"} +{"name":"Tiny Starship","permission":{"default":0,"yXqD5rPwgjXHtqeZ":3},"type":"starship","data":{"description":{"value":""},"size":"Tiny","tier":0,"hullDice":"d4","hullDiceStart":1,"hullDiceRolled":[4],"hullDiceUsed":0,"shldDice":"d4","shldDiceStart":1,"shldDiceRolled":[4],"shldDiceUsed":0,"modMaxSuitesBase":0,"modBaseCap":10,"modSizeCostMult":0.5,"modMinWorkforce":1,"suiteCap":0,"equipCostMult":0.5,"equipMinWorkforce":1,"cargoCap":0,"fuelCost":25,"fuelCap":5,"foodCap":0,"baseTurnSpeed":300,"hardpointSizeMod":1,"minCrew":0,"pwrDice":"1","source":"SotG"},"flags":{},"img":"systems/sw5e/packs/Icons/Starship%20Features/Tiny.webp","effects":[],"_id":"zC4qM8JMmMzCjMJK"} diff --git a/system.json b/system.json index 54436f2c..21ed569f 100644 --- a/system.json +++ b/system.json @@ -146,6 +146,12 @@ "path": "./packs/packs/starshipmodifications.db", "entity": "Item" }, + { + "name": "starships", + "label": "Starship Types", + "path": "./packs/packs/starships.db", + "entity": "Item" + }, { "name": "starshipweapons", "label": "Starship Weapons", diff --git a/template.json b/template.json index 140be7e6..c3f04143 100644 --- a/template.json +++ b/template.json @@ -1035,11 +1035,28 @@ "size": "", "tier": 0, "hullDice": "d6", - "hullDiceStart": 1, + "hullDiceStart": 3, + "hullDiceRolled":[6], "hullDiceUsed": 0, "shldDice": "d6", - "shldDiceStart": 1, + "shldDiceStart": 3, + "shldDiceRolled":[6], "shldDiceUsed": 0, + "modMaxSuitesBase": 0, + "modMaxSuitesMult": 1, + "modBaseCap": 20, + "modSizeCostMult": 1, + "modMinWorkforce": 2, + "suiteCap": 1, + "equipCostMult": 1, + "equipMinWorkforce": 1, + "cargoCap": 2, + "fuelCost": 50, + "fuelCap": 10, + "foodCap": 10, + "baseTurnSpeed": 250, + "hardpointSizeMod": 2, + "minCrew": 1, "pwrDice": "1", "source": "SotG" },