-
Notifications
You must be signed in to change notification settings - Fork 0
/
LightarmsDamage.cs
39 lines (35 loc) · 1004 Bytes
/
LightarmsDamage.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PFW.Damage
{
class LightarmsDamage : Damage
{
public struct LightArmsData
{
public float Power;
public float HealthDamageFactor;
}
private LightArmsData _lightarmsData;
public LightarmsDamage(LightArmsData data, Target target) : base(DamageTypes.LIGHTARMS, target)
{
_lightarmsData = data;
}
public override Target CalculateDamage()
{
Target finalState = CurrentTarget;
if (finalState.Armor == 0)
{
// Deal full damage to light targets / infantry targets
finalState.Health -= _lightarmsData.Power * _lightarmsData.HealthDamageFactor;
return finalState;
}
else
{
// No damage dealt
return finalState;
}
}
}
}