Exemplo n.º 1
0
        private static void ImprovedSlings_ResearchComplete(object sender, ResearchCompleteEventArgs e)
        {
            if (!_baseSpeed.ContainsKey(nameof(GuardSlingerJobDay)))
            {
                _baseSpeed.Add(nameof(GuardSlingerJobDay), GuardSlingerJobDay.GetGuardSettings().cooldownShot);
            }

            if (!_baseSpeed.ContainsKey(nameof(GuardSlingerJobNight)))
            {
                _baseSpeed.Add(nameof(GuardSlingerJobNight), GuardSlingerJobNight.GetGuardSettings().cooldownShot);
            }

            GuardSlingerJobDay.CachedSettings.cooldownShot   = _baseSpeed[nameof(GuardSlingerJobDay)] - (_baseSpeed[nameof(GuardSlingerJobDay)] * e.Research.Value);
            GuardSlingerJobNight.CachedSettings.cooldownShot = _baseSpeed[nameof(GuardSlingerJobNight)] - (_baseSpeed[nameof(GuardSlingerJobNight)] * e.Research.Value);
        }
Exemplo n.º 2
0
        public static void RefreshGuardSettings()
        {
            if (!WeaponGuardSettings.Contains(GuardBowJobDay.GetGuardSettings()))
            {
                WeaponGuardSettings.Add(GuardBowJobDay.GetGuardSettings());
            }

            if (!WeaponGuardSettings.Contains(GuardCrossbowJobDay.GetGuardSettings()))
            {
                WeaponGuardSettings.Add(GuardCrossbowJobDay.GetGuardSettings());
            }

            if (!WeaponGuardSettings.Contains(GuardMatchlockJobDay.GetGuardSettings()))
            {
                WeaponGuardSettings.Add(GuardMatchlockJobDay.GetGuardSettings());
            }

            if (!WeaponGuardSettings.Contains(GuardSlingerJobDay.GetGuardSettings()))
            {
                WeaponGuardSettings.Add(GuardSlingerJobDay.GetGuardSettings());
            }

            foreach (var weap in WeaponLookup)
            {
                WeaponGuardSettings.Add(new GuardBaseJob.GuardSettings
                {
                    cooldownMissingItem     = 1.5f,
                    cooldownSearchingTarget = 0.5f,
                    cooldownShot            = 3f,
                    range           = 1,
                    recruitmentItem = new InventoryItem(weap.Key, 1),
                    shootItem       = new List <InventoryItem>(),
                    shootDamage     = weap.Value.Damage,
                    OnShootAudio    = "sling",
                    OnHitAudio      = "fleshHit"
                });
            }

            WeaponGuardSettings = WeaponGuardSettings.OrderBy(w => w.shootDamage).Reverse().ToList();
        }