示例#1
0
        public override void Process()
        {
            int nCount = 0;

            X_GUID pGUID = new X_GUID();

            foreach (Troop item in troops)// ╠Ю╤спео╒ [3/31/2015 Zmy]
            {
                if (nCount >= 0 && nCount < GlobalMembers.MAX_MATRIX_COUNT)
                {
                    ObjectSelf.GetInstance().Teams.SetNumTypeDic(item.troopnum, item.trooptype);
                    pGUID.GUID_value = item.location1;
                    ObjectSelf.GetInstance().Teams.SetTeamMember(item.troopnum, pGUID, 0);
                    pGUID.GUID_value = item.location2;
                    ObjectSelf.GetInstance().Teams.SetTeamMember(item.troopnum, pGUID, 1);
                    pGUID.GUID_value = item.location3;
                    ObjectSelf.GetInstance().Teams.SetTeamMember(item.troopnum, pGUID, 2);
                    pGUID.GUID_value = item.location4;
                    ObjectSelf.GetInstance().Teams.SetTeamMember(item.troopnum, pGUID, 3);
                    pGUID.GUID_value = item.location5;
                    ObjectSelf.GetInstance().Teams.SetTeamMember(item.troopnum, pGUID, 4);

                    ObjectSelf.GetInstance().Teams.m_GodSoulID1 = item.sh1;
                    ObjectSelf.GetInstance().Teams.m_GodSoulID2 = item.sh2;
                    ObjectSelf.GetInstance().Teams.m_GodSoulID3 = item.sh3;
                    ObjectSelf.GetInstance().Teams.m_GodSoulID4 = item.sh4;
                    nCount++;
                }
            }
            pGUID = null;
            GameEventDispatcher.Inst.dispatchEvent(GameEventID.G_Formation_Update);
        }
示例#2
0
 //刷新英雄卡牌
 public void UpdateHeroCardData(ObjectCard heroObject)
 {
     HeroObject       = heroObject;
     _Herodata        = heroObject.GetHeroRow();
     HeroType         = _Herodata.getClientSignType()[0];
     _Artresourcedata = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(heroObject.GetHeroData().GetHeroViewID());
     SetBaseInfo(heroObject.GetHeroData().Level);
     InterfaceControler.GetInst().ShowHeroImg(_Herodata, AttackType_Img, JobType_Img, RaceType_Img);
     SetFormationNum();
     YetUpFrontImg.SetActive(false);
     DownFeontImg.SetActive(false);
     for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
     {
         int nGroup = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
         if (nGroup < 0 && nGroup >= GlobalMembers.MAX_MATRIX_COUNT)
         {
             continue;
         }
         X_GUID pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i];
         if (pMemberGuiD.GUID_value == HeroObject.GetGuid().GUID_value)
         {
             YetUpFrontImg.SetActive(true);
         }
     }
 }
示例#3
0
    // 移除一个选择的符文
    public void RemoveSelectRune(int index, int tableID, int smelt, int money, X_GUID guid)
    {
        for (int i = 0; i < _selectRuneList.Count; ++i)
        {
            SelectRune item = _selectRuneList[i];
            if (item.index == index)
            {
                _selectRuneList.Remove(item);
                DestroyImmediate(item.gameObject);
                break;
            }
        }

        UpdateSelectItem();
        _gainExp  -= smelt;
        _gainGold -= money;
        UpdateShow(_selectRuneList.Count);

        for (int i = 0; i < _curRuneList.Count; ++i)
        {
            if (_curRuneList[i].item.GetItemGuid() == guid)
            {
                _curRuneList[i].isSelect = false;
                break;
            }
        }

        // 更新灰图显示
        if (_selectRuneList.Count == 12)
        {
            isAdd = false;
        }

        _runeListLayout.UpdateCell();
    }
示例#4
0
        public override void Process()
        {
            if ((int)bagid == (int)EM_BAG_HASHTABLE_TYPE.EM_BAG_HASHTABLE_TYPE_COMMON || (int)bagid == (int)EM_BAG_HASHTABLE_TYPE.EM_BAG_HASHTABLE_TYPE_EQUIP)// 道具 [4/14/2015 Zmy]
            {
                int delta = 0;
                delta = ObjectSelf.GetInstance().CommonItemContainer.RepairItemCount(bagid, itemkey, curnum);

                if (delta > 0)
                {
                    LinkedList <Item> itemdata = new LinkedList <Item>();
                    X_GUID            guid     = new X_GUID();
                    guid.GUID_value = itemkey;
                    BaseItem bi = ObjectSelf.GetInstance().CommonItemContainer.FindItem(bagid, guid);
                    if (bi != null)
                    {
                        Item item = new Item();
                        item.id     = bi.GetItemRowData().getId();
                        item.key    = itemkey;
                        item.number = (short)delta;
                        itemdata.AddLast(item);
                        //GameEventDispatcher.Inst.dispatchEvent(GameEventID.KE_ShowGift, itemdata);
                    }
                }
            }
            int id = (int)bagid;

            GameEventDispatcher.Inst.dispatchEvent(GameEventID.KE_ModItemNum, id);
        }
示例#5
0
    public LimitFightManager()
    {
        m_bActivate   = true;
        m_bStartEnter = false;
        m_bRuntime    = false;
        for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
        {
            if (m_HeroInfo[i] == null)
            {
                m_HeroInfo[i] = new X_GUID();
            }
            m_HeroInfo[i].CleanUp();
            m_HeroHp[i] = -1;//初始值。代表英雄今日没有进入过试炼。进入之后血量为最大值 [6/19/2015 Zmy]
        }
        m_Pact           = -1;
        m_IsHalfCostPact = 0;
        m_TodayRanking   = -1;

        m_DropNum    = 0;
        m_AllDropNum = 0;
        m_AttrAdd1   = 0;
        m_AttrAdd2   = 0;
        m_AttrAdd3   = 0;
        m_AttrAdd4   = 0;
    }
示例#6
0
        //实例化Hero对象
        private void CallBack_InitHeroObject()
        {
            for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
            {
                int nGroup = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
                if (nGroup < 0 && nGroup >= GlobalMembers.MAX_MATRIX_COUNT)
                {
                    continue;
                }
                X_GUID pMemberGuiD = null;

                if (ObjectSelf.GetInstance().LimitFightMgr.m_bStartEnter)
                {
                    pMemberGuiD = ObjectSelf.GetInstance().LimitFightMgr.m_HeroInfo[i];
                    if (ObjectSelf.GetInstance().LimitFightMgr.m_HeroHp[i] == 0)
                    {
                        //初始英雄时,如果血量记录是0 代表本次是继续开启的试炼。并且上次的英雄已死亡。那么本次不再实例化英雄 [6/19/2015 Zmy]
                        pMemberGuiD.CleanUp();
                    }
                }
                else
                {
                    pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i]; //暂时默认上场第一组阵型的英雄[3/25/2015 Zmy]
                }
                if (!pMemberGuiD.IsValid())
                {
                    continue;
                }
                ObjectCard pHero = ObjectSelf.GetInstance().HeroContainerBag.FindHero(pMemberGuiD);
                if (pHero == null)
                {
                    continue;
                }
                ArtresourceTemplate _Artresourcedata = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(pHero.GetHeroData().GetHeroViewID());
                if (_Artresourcedata == null)
                {
                    continue;
                }

                GameObject pHeroObject = AssetLoader.Inst.GetAssetRes(_Artresourcedata.getArtresources());
                if (pHeroObject != null)
                {
                    GameObject obj1 = Instantiate(pHeroObject, FightEditorContrler.GetInstantiate().GetFormationCenterPos(i), FightEditorContrler.GetInstantiate().GetFormationCenterAngle(i)) as GameObject;
                    GameUtils.SetLayerRecursively(obj1, FightEditorContrler.GetInstantiate().GetShadowCullMaskLayer());
                    float _zoom = _Artresourcedata.getArtresources_zoom();
                    obj1.transform.localScale = new UnityEngine.Vector3(_zoom, _zoom, _zoom);
                    SceneObjectManager.GetInstance().SceneObjectAddHero(obj1, pHero.GetHeroRow().getId(), pHero);
                    FightEditorContrler.GetInstantiate().InitFormationPos(pHero, i);
                }
            }
            FightEditorContrler.GetInstantiate().HeroPathInitSpeed();

            GameEventDispatcher.Inst.dispatchEvent(GameEventID.SE_StoryCameraEnd);

            //初始化完成后,切换状态 [1/20/2015 Zmy]
            SetFightState(FightState.prepareData);

            //初始入场怒气
            InitFightPower();
        }
