{"id":13410198,"url":"https://github.com/BibliothecaDAO/loot-survivor","last_synced_at":"2025-03-14T15:32:11.374Z","repository":{"id":156776840,"uuid":"620603234","full_name":"BibliothecaDAO/loot-survivor","owner":"BibliothecaDAO","description":"Loot Survivor - onchain arcade ","archived":false,"fork":false,"pushed_at":"2024-08-07T23:10:11.000Z","size":305057,"stargazers_count":75,"open_issues_count":1,"forks_count":30,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-08-08T01:59:12.598Z","etag":null,"topics":["blockchain","cairo","cairo-lang","focg","onchain","web3"],"latest_commit_sha":null,"homepage":"https://survivor.realms.world","language":"Cairo","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BibliothecaDAO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-29T02:24:18.000Z","updated_at":"2024-08-07T23:10:36.000Z","dependencies_parsed_at":"2023-10-16T03:21:16.984Z","dependency_job_id":"83b3fc9a-6134-4197-9a8d-18f5ca42810b","html_url":"https://github.com/BibliothecaDAO/loot-survivor","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BibliothecaDAO%2Floot-survivor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BibliothecaDAO%2Floot-survivor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BibliothecaDAO%2Floot-survivor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BibliothecaDAO%2Floot-survivor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BibliothecaDAO","download_url":"https://codeload.github.com/BibliothecaDAO/loot-survivor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243600714,"owners_count":20317323,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","cairo","cairo-lang","focg","onchain","web3"],"created_at":"2024-07-30T20:01:05.482Z","updated_at":"2025-03-14T15:32:10.169Z","avatar_url":"https://github.com/BibliothecaDAO.png","language":"Cairo","funding_links":[],"categories":["Open-source projects","Projects"],"sub_categories":[],"readme":"\u003ca href=\"https://twitter.com/lootrealms\"\u003e\n\u003cimg src=\"https://img.shields.io/twitter/follow/lootrealms?style=social\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://twitter.com/BibliothecaDAO\"\u003e\n\u003cimg src=\"https://img.shields.io/twitter/follow/BibliothecaDAO?style=social\"/\u003e\n\u003c/a\u003e\n\n\n[![discord](https://img.shields.io/badge/join-bibliothecadao-black?logo=discord\u0026logoColor=white)](https://discord.gg/realmsworld)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n![background](.github/bg.png)\n\n\n## 🪦 Loot Survivor\n\n\u003e Go and die with glory\n\nPlay [Loot Survivor](https://goerli-survivor.realms.world/)\n\nTable of contents\n\n- [Game Design](#🕹️-game-design)\n- [Technology](#⛓️-technology)\n- [Infrastructure](#🖥️-infrastructure)\n- [Contributing](#🏗️-contributing)\n\n---\n\n## 🕹️ Game Design\n\nLoot Survivor is an onchain Arcade machine game. You add some tokens, try to get the highscore and live for eternity onchain.\n\nEach play through will be different and there is no end to the game. Every level just gets progressively harder.\n\n\u003cdetails\u003e\n\n\u003csummary\u003eGame Statistics\u003c/summary\u003e\nEach level up grants adventurers 1+ upgrade to help them survive their explorations. Although Luck cannot be upgraded directly, it can be increased by equipping jewelry items:\n\n- Strength: Boosts attack damage by 10%.\n- Vitality: Increases health by +20ph and max health.\n- Dexterity: Improves chances of successfully fleeing.\n- Wisdom: Helps evade Beast ambushes.\n- Intelligence: Aids in avoiding Obstacles.\n- Luck: Raises chances of critical damage (cannot be upgraded directly).\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eCombat Logic\u003c/summary\u003e\n\nThere are three categories of weapons and armor materials:\n\n**Weapons**: Blade, Bludgeon, Magic\n\n**Armor materials**: Cloth, Hide, Metal \n\n**Weapon vs. Armor Efficacy Chart**\n\n| Weapon Type | Metal | Hide | Cloth |\n|-------------|-------|------|-------|\n| Blade       | Weak  | Fair | Strong|\n| Bludgeon    | Fair  | Strong| Weak|\n| Magic       | Strong | Weak | Fair |\n\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWeapons and Materials\u003c/summary\u003e\n\n## Weapons\n\nThe items are based off the OG loot contract\n\n- Weapon\n- Head\n- Chest\n- Hands\n- Waist\n- Feet\n- Neck \n- Ring\n\n**Weapon Types and Ranks**\n\n| Weapon Type | Item Name     | Rank |\n|-------------|---------------|------|\n| Blade       | Katana        | 1    |\n| Blade       | Falchion      | 2    |\n| Blade       | Scimitar      | 3    |\n| Blade       | Long Sword    | 4    |\n| Blade       | Short Sword   | 5    |\n| Bludgeon    | Warhammer     | 1    |\n| Bludgeon    | Quarterstaff  | 2    |\n| Bludgeon    | Maul          | 3    |\n| Bludgeon    | Mace          | 4    |\n| Bludgeon    | Club          | 5    |\n| Magic       | Ghost Wand    | 1    |\n| Magic       | Grave Wand    | 2    |\n| Magic       | Bone Wand     | 3    |\n| Magic       | Wand          | 4    |\n| Magic       | Grimoire      | 1    |\n| Magic       | Chronicle     | 2    |\n| Magic       | Tome          | 3    |\n| Magic       | Book          | 4    |\n\n## Encounters\n\n- Beasts \n- Obstacles \n\n\u003c/details\u003e\n\n---\n\n## 🏗️ Contributing\n\nThe game is a work in progress and contributions are greatly appreciated.\n\n---\n\n## ⛓️ Technology\n\n\nLoot Survivor is an onchain game, designed to be immutable and permanently hosted on Starknet. We use advanced gas optimization to reduce costs on Starknet. A player's gamestate exists primarily in a single felt252, every action the player takes only updates a single storage slot.\n\n\n- Client: Nextjs\n- Indexer: Apibara\n- Graphql: Strawberry, AIOHTTP\n- Contracts: Cairo 1.0\n\n---\n\n## 🖥️ Infrastructure\n\n### Servers\n\n#### Goerli\n\n- Indexer: Northflank loot-survivor-indexer\n- Mongo DB: Northflank loot-survivor-mongo-goerli\n- Graph QL: Northflank loot-survivor-graphql\n\n---\n\n### Deploying\n\n#### Setup Starkli Account\n\n```bash\nbash scripts/starkli_setup.sh\n```\n\n#### Deploy Contract\n```bash\nbash scripts/deploy.sh.sh\n```\n\n#### Run UI\n\n```bash\ncd ui\nyarn dev\n```\n\n#### Deploy Katana \u0026 Run UI\n\n```bash\nbash scripts/katana/setup.sh\n```\n\n### Play\n\n#### Mint $lords and approve LS to spend\n```bash\nsource \"/workspaces/loot-survivor/.env\"\nstarkli invoke $LORDS_ADDRESS mint 0x1feb9c05d31b70a1506decf52a809d57493bfcd5cc85d6a3e9fd54a12d64389 1000000000000000000000 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY\nstarkli invoke $LORDS_ADDRESS approve $CONTRACT_ADDRESS 1000000000000000000000 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY\n```\n\n#### Start New Game\n```bash\nstarkli invoke $CONTRACT_ADDRESS new_game 0x020b96923a9e60f63a1829d440a03cf680768cadbc8fe737f71380258817d85b 12 123 0 0 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY\n```\n\n#### Explore\n```bash\nstarkli invoke $CONTRACT_ADDRESS explore $ADVENTURER_ID 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY\n```\n\n#### Attack Starter Beast\n```bash\nstarkli invoke $CONTRACT_ADDRESS attack $ADVENTURER_ID 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY\n```\n\n#### Upgrade Adventurer\n```bash\nstarkli invoke $CONTRACT_ADDRESS upgrade $ADVENTURER_ID 0 $CHARISMA 1 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY\n```\n\n\n### View Adventurer Details\n\n##### Adventurer State\n```bash\nstarkli call --watch $CONTRACT_ADDRESS get_adventurer $ADVENTURER_ID 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY\n```\n\n##### Get Adventurer Health\n```bash\nstarkli call --watch $CONTRACT_ADDRESS get_health $ADVENTURER_ID 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY\n```\n\n##### Get Adventurer Gold\n```bash\nstarkli call --watch $CONTRACT_ADDRESS get_gold $ADVENTURER_ID 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY\n```\n\n##### Get Adventurer XP\n```bash\nstarkli call --watch $CONTRACT_ADDRESS get_xp $ADVENTURER_ID 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY\n```\n\n##### Get number of stat upgrades available\n```bash\nstarkli call --watch $CONTRACT_ADDRESS get_stat_upgrades_available $ADVENTURER_ID 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBibliothecaDAO%2Floot-survivor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBibliothecaDAO%2Floot-survivor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBibliothecaDAO%2Floot-survivor/lists"}