public void PrepareImpactOnHit(HitEvent evt, ImpactNode weapon)
        {
            ImpactComponent impact = weapon.impact;
            DamageWeakeningByTargetComponent damageWeakeningByTarget = weapon.damageWeakeningByTarget;

            base.ApplyImpactByTargetWeakening(weapon.Entity, evt.Targets, impact.ImpactForce, damageWeakeningByTarget.DamagePercent);
        }
Пример #2
0
        public void PrepareImpactOnShot(FixedUpdateEvent evt, ImpactNode weapon)
        {
            ImpactComponent impact = weapon.impact;
            DamageWeakeningByDistanceComponent damageWeakeningByDistance = weapon.damageWeakeningByDistance;
            HitTarget tankHit = weapon.streamHit.TankHit;

            if (tankHit != null)
            {
                float             deltaTime              = evt.DeltaTime;
                VulcanImpactEvent eventInstance          = new VulcanImpactEvent();
                float             hitDistance            = tankHit.HitDistance;
                float             impactWeakeningByRange = base.GetImpactWeakeningByRange(hitDistance, damageWeakeningByDistance);
                eventInstance.Force          = (((Vector3.Normalize(tankHit.HitDirection) * impact.ImpactForce) * WeaponConstants.WEAPON_FORCE_MULTIPLIER) * deltaTime) * impactWeakeningByRange;
                eventInstance.LocalHitPoint  = tankHit.LocalHitPoint;
                eventInstance.WeakeningCoeff = impactWeakeningByRange;
                Entity[] entities = new Entity[] { weapon.Entity, tankHit.Entity };
                base.NewEvent(eventInstance).AttachAll(entities).Schedule();
            }
        }