Author Topic: How does armor damage buffing work?  (Read 1881 times)

Reason I ask is because I'm giving it a go and I have no idea as to what I'm doing.

Code taken from Gravity Cats military gear
Code: [Select]
   if(%obj.getMountedImage(2).getName() $= "gc_BucketMountedImage")
      if(getWord(%pos,2) > getWord(%obj.getWorldBoxCenter(),2) - 3.3*getWord(%obj.getScale(),2))
        %damage *= 0.9;
So how does it work?
What I want is how to make a 100% and 200% body armor stuff
« Last Edit: October 30, 2015, 09:50:32 AM by Space1255 »

The code you posted first checks if they're wearing the armor. Then checks if you were it above the armor. Then multipliers the damage by 0.9. So if they were hurt by a weapon that deals 90 damage then 90 x 0.9 = 81. The armor just stopped 9 damage.

What I want is how to make a 100% and 200% body armor stuff
What do you mean? If they're protected 100% then they can't get hurt, so why go to 200%, which is the same as 100%?

The code you posted first checks if they're wearing the armor. Then checks if you were it above the armor. Then multipliers the damage by 0.9. So if they were hurt by a weapon that deals 90 damage then 90 x 0.9 = 81. The armor just stopped 9 damage.
Ah, thanks for answering.
What do you mean? If they're protected 100% then they can't get hurt, so why go to 200%, which is the same as 100%?
Oh, oops
Since I'm here, how does buffing damage work? I'll post its code later since I'm in class.
Here it is
Code: [Select]
    if(isObject(%sourceObject.client.player)) {
    if(isObject(%sourceObject.client.player.getMountedImage(2))) {
    if(%sourceObject.client.player.getMountedImage(2).getName() $= "gc_BeretRedMountedImage")
      %damage *= 1.2;
    if(%sourceObject.client.player.getMountedImage(2).getName() $= "gc_BandanaMountedImage")
      %damage *= 1.1; } }
    parent::Damage(%this,%obj,%sourceObject,%pos,%damage,%damageType);
  }

« Last Edit: October 30, 2015, 09:50:23 AM by Space1255 »

What do you mean? If they're protected 100% then they can't get hurt, so why go to 200%, which is the same as 100%?
He probably means that it should increase the players total health by 100/200%, so they'd have 200/300 hp while wearing the armor?


He probably means that it should increase the players total health by 100/200%, so they'd have 200/300 hp while wearing the armor?
Nah, it was a typo, I meant attack buff but I was hurrying finishing up because it was between classes. Sorry for my rushed typing

I meant attack buff
Ooh

Personally I'd stay away from using gravity cats stuff as reference because his formatting is consistently a mess (lack of indenting and trying to smush things into one line )and not friendly for beginners (assuming you are one) to understand
« Last Edit: October 30, 2015, 11:57:03 AM by Headcrab Zombie »

Oh. Well I'm too deep in to turn around so may as well take this challenge. So how does buffing damage work with items?

Package the damage method, check if the player has a certain image mounted, then multiply %damage

Alright, thanks.
Actually wait, if the damage is multiplied by 0.X, does it decrease damage dealt or taken? Similarly, does multiplying it by 1.X increase damage or protection?
« Last Edit: October 30, 2015, 12:07:28 PM by Space1255 »

Alright, thanks.
Actually wait, if the damage is multiplied by 0.X, does it decrease damage dealt or taken? Similarly, does multiplying it by 1.X increase damage or protection?
Multiplying by a number less than 1 will decrease damage, above 1 will increase damage


What do you mean by overall? Damage is applied directly as a number...?

Ex: bullet does 20 damage
if the damage value is multiplied by a float/double < 1, it will do less damage (ex: 20 * .5 = 10)
if the damage value is multiplied by a float/double > 1, it will do more damage (ex: 20 * 1.5 = 30)

think of damage reduction/addition as just modifying the damage that would normally have been taken.

Ah, I see. And by overall, I meant taken AND dealt, my bad.

I.E. If you have 10% protection and you shoot something, you lose 10% of its power, and if you get shot, you nullify 10%
« Last Edit: October 30, 2015, 02:40:42 PM by Space1255 »

there should be a way to adjust the damage of any projectiles or whatever fired by the player. Look up the "invulnerable" player on an rtb archive; iirc it both disabled damage on the player and prevented them from damaging anyone else.