raymi100 291 Posted August 21, 2017 (edited) 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: (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 August 21, 2017 by raymi100 Share this post Link to post Share on other sites
Lord Vectra 414 Posted August 22, 2017 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)" 1 Share this post Link to post Share on other sites
Kayzee 4,032 Posted August 22, 2017 (edited) 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 August 22, 2017 by Kayzee 1 Share this post Link to post Share on other sites
raymi100 291 Posted August 25, 2017 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 This can be closed~ 1 Share this post Link to post Share on other sites