Alright, at the moment it works like:
1) min damage is 0.
For weapons attack power is
attack = (a.attack + self.effect) * self.multiplier
Though weapons don't have anything like that.
Should I add effect and multiplier fields to jsons?For magic it's attack = (a.magic + self.effect) * self.multiplier.
Now I see why spells are so OP, I'll change spells stats However,
we use pure normal defense against magic based attacks. I want to change the formula, making it based on defense, magic and intelligence.2) Damage from weapons is based on the difference between attack and defense:
if (t.defence < 1):
defence = 2 - t.defence
damage = attack * defence
This is a weird code. Not sure why you cannot justif (t.defence < 1):
damage = attack * 2
Unless you expect negative defence, which probably should not even exist.
And for normal defense damage = (attack/t.defence) + 0.5.
Then we take a random number between 0.8 and 1.2, as rand, and
damage = int(float(damage) * multiplier * 10 * rand)
It works surprisingly well. You will have 15 damage if attack=defense, and in order to have damage 200 attack should be 19 times more than defense, so you clearly don't have enough training in the case if that's the damage made by enemies.
3) Multiplier means critical hits and elemental affinities.
Critical hit:
if dice(10):
if (a.luck >= t.luck and dice(max(50, a.luck*2))) or dice(50)
So thanks to that "or dice(50)" the chance always will be 5% at very least. With max luck it will be 10% at best.
That makes negative luck not a major issue, and makes max luck not a very big advantage. I want to change a bit crit hit chance, especially add bonuses based on occupation (warriors in general, assassin especially). Meaning a new field for traits.
Critical hit makes multiplier from the damage formula 2.5, thus makes it 2.5 times more.
I want to change the damage of crit hits based on weapon type. Daggers will have more crit damage, and so on. But don't know how. I don't think we can use char.eqslots["weapon"].type inside BE, since BE doesn't know about equipment screen.For spells it simply adds or removes % of damage based on elemental traits.
4) Poison:
- (magic + intelligence) should be more than target's
- cannot be poisoned again if already poisoned.
I don't like it, it should reset the amount of turns left for poison.- base damage = t.get_max("health") * (self.effect/1000.0). Ie based on target's max health.
-
then we have a weird line damage = max(randint(18, 22), int(damage) + randint(-4, 4)). So it can never be less than 18. That's pretty high for weak chars.
Also I don't see where you control the amount of turns which the poison will work.5) Healing:
- base amount of healed points is (effect + (char.intelligence + char.magic) * 0.25)*multiplier
It's sufficient for now, since we don't have many healing spells. In the future though I want to limit the power of weak spells, making high level ones much more useful for high levels.