0% found this document useful (0 votes)
17 views2 pages

Import Random

Echoes of Arkaea is a text-based RPG featuring character and enemy classes with health, attack, defense, and magic attributes. Players embark on quests, such as retrieving the Echo Stone, and engage in combat using attack or magic spells. The game includes a main loop for player actions and combat resolution, with a focus on survival and quest completion.

Uploaded by

ghearn1012
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Import Random

Echoes of Arkaea is a text-based RPG featuring character and enemy classes with health, attack, defense, and magic attributes. Players embark on quests, such as retrieving the Echo Stone, and engage in combat using attack or magic spells. The game includes a main loop for player actions and combat resolution, with a focus on survival and quest completion.

Uploaded by

ghearn1012
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Echoes of Arkaea.

<hdml>

# Character classes
class Character:
def __init__(self, name, health, attack, defense, magic):
self.name = name
self.health = health
self.attack = attack
self.defense = defense
self.magic = magic

def take_damage(self, damage):


self.health -= damage
if self.health < 0:
self.health = 0

def attack_enemy(self, enemy):


damage = max(self.attack - enemy.defense, 0)
print(f"{self.name} attacks {enemy.name} for {damage} damage!")
enemy.take_damage(damage)

def cast_spell(self, enemy):


damage = max(self.magic - enemy.defense, 0)
print(f"{self.name} casts a spell on {enemy.name} for {damage} damage!")
enemy.take_damage(damage)

def is_alive(self):
return self.health > 0

class Enemy:
def __init__(self, name, health, attack, defense):
self.name = name
self.health = health
self.attack = attack
self.defense = defense

def take_damage(self, damage):


self.health -= damage
if self.health < 0:
self.health = 0

def attack_player(self, player):


damage = max(self.attack - player.defense, 0)
print(f"{self.name} attacks {player.name} for {damage} damage!")
player.take_damage(damage)

def is_alive(self):
return self.health > 0

# Quest structure
class Quest:
def __init__(self, name, description, reward):
self.name = name
self.description = description
self.reward = reward

# Main Game Loop


def main_game():
# Create player and enemy
player = Character("Alaric", 100, 20, 10, 30) # Name, health, attack, defense,
magic
enemy = Enemy("Shade Minion", 50, 15, 5) # Name, health, attack, defense

print("Welcome to Echoes of Arkaea!")

# Introduce first quest


first_quest = Quest("Retrieve the Echo Stone",
"Explore the Enchanted Forest to find the first Echo
Stone.",
"Echo Stone (Magic Boost)")

print(f"Quest: {first_quest.name}")
print(f"Description: {first_quest.description}")

# Begin combat loop


while player.is_alive() and enemy.is_alive():
print(f"\n{player.name}'s Health: {player.health} | {enemy.name}'s Health:
{enemy.health}")
print("1. Attack")
print("2. Cast Spell")
print("3. Use Item (Coming Soon)")

choice = input("What will you do? (1/2/3): ")

if choice == '1':
player.attack_enemy(enemy)
elif choice == '2':
player.cast_spell(enemy)
else:
print("That option is not available yet.")

if enemy.is_alive():
enemy.attack_player(player)

if not player.is_alive():
print(f"{player.name} has been defeated. Game Over.")
break
if not enemy.is_alive():
print(f"{enemy.name} has been defeated!")
print(f"You have completed the quest: {first_quest.name}")
print(f"Reward: {first_quest.reward}")
break

# End Game Check


if player.is_alive():
print("You've completed Day 1 of the adventure. Get ready for the next
day!")
else:
print("Try again to complete Day 1.")

# Run the game


if __name__ == "__main__":
main_game()

You might also like