I'm working on a powerful yet easy to understand open source battle engine to promote RPGs, and here's what I have so far:
link removedThe engine is turn based and supports 1 on 1 combat. Currently the engine contains attack strength, attack accuracy, attack evasion and status effects. I'll get crackin' on Spells soon and then Items. Eventually I'd like to give monsters multiple attacks to choose from and possibly even multiple attacks per turn, but I'll work on the easier stuff first.
Important: You don't need to understand any of the code to use the engine in your game, you just need to set the stats of your game's enemies on card 7. (the "Encounter" card) These are the stats for each enemy:
EnemyName$
- The name of the enemy.
EnemyCardPic
- The number of the card containing the enemy's picture.
EnemyHP
- The health of the monster when the battle begins. (should equal "EnemyMaxHP")
EnemyMaxHP
- The total health of the monster. Healing effects won't restore health above this number.
EnemyCondition$
- The status condition of the monster. ("Normal", "Poisoned", "Asleep" etc.) Should equal "Normal".
EnemyWeapon$
- The name of the enemy's weapon. Example: "The Orc attacks with its Orc Crossbow!" or "The Grey Wyrm attacks with its Dragon Talon!"
EnemyATKBase
- The minimum amount of damage inflicted when an attack hits.
EnemyATKBonus
- A random amount from 1 to this number will be  inflicted when an attack hits.
EnemyWC
- The enemy's weapon class. ("chance to hit" improvement) The base chance to hit is 50/50.
EnemyAC
- The enemy's armor class. ("chance to avoid" improvement) The base chance to avoid is 50/50.
EnemyInflictPoisonChance
- The chance for an enemy to poison the player on a successful attack hit. A random amount between 1 and this number is rolled, if the number is 1 the effect occurs. (set to 0 to remove the effect)
EnemyInflictSleepChance
- The chance for an enemy to charm the player to sleep on a successful attack hit. A random amount between 1 and this number is rolled, if the number is 1 the effect occurs. (set to 0 to remove the effect)
The you set the player's stats in the same way:
PlayerName$ = "string"
PlayerHP = value
PlayerMaxHP = value
PlayerCondition$ = "string"
PlayerWeapon$ = "string"
PlayerATKBase = value
PlayerATKBonus = value
PlayerWC = value
PlayerAC = value
PlayerInflictPoisonChance = value
PlayerInflictSleepChance = value
So all you need to do to initiate a battle is this:
EnemyName$ = "Whatever"
GOTOCARD BattleCard_Encounter
Simple, sweet, and sugar free. You can easily edit the amount of damage Poison inflicts as well as the chance of Sleep recovery by changing the vars on card 2. Anyone is free to modify and/or add to the source file, so if you can't be bothered waiting for me to implement improvements, feel free to hit the code yourselves. The vars all have easily readable names, and I've commented pretty much
every routine to make the entire thing understandable to anybody.
Suggestions and feedback would be greatly appreciated, as I'm making this for the GMG and wanna add your ideas to the engine. Also, if any of my explanations seem confusing or if there's something you don't understand, tell me and I'll explain in more detail. The engine looks a little complicated with all the vars, but I assure you it's
really easy to use.
As always: Enjoy!