kypvalanx / Foundry-VTT-StarWars-SagaEdition

25 stars 7 forks source link

Taking a level in a new class gives more trained skills #454

Closed consumptionof closed 5 months ago

consumptionof commented 5 months ago

When you add a new class to a character, they get a number of trained skills matching their class + their Int modifier. This makes sense when the character is first created, but it keeps giving new trained skills for each new class (that gets skills). For example, character with 18 INT and a level each in Scoundrel, Soldier, and Jedi gains 13 trained skills.

Steps to replicate:

kypvalanx commented 5 months ago
                        it('should onlt take trained skills from first level class', async function () {
                            await withTestActor(async actor => {
                                actor.suppressDialog = true
                                await actor.setAttributes({int:18})
                                await actor.sheet._onDropItem(getMockEvent(), {name: "Scoundrel", type: "class"})
                                await actor.sheet._onDropItem(getMockEvent(), {name: "Jedi", type: "class",
                                    answers: ["Force Sensitivity"]})
                                await actor.sheet._onDropItem(getMockEvent(), {name: "Soldier", type: "class", answers: ["Armor Proficiency (Light)"]})
                                hasItems(assert, actor.items, [  "Bonus Feat (Point-Blank Shot)",
                                    "Bonus Feat (Weapon Proficiency (Pistols))",
                                    "Bonus Feat (Weapon Proficiency (Simple Weapons))",
                                    "Jedi",
                                    "Point-Blank Shot",
                                    "Scoundrel",
                                    "Soldier",
                                    "Weapon Proficiency (Pistols)",
                                    "Weapon Proficiency (Simple Weapons)"])
                                assert.lengthOf(actor.items, 9)
                                const availableTrainedSkills = await getAvailableTrainedSkillCount(actor)
                                assert.equal(availableTrainedSkills, 8);
                            });
                        });
                    this seems to work correctly, i'll keep looking
kypvalanx commented 5 months ago

@consumptionof can you send me the character that's causing the problem?

consumptionof commented 5 months ago

@consumptionof can you send me the character that's causing the problem?

It looks like an update fixed it. Doing the steps above no longer give the same result; I don't get any more trained skills when taking another base class. Thank you!