The item() class holds the information of the item and also runs the item effect when it gets used. Constructor def __init__ ( self , command , name , cost , usage): self .effect = command self .name = name self .cost = cost self .usage = usage The effect holds the string name of the effect for the item, usage holds the value of the Effect . The rest are self-explanatory. EffectHandler() def effectHandler ( self , user: PlayableCharacter , equip= True ): #learned how to specify type of parameter. if equip: if self .effect == "Def" : user.defense = user.defense + self .usage elif self .effect == "AtkPhy" or self .effect == "AtkMag" : user.attack = user.attack + self .usage else : if self .effect == "hp" : user = self .healing(user) return user This handles the effects of the item when it is used. If equip is true then it will check for the equip...
With my flow charts and my corrected UML in hand, I went on in to create all the functions with default returns and values to get myself set up. The reason I've done this is that I want to practice top design. I heard about it from my Java Programing professor and thought to implement it here just to see what it's like to break down problems into smaller steps beforehand and set up a framework so that it's easy to test things. So let's dive into it! First things first, I created a monster object called "thatMonster" to use for testing purposes. It will be removed later down the line. Then I followed up with an outline in the main line of what methods will be called. # Main Line Commands inputAndCheck( "how would you like to boot? 0 New game or integer of save you are booting" , [ 0 ]) bootSave(currentAwnser) input ( type (Lori.level)) generateCharacters() os.system( "cls" ) input ( "we made it!!!" ) if chapter == 0 : input ...