Jump to content

Recommended Posts

Hello! I am trying to create a skill In RPG Maker VX Ace that does less damage if the target is poisoned, but I can't seem to get it to work right. I tried looking around on google, too, but I didn't find anything useful that would help me.

 

This is the damage formula I have so far: 

if b.state?(2) a.atk - b.def else 25 + (a.atk * 2) - b.def

 

And this is how I have the skill set up:

 

 


L9w8C5g.png

ILq3J1M.png

(Sorry if the black boxes are distracting, I just didn't want to give any spoilers about my game....)
 

 

 

Can anyone help me with this? I'm completely lost...

 

Edited by raymi100

Share this post


Link to post
Share on other sites

A better way is to use 'then', it's made for exactly this situation:

if b.state?(2) then a.atk - b.def else 25 + (a.atk * 2) - b.def end

Might be a newer ruby feature though?

 

Personally I prefer using the trinary operator, like this:

 

b.state?(2) ? a.atk - b.def : 25 + (a.atk * 2) - b.def

It makes the formula much shorter.

Edited by Kayzee

Share this post


Link to post
Share on other sites
On 8/21/2017 at 8:06 PM, Lord Vectra said:

if b.state?(2); a.atk - b.def; else; 25 + (a.atk * 2) - b.def; end

 

You forgot an "end" at the end, forgot to put a semi-colon before and after "else", and you forgot to put a semi-colon after "if b.state?(2)"

 

On 8/22/2017 at 3:19 PM, Kayzee said:

A better way is to use 'then', it's made for exactly this situation:


if b.state?(2) then a.atk - b.def else 25 + (a.atk * 2) - b.def end

Might be a newer ruby feature though?

 

Personally I prefer using the trinary operator, like this:

 


b.state?(2) ? a.atk - b.def : 25 + (a.atk * 2) - b.def

It makes the formula much shorter.

Thanks to both of you! Now the skill works perfectly :D This can be closed~ :) 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×