programming-game
Version:
The client for programming game, an mmorpg that you interact with entirely through code.
137 lines (136 loc) • 5.42 kB
TypeScript
import { UniqueItemId, UnitStats } from "./types";
import { Spells } from "./spells";
export type ItemDefinition = EquipmentDefinition | UsableItemDefinition | TrashItemDefinition | AmmoDefinition | FoodItemDefinition;
export type UniqueItemDefinition = WeaponDefinition | GrimmoireDefinition | ArmorDefinition;
export type EquipmentDefinition = WeaponDefinition | GrimmoireDefinition | ArmorDefinition | AccessoryDefinition;
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;
stats: {
attack: number;
};
}
export interface WeaponDefinition extends BaseItemDefinition<Weapons | OffhandWeapons> {
id: Weapons | OffhandWeapons;
type: WeaponType;
stats: Partial<UnitStats>;
}
export interface GrimmoireDefinition extends WeaponDefinition {
type: "grimmoire";
stats: Partial<UnitStats>;
spells: Partial<Record<Spells, true>>;
}
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" | "arrowShaft" | "bitOfWood" | "woodLog" | "woodPommel" | "pinewoodLog" | "pinewoodBits" | "pinewoodArrowShaft" | "pinewoodPommel" | "copperIngot" | "chunkOfCopper" | "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 | OffhandWeapons | Accessories | Armors | UniqueItemId;
type Accessories = Amulets | Rings;
type Armors = Helms | Chests | Legs | Boots | Gloves | UniqueItemId;
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" | "stonePickaxe";
export type OffhandWeapons =
/**
* grimmoires
*/
"basicGrimmoire" | "adeptsGrimmoire" | "mastersGrimmoire" | "cheatersGrimmoire"
/**
* Shields
*/
| "woodenShield" | "pinewoodShield" | "copperShield" | "ironShield" | "steelShield" | "goldShield" | "platinumShield";
export type ItemType = "usable" | "food" | "trash" | WeaponType | ArmorType | AccessoryType | "ammo";
export type WeaponType = "dagger" | "oneHandedAxe" | "oneHandedMace" | "oneHandedSword" | "wand" | "bow" | "staff" | "crossbow" | "twoHandedAxe" | "twoHandedMace" | "twoHandedSword" | "fellingAxe" | "pickaxe" | OffhandWeaponType;
export type OffhandWeaponType = "shield" | "offhand" | "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";
export declare const items: Record<Items, ItemDefinition>;
export {};