Addition of Creature isDisabled method.

This commit is contained in:
MobiusDevelopment
2021-08-11 22:08:05 +00:00
parent aa50d9efa6
commit cefabb9fe9
83 changed files with 397 additions and 211 deletions

View File

@ -951,7 +951,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
try
{
if ((target == null) || (isAttackingDisabled() && !isSummon()) || !target.isTargetable())
if ((target == null) || (isAttackDisabled() && !isSummon()) || !target.isTargetable())
{
return;
}
@ -1928,11 +1928,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
/**
* @return True if the Creature can't attack (stun, sleep, attackEndTime, fakeDeath, paralyze, attackMute).
* @return True if the Creature can't attack (attackEndTime, attackMute, fake death, stun, sleep, paralyze).
*/
public boolean isAttackingDisabled()
public boolean isAttackDisabled()
{
return hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
return isAttackingNow() || isDisabled();
}
/**
* @return True if the Creature is disabled (attackMute, fake death, stun, sleep, paralyze).
*/
public boolean isDisabled()
{
return _AIdisabled || isAlikeDead() || isPhysicalAttackMuted() || hasBlockActions();
}
public boolean isConfused()

View File

@ -2889,7 +2889,7 @@ public class PlayerInstance extends Playable
return;
}
if (!_waitTypeSitting && !isAttackingDisabled() && !isControlBlocked() && !isImmobilized() && !isFishing())
if (!_waitTypeSitting && !isAttackDisabled() && !isControlBlocked() && !isImmobilized() && !isFishing())
{
breakAttack();
setSitting(true);

View File

@ -548,8 +548,8 @@ public class SkillCaster implements Runnable
// Launch the magic skill in order to calculate its effects
try
{
// Mobius: Disabled characters should not be able to finish bad skills.
if (caster.isAttackingDisabled() && skill.isBad())
// Disabled characters should not be able to finish bad skills.
if (skill.isBad() && caster.isDisabled())
{
return;
}