Giter Site home page Giter Site logo

bengineer42 / loot-survivor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bibliothecadao/loot-survivor

0.0 0.0 0.0 297.06 MB

Loot Survivor - onchain arcade

Home Page: https://survivor.realms.world

License: MIT License

Shell 0.40% JavaScript 0.23% Python 3.45% TypeScript 41.74% CSS 0.31% Dockerfile 0.07% Cairo 53.80%

loot-survivor's Introduction

discord License: MIT

background

đŸĒĻ Loot Survivor

Go and die with glory

Play Loot Survivor

Table of contents


🕹ī¸ Game Design

Loot Survivor is an onchain Arcade machine game. You add some tokens, try to get the highscore and live for eternity onchain.

Each play through will be different and there is no end to the game. Every level just gets progressively harder.

Game Statistics Each 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:
  • Strength: Boosts attack damage by 10%.
  • Vitality: Increases health by +20ph and max health.
  • Dexterity: Improves chances of successfully fleeing.
  • Wisdom: Helps evade Beast ambushes.
  • Intelligence: Aids in avoiding Obstacles.
  • Luck: Raises chances of critical damage (cannot be upgraded directly).
Combat Logic

There are three categories of weapons and armor materials:

Weapons: Blade, Bludgeon, Magic

Armor materials: Cloth, Hide, Metal

Weapon vs. Armor Efficacy Chart

Weapon Type Metal Hide Cloth
Blade Weak Fair Strong
Bludgeon Fair Strong Weak
Magic Strong Weak Fair
Weapons and Materials

Weapons

The items are based off the OG loot contract

  • Weapon
  • Head
  • Chest
  • Hands
  • Waist
  • Feet
  • Neck
  • Ring

Weapon Types and Ranks

Weapon Type Item Name Rank
Blade Katana 1
Blade Falchion 2
Blade Scimitar 3
Blade Long Sword 4
Blade Short Sword 5
Bludgeon Warhammer 1
Bludgeon Quarterstaff 2
Bludgeon Maul 3
Bludgeon Mace 4
Bludgeon Club 5
Magic Ghost Wand 1
Magic Grave Wand 2
Magic Bone Wand 3
Magic Wand 4
Magic Grimoire 1
Magic Chronicle 2
Magic Tome 3
Magic Book 4

Encounters

  • Beasts
  • Obstacles

🏗ī¸ Contributing

The game is a work in progress and contributions are greatly appreciated.


⛓ī¸ Technology

Loot 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.

  • Client: Nextjs
  • Indexer: Apibara
  • Graphql: Strawberry, AIOHTTP
  • Contracts: Cairo 1.0

đŸ–Ĩī¸ Infrastructure

Servers

Goerli

  • Indexer: Northflank loot-survivor-indexer
  • Mongo DB: Northflank loot-survivor-mongo-goerli
  • Graph QL: Northflank loot-survivor-graphql

Deploying

Setup Starkli Account

bash scripts/starkli_setup.sh

Deploy Contract

bash scripts/deploy.sh.sh

Play

Mint $lords and approve LS to spend

source "/workspaces/loot-survivor/.env"
starkli invoke $LORDS_ADDRESS mint 0x1feb9c05d31b70a1506decf52a809d57493bfcd5cc85d6a3e9fd54a12d64389 1000000000000000000000 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY
starkli invoke $LORDS_ADDRESS approve $CONTRACT_ADDRESS 1000000000000000000000 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY

Start New Game

starkli invoke $CONTRACT_ADDRESS new_game 0x020b96923a9e60f63a1829d440a03cf680768cadbc8fe737f71380258817d85b 12 123 0 0 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY

Explore

starkli invoke $CONTRACT_ADDRESS explore $ADVENTURER_ID 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY

Attack Starter Beast

starkli invoke $CONTRACT_ADDRESS attack $ADVENTURER_ID 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY

Upgrade Adventurer

starkli invoke $CONTRACT_ADDRESS upgrade $ADVENTURER_ID 0 $CHARISMA 1 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY

View Adventurer Details

Adventurer State
starkli call --watch $CONTRACT_ADDRESS get_adventurer $ADVENTURER_ID 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY
Get Adventurer Health
starkli call --watch $CONTRACT_ADDRESS get_health $ADVENTURER_ID 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY
Get Adventurer Gold
starkli call --watch $CONTRACT_ADDRESS get_gold $ADVENTURER_ID 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY
Get Adventurer XP
starkli call --watch $CONTRACT_ADDRESS get_xp $ADVENTURER_ID 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY
Get number of stat upgrades available
starkli call --watch $CONTRACT_ADDRESS get_stat_upgrades_available $ADVENTURER_ID 0 --account $STARKNET_ACCOUNT --private-key $PRIVATE_KEY

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.