Skip to content

INQTest.js.getSkillModifier.js

kyleady edited this page Jan 30, 2018 · 2 revisions

Purpose

Determines the skill modifier for the given inqcharacter.

Usage

INQTest.prototype.getSkillModifier(inqcharacter)

inqcharacter is an INQCharacter. It will use INQCharacter.js.get.js to retrieve the relevant skill info.

The skill and skill group are expected to be defined ahead of time. If no skill is specified, this method will send no warnings and it will leave this.Modifiers unchanged.

If INQTest has not specified a skill group but inqcharacter has skill groups for the defined skill, this method will send a warning to the GM and it will leave this.Modifiers unchanged.

If multiple skill modifiers could apply, this method will choose the most beneficial one.

If no skill modifiers are found, it will set the modifier to -20.

If a skill modifier is found, {Name: 'Skill', Value: skill_modifier} is added through INQTest.js.addModifier.js.

Examples

A warning will be sent if the character has skill groups but no skill group was specified.

var inqcharacter = new INQCharacter();
inqcharacter.List.Skills.push(new INQLink('Tactics(Assault Doctrine)+13'));

var myTest = new INQTest();
myTest.setSkill('Tactics');

myTest.getSkillModifier(inqcharacter);
// a warning will be sent to the GM
// no modifier will be added

If multiple possible modifiers are found, it will use the best modifier.

var inqcharacter = new INQCharacter();
inqcharacter.List.Skills.push(new INQLink('Common Lore(all)+10'));
inqcharacter.List.Skills.push(new INQLink('Common Lore(War)+30'));
inqcharacter.List.Skills.push(new INQLink('Common Lore(Imperial Guard)+20'));

var myTest = new INQTest();
myTest.setSkill('Common Lore(Imperial Guard)');
myTest.setSubgroup('Common Lore(Imperial Guard)');

myTest.getSkillModifier(inqcharacter);
// adds {Name: 'Skill', Value: 20} to myTest.Modifiers

myTest.setSubgroup('Common Lore(Tech)');

myTest.getSkillModifier(inqcharacter);
// adds {Name: 'Skill', Value: 10} to myTest.Modifiers

If no modifiers are found, it will add a penalty instead.

var inqcharacter = new INQCharacter();
inqcharacter.List.Skills.push(new INQLink('Medicae'));

var myTest = new INQTest();
myTest.setSkill('Tech-Use');
myTest.setSubgroup('Tech-Use');

myTest.getSkillModifier(inqcharacter);
// adds {Name: 'Skill', Value: -20} to myTest.Modifiers

Clone this wiki locally