More minor duel related changes.

This commit is contained in:
MobiusDev
2018-02-17 11:15:44 +00:00
parent 785c5caa83
commit df78ad9aea
6 changed files with 30 additions and 22 deletions

View File

@@ -91,8 +91,6 @@ public class Duel
if (_partyDuel)
{
// increase countdown so that start task can teleport players
_countdown++;
// inform players that they will be ported shortly
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IN_A_MOMENT_YOU_WILL_BE_TRANSPORTED_TO_THE_SITE_WHERE_THE_DUEL_WILL_TAKE_PLACE);
broadcastToTeam1(sm);
@@ -588,7 +586,7 @@ public class Duel
}
/**
* teleport all players
* Teleports all players to a free arena.
*/
public void teleportPlayers()
{
@@ -813,6 +811,8 @@ public class Duel
stopFighting();
// Don't restore hp, mp, cp
restorePlayerConditions(true);
// TODO: is there no other message for a canceled duel?
// send SystemMessage
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
broadcastToTeam1(sm);
@@ -822,7 +822,9 @@ public class Duel
case TIMEOUT:
{
stopFighting();
// hp,mp,cp seem to be restored in a timeout too...
restorePlayerConditions(false);
// send SystemMessage
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
broadcastToTeam1(sm);

View File

@@ -91,8 +91,6 @@ public class Duel
if (_partyDuel)
{
// increase countdown so that start task can teleport players
_countdown++;
// inform players that they will be ported shortly
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IN_A_MOMENT_YOU_WILL_BE_TRANSPORTED_TO_THE_SITE_WHERE_THE_DUEL_WILL_TAKE_PLACE);
broadcastToTeam1(sm);
@@ -588,7 +586,7 @@ public class Duel
}
/**
* teleport all players
* Teleports all players to a free arena.
*/
public void teleportPlayers()
{
@@ -813,6 +811,8 @@ public class Duel
stopFighting();
// Don't restore hp, mp, cp
restorePlayerConditions(true);
// TODO: is there no other message for a canceled duel?
// send SystemMessage
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
broadcastToTeam1(sm);
@@ -822,7 +822,9 @@ public class Duel
case TIMEOUT:
{
stopFighting();
// hp,mp,cp seem to be restored in a timeout too...
restorePlayerConditions(false);
// send SystemMessage
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
broadcastToTeam1(sm);

View File

@@ -91,8 +91,6 @@ public class Duel
if (_partyDuel)
{
// increase countdown so that start task can teleport players
_countdown++;
// inform players that they will be ported shortly
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IN_A_MOMENT_YOU_WILL_BE_TRANSPORTED_TO_THE_SITE_WHERE_THE_DUEL_WILL_TAKE_PLACE);
broadcastToTeam1(sm);
@@ -588,7 +586,7 @@ public class Duel
}
/**
* teleport all players
* Teleports all players to a free arena.
*/
public void teleportPlayers()
{
@@ -813,6 +811,8 @@ public class Duel
stopFighting();
// Don't restore hp, mp, cp
restorePlayerConditions(true);
// TODO: is there no other message for a canceled duel?
// send SystemMessage
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
broadcastToTeam1(sm);
@@ -822,7 +822,9 @@ public class Duel
case TIMEOUT:
{
stopFighting();
// hp,mp,cp seem to be restored in a timeout too...
restorePlayerConditions(false);
// send SystemMessage
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
broadcastToTeam1(sm);

View File

@@ -91,8 +91,6 @@ public class Duel
if (_partyDuel)
{
// increase countdown so that start task can teleport players
_countdown++;
// inform players that they will be ported shortly
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IN_A_MOMENT_YOU_WILL_BE_TRANSPORTED_TO_THE_SITE_WHERE_THE_DUEL_WILL_TAKE_PLACE);
broadcastToTeam1(sm);
@@ -588,7 +586,7 @@ public class Duel
}
/**
* teleport all players
* Teleports all players to a free arena.
*/
public void teleportPlayers()
{
@@ -813,6 +811,8 @@ public class Duel
stopFighting();
// Don't restore hp, mp, cp
restorePlayerConditions(true);
// TODO: is there no other message for a canceled duel?
// send SystemMessage
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
broadcastToTeam1(sm);
@@ -822,7 +822,9 @@ public class Duel
case TIMEOUT:
{
stopFighting();
// hp,mp,cp seem to be restored in a timeout too...
restorePlayerConditions(false);
// send SystemMessage
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
broadcastToTeam1(sm);

View File

@@ -289,7 +289,7 @@ public class Duel
}
catch (Exception e)
{
_log.log(Level.SEVERE, "", e);
_log.log(Level.SEVERE, "There has been a problem while runing a duel end task!", e);
}
}
}
@@ -437,13 +437,12 @@ public class Duel
}
else
{
// Set duel state and team
// set isInDuel() state
_playerA.setIsInDuel(_duelId);
_playerA.setTeam(Team.BLUE);
_playerB.setIsInDuel(_duelId);
_playerB.setTeam(Team.RED);
// Send duel Start packets
// Send duel packets
broadcastToTeam1(ExDuelReady.PLAYER_DUEL);
broadcastToTeam2(ExDuelReady.PLAYER_DUEL);
@@ -461,7 +460,7 @@ public class Duel
broadcastToTeam1(B04_S01);
broadcastToTeam2(B04_S01);
// start dueling task
// start duelling task
ThreadPoolManager.schedule(new ScheduleDuelTask(this), 1000);
}
@@ -720,7 +719,7 @@ public class Duel
}
/**
* Playback the bow animation for all looser
* Playback the bow animation for all loosers
*/
public void playKneelAnimation()
{
@@ -1053,11 +1052,10 @@ public class Duel
else
// teleport the player back & delete his PlayerCondition record
{
final PlayerCondition cond = _playerConditions.get(player.getObjectId());
final PlayerCondition cond = _playerConditions.remove(player.getObjectId());
if (cond != null)
{
cond.teleportBack();
_playerConditions.remove(player.getObjectId());
}
player.setIsInDuel(0);
}

View File

@@ -91,8 +91,6 @@ public class Duel
if (_partyDuel)
{
// increase countdown so that start task can teleport players
_countdown++;
// inform players that they will be ported shortly
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IN_A_MOMENT_YOU_WILL_BE_TRANSPORTED_TO_THE_SITE_WHERE_THE_DUEL_WILL_TAKE_PLACE);
broadcastToTeam1(sm);
@@ -588,7 +586,7 @@ public class Duel
}
/**
* teleport all players
* Teleports all players to a free arena.
*/
public void teleportPlayers()
{
@@ -813,6 +811,8 @@ public class Duel
stopFighting();
// Don't restore hp, mp, cp
restorePlayerConditions(true);
// TODO: is there no other message for a canceled duel?
// send SystemMessage
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
broadcastToTeam1(sm);
@@ -822,7 +822,9 @@ public class Duel
case TIMEOUT:
{
stopFighting();
// hp,mp,cp seem to be restored in a timeout too...
restorePlayerConditions(false);
// send SystemMessage
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
broadcastToTeam1(sm);