public override void Do(RoleBase user, RoleBase target) { int tarHp = target.Hp; int damage = damageBase; tarHp -= damage; Util.Input(" {0}_{1} 向 {2}_{3} 释放技能{4},造成 {5} 点伤害!!!", user.name, user.id, target.name, target.id, name, damage); target.Hp = tarHp; }
public override void Do(RoleBase user, RoleBase target) { int hp = target.Hp; int damage = damageBase; hp += damage; Util.Input(" {0}_{1} 向 {2}_{3} 释放技能{4},恢复 {5} 点生命值!!!", user.name, user.id, target.name, target.id, name, damage); target.Hp = hp; }
public override void Do(RoleBase user, RoleBase target) { int hp = target.Hp; int r = Game._random.Next(0, 4); int damage = damageBase + r; hp -= damage; Util.Input(" {0}_{1} 向 {2}_{3} 释放技能{4},造成 {5} 点伤害!!!", user.name, user.id, target.name, target.id, name, damage); target.Hp = hp; }
public override void Do(RoleBase user, RoleBase target) { int hp = target.Hp; //int damage = damageBase; int damage = Math.Min(hp, damageBase); hp -= damage; Util.Input(" {0}_{1} 向 {2}_{3} 释放技能{4},造成 {5} 点伤害, 恢复 {5} 点生命值!!!", user.name, user.id, target.name, target.id, name, damage); target.Hp = hp; user.Hp += damage; }
//将string类型的idList转换成int类型 //当前版本目标不包括:召唤物和已死亡对象 public bool FindTargetsID(List <RoleBase> liveList, RoleBase player) { try { List <int> enemyID = new List <int> ( ); enemyID.Add(player.id); for (int i = 0; i < liveList.Count; i++) { enemyID.Add(liveList [i].id); } for (int i = 0; i < idStrList.Count; i++) { int id = Convert.ToInt32(idStrList [i]); foreach (int EnemyID in enemyID) { if (id == EnemyID) { tarsIDList.Add(id); break; } } bool inList = InListCheck(id, tarsIDList); if (inList) { //Util.Input ("技能释放对象: {0}" , id); } else { Util.Input("{0}是无效ID!", id); return(false); } } } catch { Util.Input("无效ID00000000!"); return(false); } RemoveTheSameID(tarsIDList); return(true); }
public List <RoleBase> ActSequence(RoleBase player, List <RoleBase> liveList) { List <RoleBase> actSeq = new List <RoleBase> ( ); for (int s = maxSpeed; s > minSpeed; s--) { if (player.Speed == s) { actSeq.Add(player); } for (int i = 0; i < liveList.Count; i++) { if (liveList [i].Speed == s) { actSeq.Add(liveList [i]); } } } return(actSeq); }
//解析第二段输入:tarsID public bool ParseTarsOrder(List <RoleBase> liveList, RoleBase player) { Util.Input("请输入目标ID (重新选择技能请输入back):"); string import = Console.ReadLine( ); tarsIDList = new List <int> ( ); if (string.IsNullOrWhiteSpace(import)) { if (matchSkill.skillProperty != SkillProperty.All) { Util.Input("未输入目标,技能无法使用!"); return(false); } else { //Util.Input ("全体技能>>>>>>"); Util.Input("惊喜不惊喜?意外不意外?>>>>>>"); return(AllTarsID(liveList)); } } string [] idArr = import.Split(new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries); idStrList = new List <string> (idArr); if (idStrList == null) { Util.Input("找不到ID列表!"); return(false); } if (idStrList.Count > 1) { if (matchSkill.skillProperty == SkillProperty.Single) { Util.Input("当前技能为单体技能,目标无效!"); return(false); } else if (matchSkill.skillProperty == SkillProperty.Multi) { return(FindTargetsID(liveList, player)); } else { Util.Input("全体技能..."); return(AllTarsID(liveList)); } } else { if (idStrList [0] == "back") { back = true; return(true); } else { if (matchSkill.skillProperty != SkillProperty.All) { return(FindTargetsID(liveList, player)); } else { return(AllTarsID(liveList)); } } } }
public override void UseSkill(RoleBase user, RoleBase target, SkillBase skill) { skill.Do(user, target); }
public virtual void Do(RoleBase user, RoleBase target) { Util.Input("释放技能!!"); }
//用比较ID的方法获得技能对象列表 public List <RoleBase> IDToRole(List <int> tarsIDList, List <RoleBase> allList, RoleBase player) { //RemoveTheSameID (tarsIDList); List <RoleBase> tars = new List <RoleBase> ( ); for (int i = 0; i < tarsIDList.Count; i++) { for (int j = 0; j < allList.Count; j++) { if (tarsIDList [i] == allList [j].id) { tars.Add(allList [j]); } else if (tarsIDList [i] == player.id) { tars.Add(player); break; } } } return(tars); }
public override void UseSkill(RoleBase user, RoleBase target, SkillBase skill) { base.UseSkill(user, target, skill); }
public virtual void UseSkill(RoleBase user, RoleBase target, SkillBase skill) { skill.Do(user, target); }