Skip to content

Commit

Permalink
Feat/adventurer Mart - WIP (#296)
Browse files Browse the repository at this point in the history
* #295: Contracts for starting adventurers with basic weapon

* adventure mart work

* itemmart  work with generative seed

* market work

* cli work, cleanup contracts

* work on Adventurers, readme

* readme

* chmod fix

* downgrade protostar version

* add ownership for nfts to adventurer

* cli work, minor tweaks

* feat: add upgrade stat and purchase health

- add upgrade and purchase health and parameters in adventurer dynamic data

- add functions to upgrade stat and purchase health

- add purchase param reset if adventurer explores

- NOTE: upgrade stat doesn't take into account multi-level

- begin tests

- add gui.py and begin writing gui tasks

* fix internal functions with beast, clean cli, add in world balance

* fixes, add purchase health test

* cli work

* cli work

* fixes

- fix purchase health and upgrade stat functions

- add working tests

- change to camel case

* fixes:

- change naming conventions from camelCase to snake_case (other than OZ funcs and events)

- fix `mint_with_starting_weapon`, no `adventurer_token_id` needed

— add checks for ids in `mint_starting_weapon`

- fix deploy script

— add feature in `wrapped_declare` to recognise file names for container and non-container

- changed python formatting (needs checking)

- fix adventurer tests

* readme

* fix tests for loot and beasts

- fix deployment script names

* fix metadata tests

* market fix

* cli updates

* add loot subcommand

* add starting weapon assertions

* fix market emit

* complete some todos

- overflow checks
- add adventurer level in `damage_from_beast` calc
- add adventurer owner as storage in Loot
- assert adventurer is owner in equip item

* all tests passing

- fix contract bugs
- remove unnecessary prank stops

* add beast health to ambush calc

* add randomness to gold drop

* fix test

* fix

* fixes, add gold discovery formula

* fix

* items can now increase in greatness (wip)

* fix ifs, all tests passing

* fix mint_starting bug

- add calc for health discovery
- add calc for xp discovery
- change lords deployment to non proxy

* cli work

* minor contract tweaks and cli work

* move over increase xp, all tests passing

* fix

* tweaks

* cli

* - add adventurer alive assertion in `bid_on_item`
- Begin market tests

* add market tests

* fix cli issue

* cli work

* Adds Gnome and Golem as bottom tier Beasts

* wip starting beast

* Beasts now attack different body parts

* work on starting beastS

* add .sh script for easy setup, cli work, fix beast bug where it did not unassign after killing it

* add level damage boost and critical hit boost

* add images

* fix, all tests passing

- fix beast level to be 1 in damage calc (to improve)

* add dynamic obstacle damage to armor locations

* fixed print_beast_img and reduced starter beast to 2hp

* Level adventurer up after defeating first beast

* removed hardcode variables

* fix beast

* slight bug in obstacle id

* make market fetch all available items

* added some beasts, fix market cli to print current available

* add adventurer packing utils

* obstacle_ id fix

* fix adventurer packing util

- swap warp for roll (block number over block timestamp)

* fixes

	- remove unnecessary adventurer storage var
	- fix obstacle test
	- fix getting item id from equipped slot
	- tidy damage calculations
	- switch item and adventurer discovery type (else item never discovered)
	- improve explore test cases

* fixes

	- remove unnecessary adventurer storage var
	- fix obstacle test
	- fix getting item id from equipped slot
	- tidy damage calculations
	- switch item and adventurer discovery type (else item never discovered)
	- improve explore test cases
	- change beast rand to block number
	- all tests passing
	- block number causing severe issues in protostar

* Make obstacle levels dynamic

* Adjust test_discover_obstacle for dynamic obstacles

* loot arcade bug fix

* cli work, fix gautlet bug being assigned to the foot slot

* Makes Beast HP dynamic

* change combat calculation
	- damage = (base_damage - armor_strength) * efficacy
	- improve tests
	- add test util to create adventurer with level

* fixes
	- grant mint role in deploy script
	- tweak attack print output
	- fix purchase health cli command

* fix config

* - improve potion health logs
- calculate damages in cli

* add todos, item weight

* add gui complexity

* flesh out gui WIP

* continue gui

* fix logs, continue gui work

* modify flee input to adventurer ID, continue gui

* - fix some info in cli
- gui fetch adventurers on load, only allow selecting these

* add king tibute payment
- add become_king in adventurer
- add pay_king_tribute in adventurer
- add test
- fix config
- change pyproject to python 3.9

* add gui to pyproject
- improve gui

* clean

* add king cli commands and gui functions

* add king timer reset on payout

* improvements
	- improve logging
	- fix mint daily items guy
	- add gold balance outputs to UI
	- add update gold balance functions to ones that change it

* add health to gui

* gui work
	- add loader on transactions
	- add get king contract function, cli etc..
	- add king and kings gold widgets
	- add your gold dynamic text
	- add get items on load
	- add market item dropdown
	- dynamically update adventurers list WIP

* fix your gold text color

* fix market items

* handling invoke outputs
	- add get result from invoke
	- add logs for obstacle results
	- add logs for flee result
	- add gui handlers

* continue gui
	- add more loading text
	- fix become king logic
	- update king on become king
	- add king reign time
	- add dynamic king recognition

* add equipped items display

---------

Co-authored-by: loothero <[email protected]>
Co-authored-by: starknetdev <[email protected]>
  • Loading branch information
3 people authored Mar 1, 2023
1 parent 5f092ef commit 70cb98e
Show file tree
Hide file tree
Showing 333 changed files with 7,265 additions and 1,077 deletions.
7 changes: 3 additions & 4 deletions .devcontainer/devcontainer.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// https://github.com/microsoft/vscode-dev-containers/tree/v0.202.5/containers/python-3
{
"name": "Loot",
"image": "ghcr.io/bibliothecaforadventurers/loot:latest",
"image": "ghcr.io/bibliothecadao/loot:latest",
// Set *default* container specific settings.json values on container create.
"settings": {
"python.pythonPath": "/usr/local/bin/python",
Expand Down Expand Up @@ -32,11 +32,10 @@
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",
"postCreateCommand": ". scripts/startup.sh",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "root",
"remoteEnv": {
"CAIRO_PATH": "/workspaces/realms-contracts/lib/cairo_graphs/src:/workspaces/realms-contracts/lib/cairo_contracts/src:/workspaces/realms-contracts/lib/cairo_math_64x61/contracts:/workspaces/realms-contracts/lib/guild_contracts:${containerEnv:PATH}"
},
// "postStartCommand": "bash /workspaces/realms-contracts/scripts/setup_cli_env.sh"
}
}
Empty file modified .eslintignore
100644 → 100755
Empty file.
Empty file modified .eslintrc.js
100644 → 100755
Empty file.
Empty file modified .gitattributes
100644 → 100755
Empty file.
Empty file modified .github/workflows/check-python-setup/action.yaml
100644 → 100755
Empty file.
Empty file modified .github/workflows/docker.yaml
100644 → 100755
Empty file.
Empty file modified .github/workflows/docker_test.yaml
100644 → 100755
Empty file.
Empty file modified .github/workflows/lint.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/protostar-test.yaml
100644 → 100755
Empty file.
Empty file modified .github/workflows/pytest-test.yaml
100644 → 100755
Empty file.
Empty file modified .github/workflows/static_analysis.yml
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .gitmodules
100644 → 100755
Empty file.
Empty file modified .prettierignore
100644 → 100755
Empty file.
Empty file modified .setup.js
100644 → 100755
Empty file.
Empty file modified .solhint.json
100644 → 100755
Empty file.
Empty file modified .solhintignore
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion Dockerfile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ ENV CAIRO_PATH=/loot/realms-contracts/lib/cairo_contracts/src
WORKDIR /loot/realms-contracts/
RUN pip3 install realms_cli/

RUN curl -L https://raw.githubusercontent.com/software-mansion/protostar/master/install.sh | bash
RUN curl -L https://raw.githubusercontent.com/software-mansion/protostar/master/install.sh | bash -s -- -v 0.8.1
RUN curl -L https://foundry.paradigm.xyz | bash
RUN /root/.foundry/bin/foundryup
Empty file modified LICENSE
100644 → 100755
Empty file.
18 changes: 8 additions & 10 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
</a>
</p>

![Realms x Bibliotheca header](/static/realmsxbibliotheca.jpg)

# Realmverse Contracts

## Realms is an ever-expanding on-chain permission-less gaming Lootverse built on StarkNet.

### This monorepo contains all of the Contracts (StarkNet/Cairo Ethereum/Solidity) for Bibliotheca DAO, $LORDS, and Realms.
This monorepo contains all of the Contracts (StarkNet/Cairo Ethereum/Solidity) for Bibliotheca DAO, $LORDS, and Realms.

---

# Contracts
| Directory | Title | Description |
Expand All @@ -31,20 +29,20 @@
| [/nft_marketplace](./contracts/nft_marketplace/) | NFT Marketplace | A marketplace for Realms, Dungeons, etc. built on Starknet. |
| [/lib/guild_contracts](./lib/guild_contracts/) | Guild Contracts | Contracts pulled from Guildly to allow shared player accounts. More info in [Guildly Repo](https://github.com/Guildly/contracts) |

---

# Learn more about Realms

## Follow these steps bring a 🔦
### Follow these steps bring a 🔦

## 1. Visit the [Bibliotheca DAO Site](https://bibliothecadao.xyz/) for an overview of our ecosystem
1. Visit the [Bibliotheca DAO Site](https://bibliothecadao.xyz/) for an overview of our ecosystem

## 2. The [Master Scroll](https://scroll.bibliothecadao.xyz/). This is our deep dive into everything about the game. The Master Scroll is the source of truth before this readme
2. The [Master Scroll](https://scroll.bibliothecadao.xyz/). This is our deep dive into everything about the game. The Master Scroll is the source of truth before this readme

## 3. Visit [The Atlas](https://atlas.bibliothecadao.xyz/) to see the Settling game in action
3. Visit [The Atlas](https://atlas.bibliothecadao.xyz/) to see the Settling game in action

4. Get involved at the [Realms x Bibliotheca Discord](https://discord.gg/uQnjZhZPfu)

## 4. Get involved at the [Realms x Bibliotheca Discord](https://discord.gg/uQnjZhZPfu)

---

# Development

Expand Down
Empty file modified SECURITY.md
100644 → 100755
Empty file.
Empty file modified contracts/bridge/README.md
100644 → 100755
Empty file.
Empty file modified contracts/bridge/lords_l1.sol
100644 → 100755
Empty file.
Empty file modified contracts/bridge/lords_l2.cairo
100644 → 100755
Empty file.
Empty file modified contracts/desiege/01_TowerDefence.cairo
100644 → 100755
Empty file.
Empty file modified contracts/desiege/02_TowerDefenceStorage.cairo
100644 → 100755
Empty file.
Empty file modified contracts/desiege/03_GridMovement.cairo
100644 → 100755
Empty file.
Empty file modified contracts/desiege/04_Elements.cairo
100644 → 100755
Empty file.
Empty file modified contracts/desiege/DesiegeArbiter.cairo
100644 → 100755
Empty file.
Empty file modified contracts/desiege/DesiegeModuleController.cairo
100644 → 100755
Empty file.
Empty file modified contracts/desiege/DivineEclipseElements.cairo
100644 → 100755
Empty file.
Empty file modified contracts/desiege/desiege.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified contracts/desiege/game_utils/game_structs.cairo
100644 → 100755
Empty file.
Empty file modified contracts/desiege/game_utils/grid_position.cairo
100644 → 100755
Empty file.
Empty file modified contracts/desiege/game_utils/grid_position_test.cairo
100644 → 100755
Empty file.
Empty file modified contracts/desiege/tokens/ERC1155/ERC1155_Mintable_Ownable.cairo
100644 → 100755
Empty file.
Empty file modified contracts/desiege/tokens/ERC1155/ERC1155_base.cairo
100644 → 100755
Empty file.
Empty file.
Empty file modified contracts/desiege/tokens/ERC1155/structs.cairo
100644 → 100755
Empty file.
Empty file modified contracts/desiege/utils/interfaces.cairo
100644 → 100755
Empty file.
Empty file modified contracts/exchange/Exchange_ERC20_1155.cairo
100644 → 100755
Empty file.
Empty file modified contracts/exchange/README.md
100644 → 100755
Empty file.
Empty file modified contracts/exchange/library.cairo
100644 → 100755
Empty file.
Empty file modified contracts/loot/ModuleController.cairo
100644 → 100755
Empty file.
Loading

0 comments on commit 70cb98e

Please sign in to comment.