public virtual void SetBattleProps(BattleProps battleProps) { this.m_battleProps = battleProps; this.m_hp = battleProps.hp; }
//设置战斗过程中的属性 public virtual void SetBattleProps(BattleProps props) { Hp = props.hp; AttackValue = props.attackValue; BattleProps = props; }
public virtual void SetBattleProps(BattleProps props) { HP = props.hp; Props = props; }
private void InitMonsterCfg() { string xml = DeSerializeXML(PathDefine.MonsterCfg); XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); XmlNode root = doc.SelectSingleNode("root"); foreach (XmlElement item in root.ChildNodes) { if (item.GetAttributeNode("ID") == null) { continue; } int id = int.Parse(item.GetAttributeNode("ID").InnerText); MonsterCfg cfg = new MonsterCfg(); BattleProps props = new BattleProps(); cfg.ID = id; cfg.props = props; foreach (XmlElement ele in item.ChildNodes) { string value = ele.InnerText; switch (ele.Name) { case "mName": cfg.name = value; break; case "resPath": cfg.resPath = value; break; case "skillID": cfg.skillId = int.Parse(value); break; case "isStop": cfg.isStop = value.Equals("1"); break; case "atkDis": cfg.atkDis = float.Parse(value); break; case "hp": cfg.props.hp = int.Parse(value); break; case "ad": cfg.props.ad = int.Parse(value); break; case "ap": cfg.props.ap = int.Parse(value); break; case "addef": cfg.props.addef = int.Parse(value); break; case "apdef": cfg.props.apdef = int.Parse(value); break; case "dodge": cfg.props.dodge = int.Parse(value); break; case "pierce": cfg.props.pierce = int.Parse(value); break; case "critical": cfg.props.critical = int.Parse(value); break; } } monsterCfgDic.Add(id, cfg); } }
public virtual void SetBattleProps(BattleProps battleProps) { HP = battleProps.hp; Props = battleProps; }
public virtual void SetBattleProps(BattleProps val) { battleProps = val; HP = val.hp; }
public static BattleProps operator *(BattleProps m, int lv) { BattleProps res = new BattleProps(m.critical * lv, m.pierce * lv, m.dodge * lv, m.apdef * lv, m.addef * lv, m.ap * lv, m.ad * lv, m.hp * lv); return(res); }