Originally Posted by EFFx
Yeah, when I reload the thread I thought about that way...
Lemme ask you a question, how would you suggest to manage the damage when the bullet gets through a wall? Like damage / times_that_the_bullet_gets_through_the_wall?
To do this accurately one must know:
Weapon base damage, Texture(type of a wall), ammo type penetration(this can be researched on youtube since there are tons of movies about ammo penetration), distance.
For example you hit wall with texture duct_XXX. So you've hit a ventilation shaft. We are gonna ignore thickness to real life comparison cause vent on cs_assault is simplified for editing(and it's quite thick). We can even do multiple wallshots since awp ammo could propably penetrate like 10 or more thin vent metal plates.
Let's simplify walls, group them into two groups where one only checks if the bullet reached max penetration length and the other checks penetration length, give them damage reduction points:
This is DR per penetration, piercing ammo type divides this by 2, also we must add max penetration(8 or 16 game units/inches):
wooden door 20
metal door 35
metal plate 45
This is DR per inch of penetration, piercing ammo type divides this by 2:
concrete wall 7-15(i'm not sure, but I think we should pick a number from this range)
wooden wall 7-15
thick metal door
lets say normal ammo distance check looks like this:
damage *= (3000.0 - distance) / 3000.0
damage *= (6000.0 - distance) / 6000.0
damage *= (1500.0 - distance) / 1500.0
AK47 through wooden door, distance 1000u:
36 * 0.84 - (20 / 2) = ~ 20 damage
(weapon base damage * distance modifier - (damage reduction from penetration / 2 because ammo is piercing)
AK47 through 3 units thick concrete wall, distance 2000u:
36 * 0.66 - ( (15 / 2) * 3) = 1.26 damage
(bullet HP * distance modifier - ((damage reduction from penetration / 2 because ammo is piercing) * 3 inches)
When fired bullet starts with it's base weapon damage as HP number and with each penetration the bullets HP decreases. When it reaches 0 it's removed from the game.
Texture names and wall types should be listed in a config file, also the plugin should support debug mode where it displays texture name on screen where the player is aiming.