Exemplo n.º 1
0
        public static void FillBindSkillTable(DataTable dt, XElement root)
        {
            dt.Rows.Clear();
            SkillItemData obj = null;

            foreach (var item in root.Descendants(KEYSkill))
            {
                obj = new SkillItemData();
                if (TryGetBindSkillItem(item, obj))
                {
                    dt.Rows.Add(obj.Values);
                }
            }
            dt.AcceptChanges();
        }
Exemplo n.º 2
0
    public SkillItemData GetSkillItemData(uint skill_id)
    {
        if (skillTable == null)
        {
            return(null);
        }
        SkillItemData skillItemData = skillTable.Get(skill_id);

        if (skillItemData == null)
        {
            Log.TableError(this, skill_id);
            skillItemData      = new SkillItemData();
            skillItemData.name = Log.NON_DATA_NAME;
        }
        return(skillItemData);
    }
Exemplo n.º 3
0
        public static bool TryGetBindSkillItem(XElement skillXe, SkillItemData skillItem)
        {
            var xa = skillXe.Attribute(KEYSkillCode);

            if (null == xa)
            {
                return(false);
            }
            skillItem.SkillCode  = xa.Value;
            skillItem.SkillId    = skillXe.Attribute(KEYSkillId).Value;
            skillItem.SkillName  = skillXe.Attribute(KEYSkillName).Value;
            skillItem.SkillType  = skillXe.Attribute(KEYSkillSrcType).Value;
            skillItem.Memo       = GetAttributeValue(skillXe, SharedData.KEYMemo);
            skillItem.ModelId    = GetAttributeValue(skillXe, SharedData.KEYModelId);
            skillItem.OpenClipId = GetAttributeValue(skillXe, KEYOpenClipId);
            skillItem.ClipId     = GetAttributeValue(skillXe, SharedData.KEYClipId);
            return(true);
        }
Exemplo n.º 4
0
        public override PacketDistributed MergeFrom(pb::CodedInputStream input, PacketDistributed _base)
        {
            GCRefreshShenQiSkill _inst = (GCRefreshShenQiSkill)_base;

            while (true)
            {
                uint tag = input.ReadTag();
                switch (tag)
                {
                case 0:
                {
                    return(_inst);
                }

                case  10: {
                    SkillItemData subBuilder = new SkillItemData();
                    input.ReadMessage(subBuilder);
                    _inst.ShenQiSkilldata = subBuilder;
                    break;
                }
                }
            }
            return(_inst);
        }
Exemplo n.º 5
0
        public static bool cb(CSVReader csv_reader, SkillItemData data, ref uint key)
        {
            data.id = key;
            csv_reader.Pop(ref data.appVer);
            csv_reader.Pop(ref data.type);
            csv_reader.Pop(ref data.name);
            csv_reader.Pop(ref data.text);
            csv_reader.Pop(ref data.rarity);
            csv_reader.Pop(ref data.modelID);
            csv_reader.PopColor(ref data.modelColor);
            csv_reader.Pop(ref data.iconID);
            csv_reader.Pop(ref data.maxLv);
            csv_reader.Pop(ref data.growID);
            csv_reader.Pop(ref data.baseNeedExp);
            csv_reader.Pop(ref data.baseGiveExp);
            csv_reader.Pop(ref data.baseAtk);
            csv_reader.Pop(ref data.baseDef);
            csv_reader.Pop(ref data.baseHp);
            data.atkElement = new int[6];
            data.defElement = new int[6];
            for (int i = 0; i < 6; i++)
            {
                csv_reader.Pop(ref data.atkElement[i]);
            }
            for (int j = 0; j < 6; j++)
            {
                csv_reader.Pop(ref data.defElement[j]);
            }
            csv_reader.Pop(ref data.baseSell);
            csv_reader.Pop(ref data.enableEquipType);
            csv_reader.Pop(ref data.castTime);
            csv_reader.Pop(ref data.useGauge);
            csv_reader.Pop(ref data.castStateName);
            csv_reader.Pop(ref data.actStateName);
            csv_reader.Pop(ref data.startEffectName);
            csv_reader.Pop(ref data.startSEID);
            csv_reader.Pop(ref data.actLocalEffectName);
            csv_reader.Pop(ref data.actOneshotEffectName);
            csv_reader.Pop(ref data.actSEID);
            csv_reader.Pop(ref data.enchantEffectName);
            csv_reader.Pop(ref data.reactionType);
            csv_reader.Pop(ref data.bulletName);
            data.attackInfoNames = new string[5];
            for (int k = 0; k < 5; k++)
            {
                csv_reader.Pop(ref data.attackInfoNames[k]);
            }
            csv_reader.Pop(ref data.selfOnly);
            csv_reader.Pop(ref data.skillAtk);
            csv_reader.PopEnum(ref data.skillAtkType, ELEMENT_TYPE.MAX);
            csv_reader.Pop(ref data.skillAtkRate);
            csv_reader.Pop(ref data.hitEffectName);
            csv_reader.Pop(ref data.hitSEID);
            csv_reader.Pop(ref data.skillRange);
            csv_reader.Pop(ref data.healHp);
            csv_reader.Pop(ref data.healType);
            data.supportPassiveEqType = new ENABLE_EQUIP_TYPE[3];
            data.supportType          = new BuffParam.BUFFTYPE[3];
            data.supportValue         = new int[3];
            data.supportTime          = new float[3];
            data.supportEffectName    = new string[3];
            for (int l = 0; l < 3; l++)
            {
                csv_reader.Pop(ref data.supportPassiveEqType[l]);
                csv_reader.PopEnum(ref data.supportType[l], BuffParam.BUFFTYPE.NONE);
                csv_reader.Pop(ref data.supportValue[l]);
                csv_reader.Pop(ref data.supportTime[l]);
                csv_reader.Pop(ref data.supportEffectName[l]);
            }
            csv_reader.PopEnum(ref data.supportPassiveSpAttackType, SP_ATTACK_TYPE.NONE);
            string value = string.Empty;

            csv_reader.Pop(ref value);
            if (!string.IsNullOrEmpty(value))
            {
                string[] array = value.Split(':');
                data.buffTableIds = new int[array.Length];
                for (int m = 0; m < array.Length; m++)
                {
                    data.buffTableIds[m] = array[m].ToInt32OrDefault(0);
                }
            }
            string value2 = string.Empty;

            csv_reader.Pop(ref value2);
            if (!string.IsNullOrEmpty(value2))
            {
                string[] array2 = value2.Split(':');
                data.lockBuffTypes = new int[array2.Length];
                for (int n = 0; n < array2.Length; n++)
                {
                    data.lockBuffTypes[n] = array2[n].ToInt32OrDefault(0);
                }
            }
            return(true);
        }
