proc-gen equipment drops from monsters can be picked up master
authorxangelo <git@xangelo.ca>
Mon, 28 Mar 2022 04:16:50 +0000 (00:16 -0400)
committerxangelo <git@xangelo.ca>
Mon, 28 Mar 2022 04:16:50 +0000 (00:16 -0400)
commitb5d3cc37fddebff8dcdf1ef0cdd3a626811f14d3
tree5d3b7588b86161bdbe7040651229ae6f0370cf7c
parent20dc560a75cfd6ddc8a66956315a30001779ec24
proc-gen equipment drops from monsters can be picked up

This is a large update that deals with procedurally generated equipment
that monsters can drop when they're killed.

1. Procedurally Generated Equipment
All equipment is added with a "base" type. An "Old Shirt" for example.
This has some rarity-based weights to decide the probability of dropping
a Common/Uncommon/Rare version of this item. It also defines a set of
stats that can be manipulated by this equipment as well as a list of
stats that this equipment MUST modify.

The stats that can be modified are done so via min/max values to allow
for some randomness in drops.

There is also the base durability of an item.

Everything is modified by the rarity at set rates.

All euipment is tagged with the type of equipment and the place that
equipment can be equipped (Left Arm, Torso, Head, etc.).

2. Monsters are assigned a base-item that can be generated. When they
die, we generated a rough item that is placed in the "World Drops" that
references the base item. A player can choose to pick or leave the item.
Once picked up the item is then generated based on the proc-gen rules
and placed in their inventory.
22 files changed:
prisma/migrations/20220317054135_create_item_config/migration.sql [new file with mode: 0644]
prisma/migrations/20220317054315_add_more_types/migration.sql [new file with mode: 0644]
prisma/migrations/20220317054755_add_dual_wield_type/migration.sql [new file with mode: 0644]
prisma/migrations/20220317154129_rework_items/migration.sql [new file with mode: 0644]
prisma/migrations/20220317154640_default_item_droprate_10/migration.sql [new file with mode: 0644]
prisma/migrations/20220318060910_id_on_monster_biome/migration.sql [new file with mode: 0644]
prisma/migrations/20220325174002_add_worldrops/migration.sql [new file with mode: 0644]
prisma/schema.prisma
prisma/seed.ts
prisma/seed/equipment.ts [new file with mode: 0644]
prisma/seed/monsters.ts [new file with mode: 0644]
src/lib/weighted.ts [new file with mode: 0644]
src/public/app/api.ts
src/public/app/dom.ts
src/public/app/game.ts
src/public/app/sections/overview.ts
src/public/bundle.js
src/public/index.html
src/routes/fight/fight.ts
src/routes/index.ts
src/routes/inventory/index.ts [new file with mode: 0644]
src/routes/inventory/pick.ts [new file with mode: 0644]