Exemple #1
0
        public void OnBeforeFire(WeaponBaseAgent weaponBaseAgent, WeaponSideCmd cmd)
        {
            var runTimeComponent = weaponBaseAgent.RunTimeComponent;

            if (runTimeComponent.LastAttackTimestamp == 0)
            {
            }
            else
            {
                var config = weaponBaseAgent.PistolAccuracyLogicCfg;
                if (config == null)
                {
                    return;
                }
                runTimeComponent.Accuracy = AccuracyFormula.GetPistolAccuracy(cmd.UserCmd.RenderTime - runTimeComponent.LastAttackTimestamp,
                                                                              config.AccuracyFactor, config.MinAccuracy, config.MaxAccuracy);
            }
        }
Exemple #2
0
        public void OnBeforeFire(WeaponAttackProxy attackProxy, WeaponSideCmd cmd)
        {
            var runTimeComponent = attackProxy.RuntimeComponent;

            if (runTimeComponent.LastAttackTimestamp == 0)
            {
            }
            else
            {
                var config = attackProxy.WeaponConfigAssy.S_PistolAccuracyLogicCfg;
                if (config == null)
                {
                    return;
                }
                runTimeComponent.Accuracy = AccuracyFormula.GetPistolAccuracy(cmd.UserCmd.RenderTime - runTimeComponent.LastAttackTimestamp,
                                                                              config.AccuracyFactor, config.MinAccuracy, config.MaxAccuracy);
            }
        }