I came across the battle rules for your app in the Designer attributes in the info screen.
For convenience, I'm copying them here to make it easier to read and compare to your code.
Info
Info
This is a mobile game made in app inventor in about a week. It was made with homemade rpgs like DnD in mind and to pass the time with small and quick battles. Thank you for downloading and playing!
Stats
Stats
The played character has a list of these 9 tracked statistics:
- Level,
- Vitality,
- Attribute points,
- Armour,
- Strength,
- Speed,
- Combat,
- Magic and
- Charisma.
The last six are on a point scale of 1-100 and they are used in combat (except Charisma) to calculate each interaction.
Level is calculated using the sum of the character points divided by 20 and it generally only serves as an indicator of your strength compared to monsters.
Vitality always begins at 100 points and when depleted you lose the battle.
Attribute points are won through battle and can be used to upgrade your stats.
To disable the 100 point cap on stats look for the relevant option in the settings
Enemies
Enemies
There are currently 10 different types of enemies in the game, with each of them having some special characteristics.
For the first five types of enemies, swarm battles are unlocked after defeating them for the first time, which allows you to battle multiple of them in each battle.
Each enemy has a relative danger level that determines it's stats.
Every enemy is randomly generated to have 15 points distributed per level among their three tracked statistics:
- Armour,
- Strength and
- Speed,
which are used in combat calculations.
For an increased challenge you can make enemies have the same level as you do. Look for enemy upscaling in the settings.
Battle
Battle
After initiating a battle, the character will be be put up against the enemies he has selected (or the default option of one ghoul).
Depending on each character's speed, the turn order will be calculated. Every character can do an action and then attack on their turn.
The played character and each monster type have a unique set of actions that apply effects.
Your available actions are:
- Attacking stance, which slightly increases your attack power,
- Defensive stance, which slightly increases your defensive ability,
- Healing Potion, which passivly restores health,
- Fire spell, which applies a burn to the chosen enemy,
- Shield spell, which reduces or blocks enemy damage and
- Confuse spell, which slows or stuns enemies.
Those factors and the stats of the attacker and the defender will be used in calculations to deal damage on the defender's Vitality.
When a monster's Vitality reaches zero it dies and if there are no monsters left, the battle ends in a victory and the character is rewarded with Attribute Points.
If the character's Vitality reaches zero, you have lost the battle but you will not be punished in any way.
You can see more information about the calculations below.
You can visit the Bestiary and refresh your memory or learn more information and tactics for each enemy type. If you want an easier or maybe a tougher time you can change the difficulty in the settings.
Calculations
Calculations
When first entering a battle the turn order is established by comparing the speed stats.
Starting with the order of most to least speed, each character gets 2 turns for every 20 more speed compared to the slowest enemy that they have(i.e. a battle with three characters 1, 2 and 3 of speed 25, 20 and 5 accordingly, would have a turn order of 1, 1, 2, 3).
During their turn, the character chooses an action that will have an immediate or a passive effect over the next or next few turns.
The played character's actions are:
- restore 2 Vitality for the next two turns,
- deal 2 damage to the chosen enemy for the next two turns (only one enemy at a time),
- block an attack if calculated damage is equal or less of 5, and lastly,
- decrease targeted enemy Speed by 0.1* Magic for the next turn and have a Magic * 0.8 * 100% chance to disallow their next attack.
Then (unless forbidden by an action) the character will attack, with the base calculation being: round(0.2* Strength - 0.15* Enemy Armour).
The played actions can change these calculations, for example the played character's actions can add +0.15Combat or +0.1 Magic damage to enemies or -0.1Combat or -0.05 Magic damage for the next enemy attack.
If the damage calculated is less than five, then the damage dealt will be five (excluding flat damage dealt).
If a battle is won, the player gains round(0.5* Suggested Level) amount of Attribute points.