Пример #1
0
 /// <summary>
 /// Buff构造函数
 /// </summary>
 /// <param name="ID">ID</param>
 public Buff(string ID)
 {
     this.ID                 = ID;
     this.Name               = "Buff";
     this.BuffType           = Global.BuffType.IncreaseLife;
     this.TargetType         = Global.BuffTargetType.None;
     this.BuffActiveState    = Global.BuffActiveState.BeforeAction;
     this.ChangeHeroProperty = new HeroProperty();
     this.IsBuff             = true;
     this.Description        = "buff描述";
 }
Пример #2
0
        /// <summary>
        /// 根据技能进行构造数据
        /// </summary>
        /// <param name="ID">技能ID</param>
        /// <param name="chance">技能成功几率</param>
        public Buff(string ID, int chance)
        {
            Buff buff = BuffTable.Instance.GetBuffByID(ID);

            this.ID                 = buff.ID;
            this.Name               = buff.Name;
            this.BuffType           = buff.BuffType;
            this.TargetType         = buff.TargetType;
            this.BuffActiveState    = buff.BuffActiveState;
            this.StayTurn           = buff.StayTurn;
            this.ChangeHeroProperty = buff.ChangeHeroProperty;
            this.IsBuff             = buff.IsBuff;
            this.Description        = buff.Description;
            this.SuccessChance      = chance;
        }
Пример #3
0
        /// <summary>
        /// 通过读取表格数据使用的构造函数
        /// </summary>
        /// <param name="temps">读取的一条表格数据</param>
        public Buff(string[] temps)
        {
            int offset = 0;

            ID                 = temps[offset].ToString(); offset++;
            Name               = temps[offset].ToString(); offset++;
            BuffType           = (Global.BuffType) int.Parse(temps[offset]); offset++;
            TargetType         = (Global.BuffTargetType) int.Parse(temps[offset]); offset++;
            BuffActiveState    = (Global.BuffActiveState) int.Parse(temps[offset]); offset++;
            ChangeHeroProperty = new HeroProperty(temps[offset]); offset++;
            IsBuff             = temps[offset] == "0" ? false : true; offset++;
            SuccessChance      = int.Parse(temps[offset]); offset++;
            Description        = temps[offset].ToString(); offset++;
            //赋值buff持续回合
            StayTurn = ChangeHeroProperty.Turn;
        }