We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Old Code:
protected virtual void FullmoonAttack(int damage, int delay = 500, DefenceType defenceType = DefenceType.ACAgility, int pushDistance = -1, int distance = 1) { MirDirection dir = Direction;
bool pushed = false; for (int j = 1; j <= distance; j++) { for (int i = 0; i < 8; i++) { dir = Functions.NextDir(dir); Point point = Functions.PointMove(CurrentLocation, dir, j); if (!CurrentMap.ValidPoint(point)) continue; Cell cell = CurrentMap.GetCell(point); if (cell.Objects == null) continue; for (int o = 0; o < cell.Objects.Count; o++) { MapObject ob = cell.Objects[o]; if (ob.Race != ObjectType.Player && ob.Race != ObjectType.Monster && ob.Race != ObjectType.Hero) continue; if (!ob.IsAttackTarget(this)) continue; if (pushDistance > 0 && !pushed) { ob.Pushed(this, Direction, pushDistance); pushed = true; } DelayedAction action = new DelayedAction(DelayedType.Damage, Envir.Time + delay, ob, damage, defenceType); ActionList.Add(action); break; } } } }
Code after repair:Increase judgment on direction
protected virtual void FullmoonAttack(int damage, int delay = 500, DefenceType defenceType = DefenceType.ACAgility, int pushDistance = -1, int distance = 1) //修改推动的方向问题 { MirDirection dir = Direction; List<MapObject> targets = new List<MapObject>(); for (int j = 1; j <= distance; j++) { for (int i = 0; i < 8; i++) { dir = Functions.NextDir(dir); Point point = Functions.PointMove(CurrentLocation, dir, j); if (!CurrentMap.ValidPoint(point)) continue; Cell cell = CurrentMap.GetCell(point); if (cell.Objects == null) continue; foreach (MapObject ob in cell.Objects) { if (ob.Race != ObjectType.Player && ob.Race != ObjectType.Monster && ob.Race != ObjectType.Hero) continue; if (!ob.IsAttackTarget(this)) continue; targets.Add(ob); } } } foreach (MapObject ob in targets) { MirDirection pushDir; if (distance == 1) { pushDir = Functions.ReverseDirection(dir); } else { pushDir = Functions.DirectionFromPoint(CurrentLocation, ob.CurrentLocation); } if (pushDistance > 0 && !ob.InSafeZone) { ob.Pushed(this, pushDir, pushDistance); } ActionList.Add(new DelayedAction(DelayedType.Damage, Envir.Time + delay, ob, damage, defenceType)); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Old Code:
protected virtual void FullmoonAttack(int damage, int delay = 500, DefenceType defenceType = DefenceType.ACAgility, int pushDistance = -1, int distance = 1)
{
MirDirection dir = Direction;
Code after repair:Increase judgment on direction
The text was updated successfully, but these errors were encountered: