Skip to content

Commit

Permalink
Merge pull request #13259 from raelik/battltech_atow_3rd_printing_update
Browse files Browse the repository at this point in the history
BattleTech A Time of War 3rd Printing Update - Removal of tiered skills
  • Loading branch information
BronsonHall authored Sep 3, 2024
2 parents db2f66b + ef559be commit 83a5f7f
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 340 deletions.
210 changes: 59 additions & 151 deletions BattleTech-A-Time-of-War/BattleTech-A-Time-of-War.html
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,15 @@ <h1>Inventory</h1>
"archery": "Archery",
},
},
"art": {
"linkedAttributes": [DEXTERITY_LINK, INTELLIGENCE_LINK, ],
"targetNumber": 9,
"complexity": "CA",
"subSkills": true,
"displayName": {
"art": "Art",
},
},
"artillery": {
"linkedAttributes": [INTELLIGENCE_LINK, WILL_LINK, ],
"targetNumber": 8,
Expand Down Expand Up @@ -971,6 +980,15 @@ <h1>Inventory</h1>
"climbing": "Climbing",
},
},
"computers": {
"linkedAttributes": [DEXTERITY_LINK, INTELLIGENCE_LINK, ],
"targetNumber": 9,
"complexity": "CA",
"subSkills": false,
"displayName": {
"computers": "Computers",
},
},
"communications": {
"linkedAttributes": [INTELLIGENCE_LINK, ],
"targetNumber": 7,
Expand Down Expand Up @@ -1055,6 +1073,15 @@ <h1>Inventory</h1>
"gunnery_turret": "Gunnery/Turret",
},
},
"interest": {
"linkedAttributes": [INTELLIGENCE_LINK, WILL_LINK, ],
"targetNumber": 9,
"complexity": "CA",
"subSkills": true,
"displayName": {
"interest": "Interest",
},
},
"interrogation": {
"linkedAttributes": [WILL_LINK, CHARISMA_LINK, ],
"targetNumber": 9,
Expand Down Expand Up @@ -1091,6 +1118,15 @@ <h1>Inventory</h1>
"leadership": "Leadership",
},
},
"martial": {
"linkedAttributes": [REFLEX_LINK, DEXTERITY_LINK, ],
"targetNumber": 8,
"complexity": "SA",
"subSkills": false,
"displayName": {
"martial_arts": "Martial Arts",
},
},
"medtech": {
"linkedAttributes": [INTELLIGENCE_LINK, ],
"targetNumber": 7,
Expand All @@ -1101,6 +1137,15 @@ <h1>Inventory</h1>
"medtech_veterinary": "MedTech/Veterinary",
},
},
"melee": {
"linkedAttributes": [REFLEX_LINK, DEXTERITY_LINK, ],
"targetNumber": 8,
"complexity": "SA",
"subSkills": false,
"displayName": {
"melee_weapons": "Melee Weapons",
},
},
"navigation": {
"linkedAttributes": [INTELLIGENCE_LINK, ],
"targetNumber": 7,
Expand Down Expand Up @@ -1149,6 +1194,17 @@ <h1>Inventory</h1>
"piloting_spacecraft": "Piloting/Spacecraft",
},
},
"prestidigitation": {
"linkedAttributes": [REFLEX_LINK, DEXTERITY_LINK, ],
"targetNumber": 8,
"complexity": "SA",
"subSkills": false,
"displayName": {
"prestidigitation_pick_pocket": "Prestidigitation/Pick Pocket",
"prestidigitation_quickdraw": "Prestidigitation/Quickdraw",
"prestidigitation_sleight_of_hand": "Prestidigitation/Sleight of Hand",
},
},
"protocol": {
"linkedAttributes": [WILL_LINK, CHARISMA_LINK, ],
"targetNumber": 9,
Expand Down Expand Up @@ -1337,133 +1393,6 @@ <h1>Inventory</h1>
},
};

const tieredSkillsBasic = {
"art": {
"linkedAttributes": [DEXTERITY_LINK, ],
"targetNumber": 8,
"complexity": "CB",
"subSkills": true,
"displayName": {
"art": "Art",
},
},
"computers": {
"linkedAttributes": [INTELLIGENCE_LINK, ],
"targetNumber": 8,
"complexity": "CB",
"subSkills": false,
"displayName": {
"computers": "Computers",
},
},
"interest": {
"linkedAttributes": [INTELLIGENCE_LINK, ],
"targetNumber": 8,
"complexity": "CB",
"subSkills": true,
"displayName": {
"interest": "Interest",
},
},
"martial": {
"linkedAttributes": [REFLEX_LINK, ],
"targetNumber": 7,
"complexity": "SB",
"subSkills": false,
"displayName": {
"martial_arts": "Martial Arts",
},
},
"melee": {
"linkedAttributes": [DEXTERITY_LINK, ],
"targetNumber": 7,
"complexity": "SB",
"subSkills": false,
"displayName": {
"melee_weapons": "Melee Weapons",
},
},
"prestidigitation": {
"linkedAttributes": [DEXTERITY_LINK, ],
"targetNumber": 7,
"complexity": "SB",
"subSkills": false,
"displayName": {
"prestidigitation_pick_pocket": "Prestidigitation/Pick Pocket",
"prestidigitation_quickdraw": "Prestidigitation/Quickdraw",
"prestidigitation_sleight_of_hand": "Prestidigitation/Sleight of Hand",
},
},
};

