private void HandlePreCollision(SpeculativeRigidbody myRigidbody, PixelCollider myPixelCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherPixelCollider)
 {
     try
     {
         if (otherRigidbody)
         {
             if (otherRigidbody.GetComponent <GameActor>())
             {
                 PhysicsEngine.SkipCollision = true;
             }
             if (otherRigidbody.GetComponent <Projectile>())
             {
                 if (otherRigidbody.GetComponent <Projectile>().ProjectilePlayerOwner())
                 {
                     PhysicsEngine.SkipCollision = true;
                 }
                 else
                 {
                     myRigidbody.GetComponentInChildren <MinorBreakable>().Break();
                     //otherRigidbody.GetComponent<Projectile>().DieInAir();
                 }
             }
         }
     }
     catch (Exception e)
     {
         ETGModConsole.Log(e.Message);
         ETGModConsole.Log(e.StackTrace);
     }
 }
        private void HandleTriggerCollision(SpeculativeRigidbody specRigidbody, SpeculativeRigidbody sourceSpecRigidbody, CollisionData collisionData)
        {
            PlayerController player  = specRigidbody.GetComponent <PlayerController>();
            AIActor          aiActor = specRigidbody.GetComponent <AIActor>();

            if (player)
            {
                if (!player.IsOnFire && player.IsGrounded && !player.IsSlidingOverSurface && player.healthHaver && player.healthHaver.IsVulnerable)
                {
                    player.IsOnFire = true;
                    player.CurrentFireMeterValue += BraveTime.DeltaTime * 0.5f;
                    player.ApplyEffect(m_GoopDefinition.fireEffect);
                }
            }
            else if (aiActor && aiActor.GetResistanceForEffectType(EffectResistanceType.Fire) < 1f)
            {
                float num = 0f;
                if (aiActor.GetResistanceForEffectType(EffectResistanceType.Fire) < 1f)
                {
                    num += 1f * BraveTime.DeltaTime;
                }
                aiActor.ApplyEffect(m_GoopDefinition.fireEffect);
                if (num > 0f)
                {
                    aiActor.healthHaver.ApplyDamage(num, Vector2.zero, StringTableManager.GetEnemiesString("#GOOP", -1), CoreDamageTypes.Fire, DamageCategory.Environment, false, null, false);
                }
            }
        }
 private void HandleFlightCollider(SpeculativeRigidbody specRigidbody, SpeculativeRigidbody sourceSpecRigidbody, CollisionData collisionData)
 {
     if (!GameManager.Instance.IsLoadingLevel && !Lock.IsLocked && !loadLevelOnPitFall)
     {
         PlayerController component = specRigidbody.GetComponent <PlayerController>();
         if (component && component.IsFlying)
         {
             m_timeHovering += BraveTime.DeltaTime;
             if (m_timeHovering > 0.5f)
             {
                 component.ForceFall();
                 m_timeHovering = 0f;
             }
         }
     }
     else if (!GameManager.Instance.IsLoadingLevel && !Lock.IsLocked && loadLevelOnPitFall)
     {
         PlayerController component = specRigidbody.GetComponent <PlayerController>();
         if (component && component.IsFlying && !GameManager.Instance.IsLoadingLevel && !string.IsNullOrEmpty(targetLevelName))
         {
             m_timeHovering += BraveTime.DeltaTime;
             if (m_timeHovering > 0.5f)
             {
                 ChaosGlitchMod.isGlitchFloor   = true;
                 component.LevelToLoadOnPitfall = targetLevelName;
                 component.ForceFall();
             }
         }
     }
 }
 protected override void OnPreCollision(SpeculativeRigidbody myRigidbody, PixelCollider myCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherCollider)
 {
     if (otherRigidbody == Shooter && !allowSelfShooting)
     {
         PhysicsEngine.SkipCollision = true;
         return;
     }
     if (otherRigidbody.gameActor != null && otherRigidbody.gameActor is PlayerController && (!collidesWithPlayer || (otherRigidbody.gameActor as PlayerController).IsGhost || (otherRigidbody.gameActor as PlayerController).IsEthereal))
     {
         PhysicsEngine.SkipCollision = true;
         return;
     }
     if (otherRigidbody.aiActor)
     {
         if (Owner is PlayerController && !otherRigidbody.aiActor.IsNormalEnemy)
         {
             PhysicsEngine.SkipCollision = true;
             return;
         }
         if (Owner is AIActor && !collidesWithEnemies && otherRigidbody.aiActor.IsNormalEnemy && !otherRigidbody.aiActor.HitByEnemyBullets)
         {
             PhysicsEngine.SkipCollision = true;
             return;
         }
     }
     if (!GameManager.PVP_ENABLED && Owner is PlayerController && otherRigidbody.GetComponent <PlayerController>() != null && !allowSelfShooting)
     {
         PhysicsEngine.SkipCollision = true;
         return;
     }
     if (GameManager.Instance.InTutorial)
     {
         PlayerController component = otherRigidbody.GetComponent <PlayerController>();
         if (component)
         {
             if (component.spriteAnimator.QueryInvulnerabilityFrame())
             {
                 GameManager.BroadcastRoomTalkDoerFsmEvent("playerDodgedBullet");
             }
             else if (component.IsDodgeRolling)
             {
                 GameManager.BroadcastRoomTalkDoerFsmEvent("playerAlmostDodgedBullet");
             }
             else
             {
                 GameManager.BroadcastRoomTalkDoerFsmEvent("playerDidNotDodgeBullet");
             }
         }
     }
     if (collidesWithProjectiles && collidesOnlyWithPlayerProjectiles && otherRigidbody.projectile && !(otherRigidbody.projectile.Owner is PlayerController))
     {
         PhysicsEngine.SkipCollision = true;
         return;
     }
 }
 private void HandleFlightCollider(SpeculativeRigidbody specRigidbody, SpeculativeRigidbody sourceSpecRigidbody, CollisionData collisionData)
 {
     if (!GameManager.Instance.IsLoadingLevel && IsValidForUse())
     {
         PlayerController component = specRigidbody.GetComponent <PlayerController>();
         if (component && component.IsFlying && !m_isLoading && !GameManager.Instance.IsLoadingLevel && !string.IsNullOrEmpty(targetLevelName))
         {
             m_timeHovering += BraveTime.DeltaTime;
             if (GameManager.Instance.CurrentGameType == GameManager.GameType.COOP_2_PLAYER)
             {
                 PlayerController otherPlayer = GameManager.Instance.GetOtherPlayer(component);
                 if (component.IsFlying && !otherPlayer.IsFlying && !otherPlayer.IsGhost)
                 {
                     m_timeHovering = 0f;
                 }
             }
             if (m_timeHovering > 0.5f)
             {
                 m_isLoading = true;
                 if (IsSecretGlitchFloorPit)
                 {
                     GameManager.Instance.InjectedFlowPath = "secretglitchfloor_Flow";
                     ExpandUtility.RatDungeon = DungeonDatabase.GetOrLoadByName("Base_ResourcefulRat");
                     ExpandUtility.RatDungeon.LevelOverrideType = GameManager.LevelOverrideState.NONE;
                     ExpandPrefabs.InitCanyonTileSet(ExpandUtility.RatDungeon, GlobalDungeonData.ValidTilesets.PHOBOSGEON);
                 }
                 component.LevelToLoadOnPitfall = targetLevelName;
                 component.ForceFall();
                 // GameManager.Instance.LoadCustomLevel(targetLevelName);
             }
         }
     }
 }
