Beispiel #1
0
    public static void SetGoodsName(this GTextField textField, EGoodsType type, int id)
    {
        switch (type)
        {
        case EGoodsType.DaoJu:
        {
            var deploy = GoodsDeploy.GetInfo(id);
            textField.text = deploy.Name;
            break;
        }

        case EGoodsType.XinFa:
        {
            var deploy = XinFaDeploy.GetInfo(id);
            textField.text = deploy.Name;
            break;
        }

        case EGoodsType.CanBen:
        {
            var deploy = CanBenDeploy.GetInfo(id);
            textField.text = deploy.Name;
            break;
        }

        default:
            textField.text = "";
            break;
        }
    }
Beispiel #2
0
    private void OnSkillSelected(EventContext context)
    {
        var itemData = m_UI.m_ListSkill.GetSelectedData <ItemData>();
        var deploy   = CanBenDeploy.GetInfo(itemData.Id);

        m_View.Data.SkillId = itemData.Id;
        m_View.RefreshSelectBook();

        var icon = m_UI.m_BtnSelectSkill as UI_GoodsSmallIcon;

        icon.m_State.selectedIndex = 1;

        m_UI.m_BtnSelectSkill.icon = UIPackage.GetItemURL("Common", deploy.Icon);
    }
Beispiel #3
0
    public override void OnRefresh()
    {
        var pupilData = PupilProxy.instance.getPupilInfo(m_PupilId);
        var deploy    = pupilData.GetDeploy();

        m_UI.m_LabelName.SetText(deploy.Name);
        m_UI.m_LabelLevel.SetValue(pupilData.Level);
        m_UI.m_LabelCombat.SetValue(pupilData.GetCombat());
        m_UI.m_StarLevel.AsStarLevelBig().SetLevel(deploy.StarLevel);
        m_UI.m_IconBody.icon     = UIUtil.GetPupilBodyUrl(deploy.Sex);
        m_UI.m_Sex.selectedIndex = (int)deploy.Sex;

        if (m_UI.m_ViewState.selectedIndex == 0)
        {
            m_UI.m_ViewState.selectedIndex = 1;
        }

        m_UI.m_ProgressExp.max   = pupilData.MaxExp;
        m_UI.m_ProgressExp.value = pupilData.CurExp;

        var equipingItem = pupilData.GetEquipingWuXue();

        if (equipingItem != null)
        {
            m_UI.m_JueXueState.selectedIndex = 1;
            (m_UI.m_IconWuXue as UI_GoodsSmallIcon).m_State.selectedIndex = 1;
            m_UI.m_IconWuXue.icon = UIUtil.GetGoodsUrl(equipingItem.Type, equipingItem.Id);
            m_UI.m_LabelWuXueName.SetText(equipingItem.Name);
            m_UI.m_LabelWuXueCombat.SetValue("9999");

            var uniqueSkillData = UniqueSkillProxy.instance.GetData(equipingItem.Id);
            var xinfaDeploy     = XinFaDeploy.GetInfo(uniqueSkillData.SkillId1);
            var canbenDeploy    = CanBenDeploy.GetInfo(uniqueSkillData.SkillId2);

            string str  = (xinfaDeploy.Type == ESkillType.NeiGong) ? "内功" : "外功";
            string str1 = (canbenDeploy.Type == ESkillType.JianFa) ? "剑法" : "刀法";
            m_UI.m_LabelWuXueType.SetValue(str + str1);

            var skillEffectDeploy = SkillEffectDeploy.GetInfo(uniqueSkillData.Id);
            m_UI.m_LabelWuXueDesc.SetValue(skillEffectDeploy.Desc);
        }
        else
        {
            m_UI.m_JueXueState.selectedIndex = 0;
        }
    }
