mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-28 05:45:10 -06:00
Some ContentAPI usage
This commit is contained in:
parent
189d989a28
commit
cd74bb46b1
2 changed files with 13 additions and 10 deletions
|
|
@ -250,7 +250,7 @@ public abstract class MovementPulse extends Pulse {
|
|||
if (near || pulse()) {
|
||||
if (mover instanceof Player) {
|
||||
if (near) {
|
||||
((Player) mover).getPacketDispatch().sendMessage("I can't reach that.");
|
||||
sendMessage((Player) mover, "I can't reach that.");
|
||||
}
|
||||
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext((Player) mover));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package core.game.node.entity.combat
|
||||
|
||||
import core.ServerConstants
|
||||
import core.api.face
|
||||
import core.api.sendMessage
|
||||
import core.api.stopWalk
|
||||
import core.game.container.impl.EquipmentContainer
|
||||
import core.game.node.Node
|
||||
import core.game.node.entity.Entity
|
||||
|
|
@ -273,15 +276,15 @@ object CombatMovementIntents {
|
|||
attacker, target, attacker.location, projectedTargetLocation, trace
|
||||
)
|
||||
) {
|
||||
attacker.walkingQueue.reset()
|
||||
attacker.face(target)
|
||||
stopWalk(attacker)
|
||||
face(attacker, target)
|
||||
projectedLocations[attacker] = attacker.location
|
||||
reserveOccupiedTiles(reservedTiles, attacker, attacker.location)
|
||||
return
|
||||
}
|
||||
if (canAttackFrom(attacker, target, attacker.location, targetLocation, trace)) {
|
||||
attacker.walkingQueue.reset()
|
||||
attacker.face(target)
|
||||
stopWalk(attacker)
|
||||
face(attacker, target)
|
||||
projectedLocations[attacker] = attacker.location
|
||||
reserveOccupiedTiles(reservedTiles, attacker, attacker.location)
|
||||
return
|
||||
|
|
@ -298,7 +301,7 @@ object CombatMovementIntents {
|
|||
return
|
||||
}
|
||||
walkPath(attacker, attackPath)
|
||||
attacker.face(target)
|
||||
face(attacker, target)
|
||||
projectedLocations[attacker] = attackPath.projectedLocation
|
||||
reserveOccupiedTiles(reservedTiles, attacker, attackPath.projectedLocation)
|
||||
return
|
||||
|
|
@ -313,7 +316,7 @@ object CombatMovementIntents {
|
|||
attacker, target, projectedAttackerLocation, targetLocation, trace
|
||||
)
|
||||
) {
|
||||
attacker.face(target)
|
||||
face(attacker, target)
|
||||
projectedLocations[attacker] = projectedAttackerLocation
|
||||
reserveOccupiedTiles(reservedTiles, attacker, projectedAttackerLocation)
|
||||
return
|
||||
|
|
@ -334,7 +337,7 @@ object CombatMovementIntents {
|
|||
}
|
||||
|
||||
walkPath(attacker, attackPath)
|
||||
attacker.face(target)
|
||||
face(attacker, target)
|
||||
projectedLocations[attacker] = attackPath.projectedLocation
|
||||
reserveOccupiedTiles(reservedTiles, attacker, attackPath.projectedLocation)
|
||||
return
|
||||
|
|
@ -1111,9 +1114,9 @@ object CombatMovementIntents {
|
|||
@JvmStatic
|
||||
fun stopUnreachableCombat(attacker: Entity) {
|
||||
attacker.properties.combatPulse.stop()
|
||||
attacker.walkingQueue.reset()
|
||||
stopWalk(attacker)
|
||||
if (attacker is Player) {
|
||||
attacker.packetDispatch.sendMessage("I can't reach that!")
|
||||
sendMessage(attacker, "I can't reach that!")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue