Search in sources :

Example 1 with IdentityList

use of pcgen.base.util.IdentityList in project pcgen by PCGen.

the class PlayerCharacter method processOldAcCheck.

/**
	 * Calculate the ACCHECK bonus from equipped items. Extracted from
	 * modToFromEquipment.
	 *
	 * TODO Penalty for load could/should be GameMode specific?
	 *
	 * @return PC's ACCHECK bonus from equipment
	 * @deprecated due to PCACCHECK code control
	 */
@Deprecated
public int processOldAcCheck() {
    Load load = getHouseRuledLoadType();
    int bonus = 0;
    int penaltyForLoad = (load == Load.MEDIUM) ? -3 : (load == Load.HEAVY) ? -6 : 0;
    final IdentityList<Equipment> vEqList = new IdentityList<>(tempBonusItemList);
    for (Equipment eq : getEquippedEquipmentSet()) {
        // Do not count virtual items created by temporary bonuses
        if (!vEqList.contains(eq)) {
            bonus += EqToken.getAcCheckTokenInt(this, eq);
        }
    }
    bonus = Math.min(bonus, penaltyForLoad);
    bonus += (int) getTotalBonusTo("MISC", "ACCHECK");
    return bonus;
}
Also used : Load(pcgen.util.enumeration.Load) IdentityList(pcgen.base.util.IdentityList)

Aggregations

IdentityList (pcgen.base.util.IdentityList)1 Load (pcgen.util.enumeration.Load)1