From cfa3d90992648d60d3b9b4d094ea0727f20e9d7f Mon Sep 17 00:00:00 2001 From: Rafael Barreto Date: Thu, 7 Oct 2010 00:48:44 +0000 Subject: [PATCH] changing the armor values to force suicide even at 100/100 when it explodes in hand or in foot... so the max armor absorption cannot be greater than 36%, otherwise we would need to change the nade damage, and it would affect the game/weapon balance (lets think about this only after the next release) git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5722 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/entity.h | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/source/src/entity.h b/source/src/entity.h index 17b90d39..64c31b8b 100644 --- a/source/src/entity.h +++ b/source/src/entity.h @@ -339,23 +339,11 @@ public: return damage; } - /* 4-level armor - continous approach: 16%, 33%, 37%, 41% */ - int armoursection = 0; - int ad = damage; - if(armour > 25) armoursection = 1; - if(armour > 50) armoursection = 2; - if(armour > 75) armoursection = 3; - switch(armoursection) - { - case 0: ad = (int) (16.0f/25.0f * armour); break; // 16 - case 1: ad = (int) (17.0f/25.0f * armour) - 1; break; // 33 - case 2: ad = (int) (4.0f/25.0f * armour) + 25; break; // 37 - case 3: ad = (int) (4.0f/25.0f * armour) + 25; break; // 41 - default: break; - } - int rd = ad * damage/100.0f; - armour -= rd; - damage -= rd; + /* 4-level armor - semi-continous approach: 16%, 33%, 34.5%, 36% */ + int ad = armour > 25 ? damage * ( 3000 + 6 * armour ) / 10000 : ( damage * 16 ) / 100; + if(ad>armour) ad = armour; + armour -= ad; + damage -= ad; health -= damage; return damage; }