How can I write the contrary of
if ((a.isStateAffected(5))||(b.isStateAffected(5)))
if ((a.isStateAffected(5))||(b.isStateAffected(5)))
Ruby does. I don't know of any other language that does, however.
!. If for example the condition is:a.isStateAffected(5) || b.isStateAffected(5)
!(a.isStateAffected(5) || b.isStateAffected(5))
!a.isStateAffected(5) && !b.isStateAffected(5)
not (A and B) == not A or not Bnot (A or B) == not A and not Buser.isStateAffected(x) returns the value true if the battler is affected with the state with the id x and false otherwise. If we now invert that value our end result becomes false if the battler is affected with the state with the id x and true otherwise.In addition to the above explanation - there's no need for confusion because you use these two things in the exact same way.
if (myThing != true)
if (!myThing)
if (myThing != false)
if (myThing)
Original thread: https://forums.rpgmakerweb.com/threads/contrary-of-an-if.151406/