"If" Statement Always Returning True?

I'm trying to modify damage numbers during battle, but I'm running into a problem where, whenever I write an "if" statement, the thing I'm "iffing" always ends up happening, regardless of whether the "if" condition is actually met. For example, if I write:

if skill.power = 2 self.damage = 25 elsif skill.power = 3 self.damage = 100 end

then "self.damage" always returns 100, regardless of the value of skill.power, just because it was what was calculated last. Similarly, if I write:

if skill.power = 3 self.damage = 100 elsif skill.power = 2 self.damage = 25 end

then "self.damage" always returns 25. What am I doing wrong? I can't figure it out.
= is setting something equal to a value, just like in math. To check for equality, you do ==
= is setting something equal to a value, just like in math. To check for equality, you do ==
...It's always the obvious things, isn't it? Ah well, you live and learn.
= assignment (set a constant or variable to a specific value or another constant or value)
== equality (at least same class or same ID or the like)
=== identity (same object on both sides aka operands of the expression)
@kyonides This is Ruby. The === operator is used when testing equality in a case statement.

Ruby:
(3...13) === 7   # true

*hugs*
@kyonides This is Ruby. The === operator is used when testing equality in a case statement.

Ruby:
(3...13) === 7   # true

*hugs*

Yes and not. The reason why the result is true-ish is because the Range object includes number 7. Reduce the range right hand value to 6 and it will throw a false value at you. In other words, it actually tested the identiity of each of its values till it hit number 7, meaning that the comparison is true.

There's another special case:

Ruby:
range === range #=> false
range == range #=> true

Original thread: https://forums.rpgmakerweb.com/threads/if-statement-always-returning-true.156754/