The battle calendar and battle system


This week the battle calendar was completed and the skeleton of the battle system was coded. 


The battle calendar had some tricky code, where I needed to figure out the weekday, the day number, the season, and which week of the season we were in. These variables were used to show when battles were in the next seven days. Seasons are 30 days, and a week is 7 days, so there are times when I need to show battles for the next season before the current season is over. The calendar determines who you battle based on rank, season, and week. So the last friday of the month is always tournament day for every rank. The other three weeks, Mondays are rank E battles, Tuesdays rank D, etc. This means as you rank up, more battles are available in the week. 


The system also needed to calculate the prize money you would earn if you won, the fame you win/lose depending on your dragon's rank (battle lower ranks and lose fame), and the name of the rival and battle. Then it needs to send that data to the battle. It was a lot of filling out lists and logic puzzles. But now its working!


The next challenge was getting an enemy dragon into the battle field. The old system assumed there was only one dragon, so adding another dragon created a lot of problems. The new dragon would copy the stats and appearance of your own dragon, which was a problem. I had to rework how the dragon generation system worked, so that when a new dragon is generated you can indicate which stats to use, which colors and breed, and which seed to pull. The battle system still needs to calculate damage, stamina costs, etc but the data is now available for those calculations. 

Leave a comment

Log in with itch.io to leave a comment.