BibliothecaDAO / realms-contracts

Realms Monorepo for Ethereum contracts and Starknet contracts.
https://bibliothecadao.xyz/
MIT License
87 stars 33 forks source link

Loot Survivor | Grant items XP when taking damage from obstacles #312

Closed loothero closed 1 year ago

loothero commented 1 year ago

When an adventurer suffers damage from an obstacle, their items should receive XP. Note in #311 the adventurer receives XP regardless of whether they sustain damage but the items only receive XP if they are utilized.

Currently our primary logic for allocating XP to items is an internal function _allocate_xp_to_items function is in Beast.cairo. As such, implementing this functionality will require a little extra work:

  1. Move the core logic in _allocate_xp_to_items to an external function in LootMarketArcade that can only be called by approved modules
  2. Existing _allocate_xp_to_items in Beast.cairo will call ILoot.allocate_xp_to_items -> LootMarketArcade
  3. In Adventurer.cairo when adventurer takes damage from the obstacle, we can assign xp to items via ILoot.allocate_xp_to_items too
starknetdev commented 1 year ago

This has been added in https://github.com/BibliothecaDAO/realms-contracts/pull/303/commits/705b246353cd7d242c51d16e1c8274ba145303f0 so closing