Advertisement
littlebosskingzmb

Untitled

Jun 13th, 2024
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.85 KB | Gaming | 0 0
  1.  
  2. import random
  3.  
  4. class Character:
  5.     def __init__(self, name, race, character_class, rank):
  6.         self.name = name
  7.         self.race = race
  8.         self.character_class = character_class
  9.         self.rank = rank
  10.         self.level = 1
  11.         self.experience = 0
  12.         self.skills = self.get_initial_skills(character_class, rank)
  13.  
  14.     def get_initial_skills(self, character_class, rank):
  15.         skills = {
  16.             'E-Rank Warrior': ['Slash', 'Block'],
  17.             'D-Rank Berserker': ['Frenzy', 'Power Strike'],
  18.             'C-Rank Swordmaster': ['Blade Dance', 'Parry'],
  19.             'B-Rank Crusader': ['Smite', 'Divine Protection'],
  20.             'A-Rank Shadow Assassin': ['Shadow Step', 'Poison Dagger'],
  21.             'S-Rank Dragon Knight': ['Dragon\'s Breath', 'Scales of Protection'],
  22.             'Z-Rank Celestial Paladin': ['Wrath of the Heavens', 'Eternal Shield']
  23.         }
  24.         return skills.get(f"{rank} {character_class}", [])
  25.  
  26.     def gain_experience(self, amount):
  27.         self.experience += amount
  28.         if self.experience >= 100:
  29.             self.level_up()
  30.  
  31.     def level_up(self):
  32.         self.level += 1
  33.         self.experience = 0
  34.         print(f"{self.name} has leveled up to level {self.level}!")
  35.  
  36.     def show_skills(self):
  37.         print(f"{self.name}'s Skills: {', '.join(self.skills)}")
  38.  
  39.     def attack(self):
  40.         skill = random.choice(self.skills)
  41.         print(f"{self.name} uses {skill}!")
  42.  
  43. def main():
  44.     print("Welcome to Transcend: Gateway to Worlds!")
  45.     name = input("Enter your character's name: ")
  46.     race = input("Choose your race (Human, Elf, Dwarf, Orc, Fey, Cyborg, Dragon, Vampire, Angel, Demon): ")
  47.     character_class = input("Choose your class (Warrior, Mage, Rogue, Technomancer, Ranger, Monk, Necromancer, Paladin, Elementalist, Bard): ")
  48.     rank = input("Choose your rank (E-Rank, D-Rank, C-Rank, B-Rank, A-Rank, S-Rank, Z-Rank): ")
  49.    
  50.     player = Character(name, race, character_class, rank)
  51.     print(f"Character created: {player.name}, the {player.rank} {player.race} {player.character_class}")
  52.     player.show_skills()
  53.  
  54.     # Example gameplay loop
  55.     while True:
  56.         action = input("Choose an action (explore, fight, skills, quit): ")
  57.         if action == "explore":
  58.             print(f"{player.name} explores the world...")
  59.             player.gain_experience(10)
  60.         elif action == "fight":
  61.             print(f"{player.name} fights an enemy...")
  62.             player.attack()
  63.             player.gain_experience(20)
  64.         elif action == "skills":
  65.             player.show_skills()
  66.         elif action == "quit":
  67.             break
  68.         else:
  69.             print("Invalid action.")
  70.  
  71. if __name__ == "__main__":
  72.     main()player.nameself.skillsself.experienceself.levelself.rankself.raceimport random
  73.  
  74. class Character:
  75.     def __init__(self, name, race, character_class, rank):
  76.         self.name = name
  77.         self.race = race
  78.         self.character_class = character_class
  79.         self.rank = rank
  80.         self.level = 1
  81.         self.experience = 0
  82.         self.skills = self.get_initial_skills(character_class, rank)
  83.  
  84.     def get_initial_skills(self, character_class, rank):
  85.         skills = {
  86.             'E-Rank Warrior': ['Slash', 'Block'],
  87.             'D-Rank Berserker': ['Frenzy', 'Power Strike'],
  88.             'C-Rank Swordmaster': ['Blade Dance', 'Parry'],
  89.             'B-Rank Crusader': ['Smite', 'Divine Protection'],
  90.             'A-Rank Shadow Assassin': ['Shadow Step', 'Poison Dagger'],
  91.             'S-Rank Dragon Knight': ['Dragon\'s Breath', 'Scales of Protection'],
  92.             'Z-Rank Celestial Paladin': ['Wrath of the Heavens', 'Eternal Shield']
  93.         }
  94.         return skills.get(f"{rank} {character_class}", [])
  95.  
  96.     def gain_experience(self, amount):
  97.         self.experience += amount
  98.         if self.experience >= 100:
  99.             selfself.name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement