Ejemplo n.º 1
0
        public SceneCardBase createCardById(uint objid, EnDZPlayer m_playerSide, CardArea area, CardType cardType, SceneDZData sceneDZData)
        {
            SceneCardBase ret = null;

            if (SceneDZCV.WHITE_CARDID == objid)       // 白色占位卡牌
            {
                ret = new WhiteCard(sceneDZData);
            }
            else if (SceneDZCV.BLACK_CARD_ID == objid)       // 背面牌
            {
                ret = new BlackCard(sceneDZData);
            }
            else if (CardType.CARDTYPE_ATTEND == cardType)
            {
                if (EnDZPlayer.ePlayerSelf == m_playerSide)
                {
                    ret = new SelfAttendCard(sceneDZData);
                }
                else
                {
                    ret = new EnemyAttendCard(sceneDZData);
                }
            }
            else if (CardType.CARDTYPE_SECRET == cardType)
            {
                ret = new SecretCard(sceneDZData);
            }
            else if (CardType.CARDTYPE_MAGIC == cardType)
            {
                if (EnDZPlayer.ePlayerSelf == m_playerSide)
                {
                    ret = new SelfMagicCard(sceneDZData);
                }
                else
                {
                    ret = new EnemyMagicCard(sceneDZData);
                }
            }
            else if (CardType.CARDTYPE_EQUIP == cardType)
            {
                if (EnDZPlayer.ePlayerSelf == m_playerSide)
                {
                    ret = new SelfEquipCard(sceneDZData);
                }
                else
                {
                    ret = new EnemyEquipCard(sceneDZData);
                }
            }
            else if (CardType.CARDTYPE_HERO == cardType)
            {
                if (EnDZPlayer.ePlayerSelf == m_playerSide)
                {
                    ret = new SelfHeroCard(sceneDZData);
                }
                else
                {
                    ret = new EnemyHeroCard(sceneDZData);
                }
            }
            else if (CardType.CARDTYPE_SKILL == cardType)
            {
                if (EnDZPlayer.ePlayerSelf == m_playerSide)
                {
                    ret = new SelfSkillCard(sceneDZData);
                }
                else
                {
                    ret = new EnemySkillCard(sceneDZData);
                }
            }
            //else if (CardType.CARDTYPE_LUCK_COINS == cardType)
            //{
            //    return new LuckCoinCard(sceneDZData);
            //}

            ret.setIdAndPnt(objid, sceneDZData.m_placeHolderGo.m_centerGO);
            ret.init();
            ret.setBaseInfo(m_playerSide, area, cardType);

            this.addObject(ret);
            if (SceneDZCV.WHITE_CARDID != objid &&
                SceneDZCV.BLACK_CARD_ID != objid)       // 这两个没有 AI 
            {
                Ctx.m_instance.m_aiSystem.aiControllerMgr.addController(ret.aiController);       // 添加到控制器中
            }

            return ret;
        }
Ejemplo n.º 2
0
        public SceneCardBase createCardById(uint objid, EnDZPlayer m_playerSide, CardArea area, CardType cardType, SceneDZData sceneDZData)
        {
            SceneCardBase ret = null;

            if (SceneDZCV.WHITE_CARDID == objid)       // 白色占位卡牌
            {
                ret = new WhiteCard(sceneDZData);
            }
            else if (SceneDZCV.BLACK_CARD_ID == objid)       // 背面牌
            {
                ret = new BlackCard(sceneDZData);
            }
            else if (CardType.CARDTYPE_ATTEND == cardType)
            {
                if (EnDZPlayer.ePlayerSelf == m_playerSide)
                {
                    ret = new SelfAttendCard(sceneDZData);
                }
                else
                {
                    ret = new EnemyAttendCard(sceneDZData);
                }
            }
            else if (CardType.CARDTYPE_SECRET == cardType)
            {
                ret = new SecretCard(sceneDZData);
            }
            else if (CardType.CARDTYPE_MAGIC == cardType)
            {
                if (EnDZPlayer.ePlayerSelf == m_playerSide)
                {
                    ret = new SelfMagicCard(sceneDZData);
                }
                else
                {
                    ret = new EnemyMagicCard(sceneDZData);
                }
            }
            else if (CardType.CARDTYPE_EQUIP == cardType)
            {
                if (EnDZPlayer.ePlayerSelf == m_playerSide)
                {
                    ret = new SelfEquipCard(sceneDZData);
                }
                else
                {
                    ret = new EnemyEquipCard(sceneDZData);
                }
            }
            else if (CardType.CARDTYPE_HERO == cardType)
            {
                if (EnDZPlayer.ePlayerSelf == m_playerSide)
                {
                    ret = new SelfHeroCard(sceneDZData);
                }
                else
                {
                    ret = new EnemyHeroCard(sceneDZData);
                }
            }
            else if (CardType.CARDTYPE_SKILL == cardType)
            {
                if (EnDZPlayer.ePlayerSelf == m_playerSide)
                {
                    ret = new SelfSkillCard(sceneDZData);
                }
                else
                {
                    ret = new EnemySkillCard(sceneDZData);
                }
            }
            //else if (CardType.CARDTYPE_LUCK_COINS == cardType)
            //{
            //    return new LuckCoinCard(sceneDZData);
            //}

            ret.setIdAndPnt(objid, sceneDZData.m_placeHolderGo.m_centerGO);
            ret.init();
            ret.setBaseInfo(m_playerSide, area, cardType);

            this.addObject(ret);
            if (SceneDZCV.WHITE_CARDID != objid &&
                SceneDZCV.BLACK_CARD_ID != objid)                                          // 这两个没有 AI
            {
                Ctx.m_instance.m_aiSystem.aiControllerMgr.addController(ret.aiController); // 添加到控制器中
            }

            return(ret);
        }