コード例 #1
0
ファイル: SettingLayer.cs プロジェクト: toowind/BBMessenger
        public void ShowWidnow(bool bShow)
        {
            bool bVisible = visible();

            if (bVisible == bShow)
            {
                return;
            }

            set_visible(bShow);
            m_btnCancle.set_visible(bShow);
            m_btnOk.set_visible(bShow);
            m_btnMinus.set_visible(bShow);
            m_btnAdd.set_visible(bShow);
            m_sldNumber.set_visible(bShow);
            m_btnMinus1.set_visible(bShow);
            m_btnAdd1.set_visible(bShow);
            m_sldNumber1.set_visible(bShow);

            if (bShow)
            {
                try
                {
                    Sound_Instance pSound = Root.instance().sound_manager().sound_instance(16);
                    pSound.play(false, true);
                }
                catch
                {
                }
            }
        }
コード例 #2
0
ファイル: BuyBulletLayer.cs プロジェクト: toowind/BBMessenger
        public void ShowWidnow(bool bIsShow)
        {
            CGameScene pGameScene = (CGameScene)parent();

            bool bShow = (pGameScene.m_dwRoomType == 0) ? bIsShow : false;

            bool bVisible = visible();

            if (bVisible == bShow)
            {
                return;
            }

            set_visible(bShow);
            m_btnCancle.set_visible(bShow);
            m_btnMax.set_visible(bShow);
            m_btnOk.set_visible(bShow);
            m_btnMinus.set_visible(bShow);
            m_btnAdd.set_visible(bShow);
            m_sldNumber.set_visible(bShow);

            if (bShow)
            {
                try
                {
                    Sound_Instance pSound = Root.instance().sound_manager().sound_instance(16);
                    pSound.play(false, true);
                }
                catch
                {
                }
            }

            if (bIsShow == true)
            {
                CClientKernel pClientKernel = pGameScene.GetClientKernel();
                if (pClientKernel == null)
                {
                    return;
                }

                UserInfo pUserData = pClientKernel.GetMeUserInfo();
                if ((pUserData != null) && (pUserData.GetGameMoney() > 100))
                {
                    int nMeBuyCount = (pUserData.GetGameMoney() - 100) / m_lCellScore;
                    m_nMaxBuyFishGold = (m_nMaxFishGold <= nMeBuyCount) ? m_nMaxFishGold : nMeBuyCount;
                }
                else
                {
                    m_nMaxBuyFishGold = 0;
                }

                button_press(10011);
            }
        }
コード例 #3
0
        public void ChangeSceneType(FishDefine.enSceneType SceneType)
        {
            if (SceneType == m_SceneType)
            {
                return;
            }

            if (m_BackSound[m_cbSceneSoundOld] != null)
            {
                m_BackSound[m_cbSceneSoundOld].stop();
            }

            m_cbSceneSoundOld = m_cbSceneSound;

            try
            {
                Sound_Instance pSound = Root.instance().sound_manager().sound_instance(4);
                pSound.play(false, true);
            }
            catch
            {
            }

            m_SceneType  = SceneType;
            m_IsSceneing = 1;

            ostringstream ostr = new ostringstream();

            int nSide = 1;

            Point ptBegin = (nSide == 0) ? new Point(-263, 0) : new Point(1280 + 263, 0);
            Point ptEnd   = (nSide == 0) ? new Point(1272 - 20, 0) : new Point(-283, 0);

            ostr.str("");
            ostr = ostr + "tide_water_" + nSide;

            m_sprTideWater.set_display_image(Root.instance().imageset_manager().imageset("ui_game").image(ostr.str()));
            m_sprTideWater.set_position(ptBegin);
            m_sprTideWater.set_visible(true);

            ostr.str("");
            ostr             = ostr + "bg_game_" + (int)SceneType;
            m_imgBackground1 = Root.instance().imageset_manager().imageset(ostr.str()).image("bg");

            GameControls.XLBE.Action actWater = new Action_Sequence(new Action_Delay(4), new Action_Move_To(4.4135, ptEnd), new Action_Func(ChangeSceneEnd), null);
            m_sprTideWater.run_action(actWater);
        }