Beispiel #4
0
    public override void Execute(INotification notification)
    {
        var itemDatas = notification.Body as List <ItemData>;

        if (itemDatas.Count <= 0)
        {
            Facade.SendNotification(OptResultDefine.NotifyNotSelectCost, null, OptResultDefine.SelectCostTypeGoods);
            return;
        }

        var skillCreateProxy = Facade.RetrieveProxy(SkillCreateProxy.Name) as SkillCreateProxy;
        var createData       = skillCreateProxy.GetData();
        var xinfaDeploy      = XinFaDeploy.GetInfo(createData.SkillType);
        var canBenDeploy     = CanBenDeploy.GetInfo(createData.SkillId);

        // 消耗道具
        var totalAddAttr = 0;

        foreach (var itemData in itemDatas)
        {
            var goodsDeploy = GoodsDeploy.GetInfo(itemData.Id);
            totalAddAttr += goodsDeploy.GetAddAttr(xinfaDeploy.Type);
            totalAddAttr += goodsDeploy.GetAddAttr(canBenDeploy.Type);
            GoodsProxy.instance.RemoveItem(itemData.Id, itemData.Type, 1);
        }

        // 触发概率
        bool isSuccess = true;

        if (isSuccess)
        {
            skillCreateProxy.BasePowerUp(totalAddAttr);
            Facade.SendNotification(OptResultDefine.NotifyCreateSkillPowerUpSuccess);
        }
        else
        {
            Facade.SendNotification(OptResultDefine.NotifyCreateSkillPowerUpFail);
        }

        // 提升威力奇遇
        skillCreateProxy.selectPowerUpEvent();

        // 数据更新
        AppFacade.getInstance().DataUpdated();
    }
Beispiel #5
0
    private void SkillItemRenderer(int index, GObject obj)
    {
        var item     = obj as UI_SelectTypeItem;
        var itemData = m_UI.m_ListSkill.GetData <ItemData>(index);
        var deploy   = CanBenDeploy.GetInfo(itemData.Id);

        item.m_LabelName.text = deploy.Name;
        item.m_LabelCount.SetValue(itemData.Count);

        item.m_CondType.selectedIndex = (int)deploy.CondAttrType;
        item.m_LabelCond.SetValue(deploy.CondAttrValue);

        item.m_Type.selectedIndex = 1;
        item.m_LabelTypeValue.SetDiff(deploy.Difficulty);

        var icon = item.m_Icon as UI_GoodsSmallIcon;

        icon.m_State.selectedIndex = 1;

        item.m_Icon.icon = UIPackage.GetItemURL("Common", deploy.Icon);
    }
Beispiel #6
0
    public override void OnEnter()
    {
        var ids = PupilProxy.instance.GetPupilIds();

        var xinfaDeploy  = XinFaDeploy.GetInfo(m_View.Data.SkillType);
        var canBenDeploy = CanBenDeploy.GetInfo(m_View.Data.SkillId);
        var createDeploy = UniqueSkillCreateDeploy.GetInfo(m_View.Data.SkillType, m_View.Data.SkillId);

        m_UI.m_ListPupil.SetData(ids);

        m_UI.m_IconXinFaCond.icon = UIUtil.GetPupilAttUrl(xinfaDeploy.CondAttrType);
        m_UI.m_LabelXinFaCond.SetText(xinfaDeploy.CondAttrValue);

        m_UI.m_IconCanBenCond.icon = UIUtil.GetPupilAttUrl(canBenDeploy.CondAttrType);
        m_UI.m_LabelCanBenCond.SetText(canBenDeploy.CondAttrValue);

        m_UI.m_LabelCreateDiff.SetDiff(canBenDeploy.Difficulty);
        m_UI.m_LabelCreateFitness.SetFitness(createDeploy.Value.FitValue);

        m_UI.m_PupilSelected.selectedIndex = 0;
    }
