Here's an overview of what I'm after for a basic combat engine, as far as specs go. Tell me, if one or more of you could, if this makes sense and/or would be too hard to code. I should think not, but I'm not a programmer either.
Statistics
Each entity capable of combat will have various statistics which govern how well they can perform. Below, I will discuss each.
HP: hit points. If this drops to 0, the entity is incapacitated and unable to battle unless revived by an ally.
MP: mana points. This governs the use of magical spells. If MP reaches 0, all skills which would consume MP are no longer available. MP can be healed in or out of battle using items if necessary.
Stamina: This is a gauge of your ability to perform actions. Characters begin a fight with 25 stamina (this can be enhanced with equipment or augmentation, see far below). Regular attacks use up 2 stamina, using an item (on you or on someone else) uses 1. Defending uses up 2 stamina as well. The Wait command will leave the waiting character completely helpless but restores 5 stamina. Stamina naturally recovers at a rate of 1 every round, and there are somewhat rare items which can be used to refill stamina, though it should be noted that many of these may damage the user's HP or MP as payment. Magic does not require stamina, because it requires MP, but physical skills can have costs anywhere from 3 to 12 stamina depending on their power and usefulness. Management of stamina will be an integral part of battle strategy.
Accuracy and Agility
These stats determine how often hits land and how often hits are dodged. If your accuracy and an enemy's agility are equal, the chance of a hit is 75 percent. For every point of difference either way, the percentage goes up or down by 1, to a minimum of 10% and a maximum of 95%. For instance, if you have 10 accuracy and your opponent has 8 agility, you have a 77 percent chance to hit them. If they have 100 agility, you only have a 10% chance to hit them.
Note: Accuracy and agility figure into physical attacks only. Some physical skills have agility and/or accuracy modifiers when used, such that a particularly wild attack might be less accurate, or a low-damage attack might be particularly so. Some skills will grant the user extra agility, followed on the round after by an attack which would then remove the agility bonus.
Focus and Foresight
Focus is the accuracy of your magic, and foresight is one's ability to dodge magic. Owing to the more costly aspect of magic, the base chance to hit is 85 percent instead of 75 percent, and it takes 3 points to change the percentage by 1 either way. For instance, if your focus is 100 and your enemy's foresight is 79, you have a 92% chance to hit. Unlike melee, magic may reach a maximum of 100 percent (which would take a minimum of 45 points of difference between your focus and your enemy's lower foresight). Also different from melee, magic's base chance to hit can never drop below 30%.
Damage and Armour
Damage, in this case, refers to how much pain you dish out with physical attacks. Damage is a fixed number, and equipping a weapon directly modifies it. For instance, a character whose damage is 14 who equips a sword whose damage is 4-6 now has a damage potential of 18-20.
Characters will gain bonuses to their damage as they level, or by using certain items.
Damage compares directly to armour to determine how much an enemy is hurt. The overall damage number is calculated first, then it is compared to the enemy's armour number. If the damage number is higher, the difference is dealt to the enemy as HP loss.
Example: damage of 20-23, armour of 6-6. Damage will be 14-17 (rolled randomly).
Armour is another fairly innate stat which can be enhanced by certain items and/or events. It will probably never become as godly as damage, and some characters are naturally more armoured than others. Wearing armour which has an armour rating naturally boosts this stat further.
Slash, Bash and Thrust
Weapons do different types of damage, and naturally, certain monsters are more resistant to certain types of attack...or weak to them, as may be the case. It may not be wise to use a sword on a stone golem, but using a hammer might work well, for instance.
Certain weapons will add a damage modifier while equipped, such as Bash+4. This means that any attack which uses the bash damage type would have 4 automatically added to its damage before calculating how badly the enemy will be hurt. It also means that attacks of a differing damage type will be unavailable. No using Tendon Slice while wielding a hammer. Certain armour will have modifiers against certain types of damage as well. A crystal breastplate might, for instance, have thrust+3 and bash -5, which means that it will help you resist thrusting attacks but will lower your armour against bashing attacks by 5.
Note: these single numbers will modify both sides of a spread...so if a spread is 3-5 and the modifier is +4, then the spread is now 7-9.
Examples
Jann uses a glittering rapier with a damage rating of 8-12 (thrust+6) to attack a stone golem (bash-5, thrust+7).
Jan's natural damage is 7. The golem's natural armour is 11.
Jann's damage is: 7+(rand 8-12)+6 = thrust damage of 21-25
Golem's armour is: 11+7 = 18
Thus, you would roll a number between 21 and 25, then remove 18 from that number, and that's how much the golem is hurt for.
Please note: certain characters can and will get bonuses to specific damage types as they level, so it will not be quite so easy to simply switch all characters to using a weapon of a certain type. This may help, but it will not be so crushingly advantageous as it might appear.
Magic Attack and Magic Defense
For want of better terms, these determine how much oomph your spells pack, and how well you can survive when hit with spells.
This is handled in much the same way as damage and armour. Certain pieces of equipment will augment your magic damage, and certain heavier pieces of armour, for instance, may impede it. Nonelemental magic is rare, however, and thus, most magic will be of an elemental type.
Earth, Water, Air and Fire
Much like slash, bash and thrust, these are specifics of magic damage. If you are using a Fireball spell, its damage will obviously be fire. Your magic damage will be calculated by taking your natural magical attack, then adding the spell damage on top of it, then factoring in the enemy's resistance to (or weakness to) that elemental type.
Many enemies will have no elemental affinity to worry about, but some certainly will. Observe an example:
Breck uses Chill Cascade (+12-18 water) on a Lava Beast (fire+9999, water -20).
Breck's magic attack is 13, and the Lava beast's magic defense is 9
Breck's overall damage with the spell in question is:
13+(rand 12-18) = 25-31
Lava Beast's overall magic defense is 9+(-20) = -11 (he will take 11 more damage since this is a water spell
Thus, the damage he will take from this spell is 36-42 because he is weak to water
See how this beast had 9999 fire defense? You will categorically never be able to have such high numbers without cheating, so you will not be able to hurt the beast with fire.
Each player in your party will choose one sphere of magic. Once that sphere is chosen, it will be unavailable to the other party members. As such, once a sphere of magic is chosen, the player will slowly gain innate damage boosts when using that element.
Speed
This stat has no other function except to determine who strikes first on any given combat round. It is a fixed number to begin with, but which will slowly go up as characters level. Some equipment can greatly raise one's speed, but usually at the cost of providing little in the way of protection or other benefits.
A quick note about speed: as you become wounded, your speed drops. For every 10% below your max HP you fall, your speed will correspondingly drop. Barring other skills which may override this mechanic, this will mean that having a party at fairly low health is a really excellent way to get it killed by a large group of enemies.
A few finishing notes, for now
1. If the accuracy/agility or focus/foresight check yields a miss, the game does not need to calculate any further. A miss is a wasted attack and yields no damage, generating only a miss message.
2. Damage or magic damage that is lower than armour or magic defense yields a result of 0. The game will generate a message such as "Jann attacks the Stone Golem with her shimmering rapier, but the foe shrugged off the blow", or "Breck uses Lavastorm on the Lava Beast, but it seems unaffected".
3. If there are enemies or bosses who possess attacks which can be cancelled by successfully attacking them while they charge, damage must be dealt in order for the interrupt to succeed. Attacking something for 0 damage will not sufficiently break its concentration.
4. If a weapon possesses a modifier to a damage type, it goes without saying that the damage type it will inflict will match. If a fire rod gives you a +3 to fire and a +1 to bash, then you apply both. If a Soulrender gives you +20 to slash, then it will be a slashing weapon.
5. Some enemies, or rare pieces of equipment, may possess a trait known as "eater" or "absorb". This will only be true for magical elements, and not physical damage types. In such a case, using an element on an affected entity will cause whatever the damage would otherwise have been to be added to the target's HP total instead of removing it. In this way, it is not possible to give an enemy more than its max HP, but obviously, attacking something that absorbs your element of choice probably isn't going to work well.
6. When a weapon possesses a magical element (and it will happen, albeit not too often), calculating how much damage is done becomes more complicated:
a) If a skill is being used, and the skill has a damage type ascribed to it, then that damage bonus is also applied
B) In a case such as this, all bonuses are figured in, and all resistances or weaknesses of the enemy are also figured in.
Observe:
Jayde is wielding a Lightbringer (5-10 damage, fire+4, slash+7) sword.
Jayde's damage is 14, and her innate slash proficiency is 3. Her innate fire proficiency is only 2.
She wants to use a skill called Tendon Slice. This skill does 13-17 slash damage.
So here's how you calculate how much she's going to hurt her foe for:
Slash damage = 14+3+7+(rand 5-10)+(rand 13-17) = 41-50
Fire damage = 4+2 = 6
Total damage = 47-56
This is the damage she would do against an enemy not resistant or weak to slashing attacks, and not resistant or weak to fire attacks.
In order to deal with a case where resistance or weakness would factor in, the calculations for armour and magic defense are done in that order.
In text, player-side, you might see something like:
Jayde uses Tendon Slice on the angry goblin, dealing 27 damage
The flames on Jayde's Lightbringer deal an additional 3 damage
This way, if a monster is weak to slashing attacks but happens to absorb fire, you will hit it hard with the physical part of the attack but will heal it with the fire you wield.
...Complicated, I know, but there it is.
One last note on this subject, but magic spells will probably never use slash, bash or thrust damage types. I suppose I could do that, but it seems like a lot more work. In that instance, however, the magical part of the damage would be calculated first, and the slash/bash/thrust stuff would be an after-effect. The difference here is that you don't need a weapon to cast magic, but you will need a weapon for many of these skills. Magic, lacking a specific instrument, will probably not be stuck delivering random slash/bash/thrust damage because of the weapon the magic user is holding.
Thanks for reading. Do tell me your thoughts.
Check out my Manamon text walkthrough at the following link:
https://www.dropbox.com/s/z8ls3rc3f4mkb … n.txt?dl=1