コード例 #4
0
        //C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
        //	CNetLayer();
        //C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
        //	public void Dispose();

        //C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
        //	virtual void update(float dt);
        //C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
        //	virtual void draw();

        public bool NetFire(Point pt, int wChairID, FishDefine.enCannonType CannonType, int dwMulRate)
        {
            CNetObjectExtend pNetObjectExtend = new CNetObjectExtend();

            pNetObjectExtend.wChairID   = wChairID;
            pNetObjectExtend.CannonType = CannonType;
            pNetObjectExtend.dwMulRate  = dwMulRate;

            int nFirst = 0;

            if (CannonType > FishDefine.enCannonType.CannonType_5)
            {
                nFirst = 1;
            }

            Size szScale = new Size();

            switch (CannonType)
            {
            case FishDefine.enCannonType.CannonType_0:
            {
                szScale.width_  = 0.5;
                szScale.height_ = 0.5;
                break;
            }

            case FishDefine.enCannonType.CannonType_1:
            {
                szScale.width_  = 0.6;
                szScale.height_ = 0.6;
                break;
            }

            case FishDefine.enCannonType.CannonType_2:
            {
                szScale.width_  = 0.7;
                szScale.height_ = 0.7;
                break;
            }

            case FishDefine.enCannonType.CannonType_3:
            {
                szScale.width_  = 0.8;
                szScale.height_ = 0.8;
                break;
            }

            case FishDefine.enCannonType.CannonType_4:
            {
                szScale.width_  = 0.9;
                szScale.height_ = 0.9;
                break;
            }

            case FishDefine.enCannonType.CannonType_5:
            {
                szScale.width_  = 0.9;
                szScale.height_ = 0.9;
                break;
            }

            case FishDefine.enCannonType.CannonType_6:
            {
                szScale.width_  = 1.0;
                szScale.height_ = 1.0;
                break;
            }
            }


            ostringstream ostr = new ostringstream();

            ostr = ostr + "net_" + nFirst + "_" + (int)wChairID;

            Sprite sprNet = new Sprite(Root.instance().imageset_manager().imageset(ostr.str()).image("0"));

            sprNet.set_node_extend(pNetObjectExtend);

            sprNet.set_position(pt);
            sprNet.set_scale(szScale);
            add_child(sprNet);

            Animation aniBullet = Root.instance().animation_manager().animation(ostr.str());

            sprNet.run_action(new Action_Sequence(new Action_Animation(0.06, aniBullet, false), new Action_Func(NetEnd), null));

            try
            {
                Sound_Instance pSound = Root.instance().sound_manager().sound_instance(nFirst + 7);
                pSound.play(false, true);
            }
            catch
            {
            }

            return(true);
        }
コード例 #5
0
        //C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
        //	virtual void draw();

        public bool BulletFire(Point ptStart, double rotation, int wChairID, FishDefine.enCannonType CannonType, int dwMulRate)
        {
            if (GetBulletCount() > 51)
            {
                return(true);
            }

            CBulletObjectExtend BulletObjectExtend = new CBulletObjectExtend();

            BulletObjectExtend.fRotation  = rotation;
            BulletObjectExtend.wChairID   = wChairID;
            BulletObjectExtend.CannonType = CannonType;
            BulletObjectExtend.dwMulRate  = dwMulRate;

            int nFirst = 0;

            if (CannonType > FishDefine.enCannonType.CannonType_5)
            {
                nFirst = 1;
            }

            Size szScale = new Size();

            switch (CannonType)
            {
            case FishDefine.enCannonType.CannonType_0:
            {
                szScale.width_  = 0.5;
                szScale.height_ = 0.5;
                break;
            }

            case FishDefine.enCannonType.CannonType_1:
            {
                szScale.width_  = 0.6;
                szScale.height_ = 0.6;
                break;
            }

            case FishDefine.enCannonType.CannonType_2:
            {
                szScale.width_  = 0.7;
                szScale.height_ = 0.7;
                break;
            }

            case FishDefine.enCannonType.CannonType_3:
            {
                szScale.width_  = 0.8;
                szScale.height_ = 0.8;
                break;
            }

            case FishDefine.enCannonType.CannonType_4:
            {
                szScale.width_  = 0.9;
                szScale.height_ = 0.9;
                break;
            }

            case FishDefine.enCannonType.CannonType_5:
            {
                szScale.width_  = 0.9;
                szScale.height_ = 0.9;
                break;
            }

            case FishDefine.enCannonType.CannonType_6:
            {
                szScale.width_  = 1.0;
                szScale.height_ = 1.0;
                break;
            }
            }


            ostringstream ostr = new ostringstream();

            ostr = ostr + "shot_" + nFirst + "_" + (int)wChairID;

            Sprite sprBullet = new Sprite(Root.instance().imageset_manager().imageset(ostr.str()).image("0"));

            sprBullet.set_node_extend(BulletObjectExtend);

            Point pt = new Point(ptStart.x_ + 56 * Math.Cos(rotation - FishDefine.M_PI_2), ptStart.y_ + 56 * Math.Sin(rotation - FishDefine.M_PI_2));

            sprBullet.set_position(pt);
            sprBullet.set_rotation(rotation);
            sprBullet.set_scale(szScale);
            add_child(sprBullet);

            GameControls.XLBE.Action actBullet = new Action_Move_By(3, new Point(2000 * Math.Cos(rotation - FishDefine.M_PI_2), 2000 * Math.Sin(rotation - FishDefine.M_PI_2)));
            sprBullet.run_action(actBullet);

            Animation aniBullet = Root.instance().animation_manager().animation(ostr.str());

            sprBullet.run_action(new Action_Repeat_Forever(new Action_Animation(0.06, aniBullet, false)));

            //  CGameScene *pGameScene = (CGameScene *)parent();
            //  if (wChairID == pGameScene->GetMeChairID())
            //  {
            //      CMD_C_Fire Fire;
            //Fire.cbIsBack = FALSE;
            //      Fire.fRote = rotation;
            //Fire.dwMulRate = dwMulRate;
            //Fire.xStart = 0;
            //Fire.yStart = 0;
            //      pGameScene->GetClientKernel()->SendSocketData(MDM_GF_GAME, SUB_C_FIRE, &Fire, sizeof(CMD_C_Fire));
            //  }

            try
            {
                Sound_Instance pSound = Root.instance().sound_manager().sound_instance(nFirst + 5);
                pSound.play(false, true);
            }
            catch
            {
            }

            return(true);
        }