forked from MagicBane/Server
Start mobequip refactor
This commit is contained in:
@@ -39,8 +39,8 @@ public class FinalCombatManager {
|
||||
return;
|
||||
}
|
||||
|
||||
Item mainWeapon = attacker.getCharItemManager().getEquipped().get(Enum.EquipSlotType.RHELD);
|
||||
Item offWeapon = attacker.getCharItemManager().getEquipped().get(Enum.EquipSlotType.LHELD);
|
||||
Item mainWeapon = attacker.charItemManager.getEquipped().get(Enum.EquipSlotType.RHELD);
|
||||
Item offWeapon = attacker.charItemManager.getEquipped().get(Enum.EquipSlotType.LHELD);
|
||||
if(mainWeapon == null && offWeapon == null){
|
||||
//no weapons equipped, punch with both fists
|
||||
processAttack(attacker,target,Enum.EquipSlotType.RHELD);
|
||||
@@ -71,7 +71,7 @@ public class FinalCombatManager {
|
||||
PlayerBonuses bonus = attacker.getBonuses();
|
||||
float rangeMod = 1.0f;
|
||||
float attackRange = MBServerStatics.NO_WEAPON_RANGE;
|
||||
Item weapon = attacker.getCharItemManager().getEquipped(slot);
|
||||
Item weapon = attacker.charItemManager.getEquipped(slot);
|
||||
if (weapon != null) {
|
||||
if (bonus != null)
|
||||
rangeMod += bonus.getFloatPercentAll(Enum.ModType.WeaponRange, Enum.SourceType.NONE);
|
||||
@@ -123,7 +123,7 @@ public class FinalCombatManager {
|
||||
if (target.getObjectType() == Enum.GameObjectType.Building)
|
||||
hitChance = 100;
|
||||
|
||||
int passiveAnim = getSwingAnimation(attacker.getCharItemManager().getEquipped().get(slot).template, null, true);
|
||||
int passiveAnim = getSwingAnimation(attacker.charItemManager.getEquipped().get(slot).template, null, true);
|
||||
|
||||
if(ThreadLocalRandom.current().nextInt(100) > hitChance) {
|
||||
TargetedActionMsg msg = new TargetedActionMsg(attacker, target, 0f, passiveAnim);
|
||||
@@ -161,13 +161,13 @@ public class FinalCombatManager {
|
||||
|
||||
//get the damage type
|
||||
Enum.SourceType damageType;
|
||||
if(attacker.getCharItemManager().getEquipped().get(slot) == null) {
|
||||
if(attacker.charItemManager.getEquipped().get(slot) == null) {
|
||||
damageType = Enum.SourceType.CRUSHING;
|
||||
if(attacker.getObjectType().equals(Enum.GameObjectType.Mob))
|
||||
if(((Mob)attacker).isSiege())
|
||||
damageType = Enum.SourceType.SIEGE;
|
||||
}else {
|
||||
damageType = (Enum.SourceType) attacker.getCharItemManager().getEquipped().get(slot).template.item_weapon_damage.keySet().toArray()[0];
|
||||
damageType = (Enum.SourceType) attacker.charItemManager.getEquipped().get(slot).template.item_weapon_damage.keySet().toArray()[0];
|
||||
}
|
||||
|
||||
//get resists
|
||||
|
||||
Reference in New Issue
Block a user