Exemplo n.º 1
0
        public override void draw()
        {
            base.draw();

            CGameScene    pGameScene    = (CGameScene)parent();
            CClientKernel pClientKernel = pGameScene.GetClientKernel();

            if (pClientKernel == null)
            {
                return;
            }

            if (((pGameScene.m_dwRoomType == 1) || (pGameScene.m_dwRoomType == 2)) && (visible()))
            {
                Point pt = position_absolute();

                pt.x_ += 216;
                pt.y_ += 84;

                ostringstream ostr2 = new ostringstream();
                ostr2 = ostr2 + pGameScene.m_layRoles[pGameScene.GetMeChairID()].m_dwMatchScore;
                m_Font.draw_string(pt, ostr2.str(), new Color(241, 37, 0));

                pt.x_ += 142;

                ostr2.str("");
                ostr2 = ostr2 + pGameScene.m_layRoles[pGameScene.GetMeChairID()].m_dwMatchIndex;
                m_Font.draw_string(pt, ostr2.str(), new Color(241, 37, 0));
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        public override void draw()
        {
            base.draw();

            CGameScene    pGameScene    = (CGameScene)parent();
            CClientKernel pClientKernel = pGameScene.GetClientKernel();

            if (pClientKernel == null)
            {
                return;
            }
        }
Exemplo n.º 4
0
        public override void draw()
        {
            base.draw();

            CGameScene    pGameScene    = (CGameScene)parent();
            CClientKernel pClientKernel = pGameScene.GetClientKernel();

            if (pClientKernel == null)
            {
                return;
            }

            if (visible())
            {
                SetTimeHour(pGameScene.m_nMatchHour);
                SetTimeMinute(pGameScene.m_nMatchMinute);
                SetTimeSecond(pGameScene.m_nMatchSecond);

                Point pt = position_absolute();
                for (int i = 0; i < 2; i++)
                {
                    m_sprTimeHour[i].set_position(new Point(pt.x_ + 38 + i * 12, pt.y_ + 12));
                    m_sprTimeMinute[i].set_position(new Point(pt.x_ + 88 + i * 12, pt.y_ + 12));
                    m_sprTimeSecond[i].set_position(new Point(pt.x_ + 124 + i * 12, pt.y_ + 12));
                }
            }
            else
            {
                SetTimeHour(0);
                SetTimeMinute(0);
                SetTimeSecond(0);
            }

            //if(visible())
            //{
            //	char data[10];
            //	Point pt = position_absolute();

            //	std::ostringstream ostrRank;

            //	pt += Point(50,57);
            //	ostrRank + pGameScene->m_nMatchHour;
            //	m_Font->draw_string(pt, ostrRank.str().c_str(), Color(241,32,0));

            //	pt += Point(42,0);
            //	sprintf(data,"%02d",pGameScene->m_nMatchMinute);
            //	m_Font->draw_string(pt, data, Color(241,32,0));

            //	pt += Point(36,0);
            //	sprintf(data,"%02d",pGameScene->m_nMatchSecond);
            //	m_Font->draw_string(pt, data, Color(241,32,0));
            //}
        }
Exemplo n.º 5
0
        public void SetMaxFishGold(int nMaxFishGold)
        {
            m_nMaxFishGold = nMaxFishGold;

            CGameScene    pGameScene    = (CGameScene)parent();
            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;
            }
        }
Exemplo n.º 6
0
        //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);

        public override void draw()
        {
            if (!visible_)
            {
                return;
            }

            base.draw();

            CGameScene    pGameScene    = (CGameScene)parent();
            CClientKernel pClientKernel = pGameScene.GetClientKernel();

            if (pClientKernel == null)
            {
                return;
            }

            Point         pt     = new Point(position_absolute());
            Point         ptDraw = new Point();
            ostringstream ostr   = new ostringstream();

            //for (int i=0; i<4; i++)
            //{
            //    ostr.str("");
            //    ostr = ostr + m_CaptureFishs[i];

            //    ptDraw.x_ = pt.x_ + 136+i*180;
            //    ptDraw.y_ = pt.y_ +104;

            //    DrawNumber(ostr.str(), ptDraw);
            //}

            //for (int i=0; i<4; i++)
            //{
            //    ostr.str("");
            //    ostr = ostr + m_CaptureFishs[i+4];

            //    ptDraw.x_ = pt.x_ + 136+i*180;
            //    ptDraw.y_ = pt.y_ +104+74;

            //    DrawNumber(ostr.str(), ptDraw);
            //}

            //for (int i=0; i<4; i++)
            //{
            //    ostr.str("");
            //    ostr = ostr + m_CaptureFishs[i+8];

            //    ptDraw.x_ = pt.x_ + 136+i*180;
            //    ptDraw.y_ = pt.y_ +104+148;

            //    DrawNumber(ostr.str(), ptDraw);
            //}


            int wMeChairID = pGameScene.GetMeChairID();

            if (wMeChairID != GameDefine.INVALID_CHAIR)
            {
                int nFishGold = pGameScene.m_layRoles[wMeChairID].GetFishGold();
                ostr.str("");
                ostr      = ostr + nFishGold;
                ptDraw.x_ = pt.x_ + 296;
                ptDraw.y_ = pt.y_ + 310;
                DrawNumber(ostr.str(), ptDraw);

                int lCellScore = pGameScene.m_layBuyBulletLayer.GetCellScore();

                ostr.str("");
                ostr      = ostr + nFishGold * lCellScore;
                ptDraw.x_ = pt.x_ + 500;
                ptDraw.y_ = pt.y_ + 310;
                DrawNumber(ostr.str(), ptDraw);



                UserInfo pUserData = pClientKernel.GetMeUserInfo();

                if (pUserData != null)
                {
                    ostr.str("");
                    ostr      = ostr + 0;
                    ptDraw.x_ = pt.x_ + 240;
                    ptDraw.y_ = pt.y_ + 352;
                    DrawNumber(ostr.str(), ptDraw);

                    ostr.str("");
                    ostr      = ostr + pUserData.GetGameMoney();
                    ptDraw.x_ = pt.x_ + 580;
                    ptDraw.y_ = pt.y_ + 352;
                    DrawNumber(ostr.str(), ptDraw);
                }
            }

            long dwTime = FishDefine.time() - m_dwStartTime;

            if (dwTime >= 20)
            {
                ShowWidnow(false);
            }
            else
            {
                ostr.str("");
                ostr = ostr + (20 - dwTime).ToString();

                ptDraw.x_ = pt.x_ + 696;
                ptDraw.y_ = pt.y_ + 38;

                DrawTimer(ostr.str(), ptDraw);
            }
        }
Exemplo n.º 7
0
        public bool NetEnd(Node node, int tag)
        {
            Point  ptNet        = new Point();
            Point  ptTNet       = new Point();
            Point  ptFish       = new Point();
            Size   szFish       = new Size();
            Point  ptDifference = new Point();
            Rect   rcScreen     = new Rect(0, 0, 1280, 738);
            double sint;
            double cost;


            CGameScene       pGameScene       = (CGameScene)parent();
            CNetObjectExtend pNetObjectExtend = (CNetObjectExtend)node.node_extend();

            if (pNetObjectExtend.wChairID == pGameScene.GetMeChairID())
            {
                CMD_C_Cast_Net CastNet = new CMD_C_Cast_Net();
                CastNet.wChairID = pNetObjectExtend.wChairID;
                CastNet.cbCount  = 0;

                ptNet = node.position();

                foreach (Node j in pGameScene.m_layFishObject.childs())
                {
                    if (CastNet.cbCount >= FishDefine.MAX_FISH_IN_NET)
                    {
                        break;
                    }

                    CFishObjectExtend pFishObjectExtend = (CFishObjectExtend)j.node_extend();

                    if (pFishObjectExtend.wID == FishDefine.INVALID_WORD)
                    {
                        continue;
                    }

                    ptFish = j.position();
                    szFish = pFishObjectExtend.GetFishObjectSize();

                    cost      = Math.Cos(j.rotation());
                    sint      = Math.Sin(j.rotation());
                    ptTNet.x_ = (ptNet.x_ - ptFish.x_) * cost + (ptNet.y_ - ptFish.y_) * sint;
                    ptTNet.y_ = -(ptNet.x_ - ptFish.x_) * sint + (ptNet.y_ - ptFish.y_) * cost;

                    if (CFishObjectExtend.ComputeCollision(szFish.width_, szFish.height_, pNetObjectExtend.GetNetRadius(), ptTNet.x_, ptTNet.y_))
                    {
                        CastNet.FishNetObjects[CastNet.cbCount].wID      = pFishObjectExtend.wID;
                        CastNet.FishNetObjects[CastNet.cbCount].wRoundID = pFishObjectExtend.wRoundID;
                        CastNet.FishNetObjects[CastNet.cbCount].wType    = (int)pFishObjectExtend.FishType;
                        CastNet.FishNetObjects[CastNet.cbCount].dwTime   = pNetObjectExtend.dwMulRate; //时间没用上,占时存放倍数

                        CastNet.cbCount++;
                    }
                }

                CClientKernel pClientKernel = pGameScene.GetClientKernel();

                if ((pClientKernel != null) && (pNetObjectExtend.dwMulRate <= 1000))
                {
                    pClientKernel.SendSocketData(FishDefine.SUB_C_CAST_NET, CastNet);
                }
            }

            remove_child(node);

            return(true);
        }
Exemplo n.º 8
0
        //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);

        public override void draw()
        {
            base.draw();

            CGameScene    pGameScene    = (CGameScene)parent();
            CClientKernel pClientKernel = pGameScene.GetClientKernel();

            if (pClientKernel == null)
            {
                return;
            }

            UserInfo pUserData = pClientKernel.GetMeUserInfo();


            //for(WORD wChair=0;wChair<GAME_PLAYER;wChair++)
            //{
            //	if(pGameScene->m_layRoles[wChair]->m_sprMessage->visible())
            //	{
            //		Point pt = pGameScene->m_layRoles[wChair]->m_sprMessage->position() + pGameScene->m_layRoles[wChair]->position();
            //		std::ostringstream ostr;
            //		ostr = ostr + "new Point(" + pt.x_ + "," + pt.y_ +")" + pGameScene->m_layRoles[wChair]->m_cbShowData;

            //		m_Font->draw_string(pt, ostr.str().c_str(), Color(176,222,238));

            //	}

            //}

            if (pUserData != null)
            {
                int wChair = ((CGameScene)parent()).GetClientKernel().GetMeChairID();

                Point pt = position_absolute();
                pt.x_ += 56;
                pt.y_ += 14;

                //   m_Font->draw_string(pt, pUserData->szNickName, Color(14,236,212));
                //m_Font->draw_string(pt, g_WideCharToMultiByte(pUserData->szNickName), Color(14,236,212));
                m_Font.draw_string(pt, pUserData.Nickname, new Color(14, 236, 212));

                //std::string szRank;
                //if (pUserData->lScore>0 && pUserData->lScore<1000)
                //{
                //    szRank = "渔夫";
                //}
                //else
                //{
                //    szRank = "船长";
                //}

                ostringstream ostrRank = new ostringstream();
                ostrRank = ostrRank + pGameScene.m_layRoles[wChair].GetExpValue();

                pt.x_ += 160;
                m_Font.draw_string(pt, ostrRank.str(), new Color(14, 236, 212));

                pt.x_ -= 160;
                pt.y_ += 28;

                int nFishGold = pGameScene.m_layRoles[pGameScene.GetMeChairID()].GetFishGold();

                ostringstream ostr = new ostringstream();
                ostr = ostr + pUserData.GetGameMoney() + "(+" + nFishGold + ")";

                m_Font.draw_string(pt, ostr.str(), new Color(14, 236, 212));

                pt.x_ += 30;
                pt.y_ += 27;

                ostringstream ostr1 = new ostringstream();
                ostr1 = ostr1 + pGameScene.m_layRoles[wChair].GetMaxMulRate();
                m_Font.draw_string(pt, ostr1.str(), new Color(14, 236, 212));

                pt.x_ += 16;
                pt.y_ += 26;

                int           nExpToLevel = FishDefine.EXP_CHANGE_TO_LEVEL;
                ostringstream ostr2       = new ostringstream();
                ostr2 = ostr2 + pGameScene.m_layRoles[wChair].GetFireCount() % FishDefine.EXP_CHANGE_TO_LEVEL + " / " + nExpToLevel;
                m_Font.draw_string(pt, ostr2.str(), new Color(14, 236, 212));
            }
        }