#Want to know how I can subtract Opp health from dmg (i.e Opp - dmg)

1 messages · Page 1 of 1 (latest)

silk bear
#

<@&823670198958948373>

scarlet axle
#
void TakeDamage(int damage)
{
health -= damage;
}```
#

@silk bear

#

to call the method

#

TakeDamage(number/variable for damage);

silk bear
#

So I can implement that within the DanMove() class?

scarlet axle
#

yeah i think so

silk bear
#

Ill try it real quick and let you know. Thank you.

scarlet axle
scarlet axle
#

also you could have googled to figure this out instead of waiting so long

silk bear
#

I know but I had no idea what to even google.

#

It seemed so bizarre to my noob mind

scarlet axle
#

you can replace the name takedamage with danmove and put (int dmg) in danmove

silk bear
#

Anywhere?

scarlet axle
#

you would need to get the random number when you call the method instead of doing it inside of danmove though

#

i think its better to just if danmove is 1 TakeDamage(variable/number here); and use another method for everything else

silk bear
#

One sec. brb