Code style changes.

This commit is contained in:
MobiusDev
2016-04-26 19:21:19 +00:00
parent 6a13705766
commit fc070c9238
768 changed files with 3338 additions and 4252 deletions

View File

@@ -38,14 +38,14 @@ public class Area implements ITargetTypeHandler
public L2Object[] getTargetList(Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
{
final List<L2Character> targetList = new ArrayList<>();
if ((target == null) || (((target == activeChar) || target.isAlikeDead()) && (skill.getCastRange() >= 0)) || (!(target.isAttackable() || target.isPlayable())))
if ((target == null) || (((target == activeChar) || target.isAlikeDead()) && (skill.getCastRange() >= 0)) || (!target.isAttackable() && !target.isPlayable()))
{
activeChar.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
return EMPTY_TARGET_LIST;
}
final L2Character origin;
final boolean srcInArena = (activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE));
final boolean srcInArena = activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE);
if (skill.getCastRange() >= 0)
{
@@ -74,7 +74,7 @@ public class Area implements ITargetTypeHandler
final Collection<L2Character> objs = activeChar.getKnownList().getKnownCharacters();
for (L2Character obj : objs)
{
if (!(obj.isAttackable() || obj.isPlayable()) || (obj == origin))
if ((!obj.isAttackable() && !obj.isPlayable()) || (obj == origin))
{
continue;
}

View File

@@ -58,7 +58,7 @@ public class AreaCorpseMob implements ITargetTypeHandler
final Collection<L2Character> objs = activeChar.getKnownList().getKnownCharacters();
for (L2Character obj : objs)
{
if (!(obj.isAttackable() || obj.isPlayable()) || !Util.checkIfInRange(skill.getAffectRange(), target, obj, true))
if ((!obj.isAttackable() && !obj.isPlayable()) || !Util.checkIfInRange(skill.getAffectRange(), target, obj, true))
{
continue;
}

View File

@@ -167,7 +167,7 @@ public class AreaFriendly implements ITargetTypeHandler
@Override
public int compare(L2Character char1, L2Character char2)
{
return Double.compare((char1.getCurrentHp() / char1.getMaxHp()), (char2.getCurrentHp() / char2.getMaxHp()));
return Double.compare(char1.getCurrentHp() / char1.getMaxHp(), char2.getCurrentHp() / char2.getMaxHp());
}
}

View File

@@ -50,7 +50,7 @@ public class AreaSummon implements ITargetTypeHandler
};
}
final boolean srcInArena = (activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE));
final boolean srcInArena = activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE);
final Collection<L2Character> objs = target.getKnownList().getKnownCharacters();
final int maxTargets = skill.getAffectLimit();
@@ -66,7 +66,7 @@ public class AreaSummon implements ITargetTypeHandler
continue;
}
if (!(obj.isAttackable() || obj.isPlayable()))
if (!obj.isAttackable() && !obj.isPlayable())
{
continue;
}

View File

@@ -37,7 +37,7 @@ public class Aura implements ITargetTypeHandler
public L2Object[] getTargetList(Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
{
final List<L2Character> targetList = new ArrayList<>();
final boolean srcInArena = (activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE));
final boolean srcInArena = activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE);
for (L2Character obj : activeChar.getKnownList().getKnownCharactersInRadius(skill.getAffectRange()))
{
if (obj.isDoor() || obj.isAttackable() || obj.isPlayable())

View File

@@ -38,14 +38,14 @@ public class BehindArea implements ITargetTypeHandler
public L2Object[] getTargetList(Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
{
final List<L2Character> targetList = new ArrayList<>();
if ((target == null) || (((target == activeChar) || target.isAlikeDead()) && (skill.getCastRange() >= 0)) || (!(target.isAttackable() || target.isPlayable())))
if ((target == null) || (((target == activeChar) || target.isAlikeDead()) && (skill.getCastRange() >= 0)) || (!target.isAttackable() && !target.isPlayable()))
{
activeChar.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
return EMPTY_TARGET_LIST;
}
final L2Character origin;
final boolean srcInArena = (activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE));
final boolean srcInArena = activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE);
if (skill.getCastRange() >= 0)
{
@@ -74,7 +74,7 @@ public class BehindArea implements ITargetTypeHandler
final int maxTargets = skill.getAffectLimit();
for (L2Character obj : objs)
{
if (!(obj.isAttackable() || obj.isPlayable()))
if (!obj.isAttackable() && !obj.isPlayable())
{
continue;
}

View File

@@ -36,7 +36,7 @@ public class BehindAura implements ITargetTypeHandler
public L2Object[] getTargetList(Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
{
final List<L2Character> targetList = new ArrayList<>();
final boolean srcInArena = (activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE));
final boolean srcInArena = activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE);
final Collection<L2Character> objs = activeChar.getKnownList().getKnownCharactersInRadius(skill.getAffectRange());
final int maxTargets = skill.getAffectLimit();
for (L2Character obj : objs)

View File

@@ -38,14 +38,14 @@ public class FrontArea implements ITargetTypeHandler
public L2Object[] getTargetList(Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
{
final List<L2Character> targetList = new ArrayList<>();
if ((target == null) || (((target == activeChar) || target.isAlikeDead()) && (skill.getCastRange() >= 0)) || (!(target.isAttackable() || target.isPlayable())))
if ((target == null) || (((target == activeChar) || target.isAlikeDead()) && (skill.getCastRange() >= 0)) || (!target.isAttackable() && !target.isPlayable()))
{
activeChar.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
return EMPTY_TARGET_LIST;
}
final L2Character origin;
final boolean srcInArena = (activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE));
final boolean srcInArena = activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE);
if (skill.getCastRange() >= 0)
{
@@ -74,7 +74,7 @@ public class FrontArea implements ITargetTypeHandler
final int maxTargets = skill.getAffectLimit();
for (L2Character obj : objs)
{
if (!(obj.isAttackable() || obj.isPlayable()))
if (!obj.isAttackable() && !obj.isPlayable())
{
continue;
}

View File

@@ -36,7 +36,7 @@ public class FrontAura implements ITargetTypeHandler
public L2Object[] getTargetList(Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
{
final List<L2Character> targetList = new ArrayList<>();
final boolean srcInArena = (activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE));
final boolean srcInArena = activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE);
final Collection<L2Character> objs = activeChar.getKnownList().getKnownCharactersInRadius(skill.getAffectRange());
final int maxTargets = skill.getAffectLimit();
for (L2Character obj : objs)

View File

@@ -39,7 +39,7 @@ public class Ground implements ITargetTypeHandler
final List<L2Character> targetList = new ArrayList<>();
final L2PcInstance player = (L2PcInstance) activeChar;
final int maxTargets = skill.getAffectLimit();
final boolean srcInArena = (activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE));
final boolean srcInArena = activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE);
for (L2Character character : activeChar.getKnownList().getKnownCharacters())
{

View File

@@ -72,7 +72,7 @@ public class PartyClan implements ITargetTypeHandler
});
// if player in clan and not in party
if (!(hasClan || hasParty))
if (!hasClan && !hasParty)
{
return targetList.toArray(new L2Character[targetList.size()]);
}
@@ -117,7 +117,7 @@ public class PartyClan implements ITargetTypeHandler
}
}
if (!((hasClan && (obj.getClanId() == player.getClanId())) || (hasParty && obj.isInParty() && (player.getParty().getLeaderObjectId() == obj.getParty().getLeaderObjectId()))))
if ((!hasClan || (obj.getClanId() != player.getClanId())) && (!hasParty || !obj.isInParty() || (player.getParty().getLeaderObjectId() != obj.getParty().getLeaderObjectId())))
{
continue;
}

View File

@@ -36,7 +36,7 @@ public class PartyMember implements ITargetTypeHandler
activeChar.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
return EMPTY_TARGET_LIST;
}
if (!target.isDead() && ((target == activeChar) || (activeChar.isInParty() && target.isInParty() && (activeChar.getParty().getLeaderObjectId() == target.getParty().getLeaderObjectId())) || ((activeChar.isPlayer() && target.isSummon() && ((activeChar.getPet() == target) || activeChar.hasServitor(target.getObjectId()))) || (activeChar.isSummon() && target.isPlayer() && ((activeChar == target.getPet()) || target.hasServitor(activeChar.getObjectId()))))))
if (!target.isDead() && ((target == activeChar) || (activeChar.isInParty() && target.isInParty() && (activeChar.getParty().getLeaderObjectId() == target.getParty().getLeaderObjectId())) || (activeChar.isPlayer() && target.isSummon() && ((activeChar.getPet() == target) || activeChar.hasServitor(target.getObjectId()))) || (activeChar.isSummon() && target.isPlayer() && ((activeChar == target.getPet()) || target.hasServitor(activeChar.getObjectId())))))
{
return new L2Character[]
{

View File

@@ -51,7 +51,7 @@ public class TargetParty implements ITargetTypeHandler
{
for (L2PcInstance partyMember : player.getParty().getMembers())
{
if ((partyMember == null))
if (partyMember == null)
{
continue;
}