programming-game
Version:
The client for programming game, an mmorpg that you interact with entirely through code.
152 lines (151 loc) • 5.92 kB
TypeScript
import type { UnitStats } from "./unit-stats";
import { type Spells } from "./spells";
export type ItemDefinition = EquipmentDefinition | UsableItemDefinition | TrashItemDefinition | AmmoDefinition | FoodItemDefinition;
export type EquipmentDefinition = WeaponDefinition | GrimmoireDefinition | ArmorDefinition | AccessoryDefinition | OffhandEquipmentDefinition;
interface BaseItemDefinition<T> {
id: T;
name: string;
/**
* Weight in Grams
*/
weight: number;
calories?: number;
buyFromVendorPrice: number;
sellToVendorPrice: number;
type: ItemType;
deprecated?: true;
}
export interface ArmorDefinition extends BaseItemDefinition<Armors> {
id: Armors;
type: ArmorType;
stats: Partial<UnitStats>;
}
export interface AccessoryDefinition extends BaseItemDefinition<Accessories> {
id: Accessories;
type: AccessoryType;
stats: Partial<UnitStats>;
}
type AmmoTypes = "arrow" | "bolt";
export interface AmmoDefinition extends BaseItemDefinition<Ammos> {
id: Ammos;
type: "ammo";
ammoType: AmmoTypes;
damage: number;
stats: {
attack: number;
};
}
export interface WeaponDefinition extends BaseItemDefinition<Weapons> {
id: Weapons;
type: WeaponType;
stats: Partial<UnitStats>;
spellCount: number;
damage: number;
attacksPerSecond: number;
}
export interface OffhandEquipmentDefinition extends BaseItemDefinition<OffhandEquipment> {
id: OffhandEquipment;
type: OffhandEquipmentType;
spellCount: number;
stats: Partial<UnitStats>;
}
export interface GrimmoireDefinition extends OffhandEquipmentDefinition {
type: "grimmoire";
spells: Partial<Record<Spells, true>>;
}
export interface ShieldDefinition extends OffhandEquipmentDefinition {
type: "shield";
}
interface UsableItemDefinition extends BaseItemDefinition<UsableItems> {
type: "usable";
}
interface FoodItemDefinition extends BaseItemDefinition<FoodItems> {
type: "food";
}
interface TrashItemDefinition extends BaseItemDefinition<Trash> {
type: "trash";
}
export type Items = Trash | Ammos
/**
* consumables
*/
| UsableItems | FoodItems | Equipments;
type Trash = "snakeEyes" | "snakeVenom" | "snakeFangs" | "digesta" | "eyeJelly" | "glassVial" | "stone" | "stoneArrowHead" | "flint" | "copperCoin" | "feather" | "tatteredCottonCloth" | "cottonCloth" | "boltOfCottonCloth" | "tatteredLinenCloth" | "linenCloth" | "boltOfLinenCloth" | "tatteredWoolCloth" | "woolCloth" | "boltOfWoolCloth" | "coarseThread" | "snakeSkin" | "ratPelt" | "leatherStrips" | "lightLeather" | "snakeSkinLeather" | "pinewoodBits" | "pinewoodLog" | "oakBits" | "oakLog" | "arrowShaft" | "bitOfWood" | "woodLog" | "woodPommel" | "pinewoodArrowShaft" | "pinewoodPommel" | "pinewoodAxeHandle" | "chunkOfCopper" | "copperOre" | "tinOre" | "copperIngot" | "tinIngot" | "bronzeIngot" | "stoneCutterTools" | "stoneCarvingKnife" | "campfireKit" | "copperNeedle" | "anvil" | "mortarAndPestle" | "furnace" | Spells;
/**
* rings
*/
export type UsableItems = "minorHealthPotion" | "medicatedBandage";
export type FoodItems = "snakeMeat" | "ratMeat" | "chickenMeat" | "edibleSlime";
export type Equipments = Weapons | OffhandEquipment | Accessories | Armors;
type Accessories = Amulets | Rings;
type Armors = Helms | Chests | Legs | Boots | Gloves;
export type Ammos = "woodenArrow" | "pinewoodArrow" | "woodenBolt";
export type OneHandedWeapons =
/**
* wood weapons
*/
"woodenDagger" | "woodenSword" | "pinewoodSword"
/**
* copper weapons
*/
| "copperDagger" | "copperSword" | "copperGreatSword"
/**
* iron weapons
*/
| "ironDagger" | "ironSword"
/**
* steel weapons
*/
| "steelDagger" | "steelSword"
/**
* gold weapons
*/
| "goldDagger" | "goldSword"
/**
* platinum weapons
*/
| "platinumDagger" | "platinumSword";
export type Weapons = OneHandedWeapons
/**
* Bows
*/
| "woodenBow" | "pinewoodBow" | "copperBow" | "ironBow" | "steelBow" | "goldBow" | "platinumBow"
/**
* crossbows
*/
| "woodenCrossbow" | "pinewoodCrossbow" | "copperCrossbow" | "ironCrossbow" | "steelCrossbow" | "goldCrossbow" | "platinumCrossbow"
/**
* staffs
*/
| "woodenStaff" | "copperStaff" | "ironStaff" | "steelStaff" | "goldStaff" | "platinumStaff" | WeaponTools;
/**
* Tools
*/
type WeaponTools = "stoneFellingAxe" | "copperFellingAxe" | "stonePickaxe" | "copperPickaxe";
export type OffhandEquipment =
/**
* grimmoires
*/
"basicGrimmoire" | "adeptsGrimmoire" | "mastersGrimmoire" | "cheatersGrimmoire"
/**
* Shields
*/
| "woodenShield" | "pinewoodShield" | "copperShield" | "ironShield" | "steelShield" | "goldShield" | "platinumShield";
export type ItemType = "usable" | "food" | "trash" | WeaponType | ArmorType | AccessoryType | OffhandEquipmentType | "ammo";
export type WeaponType = "dagger" | "oneHandedAxe" | "oneHandedMace" | "oneHandedSword" | "bow" | "staff" | "crossbow" | "twoHandedAxe" | "twoHandedMace" | "twoHandedSword" | "fellingAxe" | "pickaxe";
export type OffhandEquipmentType = "shield" | "grimmoire";
export type AccessoryType = "ring" | "amulet" | "earring";
export type Helms = "cottonHood" | "lightLeatherHelm" | "copperMailHelm" | "snakeSkinHelm";
export type Chests = "cottonShirt" | "lightLeatherChest" | "copperMailChest" | "snakeSkinChest";
export type Gloves = "cottonGloves" | "lightLeatherGloves" | "copperMailGloves" | "snakeSkinGloves";
export type Legs = "cottonPants" | "lightLeatherLegs" | "copperMailLegs" | "snakeSkinLegs";
export type Boots = "cottonBoots" | "lightLeatherBoots" | "copperMailBoots" | "snakeSkinBoots";
export type Amulets = "minorManaAmulet";
export type Rings = "minorManaRing" | "cheatersManaRing";
type ArmorType = "helm" | "chest" | "legs" | "feet" | "hands";
/**
* @deprecated
* You should use the heartbeat.items value instead as it will always contain the latest item definitions.
*/
export declare const items: Record<Items, ItemDefinition>;
export {};