- Joined
- May 15, 2012
- Messages
- 14,682
- Reaction score
- 3,003
- First Language
- Tagalog
- Primarily Uses
- RMVXA
Use this on the damage formula
if (a.hp > b.hp) {b.addState(State_ID)};
if (a.hp > b.hp) {b.addState(State_ID)};
Oooh i dont need the question mark like with other formulas?Use this on the damage formula
if (a.hp > b.hp) {b.addState(State_ID)};
Thats for a different format or a different formula.Oooh i dont need the question mark like with other formulas?
I was wondering if some can help me out here with a formula. I dont want this specific skill to actually deal damage.
What i need is like a Rock, Paper, Scissor format.
So the user will use skill, i want the formula to check for user Hp amount and targets HP amount.
---> If users HP is greater than targets HP ---> add (x) state to target.
The second skill works similar to the first.
--User uses skill, --> check if user HP is greater than targets --> apply (x) state to user & target.
I feel like i need to declare a varible somewhere.
a.mhp > b.mhp ? addState(stateId) : 0
a.paramPlus(3) will reference the user's defense gained from equipment.Hello, I'm currently making a damage formula for a class that use bare-hands (Asura) and I would like to make the close combat skills damage based on the defense of the gloves and shoes in the equipment. I've been searching if we can call the equipment stats in the damage formula but haven't found anything yet.
Is it possible to do so?
Its not quite the answer you're looking for, but one work around I can come up with, is to have each battle start with an event that checks the party members currently equipped gear.Thanks for the answer, but is it possible to get the exact value the user got from specific equipment?
My ideal is to create a class that focus on Kick, so damage formula is based on Shoes defense, and a class with close combat that has damage formula based on both Gloves + Shoes defense.
Yes, you can just call a function. For example, lets take the first new file I create in almost any project- _formula.js, where I put any sufficiently complex code snippets I want to re-use later. Here's a typical entry:Ok, so I have this damage formula, but it have a lot of if and elses, and I pretend to put more.
there is a way to just call a function with all the formula?
My formula right now:
dp = (a.atk*2 - b.def*1.5);dr = (a.agi*2 - b.def*1.5);dm = (a.mat*2 - b.mdf*1.5);((a.isActor() && a.weapons()[0]) ? c = a.weapons()[0].wtypeId : c = 10000);(c<10000 ? ((c===30 || c===31 || c===32 || c===33) ? d = dr : ((c===42 || c===43 || c===44 || c===45 || c===46) ? d = dm : d = dp)) : d = dp);
c is the weapon type and d is the damage. dp is physical weapons, dr is ranged weapons and dm is magical weapons (like wands and staffs).
(If there's an easier way to write this, I apreciate any kind of help )
// physical atk-def formula, minimum damage 1
var physDmg = function(a, b) {
var atk = a.atk;
var def = b.def;
return Math.min(a.atk - b.def, 1);
};
// magical atk-def formula, minimum damage 1
var magDmg = function(a, b) {
var atk = a.mat;
var def = b.mdf;
return Math.min(a.atk - b.def, 1);
};
// speed-based damage, greatly reduced if you're slower
var swiftStrikeDmg = function(a, b) {
var atk = a.agi;
var def = b.agi;
if (atk > def) return atk;
else return 0;
}
I'd like to point out that a formula that complicated likely will not function as is, as there seems to be a point where too many operations in the damage formula just causes the engine to throw it away.Ok, so I have this damage formula, but it have a lot of if and elses, and I pretend to put more.
there is a way to just call a function with all the formula?
My formula right now:
dp = (a.atk*2 - b.def*1.5);dr = (a.agi*2 - b.def*1.5);dm = (a.mat*2 - b.mdf*1.5);((a.isActor() && a.weapons()[0]) ? c = a.weapons()[0].wtypeId : c = 10000);(c<10000 ? ((c===30 || c===31 || c===32 || c===33) ? d = dr : ((c===42 || c===43 || c===44 || c===45 || c===46) ? d = dm : d = dp)) : d = dp);
c is the weapon type and d is the damage. dp is physical weapons, dr is ranged weapons and dm is magical weapons (like wands and staffs).
(If there's an easier way to write this, I apreciate any kind of help )
Yes, you can just call a function. For example, lets take the first new file I create in almost any project- _formula.js, where I put any sufficiently complex code snippets I want to re-use later. Here's a typical entry:
[...]
Yes, I thought of that too. But this one worked, as I tested, but I need a bigger formula to cover everything.I'd like to point out that a formula that complicated likely will not function as is, as there seems to be a point where too many operations in the damage formula just causes the engine to throw it away.
That's not based on the size or complexity of the formula. It throws it away if there's an error in the formula. Of course, a large and complex formula is more likely to have errors, especially if you're writing it directly in the damage formula box...I'd like to point out that a formula that complicated likely will not function as is, as there seems to be a point where too many operations in the damage formula just causes the engine to throw it away.
so what I ended up finding was that the proper way to query the value was withI know that you can find the switches by using:
$dataSystem.switches[id]
id being the switch id. But I don't remember how to say if it's on or off.
so what I ended up finding was that the proper way to query the value was with
$gameSwitches.value(122) === true
so this worked for me as a damage formula
$gameSwitches.value(122) === true ? 10000 : 25;
a.tp
instead of a.TP
.