示例#1
0
 private void DryadInteract(FrameEventData evt)
 {
     if (this._dryad == null)
     {
         return;
     }
     this._dryad.ai[0] = 9f;
     if (evt.IsFirstFrame)
     {
         this._dryad.ai[1] = (float)evt.Duration;
     }
     this._dryad.localAI[0] = 0.0f;
 }
示例#2
0
        private void SpawnGoblin(FrameEventData evt)
        {
            int index = NPC.NewNPC((int)this._portal.Center.X, (int)this._portal.Bottom.Y, 552, 0, 0.0f, 0.0f, 0.0f, 0.0f, (int)byte.MaxValue);
            NPC npc   = Main.npc[index];

            npc.knockBackResist            = 0.0f;
            npc.immortal                   = true;
            npc.dontTakeDamage             = true;
            npc.takenDamageMultiplier      = 0.0f;
            npc.immune[(int)byte.MaxValue] = 100000;
            npc.friendly                   = this._ogre.friendly;
            this._army.Add(npc);
        }
示例#3
0
        // Token: 0x0600130E RID: 4878 RVA: 0x0041A478 File Offset: 0x00418678
        private void SpawnGoblin(FrameEventData evt)
        {
            int num = NPC.NewNPC((int)this._portal.Center.X, (int)this._portal.Bottom.Y, 552, 0, 0f, 0f, 0f, 0f, 255);
            NPC nPC = Main.npc[num];

            nPC.knockBackResist       = 0f;
            nPC.immortal              = true;
            nPC.dontTakeDamage        = true;
            nPC.takenDamageMultiplier = 0f;
            nPC.immune[255]           = 100000;
            nPC.friendly              = this._ogre.friendly;
            this._army.Add(nPC);
        }
示例#4
0
        private void SpawnJavalinThrower(FrameEventData evt)
        {
            var index = NPC.NewNPC((int)_portal.Center.X, (int)_portal.Bottom.Y, 561, 0, 0.0f, 0.0f, 0.0f,
                                   0.0f, byte.MaxValue);
            var npc = Main.npc[index];

            npc.knockBackResist       = 0.0f;
            npc.immortal              = true;
            npc.dontTakeDamage        = true;
            npc.takenDamageMultiplier = 0.0f;
            npc.immune[byte.MaxValue] = 100000;
            npc.friendly              = _ogre.friendly;
            _army.Add(npc);
        }
示例#5
0
 private void DryadPortalKnock(FrameEventData evt)
 {
     if (this._dryad != null)
     {
         if (evt.Frame == 20)
         {
             // ISSUE: explicit reference operation
             // ISSUE: variable of a reference type
             Vector2& local1 = @this._dryad.velocity;
             // ISSUE: explicit reference operation
             double num1 = (^ local1).Y - 7.0;
             // ISSUE: explicit reference operation
             (^ local1).Y = (__Null)num1;
             // ISSUE: explicit reference operation
             // ISSUE: variable of a reference type
             Vector2& local2 = @this._dryad.velocity;
             // ISSUE: explicit reference operation
             double num2 = (^ local2).X - 8.0;
             // ISSUE: explicit reference operation
             (^ local2).X = (__Null)num2;
             Main.PlaySound(3, (int)this._dryad.Center.X, (int)this._dryad.Center.Y, 1, 1f, 0.0f);
         }
         if (evt.Frame >= 20)
         {
             this._dryad.ai[0]     = 1f;
             this._dryad.ai[1]     = (float)evt.Remaining;
             this._dryad.rotation += 0.05f;
         }
     }
     if (this._ogre == null)
     {
         return;
     }
     if (evt.Frame > 40)
     {
         this._ogre.target    = Main.myPlayer;
         this._ogre.direction = 1;
     }
     else
     {
         this._ogre.direction = -1;
         this._ogre.ai[1]     = 0.0f;
         this._ogre.ai[0]     = Math.Min(40f, this._ogre.ai[0]);
         this._ogre.target    = 300 + this._dryad.whoAmI;
     }
 }
