Hey, so I've been working on balancing damage formulas in my game, and so far I've been doing alright. However, I've recently encountered a problem with the formulas on the healing spells. Right now I have the first level heal spell (single target) as "((a.mat / 2) + (b.mhp * 0.5)) / 2"... However, this kind of isn't doing what I was hoping it would... See, ideally, I'd like to have it so that when the player is level 1, the spell heals 50% of HP or higher. But when the player is at level 20, then they only get healed around 25%. That way, the lower level healing spells are super useful when it's all you know, but later the spell is not as useful, so they have to use higher level healing spells. However, I kinda don't want it to be a flat rate, like the default "damage" formula is, because I don't want Heal 1 to become completely useless by level 50. I'm not really sure how to implement that, since "((a.mat / 2) + (b.mhp * 0.5)) / a.level" is too dramatic of a curve. Any suggestions?
use a flat number to determine the power of the spell, and limit the influence of the caster's Magic stat. Code: power = 20 healing = power * (2 + a.mat * (a.lvl + a.mat))/256
Okay so, my math has never won any awards, and I'm only just starting with damage formulas. I've come up with... *something*... but I'm unsure if what I claim it is, is in fact correct. I'm betting it's not, because of what the engine decides to work out first. Here's my formula: a.atk * 4 - b.def * 2 + (a.atk * 4 / 100 * 35) Now, what I INTEND for that to do, is give a boost of 35% to the total damage of the player's normal attack. The player's current atk is 10 (the enemy's defense is 12) in my tests, so that tells me the number it should get from the equation in brackets is 14... which would mean a total attack power of 54. Yet, 62 is the number I'm getting at the moment. I'm starting to realize the formula bar isn't a calculator. Where am I going wrong? EDIT: The answer is, I'm not! I just didn't take into account the damage of the player's WEAPON! Duh.
Hey everyone Quick question! How do i check in the formula if the target is equiped with a specific type of armor or weapon? eg. if target is equiped with a sword ( weapon type 1 in the database) buff attack, if equiped with a heavy armor (armor type 3) buff defense
a.hasWeapon($dataWeapons[1]) ? effect if true : effect if false; I don't know what the code is for armor. For buffing, you probably want to add a state in the damage formula (b.addState(15),a.addState(40)) and use the state to manipulate your buffs/debuffs new question similar to above, I want to have a conditional statement based on weapon equipped... but multiple weapons. How can i shorten: a.hasWeapon($dataWeapons[1]) || a.hasWeapon($dataWeapons[4]) || a.hasWeapon($dataWeapons[9]) || a.hasWeapon($dataWeapons[17]) || a.hasWeapon($dataWeapons[20]) || a.hasWeapon($dataWeapons[5]) || a.hasWeapon($dataWeapons[21]) || a.hasWeapon($dataWeapons[3]) || ? d=2 : d=1;
You can use Array.some() to shorten that. Code: [1,4,9,17,20,5,21,3].some(function(e){return a.hasWeapon($dataWeapons[e])}) ? effect if true : effect if false
Worked like a charm, thanks New question: I want a cure spell that can be used on dead and alive allies, but if they're dead, it will revive them before curing them. Here is what I have... I can target dead allies and alive allies equally, but when cast on a dead ally it just casts on the next actor instead, leaving the dead ally dead and unhealed. a.level>5 ? d=5 : d=a.level; c=1+Math.randomInt(8)+(d) ; b.isDeathStateAffected ? b.revive() : 0; c
Edit: If anyone comes to thread, it's obviously dead and you want get help from anyone if you post here.
Hi guys, @KVG and @Ossra already showed how to check the weapon-type of the attacker. What I want to ask is how to get the ID of the target-enemy? The idea behind is, that I would like to make the damage depending on the weapon and the enemy against which it is used. For example: A pierce weapon deals less damage against a skeleton. How could a damage-formula that deals damage depending on weapon-type and enemy-type look like? Thanks for your help!
Having trouble with a 'Sacrifice" skill with yanfly skill core. I need cost to be equal to the character's current hp-1. and do that much damage. not sure if i should use custom cost, or custom eval. when using custom cost eval. can i do cost = user.hp-1 then call cost in the damage formula?
I was curious about creating a skill that would sacrifice half of the user's HP in order to heal the rest of the party equal to the amount given up. How would one go about setting up such a skill?
@Pharonix Maybe you figured it out by now; but this is my approach to that skill, in case anyone needs something similar. Set up for a "Reduce your HP to 1 and convert the amount of HP sacrificed into damage" skill. Damage formula Code: x = a.hp-1; a.setHp(1); x; @Hungry Moogle This one is kinda tricky. You'll need Yanfly's Skill Core, and Yanfly's Target Core plugins. Set up for a "Halve your HP to heal all allies equal to the amount of HP sacrificed" skill. Damage formula Code: a.hp Notebox Code: <Target: All Allies But User> <Custom HP Cost> cost = Math.ceil(a.hp / 2) </Custom HP Cost>
Thanks a lot! This actually works just as I wanted it to, including my addition of removal of Debuff status effects from allies. I just have two additional questions: 1.) Is it possible to remove the HP cost from the menu? I feel that its presence isn't necessary, especially since the skill description mentions that it halves the user's HP, also the HP cost obscures the MP cost for the ability which is a problem. 2.) I modified the formula for use with another somewhat similar skill that is intended to convert 1/4 of the user's HP into MP, and I've managed to get the skill working except for one small issue. The issue is that using the skill restores the user's MP for less than the amount of HP used, when the skill is supposed to restore the user's MP by the same amount of HP used. I'm guessing that the reason why this is happening, is that the amount of MP restored is based the user's HP after the HP cost is taken into account. I can't say for certain, and I'm not sure how to go about fixing it, so I included the formula for anyone whose willing to offer some advice into how I can fix it. Damage formula Code: a.hp * 0.25 Notebox Code: <Custom HP Cost> cost = Math.ceil(a.hp * 0.25) </Custom HP Cost>