示例#7
0
        public void InitData(ObjectCard hero)
        {
            objhero  = hero;
            HeroData = objhero.GetHeroRow();

            DataParent.SetActive(true);
            m_NullStateOBJ.SetActive(false);

            HeroName.text = string.Format(GameUtils.GetHeroNameFontColor(hero.GetHeroData().QualityLev), GameUtils.getString(HeroData.getTitleID()));
            InterfaceControler.AddLevelNum(hero.GetHeroData().Level.ToString(), HeroLevel);
            int       star       = hero.GetHeroData().StarLevel;
            Transform BrightStar = DataParent.transform.FindChild("HeroStar/BrightStar");

            for (int i = 0; i < BrightStar.childCount; ++i)
            {
                BrightStar.transform.GetChild(i).GetComponent <Image>().enabled = (i < star);
            }
            //InterfaceControler.GetInst().AddSharLevel(DataParent.transform.FindChild("Star_Image"),HeroData);

            //如果是远程英雄
            if (ClickType == 1)
            {
                int    group = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
                X_GUID guid  = ObjectSelf.GetInstance().Teams.m_Matrix[group, FormationNum - 1];
                UI_FormMgr.Inst.SetBackHeroGuids(guid.GUID_value);
            }
        }
示例#8
0
 public EventRequestSkillPackage(X_GUID uid, int skillid, bool isSelf, bool isMy = true)
 {
     mOwner.Copy(uid);
     mSkillID  = skillid;
     isForSelf = isSelf;
     isMyEff   = isMy;
 }
示例#9
0
    public void RefreshItem(int bagType, Item _item)
    {
        X_GUID _tempData = new X_GUID();

        _tempData.GUID_value = _item.key;
        BaseItem pData = FindItem(bagType, _tempData);

        if (pData != null)
        {
            pData.SetItemTableID(_item.id);
            pData.SetItemCount(_item.number);
            /*pData.SetItemTimesCount(_item.timer);*/
            RefreshItemTimesCount(bagType, _item.id, _item.timer);
            if (pData.GetItemType() == (int)EM_ITEM_TYPE.EM_ITEM_TYPE_RUNE)
            {
                ItemEquip     equip    = pData as ItemEquip;
                EquipItemData Itemdata = new EquipItemData();
                Itemdata.unmarshal(OctetsStream.wrap(_item.extdata));
                equip.InitRuneData(Itemdata);
            }
        }
        else
        {
            AddItem(bagType, _item);
            m_NewGetItems.Add(_tempData);
        }
        _tempData = null;
    }
示例#10
0
        public bool CalcPassivitySpellTarget(ref FIGHTOBJECT_LIST targetlist)
        {
            SkillTemplate pRow = m_pSpellInfo.GetSpellRow();

            switch (m_pSpellInfo.GetTargetType())
            {
            case (int)EM_TARGET_TYPE.EM_TARGET_FRIEND:
            {
                int nID = -1;
                if (ObjectSelf.GetInstance().Teams.IsHeroInTeam(m_pHolder.GetGuid(), ref nID))
                {
                    for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
                    {
                        X_GUID     _guid = ObjectSelf.GetInstance().Teams.m_Matrix[nID, i];
                        ObjectCard obj   = ObjectSelf.GetInstance().HeroContainerBag.FindHero(_guid);
                        if (obj != null)
                        {
                            targetlist.Add((ObjectCreature)obj);
                        }
                    }
                }
            }
            break;

            case (int)EM_TARGET_TYPE.EM_TARGET_SELF:
            {
                targetlist.Add((ObjectCreature)m_pHolder);
            }
            break;

            default:
                break;
            }
            return(true);
        }
