public void MaximumDamageReached() { Dictionary <byte, bool> thirdSlot = new Dictionary <byte, bool>(); for (byte i = 0; i < 7; i++) //0-7 slots { thirdSlot.TryAdd(i, false); } thirdSlot[3] = true; //enabled for third slot only Objects.Weapon AK47 = new Objects.Weapon("DC01", true, thirdSlot); byte[,] damageTable = new byte[4, 3] { { 100, 80, 60 }, { 2, 0, 0 }, { 2, 0, 0 }, { 2, 0, 0 } }; AK47.SetRawDamage(50000000); AK47.SetDamageTable(damageTable); // if value > 1000, it should be set to 1000 when AK47.SetRawDamage is called if (AK47.GetDamageTo(Enums.DamageClasses.Personal, Enums.DamageLocations.Headshot, Enums.DistanceTypes.Long) == 720) { Log.Information("Weapon MAXIMUM Damage TEST: SUCESS"); } else { Log.Fatal("Weapon MAXIUM Damage TEST: FAILED"); } }
public void DamageOutput() { Dictionary <byte, bool> thirdSlot = new Dictionary <byte, bool>(); for (byte i = 0; i < 7; i++) //0-7 slots { thirdSlot.TryAdd(i, false); } thirdSlot[3] = true; //enabled for third slot only Objects.Weapon AK47 = new Objects.Weapon("DC01", true, thirdSlot); byte[,] damageTable = new byte[4, 3] { { 100, 80, 60 }, { 2, 0, 0 }, { 2, 0, 0 }, { 2, 0, 0 } }; AK47.SetRawDamage(500); AK47.SetDamageTable(damageTable); // 500 * 1,2 * 0,6 = 360 if (AK47.GetDamageTo(Enums.DamageClasses.Personal, Enums.DamageLocations.Headshot, Enums.DistanceTypes.Long) != 360) { Log.Fatal("Weapon Damage TEST: FAILED"); } else { Log.Information("Weapon Damage TEST: SUCCESS"); } }