Example #1
0
 private void DoConsume(Node <EquipmentData> node, int cost)
 {
     BattleEquipTools_op.ChangeHeroMoney(this.Owner.unique_id, -cost);
     node.Data.ChangeBoughtState(true);
     node.Data.ChangePosseState(true);
     this.MarkBoughtState(node);
 }
        private void OnClick_ownShop(GameObject obj)
        {
            this.handlingRItem = null;
            EBattleShopType nearestShopType = BattleEquipTools_op.GetNearestShopType();

            MobaMessageManagerTools.BattleShop_openBattleShop(nearestShopType, EBattleShopOpenType.eFromButton);
        }
    public void ApplyChange()
    {
        List <ItemDynData>   equipList = this.EquipList;
        IEnumerable <string> source    = from x in equipList
                                         select x.typeId;
        List <string> equips = source.ToList <string>();

        BattleEquipTools_op.ApplyEquipsToHero(equips, (Hero)this.self);
        this.self.SetItemSkill(this.EquipList);
        HeroItemsChangedData msgParam = new HeroItemsChangedData(this.self.unique_id, equipList);

        MobaMessageManager.DispatchMsg(MobaMessageManager.GetMessage((ClientMsg)25043, msgParam, 0f));
    }
    private void InitDynamicData()
    {
        this.self.ChangeAttr(AttrType.Hp, OpType.Add, this.self.hp_max * this.self.hp_init_p);
        this.self.ChangeAttr(AttrType.Mp, OpType.Add, this.self.mp_max * this.self.mp_init_p);
        this.self.attackExtraDamage        = 0f;
        this.self.attackMultipleDamage     = 0f;
        this.self.beheadedCoefficient      = 0f;
        this.self.attackReboundCoefficient = 0f;
        this.self.a_growthFactor           = 1f;
        this.self.attackForTargetBuff      = string.Empty;
        List <string> heroItemsString = BattleEquipTools_op.GetHeroItemsString(this.self);
        Dictionary <AttrType, float> dictionary;
        Dictionary <AttrType, float> dictionary2;

        BattleEquipTools_config.GetItemsAttri(heroItemsString, out dictionary, out dictionary2);
        foreach (KeyValuePair <AttrType, float> current in dictionary)
        {
            base.ChangeAttr(current.Key, OpType.Add, current.Value);
        }
        foreach (KeyValuePair <AttrType, float> current2 in dictionary2)
        {
            base.ChangeAttr(current2.Key, OpType.Mul, current2.Value);
        }
    }