// 將 buffer 往 vector 移動一格. // camera 也會更著移動. public void MoveForward(Vector2D vector) { // remove line. Dimention dimention = Dimention.Null; int value = 0; switch (vector) { case Vector2D.Up: dimention = Dimention.Y; value = center.Y.value - extra; break; case Vector2D.Down: dimention = Dimention.Y; value = center.Y.value + extra; break; case Vector2D.Left: dimention = Dimention.X; value = center.X.value + extra; break; case Vector2D.Right: dimention = Dimention.X; value = center.X.value - extra; break; } RemoveLine(dimention, value); // move bufferCenter and camera. this.center.MoveFor(vector, 1); // GameObjectMove(camera, Convert(vector)); // add line. Point2D point = this.center.Copy(); point.MoveFor(vector, extra); vector = VectorConvert.Rotate(vector); point.MoveFor(vector, extra); vector = VectorConvert.Invert(vector); AddLine(point, vector, Width); }
public void Horizon() { ep.Add(-20); if (ep.IsZero) { return; } Point2D targetPosition = this.posit.Copy(); Vector2D targetVector = this.Vect; if (GlobalAsset.player != null && this.Plain.Dimention == GlobalAsset.player.Plain.Dimention) { SkillManager.showSkill(Skill.horizon, this); } else { SkillManager.showSkill(Skill.attack, this); } targetPosition.MoveFor(targetVector, 1); targetVector = VectorConvert.Rotate(targetVector); targetPosition.MoveFor(targetVector, 2); targetVector = VectorConvert.Invert(targetVector); for (int i = 0; i < 3; ++i) { targetPosition.MoveFor(targetVector, 1); Grid targetGrid = World.GetAt(targetPosition.Binded); if (targetGrid == null) { continue; } if (targetGrid.Obj == null) { continue; } if (targetGrid.Obj is Attackable) { Attackable target = (Attackable)targetGrid.Obj; target.BeAttack(this); } } }