Addition of removedOnUnequipWeapon skill parameter.
This commit is contained in:
@ -397,10 +397,11 @@ public abstract class Inventory extends ItemContainer
|
||||
}
|
||||
});
|
||||
}
|
||||
// Must check for toggle skill item conditions.
|
||||
// Must check for toggle and isRemovedOnUnequipWeapon skill item conditions.
|
||||
for (Skill skill : player.getAllSkills())
|
||||
{
|
||||
if (skill.isToggle() && player.isAffectedBySkill(skill.getId()) && !skill.checkConditions(SkillConditionScope.GENERAL, player, player))
|
||||
if ((skill.isToggle() && player.isAffectedBySkill(skill.getId()) && !skill.checkConditions(SkillConditionScope.GENERAL, player, player)) //
|
||||
|| (it.isWeapon() && skill.isRemovedOnUnequipWeapon()))
|
||||
{
|
||||
player.stopSkillEffects(true, skill.getId());
|
||||
update.compareAndSet(false, true);
|
||||
|
@ -151,6 +151,7 @@ public class Skill implements IIdentifiable
|
||||
|
||||
private final boolean _removedOnAnyActionExceptMove;
|
||||
private final boolean _removedOnDamage;
|
||||
private final boolean _removedOnUnequipWeapon;
|
||||
|
||||
private final boolean _blockedInOlympiad;
|
||||
|
||||
@ -345,6 +346,7 @@ public class Skill implements IIdentifiable
|
||||
|
||||
_removedOnAnyActionExceptMove = set.getBoolean("removedOnAnyActionExceptMove", false);
|
||||
_removedOnDamage = set.getBoolean("removedOnDamage", false);
|
||||
_removedOnUnequipWeapon = set.getBoolean("removedOnUnequipWeapon", false);
|
||||
|
||||
_blockedInOlympiad = set.getBoolean("blockedInOlympiad", false);
|
||||
|
||||
@ -587,6 +589,14 @@ public class Skill implements IIdentifiable
|
||||
return _removedOnDamage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if skill effects should be removed on unequip weapon
|
||||
*/
|
||||
public boolean isRemovedOnUnequipWeapon()
|
||||
{
|
||||
return _removedOnUnequipWeapon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if skill can not be used in olympiad.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user