示例#6
0
        private void DryadPortalFade(FrameEventData evt)
        {
            if (this._dryad == null || this._portal == null)
            {
                return;
            }
            if (evt.IsFirstFrame)
            {
                Main.PlaySound(SoundID.DD2_EtherianPortalDryadTouch, this._dryad.Center);
            }
            float amount = Math.Max(0.0f, (float)(evt.Frame - 7) / (float)(evt.Duration - 7));

            this._dryad.color     = new Color(Vector3.Lerp(Vector3.One, new Vector3(0.5f, 0.0f, 0.8f), amount));
            this._dryad.Opacity   = 1f - amount;
            this._dryad.rotation += (float)(0.0500000007450581 * ((double)amount * 4.0 + 1.0));
            this._dryad.scale     = 1f - amount;
            if ((double)this._dryad.position.X < (double)this._portal.Right.X)
            {
                this._dryad.velocity.X *= 0.95f;
                this._dryad.velocity.Y *= 0.55f;
            }
            int   num1 = (int)(6.0 * (double)amount);
            float num2 = this._dryad.Size.Length() / 2f / 20f;

            for (int index = 0; index < num1; ++index)
            {
                if (Main.rand.Next(5) == 0)
                {
                    Dust   dust = Dust.NewDustDirect(this._dryad.position, this._dryad.width, this._dryad.height, 27, this._dryad.velocity.X * 1f, 0.0f, 100, new Color(), 1f);
                    double num3 = 0.550000011920929;
                    dust.scale = (float)num3;
                    double num4 = 0.699999988079071;
                    dust.fadeIn = (float)num4;
                    Vector2 vector2_1 = dust.velocity * (0.1f * num2);
                    dust.velocity = vector2_1;
                    Vector2 vector2_2 = dust.velocity + this._dryad.velocity;
                    dust.velocity = vector2_2;
                }
            }
        }
示例#7
0
        private void DryadPortalFade(FrameEventData evt)
        {
            if (_dryad == null || _portal == null)
            {
                return;
            }
            if (evt.IsFirstFrame)
            {
                Main.PlaySound(SoundID.DD2_EtherianPortalDryadTouch, _dryad.Center);
            }
            var amount = Math.Max(0.0f, (evt.Frame - 7) / (float)(evt.Duration - 7));

            _dryad.color     = new Color(Vector3.Lerp(Vector3.One, new Vector3(0.5f, 0.0f, 0.8f), amount));
            _dryad.Opacity   = 1f - amount;
            _dryad.rotation += (float)(0.0500000007450581 * (amount * 4.0 + 1.0));
            _dryad.scale     = 1f - amount;
            if (_dryad.position.X < (double)_portal.Right.X)
            {
                _dryad.velocity.X *= 0.95f;
                _dryad.velocity.Y *= 0.55f;
            }

            var num1 = (int)(6.0 * amount);
            var num2 = _dryad.Size.Length() / 2f / 20f;

            for (var index = 0; index < num1; ++index)
            {
                if (Main.rand.Next(5) == 0)
                {
                    var dust = Dust.NewDustDirect(_dryad.position, _dryad.width, _dryad.height, 27,
                                                  _dryad.velocity.X * 1f, 0.0f, 100, new Color(), 1f);
                    dust.scale     = 0.55f;
                    dust.fadeIn    = 0.7f;
                    dust.velocity *= 0.1f * num2;
                    dust.velocity += _dryad.velocity;
                }
            }
        }
示例#8
0
        private void DryadPortalFade(FrameEventData evt)
        {
            if (_dryad == null || _portal == null)
            {
                return;
            }
            if (evt.IsFirstFrame)
            {
                SoundEngine.PlaySound(SoundID.DD2_EtherianPortalDryadTouch, _dryad.Center);
            }
            float val = (float)(evt.Frame - 7) / (float)(evt.Duration - 7);

            val              = Math.Max(0f, val);
            _dryad.color     = new Color(Vector3.Lerp(Vector3.One, new Vector3(0.5f, 0f, 0.8f), val));
            _dryad.Opacity   = 1f - val;
            _dryad.rotation += 0.05f * (val * 4f + 1f);
            _dryad.scale     = 1f - val;
            if (_dryad.position.X < _portal.Right.X)
            {
                _dryad.velocity.X *= 0.95f;
                _dryad.velocity.Y *= 0.55f;
            }
            int   num  = (int)(6f * val);
            float num2 = _dryad.Size.Length() / 2f;

            num2 /= 20f;
            for (int i = 0; i < num; i++)
            {
                if (Main.rand.Next(5) == 0)
                {
                    Dust dust = Dust.NewDustDirect(_dryad.position, _dryad.width, _dryad.height, 27, _dryad.velocity.X * 1f, 0f, 100);
                    dust.scale     = 0.55f;
                    dust.fadeIn    = 0.7f;
                    dust.velocity *= 0.1f * num2;
                    dust.velocity += _dryad.velocity;
                }
            }
        }