Beispiel #7
0
    private void OnRefreshCreatingBookInfo(EventContext context)
    {
        var xinfaDeploy  = XinFaDeploy.GetInfo(Data.SkillType);
        var canBenDeploy = CanBenDeploy.GetInfo(Data.SkillId);
        var createDeploy = UniqueSkillCreateDeploy.GetInfo(Data.SkillType, Data.SkillId);

        m_UI.m_CreatingBookInfo.m_IconXinFaCond.icon  = UIUtil.GetPupilAttUrl(xinfaDeploy.CondAttrType);
        m_UI.m_CreatingBookInfo.m_IconCanBenCond.icon = UIUtil.GetPupilAttUrl(canBenDeploy.CondAttrType);
        m_UI.m_CreatingBookInfo.m_LabelXinFaCond.SetText(xinfaDeploy.CondAttrValue);
        m_UI.m_CreatingBookInfo.m_LabelCanBenCond.SetText(canBenDeploy.CondAttrValue);
        m_UI.m_CreatingBookInfo.m_IconDiff.icon = UIUtil.GetDiffUrl(canBenDeploy.Difficulty);

        if (Data.PlaceId > 0)
        {
            var placeDeploy = PlaceDeploy.GetInfo(Data.PlaceId);

            var fitness = placeDeploy.AddAtt.AddShenFa;
            if (xinfaDeploy.Type == ESkillType.NeiGong)
            {
                fitness += placeDeploy.AddAtt.AddNeiGong;
            }
            else if (xinfaDeploy.Type == ESkillType.WaiGong)
            {
                fitness += placeDeploy.AddAtt.AddWaiGong;
            }
            if (canBenDeploy.Type == ESkillType.DaoFa)
            {
                fitness += placeDeploy.AddAtt.AddDaoFa;
            }
            else if (canBenDeploy.Type == ESkillType.JianFa)
            {
                fitness += placeDeploy.AddAtt.AddJianFa;
            }
            m_UI.m_CreatingBookInfo.m_IconFitness.icon = UIUtil.GetFitnessUrl(createDeploy.Value.FitValue + fitness);
        }
        else
        {
            m_UI.m_CreatingBookInfo.m_IconFitness.icon = UIUtil.GetFitnessUrl(createDeploy.Value.FitValue);
        }
    }
Beispiel #8
0
    private void OnPlaceSelected(EventContext context)
    {
        var placeId = m_UI.m_ListPlace.GetSelectedData <int>();

        m_View.Data.PlaceId = placeId;
        var placeDeploy = PlaceDeploy.GetInfo(placeId);

        var fitness = placeDeploy.AddAtt.AddShenFa;

        var xinfaDeploy = XinFaDeploy.GetInfo(m_View.Data.SkillType);

        if (xinfaDeploy.Type == ESkillType.NeiGong)
        {
            fitness += placeDeploy.AddAtt.AddNeiGong;
        }
        else if (xinfaDeploy.Type == ESkillType.WaiGong)
        {
            fitness += placeDeploy.AddAtt.AddWaiGong;
        }

        var canbenDeploy = CanBenDeploy.GetInfo(m_View.Data.SkillId);

        if (canbenDeploy.Type == ESkillType.DaoFa)
        {
            fitness += placeDeploy.AddAtt.AddDaoFa;
        }
        else if (canbenDeploy.Type == ESkillType.JianFa)
        {
            fitness += placeDeploy.AddAtt.AddJianFa;
        }

        var createDeploy = UniqueSkillCreateDeploy.GetInfo(m_View.Data.SkillType, m_View.Data.SkillId);

        var oriFit = Define.ValueToFit(createDeploy.Value.FitValue);
        var curFit = Define.ValueToFit(createDeploy.Value.FitValue + fitness);

        m_UI.m_CreatingBookInfo.m_IconFitness.icon = UIUtil.GetFitnessUrl(createDeploy.Value.FitValue + fitness);

        m_UI.m_CreatingBookInfo.m_IconUp.visible = (int)curFit > (int)oriFit;
    }
