Browse Source

signature names updated

combat-2
MagicBot 8 months ago
parent
commit
768e209b2b
  1. 250
      src/engine/objects/AbstractCharacter.java

250
src/engine/objects/AbstractCharacter.java

@ -491,9 +491,9 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -491,9 +491,9 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
}
public static Regions InsideBuildingRegionGoingDown(AbstractCharacter player) {
public static Regions InsideBuildingRegionGoingDown(AbstractCharacter abstractCharacter) {
HashSet<AbstractWorldObject> buildings = WorldGrid.getObjectsInRangePartial(player, 1000, MBServerStatics.MASK_BUILDING);
HashSet<AbstractWorldObject> buildings = WorldGrid.getObjectsInRangePartial(abstractCharacter, 1000, MBServerStatics.MASK_BUILDING);
Regions tempRegion = null;
for (AbstractWorldObject awo : buildings) {
@ -502,12 +502,12 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -502,12 +502,12 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
if (building.getBounds() == null)
continue;
if (!Bounds.collide(player.getLoc(), building.getBounds()))
if (!Bounds.collide(abstractCharacter.getLoc(), building.getBounds()))
continue;
for (Regions region : building.getBounds().getRegions()) {
if (!region.isPointInPolygon(player.getLoc()))
if (!region.isPointInPolygon(abstractCharacter.getLoc()))
continue;
if (!region.isOutside())
@ -536,22 +536,22 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -536,22 +536,22 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
}
public static void teleport(AbstractCharacter worldObject, final Vector3fImmutable targetLoc) {
worldObject.locationLock.writeLock().lock();
public static void teleport(AbstractCharacter abstractCharacter, final Vector3fImmutable targetLoc) {
abstractCharacter.locationLock.writeLock().lock();
try {
MovementManager.translocate(worldObject, targetLoc);
if (worldObject.getObjectType().equals(GameObjectType.PlayerCharacter))
InterestManager.INTERESTMANAGER.HandleLoadForTeleport((PlayerCharacter) worldObject);
MovementManager.translocate(abstractCharacter, targetLoc);
if (abstractCharacter.getObjectType().equals(GameObjectType.PlayerCharacter))
InterestManager.INTERESTMANAGER.HandleLoadForTeleport((PlayerCharacter) abstractCharacter);
} catch (Exception e) {
Logger.error(e);
} finally {
worldObject.locationLock.writeLock().unlock();
abstractCharacter.locationLock.writeLock().unlock();
}
}
public static void removeRune(PlayerCharacter pc, ClientConnection origin, int runeID) {
public static void removeRune(PlayerCharacter playerCharacter, ClientConnection origin, int runeID) {
if (pc == null || origin == null) {
if (playerCharacter == null || origin == null) {
return;
}
@ -561,12 +561,12 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -561,12 +561,12 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
}
//see if pc has rune
ArrayList<CharacterRune> runes = pc.getRunes();
ArrayList<CharacterRune> runes = playerCharacter.getRunes();
if (runes == null)
return;
CharacterRune found = pc.getRune(runeID);
CharacterRune found = playerCharacter.getRune(runeID);
if (found == null)
return;
@ -574,16 +574,16 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -574,16 +574,16 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
//TODO see if player needs to refine skills or powers first
//attempt remove rune from player
if (!CharacterRune.removeRune(pc, runeID))
if (!CharacterRune.removeRune(playerCharacter, runeID))
return;
//update client with removed rune.
ApplyRuneMsg arm = new ApplyRuneMsg(pc.getObjectType().ordinal(), pc.getObjectUUID(), runeID);
Dispatch dispatch = Dispatch.borrow(pc, arm);
ApplyRuneMsg arm = new ApplyRuneMsg(playerCharacter.getObjectType().ordinal(), playerCharacter.getObjectUUID(), runeID);
Dispatch dispatch = Dispatch.borrow(playerCharacter, arm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
}
public static void removeAllBlessings(PlayerCharacter player) {
public static void removeAllBlessings(PlayerCharacter playerCharacter) {
PowersBase[] powers = new PowersBase[3];
@ -592,24 +592,24 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -592,24 +592,24 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
powers[2] = PowersManager.getPowerByIDString("BLS-WISDOM");
for (PowersBase power : powers) {
PowersManager.removeEffect(player, power.getActions().get(0), true, false);
PowersManager.removeEffect(playerCharacter, power.getActions().get(0), true, false);
}
}
/**
* @param abstractCharacter
* @ Calculates Atr (both hands) Defense, and Damage for pc
* @param playerCharacter
*/
public static void calculateAtrDefenseDamage(AbstractCharacter playerCharacter) {
if (playerCharacter.charItemManager == null || playerCharacter.charItemManager.getEquipped() == null || playerCharacter.skills == null) {
Logger.error("Player " + playerCharacter.getObjectUUID() + " missing skills or equipment");
defaultAtrAndDamage(playerCharacter,true);
defaultAtrAndDamage(playerCharacter,false);
playerCharacter.defenseRating = 0;
public static void calculateAtrDefenseDamage(AbstractCharacter abstractCharacter) {
if (abstractCharacter.charItemManager == null || abstractCharacter.charItemManager.getEquipped() == null || abstractCharacter.skills == null) {
Logger.error("Player " + abstractCharacter.getObjectUUID() + " missing skills or equipment");
defaultAtrAndDamage(abstractCharacter, true);
defaultAtrAndDamage(abstractCharacter, false);
abstractCharacter.defenseRating = 0;
return;
}
ConcurrentHashMap<EquipSlotType, Item> equipped = playerCharacter.charItemManager.getEquipped();
ConcurrentHashMap<EquipSlotType, Item> equipped = abstractCharacter.charItemManager.getEquipped();
// // Reset passives
// if (this.bonuses != null) {
@ -621,30 +621,30 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -621,30 +621,30 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
// this.bonuses.setBool("Dodge", false);
// }
// calculate atr and damage for each hand
calculateAtrDamageForWeapon(playerCharacter,equipped.get(EquipSlotType.RHELD), true, equipped.get(EquipSlotType.RHELD));
calculateAtrDamageForWeapon(playerCharacter,equipped.get(EquipSlotType.LHELD), false, equipped.get(EquipSlotType.LHELD));
calculateAtrDamageForWeapon(abstractCharacter, equipped.get(EquipSlotType.RHELD), true, equipped.get(EquipSlotType.RHELD));
calculateAtrDamageForWeapon(abstractCharacter, equipped.get(EquipSlotType.LHELD), false, equipped.get(EquipSlotType.LHELD));
// No Defense while in DeathShroud
if (playerCharacter.effects != null && playerCharacter.effects.containsKey("DeathShroud"))
playerCharacter.defenseRating = (short) 0;
if (abstractCharacter.effects != null && abstractCharacter.effects.containsKey("DeathShroud"))
abstractCharacter.defenseRating = (short) 0;
else {
// calculate defense for equipment
float defense = playerCharacter.statDexCurrent * 2;
defense += getShieldDefense(playerCharacter,equipped.get(EquipSlotType.LHELD));
defense += getArmorDefense(playerCharacter,equipped.get(EquipSlotType.HELM));
defense += getArmorDefense(playerCharacter,equipped.get(EquipSlotType.CHEST));
defense += getArmorDefense(playerCharacter,equipped.get(EquipSlotType.UPARM));
defense += getArmorDefense(playerCharacter,equipped.get(EquipSlotType.HANDS));
defense += getArmorDefense(playerCharacter,equipped.get(EquipSlotType.LEGS));
defense += getArmorDefense(playerCharacter,equipped.get(EquipSlotType.FEET));
defense += getWeaponDefense(playerCharacter,equipped);
if (playerCharacter.bonuses != null) {
float defense = abstractCharacter.statDexCurrent * 2;
defense += getShieldDefense(abstractCharacter, equipped.get(EquipSlotType.LHELD));
defense += getArmorDefense(abstractCharacter, equipped.get(EquipSlotType.HELM));
defense += getArmorDefense(abstractCharacter, equipped.get(EquipSlotType.CHEST));
defense += getArmorDefense(abstractCharacter, equipped.get(EquipSlotType.UPARM));
defense += getArmorDefense(abstractCharacter, equipped.get(EquipSlotType.HANDS));
defense += getArmorDefense(abstractCharacter, equipped.get(EquipSlotType.LEGS));
defense += getArmorDefense(abstractCharacter, equipped.get(EquipSlotType.FEET));
defense += getWeaponDefense(abstractCharacter, equipped);
if (abstractCharacter.bonuses != null) {
// add any bonuses
defense += (short) playerCharacter.bonuses.getFloat(ModType.DCV, SourceType.NONE);
defense += (short) abstractCharacter.bonuses.getFloat(ModType.DCV, SourceType.NONE);
// Finally multiply any percent modifiers. DO THIS LAST!
float pos_Bonus = playerCharacter.bonuses.getFloatPercentPositive(ModType.DCV, SourceType.NONE);
float pos_Bonus = abstractCharacter.bonuses.getFloatPercentPositive(ModType.DCV, SourceType.NONE);
defense = (short) (defense * (1 + pos_Bonus));
//Lucky rune applies next
@ -653,7 +653,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -653,7 +653,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
//and negative percent modifiers
//already done...
float neg_Bonus = playerCharacter.bonuses.getFloatPercentNegative(ModType.DCV, SourceType.NONE);
float neg_Bonus = abstractCharacter.bonuses.getFloatPercentNegative(ModType.DCV, SourceType.NONE);
defense = (short) (defense * (1 + neg_Bonus));
} else
@ -661,14 +661,14 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -661,14 +661,14 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
Logger.error("Error: missing bonuses");
defense = (defense < 1) ? 1 : defense;
playerCharacter.defenseRating = (short) (defense + 0.5f);
abstractCharacter.defenseRating = (short) (defense + 0.5f);
}
}
/**
* @ Calculates Atr, and Damage for each weapon
*/
public static void calculateAtrDamageForWeapon(AbstractCharacter playerCharacter, Item weapon, boolean mainHand, Item otherHand) {
public static void calculateAtrDamageForWeapon(AbstractCharacter abstractCharacter, Item weapon, boolean mainHand, Item otherHand) {
// make sure weapon exists
boolean noWeapon = false;
@ -680,7 +680,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -680,7 +680,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
if (ib == null)
noWeapon = true;
else if (!weapon.template.item_type.equals(ItemType.WEAPON)) {
defaultAtrAndDamage(playerCharacter,mainHand);
defaultAtrAndDamage(abstractCharacter, mainHand);
return;
} else
wb = ib;
@ -697,22 +697,22 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -697,22 +697,22 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
// get skill percentages and min and max damage for weapons
if (noWeapon) {
if (mainHand) {
Item off = playerCharacter.charItemManager.getEquipped().get(EquipSlotType.LHELD);
Item off = abstractCharacter.charItemManager.getEquipped().get(EquipSlotType.LHELD);
if (off != null && off.template != null && off.template.item_type.equals(ItemType.WEAPON))
playerCharacter.rangeHandOne = 10 * (1 + (playerCharacter.statStrBase / 600)); // Set
abstractCharacter.rangeHandOne = 10 * (1 + (abstractCharacter.statStrBase / 600)); // Set
// to
// no
// weapon
// range
else
playerCharacter.rangeHandOne = -1; // set to do not attack
abstractCharacter.rangeHandOne = -1; // set to do not attack
} else
playerCharacter.rangeHandTwo = -1; // set to do not attack
abstractCharacter.rangeHandTwo = -1; // set to do not attack
skillPercentage = getModifiedAmount(playerCharacter.skills.get("Unarmed Combat"));
masteryPercentage = getModifiedAmount(playerCharacter.skills.get("Unarmed Combat Mastery"));
skillPercentage = getModifiedAmount(abstractCharacter.skills.get("Unarmed Combat"));
masteryPercentage = getModifiedAmount(abstractCharacter.skills.get("Unarmed Combat Mastery"));
if (masteryPercentage == 0f)
mastDam = CharacterSkill.getQuickMastery(playerCharacter, "Unarmed Combat Mastery");
mastDam = CharacterSkill.getQuickMastery(abstractCharacter, "Unarmed Combat Mastery");
else
mastDam = masteryPercentage;
// TODO Correct these
@ -720,27 +720,27 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -720,27 +720,27 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
max = 3;
} else {
if (mainHand)
playerCharacter.rangeHandOne = weapon.template.item_weapon_max_range * (1 + (playerCharacter.statStrBase / 600));
abstractCharacter.rangeHandOne = weapon.template.item_weapon_max_range * (1 + (abstractCharacter.statStrBase / 600));
else
playerCharacter.rangeHandTwo = weapon.template.item_weapon_max_range * (1 + (playerCharacter.statStrBase / 600));
abstractCharacter.rangeHandTwo = weapon.template.item_weapon_max_range * (1 + (abstractCharacter.statStrBase / 600));
if (playerCharacter.bonuses != null) {
float range_bonus = 1 + playerCharacter.bonuses.getFloatPercentAll(ModType.WeaponRange, SourceType.NONE);
if (abstractCharacter.bonuses != null) {
float range_bonus = 1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponRange, SourceType.NONE);
if (mainHand)
playerCharacter.rangeHandOne *= range_bonus;
abstractCharacter.rangeHandOne *= range_bonus;
else
playerCharacter.rangeHandTwo *= range_bonus;
abstractCharacter.rangeHandTwo *= range_bonus;
}
skillPercentage = getModifiedAmount(playerCharacter.skills.get(weapon.template.item_skill_used));
masteryPercentage = getModifiedAmount(playerCharacter.skills.get(wb.item_skill_mastery_used));
skillPercentage = getModifiedAmount(abstractCharacter.skills.get(weapon.template.item_skill_used));
masteryPercentage = getModifiedAmount(abstractCharacter.skills.get(wb.item_skill_mastery_used));
if (masteryPercentage == 0f)
mastDam = 0f;
// mastDam = CharacterSkill.getQuickMastery(this, wb.getMastery());
else
mastDam = masteryPercentage;
int[] damages = (int[])wb.item_weapon_damage.values().toArray()[0];
int[] damages = (int[]) wb.item_weapon_damage.values().toArray()[0];
min = damages[0];
max = damages[1];
strBased = wb.item_primary_attr.equals(AttributeType.Strength);
@ -758,29 +758,29 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -758,29 +758,29 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
// }
}
if (playerCharacter.effects != null && playerCharacter.effects.containsKey("DeathShroud"))
if (abstractCharacter.effects != null && abstractCharacter.effects.containsKey("DeathShroud"))
// No Atr in deathshroud.
if (mainHand)
playerCharacter.atrHandOne = (short) 0;
abstractCharacter.atrHandOne = (short) 0;
else
playerCharacter.atrHandTwo = (short) 0;
abstractCharacter.atrHandTwo = (short) 0;
else {
// calculate atr
float atr = 0;
atr += (int) skillPercentage * 4f; //<-round down skill% -
atr += (int) masteryPercentage * 3f;
if (playerCharacter.statStrCurrent > playerCharacter.statDexCurrent)
atr += playerCharacter.statStrCurrent / 2;
if (abstractCharacter.statStrCurrent > abstractCharacter.statDexCurrent)
atr += abstractCharacter.statStrCurrent / 2;
else
atr += playerCharacter.statDexCurrent / 2;
atr += abstractCharacter.statDexCurrent / 2;
// add in any bonuses to atr
if (playerCharacter.bonuses != null) {
if (abstractCharacter.bonuses != null) {
// Add any base bonuses
atr += playerCharacter.bonuses.getFloat(ModType.OCV, SourceType.NONE);
atr += abstractCharacter.bonuses.getFloat(ModType.OCV, SourceType.NONE);
// Finally use any multipliers. DO THIS LAST!
float pos_Bonus = (1 + playerCharacter.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.NONE));
float pos_Bonus = (1 + abstractCharacter.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.NONE));
atr *= pos_Bonus;
// next precise
@ -788,7 +788,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -788,7 +788,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
// atr *= (1 + ((float) this.bonuses.getShort("rune.Attack") / 100));
//and negative percent modifiers
float neg_Bonus = playerCharacter.bonuses.getFloatPercentNegative(ModType.OCV, SourceType.NONE);
float neg_Bonus = abstractCharacter.bonuses.getFloatPercentNegative(ModType.OCV, SourceType.NONE);
atr *= (1 + neg_Bonus);
}
@ -797,9 +797,9 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -797,9 +797,9 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
// set atr
if (mainHand)
playerCharacter.atrHandOne = (short) (atr + 0.5f);
abstractCharacter.atrHandOne = (short) (atr + 0.5f);
else
playerCharacter.atrHandTwo = (short) (atr + 0.5f);
abstractCharacter.atrHandTwo = (short) (atr + 0.5f);
}
//calculate speed
@ -808,8 +808,8 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -808,8 +808,8 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
else
speed = 20f; //unarmed attack speed
if (weapon != null)
speed *= (1 + playerCharacter.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.NONE));
speed *= (1 + playerCharacter.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.NONE));
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.NONE));
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.NONE));
if (speed < 10)
speed = 10;
@ -850,37 +850,37 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -850,37 +850,37 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
// calculate damage
float minDamage;
float maxDamage;
float pri = (strBased) ? (float) playerCharacter.statStrCurrent : (float) playerCharacter.statDexCurrent;
float sec = (strBased) ? (float) playerCharacter.statDexCurrent : (float) playerCharacter.statStrCurrent;
float pri = (strBased) ? (float) abstractCharacter.statStrCurrent : (float) abstractCharacter.statDexCurrent;
float sec = (strBased) ? (float) abstractCharacter.statDexCurrent : (float) abstractCharacter.statStrCurrent;
minDamage = (float) (min * ((0.0315f * Math.pow(pri, 0.75f)) + (0.042f * Math.pow(sec, 0.75f)) + (0.01f * ((int) skillPercentage + (int) mastDam))));
maxDamage = (float) (max * ((0.0785f * Math.pow(pri, 0.75f)) + (0.016f * Math.pow(sec, 0.75f)) + (0.0075f * ((int) skillPercentage + (int) mastDam))));
minDamage = (float) ((int) (minDamage + 0.5f)); //round to nearest decimal
maxDamage = (float) ((int) (maxDamage + 0.5f)); //round to nearest decimal
// Half damage if in death shroud
if (playerCharacter.effects != null && playerCharacter.effects.containsKey("DeathShroud")) {
if (abstractCharacter.effects != null && abstractCharacter.effects.containsKey("DeathShroud")) {
minDamage *= 0.5f;
maxDamage *= 0.5f;
}
// add in any bonuses to damage
if (playerCharacter.bonuses != null) {
if (abstractCharacter.bonuses != null) {
// Add any base bonuses
minDamage += playerCharacter.bonuses.getFloat(ModType.MinDamage, SourceType.NONE);
maxDamage += playerCharacter.bonuses.getFloat(ModType.MaxDamage, SourceType.NONE);
minDamage += abstractCharacter.bonuses.getFloat(ModType.MinDamage, SourceType.NONE);
maxDamage += abstractCharacter.bonuses.getFloat(ModType.MaxDamage, SourceType.NONE);
minDamage += playerCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.NONE);
maxDamage += playerCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.NONE);
minDamage += abstractCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.NONE);
maxDamage += abstractCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.NONE);
// Finally use any multipliers. DO THIS LAST!
float percentMinDamage = 1;
float percentMaxDamage = 1;
percentMinDamage += playerCharacter.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.NONE);
percentMinDamage += playerCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.NONE);
percentMinDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.NONE);
percentMinDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.NONE);
percentMaxDamage += playerCharacter.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.NONE);
percentMaxDamage += playerCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.NONE);
percentMaxDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.NONE);
percentMaxDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.NONE);
minDamage *= percentMinDamage;
maxDamage *= percentMaxDamage;
@ -889,20 +889,20 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -889,20 +889,20 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
// set damages
if (mainHand) {
playerCharacter.minDamageHandOne = (int) minDamage;
playerCharacter.maxDamageHandOne = (int) maxDamage;
playerCharacter.speedHandOne = speed;
abstractCharacter.minDamageHandOne = (int) minDamage;
abstractCharacter.maxDamageHandOne = (int) maxDamage;
abstractCharacter.speedHandOne = speed;
} else {
playerCharacter.minDamageHandTwo = (int) minDamage;
playerCharacter.maxDamageHandTwo = (int) maxDamage;
playerCharacter.speedHandTwo = speed;
abstractCharacter.minDamageHandTwo = (int) minDamage;
abstractCharacter.maxDamageHandTwo = (int) maxDamage;
abstractCharacter.speedHandTwo = speed;
}
}
/**
* @ Calculates Defense for shield
*/
private static float getShieldDefense(AbstractCharacter playerCharacter, Item shield) {
private static float getShieldDefense(AbstractCharacter abstractCharacter, Item shield) {
if (shield == null)
return 0;
@ -915,7 +915,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -915,7 +915,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
if (ab == null)
return 0;
CharacterSkill blockSkill = playerCharacter.skills.get("Block");
CharacterSkill blockSkill = abstractCharacter.skills.get("Block");
float skillMod;
@ -940,7 +940,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -940,7 +940,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
/**
* @ Calculates Defense for armor
*/
private static float getArmorDefense(AbstractCharacter playerCharacter, Item armor) {
private static float getArmorDefense(AbstractCharacter abstractCharacter, Item armor) {
if (armor == null)
return 0;
@ -956,10 +956,10 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -956,10 +956,10 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
if (armor.template.item_skill_used.isEmpty())
return ib.item_defense_rating;
CharacterSkill armorSkill = playerCharacter.skills.get(armor.template.item_skill_used);
CharacterSkill armorSkill = abstractCharacter.skills.get(armor.template.item_skill_used);
if (playerCharacter.getObjectType().equals(GameObjectType.PlayerCharacter) && armorSkill == null) {
Logger.error("Player " + playerCharacter.getObjectUUID()
if (abstractCharacter.getObjectType().equals(GameObjectType.PlayerCharacter) && armorSkill == null) {
Logger.error("Player " + abstractCharacter.getObjectUUID()
+ " has armor equipped without the nescessary skill to equip it");
return ib.item_defense_rating;
}
@ -979,7 +979,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -979,7 +979,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
/**
* @ Calculates Defense for weapon
*/
private static float getWeaponDefense(AbstractCharacter playerCharacter, ConcurrentHashMap<EquipSlotType, Item> equipped) {
private static float getWeaponDefense(AbstractCharacter abstractCharacter, ConcurrentHashMap<EquipSlotType, Item> equipped) {
Item weapon = equipped.get(EquipSlotType.RHELD);
ItemTemplate wb = null;
CharacterSkill skill, mastery;
@ -996,11 +996,11 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -996,11 +996,11 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
if (wb == null)
unarmed = true;
if (unarmed) {
skill = playerCharacter.skills.get("Unarmed Combat");
mastery = playerCharacter.skills.get("Unarmed Combat Mastery");
skill = abstractCharacter.skills.get("Unarmed Combat");
mastery = abstractCharacter.skills.get("Unarmed Combat Mastery");
} else {
skill = playerCharacter.skills.get(weapon.template.item_skill_used);
mastery = playerCharacter.skills.get(wb.item_skill_mastery_used);
skill = abstractCharacter.skills.get(weapon.template.item_skill_used);
mastery = abstractCharacter.skills.get(wb.item_skill_mastery_used);
}
if (skill != null)
val += (int) skill.getModifiedAmount() / 2f;
@ -1011,15 +1011,15 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -1011,15 +1011,15 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
//Don't call this function directly. linked from pc.calculateSkills()
//through SkillCalcJob. Designed to only run from one worker thread
public static void runSkillCalc(AbstractCharacter playerCharacter) {
public static void runSkillCalc(AbstractCharacter abstractCharacter) {
try {
//see if any new skills or powers granted
CharacterSkill.calculateSkills(playerCharacter);
CharacterSkill.calculateSkills(abstractCharacter);
// calculate granted Trains in powers.
CharacterPower.grantTrains(playerCharacter);
CharacterPower.grantTrains(abstractCharacter);
//see if any new powers unlocked from previous check
CharacterPower.calculatePowers(playerCharacter);
CharacterPower.calculatePowers(abstractCharacter);
} catch (Exception e) {
}
@ -1027,10 +1027,10 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -1027,10 +1027,10 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
}
//calculate item bonuses here
public static void calculateItemBonuses(AbstractCharacter playerCharacter) {
if (playerCharacter.charItemManager == null || playerCharacter.bonuses == null)
public static void calculateItemBonuses(AbstractCharacter abstractCharacter) {
if (abstractCharacter.charItemManager == null || abstractCharacter.bonuses == null)
return;
ConcurrentHashMap<EquipSlotType, Item> equipped = playerCharacter.charItemManager.getEquipped();
ConcurrentHashMap<EquipSlotType, Item> equipped = abstractCharacter.charItemManager.getEquipped();
for (Item item : equipped.values()) {
ItemTemplate ib = item.template;
if (ib == null)
@ -1042,19 +1042,19 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -1042,19 +1042,19 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
/**
* @ Defaults ATR, Defense and Damage for player
*/
private static void defaultAtrAndDamage(AbstractCharacter playerCharacter, boolean mainHand) {
private static void defaultAtrAndDamage(AbstractCharacter abstractCharacter, boolean mainHand) {
if (mainHand) {
playerCharacter.atrHandOne = 0;
playerCharacter.minDamageHandOne = 0;
playerCharacter.maxDamageHandOne = 0;
playerCharacter.rangeHandOne = -1;
playerCharacter.speedHandOne = 20;
abstractCharacter.atrHandOne = 0;
abstractCharacter.minDamageHandOne = 0;
abstractCharacter.maxDamageHandOne = 0;
abstractCharacter.rangeHandOne = -1;
abstractCharacter.speedHandOne = 20;
} else {
playerCharacter.atrHandTwo = 0;
playerCharacter.minDamageHandTwo = 0;
playerCharacter.maxDamageHandTwo = 0;
playerCharacter.rangeHandTwo = -1;
playerCharacter.speedHandTwo = 20;
abstractCharacter.atrHandTwo = 0;
abstractCharacter.minDamageHandTwo = 0;
abstractCharacter.maxDamageHandTwo = 0;
abstractCharacter.rangeHandTwo = -1;
abstractCharacter.speedHandTwo = 20;
}
}

Loading…
Cancel
Save