示例#1
0
 private void HandleHeatEffects(TableTechChaosEffectIdentifier identifier, FlippableCover table)
 {
     if (identifier == TableTechChaosEffectIdentifier.HEAT && table)
     {
         table.StartCoroutine(this.HandleHeatEffectsCR(table));
     }
 }
示例#2
0
 private void HandleBlankEffect(TableTechChaosEffectIdentifier identifier, FlippableCover table)
 {
     if (identifier == TableTechChaosEffectIdentifier.BLANK)
     {
         GameManager.Instance.StartCoroutine(this.DelayedBlankEffect(table));
     }
 }
示例#3
0
 private void HandleStealthEffect(TableTechChaosEffectIdentifier identifier, FlippableCover obj)
 {
     if (identifier == TableTechChaosEffectIdentifier.STEALTH)
     {
         PlayerController owner = base.Owner;
         this.BreakStealth(owner);
         owner.OnItemStolen += this.BreakStealthOnSteal;
         owner.ChangeSpecialShaderFlag(1, 1f);
         owner.healthHaver.OnDamaged += this.OnDamaged;
         owner.SetIsStealthed(true, "table tech chaos");
         owner.SetCapableOfStealing(true, "table tech chaos", null);
         GameManager.Instance.StartCoroutine(this.Unstealthy());
         if (base.Owner.PlayerHasActiveSynergy("#HIDDEN_TECH_SUPER_CHAOS"))
         {
             float       num;
             RoomHandler room = obj.transform.position.GetAbsoluteRoom();
             if (room != null)
             {
                 AIActor aiactor = room.GetNearestEnemy(obj.specRigidbody.UnitCenter, out num, true, true);
                 if (aiactor != null)
                 {
                     aiactor.PlayEffectOnActor(RedpoofVFX, Vector3.zero, false, true, false);
                     aiactor.healthHaver.ApplyDamage(UnityEngine.Random.Range(15, 30), obj.specRigidbody.UnitCenter - aiactor.sprite.WorldCenter, "Hidden Tech Assassin", CoreDamageTypes.None, DamageCategory.Unstoppable, true, null, false);
                 }
             }
         }
     }
 }
示例#4
0
 private void HandleMoneyEffect(TableTechChaosEffectIdentifier identifier, FlippableCover sourceCover)
 {
     if (identifier == TableTechChaosEffectIdentifier.MONEY)
     {
         int amountToDrop = UnityEngine.Random.Range(1, 5);
         LootEngine.SpawnCurrency(sourceCover.specRigidbody.UnitCenter, amountToDrop, false);
     }
 }
示例#5
0
 private void HandleTemporalEffects(TableTechChaosEffectIdentifier identifier)
 {
     if (identifier == TableTechChaosEffectIdentifier.TIME_SLOW && (!base.Owner || !base.Owner.PlayerHasActiveSynergy("#HIDDEN_TECH_SUPER_CHAOS")))
     {
         base.Owner.StartCoroutine(this.HandleTimeSlowDuration());
     }
     if (identifier == TableTechChaosEffectIdentifier.INVULNERABILITY)
     {
         base.Owner.healthHaver.TriggerInvulnerabilityPeriod(3.5f);
         AkSoundEngine.PostEvent("Play_OBJ_shrine_accept_01", base.Owner.gameObject);
         base.Owner.PlayEffectOnActor(SoulOrbController.SoulFocusVFX, new Vector3(0f, -0.5f, 0f), true, false, false);
     }
 }
示例#6
0
 private void HandleVolleyEffect(TableTechChaosEffectIdentifier identifier)
 {
     if (identifier == TableTechChaosEffectIdentifier.VOLLEY)
     {
         if (this.m_volleyElapsed < 0f)
         {
             base.Owner.StartCoroutine(this.HandleVolleyCooldown());
         }
         else
         {
             this.m_volleyElapsed = 0f;
         }
     }
 }
