UNPKG

programming-game

Version:

The client for programming game, an mmorpg that you interact with entirely through code.

1,458 lines (1,437 loc) 29.5 kB
import { UniqueItemId, UnitStats } from "./types"; import { Spells, spellMap } 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 = // alchemy | "snakeEyes" | "snakeVenom" | "snakeFangs" | "digesta" | "eyeJelly" | "glassVial" | "stone" | "stoneArrowHead" | "flint" // money | "copperCoin" | "feather" // cloth // tier 1 | "tatteredCottonCloth" | "cottonCloth" | "boltOfCottonCloth" // tier 2 | "tatteredLinenCloth" | "linenCloth" | "boltOfLinenCloth" // tier 4 | "tatteredWoolCloth" | "woolCloth" | "boltOfWoolCloth" // crafting ingredients | "coarseThread" // leather | "snakeSkin" | "ratPelt" | "leatherStrips" | "lightLeather" | "snakeSkinLeather" // wood | "arrowShaft" // deprecated | "bitOfWood" | "woodLog" | "woodPommel" | "pinewoodLog" // tier 1 | "pinewoodBits" | "pinewoodArrowShaft" | "pinewoodPommel" // Sword/dagger pommel // metals | "copperIngot" | "chunkOfCopper" // crafting stations | "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"; //#region OneHandedWeapons 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"; //#endregion OneHandedWeapons //#region weapons 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"; //#endregion weapons //#region offhand weapons export type OffhandWeapons = /** * grimmoires */ | "basicGrimmoire" // 3 slots | "adeptsGrimmoire" // 5 slots | "mastersGrimmoire" // 9 slots | "cheatersGrimmoire" // has everything /** * Shields */ | "woodenShield" | "pinewoodShield" | "copperShield" | "ironShield" | "steelShield" | "goldShield" | "platinumShield"; //#endregion offhand weapons export type ItemType = | "usable" | "food" | "trash" | WeaponType | ArmorType | AccessoryType | "ammo"; export type WeaponType = // 1 handers | "dagger" | "oneHandedAxe" | "oneHandedMace" | "oneHandedSword" | "wand" // 2 handers | "bow" | "staff" | "crossbow" | "twoHandedAxe" | "twoHandedMace" | "twoHandedSword" | "fellingAxe" | "pickaxe" | OffhandWeaponType; // off hands 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"; const generateArmor = ( id: Armors, name: string, type: ArmorType, defense: number ): ArmorDefinition => { return { id, name, type, weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { defense, }, }; }; const createCraftingIngredient = ( id: Trash, name: string, weight: number, buyPrice = 1, sellPrice = 1, deprecated = false ): ItemDefinition => { const def: ItemDefinition = { id, name, weight, type: "trash", buyFromVendorPrice: buyPrice, sellToVendorPrice: sellPrice, }; if (deprecated) { def.deprecated = true; } return def; }; type InnerProps = { name: string; type: ArmorType }; const createArmorGenerator = <T extends Armors>(opts: { baseWeight: number; baseDefense: number; items: Record<T, InnerProps>; }) => { return (Object.entries(opts.items) as [T, InnerProps][]).reduce( (acc, [key, val]) => { acc[key as T] = generateArmor( key as T, val.name, val.type, opts.baseDefense ); return acc; }, {} as { [key in T]: ArmorDefinition; } ); }; const createSpellStone = <T extends Spells>( spell: T, name: string ): ItemDefinition => { return { id: spell as T, type: "trash" as const, name: `${name} Spell Stone`, weight: 5_000, buyFromVendorPrice: 0, sellToVendorPrice: 0, }; }; const glassVial = createCraftingIngredient("glassVial", "Glass Vial", 100); const eyeJelly = createCraftingIngredient("eyeJelly", "Eye Jelly", 0.25); const pinewoodArrowShaftWeight = 35; const featherWeight = 0.1; const stoneArrowHeadWeight = 7; export const items: Record<Items, ItemDefinition> = { //#region crafting arrowShaft: createCraftingIngredient( "arrowShaft", "Arrow Shaft", 300, 3, 1, true ), feather: createCraftingIngredient("feather", "Feather", featherWeight, 1, 1), snakeFangs: createCraftingIngredient("snakeFangs", "Snake Fangs", 7), woodLog: createCraftingIngredient("woodLog", "Wood Log", 5000, 18, 1, true), bitOfWood: createCraftingIngredient( "bitOfWood", "Bit of Wood", 500, 2, 1, true ), stoneArrowHead: createCraftingIngredient( "stoneArrowHead", "Stone Arrow Head", stoneArrowHeadWeight, 3, 1 ), pinewoodLog: createCraftingIngredient( "pinewoodLog", "Pinewood Log", 5_000, 18, 1 ), pinewoodBits: createCraftingIngredient( "pinewoodBits", "Pinewood Bits", 500, 2, 1 ), pinewoodArrowShaft: createCraftingIngredient( "pinewoodArrowShaft", "Pinewood Arrow Shaft", pinewoodArrowShaftWeight, 3, 1 ), ratPelt: createCraftingIngredient("ratPelt", "Rat Pelt", 100), copperNeedle: createCraftingIngredient("copperNeedle", "Copper Needle", 0.5), coarseThread: createCraftingIngredient("coarseThread", "Coarse Thread", 0.5), eyeJelly, snakeSkinLeather: createCraftingIngredient( "snakeSkinLeather", "Snakeskin Leather", 1000 ), glassVial, minorHealthPotion: { id: "minorHealthPotion", name: "Minor Health Potion", buyFromVendorPrice: 100, sellToVendorPrice: 10, weight: glassVial.weight + eyeJelly.weight, type: "usable", }, medicatedBandage: { id: "medicatedBandage", name: "Medicated Bandage", buyFromVendorPrice: 100, sellToVendorPrice: 10, weight: 0.1, type: "usable", }, digesta: createCraftingIngredient("digesta", "Digesta", 100), leatherStrips: createCraftingIngredient( "leatherStrips", "Leather Strips", 100 ), lightLeather: createCraftingIngredient("lightLeather", "Light Leather", 1000), // cloths // tier 1 tatteredCottonCloth: createCraftingIngredient( "tatteredCottonCloth", "Tattered Cotton Cloth", 100 ), cottonCloth: createCraftingIngredient("cottonCloth", "Cotton Cloth", 1000), boltOfCottonCloth: createCraftingIngredient( "boltOfCottonCloth", "Bolt of Cotton Cloth", 10_000 ), tatteredLinenCloth: createCraftingIngredient( "tatteredLinenCloth", "Tattered Linen Cloth", 100 ), linenCloth: createCraftingIngredient("linenCloth", "Linen Cloth", 1000), boltOfLinenCloth: createCraftingIngredient( "boltOfLinenCloth", "Bolt of Linen Cloth", 10_000 ), tatteredWoolCloth: createCraftingIngredient( "tatteredWoolCloth", "Tattered Wool Cloth", 100 ), woolCloth: createCraftingIngredient("woolCloth", "Wool Cloth", 1000), boltOfWoolCloth: createCraftingIngredient( "boltOfWoolCloth", "Bolt of Wool Cloth", 10_000 ), snakeSkin: { id: "snakeSkin", name: "Snake Skin", type: "trash", weight: 100, buyFromVendorPrice: 1, sellToVendorPrice: 1, }, stone: { id: "stone", name: "Stone", type: "trash", weight: 1000, buyFromVendorPrice: 10, sellToVendorPrice: 1, }, flint: { id: "flint", name: "Flint", type: "trash", weight: 1000, buyFromVendorPrice: 10, sellToVendorPrice: 1, }, stoneCutterTools: { id: "stoneCutterTools", name: "Stone Cutting Tools", type: "trash", weight: 5_000, buyFromVendorPrice: 1_000, sellToVendorPrice: 10, }, campfireKit: { id: "campfireKit", name: "Campfire Kit", type: "trash", weight: 3_000, buyFromVendorPrice: 1_000, sellToVendorPrice: 100, }, anvil: { id: "anvil", name: "Anvil", type: "trash", weight: 10_000, buyFromVendorPrice: 1_000, sellToVendorPrice: 100, }, stoneCarvingKnife: { id: "stoneCarvingKnife", name: "Stone Carving Knife", type: "trash", weight: 500, buyFromVendorPrice: 100, sellToVendorPrice: 10, }, mortarAndPestle: { id: "mortarAndPestle", name: "Mortar and Pestle", type: "trash", weight: 500, buyFromVendorPrice: 100, sellToVendorPrice: 10, }, furnace: { id: "furnace", name: "Furnace", type: "trash", weight: 10_000, buyFromVendorPrice: 1, sellToVendorPrice: 1, }, copperIngot: { id: "copperIngot", name: "Copper Ingot", type: "trash", weight: 3_000, buyFromVendorPrice: 3_000, sellToVendorPrice: 300, }, chunkOfCopper: { id: "chunkOfCopper", name: "Chunk of Copper", type: "trash", weight: 1_000, buyFromVendorPrice: 1_000, sellToVendorPrice: 100, }, woodPommel: { id: "woodPommel", name: "Wood Pommel", type: "trash", weight: 1000, buyFromVendorPrice: 1, sellToVendorPrice: 1, deprecated: true, }, pinewoodPommel: { id: "pinewoodPommel", name: "Pinewood Pommel", type: "trash", weight: 1000, buyFromVendorPrice: 1, sellToVendorPrice: 1, }, //#endregion crafting //#region consumables ratMeat: { id: "ratMeat", name: "Rat Meat", type: "food", weight: 400, buyFromVendorPrice: 0.5, sellToVendorPrice: 0.5, calories: 200, }, snakeMeat: { id: "snakeMeat", name: "Snake Meat", type: "food", weight: 1000, calories: 500, buyFromVendorPrice: 0.5, sellToVendorPrice: 0.5, }, edibleSlime: { id: "edibleSlime", name: "Edible Slime", type: "food", weight: 100, calories: 3_000, buyFromVendorPrice: 1000, sellToVendorPrice: 100, }, chickenMeat: { id: "chickenMeat", name: "Chicken Meat", type: "food", weight: 1000, calories: 500, buyFromVendorPrice: 0.5, sellToVendorPrice: 0.5, }, //#endregion consumables //#region ammo woodenArrow: { id: "woodenArrow", type: "ammo", ammoType: "arrow", name: "Wooden Arrow", weight: 1, buyFromVendorPrice: 1, sellToVendorPrice: 1, stats: { attack: 1, }, deprecated: true, }, pinewoodArrow: { id: "pinewoodArrow", type: "ammo", ammoType: "arrow", name: "Pinewood Arrow", // combined weight of the arrow shaft, feather, and stone arrow head weight: pinewoodArrowShaftWeight + 1 + stoneArrowHeadWeight, buyFromVendorPrice: 1, sellToVendorPrice: 1, stats: { attack: 1, }, }, woodenBolt: { id: "woodenBolt", type: "ammo", ammoType: "bolt", name: "Wooden Bolt", weight: 1, buyFromVendorPrice: 1, sellToVendorPrice: 1, stats: { attack: 1, }, deprecated: true, }, //#endregion ammo //#region random snakeVenom: { id: "snakeVenom", name: "Snake Venom", type: "trash", weight: 10, buyFromVendorPrice: 1, sellToVendorPrice: 1, }, snakeEyes: { id: "snakeEyes", name: "Snake Eyes", type: "trash", weight: 10, buyFromVendorPrice: 10, sellToVendorPrice: 1, }, //#endregion random //#region weapons //#region staffs woodenStaff: { id: "woodenStaff", name: "Wooden Staff", type: "staff", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 1, }, deprecated: true, }, copperStaff: { id: "copperStaff", name: "Copper Staff", type: "staff", weight: 1000, buyFromVendorPrice: 200, sellToVendorPrice: 20, stats: { attack: 2, }, deprecated: true, }, ironStaff: { id: "ironStaff", name: "Iron Staff", type: "staff", weight: 1000, buyFromVendorPrice: 300, sellToVendorPrice: 30, stats: { attack: 3, }, deprecated: true, }, steelStaff: { id: "steelStaff", name: "Steel Staff", type: "staff", weight: 1000, buyFromVendorPrice: 400, sellToVendorPrice: 40, stats: { attack: 4, }, deprecated: true, }, goldStaff: { id: "goldStaff", name: "Gold Staff", type: "staff", weight: 1000, buyFromVendorPrice: 500, sellToVendorPrice: 50, stats: { attack: 5, }, deprecated: true, }, platinumStaff: { id: "platinumStaff", name: "Platinum Staff", type: "staff", weight: 1000, buyFromVendorPrice: 600, sellToVendorPrice: 60, stats: { attack: 6, }, deprecated: true, }, //#endregion staffs //#region wooden woodenDagger: { id: "woodenDagger", name: "Wooden Dagger", type: "dagger", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 1, }, deprecated: true, }, woodenSword: { id: "woodenSword", name: "Wooden Sword", type: "oneHandedSword", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 2, }, deprecated: true, }, pinewoodSword: { id: "pinewoodSword", name: "Pinewood Sword", type: "dagger", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 1, }, }, //#endregion wooden //#region stone weapons stoneFellingAxe: { id: "stoneFellingAxe", name: "Stone Felling Axe", type: "fellingAxe", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 2.5, }, } satisfies WeaponDefinition, stonePickaxe: { id: "stonePickaxe", name: "Stone Pickaxe", type: "pickaxe", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 2.5, }, }, //#endregion stone weapons /** * copper weapons */ copperDagger: { id: "copperDagger", name: "Copper Dagger", type: "dagger", weight: 500, buyFromVendorPrice: 200, sellToVendorPrice: 20, stats: { attack: 2, }, }, copperSword: { id: "copperSword", name: "Copper Sword", type: "oneHandedSword", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 3, }, }, copperGreatSword: { id: "copperGreatSword", name: "Copper Greatsword", type: "twoHandedSword", weight: 2000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 5, }, }, /** * iron weapons */ ironDagger: { id: "ironDagger", name: "Iron Dagger", type: "dagger", weight: 1000, buyFromVendorPrice: 300, sellToVendorPrice: 30, stats: { attack: 3, }, }, ironSword: { id: "ironSword", name: "Iron Sword", type: "oneHandedSword", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 4, }, }, /** * steel weapons */ steelDagger: { id: "steelDagger", name: "Steel Dagger", type: "dagger", weight: 1000, buyFromVendorPrice: 300, sellToVendorPrice: 30, stats: { attack: 4, }, }, steelSword: { id: "steelSword", name: "Steel Sword", type: "oneHandedSword", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 5, }, }, /** * gold weapons */ goldDagger: { id: "goldDagger", name: "Gold Dagger", type: "dagger", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 5, }, }, goldSword: { id: "goldSword", name: "Gold Sword", type: "oneHandedSword", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 6, }, }, /** * platinum weapons */ platinumDagger: { id: "platinumDagger", name: "Platinum Dagger", type: "dagger", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 6, }, }, platinumSword: { id: "platinumSword", name: "Platinum Sword", type: "oneHandedSword", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 7, }, }, /** * Shields */ woodenShield: { id: "woodenShield", name: "Wooden Shield", type: "shield", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { defense: 1, }, deprecated: true, }, pinewoodShield: { id: "pinewoodShield", name: "Pinewood Shield", type: "shield", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { defense: 1, }, }, copperShield: { id: "copperShield", name: "Copper Shield", type: "shield", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { defense: 2, }, }, ironShield: { id: "ironShield", name: "Iron Shield", type: "shield", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { defense: 3, }, }, steelShield: { id: "steelShield", name: "Steel Shield", type: "shield", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { defense: 4, }, }, goldShield: { id: "goldShield", name: "Gold Shield", type: "shield", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { defense: 5, }, }, platinumShield: { id: "platinumShield", name: "Platinum Shield", type: "shield", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { defense: 6, }, }, /** * Bows */ woodenBow: { id: "woodenBow", name: "Wooden Bow", type: "bow", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 0, }, deprecated: true, }, pinewoodBow: { id: "pinewoodBow", name: "Pinewood Bow", type: "bow", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 0, }, }, copperBow: { id: "copperBow", name: "Copper Bow", type: "bow", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 1, }, deprecated: true, }, ironBow: { id: "ironBow", name: "Iron Bow", type: "bow", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 2, }, deprecated: true, }, steelBow: { id: "steelBow", name: "Steel Bow", type: "bow", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 3, }, deprecated: true, }, goldBow: { id: "goldBow", name: "Gold Bow", type: "bow", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 4, }, deprecated: true, }, platinumBow: { id: "platinumBow", name: "Platinum Bow", type: "bow", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: { attack: 5, }, deprecated: true, }, /** * crossbows */ woodenCrossbow: { id: "woodenCrossbow", name: "Wooden Crossbow", type: "crossbow", weight: 1000, buyFromVendorPrice: 200, sellToVendorPrice: 20, stats: { attack: 0, }, deprecated: true, }, pinewoodCrossbow: { id: "pinewoodCrossbow", name: "Pinewood Crossbow", type: "crossbow", weight: 1000, buyFromVendorPrice: 200, sellToVendorPrice: 20, stats: { attack: 0, }, deprecated: true, }, copperCrossbow: { id: "copperCrossbow", name: "Copper Crossbow", type: "crossbow", weight: 1000, buyFromVendorPrice: 200, sellToVendorPrice: 20, stats: { attack: 1, }, deprecated: true, }, ironCrossbow: { id: "ironCrossbow", name: "Iron Crossbow", type: "crossbow", weight: 1000, buyFromVendorPrice: 200, sellToVendorPrice: 20, stats: { attack: 2, }, deprecated: true, }, steelCrossbow: { id: "steelCrossbow", name: "Steel Crossbow", type: "crossbow", weight: 1000, buyFromVendorPrice: 200, sellToVendorPrice: 20, stats: { attack: 3, }, deprecated: true, }, goldCrossbow: { id: "goldCrossbow", name: "Gold Crossbow", type: "crossbow", weight: 1000, buyFromVendorPrice: 200, sellToVendorPrice: 20, stats: { attack: 4, }, deprecated: true, }, platinumCrossbow: { id: "platinumCrossbow", name: "Platinum Crossbow", type: "crossbow", weight: 1000, buyFromVendorPrice: 200, sellToVendorPrice: 20, stats: { attack: 5, }, deprecated: true, }, copperCoin: { id: "copperCoin", name: "Copper Coin", type: "trash", weight: 1, buyFromVendorPrice: 1, sellToVendorPrice: 1, }, //#region grimmoires basicGrimmoire: { id: "basicGrimmoire", name: "Basic Grimmoire", type: "grimmoire", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: {}, spells: {}, } satisfies GrimmoireDefinition, adeptsGrimmoire: { id: "adeptsGrimmoire", name: "Adept's Grimmoire", type: "grimmoire", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: {}, spells: {}, } satisfies GrimmoireDefinition, mastersGrimmoire: { id: "mastersGrimmoire", name: "Master's Grimmoire", type: "grimmoire", weight: 1000, buyFromVendorPrice: 100, sellToVendorPrice: 10, stats: {}, spells: {}, } satisfies GrimmoireDefinition, cheatersGrimmoire: { id: "cheatersGrimmoire", name: "Cheater's Grimmoire", type: "grimmoire", weight: 1000, buyFromVendorPrice: 0, sellToVendorPrice: 0, stats: {}, spells: Object.keys(spellMap).reduce((acc, spell) => { acc[spell as Spells] = true; return acc; }, {} as Record<Spells, true>), deprecated: true, } satisfies GrimmoireDefinition, //#endregion grimmoires //#endregion weapons minorManaRing: { id: "minorManaRing", name: "Minor Mana Ring", type: "ring", weight: 1000, buyFromVendorPrice: 1000, sellToVendorPrice: 100, stats: { maxHp: -10, maxMp: 10, }, }, minorManaAmulet: { id: "minorManaAmulet", name: "Minor Mana Amulet", type: "amulet", weight: 1000, buyFromVendorPrice: 1000, sellToVendorPrice: 100, stats: { maxHp: -10, maxMp: 10, }, }, cheatersManaRing: { id: "cheatersManaRing", name: "Cheater's Mana Ring", type: "ring", weight: 1000, buyFromVendorPrice: 0, sellToVendorPrice: 0, stats: { maxMp: 100, mpRegen: 10, }, deprecated: true, }, //#region armor // cloth // tier 1 ...createArmorGenerator({ baseDefense: 1, baseWeight: 1000, items: { cottonHood: { name: "Cotton Hood", type: "helm", }, cottonPants: { name: "Cotton Pants", type: "legs", }, cottonShirt: { name: "Cotton Shirt", type: "chest", }, cottonBoots: { name: "Cotton Boots", type: "feet", }, cottonGloves: { name: "Cotton Gloves", type: "hands", }, }, }), // leather ...createArmorGenerator({ baseDefense: 2, baseWeight: 1500, items: { lightLeatherHelm: { name: "Light Leather Cap", type: "helm", }, lightLeatherChest: { name: "Light Leather Tunic", type: "chest", }, lightLeatherLegs: { name: "Light Leather Greaves", type: "legs", }, lightLeatherBoots: { name: "Light Leather Boots", type: "feet", }, lightLeatherGloves: { name: "Light Leather Gloves", type: "hands", }, }, }), // snake skin ...createArmorGenerator({ baseDefense: 2, baseWeight: 1000, items: { snakeSkinHelm: { name: "Snake Skin Cap", type: "helm", }, snakeSkinChest: { name: "Snake Skin Tunic", type: "chest", }, snakeSkinLegs: { name: "Snake Skin Greaves", type: "legs", }, snakeSkinBoots: { name: "Snake Skin Boots", type: "feet", }, snakeSkinGloves: { name: "Snake Skin Gloves", type: "hands", }, }, }), ...createArmorGenerator({ baseDefense: 3, baseWeight: 2000, items: { copperMailHelm: { name: "Copper Mail Coif", type: "helm", }, copperMailChest: { name: "Copper Chain Vest", type: "chest", }, copperMailLegs: { name: "Copper Chain Leggings", type: "legs", }, copperMailBoots: { name: "Copper Chainmail Boots", type: "feet", }, copperMailGloves: { name: "Copper Chain Gloves", type: "hands", }, }, }), // mail // ...generateRings(), //#endregion end armor //#region spell stones aid_digestion: createSpellStone("aid_digestion", "Aid Digestion"), ballOfIce: createSpellStone("ballOfIce", "Ball of Ice"), chill: createSpellStone("chill", "Chill"), fireball: createSpellStone("fireball", "Fireball"), flashFreeze: createSpellStone("flashFreeze", "Flash Freeze"), iceArmor: createSpellStone("iceArmor", "Ice Armor"), icicle: createSpellStone("icicle", "Icicle"), heal: createSpellStone("heal", "Heal"), regen: createSpellStone("regen", "Regen"), //#endregion };