コード例 #1
0
 private void Update()
 {
     if (this.radialIndicatorActive && this.radialIndicator != null)
     {
         this.radialIndicator.CurrentRadius = 5f;
         RoomHandler absoluteRoom = this.proj.sprite.WorldCenter.GetAbsoluteRoom();
         absoluteRoom.ApplyActionToNearbyEnemies(this.proj.sprite.WorldCenter, 5f, this.AuraAction);
     }
 }
コード例 #2
0
        protected override void Update()
        {
            base.Update();
            RoomHandler             r           = Owner.sprite.transform.position.GetAbsoluteRoom();
            Vector3                 tableCenter = Owner.sprite.WorldCenter.ToVector3ZisY(0f);
            Action <AIActor, float> AuraAction  = delegate(AIActor actor, float dist)
            {
                actor.healthHaver.ApplyDamage(.7f, Vector2.zero, "bow unto his power");
            };

            r.ApplyActionToNearbyEnemies(tableCenter.XY(), 8, AuraAction);
        }
コード例 #3
0
 private AIActor TargetEnemies(PlayerController user, float initialRange, float secondaryRange)
 {
     if (user.CurrentRoom.HasActiveEnemies(RoomHandler.ActiveEnemyType.RoomClear))
     {
         if (PossibleLargestGrouping.Any())
         {
             PossibleLargestGrouping.Clear();
         }
         RoomHandler    room                       = user.CurrentRoom;
         List <AIActor> PossibleTargets            = new List <AIActor> {
         };
         AIActor TrueTarget                        = null;
         Action <AIActor, float> InitialTargetting = delegate(AIActor actor, float dist)
         {
             PossibleTargets.Add(actor);
         };
         room.ApplyActionToNearbyEnemies(user.specRigidbody.UnitCenter, initialRange, InitialTargetting);
         foreach (AIActor a in PossibleTargets)
         {
             List <AIActor> nearbyEnemies       = new List <AIActor> {
             };
             Action <AIActor, float> FindGroups = delegate(AIActor actor, float dist)
             {
                 nearbyEnemies.Add(actor);
             };
             room.ApplyActionToNearbyEnemies(a.specRigidbody.UnitCenter, secondaryRange, FindGroups);
             if (PossibleLargestGrouping.Count() < nearbyEnemies.Count())
             {
                 PossibleLargestGrouping = nearbyEnemies;
                 TrueTarget = a;
             }
         }
         return(TrueTarget);
     }
     else
     {
         return(null);
     }
 }
コード例 #4
0
            private void HandleEnemyDamage()
            {
                AkSoundEngine.PostEvent("Play_WPN_kthulu_blast_01", base.gameObject);
                RoomHandler room = base.transform.position.GetAbsoluteRoom();

                if (room != null)
                {
                    room.ApplyActionToNearbyEnemies(base.sprite.WorldCenter, 15f, delegate(AIActor aiactor, float f)
                    {
                        aiactor.PlayEffectOnActor(ResourceCache.Acquire("Global VFX/VFX_Curse") as GameObject, Vector3.zero, false, false, false);
                        aiactor.healthHaver.ApplyDamage(20f, Vector2.zero, "Soul Burn", CoreDamageTypes.Void, DamageCategory.Unstoppable, false, null, false);
                    });
                }
            }
コード例 #5
0
        private IEnumerator HandleHeatEffectsCR(float Radius, float Duration, GameActorEffect gameActorEffect, tk2dBaseSprite Psprite)
        {
            Psprite = m_owner.sprite;

            float                   elapsed     = 0f;
            RoomHandler             r           = Psprite.transform.position.GetAbsoluteRoom();
            Vector3                 tableCenter = Psprite.WorldCenter.ToVector3ZisY(0f);
            Action <AIActor, float> AuraAction  = delegate(AIActor actor, float dist)
            {
                actor.healthHaver.ApplyDamage(.1f * (m_owner.stats.GetStatModifier(PlayerStats.StatType.Damage)), Vector2.zero, "primaryPlayer");
            };

            while (elapsed < TDuration)
            {
                elapsed += BraveTime.DeltaTime;
                r.ApplyActionToNearbyEnemies(tableCenter.XY(), TRadius, AuraAction);
                yield return(null);
            }
            yield break;
        }
コード例 #6
0
        private IEnumerator HandleHeatEffectsCR(float Radius, float Duration, CharcoalDustEffect charcoalDust, tk2dBaseSprite Psprite)
        {
            Psprite = Owner.sprite;
            this.HandleRadialIndicator(6.5f, Psprite);
            float                   elapsed     = 0f;
            RoomHandler             r           = Psprite.transform.position.GetAbsoluteRoom();
            Vector3                 tableCenter = Psprite.WorldCenter.ToVector3ZisY(0f);
            Action <AIActor, float> AuraAction  = delegate(AIActor actor, float dist)
            {
                actor.ApplyEffect(Library.CharcoalDust, 1f, null);
            };

            while (elapsed < 2)
            {
                elapsed += BraveTime.DeltaTime;
                r.ApplyActionToNearbyEnemies(tableCenter.XY(), 6.5f, AuraAction);
                yield return(null);
            }
            this.UnhandleRadialIndicator();
            yield break;
        }