示例#7
0
 private void HandleStunEffect(TableTechChaosEffectIdentifier identifier)
 {
     if (identifier == TableTechChaosEffectIdentifier.STUN)
     {
         List <AIActor> activeEnemies = base.Owner.CurrentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All);
         if (activeEnemies != null)
         {
             for (int i = 0; i < activeEnemies.Count; i++)
             {
                 this.StunEnemy(activeEnemies[i]);
             }
         }
     }
 }
示例#8
0
 private void HandleMirrorEffect(TableTechChaosEffectIdentifier identifier, FlippableCover obj)
 {
     if (identifier == TableTechChaosEffectIdentifier.MIRROR)
     {
         AkSoundEngine.PostEvent("Play_WPN_kthulu_soul_01", obj.gameObject);
         obj.sprite.usesOverrideMaterial = true;
         tk2dSprite tk2dSprite = obj.sprite as tk2dSprite;
         tk2dSprite.GenerateUV2 = true;
         Material material = Instantiate <Material>(obj.sprite.renderer.material);
         material.DisableKeyword("TINTING_OFF");
         material.EnableKeyword("TINTING_ON");
         material.SetColor("_OverrideColor", new Color(0f, 1f, 1f));
         material.DisableKeyword("EMISSIVE_OFF");
         material.EnableKeyword("EMISSIVE_ON");
         material.SetFloat("_EmissivePower", 1.75f);
         material.SetFloat("_EmissiveColorPower", 1f);
         obj.sprite.renderer.material = material;
         Shader       shader          = Shader.Find("Brave/ItemSpecific/MetalSkinLayerShader");
         MeshRenderer component       = obj.sprite.GetComponent <MeshRenderer>();
         Material[]   sharedMaterials = component.sharedMaterials;
         for (int i = 0; i < sharedMaterials.Length; i++)
         {
             if (sharedMaterials[i].shader == shader)
             {
                 return;
             }
         }
         Array.Resize <Material>(ref sharedMaterials, sharedMaterials.Length + 1);
         Material material2 = new Material(shader);
         material2.SetTexture("_MainTex", sharedMaterials[0].GetTexture("_MainTex"));
         sharedMaterials[sharedMaterials.Length - 1] = material2;
         component.sharedMaterials = sharedMaterials;
         tk2dSprite.ForceBuild();
         obj.specRigidbody.OnPreRigidbodyCollision += new SpeculativeRigidbody.OnPreRigidbodyCollisionDelegate(
             delegate(SpeculativeRigidbody myRigidbody, PixelCollider myPixelCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherPixelCollider)
         {
             if (otherRigidbody.projectile != null && !(otherRigidbody.projectile.Owner is PlayerController) && base.Owner != null)
             {
                 PassiveReflectItem.ReflectBullet(otherRigidbody.projectile, true, base.Owner, 10f, 1f, 1f, 0f);
                 otherRigidbody.RegisterSpecificCollisionException(obj.specRigidbody);
                 PhysicsEngine.SkipCollision = true;
             }
         }
             );
         if (base.Owner.PlayerHasActiveSynergy("#HIDDEN_TECH_SUPER_CHAOS"))
         {
             obj.gameObject.AddComponent <MirrorBreakSynergyProcessor>().Initialize();
         }
     }
 }
