コード例 #1
0
 public Cf3MapObjectEelPitcher(int nCX, int nCY) : base(f3MapObjectType.MOT_EELPITCHER)
 {
     m_Delay     = 0;
     m_Level     = 1;
     m_DX        = 0;
     m_DY        = 0;
     m_State     = f3EelPitcherState.EELSEED;
     m_bBlinking = (false);
     m_EnemyList.Add(GetID(), this);
     SetPos(nCX * 32 + 16, nCY * 32 + 16);
 }
コード例 #2
0
 public override void OnMove()
 {
     if (m_State == f3EelPitcherState.EELLEAF)
     {
         TL.BringClose(ref m_Y, m_RootY - m_Level * 32, 4.0f);
         m_DX = m_DX + (m_pParent.GetWind((int)Math.Floor(m_X / 32), (int)Math.Floor(m_Y / 32)) - m_DX) * m_Level * 0.1f + (m_RootX - m_X) * 0.025f;
         TL.Saturate(-14.0f, ref m_DX, 14.0f);
         m_X += m_DX;
         if (m_pParent.GetHit((int)Math.Floor((m_X - 16) / 32), (int)Math.Floor(m_Y / 32), HIT.HIT_RIGHT))
         {
             m_DX = 0;
             m_X  = (int)Math.Floor(m_X / 32) * 32 + 16;
         }
         else if (m_pParent.GetHit((int)Math.Floor((m_X + 16) / 32), (int)Math.Floor(m_Y / 32), HIT.HIT_LEFT))
         {
             m_DX = 0;
             m_X  = (int)Math.Floor(m_X / 32) * 32 + 16;
         }
     }
     else if (m_State == f3EelPitcherState.EELFROZEN)
     {
         if (--m_Delay == 0)
         {
             m_Y    += 16;
             m_State = f3EelPitcherState.EELSEED;
             m_Delay = 200;
             new Cf3MapObjectEffect(m_X, m_Y, 0);
         }
     }
     else if (m_State == f3EelPitcherState.EELSEED)
     {
         TL.BringClose(ref m_DY, 8.0f, 1.0f);
         m_DX += (m_pParent.GetWind((int)Math.Floor(m_X / 32), (int)Math.Floor(m_Y / 32)) - m_DX) * 0.2f;
         TL.Saturate(-14.0f, ref m_DX, 14.0f);
         m_X += m_DX;
         if (m_pParent.GetHit((int)Math.Floor((m_X - 16) / 32), (int)Math.Floor(m_Y / 32), HIT.HIT_RIGHT))
         {
             m_DX = 0;
             m_X  = (int)Math.Floor(m_X / 32) * 32 + 16;
         }
         else if (m_pParent.GetHit((int)Math.Floor((m_X + 16) / 32), (int)Math.Floor(m_Y / 32), HIT.HIT_LEFT))
         {
             m_DX = 0;
             m_X  = (int)Math.Floor(m_X / 32) * 32 + 16;
         }
         m_Y += m_DY;
         if ((int)Math.Floor(m_Y / 32) != (int)Math.Floor((m_Y - m_DY) / 32))
         {
             // 32ドット境界をまたいだ!!
             if (m_pParent.GetHit((int)Math.Floor(m_X / 32), (int)Math.Floor(m_Y / 32), HIT.HIT_TOP) ||
                 (int)Math.Floor(m_Y / 32) >= m_pParent.GetHeight())
             {
                 Seed();
             }
             else
             {
                 if (m_pParent.GetHit((int)Math.Floor((m_X - 16) / 32), (int)Math.Floor(m_Y / 32), HIT.HIT_RIGHT))
                 {
                     m_DX = 0;
                     m_X  = (int)Math.Floor(m_X / 32) * 32 + 16;
                 }
                 else if (m_pParent.GetHit((int)Math.Floor((m_X + 16) / 32), (int)Math.Floor(m_Y / 32), HIT.HIT_LEFT))
                 {
                     m_DX = 0;
                     m_X  = (int)Math.Floor(m_X / 32) * 32 + 16;
                 }
             }
         }
     }
     else if (m_State == f3EelPitcherState.EELBUD)
     {
         if (--m_Delay == 0)
         {
             m_State = f3EelPitcherState.EELLEAF;
         }
     }
     else if (m_State == f3EelPitcherState.EELDEAD)
     {
         Kill();
     }
 }
コード例 #3
0
 public override void Synergy()
 {
     if (!IsValid())
     {
         return;
     }
     m_bBlinking = false;
     GetCPos(out var cx, out var cy);
     if (m_State == f3EelPitcherState.EELLEAF)
     {
         foreach (var it in m_pParent.GetMapObjects(cx - 2, cy - 2, cx + 2, cy + 2, f3MapObjectType.MOT_FUNYA))
         {
             if (it.IsValid())
             {
                 Reaction(it);
             }
         }
         if (m_RootY - m_Y > 16)
         {
             foreach (var it in m_pParent.GetMapObjects(cx - 1, cy - 1, cx + 1, cy + 1, f3MapObjectType.MOT_ICE))
             {
                 if (it.IsValid())
                 {
                     it.GetPos(out var objX, out var objY);
                     if (TL.IsIn(m_X - 16, objX, m_X + 16))
                     {
                         if (TL.IsIn(m_Y, objY, m_Y + 40))
                         {
                             Freeze();
                         }
                     }
                 }
             }
         }
     }
     foreach (var it in m_pParent.GetMapObjects(cx - 1, cy - 1, cx + 1, cy + 1, f3MapObjectType.MOT_EELPITCHER))
     {
         if (it.IsValid() && it != this)
         {
             it.GetPos(out var objX, out var objY);
             if (m_State == f3EelPitcherState.EELLEAF || m_State == f3EelPitcherState.EELFROZEN)
             {
                 if (TL.IsIn(m_X - 16, objX, m_X + 16))
                 {
                     if (TL.IsIn(m_Y, objY, m_Y + 16))
                     {
                         if (((Cf3MapObjectEelPitcher)it).m_State != f3EelPitcherState.EELLEAF)
                         {
                             // 食べちゃった!!
                             m_Level += ((Cf3MapObjectEelPitcher)it).m_Level;
                         }
                         else
                         {
                             // 食べられちゃった!!
                             m_State = f3EelPitcherState.EELDEAD;
                         }
                     }
                 }
             }
             else if (m_State == f3EelPitcherState.EELSEED)
             {
                 if (TL.IsIn(objX - 16, m_X, objX + 16))
                 {
                     if (TL.IsIn(objY, m_Y, objY + 16))
                     {
                         if (((Cf3MapObjectEelPitcher)it).m_State != f3EelPitcherState.EELDEAD)
                         {
                             // 食べられちゃった!!
                             m_State = f3EelPitcherState.EELDEAD;
                         }
                         else
                         {
                             // 食べちゃった!!
                             m_Level += ((Cf3MapObjectEelPitcher)it).m_Level;
                         }
                     }
                 }
             }
         }
     }
     foreach (var it in m_pParent.GetMapObjects(cx - 2, cy - 2, cx + 2, cy + 2, f3MapObjectType.MOT_GEASPRIN))
     {
         if (it.IsValid())
         {
             Reaction(it);
         }
     }
     foreach (var it in m_pParent.GetMapObjects(cx - 1, cy - 1, cx + 1, cy + 1, f3MapObjectType.MOT_NEEDLE))
     {
         if (it.IsValid())
         {
             Reaction(it);
         }
     }
 }