View Single Post
dirka_dirka
Veteran Member
Join Date: Nov 2009
Old 06-04-2010 , 20:50   [L4D2] Acid Swipe 1.2
Reply With Quote #16

I wanted to change how the DoT works to make it more like a spitter puddle. While doing that, I implemented the changes that needed to be done (in my above post). i also added hooks to the cvars so they can be changed on the fly..

The acid swipe is more like how a spitters puddle works: damage increases as time passes. Except you can get out of a puddle. To reduce this damage you have to stop the swiping.

I also didn't want the scratch to be too over powered.. so I set it up to have the first scratch be normal, and then increase in power with each additional scratch..

The default values I have in the plugin:
damage is 0.125 + previous damage from previous tick (eg: after 2 ticks its 0.25 and after 3 its 0.375).
if damage is < 1 - it is applied as 0, but the player 'feels' damage
rate is 0.25 seconds (victim takes damage 4 times a second)
duration is 2.0 seconds (total of 8 DoT's + swipe damage)
stack duration is 1.0 seconds (+4 DoT's per swipe)

The first damage is applied at time 0, and because of the ramping nature of the damage, I also reduced the claw damage from 4 to 2

How the changes work:
This means the first claw is normal damage (4), but every swipe after that is +25% damage (2 swipes is +25%, 3 swipes is +50%)..
5 swipes would result is double the normal damage.
9 swipes and the player is incapped from 100 (full) health with 0.25 seconds (and 5 more damage) remaining on the DoT. total damage from 9 swipes is triple what would normally occur.

as you can see below.. the player doesn't actually take damage for the first 1.5 seconds of the swipe, but he thinks he is..
Code:
spitter_pz_claw_dmg 2
                  Effective          # of       Claw
Time    Damage    Damage    Total    Scratch    Damage    Total DoT
0.00    0.125     0         0        1          2          2
0.25    0.250     0         0                              2
0.50    0.375     0         0                              2
0.75    0.500     0         0                              2
1.00    0.625     0         0                              2
1.25    0.750     0         0                              2
1.50    0.875     0         0                              2
1.75    1.000     1         1                              3
2.00    1.125     1         2                              4     .. 1 claw is normally 4 damage, so normal damage
2.25    1.250     1         3        2          4          7
2.50    1.375     1         4                              8
2.75    1.500     1         5                              9
3.00    1.625     1         6                              10    .. 2 claws are 2x4=8 damage, so +25% damage
3.25    1.750     1         7        3          6          13
3.50    1.875     1         8                              14
3.75    2.000     2         10                             16
4.00    2.125     2         12                             18    .. 3 claws 3x4=12, +50% damage
4.25    2.250     2         14       4          8          22
4.50    2.375     2         16                             24
4.75    2.500     2         18                             26
5.00    2.625     2         20                             28    .. 4 claws =16, +75% dmg
5.25    2.750     2         22       5          10         32
5.50    2.875     2         24                             34
5.75    3.000     3         27                             37
6.00    3.125     3         30                             40    .. 5 claws =20, double (+100%) dmg
6.25    3.250     3         33       6          12         45
6.50    3.375     3         36                             48
6.75    3.500     3         39                             51
7.00    3.625     3         42                             54    .. 6 claws =24, +125%
7.25    3.750     3         45       7          14         59
7.50    3.875     3         48                             62
7.75    4.000     4         52                             66
8.00    4.125     4         56                             70    .. 7 claws =28, +150%
8.25    4.250     4         60       8          16         76
8.50    4.375     4         64                             80
8.75    4.500     4         68                             84
9.00    4.625     4         72                             88    .. 8 = 32, +175%
9.25    4.750     4         76       9          18         94
9.50    4.875     4         80                             98
9.75    5.000     5         85                             103   .. INCAP
10.00   5.125     5         90                             108   .. 9 = 36, triple dmg or +200%
list of changes:
Code:
/*
    Version 1.2:
        Created globals for all the ConVars so calculations/lookups only have to be made once.
        Added hooks to all the convar changes (another reason why they are global).
        Changed the DoT from int time/damage to floats. This allows for more options.
        Added a rate ConVar so you can do damage at 0.1 second intervals or 10 (or more) second intervals.. not just 1 second.
        Created handles to the timers so they can be properly closed as needed.
        Made the plugin cvar not record in the config file.
        Added some color to the messages.
*/
** WARNING ** A low rate combined with a high damage and/or duration(+stack) WILL kill players quickly. eg:
Just doubling the damage will incap a 100hp player with 6 swipes.
Increasing the duration to 10 seconds (and using other values at default) will incap a player in 1 swipe.
Decreasing the rate to the min 0.1 and keeping the other values default, only takes 3 swipes and 3.9 seconds to incap someone.

Im not sure if it was my testing with bots or if it has to do with how the damage is applied.. but i did get an occational +1 damage per swipe after the first (eg: 3 swipes would do 19 instead of the 18 it should have, 4 swipes would do 29 or 30 - instead of the 28 that it should). I'll have to get back to that issue later, maybe do a check of health to see if it is what i expect (as long as its not due to math rounding issues), and if not tweak it.

Anyway, if the author wants to apply my change to the DoT, go for it.. otherwise, at least apply the fixes to the existing code.
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_acidswipe.sp - 532 views - 12.3 KB)
dirka_dirka is offline