Beispiel #1
0
        public void PrepareHitByUnblockedWeapon(SendHitToServerIfNeedEvent evt, UnblockedWeaponNode weapon)
        {
            DirectionData bestDirection = evt.TargetingData.BestDirection;

            if (bestDirection.HasAnyHit())
            {
                SplashHitData splashHit = SplashHitData.CreateSplashHitData(HitTargetAdapter.Adapt(bestDirection.Targets), bestDirection.StaticHit, weapon.Entity);
                base.ScheduleEvent(new CollectSplashTargetsEvent(splashHit), weapon);
            }
        }
Beispiel #2
0
        public void PrepareSplashTargetsWhenBlockedWeapon(ShotPrepareEvent evt, BlockedWeaponNode weapon)
        {
            WeaponBlockedComponent weaponBlocked = weapon.weaponBlocked;
            StaticHit staticHit = new StaticHit {
                Position = weaponBlocked.BlockPoint,
                Normal   = weaponBlocked.BlockNormal
            };
            SplashHitData splashHit = SplashHitData.CreateSplashHitData(new List <HitTarget>(), staticHit, weapon.Entity);

            base.ScheduleEvent(new CollectSplashTargetsEvent(splashHit), weapon);
        }
Beispiel #3
0
        public static void ExecuteSplashExplosion(Entity mine, Entity tank, Vector3 splashCenter)
        {
            StaticHit staticHit = new StaticHit {
                Normal   = Vector3.up,
                Position = splashCenter
            };
            SplashHitData    splashHit = SplashHitData.CreateSplashHitData(new List <HitTarget>(), staticHit, mine);
            HashSet <Entity> set       = new HashSet <Entity> {
                tank
            };

            splashHit.ExcludedEntityForSplashHit = set;
            EngineService.Engine.ScheduleEvent <SendTankMovementEvent>(tank);
            EngineService.Engine.ScheduleEvent(new CollectSplashTargetsEvent(splashHit), mine);
        }
        public void CollectSplashTarget(StartSplashEffectEvent e, SplashEffectNode effect, [JoinByTank] SelfTankNode selfTank, [JoinByTeam] ICollection <RemoteTankNode> remoteTanks)
        {
            StaticHit staticHit = new StaticHit {
                Normal   = Vector3.up,
                Position = selfTank.rigidbody.Rigidbody.position + (this.SPLASH_CENTER_HEIGHT * (selfTank.rigidbody.Rigidbody.rotation * Vector3.up))
            };
            SplashHitData    splashHit = SplashHitData.CreateSplashHitData(new List <HitTarget>(), staticHit, effect.Entity);
            HashSet <Entity> set       = new HashSet <Entity> {
                selfTank.Entity
            };

            splashHit.ExcludedEntityForSplashHit = set;
            if (!effect.splashEffect.CanTargetTeammates)
            {
                foreach (RemoteTankNode node in remoteTanks)
                {
                    splashHit.ExcludedEntityForSplashHit.Add(node.Entity);
                }
            }
            base.ScheduleEvent <SendTankMovementEvent>(selfTank);
            base.ScheduleEvent(new CollectSplashTargetsEvent(splashHit), effect);
        }