示例#11
0
    public void RefreshHero(Hero _hero)
    {
        X_GUID _guid = new X_GUID();

        _guid.GUID_value = _hero.key;
        ObjectCard obj = FindHero(_guid);

        if (obj != null)
        {
            obj.GetHeroData().Init(_hero, true);
            obj.UpdateAttributeValue();
        }
        else
        {
            ObjectCard pHero = new ObjectCard();
            pHero.GetHeroData().Init(_hero);
            pHero.UpdateItemEffectValue();
            pHero.UpdateTeamEffectValue();
            pHero.UpdateTrainEffectValue();

            AddIHero(pHero);

            newHeroList.Add(_guid);

            AssetLoader.Inst.DynamicLoadHeroCardRes(_hero.heroid);
        }
        GameEventDispatcher.Inst.dispatchEvent(GameEventID.Net_RefreshHero, _hero.key);
    }
示例#12
0
    public void SetShowData(X_GUID runeId)
    {
        mRuneTableId = -1;
        mRuneGUID    = runeId;
        data         = null;

        UpdateData(RuneAttriShowType.All);
    }
示例#13
0
        public bool Init(SpellInfo pSpellInfo, ref X_GUID guidTarget)
        {
            LogManager.LogAssert(m_pHolder);
            LogManager.LogAssert(pSpellInfo);

            m_pSpellInfo = pSpellInfo;
            m_SpellTarget.Copy(guidTarget);
            return(true);
        }
    private void SendMsg(X_GUID guid, int count)
    {
        CUseItem msg = new CUseItem();

        msg.bagid   = (int)EM_BAG_HASHTABLE_TYPE.EM_BAG_HASHTABLE_TYPE_COMMON;
        msg.itemkey = (int)guid.GUID_value;
        msg.num     = (short)count;
        IOControler.GetInstance().SendProtocol(msg);
    }
示例#15
0
        public void onSingleBuffAdd(X_GUID uid, BuffTemplate info)
        {
            UI_Blood mBlood = FindUIFBlood(uid);

            if (mBlood == null)
            {
                return;
            }
            mBlood.onSingleBuffAdd(info);
        }
示例#16
0
        //更新血条数值
        public void UpdateBloodValue(X_GUID uid, float fValue)
        {
            UI_Blood mBlood = FindUIFBlood(uid);

            if (mBlood == null)
            {
                return;
            }
            mBlood.SetValue(fValue);
        }
示例#17
0
        private void onSkillReleaseEnd(GameEvent e)
        {
            X_GUID       heroid = (X_GUID)e.data;
            UI_SkillIcon icon   = mIcons[heroid];

            if (icon)
            {
                icon.onResetCD();
            }
        }
示例#18
0
 /// <summary>
 /// 设置某个物品为已读状态
 /// </summary>
 /// <param name="guid"></param>
 public void SetItemPreview(X_GUID guid)
 {
     for (int i = 0; i < m_NewGetItems.Count; i++)
     {
         if (m_NewGetItems[i].Equals(guid))
         {
             m_NewGetItems.RemoveAt(i);
         }
     }
 }
示例#19
0
 /// <summary>
 /// 检查技能是否已经锁定,已经锁定的技能释放锁定
 /// </summary>
 public bool isWaitLock(X_GUID uid)
 {
     if (mMenuPanel.onCheckSkillWaitLock(uid))
     {
         mTouchControl.ChangeTouchState(TouchState.FireSign_state);
         mBloodControl.hideFlag();
         return(true);
     }
     return(false);
 }
