Implement an updated load_options function
This commit is contained in:
parent
838d34cc4d
commit
3df7efd33f
@ -2,5 +2,5 @@
|
||||
## VER: Alpha #8
|
||||
|
||||
## What's new?
|
||||
- Added an update to the UserBase model to add weapons, pickaxes, and upgrades to the users inventory
|
||||
- Updated the UserModel class to remove the ability to have weapons, upgrades, & pickaxes.
|
||||
- Started work on the load_options functions that will allow the user to choose specific options for the game
|
||||
|
@ -1,6 +1,5 @@
|
||||
# Imports
|
||||
from typing import Annotated
|
||||
from typing import List
|
||||
from fastapi import Depends
|
||||
from sqlmodel import Field, Session, SQLModel, create_engine
|
||||
from pydantic import BaseModel
|
||||
@ -10,9 +9,6 @@ class HeroBase(SQLModel):
|
||||
name: str
|
||||
gold: int | None = Field(default=0)
|
||||
health: int | None = Field(default=100)
|
||||
weapons: List[str] | None = Field(default=["basic_sword"])
|
||||
pickaxe: List[str] | None = Field(default=["basic_pickaxe"])
|
||||
upgrades: List[str] | None = Field(default=[])
|
||||
|
||||
# The main hero class. It inherits the name, gold, and health
|
||||
class Hero(HeroBase, table=True):
|
||||
|
@ -18,7 +18,7 @@ def create_account(name: str, email: str, password: str) -> Any | None:
|
||||
else:
|
||||
return False
|
||||
|
||||
def login(email, password):
|
||||
def login(email: str, password: str):
|
||||
data = {
|
||||
"email": email,
|
||||
"password": password
|
||||
@ -35,8 +35,11 @@ def login(email, password):
|
||||
def load_options() -> int:
|
||||
print("""
|
||||
Here are the available options:
|
||||
* To select an option just enter its number *
|
||||
1. Home - View the inventory
|
||||
* To select an option, just enter its number *
|
||||
1. Home - View the inventory, Save Progress, or View gold and health, Quit
|
||||
2. Cave - Mine for gold
|
||||
3. Shop - Buy weapons, pickaxes, or upgrades
|
||||
4. Arena - Fight monsters for more gold.
|
||||
""")
|
||||
|
||||
option = int(input(""))
|
||||
|
Loading…
Reference in New Issue
Block a user