Need a formula for Checking states.

Ceroes

Warper
Member
Joined
Jan 22, 2019
Messages
2
Reaction score
0
First Language
English
Primarily Uses
Other
I have tried using "if (b.states.size > 0) {a.atk * 8 - b.def * 2} else {a.atk * 4 - b.def * 2}" but this does not work, I cannot seem to get b.states.size to work for any formula. This particular formula is at least producing damage but is not increasing the damage when they are afflicted by a state( poison, sleep etc.). another one I have tried is "dmg = a.atk * 4 - b.def * 2; dmg * (1 + b.states.size)" produces 0 damage always.

Now maybe I am misunderstanding, I thought b would make it check the states of my target so it would check the states my enemy has but does b in b.states.size only determine the the actors states?

Also as a bonus I would also prefer a way to grow this depending how many states are in effect but not specific ones basically I want it to be somewhat simple to determine due to how many states an enemy has like 3 the multiplication factor for the ability. This class is going to inflict states then use a skill that only if inflicted would do 2x the damage then another skill might do damage based off how many states. Again no skill is going to look for specific states just amount and yes or no they are there.
 

BlackGoldSaw

Veteran
Veteran
Joined
Oct 10, 2017
Messages
61
Reaction score
32
First Language
English
Primarily Uses
RMMV
I'm not sure about increasing damage based on total amounts of states, but for state conditions I use this:

b.isStateAffected(1) ? (a.mat * 1 - b.mdf * 1) * 2 : a.mat * 1 - b.mdf * 1
 

Silva

Scoobityboo
Veteran
Joined
Nov 5, 2018
Messages
399
Reaction score
221
First Language
English
Primarily Uses
RMMV
Try this:

Code:
b._states.length > 0 ? a.atk*8 - b.def*2 : a.atk*4 - b.def*2
If you want it to do 3x damage if there are 2 states you could try something like this:

Code:
(b._states.length + 1) * a.atk * 4 - b.def * 2
This will mean 2 states deals 3x damage, 3 states deals 4x damage and so on. If you want to add a cap to the amount the damage can by multiplied by you can use something like this:

Code:
Math.min(b._states.length + 1, 3) * a.atk * 4 - b.def * 2
This particular example will cap the damage at 3x the base damage. "Math.min(b._state.length, x)". Replace x with the cap.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
It looks like you've used an Ace formula as a reference. The terms/commands will be different for MV.
 

Ceroes

Warper
Member
Joined
Jan 22, 2019
Messages
2
Reaction score
0
First Language
English
Primarily Uses
Other
Thanks I am going to try these out, I saw a list for MV states and it just contained information on checking if it had a particular state.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top