Exemplo n.º 6
0
        void Save()
        {
            string skillCode = this.ucSkill.txtSkillCode.Text.Trim();
            string nSkillId  = this.ucSkill.txtSKillId.Text.Trim();

            if (string.IsNullOrEmpty(skillCode))
            {
                SharedLogic.ShowMessage("技能Code不可为空");
                return;
            }
            var rows = _bindData.Select(SkillItemData.COLSkillCode + "='" + skillCode + "'");

            if (skillCode != this._editCode && null != rows && rows.Length > 0)
            {
                SharedLogic.ShowMessage("该技能Code已存在");
                this.ucSkill.txtSkillCode.Focus();
                return;
            }
            rows = _bindData.Select(SkillItemData.COLSkillId + "='" + nSkillId.TrimStart('0') + "'");
            if (null != rows)
            {
                foreach (var dr in rows)
                {
                    if (dr[SkillItemData.COLSkillCode].ToString() != _editCode)
                    {
                        SharedLogic.ShowMessage("该技能Id已存在");
                        this.ucSkill.txtSKillId.Focus();
                        return;
                    }
                }
            }
            var nXml = this.ucSkill.GetValue();

            if (null == nXml)
            {
                SharedLogic.ShowMessage("构造XML失败");
                return;
            }
            this._editXml.RemoveAll();
            this._editXml.Add(nXml.Attributes());
            this._editXml.Add(nXml.Nodes());
            var obj = new SkillItemData();

            SharedLogic.TryGetBindSkillItem(nXml, obj);
            if (this.OpState != OperationState.Edit)
            {
                this._rootXml.Add(this._editXml);
                this._bindData.Rows.Add(obj.Values);
                if (this.OpState == OperationState.New)
                {
                    this.OpState   = OperationState.Edit;
                    this._editCode = skillCode;
                }
                else if (this.OpState == OperationState.Renew || this.OpState == OperationState.CopyNew)
                {
                    this._editXml = new XElement(SharedLogic.KEYSkill);
                    this.ucSkill.txtSkillCode.Text = "";
                    this.ucSkill.txtSkillCode.Focus();
                }
                this._bindData.TableName = skillCode;
            }
            else
            {
                var editRows = _bindData.Select(SkillItemData.COLSkillCode + "='" + this._editCode + "'");
                if (null == editRows || editRows.Length == 0)
                {
                    SharedLogic.ShowMessage("未找到编辑的行");
                    return;
                }
                editRows[0][SkillItemData.COLSkillId]      = obj.SkillId;
                editRows[0][SkillItemData.COLSkillName]    = obj.SkillName;
                editRows[0][SkillItemData.COLSkillSrcType] = obj.SkillType;
                editRows[0][SkillItemData.COLModelId]      = obj.ModelId;
                editRows[0][SkillItemData.COLOpenClipId]   = obj.OpenClipId;
                editRows[0][SkillItemData.COLClipId]       = obj.ClipId;
                editRows[0][SkillItemData.COLMemo]         = obj.Memo;
            }
            this._bindData.AcceptChanges();
            SharedLogic.ShowMessage("保存成功");
        }
Exemplo n.º 7
0
 public void SetShenQiSkilldata(SkillItemData value)
 {
     hasShenQiSkilldata = true;
     shenQiSkilldata_   = value;
 }