示例#6
0
 public void OnBeamTick(BeamController bem, SpeculativeRigidbody enemy, float what)
 {
     if (Owner && Owner.CurrentGoop != null)
     {
         if (Owner.CurrentGoop.HealthModifierEffect != null && Owner.CurrentGoop.AppliesDamageOverTime && !(Owner.CurrentGoop.HealthModifierEffect is GameActorPlagueEffect))
         {
             if (bem.GetComponent <Projectile>())
             {
                 if (enemy.GetComponent <GameActor>())
                 {
                     enemy.GetComponent <GameActor>().ApplyEffect(Owner.CurrentGoop.HealthModifierEffect);
                 }
             }
         }
     }
 }
        private void HandleTriggerCollision(SpeculativeRigidbody specRigidbody, SpeculativeRigidbody sourceSpecRigidbody, CollisionData collisionData)
        {
            if (m_justWarped | !IsOpenForTeleport)
            {
                return;
            }
            PlayerController player = specRigidbody.GetComponent <PlayerController>();

            if (player)
            {
                switch (warpType)
                {
                case WarpType.Normal:
                    m_justWarped = true;
                    player.SetInputOverride("arbitrary warp");
                    StartCoroutine(HandleWarp(player));
                    return;

                case WarpType.FloorWarp:
                    StartCoroutine(HandleExitFloor());
                    m_justWarped = true;
                    return;

                case WarpType.OldWestFloorWarp:
                    StartCoroutine(HandleOldWestExitFloor(player));
                    m_justWarped = true;
                    break;

                default:
                    break;
                }
            }
        }
 private void OnElevatorTriggerEnter(SpeculativeRigidbody otherSpecRigidbody, SpeculativeRigidbody sourceSpecRigidbody, CollisionData collisionData)
 {
     if (m_isArrived == Tribool.Ready)
     {
         if (otherSpecRigidbody.GetComponent <PlayerController>() != null)
         {
             if (GameManager.Instance.CurrentGameType == GameManager.GameType.COOP_2_PLAYER)
             {
                 bool flag = true;
                 for (int i = 0; i < GameManager.Instance.AllPlayers.Length; i++)
                 {
                     if (!GameManager.Instance.AllPlayers[i].healthHaver.IsDead)
                     {
                         if (!sourceSpecRigidbody.ContainsPoint(GameManager.Instance.AllPlayers[i].SpriteBottomCenter.XY(), 2147483647, true))
                         {
                             flag = false;
                             break;
                         }
                     }
                 }
                 if (flag)
                 {
                     DoDeparture();
                 }
             }
             else
             {
                 DoDeparture();
             }
         }
     }
 }
