IEnumerator Start() { Attribute attribute = new Attribute(); attribute.CostMp = 5; attribute.m_DelayTime = 2; SkillSystem.Skill windy = new SkillSystem.Skill(); Entity sakura = new Entity(); sakura.Name = "小樱"; sakura.Mp = 10; Entity enemy = new Entity(); windy.Init(sakura, enemy, attribute); //检验流程 bool isvalid = windy.IsValid(new MpVerify()); if (!isvalid) { windy.Interrupt(new InterruptValid()); } Debug.Log("准备 吟唱"); TaskSystem.TimeCondition cond = new TaskSystem.TimeCondition(attribute.m_DelayTime); TaskSystem.Task task = new TaskSystem.Task("吟唱动画", cond); yield return(StartCoroutine(windy.Sing(task))); Debug.Log("吟唱 结束"); }
public override void Fire(Skill skill) { TimeCondition singCond = new TimeCondition(skill.Attribute.m_DelayTime); TaskSystem.Task singTask = new TaskSystem.Task("吟唱任务", singCond); tm.AddTask(singTask); //伤害计算 DamageCondtion dmgCond = new DamageCondtion(skill, delegate(int result) { HandleCast(skill, result); }, EventsType.Skill_DamageEnd, obj_Id); TaskSystem.Task dmgTask = new TaskSystem.Task("伤害检查" + attribute.Name, dmgCond); tm.AddTask(dmgTask); //启动任务队列 tm.Start("技能伤害计算流程" + attribute.Name, delegate() { Debug.Log("Hp:" + obj_entity.Hp); skill.End(); }); }
public IEnumerator DoSkill(Skill s) { Debug.Log("准备 吟唱"); TaskSystem.TimeCondition cond = new TaskSystem.TimeCondition(s.Attribute.m_DelayTime); TaskSystem.Task task = new TaskSystem.Task("吟唱动画", cond); yield return(s.Sing(task)); Debug.Log("吟唱 结束"); }
public void Fire03(Skill skill) { //伤害计算 DamageCondtion dmgCond = new DamageCondtion(skill, delegate(int result) { HandleCast(skill, result); }, EventsType.Skill_DamageEnd, skill.Caster.m_Id); TaskSystem.Task dmgTask = new TaskSystem.Task("伤害检查" + skill.Attribute.Name, dmgCond); m_tm.AddTask(dmgTask); //启动任务队列 m_tm.Start("技能伤害计算流程" + skill.Attribute.Name); }
/// <summary> /// 处理施法 /// </summary> /// <param name="skill"></param> /// <param name="result"></param> private void HandleCast(Skill skill, int result) { //释放特效 TaskSystem.Task emitTask = new TaskSystem.Task("释放", new CastCondition(skill, 0.5f)); tm.AddTask(emitTask); //打击效果 TaskSystem.Task hitTask = new TaskSystem.Task("打击效果", new HitCondition(skill, 1)); tm.AddTask(hitTask); ////启动任务队列 tm.Start(">>>技能施法流程" + attribute.Name, delegate() { //Debug.Log("Hp:" + obj_entity.Hp); skill.End(); }); }
public void Fire02(SkillSystem.Skill skill) { //to-do吟唱 吟唱时间可以根据表格来 //伤害计算 DamageCondtion dmgCond = new DamageCondtion(skill, delegate(int result) { HandleCast(skill, result); }, EventsType.Skill_DamageEnd, skill.Caster.m_Id); TaskSystem.Task dmgTask = new TaskSystem.Task("伤害检查", dmgCond); TaskManager.Instance().AddTask(dmgTask); //启动任务队列 TaskManager.Instance().Start(">>>技能伤害计算流程"); }
/// <summary> /// 处理施法 /// </summary> /// <param name="skill"></param> /// <param name="result"></param> private void HandleCast(Skill skill, int result) { //释放特效 TaskSystem.Task emitTask = new TaskSystem.Task("释放", new CastCondition(skill, 0.5f)); TaskSystem.TaskManager.Instance().AddTask(emitTask); //打击效果 TaskSystem.Task hitTask = new TaskSystem.Task("打击效果", new HitCondition(skill, 1)); TaskSystem.TaskManager.Instance().AddTask(hitTask); ////启动任务队列 TaskManager.Instance().Start(">>>技能施法流程", delegate() { Debug.Log("Hp:" + obj.obj_entity.Hp); Debug.Log("Hp2:" + obj2.obj_entity.Hp); skill.End(); }); }
IEnumerator Start() { TaskSystem.Task task1 = new TaskSystem.Task("第一个任务 时间任务,间隔两秒", new TimeCondition(5.0f)); TaskManager.Instance().AddTask(task1); TaskSystem.Task task2 = new TaskSystem.Task("第二个任务 次数任务,3", new TimesCondition(3)); TaskSystem.Task task3 = new TaskSystem.Task("第三个任务 点击按钮", new TirggerCondition(btn)); TaskManager.Instance().AddTask(task2); TaskManager.Instance().AddTask(task3); curTask = TaskManager.Instance().Next(); while (curTask != null) { yield return(curTask); Debug.Log(curTask.m_Name + " 已经做完了"); curTask = TaskManager.Instance().Next(); } }
public void Fire(Skill skill) { //to-do吟唱 吟唱时间可以根据表格来 TimeCondition singCond = new TimeCondition(skill.Attribute.m_DelayTime); TaskSystem.Task singTask = new TaskSystem.Task("吟唱任务", singCond); TaskManager.Instance().AddTask(singTask); //伤害计算 DamageCondtion dmgCond = new DamageCondtion(skill, delegate(int result) { HandleCast(skill, result); }, EventsType.Skill_DamageEnd, skill.Caster.m_Id); TaskSystem.Task dmgTask = new TaskSystem.Task("伤害检查", dmgCond); TaskManager.Instance().AddTask(dmgTask); //启动任务队列 TaskManager.Instance().Start(">>>技能伤害计算流程"); }
public void Fire02(Skill skill) { string que01 = "蓄力队列>01"; TimeCondition singCond = new TimeCondition(skill.Attribute.m_DelayTime); TaskSystem.Task singTask = new TaskSystem.Task(" 蓄力任务", singCond); m_tm.AddTask(singTask); m_tm.Start(que01, delegate() { Debug.Log(que01 + "队列结束********************************************"); for (int i = 0; i < skill.Attribute.m_BuffList.Count; i++) { WsTaskManager wtm = new WsTaskManager(); Buff b = skill.Attribute.m_BuffList[i]; TimeCondition singCond3 = new TimeCondition(b.m_DelayTime); TaskSystem.Task singTask3 = new TaskSystem.Task("A buff延迟任务" + (i + 1), singCond3); wtm.AddTask(singTask3); wtm.Start(" buff延迟队列>" + (i + 1), delegate() { //Debug.Log(" buff延迟队列结束>" + (i + 1)); Debug.Log("buff延迟任务队列结束********************************************"); WsTaskManager wtm2 = new WsTaskManager(); string tn = "B buff生效任务:" + b.m_BuffName; BuffCondition bc = new BuffCondition(b, b.m_BuffTime); //Debug.Log(tn); TaskSystem.Task tbc = new TaskSystem.Task(tn, bc); wtm2.AddTask(tbc); wtm2.Start("000 buff队列>" + (i + 1), delegate() { Debug.Log("buff队列队列结束********************************************"); b.RemoveBuff(); }); }); } }); }
public override void Fire2(Skill skill) { //释放特效 //CastCondition cc = new CastCondition(skill,skill.Attribute.m_DelayTime); //Task.Task emitTask = new Task.Task("释放", cc); //tm.AddTask(emitTask); //TimeCondition singCond = new TimeCondition(skill.Attribute.m_DelayTime); //Task.Task singTask = new Task.Task("吟唱任务", singCond); //tm.AddTask(singTask); //WsTaskManager tm1 = new WsTaskManager(); //Buff b = skill.Attribute.m_BuffList[0]; //BuffCondition bc = new BuffCondition(b, b.m_BuffTime); //string tn = b.m_BuffName; ////Debug.Log(tn); //Task.Task tbc = new Task.Task(tn, bc); //tm1.AddTask(tbc); //tm1.Start(tn, delegate () //{ // b.RemoveBuff(); //}); //Buff b2 = skill.Attribute.m_BuffList[1]; //BuffCondition bc2 = new BuffCondition(b2, b2.m_BuffTime); //string tn2 = b2.m_BuffName; //Debug.Log(tn2); //Task.Task tbc2 = new Task.Task(tn2, bc); //tm.AddTask(tbc2); //tm.Start(tn2, delegate () //{ // b2.RemoveBuff(); //}); for (int i = 0; i < skill.Attribute.m_BuffList.Count; i++) { Buff b = skill.Attribute.m_BuffList[i]; b.InitBuff(skill.Caster); WsTaskManager wtm2 = new WsTaskManager(); string tn = "B buff生效任务:" + b.m_BuffName; BuffCondition bc = new BuffCondition(b, b.m_BuffTime); TaskSystem.Task tbc = new TaskSystem.Task(tn, bc); wtm2.AddTask(tbc); wtm2.Start("000 buff队列>" + (i + 1), delegate() { b.RemoveBuff(); Debug.Log("3.*****************Fight:" + obj_entity.Fight); }); } //TimeCondition singCond2 = new TimeCondition(skill.Attribute.m_DelayTime); //Task.Task singTask2 = new Task.Task("吟唱任务2", singCond2); //tm.AddTask(singTask2); //tm.Start("队列02", delegate () //{ // Debug.Log("队列02结束------------------------------------------"); //}); //BuffCondition bc = new BuffCondition(skill.Attribute.m_BuffList[0],5); //Task.Task tbc = new Task.Task("bc任务", bc); //tm.AddTask(tbc); //tm.Start("bc任务" + attribute.Name, delegate () //{ // skill.Attribute.m_BuffList[0].RemoveBuff(); //}); ////启动任务队列 //tm.Start("吟唱任务" + attribute.Name, delegate () //{ // Debug.Log("Hp:---------" + obj_entity.Hp); // skill.End(); //}); }