Beispiel #9
0
    protected void OnSelectedGoods(ItemData data, int index)
    {
        m_SelectItemDatas[index] = data;
        m_ButtonIcons[index].m_State.selectedIndex = 1;
        m_ButtonIcons[index].icon = UIUtil.GetGoodsUrl(data.Type, data.Id);

        var xinfaDeploy  = XinFaDeploy.GetInfo(Data.SkillType);
        var canBenDeploy = CanBenDeploy.GetInfo(Data.SkillId);

        var totalAddAttr = 0;

        for (int i = 0; i < 3; i++)
        {
            var selectedItemData = m_SelectItemDatas[i];
            if (selectedItemData != null)
            {
                var goodsDeploy = GoodsDeploy.GetInfo(selectedItemData.Id);
                totalAddAttr += goodsDeploy.GetAddAttr(xinfaDeploy.Type);
                totalAddAttr += goodsDeploy.GetAddAttr(canBenDeploy.Type);
            }
        }
        m_UI.m_LabelPowerUp.SetValue(totalAddAttr);
    }
Beispiel #10
0
    private void PupilItemRenderer(int index, GObject obj)
    {
        var id     = m_UI.m_ListPupil.GetData <int>(index);
        var info   = PupilProxy.instance.getPupilInfo(id);
        var deploy = PupilDeploy.GetInfo(id);
        var item   = obj as UI_PupilSelectIcon;

        item.m_LabelName.SetText(deploy.Name);
        item.m_LabelLevel.SetValue(info.Level);

        var xinfaDeploy  = XinFaDeploy.GetInfo(m_View.Data.SkillType);
        var canBenDeploy = CanBenDeploy.GetInfo(m_View.Data.SkillId);

        item.m_IconXinFaCond.icon  = UIUtil.GetPupilAttUrl(xinfaDeploy.CondAttrType);
        item.m_IconCanBenCond.icon = UIUtil.GetPupilAttUrl(canBenDeploy.CondAttrType);

        item.m_LabelXinFaCond.SetText(info.GetAttr(xinfaDeploy.CondAttrType));
        item.m_LabelCanBenCond.SetText(info.GetAttr(canBenDeploy.CondAttrType));

        item.m_IconHead.icon = UIUtil.GetPupilHeadUrl(deploy.Sex);

        item.selected = false;
    }
Beispiel #11
0
    public ItemData AddItem(int itemId, EGoodsType type, int count)
    {
        int key = (int)type * TypeScope + itemId;

        ItemData itemInfo;

        if (GoodsMap.TryGetValue(key, out itemInfo))
        {
            itemInfo.Count += count;
        }
        else
        {
            itemInfo       = new ItemData();
            itemInfo.Id    = itemId;
            itemInfo.Type  = type;
            itemInfo.Count = count;

            switch (type)
            {
            case EGoodsType.DaoJu:
            {
                var deploy = GoodsDeploy.GetInfo(itemId);
                itemInfo.Name    = deploy.Name;
                itemInfo.Value   = deploy.Value;
                itemInfo.Desc    = deploy.Desc;
                itemInfo.Quality = deploy.Quality;
                break;
            }

            case EGoodsType.XinFa:
            {
                var deploy = XinFaDeploy.GetInfo(itemId);
                itemInfo.Name    = deploy.Name;
                itemInfo.Value   = deploy.Value;
                itemInfo.Desc    = deploy.Desc;
                itemInfo.Quality = deploy.Quality;
                break;
            }

            case EGoodsType.CanBen:
            {
                var deploy = CanBenDeploy.GetInfo(itemId);
                itemInfo.Name    = deploy.Name;
                itemInfo.Value   = deploy.Value;
                itemInfo.Desc    = deploy.Desc;
                itemInfo.Quality = deploy.Quality;
                break;
            }

            case EGoodsType.WuXue:
            {
                var data = UniqueSkillProxy.instance.GetData(itemId);
                itemInfo.Name    = data.Name;
                itemInfo.Value   = data.Value;
                itemInfo.Desc    = data.Desc;
                itemInfo.Quality = data.Quality;
                break;
            }

            default:
            {
                itemInfo.Name    = "";
                itemInfo.Value   = 0;
                itemInfo.Desc    = "";
                itemInfo.Quality = EGoodsQuality.None;
                break;
            }
            }

            GoodsMap.Add(key, itemInfo);
        }

        return(itemInfo);
    }