programming-game
Version:
The client for programming game, an mmorpg that you interact with entirely through code.
1,645 lines (1,619 loc) • 36.2 kB
text/typescript
import type { UnitStats } from "./unit-stats";
import { type Spells, spellMap } 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 =
// 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"
// logs
| "pinewoodBits"
| "pinewoodLog" // tier 1
| "oakBits"
| "oakLog"
// wood
| "arrowShaft" // deprecated
| "bitOfWood"
| "woodLog"
| "woodPommel"
| "pinewoodArrowShaft"
| "pinewoodPommel" // Sword/dagger pommel
| "pinewoodAxeHandle"
// ore chunks
| "chunkOfCopper"
| "copperOre"
| "tinOre"
// ingots
| "copperIngot"
| "tinIngot"
| "bronzeIngot"
// 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 | OffhandEquipment | Accessories | Armors;
type Accessories = Amulets | Rings;
type Armors = Helms | Chests | Legs | Boots | Gloves;
const baseAttacksPerSecond: Record<WeaponType, number> = {
dagger: 1.6,
oneHandedAxe: 1.2,
oneHandedMace: 1.1,
oneHandedSword: 1.4,
bow: 0.7,
staff: 0.8,
crossbow: 0.5,
twoHandedAxe: 0.9,
twoHandedMace: 0.8,
twoHandedSword: 1,
fellingAxe: 0.9,
pickaxe: 0.9,
};
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"
| "copperFellingAxe"
| "stonePickaxe"
| "copperPickaxe";
//#endregion weapons
//#region offhand weapons
export type OffhandEquipment =
/**
* 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
| OffhandEquipmentType
| "ammo";
export type WeaponType =
// 1 handers
| "dagger"
| "oneHandedAxe"
| "oneHandedMace"
| "oneHandedSword"
// 2 handers
| "bow"
| "staff"
| "crossbow"
| "twoHandedAxe"
| "twoHandedMace"
| "twoHandedSword"
| "fellingAxe"
| "pickaxe";
// off hands
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";
const generateArmor = (
id: Armors,
name: string,
type: ArmorType,
defense: number,
tier: number
): ArmorDefinition => {
const cost = tier * 2000;
return {
id,
name,
type,
weight: 1000,
buyFromVendorPrice: cost,
sellToVendorPrice: Math.floor(cost / 10) || 1,
stats: {
defense,
},
};
};
const createCraftingIngredient = (
id: Trash,
name: string,
weight: number,
buyPrice: number,
deprecated = false
): ItemDefinition => {
const def: ItemDefinition = {
id,
name,
weight,
type: "trash",
buyFromVendorPrice: buyPrice,
sellToVendorPrice: Math.floor(buyPrice * 0.1) || 1,
};
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>;
tier: number;
}) => {
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,
opts.tier
);
return acc;
},
{} as {
[key in T]: ArmorDefinition;
}
);
};
const calcSellPrice = (buyPrice: number) => {
return Math.floor(buyPrice * 0.1) || 1;
};
const createSpellStone = <T extends Spells>(
spell: T,
name: string,
cost: number
): ItemDefinition => {
return {
id: spell as T,
type: "trash" as const,
name: `${name} Spell Stone`,
weight: 5_000,
buyFromVendorPrice: cost,
sellToVendorPrice: calcSellPrice(cost),
};
};
const glassVial = createCraftingIngredient("glassVial", "Glass Vial", 100, 100);
const eyeJelly = createCraftingIngredient("eyeJelly", "Eye Jelly", 0.25, 100);
const pinewoodArrowShaftWeight = 35;
const featherWeight = 0.1;
const stoneArrowHeadWeight = 7;
/**
* @deprecated
* You should use the heartbeat.items value instead as it will always contain the latest item definitions.
*/
export const items: Record<Items, ItemDefinition> = {
//#region crafting
arrowShaft: createCraftingIngredient(
"arrowShaft",
"Arrow Shaft",
300,
3,
true
),
feather: createCraftingIngredient("feather", "Feather", featherWeight, 2),
snakeFangs: createCraftingIngredient("snakeFangs", "Snake Fangs", 7, 10),
woodLog: createCraftingIngredient("woodLog", "Wood Log", 5000, 18, true),
bitOfWood: createCraftingIngredient("bitOfWood", "Bit of Wood", 500, 2, true),
stoneArrowHead: createCraftingIngredient(
"stoneArrowHead",
"Stone Arrow Head",
stoneArrowHeadWeight,
3
),
pinewoodLog: createCraftingIngredient(
"pinewoodLog",
"Pinewood Log",
5_000,
18
),
pinewoodBits: createCraftingIngredient(
"pinewoodBits",
"Pinewood Bits",
500,
2
),
oakLog: createCraftingIngredient("oakLog", "Oak Log", 5_000, 18),
oakBits: createCraftingIngredient("oakBits", "Oak Bits", 500, 2),
pinewoodArrowShaft: createCraftingIngredient(
"pinewoodArrowShaft",
"Pinewood Arrow Shaft",
pinewoodArrowShaftWeight,
3
),
ratPelt: createCraftingIngredient("ratPelt", "Rat Pelt", 100, 100),
copperNeedle: createCraftingIngredient(
"copperNeedle",
"Copper Needle",
0.5,
500
),
coarseThread: createCraftingIngredient(
"coarseThread",
"Coarse Thread",
0.5,
100
),
eyeJelly,
snakeSkinLeather: createCraftingIngredient(
"snakeSkinLeather",
"Snakeskin Leather",
1000,
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: 500,
sellToVendorPrice: 50,
weight: 0.1,
type: "usable",
},
digesta: createCraftingIngredient("digesta", "Digesta", 100, 100),
leatherStrips: createCraftingIngredient(
"leatherStrips",
"Leather Strips",
100,
100
),
lightLeather: createCraftingIngredient(
"lightLeather",
"Light Leather",
1000,
1000
),
// cloths
// tier 1
tatteredCottonCloth: createCraftingIngredient(
"tatteredCottonCloth",
"Tattered Cotton Cloth",
100,
100
),
cottonCloth: createCraftingIngredient(
"cottonCloth",
"Cotton Cloth",
1000,
1000
),
boltOfCottonCloth: createCraftingIngredient(
"boltOfCottonCloth",
"Bolt of Cotton Cloth",
10_000,
3_000
),
tatteredLinenCloth: createCraftingIngredient(
"tatteredLinenCloth",
"Tattered Linen Cloth",
100,
300
),
linenCloth: createCraftingIngredient("linenCloth", "Linen Cloth", 1000, 1000),
boltOfLinenCloth: createCraftingIngredient(
"boltOfLinenCloth",
"Bolt of Linen Cloth",
10_000,
3_000
),
tatteredWoolCloth: createCraftingIngredient(
"tatteredWoolCloth",
"Tattered Wool Cloth",
100,
200
),
woolCloth: createCraftingIngredient("woolCloth", "Wool Cloth", 1000, 2_000),
boltOfWoolCloth: createCraftingIngredient(
"boltOfWoolCloth",
"Bolt of Wool Cloth",
10_000,
3_000
),
snakeSkin: {
id: "snakeSkin",
name: "Snake Skin",
type: "trash",
weight: 100,
buyFromVendorPrice: 10,
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: 100,
},
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_000,
sellToVendorPrice: 100,
},
copperIngot: {
id: "copperIngot",
name: "Copper Ingot",
type: "trash",
weight: 3_000,
buyFromVendorPrice: 3_000,
sellToVendorPrice: 300,
},
tinIngot: {
id: "tinIngot",
name: "Tin Ingot",
type: "trash",
weight: 3_000,
buyFromVendorPrice: 3_000,
sellToVendorPrice: 300,
},
bronzeIngot: {
id: "bronzeIngot",
name: "Bronze 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,
},
copperOre: {
id: "copperOre",
name: "Copper Ore",
type: "trash",
weight: 1_000,
buyFromVendorPrice: 1_000,
sellToVendorPrice: 100,
},
tinOre: {
id: "tinOre",
name: "Tin Ore",
type: "trash",
weight: 1_000,
buyFromVendorPrice: 1_000,
sellToVendorPrice: 100,
},
woodPommel: {
id: "woodPommel",
name: "Wood Pommel",
type: "trash",
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
deprecated: true,
},
pinewoodPommel: {
id: "pinewoodPommel",
name: "Pinewood Pommel",
type: "trash",
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
},
pinewoodAxeHandle: {
id: "pinewoodAxeHandle",
name: "Pinewood Axe Handle",
type: "trash",
weight: 2_000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
},
//#endregion crafting
//#region consumables
ratMeat: {
id: "ratMeat",
name: "Rat Meat",
type: "food",
weight: 400,
buyFromVendorPrice: 10,
sellToVendorPrice: 1,
calories: 200,
},
snakeMeat: {
id: "snakeMeat",
name: "Snake Meat",
type: "food",
weight: 1000,
calories: 500,
buyFromVendorPrice: 10,
sellToVendorPrice: 1,
},
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: 10,
sellToVendorPrice: 1,
},
//#endregion consumables
//#region ammo
woodenArrow: {
id: "woodenArrow",
type: "ammo",
ammoType: "arrow",
name: "Wooden Arrow",
weight: 1,
buyFromVendorPrice: 10,
sellToVendorPrice: 1,
damage: 1,
stats: {
attack: 1,
},
deprecated: true,
} satisfies AmmoDefinition,
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: 10,
sellToVendorPrice: 1,
damage: 1,
stats: {
attack: 1,
},
} satisfies AmmoDefinition,
woodenBolt: {
id: "woodenBolt",
type: "ammo",
ammoType: "bolt",
name: "Wooden Bolt",
weight: 1,
buyFromVendorPrice: 10,
sellToVendorPrice: 1,
damage: 1,
stats: {
attack: 1,
},
deprecated: true,
} satisfies AmmoDefinition,
//#endregion ammo
//#region random
snakeVenom: {
id: "snakeVenom",
name: "Snake Venom",
type: "trash",
weight: 10,
buyFromVendorPrice: 10,
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,
damage: 1,
stats: {},
spellCount: 1,
deprecated: true,
attacksPerSecond: baseAttacksPerSecond["staff"],
},
copperStaff: {
id: "copperStaff",
name: "Copper Staff",
type: "staff",
attacksPerSecond: baseAttacksPerSecond["staff"],
weight: 1000,
buyFromVendorPrice: 200,
sellToVendorPrice: 20,
damage: 2,
stats: {},
spellCount: 1,
deprecated: true,
},
ironStaff: {
id: "ironStaff",
name: "Iron Staff",
type: "staff",
attacksPerSecond: baseAttacksPerSecond["staff"],
weight: 1000,
buyFromVendorPrice: 300,
sellToVendorPrice: 30,
damage: 3,
stats: {},
spellCount: 1,
deprecated: true,
},
steelStaff: {
id: "steelStaff",
name: "Steel Staff",
type: "staff",
attacksPerSecond: baseAttacksPerSecond["staff"],
weight: 1000,
buyFromVendorPrice: 400,
sellToVendorPrice: 40,
damage: 4,
stats: {},
spellCount: 1,
deprecated: true,
} satisfies WeaponDefinition,
goldStaff: {
id: "goldStaff",
name: "Gold Staff",
type: "staff",
attacksPerSecond: baseAttacksPerSecond["staff"],
weight: 1000,
buyFromVendorPrice: 500,
sellToVendorPrice: 50,
damage: 5,
stats: {},
spellCount: 1,
deprecated: true,
} satisfies WeaponDefinition,
platinumStaff: {
id: "platinumStaff",
name: "Platinum Staff",
type: "staff",
attacksPerSecond: baseAttacksPerSecond["staff"],
weight: 1000,
buyFromVendorPrice: 600,
sellToVendorPrice: 60,
damage: 6,
stats: {},
spellCount: 1,
deprecated: true,
} satisfies WeaponDefinition,
//#endregion staffs
//#region wooden
woodenDagger: {
id: "woodenDagger",
name: "Wooden Dagger",
type: "dagger",
attacksPerSecond: baseAttacksPerSecond["dagger"],
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
damage: 1,
stats: {},
spellCount: 0,
deprecated: true,
},
woodenSword: {
id: "woodenSword",
name: "Wooden Sword",
type: "oneHandedSword",
attacksPerSecond: baseAttacksPerSecond["oneHandedSword"],
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
damage: 2,
stats: {},
spellCount: 0,
deprecated: true,
} satisfies WeaponDefinition,
pinewoodSword: {
id: "pinewoodSword",
name: "Pinewood Sword",
type: "oneHandedSword",
attacksPerSecond: baseAttacksPerSecond["oneHandedSword"],
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
damage: 1,
stats: {},
spellCount: 0,
} satisfies WeaponDefinition,
//#endregion wooden
//#region stone weapons
stoneFellingAxe: {
id: "stoneFellingAxe",
name: "Stone Felling Axe",
type: "fellingAxe",
attacksPerSecond: baseAttacksPerSecond["fellingAxe"],
weight: 2_000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
damage: 2.5,
stats: {},
spellCount: 0,
} satisfies WeaponDefinition,
copperFellingAxe: {
id: "copperFellingAxe",
name: "Copper Felling Axe",
type: "fellingAxe",
attacksPerSecond: baseAttacksPerSecond["fellingAxe"],
weight: 2_000,
buyFromVendorPrice: 3_000,
sellToVendorPrice: 300,
damage: 3.5,
stats: {},
spellCount: 0,
} satisfies WeaponDefinition,
stonePickaxe: {
id: "stonePickaxe",
name: "Stone Pickaxe",
type: "pickaxe",
attacksPerSecond: baseAttacksPerSecond["pickaxe"],
weight: 2_000,
buyFromVendorPrice: 1_000,
sellToVendorPrice: 100,
damage: 2.5,
stats: {},
spellCount: 0,
} satisfies WeaponDefinition,
copperPickaxe: {
id: "copperPickaxe",
name: "Copper Pickaxe",
type: "pickaxe",
attacksPerSecond: baseAttacksPerSecond["pickaxe"],
weight: 2_000,
buyFromVendorPrice: 3_000,
sellToVendorPrice: 300,
damage: 3.5,
stats: {},
spellCount: 0,
} satisfies WeaponDefinition,
//#endregion stone weapons
/**
* copper weapons
*/
copperDagger: {
id: "copperDagger",
name: "Copper Dagger",
type: "dagger",
attacksPerSecond: baseAttacksPerSecond["dagger"],
weight: 500,
buyFromVendorPrice: 2_500,
sellToVendorPrice: 250,
damage: 2,
stats: {},
spellCount: 0,
} satisfies WeaponDefinition,
copperSword: {
id: "copperSword",
name: "Copper Sword",
type: "oneHandedSword",
attacksPerSecond: baseAttacksPerSecond["oneHandedSword"],
weight: 1000,
buyFromVendorPrice: 3_000,
sellToVendorPrice: 300,
damage: 3,
stats: {},
spellCount: 0,
} satisfies WeaponDefinition,
copperGreatSword: {
id: "copperGreatSword",
name: "Copper Greatsword",
type: "twoHandedSword",
attacksPerSecond: baseAttacksPerSecond["twoHandedSword"],
weight: 2000,
buyFromVendorPrice: 5_000,
sellToVendorPrice: 500,
damage: 5,
stats: {},
spellCount: 0,
} satisfies WeaponDefinition,
/**
* iron weapons
*/
ironDagger: {
id: "ironDagger",
name: "Iron Dagger",
type: "dagger",
attacksPerSecond: baseAttacksPerSecond["dagger"],
weight: 1000,
buyFromVendorPrice: 300,
sellToVendorPrice: 30,
damage: 3,
stats: {},
spellCount: 0,
} satisfies WeaponDefinition,
ironSword: {
id: "ironSword",
name: "Iron Sword",
type: "oneHandedSword",
attacksPerSecond: baseAttacksPerSecond["oneHandedSword"],
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
damage: 4,
stats: {},
spellCount: 0,
} satisfies WeaponDefinition,
/**
* steel weapons
*/
steelDagger: {
id: "steelDagger",
name: "Steel Dagger",
type: "dagger",
attacksPerSecond: baseAttacksPerSecond["dagger"],
weight: 1000,
buyFromVendorPrice: 300,
sellToVendorPrice: 30,
damage: 4,
stats: {},
spellCount: 0,
} satisfies WeaponDefinition,
steelSword: {
id: "steelSword",
name: "Steel Sword",
type: "oneHandedSword",
attacksPerSecond: baseAttacksPerSecond["oneHandedSword"],
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
damage: 5,
stats: {},
spellCount: 0,
} satisfies WeaponDefinition,
/**
* gold weapons
*/
goldDagger: {
id: "goldDagger",
name: "Gold Dagger",
type: "dagger",
attacksPerSecond: baseAttacksPerSecond["dagger"],
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
damage: 5,
stats: {},
spellCount: 0,
} satisfies WeaponDefinition,
goldSword: {
id: "goldSword",
name: "Gold Sword",
type: "oneHandedSword",
attacksPerSecond: baseAttacksPerSecond["oneHandedSword"],
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
damage: 6,
stats: {},
spellCount: 0,
} satisfies WeaponDefinition,
/**
* platinum weapons
*/
platinumDagger: {
id: "platinumDagger",
name: "Platinum Dagger",
type: "dagger",
attacksPerSecond: baseAttacksPerSecond["dagger"],
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
damage: 6,
stats: {},
spellCount: 0,
deprecated: true,
} satisfies WeaponDefinition,
platinumSword: {
id: "platinumSword",
name: "Platinum Sword",
type: "oneHandedSword",
attacksPerSecond: baseAttacksPerSecond["oneHandedSword"],
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
damage: 7,
stats: {},
spellCount: 0,
deprecated: true,
} satisfies WeaponDefinition,
/**
* Shields
*/
woodenShield: {
id: "woodenShield",
name: "Wooden Shield",
type: "shield",
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
stats: {
defense: 1,
},
spellCount: 0,
deprecated: true,
},
pinewoodShield: {
id: "pinewoodShield",
name: "Pinewood Shield",
type: "shield",
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
stats: {
defense: 1,
},
spellCount: 0,
},
copperShield: {
id: "copperShield",
name: "Copper Shield",
type: "shield",
weight: 1000,
buyFromVendorPrice: 4_000,
sellToVendorPrice: 400,
stats: {
defense: 2,
},
spellCount: 0,
},
ironShield: {
id: "ironShield",
name: "Iron Shield",
type: "shield",
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
stats: {
defense: 3,
},
spellCount: 0,
},
steelShield: {
id: "steelShield",
name: "Steel Shield",
type: "shield",
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
stats: {
defense: 4,
},
spellCount: 0,
},
goldShield: {
id: "goldShield",
name: "Gold Shield",
type: "shield",
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
stats: {
defense: 5,
},
spellCount: 0,
},
platinumShield: {
id: "platinumShield",
name: "Platinum Shield",
type: "shield",
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
stats: {
defense: 6,
},
spellCount: 0,
deprecated: true,
},
/**
* Bows
*/
woodenBow: {
id: "woodenBow",
name: "Wooden Bow",
type: "bow",
attacksPerSecond: baseAttacksPerSecond["bow"],
weight: 1000,
buyFromVendorPrice: 3_000,
sellToVendorPrice: 300,
damage: 0,
stats: {},
deprecated: true,
spellCount: 0,
} satisfies WeaponDefinition,
pinewoodBow: {
id: "pinewoodBow",
name: "Pinewood Bow",
type: "bow",
attacksPerSecond: baseAttacksPerSecond["bow"],
weight: 1000,
buyFromVendorPrice: 3_000,
sellToVendorPrice: 300,
damage: 0,
stats: {},
spellCount: 0,
} satisfies WeaponDefinition,
copperBow: {
id: "copperBow",
name: "Copper Bow",
type: "bow",
attacksPerSecond: baseAttacksPerSecond["bow"],
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
damage: 1,
stats: {},
deprecated: true,
spellCount: 0,
} satisfies WeaponDefinition,
ironBow: {
id: "ironBow",
name: "Iron Bow",
type: "bow",
attacksPerSecond: baseAttacksPerSecond["bow"],
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
damage: 2,
stats: {},
deprecated: true,
spellCount: 0,
} satisfies WeaponDefinition,
steelBow: {
id: "steelBow",
name: "Steel Bow",
type: "bow",
attacksPerSecond: baseAttacksPerSecond["bow"],
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
damage: 3,
stats: {},
deprecated: true,
spellCount: 0,
} satisfies WeaponDefinition,
goldBow: {
id: "goldBow",
name: "Gold Bow",
type: "bow",
attacksPerSecond: baseAttacksPerSecond["bow"],
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
damage: 4,
stats: {},
deprecated: true,
spellCount: 0,
} satisfies WeaponDefinition,
platinumBow: {
id: "platinumBow",
name: "Platinum Bow",
type: "bow",
attacksPerSecond: baseAttacksPerSecond["bow"],
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
damage: 5,
stats: {},
deprecated: true,
spellCount: 0,
} satisfies WeaponDefinition,
/**
* crossbows
*/
woodenCrossbow: {
id: "woodenCrossbow",
name: "Wooden Crossbow",
type: "crossbow",
attacksPerSecond: baseAttacksPerSecond["crossbow"],
weight: 1000,
buyFromVendorPrice: 200,
sellToVendorPrice: 20,
damage: 0,
stats: {},
deprecated: true,
spellCount: 0,
} satisfies WeaponDefinition,
pinewoodCrossbow: {
id: "pinewoodCrossbow",
name: "Pinewood Crossbow",
type: "crossbow",
attacksPerSecond: baseAttacksPerSecond["crossbow"],
weight: 1000,
buyFromVendorPrice: 200,
sellToVendorPrice: 20,
damage: 0,
stats: {},
deprecated: true,
spellCount: 0,
} satisfies WeaponDefinition,
copperCrossbow: {
id: "copperCrossbow",
name: "Copper Crossbow",
type: "crossbow",
attacksPerSecond: baseAttacksPerSecond["crossbow"],
weight: 1000,
buyFromVendorPrice: 200,
sellToVendorPrice: 20,
damage: 1,
stats: {},
deprecated: true,
spellCount: 0,
} satisfies WeaponDefinition,
ironCrossbow: {
id: "ironCrossbow",
name: "Iron Crossbow",
type: "crossbow",
attacksPerSecond: baseAttacksPerSecond["crossbow"],
weight: 1000,
buyFromVendorPrice: 200,
sellToVendorPrice: 20,
damage: 2,
stats: {},
deprecated: true,
spellCount: 0,
} satisfies WeaponDefinition,
steelCrossbow: {
id: "steelCrossbow",
name: "Steel Crossbow",
type: "crossbow",
attacksPerSecond: baseAttacksPerSecond["crossbow"],
weight: 1000,
buyFromVendorPrice: 200,
sellToVendorPrice: 20,
damage: 3,
stats: {},
deprecated: true,
spellCount: 0,
} satisfies WeaponDefinition,
goldCrossbow: {
id: "goldCrossbow",
name: "Gold Crossbow",
type: "crossbow",
attacksPerSecond: baseAttacksPerSecond["crossbow"],
weight: 1000,
buyFromVendorPrice: 200,
sellToVendorPrice: 20,
damage: 4,
stats: {},
deprecated: true,
spellCount: 0,
} satisfies WeaponDefinition,
platinumCrossbow: {
id: "platinumCrossbow",
name: "Platinum Crossbow",
type: "crossbow",
attacksPerSecond: baseAttacksPerSecond["crossbow"],
weight: 1000,
buyFromVendorPrice: 200,
sellToVendorPrice: 20,
damage: 5,
stats: {},
deprecated: true,
spellCount: 0,
} satisfies WeaponDefinition,
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: {},
spellCount: 3,
} satisfies GrimmoireDefinition,
adeptsGrimmoire: {
id: "adeptsGrimmoire",
name: "Adept's Grimmoire",
type: "grimmoire",
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
stats: {},
spells: {},
spellCount: 6,
} satisfies GrimmoireDefinition,
mastersGrimmoire: {
id: "mastersGrimmoire",
name: "Master's Grimmoire",
type: "grimmoire",
weight: 1000,
buyFromVendorPrice: 100,
sellToVendorPrice: 10,
stats: {},
spells: {},
spellCount: 9,
} satisfies GrimmoireDefinition,
cheatersGrimmoire: {
id: "cheatersGrimmoire",
name: "Cheater's Grimmoire",
type: "grimmoire",
weight: 1000,
buyFromVendorPrice: 10,
sellToVendorPrice: 1,
stats: {},
spells: Object.keys(spellMap).reduce((acc, spell) => {
acc[spell as Spells] = true;
return acc;
}, {} as Record<Spells, true>),
deprecated: true,
spellCount: 100,
} 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: 10,
sellToVendorPrice: 1,
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",
},
},
tier: 1,
}),
// 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",
},
},
tier: 1,
}),
// 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",
},
},
tier: 1,
}),
...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",
},
},
tier: 1,
}),
// mail
// ...generateRings(),
//#endregion end armor
//#region spell stones
// tier 1
aid_digestion: createSpellStone("aid_digestion", "Aid Digestion", 2_000),
regen: createSpellStone("regen", "Regen", 2_000),
heal: createSpellStone("heal", "Heal", 4_000),
fireball: createSpellStone("fireball", "Fireball", 7_000),
// > tier 1
ballOfIce: createSpellStone("ballOfIce", "Ball of Ice", 8_000),
chill: createSpellStone("chill", "Chill", 7_000),
flashFreeze: createSpellStone("flashFreeze", "Flash Freeze", 12_000),
iceArmor: createSpellStone("iceArmor", "Ice Armor", 8_000),
icicle: createSpellStone("icicle", "Icicle", 6_000),
//#endregion
};