Thecatman
A 10 land kingdom should not be able to successfully cast on a 100. Land kingdom.
IMO spell success should be dependent on the kingdom being cast on.
I’m bored and at work so somethin like this. This is quick and dirty and 100% AI.
Spell Success System (Pass/Fail with Feedback)
- Purpose
Determine whether a spell cast by one kingdom succeeds or fails based on a combination of:
• Power (wizards, magic schools)
• Target size and defenses (land, buffs, resistances)
• Caster limitations (debuffs)
• Random magic variability
• Spell difficulty
Variables Explained
Variable
Meaning
W_used
Number of wizards used by the caster for the spell
Schools
Number of magic schools owned by the caster
T_land
Land size of the target kingdom
D_base
Base difficulty of the spell (higher = harder)
CasterBuffs
% bonuses improving caster’s spellcasting power (e.g. +0.15 for +15%)
CasterDebuffs
% penalties hindering the caster (e.g. 0.10 = -10%)
TargetResistance
Natural magic resistance of the target (e.g. 0.25 = 25%)
TargetBuffs
Active magical buffs protecting the target from hostile spells (e.g. shields)
RandomFactor
A randomly generated value between -10 and +10
Roll
A randomly generated number between 0 and 100 to determine final result
Clamp[x, 0, 100]
Limits a value to stay within 0 and 100
Logic Flow (What Happens Step by Step)
- Raw spell power is calculated based on wizards, school density vs. target land, and base difficulty.
- That power is modified by buffs, debuffs, resistances, and defenses.
- Random variation is added to simulate chaos of magic.
- A final chance to succeed is produced and clamped between 0–100.
- A roll is made (0–100) and compared to that chance.
- The spell succeeds if the roll is equal to or below the final chance.
⸻
- Feedback Messages (Optional Game Text)
On Success:
• “The spell pierces through the arcane barriers! Success.”
• “Your wizards overpower the enemy’s defenses. The spell lands cleanly.”
• “Magical precision triumphs. The spell is successful!”
On Failure:
• If TargetBuffs > 0.3: “The target’s magical wards deflect your spell.”
• If TargetResistance > 0.3: “The spell fizzles—too much innate resistance to overcome.”
• If CasterDebuffs > 0.2: “Your magic falters under adverse conditions. The spell fails.”
• If FinalChance < 10: “Your wizards attempt the impossible. The spell does not take hold.”
• Default: “The spell dissipates before reaching the target. Try again.”
Formula.
RawChance = (W_used / (T_land + 1)) * ((Schools / T_land) * 100) / D_base
ModifiedChance = RawChance
* (1 + CasterBuffs - CasterDebuffs)
* (1 - TargetResistance)
* (1 - TargetBuffs)
FinalChance = Clamp[ ModifiedChance + RandomFactor, 0, 100 ]
Roll = Random(0, 100)
Spell Succeeds if: Roll <= FinalChance