示例#9
0
        // Token: 0x0600025A RID: 602 RVA: 0x00019660 File Offset: 0x00017860
        private void OnPreCollison(SpeculativeRigidbody myRigidbody, PixelCollider myCollider, SpeculativeRigidbody other, PixelCollider otherCollider)
        {
            bool flag  = base.Owner != null;
            bool flag2 = flag;

            if (flag2)
            {
                Projectile component = other.GetComponent <Projectile>();
                bool       flag3     = component != null && !(component.Owner is PlayerController);
                bool       flag4     = flag3;
                if (flag4)
                {
                    bool flag5 = !DynamiteGuon.onCooldown;
                    bool flag6 = flag5;
                    if (flag6)
                    {
                        DynamiteGuon.onCooldown = true;
                        GameManager.Instance.StartCoroutine(GuonGeon.StartCooldown(base.Owner));
                        {
                            this.Boom(myRigidbody.sprite.WorldCenter);
                        }
                    }
                }
            }
        }
示例#10
0
        // Allow AIActors to open doors. AIActors with IgnoreForRoomClear set will not be able to open doors in COOP. (to prevent companions from opening doors in COOP mode)
        private void CheckForPlayerCollisionHook(Action <DungeonDoorController, SpeculativeRigidbody, Vector2> orig, DungeonDoorController self, SpeculativeRigidbody otherRigidbody, Vector2 normal)
        {
            orig(self, otherRigidbody, normal);
            bool isSealed = ReflectionHelpers.ReflectGetField <bool>(typeof(DungeonDoorController), "isSealed", self);
            bool m_open   = ReflectionHelpers.ReflectGetField <bool>(typeof(DungeonDoorController), "m_open", self);

            if (isSealed || self.isLocked)
            {
                return;
            }
            AIActor component = otherRigidbody.GetComponent <AIActor>();

            if (component != null && !m_open)
            {
                bool flipped = false;
                if (normal.y < 0f && self.northSouth)
                {
                    flipped = true;
                }
                if (normal.x < 0f && !self.northSouth)
                {
                    flipped = true;
                }
                if (GameManager.Instance.CurrentGameType == GameManager.GameType.SINGLE_PLAYER)
                {
                    self.Open(flipped);
                }
                else if (!component.IgnoreForRoomClear)
                {
                    self.Open(flipped);
                }
            }
        }
