add new class for user selection "Goo/Slime" fix bug when not combineble_species in player game broke, allow mulit types in player species but only show first

This commit is contained in:
2024-04-04 17:11:27 +02:00
parent 419c8a9959
commit f3d85922ed
3 changed files with 41 additions and 6 deletions
+2
View File
@@ -29,6 +29,8 @@ class CharacterCreater:
if key == "fixed_type":
if not element[key]:
return None
elif isinstance(element[key], list):
return element[key][0]
return element[key]
+4 -1
View File
@@ -5,7 +5,10 @@ class Player:
def __init__(self, name:str, type:dict, species:dict, combineble_species:dict):
self.name = name
self.type = type
self.species = {"species": species["name"], "combineble": combineble_species["name"]}
if combineble_species:
self.species = {"species": species["name"], "combineble": combineble_species["name"]}
else:
self.species = {"species": species["name"], "combineble": False}
self.inventory = []
self.inventory_size = species["inventory_size"]
+35 -5
View File
@@ -134,7 +134,7 @@
"speed": 10,
"defense": 1,
"inventory_size": 0,
"fixed_type": "Magician",
"fixed_type": ["Magician", "Inflatable"],
"combineble": true
},
"Were-Thing": {
@@ -143,19 +143,49 @@
"speed": 6,
"defense": 8,
"inventory_size": 5,
"fixed_type": "Warrior",
"fixed_type": ["Warrior", "Were-Thing"],
"combineble": true
},
"Goo/Slime": {
"hp": 100,
"strength": 5,
"speed": 4,
"defense": 10,
"inventory_size": 0,
"fixed_type": ["Slime"],
"combineble": true
}
},
"types": [
{
"name": "Magician"
"name": "Magician",
"selectable": true,
"attacks": []
},
{
"name": "Warrior"
"name": "Warrior",
"selectable": true,
"attacks": []
},
{
"name": "Archer"
"name": "Archer",
"selectable": true,
"attacks": []
},
{
"name": "Inflatable",
"selectable": false,
"attacks": []
},
{
"name": "Were-Thing",
"selectable": false,
"attacks": []
},
{
"name": "Slime",
"selectable": false,
"attacks": []
}
]
},