Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- class Character:
- def __init__(self, name, race, character_class, rank):
- self.name = name
- self.race = race
- self.character_class = character_class
- self.rank = rank
- self.level = 1
- self.experience = 0
- self.skills = self.get_initial_skills(character_class, rank)
- def get_initial_skills(self, character_class, rank):
- skills = {
- 'E-Rank Warrior': ['Slash', 'Block'],
- 'D-Rank Berserker': ['Frenzy', 'Power Strike'],
- 'C-Rank Swordmaster': ['Blade Dance', 'Parry'],
- 'B-Rank Crusader': ['Smite', 'Divine Protection'],
- 'A-Rank Shadow Assassin': ['Shadow Step', 'Poison Dagger'],
- 'S-Rank Dragon Knight': ['Dragon\'s Breath', 'Scales of Protection'],
- 'Z-Rank Celestial Paladin': ['Wrath of the Heavens', 'Eternal Shield']
- }
- return skills.get(f"{rank} {character_class}", [])
- def gain_experience(self, amount):
- self.experience += amount
- if self.experience >= 100:
- self.level_up()
- def level_up(self):
- self.level += 1
- self.experience = 0
- print(f"{self.name} has leveled up to level {self.level}!")
- def show_skills(self):
- print(f"{self.name}'s Skills: {', '.join(self.skills)}")
- def attack(self):
- skill = random.choice(self.skills)
- print(f"{self.name} uses {skill}!")
- def main():
- print("Welcome to Transcend: Gateway to Worlds!")
- name = input("Enter your character's name: ")
- race = input("Choose your race (Human, Elf, Dwarf, Orc, Fey, Cyborg, Dragon, Vampire, Angel, Demon): ")
- character_class = input("Choose your class (Warrior, Mage, Rogue, Technomancer, Ranger, Monk, Necromancer, Paladin, Elementalist, Bard): ")
- rank = input("Choose your rank (E-Rank, D-Rank, C-Rank, B-Rank, A-Rank, S-Rank, Z-Rank): ")
- player = Character(name, race, character_class, rank)
- print(f"Character created: {player.name}, the {player.rank} {player.race} {player.character_class}")
- player.show_skills()
- # Example gameplay loop
- while True:
- action = input("Choose an action (explore, fight, skills, quit): ")
- if action == "explore":
- print(f"{player.name} explores the world...")
- player.gain_experience(10)
- elif action == "fight":
- print(f"{player.name} fights an enemy...")
- player.attack()
- player.gain_experience(20)
- elif action == "skills":
- player.show_skills()
- elif action == "quit":
- break
- else:
- print("Invalid action.")
- if __name__ == "__main__":
- main()player.nameself.skillsself.experienceself.levelself.rankself.raceimport random
- class Character:
- def __init__(self, name, race, character_class, rank):
- self.name = name
- self.race = race
- self.character_class = character_class
- self.rank = rank
- self.level = 1
- self.experience = 0
- self.skills = self.get_initial_skills(character_class, rank)
- def get_initial_skills(self, character_class, rank):
- skills = {
- 'E-Rank Warrior': ['Slash', 'Block'],
- 'D-Rank Berserker': ['Frenzy', 'Power Strike'],
- 'C-Rank Swordmaster': ['Blade Dance', 'Parry'],
- 'B-Rank Crusader': ['Smite', 'Divine Protection'],
- 'A-Rank Shadow Assassin': ['Shadow Step', 'Poison Dagger'],
- 'S-Rank Dragon Knight': ['Dragon\'s Breath', 'Scales of Protection'],
- 'Z-Rank Celestial Paladin': ['Wrath of the Heavens', 'Eternal Shield']
- }
- return skills.get(f"{rank} {character_class}", [])
- def gain_experience(self, amount):
- self.experience += amount
- if self.experience >= 100:
- selfself.name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement