Olympiad game addDamage when not invulnerable.

This commit is contained in:
MobiusDevelopment
2020-11-13 22:48:46 +00:00
parent f6302f520d
commit c61ea3f137
21 changed files with 297 additions and 114 deletions

View File

@@ -678,21 +678,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -684,21 +684,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -684,21 +684,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -684,21 +684,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -684,21 +684,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -684,21 +684,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -684,21 +684,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -684,21 +684,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -678,21 +678,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -918,15 +918,22 @@ class OlympiadGame
{ {
return; return;
} }
if (player == _playerOne) if (player == _playerOne)
{
if (!_playerTwo.isInvul())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
}
else if (player == _playerTwo) else if (player == _playerTwo)
{
if (!_playerOne.isInvul())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
protected String getTitle() protected String getTitle()
{ {

View File

@@ -918,15 +918,22 @@ class OlympiadGame
{ {
return; return;
} }
if (player == _playerOne) if (player == _playerOne)
{
if (!_playerTwo.isInvul())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
}
else if (player == _playerTwo) else if (player == _playerTwo)
{
if (!_playerOne.isInvul())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
protected String getTitle() protected String getTitle()
{ {

View File

@@ -1010,15 +1010,22 @@ class OlympiadGame
{ {
return; return;
} }
if (player == _playerOne) if (player == _playerOne)
{
if (!_playerTwo.isInvul())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
}
else if (player == _playerTwo) else if (player == _playerTwo)
{
if (!_playerOne.isInvul())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
protected String getTitle() protected String getTitle()
{ {

View File

@@ -648,21 +648,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -678,21 +678,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -678,21 +678,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -678,21 +678,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -678,21 +678,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -678,21 +678,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -678,21 +678,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -678,21 +678,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()

View File

@@ -678,21 +678,30 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
} }
@Override @Override
protected final void addDamage(PlayerInstance player, int damage) protected void addDamage(PlayerInstance player, int damage)
{ {
if ((_playerOne.getPlayer() == null) || (_playerTwo.getPlayer() == null)) final PlayerInstance player1 = _playerOne.getPlayer();
final PlayerInstance player2 = _playerOne.getPlayer();
if ((player1 == null) || (player2 == null))
{ {
return; return;
} }
if (player == _playerOne.getPlayer())
if (player == player1)
{
if (!player2.isInvul() && !player2.isHpBlocked())
{ {
_damageP1 += damage; _damageP1 += damage;
} }
else if (player == _playerTwo.getPlayer()) }
else if (player == player2)
{
if (!player1.isInvul() && !player1.isHpBlocked())
{ {
_damageP2 += damage; _damageP2 += damage;
} }
} }
}
@Override @Override
public String[] getPlayerNames() public String[] getPlayerNames()