示例#9
0
 private void HandleTableFlocking(TableTechChaosEffectIdentifier identifier, FlippableCover table)
 {
     if (identifier == TableTechChaosEffectIdentifier.FLOCKING)
     {
         RoomHandler currentRoom = base.Owner.CurrentRoom;
         ReadOnlyCollection <IPlayerInteractable> roomInteractables = currentRoom.GetRoomInteractables();
         for (int i = 0; i < roomInteractables.Count; i++)
         {
             if (currentRoom.IsRegistered(roomInteractables[i]))
             {
                 FlippableCover flippableCover = roomInteractables[i] as FlippableCover;
                 if (flippableCover != null && !flippableCover.IsFlipped && !flippableCover.IsGilded)
                 {
                     if (flippableCover.flipStyle == FlippableCover.FlipStyle.ANY)
                     {
                         flippableCover.ForceSetFlipper(base.Owner);
                         flippableCover.Flip(table.DirectionFlipped);
                     }
                     else if (flippableCover.flipStyle == FlippableCover.FlipStyle.ONLY_FLIPS_LEFT_RIGHT)
                     {
                         if (table.DirectionFlipped == DungeonData.Direction.NORTH || table.DirectionFlipped == DungeonData.Direction.SOUTH)
                         {
                             flippableCover.ForceSetFlipper(base.Owner);
                             flippableCover.Flip((UnityEngine.Random.value <= 0.5f) ? DungeonData.Direction.WEST : DungeonData.Direction.EAST);
                         }
                         else
                         {
                             flippableCover.ForceSetFlipper(base.Owner);
                             flippableCover.Flip(table.DirectionFlipped);
                         }
                     }
                     else if (flippableCover.flipStyle == FlippableCover.FlipStyle.ONLY_FLIPS_UP_DOWN)
                     {
                         if (table.DirectionFlipped == DungeonData.Direction.EAST || table.DirectionFlipped == DungeonData.Direction.WEST)
                         {
                             flippableCover.ForceSetFlipper(base.Owner);
                             flippableCover.Flip((UnityEngine.Random.value <= 0.5f) ? DungeonData.Direction.SOUTH : DungeonData.Direction.NORTH);
                         }
                         else
                         {
                             flippableCover.ForceSetFlipper(base.Owner);
                             flippableCover.Flip(table.DirectionFlipped);
                         }
                     }
                 }
             }
         }
     }
 }
示例#10
0
 private void HandleTableVolley(TableTechChaosEffectIdentifier identifier, FlippableCover table)
 {
     if (identifier == TableTechChaosEffectIdentifier.TABLE_VOLLEY)
     {
         IntVector2           intVector2FromDirection = DungeonData.GetIntVector2FromDirection(table.DirectionFlipped);
         ProjectileVolleyData sourceVolley            = this.Volley;
         float d = 1f;
         if (this.m_owner && this.m_owner.PlayerHasActiveSynergy("#HIDDEN_TECH_SUPER_CHAOS"))
         {
             sourceVolley = this.VolleyOverride;
             d            = 2f;
         }
         VolleyUtility.FireVolley(sourceVolley, table.sprite.WorldCenter + intVector2FromDirection.ToVector2() * d, intVector2FromDirection.ToVector2(), this.m_owner, false);
     }
 }
示例#11
0
 private void HandleRageEffect(TableTechChaosEffectIdentifier identifier)
 {
     if (identifier == TableTechChaosEffectIdentifier.RAGE)
     {
         if (this.m_rageElapsed > 0f)
         {
             this.m_rageElapsed = 5f;
             if (base.Owner.HasActiveBonusSynergy(CustomSynergyType.ANGRIER_BULLETS, false))
             {
                 this.m_rageElapsed *= 3f;
             }
             if (this.RageOverheadVFX && this.rageInstanceVFX == null)
             {
                 this.rageInstanceVFX = base.Owner.PlayEffectOnActor(this.RageOverheadVFX, new Vector3(0f, 1.375f, 0f), true, true, false);
             }
         }
         else
         {
             base.Owner.StartCoroutine(this.HandleRageCooldown());
         }
     }
 }
示例#12
0
 private void HandleBlackHoleEffect(TableTechChaosEffectIdentifier identifier, FlippableCover obj)
 {
     if (identifier == TableTechChaosEffectIdentifier.BLACK_HOLE)
     {
         Vector3        vector2     = obj.specRigidbody.UnitCenter;
         GameObject     gameObject2 = UnityEngine.Object.Instantiate <GameObject>(SingularityObject, vector2, Quaternion.identity);
         tk2dBaseSprite component4  = gameObject2.GetComponent <tk2dBaseSprite>();
         if (component4)
         {
             component4.PlaceAtPositionByAnchor(vector2, tk2dBaseSprite.Anchor.MiddleCenter);
         }
         DebrisObject debrisObject = LootEngine.DropItemWithoutInstantiating(gameObject2, gameObject2.transform.position, Vector2.zero, 0f, false, false, true, false);
         if (gameObject2.GetComponent <BlackHoleDoer>())
         {
             debrisObject.PreventFallingInPits = true;
             debrisObject.PreventAbsorption    = true;
         }
         debrisObject.IsAccurateDebris = true;
         debrisObject.Priority         = EphemeralObject.EphemeralPriority.Critical;
         debrisObject.bounceCount      = 0;
         obj.DestroyCover();
     }
 }
