Battle system nearly done!
- HP, MP, 4 physical stats and a magic stat. The attack/spell formulae are pretty simple, and unbalanced (this is gonna need lots of testing to figure out what the defaults and formulae should be, what the increasing-stats limit should be and how to pass down gains to offspring). But they work.
- Every round the reports are added to scrolling list, and stats are recalculated and updated. Yay for Javascript, everything happening in real time!
- 3 physical attacks, 3 healing spells, 3 ice spells, 2 stat-buffing spells (all with different levels of effects and MP needed). If a griff doesn't have enough MP to cast a spell, message shows and nothing happens. Battle waits til they choose another action.
- The spell buttons only appear if the individual griffin knows them. By default all are locked. I need to make some items that 'teach' spells/skills. Scrolls or something.
- If HP or MP get below zero, it's cleaned up and set to 0. Obviously both sides' HP are checked at the start and end of rounds.
- At end of battle, the action buttons disappear and are replaced with result message. If win, a button appears, to get rewards (currently just money, but random items, XP or stats could be added). If draw or lose, there's just a link back to the battle index page.
- Enemies are currently randomly generated: names, sprites, win/loss messages, stats.
This could be sufficient for now, as it's just a 'training arena'. But later, ought to have a DB table with a bunch of fixed enemies. These could be chosen by user (useful for special events and challenges - whose finely-bred griffs can beat super powerful villain who just arrived?), or used to randomly populate regions later (for example while travelling in desert, any enemy of the desert type pops up).
To do next:
- add a few more stats (magic attack/defence?), skills and keep tweaking formulae. Must look at other RPG formulae for ideas.
- add some sort of energy system, so a griff can only do 10 battles a day, and it resets every day.
- think about magic elementy rules. Ice is weak to fire, fire weak to water, water weak to lightning, etc etc. Try to keep it quite simple! The effects will probably be a simple x2 / x0.5 modifier to attacks.
- related to elements, some skills/spells could be restricted to griffs of certain elements. A griff born with fire element shouldn't learn ice/water magic.
- make some items that can permanently increase stats. These will need to be very rare and the effects counted/limited.
- add some wearables that can give temporary stat increases. Slightly unsure how to 'link' or track them... but there must be a way
- expand the section of griff profiles to show all the new stats, and list which skills/spells they've learned, or not.
- it is NOT possible to use any items in battle, unfortunately. It would require some fancy AJAX stuff to check user's inventory and use items.
But it might be possible to add user's own stats and action buttons to the battlefield. So one could raise their character/avatar to be a soldier, mage or whatever, and have own "human-type" spells and skills that no griff can do. Only their griffin can be hit by the enemy though; if their HP is zero the battle's over and the Keeper must flee. So users don't need HP.
- I suppose fixed events/encounters will be possible later, too. Like you get to the end of X quest in an area, and the final boss battle becomes available (some kind of key item is added to user's inventory, or maybe an 'unlock switch' in DB, so other users can't go to that page and try the fight unless they've finished the quest too). Then we can make a custom copy of all the battle code, with the boss' image, background, fixed stats, messages, and special rewards. For example some tricky bosses may be in a weird dungeon that changes griffs' stats at the start, or even lowers their stats to a fixed amount - so it's only their skills/spells/strategy that will count.
- HP, MP, 4 physical stats and a magic stat. The attack/spell formulae are pretty simple, and unbalanced (this is gonna need lots of testing to figure out what the defaults and formulae should be, what the increasing-stats limit should be and how to pass down gains to offspring). But they work.
- Every round the reports are added to scrolling list, and stats are recalculated and updated. Yay for Javascript, everything happening in real time!
- 3 physical attacks, 3 healing spells, 3 ice spells, 2 stat-buffing spells (all with different levels of effects and MP needed). If a griff doesn't have enough MP to cast a spell, message shows and nothing happens. Battle waits til they choose another action.
- The spell buttons only appear if the individual griffin knows them. By default all are locked. I need to make some items that 'teach' spells/skills. Scrolls or something.
- If HP or MP get below zero, it's cleaned up and set to 0. Obviously both sides' HP are checked at the start and end of rounds.
- At end of battle, the action buttons disappear and are replaced with result message. If win, a button appears, to get rewards (currently just money, but random items, XP or stats could be added). If draw or lose, there's just a link back to the battle index page.
- Enemies are currently randomly generated: names, sprites, win/loss messages, stats.
This could be sufficient for now, as it's just a 'training arena'. But later, ought to have a DB table with a bunch of fixed enemies. These could be chosen by user (useful for special events and challenges - whose finely-bred griffs can beat super powerful villain who just arrived?), or used to randomly populate regions later (for example while travelling in desert, any enemy of the desert type pops up).
To do next:
- add a few more stats (magic attack/defence?), skills and keep tweaking formulae. Must look at other RPG formulae for ideas.
- add some sort of energy system, so a griff can only do 10 battles a day, and it resets every day.
- think about magic elementy rules. Ice is weak to fire, fire weak to water, water weak to lightning, etc etc. Try to keep it quite simple! The effects will probably be a simple x2 / x0.5 modifier to attacks.
- related to elements, some skills/spells could be restricted to griffs of certain elements. A griff born with fire element shouldn't learn ice/water magic.
- make some items that can permanently increase stats. These will need to be very rare and the effects counted/limited.
- add some wearables that can give temporary stat increases. Slightly unsure how to 'link' or track them... but there must be a way

- expand the section of griff profiles to show all the new stats, and list which skills/spells they've learned, or not.
- it is NOT possible to use any items in battle, unfortunately. It would require some fancy AJAX stuff to check user's inventory and use items.
But it might be possible to add user's own stats and action buttons to the battlefield. So one could raise their character/avatar to be a soldier, mage or whatever, and have own "human-type" spells and skills that no griff can do. Only their griffin can be hit by the enemy though; if their HP is zero the battle's over and the Keeper must flee. So users don't need HP.
- I suppose fixed events/encounters will be possible later, too. Like you get to the end of X quest in an area, and the final boss battle becomes available (some kind of key item is added to user's inventory, or maybe an 'unlock switch' in DB, so other users can't go to that page and try the fight unless they've finished the quest too). Then we can make a custom copy of all the battle code, with the boss' image, background, fixed stats, messages, and special rewards. For example some tricky bosses may be in a weird dungeon that changes griffs' stats at the start, or even lowers their stats to a fixed amount - so it's only their skills/spells/strategy that will count.