示例#20
0
 // 验证技能是否等待锁定目标
 public bool onCheckSkillWaitLock(X_GUID uid)
 {
     if (mSkillTargetStruct.mSelctRoleUID.Equals(uid))
     {
         // 解除
         mSkillTargetStruct.clear();
         return(true);
     }
     return(false);
 }
示例#21
0
 public override void Process()
 {
     // ÒƳýÓ¢ÐÛ
     foreach (var item in herokeylist)
     {
         X_GUID id = new X_GUID();
         id.GUID_value = (long)(item);
         ObjectSelf.GetInstance().HeroContainerBag.EreaseHero(id);
     }
 }
示例#22
0
    // 一个英雄是否是上阵
    bool isUpFront(ObjectCard card)
    {
        X_GUID guid  = card.GetHeroData().GUID;
        int    index = 0;

        if (ObjectSelf.GetInstance().Teams.IsHeroInTeam(guid, ref index))
        {
            return(true);
        }
        return(false);
    }
示例#23
0
        // 怪物死亡
        private void onMonsterDieCall(GameEvent e)
        {
            X_GUID   uid = (X_GUID)e.data;
            UI_Blood fb  = FindUIFBlood(uid);

            if (fb)
            {
                bloodInfo.Remove(fb);
                GameObject.Destroy(fb.gameObject);
            }
        }
示例#24
0
 public ObjectCard FindHero(X_GUID guid)
 {
     foreach (ObjectCard var in m_HeroList)
     {
         if (var.GetGuid().GUID_value == guid.GUID_value)
         {
             return(var);
         }
     }
     return(null);
 }
示例#25
0
 //更新符文装备状态 [5/21/2015 Zmy]
 public void OnUpdateRuneEquipState(X_GUID _equipped, bool _state)
 {
     if (_equipped.IsValid())
     {
         ItemEquip _item = (ItemEquip)FindItem((int)EM_BAG_HASHTABLE_TYPE.EM_BAG_HASHTABLE_TYPE_EQUIP, _equipped);
         if (_item != null)
         {
             _item.SetEquipState(_state);
         }
     }
 }
示例#26
0
 //英雄死亡后技能不可以使用
 public bool OnHeroDead(X_GUID uid)
 {
     if (mHero.GetGuid().Equals(uid))
     {
         isHeroDead        = true;
         cdIcon.fillAmount = 1;
         SetHeroShowState(SkillState.HeoDie);
         return(true);
     }
     return(false);
 }
示例#27
0
 /// <summary>
 /// 获取英雄在队伍中的index
 /// </summary>
 /// <param name="guid"></param>
 /// <returns></returns>
 public int GetTeamIndexByHeroGuid(X_GUID guid)
 {
     for (int j = 0; j < GlobalMembers.MAX_TEAM_CELL_COUNT; ++j)
     {
         if (m_Matrix[(int)m_DefaultGroup, j].Equals(guid))
         {
             return(j);
         }
     }
     return(-1);
 }
示例#28
0
 public RelationMemberData FindRelationMember(X_GUID guid)
 {
     foreach (RelationMemberData var in m_RelationMember)
     {
         if (var.MemberGUID.GUID_value == guid.GUID_value)
         {
             return(var);
         }
     }
     return(null);
 }
示例#29
0
 public void EreaseRelationMember(X_GUID guid)
 {
     foreach (RelationMemberData var in m_RelationMember)
     {
         if (var.MemberGUID.GUID_value == guid.GUID_value)
         {
             m_RelationMember.Remove(var);
             break;
         }
     }
 }
示例#30
0
 public void EreaseApplyMember(X_GUID guid)
 {
     foreach (ApplyMemberData var in m_ApplyMember)
     {
         if (var.MemberData.MemberGUID.GUID_value == guid.GUID_value)
         {
             m_ApplyMember.Remove(var);
             break;
         }
     }
 }