コード例 #7
0
        private IEnumerator HandleHeatEffectsCR(FlippableCover table)
        {
            this.HandleRadialIndicator(table);
            float                   elapsed     = 0f;
            int                     ct          = -1;
            bool                    hasSynergy  = Toolbox.AnyoneHasActiveSynergy("#HIDDEN_TECH_SUPER_CHAOS", out ct);
            RoomHandler             r           = table.transform.position.GetAbsoluteRoom();
            Vector3                 tableCenter = (!table.sprite) ? table.transform.position : table.sprite.WorldCenter.ToVector3ZisY(0f);
            Action <AIActor, float> AuraAction  = delegate(AIActor actor, float dist)
            {
                actor.ApplyEffect((!hasSynergy) ? this.TableHeatEffect : this.TableHeatSynergyEffect, 1f, null);
            };
            float modRadius = (!hasSynergy) ? 5f : 20f;

            while (elapsed < 10f)
            {
                elapsed += BraveTime.DeltaTime;
                r.ApplyActionToNearbyEnemies(tableCenter.XY(), modRadius, AuraAction);
                yield return(null);
            }
            this.UnhandleRadialIndicator(table);
            yield break;
        }
コード例 #8
0
 public override void Update()
 {
     base.Update();
     if (this.m_pickedUp && this.LastOwner != null)
     {
         if (this.m_isCurrentlyActive)
         {
             if (this.m_extantEye == null)
             {
                 GameObject obj = Instantiate(CustomCreepyEyeController.eyePrefab, this.LastOwner.CenterPosition, Quaternion.identity);
                 CustomCreepyEyeController eye = obj.GetComponent <CustomCreepyEyeController>();
                 eye.ChangeScale(0.5f);
                 eye.transform.parent = this.LastOwner.transform;
                 this.m_extantEye     = obj;
             }
             if (this.LastOwner.healthHaver != null)
             {
                 this.LastOwner.healthHaver.IsVulnerable = false;
             }
             this.LastOwner.SetIsFlying(true, "KaliberAffliction", false, false);
             this.LastOwner.ToggleRenderer(false, "KaliberAffliction");
             this.LastOwner.ToggleGunRenderers(false, "KaliberAffliction");
             this.LastOwner.ToggleHandRenderers(false, "KaliberAffliction");
             this.LastOwner.IsGunLocked = true;
             BraveInput input = BraveInput.GetInstanceForPlayer(this.LastOwner.PlayerIDX);
             if (input != null)
             {
                 if (this.m_extantBeam == null && this.LastOwner.PlayerHasActiveSynergy("#DEAD_GAZE"))
                 {
                     this.m_extantBeam = this.BeginFiringBeam(Toolbox.GetGunById(689).DefaultModule.GetCurrentProjectile(), this.LastOwner,
                                                              BraveMathCollege.Atan2Degrees(this.LastOwner.unadjustedAimPoint.XY() - this.m_extantEye.GetComponent <CustomCreepyEyeController>().poopil.GetComponent <tk2dBaseSprite>().WorldCenter),
                                                              this.m_extantEye.GetComponent <CustomCreepyEyeController>().poopil.GetComponent <tk2dBaseSprite>().WorldCenter);
                     this.m_extantBeam.projectile.baseData.damage *= 0.25f;
                 }
                 if (this.m_extantBeam != null)
                 {
                     this.ContinueFiringBeam(this.m_extantBeam, this.LastOwner,
                                             BraveMathCollege.Atan2Degrees(this.LastOwner.unadjustedAimPoint.XY() - this.m_extantEye.GetComponent <CustomCreepyEyeController>().poopil.GetComponent <tk2dBaseSprite>().WorldCenter),
                                             this.m_extantEye.GetComponent <CustomCreepyEyeController>().poopil.GetComponent <tk2dBaseSprite>().WorldCenter);
                 }
                 if (!input.ActiveActions.GetActionFromType(GungeonActions.GungeonActionType.Shoot).IsPressed)
                 {
                     this.mousePressedLast = false;
                 }
                 if (input.ActiveActions.GetActionFromType(GungeonActions.GungeonActionType.Shoot).IsPressed&& !this.mousePressedLast)
                 {
                     this.mousePressedLast = true;
                     RoomHandler room = this.LastOwner.unadjustedAimPoint.XY().GetAbsoluteRoom();
                     if (room != null)
                     {
                         room.ApplyActionToNearbyEnemies(this.LastOwner.unadjustedAimPoint.XY(), 0.5f, this.MarkNearbyEnemies);
                     }
                 }
             }
             else
             {
                 if (this.m_extantBeam != null)
                 {
                     this.CeaseBeam(this.m_extantBeam);
                     this.m_extantBeam = null;
                 }
                 this.mousePressedLast = false;
             }
         }
         else
         {
             if (this.m_extantBeam != null)
             {
                 this.CeaseBeam(this.m_extantBeam);
                 this.m_extantBeam = null;
             }
         }
     }
     else
     {
         if (this.m_extantBeam != null)
         {
             this.CeaseBeam(this.m_extantBeam);
             this.m_extantBeam = null;
         }
     }
     if (this.cooldownRemaining > 0)
     {
         this.cooldownRemaining = Mathf.Max(0, this.cooldownRemaining - BraveTime.DeltaTime);
     }
     if (this.cooldownRemaining <= 0)
     {
         if (this.markedEnemies.Count > 0)
         {
             this.EatEnemy(this.markedEnemies[0]);
             this.markedEnemies.RemoveAt(0);
             this.cooldownRemaining = 5f;
         }
     }
 }