|
| 1 | + |
| 2 | +using System; |
| 3 | +using System.Linq; |
| 4 | +using Utilities; |
| 5 | + |
| 6 | +namespace EddiDataDefinitions |
| 7 | +{ |
| 8 | + public class HandWeapon ( string edname, HandWeaponType type, Manufacturer manufacturer, int price ) : ResourceBasedLocalizedEDName<HandWeapon>( edname, edname ) |
| 9 | + { |
| 10 | + static HandWeapon () |
| 11 | + { |
| 12 | + resourceManager = Properties.HandWeapon.ResourceManager; |
| 13 | + resourceManager.IgnoreCase = true; |
| 14 | + missingEDNameHandler = edname => new HandWeapon( edname, null, null, 0 ); |
| 15 | + } |
| 16 | + |
| 17 | + // dummy used to ensure that the static constructor has run |
| 18 | + public HandWeapon () : this( "", null, null, 0 ) |
| 19 | + { } |
| 20 | + |
| 21 | + // Kinetic Weapons |
| 22 | + public static readonly HandWeapon KarmaAR50 = new( "Wpn_M_AssaultRifle_Kinetic_FAuto", HandWeaponType.AssaultRifle, Manufacturer.KinematicArmaments, 100000 ); |
| 23 | + public static readonly HandWeapon KarmaC44 = new( "Wpn_M_SubMachineGun_Kinetic_FAuto", HandWeaponType.SubMachineGun, Manufacturer.KinematicArmaments, 50000 ); |
| 24 | + public static readonly HandWeapon KarmaP15 = new( "Wpn_S_Pistol_Kinetic_SAuto", HandWeaponType.Pistol, Manufacturer.KinematicArmaments, 75000 ); |
| 25 | + |
| 26 | + // Thermal Weapons |
| 27 | + public static readonly HandWeapon TKAphelion = new( "Wpn_M_AssaultRifle_Laser_FAuto", HandWeaponType.AssaultRifle, Manufacturer.Takada, 100000 ); |
| 28 | + public static readonly HandWeapon TKEclipse = new( "Wpn_M_SubMachineGun_Laser_FAuto", HandWeaponType.SubMachineGun, Manufacturer.Takada, 50000 ); |
| 29 | + public static readonly HandWeapon TKZenith = new( "Wpn_S_Pistol_Laser_SAuto", HandWeaponType.Pistol, Manufacturer.Takada, 75000 ); |
| 30 | + |
| 31 | + // Plasma Weapons |
| 32 | + public static readonly HandWeapon ManticoreExecutioner = new( "Wpn_M_Sniper_Plasma_Charged", HandWeaponType.SniperRifle, Manufacturer.Manticore, 175000 ); |
| 33 | + public static readonly HandWeapon ManticoreIntimidator = new( "Wpn_M_Shotgun_Plasma_DoubleBarrel", HandWeaponType.Shotgun, Manufacturer.Manticore, 100000 ); |
| 34 | + public static readonly HandWeapon ManticoreOppressor = new( "Wpn_M_AssaultRifle_Plasma_FAuto", HandWeaponType.AssaultRifle, Manufacturer.Manticore, 125000 ); |
| 35 | + public static readonly HandWeapon ManticoreTormentor = new( "Wpn_S_Pistol_Plasma_Charged", HandWeaponType.Pistol, Manufacturer.Manticore, 50000 ); |
| 36 | + |
| 37 | + // Other Weapons |
| 38 | + public static readonly HandWeapon KarmaL6 = new( "Wpn_M_Launcher_Rocket_SAuto", HandWeaponType.RocketLauncher, Manufacturer.KinematicArmaments, 175000 ); |
| 39 | + |
| 40 | + [PublicAPI( "The weapon's type, as an object" )] |
| 41 | + public HandWeaponType type { get; } = type; |
| 42 | + |
| 43 | + [PublicAPI( "The weapon's manufacturer, as an object" )] |
| 44 | + public Manufacturer manufacturer { get; } = manufacturer; |
| 45 | + |
| 46 | + [PublicAPI( "The weapon's standard grade 1 price" )] |
| 47 | + public int price { get; } = price; |
| 48 | + |
| 49 | + public static HandWeapon FromNameOrEdName ( string edname, string name ) |
| 50 | + { |
| 51 | + var handweapon = AllOfThem.FirstOrDefault(handweapon => handweapon.edname.Equals(edname, StringComparison.OrdinalIgnoreCase)); |
| 52 | + if ( handweapon is null ) |
| 53 | + { |
| 54 | + Logging.Warn( $"Unknown hand weapon with edname '{edname}' and localized name '{name}'" ); |
| 55 | + handweapon = new HandWeapon( edname, null, null, 0 ); |
| 56 | + } |
| 57 | + return handweapon; |
| 58 | + } |
| 59 | + } |
| 60 | +} |
0 commit comments