From 0b2457ebfdb629f50e449f2cafac4c726f718907 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Mon, 13 Jan 2025 14:07:20 +0100 Subject: [PATCH 01/40] Delete rpg-complex.py --- src/rpg-complex.py | 228 --------------------------------------------- 1 file changed, 228 deletions(-) delete mode 100644 src/rpg-complex.py diff --git a/src/rpg-complex.py b/src/rpg-complex.py deleted file mode 100644 index 5efdd2a..0000000 --- a/src/rpg-complex.py +++ /dev/null @@ -1,228 +0,0 @@ -import math, random - -class Character: - - #Main Class for specifying character types - kind = "character"; - - #Name placeholder - name = ""; - weapon = ""; - - #Define character - def __init__(self): - pass; - - def stats (self, levelFixed, healthMax, healthCurrent, stamina, mana, power, defense, block, xpPoints): - self.levelFixed = self.stats['levelFixed']; - self.healthMax = healthMax; - self.healthCurrent = healthCurrent; - self.stamina = stamina; - self.mana = mana; - self.power = power; - self.defense = defense; - self.block = block; - self.xpPoints = xpPoints; - -class PlayerCharacter(Character): - - #Player character type - kind = "player character"; - - #Initialize level and experience - xp = 0; - level = 1; - - #Initialize player - def __init__(self, name, weapon): - self.name = name; - self.weapon = weapon; - self.inventory = []; - - def levelup(self): - self.level += 1; - print("\n**~~~~**\nLEVEL UP ! Welcome to level {}\n**~~~~**\n".format(self.level)); - - - -class NonPlayerCharacter(Character): - - #Non player character type - kind = "non player character"; - - def __init__(self): - pass; - -class Villager(NonPlayerCharacter): - - #Villager type for non mob example - kind = "villager"; - - def __init__(self): - pass; - -class Mob(NonPlayerCharacter): - - #Mob type - kind = "Mob"; - - def __init__(self): - pass; - -class PassiveMob(Mob): - - #Passive mob type = animal - kind = "animal"; - - def __init__(self): - pass; - -class NeutralMob(Mob): - - #Passive mob type = beast - kind = "beast"; - - def __init__(self): - pass; - -class HostileMob(Mob): - - #Hostile mob type = monster - kind = "hostile"; - - #Define monster - def __init__(self): - pass; - -#Define a player variable to initialize -def player(): - PlayerCharacter(str(input("Choose name")), 1, 100, 100, 100, 100, 1, 1, 0, 0); - -#Initialize few mobs for combat -goblin = HostileMob('Goblin', 'Goblinoid', 1, 10, 10, 5, 0, 1, 1, 0, 3); -slime = HostileMob('Slime', 'Slimy', 1, 1, 1, 0, 0, 1, 0, 0, 1); -orc = HostileMob('Orc', 'Goblinoid', 1, 20, 20, 10, 0, 3, 1, 0, 7); - -#List for storing hostile mob and randomly choose in combat -mobList = []; - -#Pushing mobs into list -mobList.append(goblin, slime, orc); - -class GameElements: - - #Combat Loop function - def combatLoop(self, player, mob): - - #Global Class variables - player = playerGlobal; - mob = random.choice(mobList); - xp = 0; - - #Declare monster randomly chosen - mob = random.choice(mobList); - - #Declare variables for choice and combat check - choice = 0; - combatCheck = False; - damage = 0; - - #Random number to decide monster flee - fleeRandom = random.randint(0, 99); - - #Storage variable for save purpose - basePower = player.power; - baseDefense = player.defense; - baseBlock = player.block; - - while combatCheck == False and mob.healthCurrent > 0 and player.healthCurrent > 0: - - #Giving values for heads up - print("Your health : {player.healthCurrent}\nMob health : {mob.healthCurrent}"); - print("Your stamina : {player.stamina}\nYour mana : {player.mana}") - - #Indicating player turn - print("Player turn :"); - int(input("What do you want to do ?\nAttack : 1\nHeal : 2\nDefend : 3\nFlee : 4")); - - #Each turn reinitialize values - player.power = basePower; - player.defense = baseDefense; - player.block = baseBlock; - - #Decision tree for player turn - if choice == 1: #attack - mob.healthCurrent -= player.power; - print("Inflicted {player.power} damage"); - print(mob.healthCurrent); - elif choice == 2: #heal - #Condition = player have lost health or not - if player.healthCurrent < player.healthMax: - healthReceived = min((player.healthCurrent + player.power - player.healthMax), player.power); - player.healthCurrent = min((player.healthCurrent + player.power), player.healthMax); - print("You healed yourself for {healthReceived} points"); - else: - print("You cannot heal yourself if you have taken no damage !"); - elif choice == 3: #defend - print("You chose defense, gained + 50% defense for one turn"); - player.defense *= 1.5; - elif choice == 4: #flee - print("Try to flee !"); - combatCheck = True; - break; - else: - print("Not a suitable choice"); - continue; - - #Indicating mob turn - print("Enemy turn :"); - - #Mob decision tree - if mob.healthCurrent > (round(mob.healthMax/2)): - print("Mob attacks !"); - damage = mob.power - player.defense; - player.healthCurrent = max((player.healthCurrent - damage), 1); - else: - if mob.healthCurrent > (mob.healthMax/4): - if fleeRandom > 50: - print("Mob attacks !"); - damage = mob.power - player.defense; - player.healthCurrent = max((player.healthCurrent - damage), 1); - else: - print("Monster flees !"); - combatCheck = True; - break; - elif mob.healthCurrent < (mob.healthMax/4): - if fleeRandom > 75: - print("Mob attacks !"); - damage = mob.power - player.defense; - player.healthCurrent = max((player.healthCurrent - damage), 1); - else: - print("Monster flees !"); - combatCheck = True; - break; - #Loop resumes - - - def drop(self): - - #Item list - items = []; - - def inventory(self): - #Inventory table - inventory = []; - -class Master: - - #Master function in Master Class - def master(self): - - #Global Class variables - player = playerGlobal; - mob = random.choice(mobList); - - #Call function - GameElements.combatLoop(player, mob); - - master(); \ No newline at end of file From 19811b4f540d6c21f526dddecfb5a72447f4fd50 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Wed, 15 Jan 2025 13:46:45 +0100 Subject: [PATCH 02/40] fix: Now the player can enter, exit, and re enter the dungeon without the game crashing --- src/rpg-simple.py | 257 ++++++++++++++++++++++++++++++---------------- src/testrpg.py | 4 + 2 files changed, 170 insertions(+), 91 deletions(-) diff --git a/src/rpg-simple.py b/src/rpg-simple.py index cadf712..8ff181d 100644 --- a/src/rpg-simple.py +++ b/src/rpg-simple.py @@ -66,70 +66,85 @@ def databaseSaveCreation(): pass #Global check variable + characterCheck = False combatCheck = False playCheck = True villageCheck = True dungeonCheck = True + player = {} + character = {} #Player character - player = {} - player['Name'] = str(input("Enter your name\n")) - - print("So you are called ", player['Name']) - - player['Inventory'] = [] - - player['Coins'] = 0 - player['XP'] = 0 - player['Level'] = 1 - player['Power'] = 1 - player['Defense'] = 0 - player['Armor'] = "" - player['ArmorDefense'] = 0 - player['Avoid'] = 0 - player['Life'] = 100 - player['MaxLife'] = 100 - player['Mana'] = 0 - player['MaxMana'] = 0 - player['Stamina'] = 50 - player['MaxStamina'] = 50 - player['XP'] = 0 - player['Level'] = 1 - player['Weapon'] = "" - player['WeaponDamage'] = 0 - player['DamageBonus'] = 0 - player['DefenseBonus'] = 0 - player['ClassChoice'] = int(input("Choose your class : 1 for Swordmaster, 2 for Warrior, 3 for Knight, 4 for Archer\n")) - - #Weapon choice - if player['ClassChoice'] == 1: - player['Weapon'] = "Sword" - player['Armor'] = "Leather Armor" - player['WeaponDamage'] = 8 - player['ArmorDefense'] = 8 - player['Avoid'] = 10 - print("You have equipped a sword and a leather armor, you have 10% chance to avoid\n") - elif player['ClassChoice'] == 2: - player['Weapon'] = "Axe" - player['Armor'] = "Iron Armor" - player['WeaponDamage'] = 16 - player['ArmorDefense'] = 16 - print("You have equipped an axe and an iron armor\n") - elif player['ClassChoice'] == 3: - player['Weapon'] = "Spear" - player['Armor'] = "Boiled Leather Armor" - player['WeaponDamage'] = 12 - player['ArmorDefense'] = 12 - print("You have equipped a spear and a boiled leather armor\n") - elif player['ClassChoice'] == 4: - player['Weapon'] = "Bow" - player['Armor'] = "Cloth Armor" - player['WeaponDamage'] = 6 - player['Avoid'] = 30 - print("You have equipped a bow and a cloth armor, you have 0 armor but 30% chance to avoid\n") - else: - print("Pass here") #Debug - pass + def characterCreation(): + + #Character creation checker + global characterCheck + global player + + #Player creation + player = {} + player['Name'] = str(input("What's your name ?\n")) + + print("So you are called ", player['Name'], ", nice name !") + + player['Inventory'] = [] + + player['Coins'] = 0 + player['XP'] = 0 + player['Level'] = 1 + player['Power'] = 1 + player['Defense'] = 0 + player['Armor'] = "" + player['ArmorDefense'] = 0 + player['Avoid'] = 0 + player['Life'] = 100 + player['MaxLife'] = 100 + player['Mana'] = 0 + player['MaxMana'] = 0 + player['Stamina'] = 50 + player['MaxStamina'] = 50 + player['XP'] = 0 + player['Level'] = 1 + player['Weapon'] = "" + player['WeaponDamage'] = 0 + player['DamageBonus'] = 0 + player['DefenseBonus'] = 0 + player['ClassChoice'] = int(input("What are you ? Swordmaster (1), Warrior (2), Knight (3), Archer (4)\n")) + + #Class and equipment choice + if player['ClassChoice'] == 1: + player['Weapon'] = "Sword" + player['Armor'] = "Leather Armor" + player['WeaponDamage'] = 8 + player['ArmorDefense'] = 8 + player['Avoid'] = 10 + print("You have equipped a sword and a leather armor, you have 10% chance to avoid\n") + elif player['ClassChoice'] == 2: + player['Weapon'] = "Axe" + player['Armor'] = "Iron Armor" + player['WeaponDamage'] = 16 + player['ArmorDefense'] = 16 + print("You have equipped an axe and an iron armor\n") + elif player['ClassChoice'] == 3: + player['Weapon'] = "Spear" + player['Armor'] = "Boiled Leather Armor" + player['WeaponDamage'] = 12 + player['ArmorDefense'] = 12 + print("You have equipped a spear and a boiled leather armor\n") + elif player['ClassChoice'] == 4: + player['Weapon'] = "Bow" + player['Armor'] = "Cloth Armor" + player['WeaponDamage'] = 6 + player['Avoid'] = 30 + print("You have equipped a bow and a cloth armor, you have 0 armor but 30% chance to avoid\n") + else: + print("Pass here") #Debug + pass + + characterCheck = True + village() + + return player #Define monsters mobList = [] @@ -144,7 +159,7 @@ def databaseSaveCreation(): goblin['XP'] = 10 goblin['CoinFactor'] = 3 - mobList.append(goblin) + #mobList.append(goblin) hobgoblin = {} hobgoblin['Type'] = "Goblinoid" @@ -156,7 +171,7 @@ def databaseSaveCreation(): hobgoblin['XP'] = 14 hobgoblin['CoinFactor'] = 5 - mobList.append(hobgoblin) + #mobList.append(hobgoblin) slime = {} slime['Type'] = "Slimy" @@ -179,9 +194,9 @@ def levelUp(): #Death function def death(): print("You died...") - choice = int(input("Wiuld you like to resurrect in the village church ? 1 for yes, 0 for no")) + choice = int(input("Would you like to resurrect in the village church ? 1 for yes, 0 for no")) if choice == 1: - pass #resurrect + pass #resurrect() elif choice == 2: print("You died for good... the character will be deleted...") #call delete function for char db @@ -191,14 +206,18 @@ def death(): #Death function end #Combat function - def combatLoop(monster): + def combatLoop(character, monster): + + #Global variables + global combatCheck + global player - #Initializing enemy variable + #Initializing enemy variables monster = random.choice(mobList) enemy = monster.copy() - #Combat checker variable - global combatCheck + #Initializing player variable + player = character #Storage variable for save purpose basePower = player['Power'] @@ -255,7 +274,7 @@ def combatLoop(monster): print("You chose defense, gained + 50% defense for one turn") print("debug defense :", playerProtection) elif choice == 4: #flee - print("Try to flee !") + print("You flee !") combatCheck = True break @@ -298,21 +317,34 @@ def combatLoop(monster): player['Life'] = max((player['Life'] - monsterDamage), 0) else: monsterDamage = 0 - print("You avoided the attack") + print("You avoided the attack !") else: #Mob successfully flees, combat ends print("The ", enemy['Name'], " flees !") combatCheck = True break - else: + elif enemy['Life'] <= 0: #If enemy dies exit system and indicate to player print("You have vanquished the enemy") combatCheck = True - player['XP'] += goblin['XP'] - print("You have gained ", int(enemy['XP']), " XP points, and have ", int(player['XP']), " XP points") + player['XP'] += enemy['XP'] + print("You have gained ", int(enemy['XP']), " XP points, and have ", int(player['XP']), " XP points.") gainedCoins = 1 + round(coinsRandom * enemy['CoinFactor']) player['Coins'] += gainedCoins - print("You also gained ", gainedCoins, " coins !" ) + print("You also gained ", gainedCoins, " coins for a total of ", player['Coins'], " coins !" ) + + #Loop relaunch on order by the player + print("You may continue to explore the dungeon.") + choice = int(input("Continue exploring (1) or go out (2) ?\n")) + if choice == 1: + print("You continue exploring a little more...") + combatCheck = False + player = dungeon(player) + elif choice == 2: + print("You prefer to exit the dungeon for a while...") + game() + combatCheck = False + player = dungeon(player) #Loop resumes @@ -329,8 +361,11 @@ def village(): #Choice variable choice = 0 + villageCheck = True + while villageCheck == True: - choice = int(input("What do you want to do in the village ? 1 to shop, 2 to go to the tavern, 3 to go to the guild, 4 to go to the church, 0 to quit")) + print("What do you want to do in the village ?") + choice = int(input(" Shop (1), Tavern (2), Guild (3), Church (4), Exit (0)\n")) #Village - player decision tree if choice == 1: @@ -349,15 +384,14 @@ def village(): church() elif choice == 0: #Chose to quit village - print("Exciting village...") + print("Exiting village...") villageCheck = False - #Village function end #Village shops function def shops(): print("What shop do you want to visit ?") - choice = int(input("Available shops are : Armory (1), Jewelry (2), Alchemist (3), General store (4), Exit (0)")) + choice = int(input("Available shops are : Armory (1), Jewelry (2), Alchemist (3), General store (4), Exit (0)\n")) if choice == 1: #Visit armory armory() @@ -382,7 +416,7 @@ def shops(): #Function for armory def armory(): - choice = int(input("Do you want to buy (1) or sell (2) ? 0 to quit")) + choice = int(input("Do you want to buy (1) or sell (2) ? 0 to quit\n")) if choice == 1: pass #buy elif choice == 2: @@ -395,7 +429,7 @@ def armory(): #Function for jewelry def jewelry(): - choice = int(input("Do you want to buy (1) or sell (2) ? 0 to quit")) + choice = int(input("Do you want to buy (1) or sell (2) ? 0 to quit\n")) if choice == 1: pass #buy elif choice == 2: @@ -408,7 +442,7 @@ def jewelry(): #Function for alchemist def alchemist(): - choice = int(input("Do you want to heal (1), buy (2) or sell (3) ? 0 to quit")) + choice = int(input("Do you want to heal (1), buy (2) or sell (3) ? 0 to quit\n")) if choice == 1: pass #heal elif choice == 2: @@ -423,7 +457,7 @@ def alchemist(): #Function for general store def generalStore(): - choice = int(input("Do you want to buy (1) or sell (2) ? 0 to quit")) + choice = int(input("Do you want to buy (1) or sell (2) ? 0 to quit\n")) if choice == 1: pass #buy elif choice == 2: @@ -436,7 +470,7 @@ def generalStore(): #Function for tavern def tavern(): - choice = int(input("You can : Listen to rumors (1), Shop for food (2), Rent a room (3), Exit (0)")) + choice = int(input("You can : Listen to rumors (1), Shop for food (2), Rent a room (3), Exit (0)\n")) if choice == 1: #Chose rumors rumors() @@ -445,7 +479,7 @@ def tavern(): foodShop() elif choice == 3: #Chose rest - all stats are regen to max 75% - choice = int(input("Rest effectivness is 75% max, do you want to rent the room (1 yes or 0 no) ?")) + choice = int(input("Rest effectivness is 75% max, do you want to rent the room (1 yes or 0 no) ?\n")) if choice == 1: rest() elif choice == 0: @@ -465,7 +499,7 @@ def tavern(): #Function for food shopping def foodShop(): - choice = int(input("Do you want to buy (1) or sell (2) ? Exit (0)")) + choice = int(input("Do you want to buy (1) or sell (2) ? Exit (0)\n")) if choice == 1: pass #buy food elif choice == 2: @@ -478,7 +512,7 @@ def foodShop(): #Function for the guild def guild(): - choice = int(input("Available services are : Look for quests (1), Shop for food (2), Go to your room (3), Talk with people (4), Exit (0)")) + choice = int(input("Available services are : Look for quests (1), Shop for food (2), Go to your room (3), Talk with people (4), Exit (0)\n")) if choice == 1: #Chose quests print("What quests are available... ?") @@ -500,7 +534,7 @@ def guild(): #Function for church def church(): print("Welcome to the church, what do you want to do ?") - choice = int(input("We offer those services : 1 to pray a god, 2 to receive a boon, 3 to remove a curse, 4 to buy holy water, 5 to save, 0 to quit")) + choice = int(input("We offer those services : Pray to a god (1), Receive a boon (2), Remove a curse (3), Buy holy water (4), Save (5), Exit (0)\n")) if choice == 1: #Chose prayer print("What god to pray... ?") @@ -511,6 +545,12 @@ def church(): elif choice == 3: #Chose curse removal pass #call curseRemoval() + elif choice == 4: + #Chose buy holy water + pass #call buyHolyWater() + elif choice == 5: + #Chose save + pass #call saveGame() elif choice == 0: pass #quit shopping village() @@ -535,10 +575,16 @@ def rest(): #Rest end #Dungeon function - def dungeon(): - while player['Life'] > 0 and combatCheck == False: - combatLoop(mobList) + def dungeon(character): + + #Resetting global combat checker + global combatCheck + combatCheck = False + while combatCheck == False: + combatLoop(character, mobList) + + return character #Dongeon function end @@ -547,6 +593,28 @@ def options(): pass #call delete or other db functions #Options end + #Function to welcome player + def welcome(): + + choice = int(input("Welcome to the Elder Stones game, do you want to create a new character (1) or load an existing one (2) ? Use 0 to quit game !\n")) + + if choice == 1: + #Create a character + print("So you're a new adventurer here. How about you ? Give us some details about yourself.") + character = characterCreation() + elif choice == 2: + #character = db character + pass #load char from save + elif choice == 0: + print("Quitting game...") + sys.exit() + else: + print("Wrong choice, quitting game...") + sys.exit() + + return character + + #Welcome end def game(): #Call database functions @@ -556,21 +624,28 @@ def game(): #Play checker variable global playCheck + global character + global characterCheck #Choice variable choice = 0 + #Call welcome function + if characterCheck == False: + character = welcome() + characterCheck = True + #Game loop while playCheck == True: print("What do you want to do ?") choice = int(input("Enter village (1), Explore surroundings (2), Explore dungeon (3), Additional options (4), Quit game (0)\n")) if choice == 1: - while villageCheck == True: - village() + village() elif choice == 2: pass elif choice == 3: - dungeon() + print("Be cautious exploring the dungeon...") + dungeon(character) elif choice == 4: pass #delete save, modify settings, other things options() diff --git a/src/testrpg.py b/src/testrpg.py index a9c9931..8ff181d 100644 --- a/src/testrpg.py +++ b/src/testrpg.py @@ -577,6 +577,10 @@ def rest(): #Dungeon function def dungeon(character): + #Resetting global combat checker + global combatCheck + combatCheck = False + while combatCheck == False: combatLoop(character, mobList) From f50b18bae119f87822e7fab44eea5de9987c9d8e Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Mon, 27 Jan 2025 08:49:15 +0100 Subject: [PATCH 03/40] new ideas and bug fixed --- ideas.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ideas.txt b/ideas.txt index c09f0a8..ea28d19 100644 --- a/ideas.txt +++ b/ideas.txt @@ -2,10 +2,11 @@ features : make different areas for start merchant -make flee chance dependent on mob with a parameter +make flee chance dependent on mob with a parameter (eg : speed or agility) make quests make a small random to have events playing in the dungeon such as find an item, see a monster and decide to attack or not, find a chest, a hidden way, or a trap +make floors for the dungeon with floor bosses +make semi random champions and elites spawns +make choices done by key presses instead of typing a enter each time debug : - -find why the global variable doesn't work for the save of player's data when going out an in the dungeon \ No newline at end of file From 369ccedd6213452808a7b9de3daf4d49278369e7 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Mon, 27 Jan 2025 12:32:36 +0100 Subject: [PATCH 04/40] feature: added preparation for exploration, and corresponding global variable --- ideas.txt | 1 + src/testrpg.py | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ideas.txt b/ideas.txt index ea28d19..53dbd03 100644 --- a/ideas.txt +++ b/ideas.txt @@ -7,6 +7,7 @@ make quests make a small random to have events playing in the dungeon such as find an item, see a monster and decide to attack or not, find a chest, a hidden way, or a trap make floors for the dungeon with floor bosses make semi random champions and elites spawns +make around village exploration richer, find items, encounter merchants, being ambushed make choices done by key presses instead of typing a enter each time debug : diff --git a/src/testrpg.py b/src/testrpg.py index 8ff181d..3e6f2da 100644 --- a/src/testrpg.py +++ b/src/testrpg.py @@ -68,6 +68,7 @@ def databaseSaveCreation(): #Global check variable characterCheck = False combatCheck = False + explorationCheck = False playCheck = True villageCheck = True dungeonCheck = True @@ -574,6 +575,21 @@ def rest(): pass #Rest end + #Dungeon function + def exploration(character): + + #Resetting global combat checker + global explorationCheck + explorationCheck = True + + while combatCheck == True: + #some function to loop on exploration events, find, ambush, encounter... + pass + + return character + + #Dongeon function end + #Dungeon function def dungeon(character): @@ -642,7 +658,8 @@ def game(): if choice == 1: village() elif choice == 2: - pass + print("You go for a little tour around the plains...") + exploration(character) elif choice == 3: print("Be cautious exploring the dungeon...") dungeon(character) From 85bc058c137f59942903f6d3d80c526039b822d3 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Mon, 27 Jan 2025 13:32:55 +0100 Subject: [PATCH 05/40] WIP: preparing exploration function + small fixes in the code --- ideas.txt | 10 ++++++++++ src/testrpg.py | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/ideas.txt b/ideas.txt index 53dbd03..ae6aaaa 100644 --- a/ideas.txt +++ b/ideas.txt @@ -10,4 +10,14 @@ make semi random champions and elites spawns make around village exploration richer, find items, encounter merchants, being ambushed make choices done by key presses instead of typing a enter each time +exploration feature : +integration wanted : exploration => combat OR merchant OR find item OR find place... + +combat feature : +make comabt decisions based on character class + +transform : +dungeon function to have choice which then leads to other functions +exploration function to be the same + debug : diff --git a/src/testrpg.py b/src/testrpg.py index 3e6f2da..d2fe1a4 100644 --- a/src/testrpg.py +++ b/src/testrpg.py @@ -206,6 +206,47 @@ def death(): print("Not a good choice") #Death function end + #Exploration function + def explorationLoop(character): + + #Global variables + global explorationCheck + global player + + #Initializing player variable + player = character + + while explorationCheck == True: + + #Initializing random numbers for events purpose + explorationRandom = random.randint(0, 5) + + #Declare variables for exploration + choice = 0 + explo = 1 + explorationRandom + + if explo == 1: + choice = int(input("Continue exploring (1) or go out (2) ?\n")) + if choice == 1: + explorationLoop(player) + elif choice == 2: + explorationCheck = False + else: + pass + elif explo == 2: + choice = int(input("Continue exploring (1) or go out (2) ?\n")) + elif explo == 3: + choice = int(input("Continue exploring (1) or go out (2) ?\n")) + elif explo == 4: + choice = int(input("Continue exploring (1) or go out (2) ?\n")) + elif explo == 5: + choice = int(input("Continue exploring (1) or go out (2) ?\n")) + elif explo == 6: + choice = int(input("Continue exploring (1) or go out (2) ?\n")) + + + #Exploration function end + #Combat function def combatLoop(character, monster): @@ -582,9 +623,8 @@ def exploration(character): global explorationCheck explorationCheck = True - while combatCheck == True: - #some function to loop on exploration events, find, ambush, encounter... - pass + while explorationCheck == True: + exploration(character) return character @@ -634,6 +674,7 @@ def welcome(): def game(): #Call database functions + #put these in a conditional choice depending on if they have been made or not within the save file databaseSaves() databaseWeapons() databaseArmors() From 226ca212d5c52c56cc8859ace976b788eb26c53b Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Thu, 6 Feb 2025 13:21:51 +0100 Subject: [PATCH 06/40] feat: added function skeletons for exploration functionality --- ideas.txt | 8 ++++-- src/rpg-simple.py | 65 ++++++++++++++++++++++++++++++++++++++++++++++- src/testrpg.py | 5 ++++ 3 files changed, 75 insertions(+), 3 deletions(-) diff --git a/ideas.txt b/ideas.txt index ae6aaaa..d37a2f9 100644 --- a/ideas.txt +++ b/ideas.txt @@ -4,17 +4,21 @@ make different areas for start merchant make flee chance dependent on mob with a parameter (eg : speed or agility) make quests -make a small random to have events playing in the dungeon such as find an item, see a monster and decide to attack or not, find a chest, a hidden way, or a trap make floors for the dungeon with floor bosses make semi random champions and elites spawns make around village exploration richer, find items, encounter merchants, being ambushed make choices done by key presses instead of typing a enter each time +save feature : +save the boolean for creation and feeding of databases +save characters by player and one folder containing all the save file for each player + exploration feature : integration wanted : exploration => combat OR merchant OR find item OR find place... +make a small random to have events playing in the dungeon such as find an item, see a monster and decide to attack or not, find a chest, a hidden way, or a trap combat feature : -make comabt decisions based on character class +make combat decisions based on character class transform : dungeon function to have choice which then leads to other functions diff --git a/src/rpg-simple.py b/src/rpg-simple.py index 8ff181d..7649820 100644 --- a/src/rpg-simple.py +++ b/src/rpg-simple.py @@ -68,6 +68,7 @@ def databaseSaveCreation(): #Global check variable characterCheck = False combatCheck = False + explorationCheck = False playCheck = True villageCheck = True dungeonCheck = True @@ -205,6 +206,47 @@ def death(): print("Not a good choice") #Death function end + #Exploration function + def explorationLoop(character): + + #Global variables + global explorationCheck + global player + + #Initializing player variable + player = character + + while explorationCheck == True: + + #Initializing random numbers for events purpose + explorationRandom = random.randint(0, 5) + + #Declare variables for exploration + choice = 0 + explo = 1 + explorationRandom + + if explo == 1: + choice = int(input("Continue exploring (1) or go out (2) ?\n")) + if choice == 1: + explorationLoop(player) + elif choice == 2: + explorationCheck = False + else: + pass + elif explo == 2: + choice = int(input("Continue exploring (1) or go out (2) ?\n")) + elif explo == 3: + choice = int(input("Continue exploring (1) or go out (2) ?\n")) + elif explo == 4: + choice = int(input("Continue exploring (1) or go out (2) ?\n")) + elif explo == 5: + choice = int(input("Continue exploring (1) or go out (2) ?\n")) + elif explo == 6: + choice = int(input("Continue exploring (1) or go out (2) ?\n")) + + + #Exploration function end + #Combat function def combatLoop(character, monster): @@ -559,6 +601,11 @@ def church(): village() #Church end + #Resurrection function + def resurrection(character): + pass + #End of resurrection function + #Function for rumors def rumors(): pass @@ -574,6 +621,20 @@ def rest(): pass #Rest end + #Dungeon function + def exploration(character): + + #Resetting global combat checker + global explorationCheck + explorationCheck = True + + while explorationCheck == True: + exploration(character) + + return character + + #Dongeon function end + #Dungeon function def dungeon(character): @@ -618,6 +679,7 @@ def welcome(): def game(): #Call database functions + #put these in a conditional choice depending on if they have been made or not within the save file databaseSaves() databaseWeapons() databaseArmors() @@ -642,7 +704,8 @@ def game(): if choice == 1: village() elif choice == 2: - pass + print("You go for a little tour around the plains...") + exploration(character) elif choice == 3: print("Be cautious exploring the dungeon...") dungeon(character) diff --git a/src/testrpg.py b/src/testrpg.py index d2fe1a4..7649820 100644 --- a/src/testrpg.py +++ b/src/testrpg.py @@ -601,6 +601,11 @@ def church(): village() #Church end + #Resurrection function + def resurrection(character): + pass + #End of resurrection function + #Function for rumors def rumors(): pass From ee5de53ccbb3c134717f4bec0e6276dc1dc9e2b4 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Thu, 6 Feb 2025 14:04:42 +0100 Subject: [PATCH 07/40] WIP: continuing implementation of exploration function --- ideas.txt | 5 ++++- src/testrpg.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/ideas.txt b/ideas.txt index d37a2f9..891769b 100644 --- a/ideas.txt +++ b/ideas.txt @@ -19,9 +19,12 @@ make a small random to have events playing in the dungeon such as find an item, combat feature : make combat decisions based on character class +make subfunctions for combat turns so I can decide for initiative from the player or from the monster +make another function for choosen combat when the exploration function gives the monster itself, which will call subfunctions +make an arena system with opponent lists (raised monsters, human classes) with another combat function called arena transform : dungeon function to have choice which then leads to other functions -exploration function to be the same +exploration function to be different depending on environment around villages debug : diff --git a/src/testrpg.py b/src/testrpg.py index 7649820..c9edab0 100644 --- a/src/testrpg.py +++ b/src/testrpg.py @@ -226,23 +226,78 @@ def explorationLoop(character): explo = 1 + explorationRandom if explo == 1: + #Find an item choice = int(input("Continue exploring (1) or go out (2) ?\n")) if choice == 1: explorationLoop(player) elif choice == 2: explorationCheck = False + village() else: - pass + explorationCheck = False + village() elif explo == 2: + #Monster ambush choice = int(input("Continue exploring (1) or go out (2) ?\n")) + if choice == 1: + explorationLoop(player) + elif choice == 2: + explorationCheck = False + village() + else: + explorationCheck = False + village() elif explo == 3: - choice = int(input("Continue exploring (1) or go out (2) ?\n")) + #See a monster from a distance + monster = random.choice(mobList).copy() + print("You see a monster, but it do not seem to see you, it appears to be a ", monster['Name']) + choice = int(input("Do you wish to fight this ", monster['Name'], " Yes (1), No (2) ?")) + if choice == 1: + combatLoop(player, monster) + elif choice == 2: + choice = int(input("Continue exploring (1) or go out (2) ?\n")) + if choice == 1: + explorationLoop(player) + elif choice == 2: + explorationCheck = False + village() + else: + explorationCheck = False + village() + else: + print("Wrong choice, continuig exploration...") + explorationLoop(player) + elif explo == 4: choice = int(input("Continue exploring (1) or go out (2) ?\n")) + if choice == 1: + explorationLoop(player) + elif choice == 2: + explorationCheck = False + village() + else: + explorationCheck = False + village() elif explo == 5: choice = int(input("Continue exploring (1) or go out (2) ?\n")) + if choice == 1: + explorationLoop(player) + elif choice == 2: + explorationCheck = False + village() + else: + explorationCheck = False + village() elif explo == 6: choice = int(input("Continue exploring (1) or go out (2) ?\n")) + if choice == 1: + explorationLoop(player) + elif choice == 2: + explorationCheck = False + village() + else: + explorationCheck = False + village() #Exploration function end From cda9f9e549e7949796304f512de8c5fcf7474893 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Mon, 10 Feb 2025 13:56:54 +0100 Subject: [PATCH 08/40] WIP: files for organization created --- ideas.txt | 3 +++ src/combat.py | 0 src/death.py | 0 src/exploration.py | 0 src/lists.py | 0 src/village.py | 0 6 files changed, 3 insertions(+) create mode 100644 src/combat.py create mode 100644 src/death.py create mode 100644 src/exploration.py create mode 100644 src/lists.py create mode 100644 src/village.py diff --git a/ideas.txt b/ideas.txt index 891769b..33d4ad3 100644 --- a/ideas.txt +++ b/ideas.txt @@ -27,4 +27,7 @@ transform : dungeon function to have choice which then leads to other functions exploration function to be different depending on environment around villages +final before continuig dev : +=> separate functions into files + debug : diff --git a/src/combat.py b/src/combat.py new file mode 100644 index 0000000..e69de29 diff --git a/src/death.py b/src/death.py new file mode 100644 index 0000000..e69de29 diff --git a/src/exploration.py b/src/exploration.py new file mode 100644 index 0000000..e69de29 diff --git a/src/lists.py b/src/lists.py new file mode 100644 index 0000000..e69de29 diff --git a/src/village.py b/src/village.py new file mode 100644 index 0000000..e69de29 From cd5f7cd5f62cbe455972e5217f947dda043ec3dc Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Mon, 10 Feb 2025 14:03:06 +0100 Subject: [PATCH 09/40] WIP: small modification of exploration function --- src/testrpg.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/testrpg.py b/src/testrpg.py index c9edab0..f42a8a3 100644 --- a/src/testrpg.py +++ b/src/testrpg.py @@ -238,6 +238,9 @@ def explorationLoop(character): village() elif explo == 2: #Monster ambush + monster = random.choice(mobList).copy() + print("You are ambushed by a ", monster['Name'], " !") + combatLoop(player, monster) choice = int(input("Continue exploring (1) or go out (2) ?\n")) if choice == 1: explorationLoop(player) @@ -250,7 +253,7 @@ def explorationLoop(character): elif explo == 3: #See a monster from a distance monster = random.choice(mobList).copy() - print("You see a monster, but it do not seem to see you, it appears to be a ", monster['Name']) + print("You see a monster, but it does not seem to see you, it appears to be a ", monster['Name']) choice = int(input("Do you wish to fight this ", monster['Name'], " Yes (1), No (2) ?")) if choice == 1: combatLoop(player, monster) From 80f135842fbf4dde8345c1c7863177de2a15aefb Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Tue, 11 Feb 2025 14:25:56 +0100 Subject: [PATCH 10/40] WIP: continuation of exploration feature implementation --- ideas.txt | 1 + src/game_master.py | 0 src/testrpg.py | 5 ++++- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 src/game_master.py diff --git a/ideas.txt b/ideas.txt index 33d4ad3..4c984ea 100644 --- a/ideas.txt +++ b/ideas.txt @@ -8,6 +8,7 @@ make floors for the dungeon with floor bosses make semi random champions and elites spawns make around village exploration richer, find items, encounter merchants, being ambushed make choices done by key presses instead of typing a enter each time +randomize some properties like power or health points save feature : save the boolean for creation and feeding of databases diff --git a/src/game_master.py b/src/game_master.py new file mode 100644 index 0000000..e69de29 diff --git a/src/testrpg.py b/src/testrpg.py index f42a8a3..d92408f 100644 --- a/src/testrpg.py +++ b/src/testrpg.py @@ -227,6 +227,10 @@ def explorationLoop(character): if explo == 1: #Find an item + print("You stumble upon an item on the floor, what is that ?") + #make lists : + #one list for all item where the only property is type : weapon, armor, aid... + #another one for each item type with according properties choice = int(input("Continue exploring (1) or go out (2) ?\n")) if choice == 1: explorationLoop(player) @@ -270,7 +274,6 @@ def explorationLoop(character): else: print("Wrong choice, continuig exploration...") explorationLoop(player) - elif explo == 4: choice = int(input("Continue exploring (1) or go out (2) ?\n")) if choice == 1: From df013a79a2a94aca05d4001d0617b2cbdd234303 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Tue, 11 Feb 2025 17:40:02 +0100 Subject: [PATCH 11/40] WIP: file separation pending --- src/database_connection.py | 15 ++++++++ src/database_feed.py | 74 ++++++++++++++++++++++++++++++++++++++ src/game_master.py | 10 ++++++ src/rpg-simple.py | 65 +-------------------------------- 4 files changed, 100 insertions(+), 64 deletions(-) create mode 100644 src/database_feed.py diff --git a/src/database_connection.py b/src/database_connection.py index a4c4d00..5190439 100644 --- a/src/database_connection.py +++ b/src/database_connection.py @@ -1,2 +1,17 @@ import sqlite3 +#Connection to database +def dbconnect(): + + try: + connection = sqlite3.connect('database/RPG_Database.db') + cursor = connection.cursor() + + except Exception as error: + print("Error ", error) + connection.rollback() + + finally: + connection.close() + + return connection, cursor \ No newline at end of file diff --git a/src/database_feed.py b/src/database_feed.py new file mode 100644 index 0000000..cebaa9d --- /dev/null +++ b/src/database_feed.py @@ -0,0 +1,74 @@ +import random, math, sys +from database_connection import * + +try: + #Call database connection + cursor = dbconnect() + + #Database tables creation functions + def databaseSaves(): + + global cursor + + #Create saves table + cursor.execute(""" + CREATE TABLE IF NOT EXISTS saves( + id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, + characterName TEXT, + characterLevel INTEGER, + characterXP INTEGER + ) + """) + connection.commit() + + def databaseItems(): + pass + + def databaseWeapons(): + + #Create weapons table + cursor.execute(""" + CREATE TABLE IF NOT EXISTS weapons( + id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, + weaponName TEXT, + weaponType TEXT, + weaponRank TEXT, + weaponLevel INTEGER, + weaponPrice INTEGER + ) + """) + connection.commit() + + def databaseArmors(): + + #Create armors table + cursor.execute(""" + CREATE TABLE IF NOT EXISTS armors( + id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, + armorName TEXT, + armorType TEXT, + armorRank TEXT, + armorLevel INTEGER, + armorPrice INTEGER + ) + """) + connection.commit() + + def databasePotions(): + pass + + def databaseIngredients(): + pass + + def databaseMonsters(): + pass + + #Database tables update functions + def databaseSaveCreation(): + pass + +except Exception as error: + print("Error ", error) + +finally: + pass \ No newline at end of file diff --git a/src/game_master.py b/src/game_master.py index e69de29..24bec84 100644 --- a/src/game_master.py +++ b/src/game_master.py @@ -0,0 +1,10 @@ +import random, math, sys + +try: + pass + +except Exception as error: + print("Error ", error) + +finally: + pass \ No newline at end of file diff --git a/src/rpg-simple.py b/src/rpg-simple.py index 7649820..dbf53f7 100644 --- a/src/rpg-simple.py +++ b/src/rpg-simple.py @@ -1,69 +1,6 @@ -import random, math, sys, sqlite3 +import random, math, sys try: - #Connection to database - connection = sqlite3.connect('database/RPG_Database.db') - cursor = connection.cursor() - - #Database tables creation functions - def databaseSaves(): - - #Create saves table - cursor.execute(""" - CREATE TABLE IF NOT EXISTS saves( - id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, - characterName TEXT, - characterLevel INTEGER, - characterXP INTEGER - ) - """) - connection.commit() - - def databaseItems(): - pass - - def databaseWeapons(): - - #Create weapons table - cursor.execute(""" - CREATE TABLE IF NOT EXISTS weapons( - id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, - weaponName TEXT, - weaponType TEXT, - weaponRank TEXT, - weaponLevel INTEGER, - weaponPrice INTEGER - ) - """) - connection.commit() - - def databaseArmors(): - - #Create armors table - cursor.execute(""" - CREATE TABLE IF NOT EXISTS armors( - id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, - armorName TEXT, - armorType TEXT, - armorRank TEXT, - armorLevel INTEGER, - armorPrice INTEGER - ) - """) - connection.commit() - - def databasePotions(): - pass - - def databaseIngredients(): - pass - - def databaseMonsters(): - pass - - #Database tables update functions - def databaseSaveCreation(): - pass #Global check variable characterCheck = False From 1fd26254812301e4931f4e445414d520f0286888 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Wed, 12 Feb 2025 12:35:35 +0100 Subject: [PATCH 12/40] feat/fix/WIP: database connection and feeding finally separated in their own files --- ideas.txt | 6 +-- src/database_connection.py | 31 ++++++++++------ src/database_feed.py | 14 +++++-- src/rpg-simple.py | 75 +++++++++++++++++++++++++++++++++++--- src/testrpg.py | 73 ++++--------------------------------- 5 files changed, 111 insertions(+), 88 deletions(-) diff --git a/ideas.txt b/ideas.txt index 4c984ea..dbb33cd 100644 --- a/ideas.txt +++ b/ideas.txt @@ -1,9 +1,9 @@ features : make different areas for start -merchant +merchants make flee chance dependent on mob with a parameter (eg : speed or agility) -make quests +make quests procedurally generated make floors for the dungeon with floor bosses make semi random champions and elites spawns make around village exploration richer, find items, encounter merchants, being ambushed @@ -11,7 +11,7 @@ make choices done by key presses instead of typing a enter each time randomize some properties like power or health points save feature : -save the boolean for creation and feeding of databases +save the boolean for creation and feeding of databases => python file or external file ? save characters by player and one folder containing all the save file for each player exploration feature : diff --git a/src/database_connection.py b/src/database_connection.py index 5190439..1ae049e 100644 --- a/src/database_connection.py +++ b/src/database_connection.py @@ -1,17 +1,26 @@ import sqlite3 - + #Connection to database def dbconnect(): + connection = sqlite3.connect('database/RPG_Database.db') + return connection - try: - connection = sqlite3.connect('database/RPG_Database.db') - cursor = connection.cursor() - - except Exception as error: - print("Error ", error) - connection.rollback() +#Cursor declaration to feed database +def dbcursor(): + connection = dbconnect() + return connection.cursor() - finally: - connection.close() +#In case of error in the except block +def dberror(error): + print("Error ", error) + dbConnect = dbconnect() + dbCursor = dbconnect() + dbConnect.rollback() + dbCursor.rollback() - return connection, cursor \ No newline at end of file +#And finally close all when done +def dbclose(): + connection = dbconnect() + cursor = dbcursor() + connection.close() + cursor.close() \ No newline at end of file diff --git a/src/database_feed.py b/src/database_feed.py index cebaa9d..d24246e 100644 --- a/src/database_feed.py +++ b/src/database_feed.py @@ -2,13 +2,13 @@ from database_connection import * try: - #Call database connection - cursor = dbconnect() #Database tables creation functions def databaseSaves(): - global cursor + #Calling needed variables from databse connection file + connection = dbconnect() + cursor = dbcursor() #Create saves table cursor.execute(""" @@ -26,6 +26,10 @@ def databaseItems(): def databaseWeapons(): + #Calling needed variables from databse connection file + connection = dbconnect() + cursor = dbcursor() + #Create weapons table cursor.execute(""" CREATE TABLE IF NOT EXISTS weapons( @@ -41,6 +45,10 @@ def databaseWeapons(): def databaseArmors(): + #Calling needed variables from databse connection file + connection = dbconnect() + cursor = dbcursor() + #Create armors table cursor.execute(""" CREATE TABLE IF NOT EXISTS armors( diff --git a/src/rpg-simple.py b/src/rpg-simple.py index dbf53f7..f47d13b 100644 --- a/src/rpg-simple.py +++ b/src/rpg-simple.py @@ -1,7 +1,12 @@ import random, math, sys +from database_connection import dbconnect, dbcursor, dberror, dbclose +from database_feed import * try: + dbconnect() + dbcursor() + #Global check variable characterCheck = False combatCheck = False @@ -163,23 +168,84 @@ def explorationLoop(character): explo = 1 + explorationRandom if explo == 1: + #Find an item + print("You stumble upon an item on the floor, what is that ?") + #make lists : + #one list for all item where the only property is type : weapon, armor, aid... + #another one for each item type with according properties choice = int(input("Continue exploring (1) or go out (2) ?\n")) if choice == 1: explorationLoop(player) elif choice == 2: explorationCheck = False + village() else: - pass + explorationCheck = False + village() elif explo == 2: + #Monster ambush + monster = random.choice(mobList).copy() + print("You are ambushed by a ", monster['Name'], " !") + combatLoop(player, monster) choice = int(input("Continue exploring (1) or go out (2) ?\n")) + if choice == 1: + explorationLoop(player) + elif choice == 2: + explorationCheck = False + village() + else: + explorationCheck = False + village() elif explo == 3: - choice = int(input("Continue exploring (1) or go out (2) ?\n")) + #See a monster from a distance + monster = random.choice(mobList).copy() + print("You see a monster, but it does not seem to see you, it appears to be a ", monster['Name']) + choice = int(input("Do you wish to fight this ", monster['Name'], " Yes (1), No (2) ?")) + if choice == 1: + combatLoop(player, monster) + elif choice == 2: + choice = int(input("Continue exploring (1) or go out (2) ?\n")) + if choice == 1: + explorationLoop(player) + elif choice == 2: + explorationCheck = False + village() + else: + explorationCheck = False + village() + else: + print("Wrong choice, continuig exploration...") + explorationLoop(player) elif explo == 4: choice = int(input("Continue exploring (1) or go out (2) ?\n")) + if choice == 1: + explorationLoop(player) + elif choice == 2: + explorationCheck = False + village() + else: + explorationCheck = False + village() elif explo == 5: choice = int(input("Continue exploring (1) or go out (2) ?\n")) + if choice == 1: + explorationLoop(player) + elif choice == 2: + explorationCheck = False + village() + else: + explorationCheck = False + village() elif explo == 6: choice = int(input("Continue exploring (1) or go out (2) ?\n")) + if choice == 1: + explorationLoop(player) + elif choice == 2: + explorationCheck = False + village() + else: + explorationCheck = False + village() #Exploration function end @@ -661,8 +727,7 @@ def game(): game() except Exception as error: - print("Error ", error) - connection.rollback() + dberror(error) finally: - connection.close() \ No newline at end of file + dbclose() \ No newline at end of file diff --git a/src/testrpg.py b/src/testrpg.py index d92408f..f47d13b 100644 --- a/src/testrpg.py +++ b/src/testrpg.py @@ -1,69 +1,11 @@ -import random, math, sys, sqlite3 +import random, math, sys +from database_connection import dbconnect, dbcursor, dberror, dbclose +from database_feed import * try: - #Connection to database - connection = sqlite3.connect('database/RPG_Database.db') - cursor = connection.cursor() - #Database tables creation functions - def databaseSaves(): - - #Create saves table - cursor.execute(""" - CREATE TABLE IF NOT EXISTS saves( - id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, - characterName TEXT, - characterLevel INTEGER, - characterXP INTEGER - ) - """) - connection.commit() - - def databaseItems(): - pass - - def databaseWeapons(): - - #Create weapons table - cursor.execute(""" - CREATE TABLE IF NOT EXISTS weapons( - id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, - weaponName TEXT, - weaponType TEXT, - weaponRank TEXT, - weaponLevel INTEGER, - weaponPrice INTEGER - ) - """) - connection.commit() - - def databaseArmors(): - - #Create armors table - cursor.execute(""" - CREATE TABLE IF NOT EXISTS armors( - id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, - armorName TEXT, - armorType TEXT, - armorRank TEXT, - armorLevel INTEGER, - armorPrice INTEGER - ) - """) - connection.commit() - - def databasePotions(): - pass - - def databaseIngredients(): - pass - - def databaseMonsters(): - pass - - #Database tables update functions - def databaseSaveCreation(): - pass + dbconnect() + dbcursor() #Global check variable characterCheck = False @@ -785,8 +727,7 @@ def game(): game() except Exception as error: - print("Error ", error) - connection.rollback() + dberror(error) finally: - connection.close() \ No newline at end of file + dbclose() \ No newline at end of file From ad494c0acaaa92eecdb7e61a6a63260e624b9f2b Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Wed, 12 Feb 2025 13:36:25 +0100 Subject: [PATCH 13/40] WIP: prepared lists file first step --- ideas.txt | 6 +++++- src/lists.py | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/ideas.txt b/ideas.txt index dbb33cd..a3322ab 100644 --- a/ideas.txt +++ b/ideas.txt @@ -24,11 +24,15 @@ make subfunctions for combat turns so I can decide for initiative from the playe make another function for choosen combat when the exploration function gives the monster itself, which will call subfunctions make an arena system with opponent lists (raised monsters, human classes) with another combat function called arena +npc feature : +random npc : names, surnames, nicknames, origin (country, continent, city), specialization (job, class), personalities +make dictionaries for each characteristic + transform : dungeon function to have choice which then leads to other functions exploration function to be different depending on environment around villages final before continuig dev : -=> separate functions into files +=> separate functions into files : done for databse ! debug : diff --git a/src/lists.py b/src/lists.py index e69de29..b315138 100644 --- a/src/lists.py +++ b/src/lists.py @@ -0,0 +1,55 @@ +import random, math, sys +from database_feed import * + +#This file will contain all items lists that will be needed for the game + +#General lists + + #Characters + + #NPC human + + #Monsters + + #Pets + + #Inhabited places hardcoded + + #Villages + + #Main cities + + #Dungeons + + #Subterranean + + #Overworld + + #Air placed + + #Other dimensions + + #Items + + #General items +itemList = [] + + #General categories +aidList = [] +weaponList = [] +armorList = [] + + #Precise categories + + #Weapons +swordList = [] +axeList = [] +spearList = [] +polearmList = [] +bowList = [] +crossbowList = [] + + + #Armors + + #Potions From 480b37c5bfc591cf44e27ddd769c3f140fb6eb13 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Thu, 13 Feb 2025 13:40:35 +0100 Subject: [PATCH 14/40] WIP: lists are being made in the right file --- precisions.txt | 11 +++++++++++ src/lists.py | 20 ++++++++++++++++++++ src/testrpg.py | 1 + 3 files changed, 32 insertions(+) create mode 100644 precisions.txt diff --git a/precisions.txt b/precisions.txt new file mode 100644 index 0000000..c302fae --- /dev/null +++ b/precisions.txt @@ -0,0 +1,11 @@ +human list : + +humanoid list : +corrupted humans, corrupted elves, corrupted dwarves, + +vampire list : + +zombie list : + +ghost list : + diff --git a/src/lists.py b/src/lists.py index b315138..347b2dd 100644 --- a/src/lists.py +++ b/src/lists.py @@ -8,8 +8,28 @@ #Characters #NPC human +humanList = [] #Monsters + #Species and Races +humanoidList = [] +corruptedHumans = [] +corruptedElfList = [] +corruptedDwarfList = [] + +pseudoHumanoidList = [] +goblinoidList = [] +orcoidList = [] +ogreList = [] + +undeadList = [] +vampireList = [] +zombieList = [] +ghostList = [] + + + #Individual monsters + #Pets diff --git a/src/testrpg.py b/src/testrpg.py index f47d13b..e759d3e 100644 --- a/src/testrpg.py +++ b/src/testrpg.py @@ -1,6 +1,7 @@ import random, math, sys from database_connection import dbconnect, dbcursor, dberror, dbclose from database_feed import * +from lists import * try: From 0c4984b21b64b27ecd608782bb13d41daac2d7ef Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Thu, 13 Feb 2025 13:57:19 +0100 Subject: [PATCH 15/40] WIP: Lists completion in progress + new ideas in file --- ideas.txt | 1 + precisions.txt | 4 +++- src/lists.py | 37 +++++++++++++++++++++++++++++++++---- src/testrpg.py | 3 +-- 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/ideas.txt b/ideas.txt index a3322ab..d150bfd 100644 --- a/ideas.txt +++ b/ideas.txt @@ -9,6 +9,7 @@ make semi random champions and elites spawns make around village exploration richer, find items, encounter merchants, being ambushed make choices done by key presses instead of typing a enter each time randomize some properties like power or health points +use deepcopy() to make templates and derive from that for individual monsters save feature : save the boolean for creation and feeding of databases => python file or external file ? diff --git a/precisions.txt b/precisions.txt index c302fae..5c8da64 100644 --- a/precisions.txt +++ b/precisions.txt @@ -1,7 +1,9 @@ human list : humanoid list : -corrupted humans, corrupted elves, corrupted dwarves, +corrupted humans => will have some human origins and different levels and ranks +corrupted elves => dark, high, wood, blood (unique to corrupted ones), crystal (crystal elves are elves imprisoned in stone by an ancient curse, end game enemy) +corrupted dwarves => deep, high, forest, blood (same as elves counterpart), crystal (same) vampire list : diff --git a/src/lists.py b/src/lists.py index 347b2dd..643f059 100644 --- a/src/lists.py +++ b/src/lists.py @@ -1,9 +1,13 @@ -import random, math, sys +import random, math, sys, copy from database_feed import * #This file will contain all items lists that will be needed for the game #General lists +mobList = [] +jobList = [] +classList = [] + #Characters @@ -12,24 +16,49 @@ #Monsters #Species and Races +#Humanoids humanoidList = [] -corruptedHumans = [] +corruptedHumanList = [] corruptedElfList = [] corruptedDwarfList = [] +#Append in humanoids list +humanoidList.append(corruptedHumanList) +humanoidList.append(corruptedElfList) +humanoidList.append(corruptedDwarfList) +#Pseudhumanoids pseudoHumanoidList = [] goblinoidList = [] orcoidList = [] ogreList = [] +#Append in pseudohumanoids list +pseudoHumanoidList.append(goblinoidList) +pseudoHumanoidList.append(orcoidList) +pseudoHumanoidList.append(ogreList) +#Undead undeadList = [] vampireList = [] zombieList = [] ghostList = [] - +#Append in undead list +undeadList.append(vampireList) +undeadList.append(zombieList) +undeadList.append(ghostList) #Individual monsters - +#Goblins and Goblinoids + + +goblin = {} +goblin['Type'] = "Goblinoid" +goblin['Name'] = "Goblin" +goblin['Power'] = 12 +goblin['Defense'] = 2 +goblin['Life'] = 50 +goblin['MaxLife'] = 50 +goblin['XP'] = 10 +goblin['CoinFactor'] = 3 #Pets diff --git a/src/testrpg.py b/src/testrpg.py index e759d3e..ce576d5 100644 --- a/src/testrpg.py +++ b/src/testrpg.py @@ -1,4 +1,4 @@ -import random, math, sys +import random, math, sys, copy from database_connection import dbconnect, dbcursor, dberror, dbclose from database_feed import * from lists import * @@ -91,7 +91,6 @@ def characterCreation(): return player #Define monsters - mobList = [] goblin = {} goblin['Type'] = "Goblinoid" From 49d8e6f4dbbb8ddb1d532c6cf6d37b0a091b1c71 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Thu, 13 Feb 2025 14:06:40 +0100 Subject: [PATCH 16/40] feat/WIP: templates for monsters are now functional for goblins --- .../database_connection.cpython-313.pyc | Bin 0 -> 1188 bytes src/__pycache__/database_feed.cpython-313.pyc | Bin 0 -> 2637 bytes src/lists.py | 18 +++++++++++++----- 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 src/__pycache__/database_connection.cpython-313.pyc create mode 100644 src/__pycache__/database_feed.cpython-313.pyc diff --git a/src/__pycache__/database_connection.cpython-313.pyc b/src/__pycache__/database_connection.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cbaaf66bec5311788c1757fb82e93bfab1cbe1f7 GIT binary patch literal 1188 zcmah{Pfrs;6o0dww$M_9NK35*R)dLq!9;_JO1uDqij8U0i)=#L?WS&Ac5!BVKrc1% zU&6&mh@XMP4?_c{&DxtMZ-#yW-^}h7Bm`fwZ|D7+_j|v2{Y)kWDEB^oZ`caJFJVN2 zwv_%X{`Q~@W%3jll$8Q7QjVck$`p0197jzXL`(b@1w})ag(`-B@%3+`+Jp7b4N!{i zA9w(+V~=?fI2@?JENDvcO}<|BslJP?t~Wi)ws_Sun@nGFjpnB5cwAqxywzq+f4=R#be(6GV__qm zGeeI$Z=75?x3%pL*K47J4Pyg}AD=|kg5G%k+sxOQgKG~C#}`^py6Nlz&Gs<_|F9xv zm#o~y1F{m%3@|TJQN;8mk#R<%_$=&`qNd39e!^%n?lP9ZYJ$0C#KA_V~?1C|Xf`%AO!hDa1(=f}V0`uVms<1u)8o_hOIX}9WyV~lYB4{)#Vp4QI2dBCZP%*CE8#aqhIpmLU?~I>i;@X0 zpsK1G5R|OfWGc&|S8&9|mLflN`18##%SW`(8@sZbZawZ@%I~~wt#)aqLvwAKJEHk6 z9qG_)n`VE|$$&X59mwE;ZFHSxE}GUkmo2$ykT)2%mc^C2r>y4W&4h3Zd?5b_g7j}r>X9j6pBbDWBke1D9R%d+|} D{{Ge_ literal 0 HcmV?d00001 diff --git a/src/__pycache__/database_feed.cpython-313.pyc b/src/__pycache__/database_feed.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d4c73b9146a48e279e172a198bdd95ec7c83d2a GIT binary patch literal 2637 zcmd5-(QDgA9RA6+WXX-}X307y*%qa+QkPN&BMini&{8cmX;ja$SxN*&k}hW%?n7B$_Pdki#w~Ri4Riv1_q)6AzB}E0 z`dwdD3xJRL-Tlp`4Dc7Lq>nfV`afZC02Wxn3ecn!sKDzPn!z%&lKnWN!TVrkXMyId z9HMB6h>|5C=B+%UY{`giJ_`gD_RlU=u1C^X^eWJN7Kq4ZUG#4gHJjhF1MjGjB9BW36g6 zEG=|ylknmQn+^0@TGebA%SK(R)vK#|{ie2J+|=}D<3`m)xmCk#Xic;FRnxfq(qMPX zp^h67YC0XFHH@{!7|wNan{20(jp41;QqstLm0|5L7b~p|H}HMpMzM@xmxck2^W+Y3 zyAg>cH|TV{=r9u(1}rb|v6a(8cJ7)MUvodPn<1g0-Hp6$FLWZ(rS{dp?RJPCh4!)+ zUF&YxwcThd@K-(GtJjw8kh*ruiJT25B)8gxw65&z#%kJPu`Q-W)Mp15euQujo=9+R zet&(h@OW}&e|AsmNuZQ|D1Kk;LB2fk1oDd7I}6IxBYEbbJoB48*T-QnVlie3Zm}E& z2YB#@f_Vt^Ev(TJ0~O)KEw|jo+>lr z82f%poSncwZ38E&W89k%8oN8MvUftLJN`GX@P9%$!TbrSMm?9DV1CMuld^m|FmiJE zrPPC8C;LRtA!82T{)sMBm#b}^XrUXGd#)jU!9*M-*dh*{1f;*v0~hD z$qt)0773dq7I&!UM=xF<@~54k)!ina(+Vz)oqX6v=w$^#_!G*%LisT)^m3*kC`VFB zeD~S-+07R@m5VI_nGkPKWFV(pMW&i*H literal 0 HcmV?d00001 diff --git a/src/lists.py b/src/lists.py index 643f059..1defefc 100644 --- a/src/lists.py +++ b/src/lists.py @@ -49,16 +49,24 @@ #Individual monsters #Goblins and Goblinoids - -goblin = {} -goblin['Type'] = "Goblinoid" +goblinTemplate = {} +goblinTemplate['Type'] = "Goblinoid" +goblinTemplate['Name'] = "Default" +goblinTemplate['Power'] = 0 +goblinTemplate['Defense'] = 0 +goblinTemplate['Life'] = 1 +goblinTemplate['MaxLife'] = 1 +goblinTemplate['XP'] = 10 +goblinTemplate['CoinFactor'] = 3 + +goblin = copy.deepcopy(goblinTemplate) goblin['Name'] = "Goblin" goblin['Power'] = 12 goblin['Defense'] = 2 goblin['Life'] = 50 goblin['MaxLife'] = 50 -goblin['XP'] = 10 -goblin['CoinFactor'] = 3 + +print(goblinTemplate, " ", goblin) #Pets From 17c85dc1d2a9de1277efdf6ed6fb9f072e9526e3 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Thu, 13 Feb 2025 17:48:41 +0100 Subject: [PATCH 17/40] WIP: importation of few more data in the lists file --- src/lists.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/lists.py b/src/lists.py index 1defefc..3bdba9e 100644 --- a/src/lists.py +++ b/src/lists.py @@ -46,12 +46,19 @@ undeadList.append(zombieList) undeadList.append(ghostList) +#Slimy +slimyList = [] +slimelist = [] +#Append in slimy list +slimyList.append(slimelist) + #Individual monsters #Goblins and Goblinoids goblinTemplate = {} goblinTemplate['Type'] = "Goblinoid" goblinTemplate['Name'] = "Default" +goblinTemplate['Rank'] = 1 goblinTemplate['Power'] = 0 goblinTemplate['Defense'] = 0 goblinTemplate['Life'] = 1 @@ -66,7 +73,15 @@ goblin['Life'] = 50 goblin['MaxLife'] = 50 -print(goblinTemplate, " ", goblin) +hobgoblin = {} +hobgoblin['Name'] = "Hobgoblin" +goblinTemplate['Rank'] = 2 +hobgoblin['Power'] = 16 +hobgoblin['Defense'] = 4 +hobgoblin['Life'] = 60 +hobgoblin['MaxLife'] = 60 +hobgoblin['XP'] = 14 +hobgoblin['CoinFactor'] = 5 #Pets From 7be03e0d7a62497456ca06bdec989ec1afcf6e4e Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Fri, 14 Feb 2025 12:06:37 +0100 Subject: [PATCH 18/40] WIP: list update --- src/lists.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lists.py b/src/lists.py index 3bdba9e..64cb1e5 100644 --- a/src/lists.py +++ b/src/lists.py @@ -4,11 +4,12 @@ #This file will contain all items lists that will be needed for the game #General lists +speciesList = [] mobList = [] +mobSpeciesList = [] jobList = [] classList = [] - #Characters #NPC human @@ -42,6 +43,7 @@ zombieList = [] ghostList = [] #Append in undead list +humanoidList.append(undeadList) undeadList.append(vampireList) undeadList.append(zombieList) undeadList.append(ghostList) @@ -73,9 +75,12 @@ goblin['Life'] = 50 goblin['MaxLife'] = 50 -hobgoblin = {} +goblinoidList.append(goblin) +mobList.append(goblin) + +hobgoblin = copy.deepcopy(goblinTemplate) hobgoblin['Name'] = "Hobgoblin" -goblinTemplate['Rank'] = 2 +hobgoblin['Rank'] = 2 hobgoblin['Power'] = 16 hobgoblin['Defense'] = 4 hobgoblin['Life'] = 60 @@ -83,6 +88,9 @@ hobgoblin['XP'] = 14 hobgoblin['CoinFactor'] = 5 +goblinoidList.append(hobgoblin) +mobList.append(hobgoblin) + #Pets #Inhabited places hardcoded From e4d7424e8c01902ec718a23ab4206dc1a8b208d4 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Fri, 14 Feb 2025 13:19:20 +0100 Subject: [PATCH 19/40] WIP: added demons in monsters list --- precisions.txt | 16 +++++++++++++--- src/lists.py | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 57 insertions(+), 9 deletions(-) diff --git a/precisions.txt b/precisions.txt index 5c8da64..3b318e5 100644 --- a/precisions.txt +++ b/precisions.txt @@ -5,9 +5,19 @@ corrupted humans => will have some human origins and different levels and ranks corrupted elves => dark, high, wood, blood (unique to corrupted ones), crystal (crystal elves are elves imprisoned in stone by an ancient curse, end game enemy) corrupted dwarves => deep, high, forest, blood (same as elves counterpart), crystal (same) -vampire list : +pseudohumanoid list : +goblinoids => goblin, hobgoblin, goblin warrior, goblin lieutenant, goblin chief, goblin priest, goblin general, goblin king, goblin emperor +orcoids => orc, high orc, orc warrior, orc priest, orc chief, orc general, orc king +ogres => ogre, red ogre, green ogre, blue ogre, black ogre, white ogre, mutant ogre, demonic ogre -zombie list : +undead list : +vampire list => +zombie list => +ghost list => -ghost list : +demon list : +slimy list : +slime => slime (base), glutton slime, plant slime, carrion slime, poison slime, rocky slime, metal slime, crytal slime (base slime but can harden to protect itself), +mud => animated mud, muddy corpse (undead too) +gel => \ No newline at end of file diff --git a/src/lists.py b/src/lists.py index 64cb1e5..957f5a5 100644 --- a/src/lists.py +++ b/src/lists.py @@ -12,6 +12,18 @@ #Characters +#Base global Template +baseNPCTemplate = {} +baseNPCTemplate['Hostility'] = "Neutral" +baseNPCTemplate['Species'] = "Default" +baseNPCTemplate['Type'] = "Default" +baseNPCTemplate['Name'] = "Default" +baseNPCTemplate['Rank'] = 0 +baseNPCTemplate['Power'] = 0 +baseNPCTemplate['Defense'] = 0 +baseNPCTemplate['Life'] = 1 +baseNPCTemplate['MaxLife'] = 1 + #NPC human humanList = [] @@ -48,6 +60,9 @@ undeadList.append(zombieList) undeadList.append(ghostList) +#Demons +#Append in demons list + #Slimy slimyList = [] slimelist = [] @@ -55,16 +70,31 @@ slimyList.append(slimelist) #Individual monsters -#Goblins and Goblinoids + +#Global Template +baseMonster = {} +baseMonster['Hostility'] = "Hostile" +baseMonster['Species'] = "Default" +baseMonster['Type'] = "Monster" +baseMonster['Name'] = "Default" +baseMonster['Rank'] = 1 +baseMonster['Power'] = 0 +baseMonster['Defense'] = 0 +baseMonster['Life'] = 1 +baseMonster['MaxLife'] = 1 +baseMonster['XP'] = 0 +baseMonster['CoinFactor'] = 0 + +#Humanoids + +#Pseudo Humanoids + + #Goblins and Goblinoids goblinTemplate = {} +goblinTemplate['Species'] = "PseudoHumanoid" goblinTemplate['Type'] = "Goblinoid" goblinTemplate['Name'] = "Default" -goblinTemplate['Rank'] = 1 -goblinTemplate['Power'] = 0 -goblinTemplate['Defense'] = 0 -goblinTemplate['Life'] = 1 -goblinTemplate['MaxLife'] = 1 goblinTemplate['XP'] = 10 goblinTemplate['CoinFactor'] = 3 @@ -91,6 +121,14 @@ goblinoidList.append(hobgoblin) mobList.append(hobgoblin) +print(baseNPCTemplate) +print(baseMonster) +print(goblinTemplate) +print(goblin) +print(hobgoblin) + +#Undead + #Pets #Inhabited places hardcoded From dc471ec6b6c3d62981eb17dfe93b154e7db4b22f Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Fri, 14 Feb 2025 13:33:43 +0100 Subject: [PATCH 20/40] WIP: ihneritance tree functional for goblin type --- ideas.txt | 5 +++++ precisions.txt | 23 ++++++++++++++++++++++- src/lists.py | 36 ++++++++++++++++++------------------ 3 files changed, 45 insertions(+), 19 deletions(-) diff --git a/ideas.txt b/ideas.txt index d150bfd..4c8f3de 100644 --- a/ideas.txt +++ b/ideas.txt @@ -29,6 +29,11 @@ npc feature : random npc : names, surnames, nicknames, origin (country, continent, city), specialization (job, class), personalities make dictionaries for each characteristic +statistics feature : +add stats to character templates and definitions +differenciate main and secondary stats +derived stats formulas => + transform : dungeon function to have choice which then leads to other functions exploration function to be different depending on environment around villages diff --git a/precisions.txt b/precisions.txt index 3b318e5..16e9e2b 100644 --- a/precisions.txt +++ b/precisions.txt @@ -1,3 +1,5 @@ +LISTS : + human list : humanoid list : @@ -20,4 +22,23 @@ demon list : slimy list : slime => slime (base), glutton slime, plant slime, carrion slime, poison slime, rocky slime, metal slime, crytal slime (base slime but can harden to protect itself), mud => animated mud, muddy corpse (undead too) -gel => \ No newline at end of file +gel => + +STATS : + +main : + +add mana/max mana +add stamina/max stamina +add char stats => strength, dexterity, agility, vitality, energy, luck + +secondary : + +speed +masteries : weapons, armors, magic + +derived : + +flee factor => from agility +power => strength + weapon mastery + wweapon damage + skills + bonus +defense => armor mastery + skills + bonus \ No newline at end of file diff --git a/src/lists.py b/src/lists.py index 957f5a5..aec41de 100644 --- a/src/lists.py +++ b/src/lists.py @@ -72,18 +72,18 @@ #Individual monsters #Global Template -baseMonster = {} -baseMonster['Hostility'] = "Hostile" -baseMonster['Species'] = "Default" -baseMonster['Type'] = "Monster" -baseMonster['Name'] = "Default" -baseMonster['Rank'] = 1 -baseMonster['Power'] = 0 -baseMonster['Defense'] = 0 -baseMonster['Life'] = 1 -baseMonster['MaxLife'] = 1 -baseMonster['XP'] = 0 -baseMonster['CoinFactor'] = 0 +baseMonsterTemplate = copy.deepcopy(baseNPCTemplate) +baseMonsterTemplate['Hostility'] = "Hostile" +baseMonsterTemplate['Species'] = "Default" +baseMonsterTemplate['Type'] = "Monster" +baseMonsterTemplate['Name'] = "Default" +baseMonsterTemplate['Rank'] = 1 +baseMonsterTemplate['Power'] = 0 +baseMonsterTemplate['Defense'] = 0 +baseMonsterTemplate['Life'] = 1 +baseMonsterTemplate['MaxLife'] = 1 +baseMonsterTemplate['XP'] = 0 +baseMonsterTemplate['CoinFactor'] = 0 #Humanoids @@ -91,7 +91,7 @@ #Goblins and Goblinoids -goblinTemplate = {} +goblinTemplate = copy.deepcopy(baseMonsterTemplate) goblinTemplate['Species'] = "PseudoHumanoid" goblinTemplate['Type'] = "Goblinoid" goblinTemplate['Name'] = "Default" @@ -121,11 +121,11 @@ goblinoidList.append(hobgoblin) mobList.append(hobgoblin) -print(baseNPCTemplate) -print(baseMonster) -print(goblinTemplate) -print(goblin) -print(hobgoblin) +print("base NPC : ", baseNPCTemplate) +print("base monster : ", baseMonsterTemplate) +print("goblin template : ", goblinTemplate) +print("goblin : ", goblin) +print("hob : ", hobgoblin) #Undead From 8dbb4fa9c2b06a65ecb44269ab33098d088fb90d Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Fri, 14 Feb 2025 13:59:36 +0100 Subject: [PATCH 21/40] WIP: organized template lists and added origin lists --- src/lists.py | 156 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 95 insertions(+), 61 deletions(-) diff --git a/src/lists.py b/src/lists.py index aec41de..13ea405 100644 --- a/src/lists.py +++ b/src/lists.py @@ -9,27 +9,27 @@ mobSpeciesList = [] jobList = [] classList = [] +originHumanList = [] +originMonsterList = [] +cityList = [] +countryList = [] +continentList = [] +environmentTypeList = [] + +#Append origin sublists in main lists +originHumanList.append(cityList) +originHumanList.append(countryList) +originHumanList.append(continentList) +originMonsterList.append(environmentTypeList) #Characters -#Base global Template -baseNPCTemplate = {} -baseNPCTemplate['Hostility'] = "Neutral" -baseNPCTemplate['Species'] = "Default" -baseNPCTemplate['Type'] = "Default" -baseNPCTemplate['Name'] = "Default" -baseNPCTemplate['Rank'] = 0 -baseNPCTemplate['Power'] = 0 -baseNPCTemplate['Defense'] = 0 -baseNPCTemplate['Life'] = 1 -baseNPCTemplate['MaxLife'] = 1 - #NPC human humanList = [] #Monsters #Species and Races -#Humanoids + #Humanoids humanoidList = [] corruptedHumanList = [] corruptedElfList = [] @@ -39,7 +39,7 @@ humanoidList.append(corruptedElfList) humanoidList.append(corruptedDwarfList) -#Pseudhumanoids + #Pseudohumanoids pseudoHumanoidList = [] goblinoidList = [] orcoidList = [] @@ -49,7 +49,7 @@ pseudoHumanoidList.append(orcoidList) pseudoHumanoidList.append(ogreList) -#Undead + #Undead undeadList = [] vampireList = [] zombieList = [] @@ -60,18 +60,81 @@ undeadList.append(zombieList) undeadList.append(ghostList) -#Demons + #Demons #Append in demons list -#Slimy + #Slimy slimyList = [] slimelist = [] +mudList = [] +gelList = [] #Append in slimy list slimyList.append(slimelist) +slimyList.append(mudList) +slimyList.append(gelList) + + #Inhabited places hardcoded + + #Villages + + #Main cities + + #Dungeons + + #Subterranean + + #Overworld + + #Air placed + + #Other dimensions + + #Items + + #General items +itemList = [] + + #General categories +aidList = [] +weaponList = [] +armorList = [] + + #Precise categories + + #Weapons +swordList = [] +axeList = [] +spearList = [] +polearmList = [] +bowList = [] +crossbowList = [] + + + #Armors + + #Potions + +#General Templates + + #Base global NPC Template +baseNPCTemplate = {} +baseNPCTemplate['Hostility'] = "Neutral" +baseNPCTemplate['Species'] = "Default" +baseNPCTemplate['Type'] = "Default" +baseNPCTemplate['Name'] = "Default" +baseNPCTemplate['Rank'] = 0 +baseNPCTemplate['Power'] = 0 +baseNPCTemplate['Defense'] = 0 +baseNPCTemplate['Life'] = 1 +baseNPCTemplate['MaxLife'] = 1 - #Individual monsters + #Characters -#Global Template + #Human NPC Template +baseHumanNPCTemplate = {} +baseHumanNPCTemplate[''] = 0 + + #Monster Template baseMonsterTemplate = copy.deepcopy(baseNPCTemplate) baseMonsterTemplate['Hostility'] = "Hostile" baseMonsterTemplate['Species'] = "Default" @@ -85,11 +148,19 @@ baseMonsterTemplate['XP'] = 0 baseMonsterTemplate['CoinFactor'] = 0 -#Humanoids + #Monsters species + + #Humanoids + + #Pseudo Humanoids -#Pseudo Humanoids + #Monsters types - #Goblins and Goblinoids + #Humanoids + + #Pseudo Humanoids + + #Goblins and Goblinoids goblinTemplate = copy.deepcopy(baseMonsterTemplate) goblinTemplate['Species'] = "PseudoHumanoid" @@ -131,43 +202,6 @@ #Pets - #Inhabited places hardcoded - - #Villages - - #Main cities - - #Dungeons - - #Subterranean +#Definitions - #Overworld - - #Air placed - - #Other dimensions - - #Items - - #General items -itemList = [] - - #General categories -aidList = [] -weaponList = [] -armorList = [] - - #Precise categories - - #Weapons -swordList = [] -axeList = [] -spearList = [] -polearmList = [] -bowList = [] -crossbowList = [] - - - #Armors - - #Potions + #Characters \ No newline at end of file From 026a7adf79a9be2f0387abc40034a625057edd9b Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Fri, 14 Feb 2025 14:19:53 +0100 Subject: [PATCH 22/40] WIP: organized better the lists file + added characteristics to templates --- precisions.txt | 2 ++ src/lists.py | 93 ++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 74 insertions(+), 21 deletions(-) diff --git a/precisions.txt b/precisions.txt index 16e9e2b..af6e79f 100644 --- a/precisions.txt +++ b/precisions.txt @@ -24,6 +24,8 @@ slime => slime (base), glutton slime, plant slime, carrion slime, poison slime, mud => animated mud, muddy corpse (undead too) gel => +************************************************************************* + STATS : main : diff --git a/src/lists.py b/src/lists.py index 13ea405..5586521 100644 --- a/src/lists.py +++ b/src/lists.py @@ -3,19 +3,36 @@ #This file will contain all items lists that will be needed for the game -#General lists +################################################################################################# +# GENERAL LISTS # +################################################################################################# + speciesList = [] mobList = [] mobSpeciesList = [] + jobList = [] classList = [] + originHumanList = [] originMonsterList = [] + cityList = [] countryList = [] continentList = [] environmentTypeList = [] +mobPlainsList = [] +mobForestList = [] +mobCaveList = [] +mobDesertList = [] +mobSnowList = [] +mobMountainsList = [] +mobRiverList = [] +mobLakeList = [] +mobSeaList = [] +mobSkyList = [] + #Append origin sublists in main lists originHumanList.append(cityList) originHumanList.append(countryList) @@ -114,10 +131,13 @@ #Potions -#General Templates +################################################################################################# +# GENERAL TEMPLATES # +################################################################################################# #Base global NPC Template baseNPCTemplate = {} +baseNPCTemplate['Origin'] = "None" baseNPCTemplate['Hostility'] = "Neutral" baseNPCTemplate['Species'] = "Default" baseNPCTemplate['Type'] = "Default" @@ -130,21 +150,20 @@ #Characters - #Human NPC Template -baseHumanNPCTemplate = {} -baseHumanNPCTemplate[''] = 0 + #Human NPC Base Template +baseHumanNPCTemplate = copy.deepcopy(baseNPCTemplate) +baseHumanNPCTemplate['Origin'] = originHumanList[0] +baseNPCTemplate['Hostility'] = "Variable" +baseNPCTemplate['Species'] = "Human" +baseNPCTemplate['Type'] = "HumanRaceVarious" - #Monster Template + #Monster Base Template baseMonsterTemplate = copy.deepcopy(baseNPCTemplate) +baseMonsterTemplate['Origin'] = originMonsterList[0] baseMonsterTemplate['Hostility'] = "Hostile" baseMonsterTemplate['Species'] = "Default" baseMonsterTemplate['Type'] = "Monster" -baseMonsterTemplate['Name'] = "Default" baseMonsterTemplate['Rank'] = 1 -baseMonsterTemplate['Power'] = 0 -baseMonsterTemplate['Defense'] = 0 -baseMonsterTemplate['Life'] = 1 -baseMonsterTemplate['MaxLife'] = 1 baseMonsterTemplate['XP'] = 0 baseMonsterTemplate['CoinFactor'] = 0 @@ -165,7 +184,6 @@ goblinTemplate = copy.deepcopy(baseMonsterTemplate) goblinTemplate['Species'] = "PseudoHumanoid" goblinTemplate['Type'] = "Goblinoid" -goblinTemplate['Name'] = "Default" goblinTemplate['XP'] = 10 goblinTemplate['CoinFactor'] = 3 @@ -178,6 +196,7 @@ goblinoidList.append(goblin) mobList.append(goblin) +mobCaveList.append(goblin) hobgoblin = copy.deepcopy(goblinTemplate) hobgoblin['Name'] = "Hobgoblin" @@ -191,17 +210,49 @@ goblinoidList.append(hobgoblin) mobList.append(hobgoblin) +mobCaveList.append(hobgoblin) -print("base NPC : ", baseNPCTemplate) -print("base monster : ", baseMonsterTemplate) -print("goblin template : ", goblinTemplate) -print("goblin : ", goblin) -print("hob : ", hobgoblin) - -#Undead + #Undead #Pets -#Definitions +################################################################################################# +# DEFINITIONS # +################################################################################################# + + #Characters + + #Humans + + #Monsters + + #Humanoids + + #Pseudo Humanoids + + #Goblins and Goblinoids + +goblin = copy.deepcopy(goblinTemplate) +goblin['Name'] = "Goblin" +goblin['Power'] = 12 +goblin['Defense'] = 2 +goblin['Life'] = 50 +goblin['MaxLife'] = 50 + +goblinoidList.append(goblin) +mobList.append(goblin) +mobCaveList.append(goblin) + +hobgoblin = copy.deepcopy(goblinTemplate) +hobgoblin['Name'] = "Hobgoblin" +hobgoblin['Rank'] = 2 +hobgoblin['Power'] = 16 +hobgoblin['Defense'] = 4 +hobgoblin['Life'] = 60 +hobgoblin['MaxLife'] = 60 +hobgoblin['XP'] = 14 +hobgoblin['CoinFactor'] = 5 - #Characters \ No newline at end of file +goblinoidList.append(hobgoblin) +mobList.append(hobgoblin) +mobCaveList.append(hobgoblin) \ No newline at end of file From 3e05e9d862d6fc601c95315f4f264d58d9396528 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Tue, 18 Feb 2025 12:54:02 +0100 Subject: [PATCH 23/40] WIP: added idea -> damage types need specific characteristics ; added a living state for monsters specifically for undead efficient damage --- ideas.txt | 2 +- precisions.txt | 4 ++-- src/lists.py | 39 ++++++++++++--------------------------- 3 files changed, 15 insertions(+), 30 deletions(-) diff --git a/ideas.txt b/ideas.txt index 4c8f3de..3960f81 100644 --- a/ideas.txt +++ b/ideas.txt @@ -9,7 +9,7 @@ make semi random champions and elites spawns make around village exploration richer, find items, encounter merchants, being ambushed make choices done by key presses instead of typing a enter each time randomize some properties like power or health points -use deepcopy() to make templates and derive from that for individual monsters +make undead monsters have a living state instead of a specific species => abiity for damage types to be efficient against undead + original species save feature : save the boolean for creation and feeding of databases => python file or external file ? diff --git a/precisions.txt b/precisions.txt index af6e79f..4a05615 100644 --- a/precisions.txt +++ b/precisions.txt @@ -14,8 +14,8 @@ ogres => ogre, red ogre, green ogre, blue ogre, black ogre, white ogre, mutant o undead list : vampire list => -zombie list => -ghost list => +zombie list => +ghost list => demon list : diff --git a/src/lists.py b/src/lists.py index 5586521..51d881e 100644 --- a/src/lists.py +++ b/src/lists.py @@ -137,6 +137,7 @@ #Base global NPC Template baseNPCTemplate = {} +baseNPCTemplate['LivingState'] = "Living" baseNPCTemplate['Origin'] = "None" baseNPCTemplate['Hostility'] = "Neutral" baseNPCTemplate['Species'] = "Default" @@ -177,43 +178,27 @@ #Humanoids +humanoidTemplate = copy.deepcopy(baseMonsterTemplate) +humanoidTemplate['Species'] = "Humanoid" + #Pseudo Humanoids +pseudoHumanoidTemplate = copy.deepcopy(baseMonsterTemplate) +pseudoHumanoidTemplate['Species'] = "PseudoHumanoid" + #Goblins and Goblinoids -goblinTemplate = copy.deepcopy(baseMonsterTemplate) -goblinTemplate['Species'] = "PseudoHumanoid" +goblinTemplate = copy.deepcopy(pseudoHumanoidTemplate) goblinTemplate['Type'] = "Goblinoid" goblinTemplate['XP'] = 10 goblinTemplate['CoinFactor'] = 3 -goblin = copy.deepcopy(goblinTemplate) -goblin['Name'] = "Goblin" -goblin['Power'] = 12 -goblin['Defense'] = 2 -goblin['Life'] = 50 -goblin['MaxLife'] = 50 - -goblinoidList.append(goblin) -mobList.append(goblin) -mobCaveList.append(goblin) - -hobgoblin = copy.deepcopy(goblinTemplate) -hobgoblin['Name'] = "Hobgoblin" -hobgoblin['Rank'] = 2 -hobgoblin['Power'] = 16 -hobgoblin['Defense'] = 4 -hobgoblin['Life'] = 60 -hobgoblin['MaxLife'] = 60 -hobgoblin['XP'] = 14 -hobgoblin['CoinFactor'] = 5 - -goblinoidList.append(hobgoblin) -mobList.append(hobgoblin) -mobCaveList.append(hobgoblin) - #Undead +undeadTemplate = copy.deepcopy(baseMonsterTemplate) +baseNPCTemplate['LivingState'] = "Undead" +undeadTemplate['Species'] = "Default" + #Pets ################################################################################################# From e57cc8de2b5d25e25fe33ec7a0e61cfcc4f7e1b9 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Tue, 18 Feb 2025 13:26:55 +0100 Subject: [PATCH 24/40] WIP: lists progress, added stats for stamina and mana + regeneration, added ideas --- ideas.txt | 4 +++- precisions.txt | 4 ++++ src/lists.py | 17 +++++++++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ideas.txt b/ideas.txt index 3960f81..a4058d6 100644 --- a/ideas.txt +++ b/ideas.txt @@ -2,7 +2,7 @@ features : make different areas for start merchants -make flee chance dependent on mob with a parameter (eg : speed or agility) +make flee chance dependent on mob with a parameter (eg : speed or agility) + stamina left make quests procedurally generated make floors for the dungeon with floor bosses make semi random champions and elites spawns @@ -10,6 +10,7 @@ make around village exploration richer, find items, encounter merchants, being a make choices done by key presses instead of typing a enter each time randomize some properties like power or health points make undead monsters have a living state instead of a specific species => abiity for damage types to be efficient against undead + original species +find a ay to use ranks but differenciate numeral ranks from letter ranks save feature : save the boolean for creation and feeding of databases => python file or external file ? @@ -18,6 +19,7 @@ save characters by player and one folder containing all the save file for each p exploration feature : integration wanted : exploration => combat OR merchant OR find item OR find place... make a small random to have events playing in the dungeon such as find an item, see a monster and decide to attack or not, find a chest, a hidden way, or a trap +make a counter in case randomness chooses too many times in a row the same monster (store monster name, increment counter, if counter > x then choose another monster) combat feature : make combat decisions based on character class diff --git a/precisions.txt b/precisions.txt index 4a05615..1a7f7f6 100644 --- a/precisions.txt +++ b/precisions.txt @@ -33,6 +33,10 @@ main : add mana/max mana add stamina/max stamina add char stats => strength, dexterity, agility, vitality, energy, luck +add regeneration for life, stamina and mana, based on class or monster species/type +notes : +=> for certain monsters life regen is not 0 (vampire ?) +=> life regen might be negative for some undead secondary : diff --git a/src/lists.py b/src/lists.py index 51d881e..b824a23 100644 --- a/src/lists.py +++ b/src/lists.py @@ -148,6 +148,13 @@ baseNPCTemplate['Defense'] = 0 baseNPCTemplate['Life'] = 1 baseNPCTemplate['MaxLife'] = 1 +baseNPCTemplate['LifeRegeneration'] = 0 +baseNPCTemplate['Stamina'] = 1 +baseNPCTemplate['MaxStamina'] = 1 +baseNPCTemplate['StaminaRegeneration'] = 2 +baseNPCTemplate['Mana'] = 0 +baseNPCTemplate['MaxMana'] = 0 +baseNPCTemplate['ManaRegeneration'] = 1 #Characters @@ -190,6 +197,7 @@ goblinTemplate = copy.deepcopy(pseudoHumanoidTemplate) goblinTemplate['Type'] = "Goblinoid" +baseNPCTemplate['ManaRegeneration'] = 0 goblinTemplate['XP'] = 10 goblinTemplate['CoinFactor'] = 3 @@ -197,7 +205,6 @@ undeadTemplate = copy.deepcopy(baseMonsterTemplate) baseNPCTemplate['LivingState'] = "Undead" -undeadTemplate['Species'] = "Default" #Pets @@ -223,10 +230,13 @@ goblin['Defense'] = 2 goblin['Life'] = 50 goblin['MaxLife'] = 50 +goblin['Stamina'] = 10 +goblin['MaxStamina'] = 10 goblinoidList.append(goblin) mobList.append(goblin) mobCaveList.append(goblin) +mobForestList.append(goblin) hobgoblin = copy.deepcopy(goblinTemplate) hobgoblin['Name'] = "Hobgoblin" @@ -235,9 +245,12 @@ hobgoblin['Defense'] = 4 hobgoblin['Life'] = 60 hobgoblin['MaxLife'] = 60 +hobgoblin['Stamina'] = 15 +hobgoblin['MaxStamina'] = 15 hobgoblin['XP'] = 14 hobgoblin['CoinFactor'] = 5 goblinoidList.append(hobgoblin) mobList.append(hobgoblin) -mobCaveList.append(hobgoblin) \ No newline at end of file +mobCaveList.append(hobgoblin) +mobForestList.append(hobgoblin) \ No newline at end of file From 68d895ddabd79ccac417ac04046d22ca3ca698f1 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Tue, 18 Feb 2025 14:13:44 +0100 Subject: [PATCH 25/40] WIP: added some monster templates + added idea for frequencies of encounters --- ideas.txt | 1 + src/lists.py | 27 +++++++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ideas.txt b/ideas.txt index a4058d6..37ccbbd 100644 --- a/ideas.txt +++ b/ideas.txt @@ -20,6 +20,7 @@ exploration feature : integration wanted : exploration => combat OR merchant OR find item OR find place... make a small random to have events playing in the dungeon such as find an item, see a monster and decide to attack or not, find a chest, a hidden way, or a trap make a counter in case randomness chooses too many times in a row the same monster (store monster name, increment counter, if counter > x then choose another monster) +OR implement dictionaries to have monster frequencies combat feature : make combat decisions based on character class diff --git a/src/lists.py b/src/lists.py index b824a23..bb41e09 100644 --- a/src/lists.py +++ b/src/lists.py @@ -193,13 +193,22 @@ pseudoHumanoidTemplate = copy.deepcopy(baseMonsterTemplate) pseudoHumanoidTemplate['Species'] = "PseudoHumanoid" - #Goblins and Goblinoids + #Goblinoids goblinTemplate = copy.deepcopy(pseudoHumanoidTemplate) goblinTemplate['Type'] = "Goblinoid" -baseNPCTemplate['ManaRegeneration'] = 0 -goblinTemplate['XP'] = 10 -goblinTemplate['CoinFactor'] = 3 +goblinTemplate['ManaRegeneration'] = 0 + + #Orcoids +orcTemplate = copy.deepcopy(pseudoHumanoidTemplate) +orcTemplate['Type'] = "Orcoid" +orcTemplate['ManaRegeneration'] = 0 + + #Ogre likes +ogreTemplate = copy.deepcopy(pseudoHumanoidTemplate) +ogreTemplate['Type'] = "Orcoid" +ogreTemplate['ManaRegeneration'] = 0 + #Undead @@ -222,7 +231,7 @@ #Pseudo Humanoids - #Goblins and Goblinoids + #Goblins goblin = copy.deepcopy(goblinTemplate) goblin['Name'] = "Goblin" @@ -232,6 +241,8 @@ goblin['MaxLife'] = 50 goblin['Stamina'] = 10 goblin['MaxStamina'] = 10 +goblin['XP'] = 10 +goblin['CoinFactor'] = 3 goblinoidList.append(goblin) mobList.append(goblin) @@ -253,4 +264,8 @@ goblinoidList.append(hobgoblin) mobList.append(hobgoblin) mobCaveList.append(hobgoblin) -mobForestList.append(hobgoblin) \ No newline at end of file +mobForestList.append(hobgoblin) + + #Orcoids + + #Ogres \ No newline at end of file From b2dc29f11f3558f4f9f0efa1d95201a7907a1004 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Tue, 18 Feb 2025 17:50:20 +0100 Subject: [PATCH 26/40] WIP: precised more lists and indications --- precisions.txt | 3 ++- src/lists.py | 22 ++++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/precisions.txt b/precisions.txt index 1a7f7f6..07ec6dc 100644 --- a/precisions.txt +++ b/precisions.txt @@ -20,7 +20,8 @@ ghost list => demon list : slimy list : -slime => slime (base), glutton slime, plant slime, carrion slime, poison slime, rocky slime, metal slime, crytal slime (base slime but can harden to protect itself), +slime => slime (base), glutton slime, plant slime, carrion slime, poison slime, rocky slime, metal slime, crytal slime (base slime but can harden to protect itself), +mana slime (mana fluid charged base slime) mud => animated mud, muddy corpse (undead too) gel => diff --git a/src/lists.py b/src/lists.py index bb41e09..cd5d974 100644 --- a/src/lists.py +++ b/src/lists.py @@ -184,17 +184,14 @@ #Monsters types #Humanoids - humanoidTemplate = copy.deepcopy(baseMonsterTemplate) humanoidTemplate['Species'] = "Humanoid" #Pseudo Humanoids - pseudoHumanoidTemplate = copy.deepcopy(baseMonsterTemplate) pseudoHumanoidTemplate['Species'] = "PseudoHumanoid" #Goblinoids - goblinTemplate = copy.deepcopy(pseudoHumanoidTemplate) goblinTemplate['Type'] = "Goblinoid" goblinTemplate['ManaRegeneration'] = 0 @@ -209,11 +206,24 @@ ogreTemplate['Type'] = "Orcoid" ogreTemplate['ManaRegeneration'] = 0 - #Undead - undeadTemplate = copy.deepcopy(baseMonsterTemplate) -baseNPCTemplate['LivingState'] = "Undead" +undeadTemplate['LivingState'] = "Undead" +undeadTemplate['ManaRegeneration'] = 0 + + #Vampires + #Zombies + #Ghosts + #Other undead monsters - can be anything for particular situations + + #Slimy +slimyTemplate = copy.deepcopy(baseMonsterTemplate) +slimyTemplate['Species'] = "Slimy" +slimyTemplate['ManaRegeneration'] = 0 + + #Slimes +slimeTemplate = copy.deepcopy(slimyTemplate) +slimeTemplate['Type'] = "Slime" #Pets From 0766be0be0fbfa01d97ecf2b5891f78d0d3d3677 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Wed, 19 Feb 2025 12:57:38 +0100 Subject: [PATCH 27/40] WIP: lists updated with detailed dictionaries for human origin and environment types --- ideas.txt | 3 ++- src/lists.py | 42 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/ideas.txt b/ideas.txt index 37ccbbd..8cc4205 100644 --- a/ideas.txt +++ b/ideas.txt @@ -10,7 +10,7 @@ make around village exploration richer, find items, encounter merchants, being a make choices done by key presses instead of typing a enter each time randomize some properties like power or health points make undead monsters have a living state instead of a specific species => abiity for damage types to be efficient against undead + original species -find a ay to use ranks but differenciate numeral ranks from letter ranks +find a way to use ranks but differenciate numeral ranks from letter ranks save feature : save the boolean for creation and feeding of databases => python file or external file ? @@ -21,6 +21,7 @@ integration wanted : exploration => combat OR merchant OR find item OR find plac make a small random to have events playing in the dungeon such as find an item, see a monster and decide to attack or not, find a chest, a hidden way, or a trap make a counter in case randomness chooses too many times in a row the same monster (store monster name, increment counter, if counter > x then choose another monster) OR implement dictionaries to have monster frequencies +OR keep the list and make a dictionary with a zip against a list of frequencies combat feature : make combat decisions based on character class diff --git a/src/lists.py b/src/lists.py index cd5d974..2504fd7 100644 --- a/src/lists.py +++ b/src/lists.py @@ -14,24 +14,58 @@ jobList = [] classList = [] -originHumanList = [] -originMonsterList = [] - cityList = [] countryList = [] continentList = [] environmentTypeList = [] +originHumanList = [] +originHumanDict = { + 'City': cityList, + 'Country': countryList, + 'Continent': continentList +} +originMonsterList = [] + mobPlainsList = [] +modPlainsFrequencyList = [] +mobPlainsDict = {} + mobForestList = [] +mobForestFrequencyList = [] +mobForestDict = {} + mobCaveList = [] +mobCaveFrequencyList = [] +mobCaveDict = {} + mobDesertList = [] +mobDesertFrequencyList = [] +mobDesertDict = {} + mobSnowList = [] +mobSnowFrequencyList = [] +modSnowDict = {} + mobMountainsList = [] +mobMountainsFrequencyList = [] +mobMountainsDict = {} + mobRiverList = [] +mobRiverFrequencyList = [] +mobRiverDict = {} + mobLakeList = [] +mobLakeFrequencyList = [] +mobLakeDict = {} + mobSeaList = [] +mobSeaFrequencyList = [] +mobSeaDict = {} + mobSkyList = [] +mobSkyFrequencyList = [] +mobSkyDict = {} #Append origin sublists in main lists originHumanList.append(cityList) @@ -39,6 +73,8 @@ originHumanList.append(continentList) originMonsterList.append(environmentTypeList) +originMonsterList.append(continentList) + #Characters #NPC human From f4cd2e047214deb0d845709da30c26a17391415b Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Wed, 19 Feb 2025 13:17:39 +0100 Subject: [PATCH 28/40] WIP: noted few idead + revamped some lists + made new dictionaries --- ideas.txt | 1 + src/lists.py | 38 ++++++++++++++++++++++++++++++-------- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/ideas.txt b/ideas.txt index 8cc4205..e18ee23 100644 --- a/ideas.txt +++ b/ideas.txt @@ -11,6 +11,7 @@ make choices done by key presses instead of typing a enter each time randomize some properties like power or health points make undead monsters have a living state instead of a specific species => abiity for damage types to be efficient against undead + original species find a way to use ranks but differenciate numeral ranks from letter ranks +make a random name (composed of syllabs) engine for village names save feature : save the boolean for creation and feeding of databases => python file or external file ? diff --git a/src/lists.py b/src/lists.py index 2504fd7..1e58e48 100644 --- a/src/lists.py +++ b/src/lists.py @@ -14,17 +14,23 @@ jobList = [] classList = [] -cityList = [] -countryList = [] continentList = [] +countryList = [] +allCitiesList = [] +majorCitiesList = [] +cityList = [] +villageNamesList = [] environmentTypeList = [] +#Assigning major cities to their country +cityDict = {} +#for of loop + +#Assigning countries to their continent +countryDict = {} +#for of loop + originHumanList = [] -originHumanDict = { - 'City': cityList, - 'Country': countryList, - 'Continent': continentList -} originMonsterList = [] mobPlainsList = [] @@ -67,14 +73,30 @@ mobSkyFrequencyList = [] mobSkyDict = {} -#Append origin sublists in main lists +#Append origin sublists in main lists and dictionaries originHumanList.append(cityList) originHumanList.append(countryList) originHumanList.append(continentList) originMonsterList.append(environmentTypeList) +allCitiesList.append(majorCitiesList) +allCitiesList.append(cityList) +allCitiesList.append(villageNamesList) + originMonsterList.append(continentList) +originHumanDict = { + 'City': cityList[0], + 'Country': countryList[0], + 'Continent': continentList[0] +} + +originHumanRandomDict = { #make it so the country is corresponding + 'City': random.choice(allCitiesList), + 'Country': random.choice(countryList), + 'Continent': random.choice(continentList) +} + #Characters #NPC human From 6f65dbc444d2eb68ed86f2b428436782877cbbeb Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Wed, 19 Feb 2025 13:58:02 +0100 Subject: [PATCH 29/40] WIP: noted ideas + redefined the way human origin will be given --- ideas.txt | 1 + precisions.txt | 8 ++++++++ src/lists.py | 8 ++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ideas.txt b/ideas.txt index e18ee23..7b68fed 100644 --- a/ideas.txt +++ b/ideas.txt @@ -12,6 +12,7 @@ randomize some properties like power or health points make undead monsters have a living state instead of a specific species => abiity for damage types to be efficient against undead + original species find a way to use ranks but differenciate numeral ranks from letter ranks make a random name (composed of syllabs) engine for village names +make defined major NPC in a list but make random npc register by characters so it randomizes for every player save feature : save the boolean for creation and feeding of databases => python file or external file ? diff --git a/precisions.txt b/precisions.txt index 07ec6dc..586c32c 100644 --- a/precisions.txt +++ b/precisions.txt @@ -25,6 +25,14 @@ mana slime (mana fluid charged base slime) mud => animated mud, muddy corpse (undead too) gel => +animal list : + + +insectoid list : + + +vegetal list : + ************************************************************************* STATS : diff --git a/src/lists.py b/src/lists.py index 1e58e48..a376189 100644 --- a/src/lists.py +++ b/src/lists.py @@ -74,7 +74,7 @@ mobSkyDict = {} #Append origin sublists in main lists and dictionaries -originHumanList.append(cityList) +originHumanList.append(allCitiesList) originHumanList.append(countryList) originHumanList.append(continentList) originMonsterList.append(environmentTypeList) @@ -91,6 +91,10 @@ 'Continent': continentList[0] } +#Idea for the corresponding country and continent for each preceding entity +#make major cities correspond to a country, each country to a continent, then +#make the random choice catch the corresponding value and pass it to the dictionary + originHumanRandomDict = { #make it so the country is corresponding 'City': random.choice(allCitiesList), 'Country': random.choice(countryList), @@ -99,7 +103,7 @@ #Characters - #NPC human + #NPC human - major defined NPC only humanList = [] #Monsters From 7ca4a49d2d5bedad87910ce36675c6f5850ed0da Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Wed, 19 Feb 2025 17:03:40 +0100 Subject: [PATCH 30/40] WIP: updated lists file + prepared environment types templates --- src/lists.py | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/src/lists.py b/src/lists.py index a376189..32dcb03 100644 --- a/src/lists.py +++ b/src/lists.py @@ -22,6 +22,18 @@ villageNamesList = [] environmentTypeList = [] +environmentTypeList.append("Plains") +environmentTypeList.append("Savanna") +environmentTypeList.append("Forest") +environmentTypeList.append("Cave") +environmentTypeList.append("Desert") +environmentTypeList.append("Snow") +environmentTypeList.append("Mountains") +environmentTypeList.append("River") +environmentTypeList.append("Lake") +environmentTypeList.append("Sea") +environmentTypeList.append("Sky") + #Assigning major cities to their country cityDict = {} #for of loop @@ -37,6 +49,10 @@ modPlainsFrequencyList = [] mobPlainsDict = {} +mobSavannaList = [] +modSavannaFrequencyList = [] +mobSavannaDict = {} + mobForestList = [] mobForestFrequencyList = [] mobForestDict = {} @@ -287,8 +303,44 @@ slimeTemplate = copy.deepcopy(slimyTemplate) slimeTemplate['Type'] = "Slime" + #Muddies - Muds +mudTemplate = copy.deepcopy(slimyTemplate) +mudTemplate['Type'] = "Mud" + + #Gels +gelTemplate = copy.deepcopy(slimyTemplate) +gelTemplate['Type'] = "Gel" + #Pets + #Environment Types + + #General Template + + + #Plains + + #Savanna + + #Forest + + #Cave + + #Desert + + #Snow + + #Mountains + + #River + + #Lake + + #Sea + + #Sky + + ################################################################################################# # DEFINITIONS # ################################################################################################# @@ -340,4 +392,41 @@ #Orcoids - #Ogres \ No newline at end of file + #Ogre likes + + #Undead + + #Vampires + #Zombies + #Ghosts + #Other undead monsters - can be anything for particular situations + + #Slimy + + #Slimes + +slime = copy.deepcopy(slimeTemplate) +slime['Name'] = "Slime" +slime['Power'] = 1 +slime['Defense'] = 0 +slime['Life'] = 4 +slime['MaxLife'] = 4 +slime['Stamina'] = 4 +slime['MaxStamina'] = 4 +slime['XP'] = 1 +slime['CoinFactor'] = 0.5 + +slimelist.append(slime) +mobList.append(slime) +mobCaveList.append(slime) +mobPlainsList.append(slime) + + #Muddies - Muds + #Gels + + #Pets + +################################################################################################# +# DICTIONARIES REFORMING # +################################################################################################# + From ccb86affa96f6389f0af000f87342397bca75aa3 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Wed, 19 Feb 2025 17:59:49 +0100 Subject: [PATCH 31/40] WIP: added climatic events in previsions + environment types ltemplate created with that in mind --- ideas.txt | 1 + src/lists.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ideas.txt b/ideas.txt index 7b68fed..4a9a173 100644 --- a/ideas.txt +++ b/ideas.txt @@ -24,6 +24,7 @@ make a small random to have events playing in the dungeon such as find an item, make a counter in case randomness chooses too many times in a row the same monster (store monster name, increment counter, if counter > x then choose another monster) OR implement dictionaries to have monster frequencies OR keep the list and make a dictionary with a zip against a list of frequencies +make environment types have a certain difficulty factor : for monsters that appear and climatic events like sandstorms or snow storms, floods... for random funny events combat feature : make combat decisions based on character class diff --git a/src/lists.py b/src/lists.py index 32dcb03..9af1fce 100644 --- a/src/lists.py +++ b/src/lists.py @@ -316,7 +316,11 @@ #Environment Types #General Template - +environmentBaseTemplate = {} +environmentBaseTemplate['Type'] = "Default" +environmentBaseTemplate['WorldLocation'] = "CardinalPoint" +environmentBaseTemplate['Fauna'] = "CorrespondingList" +environmentBaseTemplate['DifficultyFactor'] = 0 #Plains From 338882af788b32b5fcb56f10b01ed2dd8889b341 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Thu, 20 Feb 2025 09:16:31 +0100 Subject: [PATCH 32/40] fix: fixed some dictionary wrong key names --- .../database_connection.cpython-313.pyc | Bin 1188 -> 1183 bytes src/__pycache__/database_feed.cpython-313.pyc | Bin 2637 -> 2632 bytes src/lists.py | 19 ++++++++++-------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/__pycache__/database_connection.cpython-313.pyc b/src/__pycache__/database_connection.cpython-313.pyc index cbaaf66bec5311788c1757fb82e93bfab1cbe1f7..06b8fe4e31d09c8423a6e9f249619d2e4ee2b2ae 100644 GIT binary patch delta 40 ucmZ3&IiHjJGcPX}0}upfZ#HE-kJ<;(!_>J7*M delta 45 zcmbQwxrCGZGcPX}0}xoYt(nMuSJW@rDkiizwWv6zv?MbpvpBINwX|sCkLAn&Kco;e diff --git a/src/__pycache__/database_feed.cpython-313.pyc b/src/__pycache__/database_feed.cpython-313.pyc index 9d4c73b9146a48e279e172a198bdd95ec7c83d2a..e36f30686f01de7ad8d0bc54a8d690810ce3ada0 100644 GIT binary patch delta 42 wcmX>razcdrGcPX}0}upfZ`jD)%_QLLY!wq)oLW>I6P8()nVPqGHPa$?01pZcs{jB1 delta 47 zcmX>ha#n=IQ(BUllUbZtl3H4{c^T6pb^v1o B5G?=z diff --git a/src/lists.py b/src/lists.py index 9af1fce..ef7f64b 100644 --- a/src/lists.py +++ b/src/lists.py @@ -1,4 +1,4 @@ -import random, math, sys, copy +import random, copy from database_feed import * #This file will contain all items lists that will be needed for the game @@ -239,9 +239,11 @@ #Human NPC Base Template baseHumanNPCTemplate = copy.deepcopy(baseNPCTemplate) baseHumanNPCTemplate['Origin'] = originHumanList[0] -baseNPCTemplate['Hostility'] = "Variable" -baseNPCTemplate['Species'] = "Human" -baseNPCTemplate['Type'] = "HumanRaceVarious" +baseHumanNPCTemplate['Hostility'] = "Variable" +baseHumanNPCTemplate['Species'] = "Human" +baseHumanNPCTemplate['Type'] = "HumanRaceVarious" +baseHumanNPCTemplate['CoinFactorHuman'] = 0 +baseHumanNPCTemplate['XPHuman'] = 0 #Monster Base Template baseMonsterTemplate = copy.deepcopy(baseNPCTemplate) @@ -250,8 +252,9 @@ baseMonsterTemplate['Species'] = "Default" baseMonsterTemplate['Type'] = "Monster" baseMonsterTemplate['Rank'] = 1 +baseMonsterTemplate['CoinFactorSpecies'] = 0 +baseMonsterTemplate['CoinFactorType'] = 0 baseMonsterTemplate['XP'] = 0 -baseMonsterTemplate['CoinFactor'] = 0 #Monsters species @@ -370,7 +373,7 @@ goblin['Stamina'] = 10 goblin['MaxStamina'] = 10 goblin['XP'] = 10 -goblin['CoinFactor'] = 3 +goblin['CoinFactorSpecies'] = 3 goblinoidList.append(goblin) mobList.append(goblin) @@ -387,7 +390,7 @@ hobgoblin['Stamina'] = 15 hobgoblin['MaxStamina'] = 15 hobgoblin['XP'] = 14 -hobgoblin['CoinFactor'] = 5 +hobgoblin['CoinFactorSpecies'] = 5 goblinoidList.append(hobgoblin) mobList.append(hobgoblin) @@ -418,7 +421,7 @@ slime['Stamina'] = 4 slime['MaxStamina'] = 4 slime['XP'] = 1 -slime['CoinFactor'] = 0.5 +slime['CoinFactorSpecies'] = 0.5 slimelist.append(slime) mobList.append(slime) From b7eed3f19e3fbfe0728558a51e849b3bcb0da9d3 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Thu, 20 Feb 2025 11:52:10 +0100 Subject: [PATCH 33/40] WIP feat: implemented new way to calculate coins and XP points for humans and monsters --- src/lists.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/lists.py b/src/lists.py index ef7f64b..4548118 100644 --- a/src/lists.py +++ b/src/lists.py @@ -234,6 +234,10 @@ baseNPCTemplate['MaxMana'] = 0 baseNPCTemplate['ManaRegeneration'] = 1 +#Variables for XP and coins +valueFactorHuman = 20 +valueFactorMonster = 30 + #Characters #Human NPC Base Template @@ -242,8 +246,19 @@ baseHumanNPCTemplate['Hostility'] = "Variable" baseHumanNPCTemplate['Species'] = "Human" baseHumanNPCTemplate['Type'] = "HumanRaceVarious" -baseHumanNPCTemplate['CoinFactorHuman'] = 0 -baseHumanNPCTemplate['XPHuman'] = 0 +baseHumanNPCTemplate['CoinFactorHuman'] = valueFactorHuman * 1.5 * baseHumanNPCTemplate['Rank'] +baseHumanNPCTemplate['CoinFactorArena'] = valueFactorHuman * 2.5 * (1 + baseHumanNPCTemplate['Rank']) +baseHumanNPCTemplate['CoinFactor'] = 0 +baseHumanNPCTemplate['XPHuman'] = valueFactorHuman * 1.2 * (1 + baseHumanNPCTemplate['Rank']) + + #Human in general context +generalHumanNPCTemplate = copy.deepcopy(baseHumanNPCTemplate) +generalHumanNPCTemplate['CoinFactor'] = generalHumanNPCTemplate['CoinFactorHuman'] + + #Human in arena context +arenaHumanNPCTemplate = copy.deepcopy(baseHumanNPCTemplate) +arenaHumanNPCTemplate['CoinFactor'] = arenaHumanNPCTemplate['CoinFactorArena'] + #Monster Base Template baseMonsterTemplate = copy.deepcopy(baseNPCTemplate) @@ -252,9 +267,10 @@ baseMonsterTemplate['Species'] = "Default" baseMonsterTemplate['Type'] = "Monster" baseMonsterTemplate['Rank'] = 1 -baseMonsterTemplate['CoinFactorSpecies'] = 0 -baseMonsterTemplate['CoinFactorType'] = 0 -baseMonsterTemplate['XP'] = 0 +baseMonsterTemplate['CoinFactorSpecies'] = valueFactorMonster * 1.2 * baseMonsterTemplate['Rank'] +baseMonsterTemplate['CoinFactorType'] = valueFactorMonster * 1.4 * baseMonsterTemplate['Rank'] +baseMonsterTemplate['CoinFactor'] = 0 +baseMonsterTemplate['XP'] = valueFactorMonster * 1.3 * baseMonsterTemplate['Rank'] #Monsters species From 0fa2553fe8ad2632cb1bc3cf4e58eec3d4cce399 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Thu, 20 Feb 2025 16:57:52 +0100 Subject: [PATCH 34/40] WIP: ideas added, precisions updated --- ideas.txt | 5 ++++- precisions.txt | 40 ++++++++++++++++++++++++++++++++-------- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/ideas.txt b/ideas.txt index 4a9a173..ca0d64c 100644 --- a/ideas.txt +++ b/ideas.txt @@ -1,7 +1,7 @@ features : make different areas for start -merchants +random merchants make flee chance dependent on mob with a parameter (eg : speed or agility) + stamina left make quests procedurally generated make floors for the dungeon with floor bosses @@ -13,6 +13,7 @@ make undead monsters have a living state instead of a specific species => abiity find a way to use ranks but differenciate numeral ranks from letter ranks make a random name (composed of syllabs) engine for village names make defined major NPC in a list but make random npc register by characters so it randomizes for every player +add a tag system to make specific damage easier : dictionary of tags inside the dictionary of each template and definition save feature : save the boolean for creation and feeding of databases => python file or external file ? @@ -31,6 +32,8 @@ make combat decisions based on character class make subfunctions for combat turns so I can decide for initiative from the player or from the monster make another function for choosen combat when the exploration function gives the monster itself, which will call subfunctions make an arena system with opponent lists (raised monsters, human classes) with another combat function called arena +make a combat loop or partial loop for the arena to be able to alter coins and XP gains +humans have a specific arena characteristic for coins because there will be clandestine arena battles in the wild npc feature : random npc : names, surnames, nicknames, origin (country, continent, city), specialization (job, class), personalities diff --git a/precisions.txt b/precisions.txt index 586c32c..93700bd 100644 --- a/precisions.txt +++ b/precisions.txt @@ -6,6 +6,7 @@ humanoid list : corrupted humans => will have some human origins and different levels and ranks corrupted elves => dark, high, wood, blood (unique to corrupted ones), crystal (crystal elves are elves imprisoned in stone by an ancient curse, end game enemy) corrupted dwarves => deep, high, forest, blood (same as elves counterpart), crystal (same) +beastmen => centaur, lizardman, wolfman, foxman, tigerman, lionman, dogman, catman, goatman, cowman pseudohumanoid list : goblinoids => goblin, hobgoblin, goblin warrior, goblin lieutenant, goblin chief, goblin priest, goblin general, goblin king, goblin emperor @@ -14,10 +15,23 @@ ogres => ogre, red ogre, green ogre, blue ogre, black ogre, white ogre, mutant o undead list : vampire list => -zombie list => -ghost list => +zombie list => zombie, ghoul, plant zombie (corpse invaded by plants), zombie beast, lich, archlich, dracolich +skeleton list => skeleton, skeleton warrior, skeleton mage, skeleton knight, skeleton general, skeletal beast, skeletal demon, skeletal dragon +ghost list => dead spirit, ghost, demon list : +demonic beast => demonic animal (choose species), +lesser demon => imp, great imp, +medium demon => +greater demon => +high demon => +lords => +archdemon => + +spirit list : +elemental => nymph, djinn, +magic => djinn, +divine => djinn (named), Sylphide (wind), Callypso (water), Ifrit (fire), slimy list : slime => slime (base), glutton slime, plant slime, carrion slime, poison slime, rocky slime, metal slime, crytal slime (base slime but can harden to protect itself), @@ -25,13 +39,25 @@ mana slime (mana fluid charged base slime) mud => animated mud, muddy corpse (undead too) gel => -animal list : - +beast list : +animal => +deformed animal => +animal spirit => insectoid list : - +flying => +creeping => +digging => vegetal list : +plants => carnivorous plant, +plant spirit => + +dragon list : +wyvern => +real dragon => +draconoid (small dragons or manlike dragons who cannot talk) => +dracohuman (diluted blooded dragons with humans) => ************************************************************************* @@ -39,9 +65,7 @@ STATS : main : -add mana/max mana -add stamina/max stamina -add char stats => strength, dexterity, agility, vitality, energy, luck +add char stats => strength, dexterity, agility, vitality, energy, luck => dictionary ? add regeneration for life, stamina and mana, based on class or monster species/type notes : => for certain monsters life regen is not 0 (vampire ?) From 14ab99da32577c17912967a4ef7c11438b1001ff Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Sat, 3 May 2025 23:11:36 +0200 Subject: [PATCH 35/40] WIP: pushing a new idea just to save it --- ideas.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ideas.txt b/ideas.txt index ca0d64c..1ea5109 100644 --- a/ideas.txt +++ b/ideas.txt @@ -20,7 +20,7 @@ save the boolean for creation and feeding of databases => python file or externa save characters by player and one folder containing all the save file for each player exploration feature : -integration wanted : exploration => combat OR merchant OR find item OR find place... +integration wanted : exploration => combat OR merchant OR find item OR find place OR find tumb with epitaphs or items... make a small random to have events playing in the dungeon such as find an item, see a monster and decide to attack or not, find a chest, a hidden way, or a trap make a counter in case randomness chooses too many times in a row the same monster (store monster name, increment counter, if counter > x then choose another monster) OR implement dictionaries to have monster frequencies From 0b900ba46ca1745dcd8c50db36933cb4a8030593 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Tue, 16 Sep 2025 08:54:58 +0200 Subject: [PATCH 36/40] chore: renaming files --- src/{rpg-simple.py => main_script.py} | 0 src/{testrpg.py => test_script.py} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/{rpg-simple.py => main_script.py} (100%) rename src/{testrpg.py => test_script.py} (100%) diff --git a/src/rpg-simple.py b/src/main_script.py similarity index 100% rename from src/rpg-simple.py rename to src/main_script.py diff --git a/src/testrpg.py b/src/test_script.py similarity index 100% rename from src/testrpg.py rename to src/test_script.py From 99f1408ea916273101c98c7f61ab0cbba4b37553 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Tue, 16 Sep 2025 08:55:17 +0200 Subject: [PATCH 37/40] adding to ideas --- ideas.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/ideas.txt b/ideas.txt index 1ea5109..1ac1092 100644 --- a/ideas.txt +++ b/ideas.txt @@ -14,6 +14,7 @@ find a way to use ranks but differenciate numeral ranks from letter ranks make a random name (composed of syllabs) engine for village names make defined major NPC in a list but make random npc register by characters so it randomizes for every player add a tag system to make specific damage easier : dictionary of tags inside the dictionary of each template and definition +maybe : include exchange between characters if possible save feature : save the boolean for creation and feeding of databases => python file or external file ? From b5f399a806a20c111b19d9c932665c623058045e Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Tue, 30 Sep 2025 12:52:26 +0200 Subject: [PATCH 38/40] adding to ideas --- ideas.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ideas.txt b/ideas.txt index 1ac1092..2baef5e 100644 --- a/ideas.txt +++ b/ideas.txt @@ -45,6 +45,10 @@ add stats to character templates and definitions differenciate main and secondary stats derived stats formulas => +classes feature : +make classes real dictionnaries to choose from +each class will call it's own definition and template upon choice + transform : dungeon function to have choice which then leads to other functions exploration function to be different depending on environment around villages From 977779bb89abc61612b0d0342be829e0350b72a7 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Tue, 30 Sep 2025 13:18:29 +0200 Subject: [PATCH 39/40] bunch of fixed done --- ideas.txt | 8 ++++++-- precisions.txt | 2 +- .../database_connection.cpython-313.pyc | Bin 1183 -> 1188 bytes src/__pycache__/database_feed.cpython-313.pyc | Bin 2632 -> 2637 bytes src/lists.py | 2 +- src/main_script.py | 2 +- src/test_script.py | 2 +- 7 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ideas.txt b/ideas.txt index 2baef5e..638f39c 100644 --- a/ideas.txt +++ b/ideas.txt @@ -36,6 +36,10 @@ make an arena system with opponent lists (raised monsters, human classes) with a make a combat loop or partial loop for the arena to be able to alter coins and XP gains humans have a specific arena characteristic for coins because there will be clandestine arena battles in the wild +death handling feature : +if resurrection function called, it will handle XP and coin losses and resurrect player at 50% life +if not called, ironman mode is activated, and that character is deleted from memory + npc feature : random npc : names, surnames, nicknames, origin (country, continent, city), specialization (job, class), personalities make dictionaries for each characteristic @@ -53,7 +57,7 @@ transform : dungeon function to have choice which then leads to other functions exploration function to be different depending on environment around villages -final before continuig dev : -=> separate functions into files : done for databse ! +final before continuing dev : +=> separate functions into files : done for database ! debug : diff --git a/precisions.txt b/precisions.txt index 93700bd..802950a 100644 --- a/precisions.txt +++ b/precisions.txt @@ -11,7 +11,7 @@ beastmen => centaur, lizardman, wolfman, foxman, tigerman, lionman, dogman, catm pseudohumanoid list : goblinoids => goblin, hobgoblin, goblin warrior, goblin lieutenant, goblin chief, goblin priest, goblin general, goblin king, goblin emperor orcoids => orc, high orc, orc warrior, orc priest, orc chief, orc general, orc king -ogres => ogre, red ogre, green ogre, blue ogre, black ogre, white ogre, mutant ogre, demonic ogre +ogres => ogre, red ogre, green ogre, blue ogre, black ogre, white ogre, mutant ogre, demonic ogre, kijin = divine ogre undead list : vampire list => diff --git a/src/__pycache__/database_connection.cpython-313.pyc b/src/__pycache__/database_connection.cpython-313.pyc index 06b8fe4e31d09c8423a6e9f249619d2e4ee2b2ae..cbaaf66bec5311788c1757fb82e93bfab1cbe1f7 100644 GIT binary patch delta 45 zcmbQwxrCGZGcPX}0}xoYt(nMuSJW@rDkiizwWv6zv?MbpvpBINwX|sCkLAn&Kco;e delta 40 ucmZ3&IiHjJGcPX}0}upfZ#HE-kJ<;(!_>J7*M diff --git a/src/__pycache__/database_feed.cpython-313.pyc b/src/__pycache__/database_feed.cpython-313.pyc index e36f30686f01de7ad8d0bc54a8d690810ce3ada0..9d4c73b9146a48e279e172a198bdd95ec7c83d2a 100644 GIT binary patch delta 47 zcmX>ha#n=IQ(BUllUbZtl3H4{c^T6pb^v1o B5G?=z delta 42 wcmX>razcdrGcPX}0}upfZ`jD)%_QLLY!wq)oLW>I6P8()nVPqGHPa$?01pZcs{jB1 diff --git a/src/lists.py b/src/lists.py index 4548118..42d6293 100644 --- a/src/lists.py +++ b/src/lists.py @@ -300,7 +300,7 @@ #Ogre likes ogreTemplate = copy.deepcopy(pseudoHumanoidTemplate) -ogreTemplate['Type'] = "Orcoid" +ogreTemplate['Type'] = "OgreLike" ogreTemplate['ManaRegeneration'] = 0 #Undead diff --git a/src/main_script.py b/src/main_script.py index f47d13b..f0102e8 100644 --- a/src/main_script.py +++ b/src/main_script.py @@ -7,7 +7,7 @@ dbconnect() dbcursor() - #Global check variable + #Global check variables characterCheck = False combatCheck = False explorationCheck = False diff --git a/src/test_script.py b/src/test_script.py index ce576d5..010c430 100644 --- a/src/test_script.py +++ b/src/test_script.py @@ -8,7 +8,7 @@ dbconnect() dbcursor() - #Global check variable + #Global check variables characterCheck = False combatCheck = False explorationCheck = False From e539de375ba4a6a5a81d881a0e1a09ab5e0424e6 Mon Sep 17 00:00:00 2001 From: Duriel7 Date: Tue, 30 Sep 2025 14:23:12 +0200 Subject: [PATCH 40/40] WIP: more lists and ideas have been noted --- ideas.txt | 1 + precisions.txt | 11 +- src/__pycache__/lists.cpython-313.pyc | Bin 0 -> 8540 bytes src/lists.py | 156 ++++++++++++++++++++++---- 4 files changed, 145 insertions(+), 23 deletions(-) create mode 100644 src/__pycache__/lists.cpython-313.pyc diff --git a/ideas.txt b/ideas.txt index 638f39c..9de7235 100644 --- a/ideas.txt +++ b/ideas.txt @@ -27,6 +27,7 @@ make a counter in case randomness chooses too many times in a row the same monst OR implement dictionaries to have monster frequencies OR keep the list and make a dictionary with a zip against a list of frequencies make environment types have a certain difficulty factor : for monsters that appear and climatic events like sandstorms or snow storms, floods... for random funny events +hardcoded dungeons are handplaced into the world, but procedurally generated ones can appear virtually anywhere combat feature : make combat decisions based on character class diff --git a/precisions.txt b/precisions.txt index 802950a..8d0f832 100644 --- a/precisions.txt +++ b/precisions.txt @@ -7,6 +7,7 @@ corrupted humans => will have some human origins and different levels and ranks corrupted elves => dark, high, wood, blood (unique to corrupted ones), crystal (crystal elves are elves imprisoned in stone by an ancient curse, end game enemy) corrupted dwarves => deep, high, forest, blood (same as elves counterpart), crystal (same) beastmen => centaur, lizardman, wolfman, foxman, tigerman, lionman, dogman, catman, goatman, cowman +homonculii => homonculus, pseudohumanoid list : goblinoids => goblin, hobgoblin, goblin warrior, goblin lieutenant, goblin chief, goblin priest, goblin general, goblin king, goblin emperor @@ -17,7 +18,8 @@ undead list : vampire list => zombie list => zombie, ghoul, plant zombie (corpse invaded by plants), zombie beast, lich, archlich, dracolich skeleton list => skeleton, skeleton warrior, skeleton mage, skeleton knight, skeleton general, skeletal beast, skeletal demon, skeletal dragon -ghost list => dead spirit, ghost, +ghost list => dead spirit, ghost, fallen spirit, corrupted spirit +specter list => specter, wraith, fantom, poltergheist, animal specter, divine specter demon list : demonic beast => demonic animal (choose species), @@ -59,6 +61,13 @@ real dragon => draconoid (small dragons or manlike dragons who cannot talk) => dracohuman (diluted blooded dragons with humans) => +for cities towns and villages : +make dictionnaries with few characteristics, as name, country, continent, chief or mayor name, specialty (like a food, drink, type of cloth...)... +...environment type (when hardcoded - will see to use cardinal directions for procedurally generated ones, or select environmeent before to assign after)... +...type : village, town, city, or capital +make new lists in order to randomly assign those when procedurally generated +do double lists : one for only name, for story purposes ; the other for the entire definition and template + ************************************************************************* STATS : diff --git a/src/__pycache__/lists.cpython-313.pyc b/src/__pycache__/lists.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..358a02276302083659e6205f7596d265f431bbc1 GIT binary patch literal 8540 zcma)AOHdn0nobNz2)&UI@23ItFu48h_6yw5m~MkjQ^wD--Gx*LjrCwk5*~Kf6Y^<1 zzL;^ugo(cNTsLA5eVoh0%yAAg5mg~JsHokDC1Ow9*yxRoJ?vq>%q&$&-NI@j{;DrC zzd!TOFaP{Y_77ffGr^zZPye>jI7P^R(njg8(F8yIpO=u|6M+bIw~4~vbxIxDCvKm( ze4?M6Axb^00oDj}z?`rqm1OFa0lLsq#nUXubt>J-%b22_^0ZX ziy~P`+V`b|28pfLu?$PEV;NQyY^}>Up-*9-!LGor!mf#*RaNOqnU2*NS8Fn^*$k|7 z9d-jY4Vw|KS6%gn?Qslax+Y`BW?-e8u+L$$u(@OQdein0Z&r=#^O}s=nv6M{fmptP z&BJcN7Q`>At~zgf9K*O(ld)hku+o>XuVA-fi?Aiw9oSviGVE*E3huBV1Vljyo9wp+R_@w0J`n8n$>N z44qQ$38TuYShw;orF&$*aifHi7Rm#$MIh`>J}~z-CO$CtHV(x1HUY%;Cf*ZHPlAqi zC-pM%BwZC_Q?xDktWleB#*FoW@QKMido1@HV;mRz11t82;zNN>Lh$CZ*7kWMJ`&C_ zpGP%(Y>gg^AycErrbg$*$JY5jHZ{6{K7Rf_Aa?5Fs=#(h+m>37g^O%|tHLFwUgg+j zQ>VvfbgROrRal>WRH4U~LQjM%;u9Xv3ZIM7pUsX5vto?1QJZ8TBFd&Bb3k9P+?fZuWoD5qEPOOmo?20_3tx)s z0a7T=rDhvYg+I<&@>#+>P_4pcy>p>CMV+DxoK@rzO0OESw1NxXA@tS&+ zGpg%R&Zw?OIpa7z)=H5m8_4AiQx6|d=?k`Ds<4bct^!3|1&X)|6mb=(FIQm|h^sJP z^}IGpYag2x<&5eolrzG$R*Bb*-9N-PgxndcGwQ|-$8u6iq_c)okhY|BS~48-8AZW`QA{{r}{4M09oNP4Q$)vH?T_q7uqz&gCIiFLcq~Th~ zWOIomn`%y8m-5LR;@p&@2{~&t+}qxyo>B_W6)F9~Xk5;`L`Y6h<#ZOki-~pFa4t!| zVjw`DD{@>;%ZijsWUvrcPbIMDW^hb=cmg{xLT0Oi-moNrOXp)CK%eD=!!TSAd#QiZ zeMw13Yf0H?T*#-Sv=Lyh6)7sykxV`t2MvG!J8k%9Gl}%P6wPH6MlwelX39ryDl(1J zrpC{+zaORz=fh>bhLg)hx1335bC4ov^G(^}>+J7;rVXDxMwN{J{crT|zo(5850{N5 zHe)6cGknWgIUmbdZP%^LS~8KQLpZM}eK*~WEAnCjdEi)0$7CsHGz!T?YMZ~19ZUI` zQGZKL8s1q+i9zt>GPayEybm%;GPanB^5a0X3Q}(~lLjZgm_QOX&P#dhJ2016Ur$7F z{@YwA!@aTeuafOa;}$2I!!(}#~f=+6^V=!5C8gyB%6 zbS#rH8lsuaZNnRra?+ZVm7lN6a?EgNdCswroT$ zIi$@^IgRt6j&q4<&M2+N8vYEsUhE_pKgc`GWMN%i?1>iy){LYwG2Wb4R30^*!TN~WWa#HD6Mr4k39$s!r%bCqeH=D+H1ut5hm`~VjRC>70UTYOz#;jF% zv(ksI!uzdNXwkD)p^ZuptP-QWj30ozRUVmBM|n@BX9bzLdq8F-mAST-T9s}V$%>Gc zUn@e|sC1w@&|b!GMgxVK(L)?pvQ2_be!-8MkzZ_AA-~{xR-RhS+Y#N!B%-p>T9$LD z(YRr3*tJ26A`8UBAj$}9wM0<@@|!t1W~XVu>iZ(O{v+1hOGz>NHY@5B<9T@%C{5m+ zVfBg)HDy@MLWyb4vzoGeL_P9r%Y#YAwOBE53nG5$kqkX>GHioTOxDD$jS| zjLS(j*p$f0DTbVqxx40)L%qXU}^eb~glpKiZnZw!Bg1y9a_rI`8T@%;SNF&%n|XPUoU~h& zvs~OG1NIng9XSYg(R9?rHi%ZJ74e57DhcwPb#$pD!nSrmH?DVftE7!#dsWiG#X5k<9=*L&C9OJz2S4`k`U}lmQJunrAGHyFU0|O?G!of) z#iaF{t$$>qlv;c&xKG+O(yn%#-XoI-#Jf+z8VT<_XO5-T!#&cgm&VlA;XN{PKupiw z9te*$y{$W6|Ms@-@7z86+h6O!-rZkn!GZsBHiS+T{6`Vu4ZT}>yRmq> z?9i>|5R2Ms(osZ4ldpy6C6kKgMj;p`zyUP#e6>gVbke*}f*J|#OfaQNEzH(qkB#k-?jsM|n@;E87m41X1LE2z0gVK9I`&AH zZnfI>kQ5cIqj8?84uV}c+4-}%AQsh(Pst`{S;HArAt&wiMX9UQF8>)An1afFd@-oy_>g(zTaw2W?o?gqt8nydIP8IxWU{J$dv^)C; z;NsDs%-A>`9@fZ+-uY2)oB_Rz0iFxkYkT*HSMOi_;d!y`BE4t>pL`$G2F?TSJfwRY znxgQDhI>9ZM&Tn3htzkL!uxci<5&JDXyY^L>;v`TGi~;{HvSxAYU_xGB4Q5y<)*qI zs!yZZLQI>BY2&iZ7#^WBi5hCt;JNPwZSd1S-c)DqsjE-48Bx0?YJ*QHfv$?syZXMH z{B}|uy;khJPRqvVv^w*(Ho5}53mt|*>FD{+`>j_Uxl(MuO7H#1RrT7EHgX4eCkgpb zncBKOq~53gaJLw_fLf~epZ$J7>!)yMfogg3G=;Y{(ytGUQ}`tnqW2Vq^BR(>x6gtT z*Z)$lP0XtEkJQKCX!DXbAz@4npVDv@MyWKTkmkPn;HftIOdEa128R%-J~T`xS){^t zPkkTKx-Y1gzxwMX?edD&js1jn=8#ah?cw$h*WX`P2QCytIG}*uJBsHH?pqf&+u8eF z&$m75sVl_}Y&N0~VHc5|ZA^;6mI$o}YTw0T@Dd7b$56rdW(%cEA08?ARQ~`p2g@IN zmwKC0yU!JU=kd*n^cLK2u*;A>c(UMDJ-uA`K$zAUwdZ`%e*uN0ZJ^+JgX0hDCx;3i z)!PTL%2qsA44%h|{i9g%6_vDX#Q+Jme(=8cs=a56fphrObqyB0ZxZwd3=J2&s;{3% z&sn>vV&F7L?R_AvYp7_Yhckhk%l=T@M^V#>^EbZNIHx_F6LIg87LBy* z;G^4VeKd9`@4ypaAAzZ&XAHF}+*feD8KHq7Bono^0U-}t^tN`OF}gltGDi`U*=M89 zZuFg|l?pp_y&1v|2L=l+wYdiuz>f0~E7LsAZB|xGapLC(igf8yM|nqs#N~bGee2yx z6`O_%je4N1&{$Z1?bU-V0CA`p3IpK$19~86j@ex{icm*f;E?X~1I1pu^`8Dhqw2s_ k=(MYT>mI^4Ma=Kv{#zpA*9pD=rQlZom2@e8!cVjR2ML{o9smFU literal 0 HcmV?d00001 diff --git a/src/lists.py b/src/lists.py index 42d6293..4f94665 100644 --- a/src/lists.py +++ b/src/lists.py @@ -14,25 +14,21 @@ jobList = [] classList = [] +continentNamesList = [] +countryNamesList = [] +allCitiesNamesList = [] +majorCitiesNamesList = [] +cityNamesList = [] +villageNamesList = [] + continentList = [] countryList = [] allCitiesList = [] majorCitiesList = [] cityList = [] -villageNamesList = [] -environmentTypeList = [] +villageList = [] -environmentTypeList.append("Plains") -environmentTypeList.append("Savanna") -environmentTypeList.append("Forest") -environmentTypeList.append("Cave") -environmentTypeList.append("Desert") -environmentTypeList.append("Snow") -environmentTypeList.append("Mountains") -environmentTypeList.append("River") -environmentTypeList.append("Lake") -environmentTypeList.append("Sea") -environmentTypeList.append("Sky") +environmentTypeList = [] #Assigning major cities to their country cityDict = {} @@ -124,15 +120,20 @@ #Monsters #Species and Races + #Humanoids humanoidList = [] corruptedHumanList = [] corruptedElfList = [] corruptedDwarfList = [] +beastMenList = [] +homonculiiList = [] #Append in humanoids list humanoidList.append(corruptedHumanList) humanoidList.append(corruptedElfList) humanoidList.append(corruptedDwarfList) +humanoidList.append(beastMenList) +humanoidList.append(homonculiiList) #Pseudohumanoids pseudoHumanoidList = [] @@ -144,16 +145,24 @@ pseudoHumanoidList.append(orcoidList) pseudoHumanoidList.append(ogreList) - #Undead -undeadList = [] + #Undead - Humanoid +undeadHumanoidList = [] vampireList = [] zombieList = [] +skeletonList = [] ghostList = [] -#Append in undead list -humanoidList.append(undeadList) -undeadList.append(vampireList) -undeadList.append(zombieList) -undeadList.append(ghostList) +#Append in humanoid undead list +humanoidList.append(undeadHumanoidList) +undeadHumanoidList.append(vampireList) +undeadHumanoidList.append(zombieList) +undeadHumanoidList.append(skeletonList) +undeadHumanoidList.append(ghostList) + + #Undead - Non Humanoid +undeadList = [] +specterList = [] +#Append in non humanoid undead list +undeadList.append(specterList) #Demons #Append in demons list @@ -168,13 +177,17 @@ slimyList.append(mudList) slimyList.append(gelList) - #Inhabited places hardcoded + #Inhabited places - hardcoded => do procedurally generated ones later in definitions ? #Villages +villageNamesList.append("Slenia") + + #Cities and Towns #Main cities +majorCitiesNamesList.append("Otoria") - #Dungeons + #Dungeons - hardcoded base #Subterranean @@ -184,6 +197,21 @@ #Other dimensions + #Dungeons - procedurally generated + procedural algorithm => TO DO later in definitions ? + + #Environement List +environmentTypeList.append("Plains") +environmentTypeList.append("Savanna") +environmentTypeList.append("Forest") +environmentTypeList.append("Cave") +environmentTypeList.append("Desert") +environmentTypeList.append("Snow") +environmentTypeList.append("Mountains") +environmentTypeList.append("River") +environmentTypeList.append("Lake") +environmentTypeList.append("Sea") +environmentTypeList.append("Sky") + #Items #General items @@ -310,6 +338,7 @@ #Vampires #Zombies + #Skeletons #Ghosts #Other undead monsters - can be anything for particular situations @@ -332,6 +361,31 @@ #Pets + #Base global inhabited places Template + + #Inhabited places - hardcoded +inhabitedPlaceTemplate = {} + + #Villages - Listing +villageTemplate = copy.deepcopy(inhabitedPlaceTemplate) + + #Cities and Towns - Listing + + #Main cities - Listing +majorCityTemplate = copy.deepcopy(inhabitedPlaceTemplate) + + #Dungeons - hardcoded base + + #Subterranean + + #Overworld + + #Air placed + + #Other dimensions + + #Dungeons - procedurally generated + procedural algorithm => TO DO later + #Environment Types #General Template @@ -421,8 +475,18 @@ #Vampires #Zombies + #Skeletons #Ghosts +ghost = copy.deepcopy(undeadTemplate) + +undeadHumanoidList.append(ghost) +mobList.append(ghost) #continue to append to other lists + #Other undead monsters - can be anything for particular situations +specter = copy.deepcopy(undeadTemplate) + +undeadList.append(specter) +mobList.append(specter) #continue to append in other lists #Slimy @@ -449,6 +513,54 @@ #Pets + #Base global inhabited places Template + + #Inhabited places - hardcoded + + #Villages - Listing +villageSlenia = copy.deepcopy(villageTemplate) + + #Cities and Towns - Listing + + #Main cities - Listing +majorCitiesOtoria = copy.deepcopy(majorCityTemplate) + + #Dungeons - hardcoded base + + #Subterranean + + #Overworld + + #Air placed + + #Other dimensions + + #Dungeons - procedurally generated + procedural algorithm => TO DO later + + #Environment Names - Example : "Plains of Skaria" can be Plains or other type + + #Plains + + #Savanna + + #Forest + + #Cave + + #Desert + + #Snow + + #Mountains + + #River + + #Lake + + #Sea + + #Sky + ################################################################################################# # DICTIONARIES REFORMING # #################################################################################################