refactor: use subclasses for different item types
This commit is contained in:
parent
be616e3be8
commit
8d2cff77d7
47 changed files with 766 additions and 456 deletions
|
@ -2,7 +2,6 @@
|
|||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { CooldownDuration } from "../item/item-data-source";
|
||||
import {
|
||||
getActorUpdateDataGetter,
|
||||
getCompendiumMigrator,
|
||||
|
@ -45,10 +44,10 @@ function getItemUpdateData(itemData: Partial<foundry.data.ItemData["_source"]>)
|
|||
return updateData;
|
||||
}
|
||||
|
||||
function migrateCooldownDuration(cooldownDurationValue?: string, cooldownDurationUnit?: string) {
|
||||
function migrateCooldownDuration(cooldownDurationValue = "", cooldownDurationUnit = "") {
|
||||
if (Number.isNumeric(cooldownDurationValue)) {
|
||||
const value = Number.fromString(cooldownDurationValue!);
|
||||
const rounds = getRounds(cooldownDurationUnit ?? "", value);
|
||||
const value = Number.fromString(cooldownDurationValue);
|
||||
const rounds = getRounds(cooldownDurationUnit, value);
|
||||
|
||||
if (rounds * secondsPerRound > secondsPerDay) {
|
||||
return "d20d";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue