public override void OnWeaponHitEntity(PlayerEntity playerEntity, DaggerfallEntity targetEntity = null)
        {
            const int chanceOfAttackSound = 10;
            const int chanceOfBarkSound   = 20;

            // Check if we killed an innocent and update satiation - do not need to be transformed
            if (KilledInnocent(targetEntity))
            {
                UpdateSatiation();
            }

            // Do nothing further if not transformed
            if (!isTransformed)
            {
                return;
            }

            // Lycanthrope characters emit both attack and bark sounds while attacking
            SoundClips customSound = SoundClips.None;

            if (infectionType == LycanthropyTypes.Werewolf)
            {
                if (Dice100.SuccessRoll(chanceOfAttackSound))
                {
                    customSound = SoundClips.EnemyWerewolfAttack;
                }
                else if (Dice100.SuccessRoll(chanceOfBarkSound))
                {
                    customSound = SoundClips.EnemyWerewolfBark;
                }
            }
            else if (infectionType == LycanthropyTypes.Wereboar)
            {
                if (Dice100.SuccessRoll(chanceOfAttackSound))
                {
                    customSound = SoundClips.EnemyWereboarAttack;
                }
                else if (Dice100.SuccessRoll(chanceOfBarkSound))
                {
                    customSound = SoundClips.EnemyWereboarBark;
                }
            }

            // Play sound through weapon
            FPSWeapon screenWeapon = GameManager.Instance.WeaponManager.ScreenWeapon;

            if (screenWeapon && customSound != SoundClips.None)
            {
                screenWeapon.PlayAttackVoice(customSound);
            }
        }
Пример #2
0
        public override void OnWeaponHitEnemy(PlayerEntity playerEntity, EnemyEntity enemyEntity)
        {
            const int chanceOfAttackSound = 10;
            const int chanceOfBarkSound   = 20;

            // Do nothing if not transformed
            if (!isTransformed)
            {
                return;
            }

            // Lycanthrope characters emit both attack and bark sounds while attacking
            SoundClips customSound = SoundClips.None;

            if (infectionType == LycanthropyTypes.Werewolf)
            {
                if (Dice100.SuccessRoll(chanceOfAttackSound))
                {
                    customSound = SoundClips.EnemyWerewolfAttack;
                }
                else if (Dice100.SuccessRoll(chanceOfBarkSound))
                {
                    customSound = SoundClips.EnemyWerewolfBark;
                }
            }
            else if (infectionType == LycanthropyTypes.Wereboar)
            {
                if (Dice100.SuccessRoll(chanceOfAttackSound))
                {
                    customSound = SoundClips.EnemyWereboarAttack;
                }
                else if (Dice100.SuccessRoll(chanceOfBarkSound))
                {
                    customSound = SoundClips.EnemyWereboarBark;
                }
            }

            // Play sound through weapon
            FPSWeapon screenWeapon = GameManager.Instance.WeaponManager.ScreenWeapon;

            if (screenWeapon && customSound != SoundClips.None)
            {
                screenWeapon.PlayAttackVoice(customSound);
            }
        }
        void PlayLycanthropeMoveSound()
        {
            // Get sound based on infection type
            SoundClips customSound = SoundClips.None;

            if (infectionType == LycanthropyTypes.Werewolf)
            {
                customSound = SoundClips.EnemyWerewolfMove;
            }
            else if (infectionType == LycanthropyTypes.Wereboar)
            {
                customSound = SoundClips.EnemyWereboarMove;
            }

            // Play sound through weapon
            FPSWeapon screenWeapon = GameManager.Instance.WeaponManager.ScreenWeapon;

            if (screenWeapon && customSound != SoundClips.None)
            {
                screenWeapon.PlayAttackVoice(customSound);
            }
        }