Attack formula for multiple actors

Skytor

Veteran
Veteran
Joined
Jul 13, 2017
Messages
33
Reaction score
1
First Language
English
Primarily Uses
N/A
Hi,

So I've been working on a project to make an empowering ability and its been a bit finicky so far.
(I would put all of the common events and stuff so far, but it would take way too long!)

so i am now working on the attack formula for the spells.

When you empower yourself you are given the state "Empowered", "Empowered 2" , "Empowered 3" or "Empowered 4"
And then the attack formula checks what state you are effected with and then power it accordingly.

a.isStateAffected(12) ? 100 + v[23] * 12 + a.mat * 2 - b.mdf * 2 : 25 * a.mat * 2 - b.mdf * 2 ;

This was the first formula I used, and it worked, but it only worked for one character so i tried to make one that detected of you had been effected with "Empowered" or "Empowered 2", it still worked for actor one but for some reason did not work for actor 2, making the damage output 0:

a.isStateAffected(12) ? 100 + v[23] * 12 + a.mat * 2 - b.mdf * 2 : a.isStateAffected(13) ? 100 + v[25] * 12 + a.mat * 2 - b.mdf * 2 : 25 * a.mat * 2 - b.mdf * 2 ;

Anyone wanna help me out and fix the formula for me, or even tell me how to fix it?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
In both of those formulas you have a *2:25
Shouldn't that be *2.25 ? Or is it done differently in Javascript than in Ruby?

I am a bit confused by the order that you describe.
In turn one I inflict myself with Empowered. Is that formula being run in the same turn, or the next? If it is the same, can it run such a check when it is only being inflicted now? But that is what you seem to be saying is happening.

If it is the next, then the player might use that skill without having inflicted Empower. Taking the second formula, you check if the actor has state 12 and spell out what happens if that is the case; similarly if the actor has state 13. What I don't see is what that formula would do if the actor has neither 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,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top