AttackEndTime rework and proper MovementTaskManager comments.

This commit is contained in:
MobiusDevelopment
2022-10-16 21:44:29 +00:00
parent 739e49bd8e
commit 8c4fff7541
83 changed files with 963 additions and 513 deletions

View File

@@ -5246,19 +5246,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
}
/**
* Calculate movement data for a move to location action and add the Creature to movingObjects of GameTimeTaskManager (only called by AI Accessor).<br>
* Calculate movement data for a move to location action and add the Creature to MOVING_OBJECTS of MovementTaskManager (only called by AI Accessor).<br>
* <br>
* <b><u>Concept</u>:</b><br>
* <br>
* At the beginning of the move action, all properties of the movement are stored in the MoveData object called <b>_move</b> of the Creature. The position of the start point and of the destination permit to estimated in function of the movement speed the time to achieve the destination.<br>
* All Creature in movement are identified in <b>movingObjects</b> of GameTimeTaskManager that will call the updatePosition method of those Creature each 0.1s.<br>
* All Creature in movement are identified in <b>MOVING_OBJECTS</b> of MovementTaskManager that will call the updatePosition method of those Creature each 0.1s.<br>
* <br>
* <b><u>Actions</u>:</b><br>
* <li>Get current position of the Creature</li>
* <li>Calculate distance (dx,dy) between current position and destination including offset</li>
* <li>Create and Init a MoveData object</li>
* <li>Set the Creature _move object to MoveData object</li>
* <li>Add the Creature to movingObjects of the GameTimeTaskManager</li>
* <li>Add the Creature to MOVING_OBJECTS of the MovementTaskManager</li>
* <li>Create a task to notify the AI that Creature arrives at a check point of the movement</li><br>
* <font color=#FF0000><b><u>Caution</u>: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation </b></font><br>
* <br>
@@ -5659,7 +5659,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
// Set the Creature _move object to MoveData object
_move = m;
// Add the Creature to moving objects of the GameTimeTaskManager.
// Add the Creature to moving objects of the MovementTaskManager.
// The MovementTaskManager manages object movement.
MovementTaskManager.getInstance().registerMovingObject(this);
@@ -5669,7 +5669,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
ThreadPool.schedule(new NotifyAITask(CtrlEvent.EVT_ARRIVED_REVALIDATE), 2000);
}
// the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive to destination by GameTimeTaskManager
// the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive to destination by MovementTaskManager
// Send a Server->Client packet MoveToLocation to the actor and all Player in its _knownPlayers
broadcastMoveToLocation();