示例#11
0
        private bool AdjustRigidbodyVelocity(SpeculativeRigidbody other, Vector2 myCenter)
        {
            bool    result       = false;
            Vector2 a            = other.UnitCenter - myCenter;
            float   effectRadius = 10f;
            float   num          = Vector2.SqrMagnitude(a);

            if (num >= effectRadius * effectRadius)
            {
                return(result);
            }
            float   gravitationalForce = 500f;
            Vector2 vector             = other.Velocity;
            AIActor aiactor            = other.aiActor;

            if (aiactor == null)
            {
                return(false);
            }
            aiactor.CollisionDamage = 0;
            if (other.GetComponent <BlackHoleDoer>() != null)
            {
                return(false);
            }
            if (vector == Vector2.zero)
            {
                Vector2 lhs = myCenter - other.UnitCenter;
                if (lhs == Vector2.zero)
                {
                    lhs = new Vector2(UnityEngine.Random.value - 0.5f, UnityEngine.Random.value - 0.5f);
                }
                vector = lhs.normalized * 3f;
            }
            if (num < 4f)
            {
                aiactor.EraseFromExistence(true);
                result = true;
            }
            Vector2 frameAccelerationForRigidbody = this.GetFrameAccelerationForRigidbody(other.UnitCenter, myCenter, Mathf.Sqrt(num), gravitationalForce);
            float   d       = Mathf.Clamp(BraveTime.DeltaTime, 0f, 0.02f);
            Vector2 b       = frameAccelerationForRigidbody * d;
            Vector2 vector2 = vector + b;

            if (BraveTime.DeltaTime > 0.02f)
            {
                vector2 *= 0.02f / BraveTime.DeltaTime;
            }
            aiactor.knockbackDoer.ApplyKnockback(vector2, 2 * (aiactor.knockbackDoer.weight / 10f), true);
            if (aiactor.behaviorSpeculator != null)
            {
                aiactor.behaviorSpeculator.Stun(0.1f, false);
            }
            if (aiactor != null)
            {
                aiactor.CollisionDamage = 0;
            }
            return(result);
        }
示例#12
0
        private void OnPreCollision(SpeculativeRigidbody myRigidbody, PixelCollider myCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherCollider)
        {
            PlayerController player = this.Owner;

            PhysicsEngine.SkipCollision = true;
            RoomHandler currentRoom = GameManager.Instance.PrimaryPlayer.CurrentRoom;
            AIActor     component   = otherRigidbody.GetComponent <AIActor>();
            bool        flag        = component != null;

            if (flag)
            {
                if (component.healthHaver && component.CenterPosition.GetAbsoluteRoom() == currentRoom)
                {
                    if (didDamage == false && !player.IsStealthed)
                    {
                        didDamage = true;
                        GameManager.Instance.StartCoroutine(this.DamageTimer());

                        if (player.HasPickupID(822) || player.HasPickupID(457))
                        {
                            Gun gun = PickupObjectDatabase.GetById(616) as Gun;
                            GameActorHealthEffect bleedEffect = new GameActorHealthEffect
                            {
                                TintColor                = Color.red,
                                DeathTintColor           = Color.red,
                                AppliesTint              = true,
                                AppliesDeathTint         = true,
                                AffectsEnemies           = true,
                                AffectsPlayers           = false,
                                effectIdentifier         = "sharpguonbleed",
                                resistanceType           = EffectResistanceType.None,
                                duration                 = 3f,
                                DamagePerSecondToEnemies = 3f,
                                stackMode                = GameActorEffect.EffectStackingMode.Refresh
                            };
                            component.ApplyEffect(bleedEffect, 1, null);


                            Vector3 vector            = component.sprite.WorldBottomLeft.ToVector3ZisY(0);
                            Vector3 vector2           = component.sprite.WorldTopRight.ToVector3ZisY(0);
                            float   num               = (vector2.y - vector.y) * (vector2.x - vector.x);
                            float   num2              = 50f * num;
                            int     num3              = Mathf.CeilToInt(Mathf.Max(1f, num2 * BraveTime.DeltaTime));
                            int     num4              = num3;
                            Vector3 minPosition       = vector;
                            Vector3 maxPosition       = vector2;
                            Vector3 direction         = Vector3.up / 2f;
                            float   angleVariance     = 120f;
                            float   magnitudeVariance = 3f;
                            float?  startLifetime     = new float?(UnityEngine.Random.Range(12, 20f));
                            GlobalSparksDoer.DoRandomParticleBurst(num4, minPosition, maxPosition, direction, angleVariance, magnitudeVariance, null, startLifetime, null, GlobalSparksDoer.SparksType.BLOODY_BLOOD);
                        }

                        component.healthHaver.ApplyDamage(4f, Vector2.zero, "Sharp Guon", CoreDamageTypes.None, DamageCategory.Normal, false, null, false);
                    }
                }
            }
        }
        private void HandleTriggerExited(SpeculativeRigidbody specRigidbody, SpeculativeRigidbody sourceSpecRigidbody)
        {
            PlayerController component = specRigidbody.GetComponent <PlayerController>();

            if (component)
            {
                component.LevelToLoadOnPitfall = string.Empty;
            }
        }
        private void HandleTriggerEntered(SpeculativeRigidbody specRigidbody, SpeculativeRigidbody sourceSpecRigidbody, CollisionData collisionData)
        {
            PlayerController component = specRigidbody.GetComponent <PlayerController>();

            if (component)
            {
                component.LevelToLoadOnPitfall = targetLevelName;
            }
        }
        private void HandleTriggerEntered(SpeculativeRigidbody targetRigidbody, SpeculativeRigidbody sourceSpecRigidbody, CollisionData collisionData)
        {
            Projectile projectile = targetRigidbody.projectile;

            if (projectile)
            {
                projectile.HandleKnockback(base.specRigidbody, targetRigidbody.GetComponent <PlayerController>(), false, false);
            }
        }
        private void OnPreCollision(SpeculativeRigidbody myRigidbody, PixelCollider myCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherCollider)
        {
            Projectile component = otherRigidbody.GetComponent <Projectile>();

            if (component != null && !(component.Owner is PlayerController))
            {
                PassiveReflectItem.ReflectBullet(component, true, Owner.specRigidbody.gameActor, 10f, 1f, 1f, 0f);
                PhysicsEngine.SkipCollision = true;
            }
        }
 public void OnPreRigidBodyCollision(SpeculativeRigidbody myRigidbody, PixelCollider myPixelCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherPixelCollider)
 {
     if (otherRigidbody.GetComponent <AIActor>() && otherRigidbody.GetComponent <AIActor>().healthHaver.IsAlive)
     {
         AIActor TargetAIActor = otherRigidbody.GetComponent <AIActor>();
         if (TargetAIActor.gameObject.GetComponent <CompanionController>() && TargetAIActor.IgnoreForRoomClear)
         {
             if (TargetAIActor.knockbackDoer)
             {
                 TargetAIActor.knockbackDoer.ApplyKnockback(new Vector2(-1f, 0), 2, true);
             }
             else
             {
                 PhysicsEngine.SkipCollision = true;
             }
         }
         else
         {
             TargetAIActor.healthHaver.ApplyDamage(500, new Vector2(1, 0), "Big Ass Worm", CoreDamageTypes.None, DamageCategory.Unstoppable, true, null, true);
         }
         return;
     }
     else if (!PlayerEaten && otherRigidbody.GetComponent <PlayerController>())
     {
         PlayerEaten = true;
         otherRigidbody.GetComponent <PlayerController>().SetInputOverride("got eaten");
         specRigidbody.Velocity = Vector2.zero;
         spriteAnimator.Stop();
         StartCoroutine(HandleTransitionToBellyFloor(otherRigidbody.GetComponent <PlayerController>()));
         return;
     }
     else if (otherRigidbody.GetComponent <MajorBreakable>())
     {
         // Vector3 ObjectPosition = otherRigidbody.GetUnitCenter(ColliderType.Ground);
         otherRigidbody.GetComponent <MajorBreakable>().Break(new Vector2(1, 0));
         // Exploder.DoDefaultExplosion(ObjectPosition, new Vector2(1, 0), null, true, CoreDamageTypes.None, true);
     }
     else if (otherRigidbody.GetComponent <MinorBreakable>())
     {
         otherRigidbody.GetComponent <MinorBreakable>().Break(new Vector2(1, 0));
     }
 }
 private void preCollide(SpeculativeRigidbody myRigidbody, PixelCollider myCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherCollider)
 {
     if (baseEnemy && baseEnemy.EnemyScale.x < 0.55f)
     {
         if (otherRigidbody.GetComponent <PlayerController>())
         {
             baseEnemy.EraseFromExistenceWithRewards(false);
             GlobalSparksDoer.DoRandomParticleBurst(5, baseEnemy.specRigidbody.UnitBottomLeft, baseEnemy.specRigidbody.UnitTopRight, new Vector3(1, 1, 1), 360, 4, null, null, null, GlobalSparksDoer.SparksType.BLOODY_BLOOD);
         }
     }
 }
        private static IEnumerator HandleFreeFiringBeam(BeamController beam, SpeculativeRigidbody otherShooter, Vector2 fixedPosition, bool usesFixedPosition, float targetAngle, float duration, bool followProjDir, float projFollowOffset)
        {
            float elapsed = 0f;

            yield return(null);

            while (elapsed < duration)
            {
                Vector2 sourcePos;
                if (otherShooter == null)
                {
                    break;
                }
                if (usesFixedPosition)
                {
                    sourcePos = fixedPosition;
                }
                else
                {
                    sourcePos = otherShooter.UnitCenter;
                }

                elapsed += BraveTime.DeltaTime;
                if (sourcePos != null)
                {
                    if (otherShooter != null && !usesFixedPosition && otherShooter.GetComponent <Projectile>() && followProjDir)
                    {
                        beam.Direction = (otherShooter.GetComponent <Projectile>().Direction.ToAngle() + projFollowOffset).DegreeToVector2();
                    }
                    beam.Origin = sourcePos;
                    beam.LateUpdatePosition(sourcePos);
                }
                else
                {
                    ETGModConsole.Log("SOURCEPOS WAS NULL IN BEAM FIRING HANDLER");
                }
                yield return(null);
            }
            beam.CeaseAttack();
            yield break;
        }