示例#13
0
 public TableTechChaosEffect(TableTechChaosEffectIdentifier identifier)
 {
     this.identifier = identifier;
 }
示例#14
0
        private void HandleProjectileEffect(TableTechChaosEffectIdentifier identifier, FlippableCover table)
        {
            if (identifier == TableTechChaosEffectIdentifier.PROJECTILE)
            {
                GameObject original = (GameObject)ResourceCache.Acquire("Global VFX/VFX_Table_Exhaust");
                Vector2    vector   = DungeonData.GetIntVector2FromDirection(table.DirectionFlipped).ToVector2();
                float      z        = BraveMathCollege.Atan2Degrees(vector);
                Vector3    zero     = Vector3.zero;
                switch (table.DirectionFlipped)
                {
                case DungeonData.Direction.NORTH:
                    zero = Vector3.zero;
                    break;

                case DungeonData.Direction.EAST:
                    zero = new Vector3(-0.5f, 0.25f, 0f);
                    break;

                case DungeonData.Direction.SOUTH:
                    zero = new Vector3(0f, 0.5f, 1f);
                    break;

                case DungeonData.Direction.WEST:
                    zero = new Vector3(0.5f, 0.25f, 0f);
                    break;
                }
                GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original, table.specRigidbody.UnitCenter.ToVector3ZisY(0f) + zero, Quaternion.Euler(0f, 0f, z));
                gameObject.transform.parent = table.specRigidbody.transform;
                Projectile projectile = table.specRigidbody.gameObject.AddComponent <Projectile>();
                projectile.Shooter         = base.Owner.specRigidbody;
                projectile.Owner           = base.Owner;
                projectile.baseData.damage = 30f;
                projectile.baseData.range  = 1000f;
                projectile.baseData.speed  = 20f;
                projectile.baseData.force  = 50f;
                projectile.baseData.UsesCustomAccelerationCurve     = true;
                projectile.baseData.AccelerationCurve               = this.CustomAccelerationCurve;
                projectile.baseData.CustomAccelerationCurveDuration = 0.8f;
                projectile.shouldRotate = false;
                projectile.Start();
                projectile.SendInDirection(vector, true, true);
                projectile.collidesWithProjectiles = true;
                projectile.projectileHitHealth     = 20;
                Action <Projectile> value = delegate(Projectile p)
                {
                    if (table && table.shadowSprite)
                    {
                        table.shadowSprite.renderer.enabled = false;
                    }
                };
                projectile.OnDestruction += value;
                ExplosiveModifier explosiveModifier = projectile.gameObject.AddComponent <ExplosiveModifier>();
                explosiveModifier.explosionData = this.ProjectileExplosionData;
                table.PreventPitFalls           = true;
                if (base.Owner && base.Owner.PlayerHasActiveSynergy("#HIDDEN_TECH_SUPER_CHAOS"))
                {
                    HomingModifier homingModifier = projectile.gameObject.AddComponent <HomingModifier>();
                    homingModifier.AssignProjectile(projectile);
                    homingModifier.HomingRadius    = 20f;
                    homingModifier.AngularVelocity = 720f;
                    BounceProjModifier bounceProjModifier = projectile.gameObject.AddComponent <BounceProjModifier>();
                    bounceProjModifier.numberOfBounces    = 4;
                    bounceProjModifier.onlyBounceOffTiles = true;
                }
            }
        }
示例#15
0
        private IEnumerator HandleDelayedEffect(float delayTime, Action <TableTechChaosEffectIdentifier, FlippableCover> effect, TableTechChaosEffectIdentifier identifier, FlippableCover table)
        {
            yield return(new WaitForSeconds(delayTime));

            effect(identifier, table);
            yield break;
        }