Update actor for using/get a void point
This commit is contained in:
@@ -375,23 +375,25 @@ export class DicePickerDialog extends FormApplication {
|
|||||||
|
|
||||||
// Update Actor
|
// Update Actor
|
||||||
if (this._actor) {
|
if (this._actor) {
|
||||||
|
const actorData = duplicate(this._actor.data.data);
|
||||||
|
|
||||||
// TODO update actor stance ? good idea or not, choice-able ?
|
// TODO update actor stance ? good idea or not, choice-able ?
|
||||||
// this._actor.data.data.stance = approach;
|
// actorData.stance = approach;
|
||||||
|
|
||||||
|
// If hidden add 1 void pt
|
||||||
|
if (this._difficulty.isHidden) {
|
||||||
|
actorData.void_points.value = Math.min(actorData.void_points.value + 1, actorData.void_points.max);
|
||||||
|
}
|
||||||
|
|
||||||
// If Void point is used, minus the actor
|
// If Void point is used, minus the actor
|
||||||
if (formData.use_void_point) {
|
if (formData.use_void_point) {
|
||||||
this._actor.data.data.void_points.value = Math.max(this._actor.data.data.void_points.value - 1, 0);
|
actorData.void_points.value = Math.max(actorData.void_points.value - 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If hidden add void 1pt
|
// Update actor
|
||||||
// this._difficulty.isHidden = !!formData.diff_hidden;
|
this._actor.update({
|
||||||
// this._difficulty.difficulty = formData.diff;
|
data: diffObject(this._actor.data.data, actorData),
|
||||||
if (this._difficulty.isHidden) {
|
});
|
||||||
this._actor.data.data.void_points.value = Math.min(
|
|
||||||
this._actor.data.data.void_points.value + 1,
|
|
||||||
this._actor.data.data.void_points.max
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Let's roll !
|
// Let's roll !
|
||||||
|
|||||||
Reference in New Issue
Block a user