示例#20
0
 private void eatBullet(SpeculativeRigidbody mySpec, PixelCollider myPixCo, SpeculativeRigidbody otherSpec, PixelCollider otherPixCo)
 {
     if (otherSpec.GetComponent <PlayerController>() != null)
     {
         PlayerController player = otherSpec.GetComponent <PlayerController>();
         if (mySpec.projectile)
         {
             mySpec.projectile.DieInAir(false, true, true, false);
             if (player.healthHaver.GetCurrentHealth() < player.healthHaver.GetMaxHealth())
             {
                 player.healthHaver.ApplyHealing(1f);
             }
             else
             {
                 base.StartCoroutine(this.tempBuff(player));
             }
             PhysicsEngine.SkipCollision = true;
             mySpec.projectile.specRigidbody.OnPreRigidbodyCollision -= this.eatBullet;
         }
     }
 }
        public void JamEnemyOnHit(Projectile projectile, SpeculativeRigidbody enemyRigidbody, bool killedEnemy)
        {
            if (this && projectile && enemyRigidbody)
            {
                AIActor enemy = enemyRigidbody.GetComponent <AIActor>();

                if (enemy && enemy.healthHaver && enemy.healthHaver.IsAlive && !enemy.healthHaver.IsBoss && !enemy.IsBlackPhantom)
                {
                    enemy.BecomeBlackPhantom();
                }
            }
        }
示例#22
0
        private void OnGuonHit(SpeculativeRigidbody myRigidbody, PixelCollider myCollider, SpeculativeRigidbody other, PixelCollider otherCollider)
        {
            Projectile component = other.GetComponent <Projectile>();

            if (component != null && !(component.Owner is PlayerController))
            {
                if (UnityEngine.Random.value < 0.1f && cashSpawnedThisRoom < 20)
                {
                    LootEngine.SpawnItem(PickupObjectDatabase.GetById(68).gameObject, other.specRigidbody.UnitCenter, Vector2.zero, 1f, false, true, false);
                    cashSpawnedThisRoom += 1;
                }
            }
        }
