void GetLineSkill(SkillPoint point) { CloseSkill(); damageList.Clear(); damageList.Add(point); switch (point.type) { case PointType.LEFT: GetLEFT(point); break; case PointType.RIGHT: GetRIGHT(point); break; case PointType.LEFTUP: GetLEFTUP(point); break; case PointType.LEFTDOWN: GetLEFTDOWN(point); break; case PointType.RIGHTUP: GetRIGHTUP(point); break; case PointType.RIGHTDOWN: GetRIGHTDOWN(point); break; } ShowSkill(); }
void GetPointSkill(SkillPoint point) { CloseSkill(); damageList.Clear(); damageList.Add(point); ShowSkill(); }
void GetSelf() { SkillPoint p = new SkillPoint(GameManage.Instance.role.x, GameManage.Instance.role.y, PointType.LEFT); rangeList.Add(p); damageList.Add(p); GameManage.Instance.IsSkill = true; }
void GetRIGHT(SkillPoint p) { if (p.y + 1 < GameManage.col) { SkillPoint point = new SkillPoint(p.x, p.y + 1, PointType.RIGHT); damageList.Add(point); } }
void GetLEFT(SkillPoint p) { if (p.y - 1 >= 0) { SkillPoint point = new SkillPoint(p.x, p.y - 1, PointType.RIGHT); damageList.Add(point); } }
private static SkillRemaining Create() { var skillId = new SkillId("TestSkill"); var actorId = new ActorId("TestActor"); var skillPoint = new SkillPoint(2); return(new SkillRemaining(skillId, actorId, skillPoint)); }
public SkillRemaining( SkillId skillId, ActorId actorId, SkillPoint skillPoint) { this.skillId = skillId; this.actorId = actorId; this.skillPoint = skillPoint; }
public void Consume() { var skillPoint = new SkillPoint(2); Assert.IsTrue(skillPoint.CheckRemain()); skillPoint = skillPoint.Consume(); Assert.IsTrue(skillPoint.CheckRemain()); skillPoint = skillPoint.Consume(); Assert.IsFalse(skillPoint.CheckRemain()); }
public Skill( SkillId id, Target target, Force force, SkillPoint point) { this.id = id; this.target = target; this.force = force; skillPoint = point; }
void addOpen(mapPoint p, PointType type) { if (close.Find(a => a.x == p.x && a.y == p.y) != null) { return; } if (open.Find(a => a.x == p.x && a.y == p.y) != null) { return; } SkillPoint point = new SkillPoint(p.x, p.y, type); open.Add(point); }
void GetLEFTDOWN(SkillPoint p) { if (p.x % 2 != 0) { if (p.x - 1 >= 0) { SkillPoint point = new SkillPoint(p.x - 1, p.y, PointType.LEFTDOWN); damageList.Add(point); } } else { if (p.y - 1 >= 0 && p.x - 1 >= 0) { SkillPoint point = new SkillPoint(p.x - 1, p.y - 1, PointType.LEFTDOWN); damageList.Add(point); } } }
void GetLEFTUP(SkillPoint p) { if (p.x % 2 != 0) { if (p.x + 1 < GameManage.row) { SkillPoint point = new SkillPoint(p.x + 1, p.y, PointType.LEFTUP); damageList.Add(point); } } else { if (p.y - 1 >= 0 && p.x + 1 < GameManage.row) { SkillPoint point = new SkillPoint(p.x + 1, p.y - 1, PointType.LEFTUP); damageList.Add(point); } } }
void GetRIGHTDOWN(SkillPoint p) { if (p.x % 2 != 0) { if (p.y + 1 < GameManage.col && p.x - 1 >= 0) { SkillPoint point = new SkillPoint(p.x - 1, p.y + 1, PointType.RIGHTDOWN); damageList.Add(point); } } else { if (p.x - 1 >= 0) { SkillPoint point = new SkillPoint(p.x - 1, p.y, PointType.RIGHTDOWN); damageList.Add(point); } } }
public void GetSkillArea(SkillConf skill, SkillLevelConf skillLevel) { mapp = GameManage.Instance.mapPoints; rangeList.Clear(); damageList.Clear(); this.skill = skill; this.skillLevel = skillLevel; switch (skill.skillAreaType) { case SkillAreaType.Line: GetArea(); ShowRange(); break; case SkillAreaType.Self: GetSelf(); ShowSkill(); break; case SkillAreaType.OuterCircle: GetArea(); ShowRange(); break; case SkillAreaType.Circle: GetArea(); foreach (SkillPoint p in rangeList) { SkillPoint point = new SkillPoint(p.x, p.y, PointType.LEFT); damageList.Add(point); } ShowSkill(); break; case SkillAreaType.Point: GetArea(); ShowRange(); break; } }
void GetOuterCircleSkill(SkillPoint point) { CloseSkill(); damageList.Clear(); damageList.Add(point); if (point.y + 1 < GameManage.col) { SkillPoint p = new SkillPoint(point.x, point.y + 1, PointType.RIGHT); damageList.Add(p); } if (point.y - 1 >= 0) { SkillPoint p = new SkillPoint(point.x, point.y - 1, PointType.RIGHT); damageList.Add(p); } if (point.x % 2 != 0) { if (point.x + 1 < GameManage.row) { SkillPoint p = new SkillPoint(point.x + 1, point.y, PointType.RIGHT); damageList.Add(p); } if (point.x - 1 >= 0) { SkillPoint p = new SkillPoint(point.x - 1, point.y, PointType.RIGHT); damageList.Add(p); } if (point.y + 1 < GameManage.col && point.x + 1 < GameManage.row) { SkillPoint p = new SkillPoint(point.x + 1, point.y + 1, PointType.RIGHT); damageList.Add(p); } if (point.y + 1 < GameManage.col && point.x - 1 >= 0) { SkillPoint p = new SkillPoint(point.x - 1, point.y + 1, PointType.RIGHT); damageList.Add(p); } } else { if (point.x + 1 < GameManage.row) { SkillPoint p = new SkillPoint(point.x + 1, point.y, PointType.RIGHT); damageList.Add(p); } if (point.x - 1 >= 0) { SkillPoint p = new SkillPoint(point.x - 1, point.y, PointType.RIGHT); damageList.Add(p); } if (point.y - 1 >= 0 && point.x + 1 < GameManage.row) { SkillPoint p = new SkillPoint(point.x + 1, point.y - 1, PointType.RIGHT); damageList.Add(p); } if (point.y - 1 >= 0 && point.x - 1 >= 0) { SkillPoint p = new SkillPoint(point.x - 1, point.y - 1, PointType.RIGHT); damageList.Add(p); } } ShowSkill(); }
void GetArea() { open.Clear(); close.Clear(); SkillPoint my = new SkillPoint(GameManage.Instance.role.x, GameManage.Instance.role.y, PointType.LEFT); open.Add(my); for (int i = 0; i < skill.range; i++) { int count = open.Count; for (int j = 0; j < count; j++) { SkillPoint now = open[j]; if (now.y + 1 < GameManage.col) { addOpen(mapp[now.x][now.y + 1], PointType.RIGHT); } if (now.y - 1 >= 0) { addOpen(mapp[now.x][now.y - 1], PointType.LEFT); } if (now.x % 2 != 0) { if (now.x + 1 < GameManage.row) { addOpen(mapp[now.x + 1][now.y], PointType.LEFTUP); } if (now.x - 1 >= 0) { addOpen(mapp[now.x - 1][now.y], PointType.LEFTDOWN); } if (now.y + 1 < GameManage.col && now.x + 1 < GameManage.row) { addOpen(mapp[now.x + 1][now.y + 1], PointType.RIGHTUP); } if (now.y + 1 < GameManage.col && now.x - 1 >= 0) { addOpen(mapp[now.x - 1][now.y + 1], PointType.RIGHTDOWN); } } else { if (now.x + 1 < GameManage.row) { addOpen(mapp[now.x + 1][now.y], PointType.RIGHTUP); } if (now.x - 1 >= 0) { addOpen(mapp[now.x - 1][now.y], PointType.RIGHTDOWN); } if (now.y - 1 >= 0 && now.x + 1 < GameManage.row) { addOpen(mapp[now.x + 1][now.y - 1], PointType.LEFTUP); } if (now.y - 1 >= 0 && now.x - 1 >= 0) { addOpen(mapp[now.x - 1][now.y - 1], PointType.LEFTDOWN); } } close.Add(open[j]); } for (int j = 0; j < count; j++) { open.Remove(open[0]); } } open.AddRange(close); open.Remove(my); rangeList = open; //Debug.LogError("rangeList " + rangeList.Count); GameManage.Instance.IsSkill = true; }
public void Consume() => skillPoint = skillPoint.Consume();
public void CanCreateZeroPoint() { var skillPoint = new SkillPoint(0); Assert.IsFalse(skillPoint.CheckRemain()); }