untitled-combat-game-calculations
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

untitled-combat-game-calculations

A package containing business logic shared between the client-side and server-side application for untitled-combat-game. Relies heavily on typescript for input validation where business logic is not implemented.

This is still very much a work in progres.

Exposed functions

All of the currently exposed functions. Check character.types.d.ts for type definitions.

// calculates shield/armor combat stats
getArmorCombatStats: (armor?: ArmorType | ShieldType | undefined) => ArmorCombatStatsType;

// validates character baseStats
validateCharacterStats: (stats: CharacterStatsType) => boolean;

// calculates max character fatigue based on baseStats
calculateMaxFatigue: (data: {
    baseStats: CharacterStatsType;
    armor?: ArmorType | undefined;
    shield?: ShieldType | undefined;
}) => number;

// calculates max character hitpoints base on baseStats
calculateMaxHitpoints: (baseStats: CharacterStatsType) => number;

// calculates max character resolve based on baseStats
calculateMaxResolve: (baseStats: CharacterStatsType) => number;

// Calculates character combat stats based on baseStats, equipped armor and shield
calculateCombatStats: (data: {
    baseStats: CharacterStatsType;
    armor?: ArmorType | undefined;
    shield?: ShieldType | undefined;
}) => CombatStatsType;

// Calculates character skills based on baseStats, equiped shield and weapon
calculateCharacterSkills: (data: {
    baseStats: CharacterStatsType;
    shield?: ShieldType | undefined;
    weapon?: WeaponType | undefined;
}) => SkillValuesType[];

// Calculated final character basa. Represents a entry in the characters database.
calculateCharacter: (data: {
    armor?: ArmorType | undefined;
    baseStats: CharacterStatsType;
    description: string;
    name: string;
    _id: string | null;
    shield?: ShieldType | undefined;
    weapon?: WeaponType | undefined;
}) => CharacterType;

Readme

Keywords

none

Package Sidebar

Install

npm i untitled-combat-game-calculations

Weekly Downloads

1

Version

1.1.0

License

ISC

Unpacked Size

12.4 kB

Total Files

6

Last publish

Collaborators

  • shooshte