示例#9
0
 // Token: 0x06001314 RID: 4884 RVA: 0x0041A918 File Offset: 0x00418B18
 private void DryadPortalFade(FrameEventData evt)
 {
     if (this._dryad != null && this._portal != null)
     {
         if (evt.IsFirstFrame)
         {
             Main.PlaySound(SoundID.DD2_EtherianPortalDryadTouch, this._dryad.Center);
         }
         float num = (float)(evt.Frame - 7) / (float)(evt.Duration - 7);
         num = Math.Max(0f, num);
         this._dryad.color     = new Color(Vector3.Lerp(Vector3.One, new Vector3(0.5f, 0f, 0.8f), num));
         this._dryad.Opacity   = 1f - num;
         this._dryad.rotation += 0.05f * (num * 4f + 1f);
         this._dryad.scale     = 1f - num;
         if (this._dryad.position.X < this._portal.Right.X)
         {
             NPC expr_101_cp_0_cp_0 = this._dryad;
             expr_101_cp_0_cp_0.velocity.X = expr_101_cp_0_cp_0.velocity.X * 0.95f;
             NPC expr_11A_cp_0_cp_0 = this._dryad;
             expr_11A_cp_0_cp_0.velocity.Y = expr_11A_cp_0_cp_0.velocity.Y * 0.55f;
         }
         int   num2 = (int)(6f * num);
         float num3 = this._dryad.Size.Length() / 2f;
         num3 /= 20f;
         for (int i = 0; i < num2; i++)
         {
             if (Main.rand.Next(5) == 0)
             {
                 Dust expr_1BA = Dust.NewDustDirect(this._dryad.position, this._dryad.width, this._dryad.height, 27, this._dryad.velocity.X * 1f, 0f, 100, default(Color), 1f);
                 expr_1BA.scale     = 0.55f;
                 expr_1BA.fadeIn    = 0.7f;
                 expr_1BA.velocity *= 0.1f * num3;
                 expr_1BA.velocity += this._dryad.velocity;
             }
         }
     }
 }
示例#10
0
        private void DryadPortalKnock(FrameEventData evt)
        {
            if (_dryad != null)
            {
                if (evt.Frame == 20)
                {
                    _dryad.velocity.Y -= 7f;
                    _dryad.velocity.X -= 8f;
                    Main.PlaySound(3, (int)_dryad.Center.X, (int)_dryad.Center.Y, 1, 1f, 0.0f);
                }

                if (evt.Frame >= 20)
                {
                    _dryad.ai[0]     = 1f;
                    _dryad.ai[1]     = evt.Remaining;
                    _dryad.rotation += 0.05f;
                }
            }

            if (_ogre == null)
            {
                return;
            }
            if (evt.Frame > 40)
            {
                _ogre.target    = Main.myPlayer;
                _ogre.direction = 1;
            }
            else
            {
                _ogre.direction = -1;
                _ogre.ai[1]     = 0.0f;
                _ogre.ai[0]     = Math.Min(40f, _ogre.ai[0]);
                _ogre.target    = 300 + _dryad.whoAmI;
            }
        }
示例#11
0
 private static void EmptyFrameEvent(FrameEventData evt)
 {
 }
示例#12
0
 private void PerFrameSettings(FrameEventData evt)
 {
     CombatText.clearAll();
 }
示例#13
0
 private void DryadWalk(FrameEventData evt)
 {
     this._dryad.ai[0] = 1f;
     this._dryad.ai[1] = 2f;
 }
示例#14
0
 private void CreatePortal(FrameEventData evt)
 {
     this._portal          = this.PlaceNPCOnGround(549, this._startPoint + new Vector2(-240f, 0.0f));
     this._portal.immortal = true;
 }
示例#15
0
 private void OgreSwingSound(FrameEventData evt)
 {
     Main.PlaySound(SoundID.DD2_OgreAttack, this._ogre.Center);
 }
示例#16
0
 private void OgreSwingSound(FrameEventData evt)
 {
     SoundEngine.PlaySound(SoundID.DD2_OgreAttack, _ogre.Center);
 }
示例#17
0
 private void CreatePortal(FrameEventData evt)
 {
     _portal          = PlaceNPCOnGround(549, _startPoint + new Vector2(-240f, 0f));
     _portal.immortal = true;
 }