Skip to content

Commit

Permalink
Merge pull request RanvierMUD#19 from Ranvier-TS/use-record-type-in-d…
Browse files Browse the repository at this point in the history
…mg-metadata

Avoid using object in damage/heal metadata
  • Loading branch information
seanohue authored Jun 16, 2021
2 parents 8aacd73 + 259991c commit 999ab3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Damage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class Damage {
attacker?: PlayerOrNpc | null;
amount: number;
source?: any = null;
metadata: object;
metadata: Record<string, unknown>;

/**
* @param {string} attribute Attribute the damage is going to apply to
Expand All @@ -26,7 +26,7 @@ export class Damage {
amount: number,
attacker: PlayerOrNpc,
source: any,
metadata: object = {}
metadata: Partial<Record<string, unknown>> = {}
) {
if (!Number.isFinite(amount)) {
throw new TypeError(
Expand All @@ -50,7 +50,7 @@ export class Damage {
* @param {Character} target
* @return {number} Final damage amount
*/
evaluate(target: PlayerOrNpc) {
evaluate(target: PlayerOrNpc): number {
let amount = this.amount;

if (this.attacker) {
Expand Down

0 comments on commit 999ab3c

Please sign in to comment.