Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Define power systems structure #9

Open
Spice-King opened this issue Oct 18, 2020 · 2 comments
Open

Define power systems structure #9

Spice-King opened this issue Oct 18, 2020 · 2 comments

Comments

@Spice-King
Copy link
Owner

I wish to support as much home brew content as possible, so baking in the various power systems feels kinda bad, plus that means baking in the deluxe and paid supplements in order to support them.

@Spice-King Spice-King created this issue from a note in SWNR Ideas Board (To Do) Oct 18, 2020
@Spice-King
Copy link
Owner Author

// For linking system def to classes, foci and what not.
declare interface SWNRPowerSystemDef {
  resourceName: string;
  type: "effort pool" | "prepared spells" | "spell slots";
  system: SWNRPowerSystemDefs;
}

declare type SWNRValidLevels = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
declare type SWNRSpellLevels = 1 | 2 | 3 | 4 | 5;
declare type SWNRPowerSystemDefs =
  | SWNREffortPoolDef
  | SWNRPreparedSpellsDef
  | SWNRSpellSlotsDef;

declare interface SWNRPowerSystem {
  localizationKey: string;
  value: number;
  max: number;
  type: SWNRPowerSystemTypes;
}

declare type SWNRPowerSystemTypes =
  | SWNREffortPool
  | SWNRSpellSlots
  | SWNRPreparedSpells;

declare interface SWNREffortPool extends SWNRPowerSystem {
  committed: {
    active: number;
    scene: number;
    day: number;
  };
}

declare interface SWNRSpellSlots extends SWNRPowerSystem {
  spentSlots: {
    [SpellLevel in SWNRSpellLevels]: number;
  };
}

declare interface SWNRPreparedSpells extends SWNRPowerSystem {
  preparedSpells: {
    spellItemId: string;
    slotLevel: SWNRSpellLevels;
    used: boolean;
  }[];
}

declare interface SWNREffortPoolDef extends SWNRPowerSystemDef {
  timeSlots: {
    name: string;
    localization: string;
  }[];
}

declare interface SWNRPreparedSpellsDef extends SWNRPowerSystemDef {
  preparedSpellsPerCharLevel: {
    [P in SWNRValidLevels]: {
      [P in SWNRSpellLevels]: number;
    };
  };
}

declare interface SWNRSpellSlotsDef extends SWNRPowerSystemDef {
  spellsPerLevel: {
    [P in SWNRValidLevels]: {
      [P in SWNRSpellLevels]: {
        spellSlots: number;
        knownSpellsLimit: number;
      };
    };
  };
}

@bwebster4
Copy link
Contributor

I like this

thebwt pushed a commit to thebwt/foundry-swnr that referenced this issue Dec 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Development

No branches or pull requests

2 participants