-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathKiller.cs
More file actions
61 lines (47 loc) · 1.83 KB
/
Killer.cs
File metadata and controls
61 lines (47 loc) · 1.83 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using Newtonsoft.Json;
using Utilities;
namespace EddiDataDefinitions
{
// For use with the `Died` event
public class Killer
{
[PublicAPI]
public string name { get; }
[PublicAPI]
public string rating => combatRating?.localizedName;
[PublicAPI]
public string equipment => killerShip?.SpokenModel()
?? killerCmdrSuit?.localizedName
?? killerVehicle?.localizedName
?? killerNpcSuitLoadout?.localizedName
;
// Not intended to be user facing
[JsonIgnore]
private CombatRating combatRating { get; }
[JsonIgnore]
private Ship killerShip { get; }
[JsonIgnore]
private VehicleDefinition killerVehicle { get; }
[JsonIgnore]
private NpcSuitLoadout killerNpcSuitLoadout { get; }
[JsonIgnore]
private Suit killerCmdrSuit { get; }
public Killer(string edName, string edModel, CombatRating rating)
{
this.name = edName;
this.combatRating = rating;
// Might be a ship
killerShip = ShipDefinitions.FromEDModel(edModel, false);
if ( killerShip != null ) { return; }
// Might be a SRV or Fighter
killerVehicle = VehicleDefinition.EDNameExists(edModel) ? VehicleDefinition.FromEDName(edModel) : null;
if ( killerVehicle != null ) { return; }
// Might be an on foot commander
killerCmdrSuit = Suit.EDNameExists(edModel) ? Suit.FromEDName(edModel) : null;
if ( killerCmdrSuit != null ) { return; }
// Might be an on foot NPC
killerNpcSuitLoadout = NpcSuitLoadout.EDNameExists(edModel) ? NpcSuitLoadout.FromEDName(edModel) : null;
if ( killerNpcSuitLoadout != null ) { return; }
}
}
}