示例#23
0
        private void HandleTriggerCollision(SpeculativeRigidbody specRigidbody, SpeculativeRigidbody sourceSpecRigidbody, CollisionData collisionData)
        {
            if (m_triggered)
            {
                return;
            }
            PlayerController player = specRigidbody.GetComponent <PlayerController>();

            if (player)
            {
                StartCoroutine(Trigger());
            }
        }
        private void HandleTriggerCollision(SpeculativeRigidbody Rigidbody, SpeculativeRigidbody sourceSpecRigidbody, CollisionData collisionData)
        {
            if (m_InUse | m_IsRecievingPlayer)
            {
                return;
            }
            PlayerController player = Rigidbody.GetComponent <PlayerController>();

            if (player && !m_IsRecievingPlayer)
            {
                StartCoroutine(Trigger(player));
            }
        }
示例#25
0
        public void OnPreCollision(SpeculativeRigidbody otherRigidbody, SpeculativeRigidbody source, CollisionData collisionData)
        {
            if (this.m_hasBeenPickedUp)
            {
                return;
            }
            PlayerController component = otherRigidbody.GetComponent <PlayerController>();

            if (component != null)
            {
                this.m_hasBeenPickedUp = true;
                this.Pickup(component);
            }
        }
        private void HandleTriggerExited(SpeculativeRigidbody specRigidbody, SpeculativeRigidbody sourceSpecRigidbody)
        {
            PlayerController component = specRigidbody.GetComponent <PlayerController>();

            if (component)
            {
                if (IsSecretGlitchFloorPit)
                {
                    GameManager.Instance.InjectedFlowPath = string.Empty;
                    ExpandUtility.RatDungeon = null;
                }
                component.LevelToLoadOnPitfall = string.Empty;
            }
        }
示例#27
0
        private void OnPreCollision(SpeculativeRigidbody myRigidbody, PixelCollider myPixelCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherPixelCollider)
        {
            MinorBreakable component = otherRigidbody.GetComponent <MinorBreakable>();

            if (component && !component.onlyVulnerableToGunfire && !component.IsBig)
            {
                component.Break(specRigidbody.Velocity);
                PhysicsEngine.SkipCollision = true;
            }
            if (otherRigidbody && otherRigidbody.aiActor && !otherRigidbody.aiActor.IsNormalEnemy)
            {
                PhysicsEngine.SkipCollision = true;
            }
        }
示例#28
0
        private void OnPreCollision(SpeculativeRigidbody otherRigidbody, SpeculativeRigidbody source, CollisionData collisionData)
        {
            if (this.m_hasBeenPickedUp)
            {
                return;
            }
            PlayerController component = otherRigidbody.GetComponent <PlayerController>();

            if (component != null)
            {
                this.m_hasBeenPickedUp = true;
                SpriteOutlineManager.RemoveOutlineFromSprite(base.sprite, true);
                this.Pickup(component);
            }
        }
        private void OnPreCollison(SpeculativeRigidbody myRigidbody, PixelCollider myCollider, SpeculativeRigidbody other, PixelCollider otherCollider)
        {
            bool flag = Owner != null;

            if (flag)
            {
                Projectile component = other.GetComponent <Projectile>();
                bool       flag2     = component != null && !(component.Owner is PlayerController);
                if (flag2)
                {
                    rockpoints++;
                    AkSoundEngine.PostEvent("Play_WPN_radgun_cool_01", base.gameObject);
                }
            }
        }
        private void HandleTriggerEntered(SpeculativeRigidbody specRigidbody, SpeculativeRigidbody sourceSpecRigidbody, CollisionData collisionData)
        {
            PlayerController component = specRigidbody.GetComponent <PlayerController>();

            if (component)
            {
                if (loadLevelOnPitFall)
                {
                    Pixelator.Instance.RegisterAdditionalRenderPass(ChaosShaders.GlitchScreenShader);
                    ChaosGlitchMod.isGlitchFloor = true;
                    // GameManager.Instance.InjectedFlowPath = targetDungeonFlow;
                    component.LevelToLoadOnPitfall = targetLevelName;
                }
            }
        }