const tieredSkillsAdvanced = {
"art": {
"linkedAttributes": [DEXTERITY_LINK, INTELLIGENCE_LINK, ],
"targetNumber": 9,
"complexity": "CA",
"subSkills": true,
"displayName": {
"art": "Art",
},
},
"computers": {
"linkedAttributes": [DEXTERITY_LINK, INTELLIGENCE_LINK, ],
"targetNumber": 9,
"complexity": "CA",
"subSkills": false,
"displayName": {
"computers": "Computers",
},
},
"interest": {
"linkedAttributes": [INTELLIGENCE_LINK, WILL_LINK, ],
"targetNumber": 9,
"complexity": "CA",
"subSkills": true,
"displayName": {
"interest": "Interest",
},
},
"martial": {
"linkedAttributes": [REFLEX_LINK, DEXTERITY_LINK, ],
"targetNumber": 8,
"complexity": "SA",
"subSkills": false,
"displayName": {
"martial_arts": "Martial Arts",
},
},
"melee": {
"linkedAttributes": [REFLEX_LINK, DEXTERITY_LINK, ],
"targetNumber": 8,
"complexity": "SA",
"subSkills": false,
"displayName": {
"melee_weapons": "Melee Weapons",
},
},
"prestidigitation": {
"linkedAttributes": [REFLEX_LINK, DEXTERITY_LINK, ],
"targetNumber": 8,
"complexity": "SA",
"subSkills": false,
"displayName": {
"prestidigitation_pick_pocket": "Prestidigitation/Pick Pocket",
"prestidigitation_quickdraw": "Prestidigitation/Quickdraw",
"prestidigitation_sleight_of_hand": "Prestidigitation/Sleight of Hand",
},
},
};

const tieredSkills = [
"art",
"computers",
"interest",
"martial",
"melee",
"prestidigitation",
];

const calculateSkillLevel = (skillXP, learningSpeedModifier) => {
const learningSpeedPercentageModifier = 1 + 0.2 * learningSpeedModifier;

Expand Down Expand Up @@ -1502,16 +1431,8 @@ <h1>Inventory</h1>
return skill.displayName[skillDisplayNameKey]
};

const getSkill = (skillName, skillLevel, tieredSkill) => {
if (tieredSkill) {
if (skillLevel <= 3) {
return tieredSkillsBasic[skillName]
} else {
return tieredSkillsAdvanced[skillName]
}
} else {
return skillsList[skillName]
}
const getSkill = (skillName) => {
return skillsList[skillName]
};

const sheetOpened = () => {
Expand Down Expand Up @@ -1587,11 +1508,7 @@ <h1>Inventory</h1>

skillAttributesToSet[skillLevel] = calculateSkillLevel(Number(newValue), values.learning_speed);

const skillData = getSkill(
skillNameLookupKey,
skillAttributesToSet[skillLevel],
tieredSkills.includes(skillNameLookupKey)
);
const skillData = getSkill(skillNameLookupKey);

skillAttributesToSet["repeating_skills_" + skillId + "skill_tnc"] = skillData.targetNumber + "/" + skillData.complexity;
skillAttributesToSet["repeating_skills_" + skillId + "target_number"] = skillData.targetNumber;
Expand Down Expand Up @@ -1736,11 +1653,6 @@ <h1>Inventory</h1>

if (skillFirstName in skillsList) {
skillData = skillsList[skillFirstName];
} else if (skillFirstName in tieredSkillsBasic) {
skillData = tieredSkillsBasic[skillFirstName];
} else if (skillFirstName.substring(0, skillFirstName.length - 1) in tieredSkillsBasic) {
skillData = tieredSkillsBasic[skillFirstName.substring(0, skillFirstName.length - 1)];
parsedSkillName = parsedSkillName.substring(0, parsedSkillName.length - 1);
} else {
console.error("Unable to migrate skill data. Old values are: " + JSON.stringify(oldSkillValues));
skillsUpdated++;
Expand Down Expand Up @@ -1802,7 +1714,3 @@ <h1>Inventory</h1>
};

</script>




Loading

0 comments on commit 83a5f7f

Please sign in to comment.