28 apply damage through chat (#40)
* Add Rightclick menu to apply damage/heal Changes: + add rightclick context menu for rolls + only appears if keyword Schaden exists + calculate damage from all rolls with keyword Schaden + possible to apply damage or heal actor or if present token ToDo: + add button that does the same * Add Rüstungsschutz to damage calculation Changes: + Add Damage application from chat + take token first, if none exist, take actor + include damage reduction from equipped armor + damage appliaction is only accesible through right click on roll * Fix falsy display of rightclick context menu
This commit is contained in:
@@ -82,6 +82,8 @@ export enum M5Stats {
|
||||
POISON_RESISTANCE = "poisonResistance",
|
||||
LP = "lp",
|
||||
AP = "ap",
|
||||
PROTECTION_LP = "lpProtection",
|
||||
PROTECTION_AP = "apProtection",
|
||||
}
|
||||
|
||||
export enum M5ModType {
|
||||
@@ -143,7 +145,8 @@ export interface M5CharacterCalculatedData {
|
||||
stats: {
|
||||
lp: M5ModResult;
|
||||
ap: M5ModResult;
|
||||
armor: number;
|
||||
lpProtection: M5ModResult;
|
||||
apProtection: M5ModResult;
|
||||
defense: M5ModResult;
|
||||
damageBonus: M5ModResult;
|
||||
attackBonus: M5ModResult;
|
||||
|
||||
@@ -53,7 +53,8 @@ export class M5Character extends Actor {
|
||||
stats: {
|
||||
lp: { value: 0, mods: [] },
|
||||
ap: { value: 0, mods: [] },
|
||||
armor: 0,
|
||||
lpProtection: { value: 0, mods: [] },
|
||||
apProtection: { value: 0, mods: [] },
|
||||
defense: { value: 0, mods: [] },
|
||||
damageBonus: { value: 0, mods: [] },
|
||||
attackBonus: { value: 0, mods: [] },
|
||||
@@ -116,7 +117,8 @@ export class M5Character extends Actor {
|
||||
|
||||
ret.stats.lp = this.modResult(data.lp);
|
||||
ret.stats.ap = this.modResult(data.ap);
|
||||
ret.stats.armor = 0;
|
||||
ret.stats.lpProtection = this.modResult(0);
|
||||
ret.stats.apProtection = this.modResult(0);
|
||||
ret.stats.defense = this.modResult(M5Character.defenseFromLevel(ret.level));
|
||||
ret.stats.damageBonus = this.modResult(Math.floor(ret.attributes.st.value / 20) + Math.floor(ret.attributes.gs.value / 30) - 3);
|
||||
ret.stats.attackBonus = this.modResult(ret.attributes.gs.bonus);
|
||||
|
||||
@@ -39,6 +39,8 @@ export default class M5ModAggregate {
|
||||
this.push({ type: M5ModType.STAT, id: M5Stats.POISON_RESISTANCE, operation: M5ModOperation.SET, value: calc.stats.poisonResistance.value }, characterString);
|
||||
this.push({ type: M5ModType.STAT, id: M5Stats.LP, operation: M5ModOperation.SET, value: calc.stats.lp.value }, characterString);
|
||||
this.push({ type: M5ModType.STAT, id: M5Stats.AP, operation: M5ModOperation.SET, value: calc.stats.ap.value }, characterString);
|
||||
this.push({ type: M5ModType.STAT, id: M5Stats.PROTECTION_LP, operation: M5ModOperation.SET, value: calc.stats.lpProtection.value }, characterString);
|
||||
this.push({ type: M5ModType.STAT, id: M5Stats.PROTECTION_AP, operation: M5ModOperation.SET, value: calc.stats.apProtection.value }, characterString);
|
||||
}
|
||||
|
||||
push(mod: M5ItemMod, source: string) {
|
||||
|
||||
@@ -111,6 +111,8 @@ export class M5Item extends Item {
|
||||
itemData.mods[1] = { type: "stat", id: "attackBonus", operation: "add", value: itemData.stats.attackBonus };
|
||||
itemData.mods[2] = { type: "stat", id: "movement", operation: "add", value: itemData.stats.movementBonus };
|
||||
itemData.mods[3] = { type: "attribute", id: "gw", operation: "add100", value: itemData.attributeMod.gw };
|
||||
itemData.mods[4] = { type: "stat", id: "lpProtection", operation: "set", value: itemData.lpProtection };
|
||||
itemData.mods[5] = { type: "stat", id: "apProtection", operation: "set", value: itemData.apProtection };
|
||||
} else if (itemType === "spell") {
|
||||
calc.fw = 0;
|
||||
if (actor) {
|
||||
|
||||
Reference in New Issue
Block a user