Devlog 4:A (DONE BY ERNIE BURROWS)
New Features.
- Added healing ability.
- Added robot armor slots.
- Added defense ability.
- Set up enemy ability choosing AI.
- Refactored abilities to allow for ability uses per battle
Added healing ability.
I added a scriptable object of a healing ability. Overall this was not that much work due to some good code hierarchy set up earlier in the project. I even did it the right way and made a .Heal() function instead of just passing in a negative number to .TakeDamage()
Added robot armor slots.
I added a head, body and weapon armor slots to both the enemy and the player robot, all 3 slots have a ability effect increase from 0-100%.
The head armor slot effects the healing percent, the Body armor slot decreases incoming damage, and the Weapon "Armor" slot increases outgoing damage. I calculated all this in the BattleSystem.cs. Essentially the armors will increase or decrease the correct stat based on their effect %.
Added defense ability.
I had to do some thinking on what the "Defense" ability would be. Since we have armor that effects both incoming and outgoing attack damage, a tail whip or bolster wasn't going to do it here. I thought for a second on making an initiative or attack speed to the system... Then I realized this would mean I had to re-work the entire system. So I settled on the most annoying ability in turn based RPG's... That's right, the defense ability increases your characters chance to dodge an attack. The calculations for this are in BattleSystem.cs, but essentially I generate a random number between 0 and 100 and if the dodge percent is higher then that number then the attack misses.
Set up enemy ability choosing AI.
I created a function that will choose which ability the enemy will perform next. The function is in BattleState.cs and it follows the below flow chart. However, it also has a bit more added complexity of checking the uses left on abilities. Once the enemy is out of uses on an ability it will transition to the next state of decision making. If the enemy somehow uses all of it ability uses (nearly impossible) the enemy will simply sit there and let you kill it.
Refactored abilities to allow for ability uses per battle
I changed the Battle Character to have a list of a custom class Abilities. This class holds an AbilitySO, a statingUses, and a currentUsesLeft. This actually did require that I refactor most of the code in the game since a lot of systems where expecting to receive the AbilitySO and not a custom class. Luckly changing ability -> ability.ability was not that hard to do.
Flow Chart with Pseudocode:
Youtube ->
Github-> https://github.com/GEIII-GearUp/GearUp/tree/7e783770ccf990e02e41333b7d4b95aae8d4...
Get Gear Up
Gear Up
Status | Released |
Authors | Ernie Burrows, ethornewell |
More posts
- Devlog 4:B (DONE BY EMMA THORNEWELL)13 days ago
- Devlog 3:B (Done by Emma Thornewell)40 days ago
- Devlog 3: A (DONE BY ERNIE BURROWS)43 days ago
- Devlog 2:B (DONE BY EMMA THORNEWELL)54 days ago
- Devlog 2: A (DONE BY ERNIE BURROWS)59 days ago
- Devlog 1: B (DONE BY ERNIE BURROWS)68 days ago
- Devlog 1: A (DONE BY EMMA THORNEWELL)68 days ago
Leave a comment
Log in with itch.io to leave a comment.