TargetModifier
 TargetModifier ⇐ ComparisonModifier
A TargetModifier determines whether rolls are classed as a success, failure, or neutral.
This modifies the roll values, depending on the state;
success = 1, failure = -1, neutral = 0.
Kind: global class
Extends: ComparisonModifier
- TargetModifier ⇐ 
ComparisonModifier- new TargetModifier(successCP, [failureCP])
 - .order : 
number - .failureComparePoint ⇒ 
ComparePoint|null - .failureComparePoint
 - .name ⇒ 
string - .notation ⇒ 
string - .successComparePoint ⇒ 
ComparePoint - .successComparePoint
 - .getStateValue(value) ⇒ 
number - .isFailure(value) ⇒ 
boolean - .isNeutral(value) ⇒ 
boolean - .isSuccess(value) ⇒ 
boolean - .run(results, _context) ⇒ 
RollResults - .toJSON() ⇒ 
Object 
 
new TargetModifier(successCP, [failureCP])
Create a TargetModifier instance.
Throws:
TypeErrorfailure comparePoint must be instance of ComparePoint or null
| Param | Type | Default | Description | 
|---|---|---|---|
| successCP | ComparePoint | The success comparison object | |
| [failureCP] | ComparePoint |  | The failure comparison object | 
 targetModifier.order : number
The default modifier execution order.
Kind: instance property of TargetModifier
 targetModifier.failureComparePoint ⇒ ComparePoint | null
The failure compare point for the modifier
Kind: instance property of TargetModifier
targetModifier.failureComparePoint
Set the failure compare point
Kind: instance property of TargetModifier
Throws:
TypeErrorfailure comparePoint must be instance of ComparePoint or null
| Param | Type | 
|---|---|
| comparePoint | ComparePoint | null | 
 targetModifier.name ⇒ string
The name of the modifier.
Kind: instance property of TargetModifier
Returns: string - 'target'
 targetModifier.notation ⇒ string
The modifier's notation.
Kind: instance property of TargetModifier
 targetModifier.successComparePoint ⇒ ComparePoint
The success compare point for the modifier
Kind: instance property of TargetModifier
targetModifier.successComparePoint
Set the success compare point for the modifier
Kind: instance property of TargetModifier
| Param | Type | 
|---|---|
| value | ComparePoint | 
 targetModifier.getStateValue(value) ⇒ number
Check if the value is a success/failure/neither and return the corresponding state value.
Kind: instance method of TargetModifier
Returns: number - success = 1, failure = -1, neutral = 0
| Param | Type | Description | 
|---|---|---|
| value | number | The number to compare against | 
 targetModifier.isFailure(value) ⇒ boolean
Check if the value matches the failure compare point.
A response of false does NOT indicate a success. A value is a success ONLY if it passes the success compare point. A value could be neither a failure nor a success.
Kind: instance method of TargetModifier
| Param | Type | Description | 
|---|---|---|
| value | number | The number to compare against | 
 targetModifier.isNeutral(value) ⇒ boolean
Check if the value is neither a success nor a failure.
Kind: instance method of TargetModifier
Returns: boolean - true if the value doesn't match the success and failure compare points
| Param | Type | Description | 
|---|---|---|
| value | number | The number to compare against | 
 targetModifier.isSuccess(value) ⇒ boolean
Check if the value matches the success compare point.
A response of false does NOT indicate a failure. A value is a failure ONLY if it passes the failure compare point. A value could be neither a failure nor a success.
Kind: instance method of TargetModifier
| Param | Type | Description | 
|---|---|---|
| value | number | The number to compare against | 
 targetModifier.run(results, _context) ⇒ RollResults
Run the modifier on the results.
Kind: instance method of TargetModifier
Returns: RollResults - The modified results
| Param | Type | Description | 
|---|---|---|
| results | RollResults | The results to run the modifier against | 
| _context | StandardDice | RollGroup | The object that the modifier is attached to | 
 targetModifier.toJSON() ⇒ Object
Return an object for JSON serialising.
This is called automatically when JSON encoding the object.
Kind: instance method of TargetModifier