Hi everyone! I've been trying to make a skill that deals more damage the more debuffed an enemy is, and here's what I've come up with
for i in 2..7;c-=b.buffs;end;(a.atk*4-b.def*2)*(1+c*0.2)However, it always deals 0 damage even though the normal attack (which uses the a.atk*4 - b.def*2 formula) works normally and deals damage. Can anyone see what's the problem?
Damage formula question
● ARCHIVED · READ-ONLY
-
-
the damage formula doesn't recognize "buffs", and essintally you can do this, though very limitedly if the stat the skill was hitting was debuffed
maybe a skill like armor break?
anyway, you would need a script to make your current damage formula work -
If you wanna debuff a monster to get more damage you can do this that way:
Make a skill in the database, that calls a common event.
You use debuff.
So you add debuff to the creature.
Second time you use debuff, you wanna do a debuff level 2...
and so on until 7.
Am I right?
If yes here is a solution for you:
Skill Debuff.
You call a common event
In the common event:
(I make it as simple as I can so you can understand it.
If enemy is debuff 7
do nothing
end if.
If enemy is debuff 6
Remove debuff 6
Add debuff 7
end if.
If enemy is debuff 5
Remove debuff 5
Add debuff 6
end if.
If enemy is debuff 4
Remove debuff 4
Add debuff 5
end if.
If enemy is debuff 3
Remove debuff 3
Add debuff 4
end if.
If enemy is debuff 2
Remove debuff 2
Add debuff 3
end if.
If enemy is debuff 1
Remove debuff 1
Add debuff 2
end if.
If enemy is not debuff 1
If enemy is not debuff 2
If enemy is not debuff 3
If enemy is not debuff 4
If enemy is not debuff 5
If enemy is not debuff 6
If enemy is not debuff 7
Add debuff 1
end if.
end if.
end if.
end if.
end if.
end if.
end if.
this can be done with a common event as you can see.
Now you need SEVEN different debuffs of the armour.
So start from making the seven debuff states.
Then make the debuff skill.
Then make the common event.
And thus your problem became more simple to solve. -
No, what I've been trying to do is a skill that deals more damage the more debuffs the enemy has, with let's say, 15% bonus for each debuff.
So, if the enemy has 1 LV of ATK and MDEF debuffs, the skill does 130% damage.
If the enemy has 2 LVs of DEF and 1 LV of ATK debuffs, the skill does 145% damage. (not counting the increasing damage from the DEF reduction).
It's a high-tier skill for a class that specializes in debuff-applying attacks.
Anyway, I'm trying right now to implement a method into Game_battlerBase that returns the value I seek. I'll post again if I meet any roadblocks.
EDIT: just one thing. If I make more lines, "return" marks the value the defined word will retrieve? Sorry, I'm not too much used to scripting.
EDIT 2: Never mind, I got it to work. Thank you for your help :)