Initial refactor of damagetype
This commit is contained in:
+172
-107
@@ -724,118 +724,178 @@ public class Enum {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum DamageType {
|
||||||
|
None,
|
||||||
|
Crush,
|
||||||
|
Slash,
|
||||||
|
Siege,
|
||||||
|
Pierce,
|
||||||
|
Magic,
|
||||||
|
Bleed,
|
||||||
|
Poison,
|
||||||
|
Mental,
|
||||||
|
Holy,
|
||||||
|
Unholy,
|
||||||
|
Lightning,
|
||||||
|
Fire,
|
||||||
|
Cold,
|
||||||
|
Healing,
|
||||||
|
Acid,
|
||||||
|
Disease,
|
||||||
|
Unknown,
|
||||||
|
// these added for immunities
|
||||||
|
Attack,
|
||||||
|
Powers,
|
||||||
|
Combat,
|
||||||
|
Spires,
|
||||||
|
Snare,
|
||||||
|
Stun,
|
||||||
|
Blind,
|
||||||
|
Root,
|
||||||
|
Fear,
|
||||||
|
Charm,
|
||||||
|
PowerBlock,
|
||||||
|
DeBuff,
|
||||||
|
Powerblock,
|
||||||
|
Steel,
|
||||||
|
Drain;
|
||||||
|
|
||||||
|
public static DamageType GetDamageType(String modName) {
|
||||||
|
DamageType damageType;
|
||||||
|
if (modName.isEmpty())
|
||||||
|
return DamageType.None;
|
||||||
|
|
||||||
|
try {
|
||||||
|
damageType = DamageType.valueOf(modName.replace(",", ""));
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logger.error(e);
|
||||||
|
return DamageType.None;
|
||||||
|
}
|
||||||
|
return damageType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public enum SourceType {
|
public enum SourceType {
|
||||||
NONE,
|
None,
|
||||||
ABJURATION,
|
Abjuration,
|
||||||
ACID,
|
Acid,
|
||||||
ANTISIEGE,
|
AntiSiege,
|
||||||
ARCHERY,
|
Archery,
|
||||||
AXE,
|
Axe,
|
||||||
BARDSONG,
|
Bardsong,
|
||||||
BEASTCRAFT,
|
Beastcraft,
|
||||||
BENEDICTION,
|
Benediction,
|
||||||
BLADEWEAVING,
|
BladeWeaving,
|
||||||
BLEEDING,
|
Bleed,
|
||||||
BLIND,
|
Blind,
|
||||||
BLOCK,
|
Block,
|
||||||
BLOODCRAFT,
|
Bloodcraft,
|
||||||
BOW,
|
Bow,
|
||||||
BUFF,
|
Buff,
|
||||||
CHANNELING,
|
Channeling,
|
||||||
CHARM,
|
Charm,
|
||||||
|
Cold,
|
||||||
COLD,
|
COLD,
|
||||||
CONSTITUTION,
|
Constitution,
|
||||||
CORRUPTION,
|
Corruption,
|
||||||
CROSSBOW,
|
Crossbow,
|
||||||
CRUSHING,
|
Crush,
|
||||||
DAGGER,
|
Dagger,
|
||||||
DAGGERMASTERY,
|
DaggerMastery,
|
||||||
DEBUFF,
|
DeBuff,
|
||||||
DEXTERITY,
|
Dexterity,
|
||||||
DISEASE,
|
Disease,
|
||||||
DODGE,
|
Dodge,
|
||||||
DRAGON,
|
Dragon,
|
||||||
DRAIN,
|
Drain,
|
||||||
EARTH,
|
Earth,
|
||||||
EFFECT,
|
Effect,
|
||||||
EXORCISM,
|
Exorcism,
|
||||||
FEAR,
|
Fear,
|
||||||
|
Fire,
|
||||||
FIRE,
|
FIRE,
|
||||||
FLY,
|
Fly,
|
||||||
GIANT,
|
Giant,
|
||||||
GREATAXEMASTERY,
|
GreatAxeMastery,
|
||||||
GREATSWORDMASTERY,
|
GreatSwordMastery,
|
||||||
HAMMER,
|
Hammer,
|
||||||
HEALING,
|
Heal,
|
||||||
|
Healing,
|
||||||
|
Holy,
|
||||||
HOLY,
|
HOLY,
|
||||||
IMMUNETOATTACK,
|
ImmuneToAttack,
|
||||||
IMMUNETOPOWERS,
|
ImmuneToPowers,
|
||||||
INTELLIGENCE,
|
Intelligence,
|
||||||
INVISIBLE,
|
Invisible,
|
||||||
|
Lightning,
|
||||||
LIGHTNING,
|
LIGHTNING,
|
||||||
LITURGY,
|
Liturgy,
|
||||||
|
Magic,
|
||||||
MAGIC,
|
MAGIC,
|
||||||
|
Mental,
|
||||||
MENTAL,
|
MENTAL,
|
||||||
NATURELORE,
|
NatureLore,
|
||||||
NECROMANCY,
|
Necromancy,
|
||||||
PARRY,
|
Parry,
|
||||||
PIERCING,
|
Pierce,
|
||||||
|
Poison,
|
||||||
POISON,
|
POISON,
|
||||||
POLEARM,
|
PoleArm,
|
||||||
POWERBLOCK,
|
Powerblock,
|
||||||
RAT,
|
Rat,
|
||||||
RESISTDEBUFF,
|
ResistDeBuff,
|
||||||
RESTORATION,
|
Restoration,
|
||||||
ROOT,
|
Root,
|
||||||
SHADOWMASTERY,
|
Shadowmastery,
|
||||||
SIEGE,
|
Siege,
|
||||||
SLASHING,
|
Slash,
|
||||||
SNARE,
|
Snare,
|
||||||
SORCERY,
|
Sorcery,
|
||||||
SPEAR,
|
Spear,
|
||||||
SPEARMASTERY,
|
SpearMastery,
|
||||||
SPIRIT,
|
Spirit,
|
||||||
STAFF,
|
Staff,
|
||||||
STEAL,
|
Stormcalling,
|
||||||
STORMCALLING,
|
Strength,
|
||||||
STRENGTH,
|
Stun,
|
||||||
STUN,
|
Summon,
|
||||||
SUMMON,
|
Sword,
|
||||||
SWORD,
|
SwordMastery,
|
||||||
SWORDMASTERY,
|
Thaumaturgy,
|
||||||
THAUMATURGY,
|
Theurgy,
|
||||||
THEURGY,
|
Transform,
|
||||||
TRANSFORM,
|
UnarmedCombat,
|
||||||
UNARMEDCOMBAT,
|
UnarmedCombatMastery,
|
||||||
UNARMEDCOMBATMASTERY,
|
Unholy,
|
||||||
UNHOLY,
|
UNHOLY,
|
||||||
UNKNOWN,
|
Unknown,
|
||||||
WARDING,
|
Warding,
|
||||||
WARLOCKRY,
|
Warlockry,
|
||||||
WAYOFTHEGAANA,
|
WayoftheGaana,
|
||||||
WEARARMORHEAVY,
|
WearArmorHeavy,
|
||||||
WEARARMORLIGHT,
|
WearArmorLight,
|
||||||
WEARARMORMEDIUM,
|
WearArmorMedium,
|
||||||
WEREFORM,
|
Wereform,
|
||||||
ATHLETICS,
|
Athletics,
|
||||||
AXEMASTERY,
|
AxeMastery,
|
||||||
BARGAINING,
|
Bargaining,
|
||||||
BLADEMASTERY,
|
BladeMastery,
|
||||||
FLAMECALLING,
|
FlameCalling,
|
||||||
GREATHAMMERMASTERY,
|
GreatHammerMastery,
|
||||||
HAMMERMASTERY,
|
HammerMastery,
|
||||||
LEADERSHIP,
|
Leadership,
|
||||||
POLEARMMASTERY,
|
PoleArmMastery,
|
||||||
RUNNING,
|
Running,
|
||||||
STAFFMASTERY,
|
StaffMastery,
|
||||||
THROWING,
|
Throwing,
|
||||||
TOUGHNESS,
|
Toughness,
|
||||||
WAYOFTHEWOLF,
|
WayoftheWolf,
|
||||||
WAYOFTHERAT,
|
WayoftheRat,
|
||||||
WAYOFTHEBEAR,
|
WayoftheBear,
|
||||||
ORTHANATOS,
|
Orthanatos,
|
||||||
SUNDANCING,
|
SunDancing,
|
||||||
//POWER CATEGORIES.
|
//Power categories.
|
||||||
AE,
|
AE,
|
||||||
AEDAMAGE,
|
AEDAMAGE,
|
||||||
BEHAVIOR,
|
BEHAVIOR,
|
||||||
@@ -843,8 +903,10 @@ public class Enum {
|
|||||||
BOONCLASS,
|
BOONCLASS,
|
||||||
BOONRACE,
|
BOONRACE,
|
||||||
BREAKFLY,
|
BREAKFLY,
|
||||||
|
BUFF,
|
||||||
CHANT,
|
CHANT,
|
||||||
DAMAGE,
|
DAMAGE,
|
||||||
|
DEBUFF,
|
||||||
DISPEL,
|
DISPEL,
|
||||||
FLIGHT,
|
FLIGHT,
|
||||||
GROUPBUFF,
|
GROUPBUFF,
|
||||||
@@ -857,24 +919,27 @@ public class Enum {
|
|||||||
SPIREDISABLE,
|
SPIREDISABLE,
|
||||||
SPIREPROOFTELEPORT,
|
SPIREPROOFTELEPORT,
|
||||||
STANCE,
|
STANCE,
|
||||||
|
STUN,
|
||||||
|
SUMMON,
|
||||||
TELEPORT,
|
TELEPORT,
|
||||||
THIEF,
|
THIEF,
|
||||||
TRACK,
|
TRACK,
|
||||||
|
TRANSFORM,
|
||||||
VAMPDRAIN,
|
VAMPDRAIN,
|
||||||
WEAPON,
|
WEAPON,
|
||||||
WIZARDRY;
|
Wizardry;
|
||||||
|
|
||||||
public static SourceType GetSourceType(String modName) {
|
public static SourceType GetSourceType(String modName) {
|
||||||
SourceType returnMod;
|
SourceType returnMod;
|
||||||
if (modName.isEmpty())
|
if (modName.isEmpty())
|
||||||
return SourceType.NONE;
|
return SourceType.None;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
returnMod = SourceType.valueOf(modName.replace(",", "").toUpperCase());
|
returnMod = SourceType.valueOf(modName.replace(",", ""));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error(modName);
|
Logger.error(modName);
|
||||||
Logger.error(e);
|
Logger.error(e);
|
||||||
return SourceType.NONE;
|
return SourceType.None;
|
||||||
}
|
}
|
||||||
return returnMod;
|
return returnMod;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public enum ChatManager {
|
|||||||
|
|
||||||
PlayerBonuses bonus = pc.getBonuses();
|
PlayerBonuses bonus = pc.getBonuses();
|
||||||
|
|
||||||
if (bonus != null && bonus.getBool(ModType.Silenced, SourceType.NONE)) {
|
if (bonus != null && bonus.getBool(ModType.Silenced, SourceType.None)) {
|
||||||
ChatManager.chatSayError(pc, SILENCED);
|
ChatManager.chatSayError(pc, SILENCED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public enum CombatManager {
|
|||||||
case PlayerCharacter:
|
case PlayerCharacter:
|
||||||
case Mob:
|
case Mob:
|
||||||
PlayerBonuses bonuses = ((AbstractCharacter) target).getBonuses();
|
PlayerBonuses bonuses = ((AbstractCharacter) target).getBonuses();
|
||||||
if (bonuses != null && bonuses.getBool(Enum.ModType.ImmuneToAttack, Enum.SourceType.NONE))
|
if (bonuses != null && bonuses.getBool(Enum.ModType.ImmuneToAttack, Enum.SourceType.None))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case NPC:
|
case NPC:
|
||||||
@@ -90,7 +90,7 @@ public enum CombatManager {
|
|||||||
|
|
||||||
if (weapon != null) {
|
if (weapon != null) {
|
||||||
if (bonus != null)
|
if (bonus != null)
|
||||||
rangeMod += bonus.getFloatPercentAll(Enum.ModType.WeaponRange, Enum.SourceType.NONE);
|
rangeMod += bonus.getFloatPercentAll(Enum.ModType.WeaponRange, Enum.SourceType.None);
|
||||||
|
|
||||||
attackRange = weapon.template.item_weapon_max_range * rangeMod;
|
attackRange = weapon.template.item_weapon_max_range * rangeMod;
|
||||||
}
|
}
|
||||||
@@ -210,15 +210,15 @@ public enum CombatManager {
|
|||||||
|
|
||||||
//get the damage type
|
//get the damage type
|
||||||
|
|
||||||
Enum.SourceType damageType;
|
Enum.DamageType damageType;
|
||||||
|
|
||||||
if (attacker.charItemManager.getEquipped().get(slot) == null) {
|
if (attacker.charItemManager.getEquipped().get(slot) == null) {
|
||||||
damageType = Enum.SourceType.CRUSHING;
|
damageType = Enum.DamageType.Crush;
|
||||||
if (attacker.getObjectType().equals(Enum.GameObjectType.Mob))
|
if (attacker.getObjectType().equals(Enum.GameObjectType.Mob))
|
||||||
if (((Mob) attacker).isSiege())
|
if (((Mob) attacker).isSiege())
|
||||||
damageType = Enum.SourceType.SIEGE;
|
damageType = Enum.DamageType.Siege;
|
||||||
} else {
|
} else {
|
||||||
damageType = (Enum.SourceType) attacker.charItemManager.getEquipped().get(slot).template.item_weapon_damage.keySet().toArray()[0];
|
damageType = (Enum.DamageType) attacker.charItemManager.getEquipped().get(slot).template.item_weapon_damage.keySet().toArray()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
//get resists
|
//get resists
|
||||||
@@ -318,11 +318,11 @@ public enum CombatManager {
|
|||||||
|
|
||||||
int wepSpeed = (int) (weapon.template.item_weapon_wepspeed);
|
int wepSpeed = (int) (weapon.template.item_weapon_wepspeed);
|
||||||
|
|
||||||
if (weapon.getBonusPercent(Enum.ModType.WeaponSpeed, Enum.SourceType.NONE) != 0f) //add weapon speed bonus
|
if (weapon.getBonusPercent(Enum.ModType.WeaponSpeed, Enum.SourceType.None) != 0f) //add weapon speed bonus
|
||||||
wepSpeed *= (1 + weapon.getBonus(Enum.ModType.WeaponSpeed, Enum.SourceType.NONE));
|
wepSpeed *= (1 + weapon.getBonus(Enum.ModType.WeaponSpeed, Enum.SourceType.None));
|
||||||
|
|
||||||
if (attacker.getBonuses() != null && attacker.getBonuses().getFloatPercentAll(Enum.ModType.AttackDelay, Enum.SourceType.NONE) != 0f) //add effects speed bonus
|
if (attacker.getBonuses() != null && attacker.getBonuses().getFloatPercentAll(Enum.ModType.AttackDelay, Enum.SourceType.None) != 0f) //add effects speed bonus
|
||||||
wepSpeed *= (1 + attacker.getBonuses().getFloatPercentAll(Enum.ModType.AttackDelay, Enum.SourceType.NONE));
|
wepSpeed *= (1 + attacker.getBonuses().getFloatPercentAll(Enum.ModType.AttackDelay, Enum.SourceType.None));
|
||||||
|
|
||||||
if (wepSpeed < 10)
|
if (wepSpeed < 10)
|
||||||
wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects.
|
wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects.
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public enum MovementManager {
|
|||||||
toMove.setIsCasting(false);
|
toMove.setIsCasting(false);
|
||||||
toMove.setItemCasting(false);
|
toMove.setItemCasting(false);
|
||||||
|
|
||||||
if (toMove.getBonuses().getBool(ModType.Stunned, SourceType.NONE) || toMove.getBonuses().getBool(ModType.CannotMove, SourceType.NONE)) {
|
if (toMove.getBonuses().getBool(ModType.Stunned, SourceType.None) || toMove.getBonuses().getBool(ModType.CannotMove, SourceType.None)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -391,7 +391,7 @@ public enum MovementManager {
|
|||||||
|
|
||||||
//don't move if player is stunned or rooted
|
//don't move if player is stunned or rooted
|
||||||
PlayerBonuses bonus = member.getBonuses();
|
PlayerBonuses bonus = member.getBonuses();
|
||||||
if (bonus.getBool(ModType.Stunned, SourceType.NONE) || bonus.getBool(ModType.CannotMove, SourceType.NONE))
|
if (bonus.getBool(ModType.Stunned, SourceType.None) || bonus.getBool(ModType.CannotMove, SourceType.None))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
member.update();
|
member.update();
|
||||||
|
|||||||
@@ -433,9 +433,9 @@ public enum NPCManager {
|
|||||||
|
|
||||||
for (Item equipped : mob.charItemManager.equipped.values()) {
|
for (Item equipped : mob.charItemManager.equipped.values()) {
|
||||||
if (equipped.template.item_type.equals(Enum.ItemType.ARMOR)) {
|
if (equipped.template.item_type.equals(Enum.ItemType.ARMOR)) {
|
||||||
mob.resists.setResist(Enum.SourceType.SLASHING, mob.resists.getResist(Enum.SourceType.SLASHING, 0) + equipped.template.combat_attack_resist.get("SLASHING"));
|
mob.resists.setResist(Enum.DamageType.Slash, mob.resists.getResist(Enum.DamageType.Slash, 0) + equipped.template.combat_attack_resist.get("SLASHING"));
|
||||||
mob.resists.setResist(Enum.SourceType.CRUSHING, mob.resists.getResist(Enum.SourceType.CRUSHING, 0) + equipped.template.combat_attack_resist.get("CRUSHING"));
|
mob.resists.setResist(Enum.DamageType.Crush, mob.resists.getResist(Enum.DamageType.Crush, 0) + equipped.template.combat_attack_resist.get("CRUSHING"));
|
||||||
mob.resists.setResist(Enum.SourceType.PIERCING, mob.resists.getResist(Enum.SourceType.PIERCING, 0) + equipped.template.combat_attack_resist.get("PIERCING"));
|
mob.resists.setResist(Enum.DamageType.Pierce, mob.resists.getResist(Enum.DamageType.Pierce, 0) + equipped.template.combat_attack_resist.get("PIERCING"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ public enum PowersManager {
|
|||||||
// verify player is not stunned or prohibited from casting
|
// verify player is not stunned or prohibited from casting
|
||||||
PlayerBonuses bonus = playerCharacter.getBonuses();
|
PlayerBonuses bonus = playerCharacter.getBonuses();
|
||||||
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
||||||
if (bonus != null && (bonus.getBool(ModType.Stunned, SourceType.NONE) || bonus.getBool(ModType.CannotCast, SourceType.NONE) || bonus.getBool(ModType.BlockedPowerType, sourceType)))
|
if (bonus != null && (bonus.getBool(ModType.Stunned, SourceType.None) || bonus.getBool(ModType.CannotCast, SourceType.None) || bonus.getBool(ModType.BlockedPowerType, sourceType)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// if moving make sure spell valid for movement
|
// if moving make sure spell valid for movement
|
||||||
@@ -468,7 +468,7 @@ public enum PowersManager {
|
|||||||
cost = 0;
|
cost = 0;
|
||||||
|
|
||||||
if (bonus != null)
|
if (bonus != null)
|
||||||
cost *= (1 + bonus.getFloatPercentAll(ModType.PowerCost, SourceType.NONE));
|
cost *= (1 + bonus.getFloatPercentAll(ModType.PowerCost, SourceType.None));
|
||||||
|
|
||||||
if (playerCharacter.getAltitude() > 0)
|
if (playerCharacter.getAltitude() > 0)
|
||||||
cost *= 1.5f;
|
cost *= 1.5f;
|
||||||
@@ -615,7 +615,7 @@ public enum PowersManager {
|
|||||||
// verify player is not stunned or prohibited from casting
|
// verify player is not stunned or prohibited from casting
|
||||||
PlayerBonuses bonus = caster.getBonuses();
|
PlayerBonuses bonus = caster.getBonuses();
|
||||||
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
||||||
if (bonus != null && (bonus.getBool(ModType.Stunned, SourceType.NONE) || bonus.getBool(ModType.CannotCast, SourceType.NONE) || bonus.getBool(ModType.BlockedPowerType, sourceType)))
|
if (bonus != null && (bonus.getBool(ModType.Stunned, SourceType.None) || bonus.getBool(ModType.CannotCast, SourceType.None) || bonus.getBool(ModType.BlockedPowerType, sourceType)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// if moving make sure spell valid for movement
|
// if moving make sure spell valid for movement
|
||||||
@@ -775,7 +775,7 @@ public enum PowersManager {
|
|||||||
PlayerBonuses bonus = playerCharacter.getBonuses();
|
PlayerBonuses bonus = playerCharacter.getBonuses();
|
||||||
|
|
||||||
if (bonus != null) {
|
if (bonus != null) {
|
||||||
if (bonus.getBool(ModType.Stunned, SourceType.NONE))
|
if (bonus.getBool(ModType.Stunned, SourceType.None))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
||||||
@@ -1053,7 +1053,7 @@ public enum PowersManager {
|
|||||||
// verify player is not stunned or power type is blocked
|
// verify player is not stunned or power type is blocked
|
||||||
PlayerBonuses bonus = caster.getBonuses();
|
PlayerBonuses bonus = caster.getBonuses();
|
||||||
if (bonus != null) {
|
if (bonus != null) {
|
||||||
if (bonus.getBool(ModType.Stunned, SourceType.NONE))
|
if (bonus.getBool(ModType.Stunned, SourceType.None))
|
||||||
return;
|
return;
|
||||||
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
|
||||||
if (bonus.getBool(ModType.BlockedPowerType, sourceType))
|
if (bonus.getBool(ModType.BlockedPowerType, sourceType))
|
||||||
@@ -1688,7 +1688,7 @@ public enum PowersManager {
|
|||||||
PlayerCharacter pcc = (PlayerCharacter) awo;
|
PlayerCharacter pcc = (PlayerCharacter) awo;
|
||||||
PlayerBonuses bonuses = pcc.getBonuses();
|
PlayerBonuses bonuses = pcc.getBonuses();
|
||||||
|
|
||||||
if (bonuses != null && bonuses.getBool(ModType.ImmuneToPowers, SourceType.NONE)) {
|
if (bonuses != null && bonuses.getBool(ModType.ImmuneToPowers, SourceType.None)) {
|
||||||
awolist.remove();
|
awolist.remove();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1838,7 +1838,7 @@ public enum PowersManager {
|
|||||||
// Remove players who are in safe mode
|
// Remove players who are in safe mode
|
||||||
PlayerCharacter pcc = (PlayerCharacter) awo;
|
PlayerCharacter pcc = (PlayerCharacter) awo;
|
||||||
PlayerBonuses bonuses = pcc.getBonuses();
|
PlayerBonuses bonuses = pcc.getBonuses();
|
||||||
if (bonuses != null && bonuses.getBool(ModType.ImmuneToPowers, SourceType.NONE)) {
|
if (bonuses != null && bonuses.getBool(ModType.ImmuneToPowers, SourceType.None)) {
|
||||||
awolist.remove();
|
awolist.remove();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class ChantJob extends AbstractEffectJob {
|
|||||||
PowersManager.finishEffectTime(this.source, this.target, this.action, this.trains);
|
PowersManager.finishEffectTime(this.source, this.target, this.action, this.trains);
|
||||||
if (AbstractWorldObject.IsAbstractCharacter(source))
|
if (AbstractWorldObject.IsAbstractCharacter(source))
|
||||||
((AbstractCharacter) source).cancelLastChant();
|
((AbstractCharacter) source).cancelLastChant();
|
||||||
} else if (bonuses != null && bonuses.getBool(ModType.Silenced, SourceType.NONE)) {
|
} else if (bonuses != null && bonuses.getBool(ModType.Silenced, SourceType.None)) {
|
||||||
PowersManager.finishEffectTime(this.source, this.target, this.action, this.trains);
|
PowersManager.finishEffectTime(this.source, this.target, this.action, this.trains);
|
||||||
if (AbstractWorldObject.IsAbstractCharacter(source))
|
if (AbstractWorldObject.IsAbstractCharacter(source))
|
||||||
((AbstractCharacter) source).cancelLastChant();
|
((AbstractCharacter) source).cancelLastChant();
|
||||||
|
|||||||
@@ -947,7 +947,7 @@ public class MobAI {
|
|||||||
if (mob.isSit() && mob.getTimeStamp("HEALTHRECOVERED") < System.currentTimeMillis() + 3000)
|
if (mob.isSit() && mob.getTimeStamp("HEALTHRECOVERED") < System.currentTimeMillis() + 3000)
|
||||||
if (mob.getHealth() < mob.getHealthMax()) {
|
if (mob.getHealth() < mob.getHealthMax()) {
|
||||||
|
|
||||||
float recoveredHealth = mob.getHealthMax() * ((1 + mob.getBonuses().getFloatPercentAll(Enum.ModType.HealthRecoverRate, Enum.SourceType.NONE)) * 0.01f);
|
float recoveredHealth = mob.getHealthMax() * ((1 + mob.getBonuses().getFloatPercentAll(Enum.ModType.HealthRecoverRate, Enum.SourceType.None)) * 0.01f);
|
||||||
mob.setHealth(mob.getHealth() + recoveredHealth);
|
mob.setHealth(mob.getHealth() + recoveredHealth);
|
||||||
mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis());
|
mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis());
|
||||||
|
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ public class MovementUtilities {
|
|||||||
if (agent.getMobBase() != null && Enum.MobFlagType.SENTINEL.elementOf(agent.getMobBase().getFlags()))
|
if (agent.getMobBase() != null && Enum.MobFlagType.SENTINEL.elementOf(agent.getMobBase().getFlags()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return (agent.isAlive() && !agent.getBonuses().getBool(ModType.Stunned, SourceType.NONE) && !agent.getBonuses().getBool(ModType.CannotMove, SourceType.NONE));
|
return (agent.isAlive() && !agent.getBonuses().getBool(ModType.Stunned, SourceType.None) && !agent.getBonuses().getBool(ModType.CannotMove, SourceType.None));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Vector3fImmutable randomPatrolLocation(Mob agent, Vector3fImmutable center, float radius) {
|
public static Vector3fImmutable randomPatrolLocation(Mob agent, Vector3fImmutable center, float radius) {
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class RepairMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
//account for durability modifications
|
//account for durability modifications
|
||||||
|
|
||||||
float durMod = toRepair.getBonusPercent(Enum.ModType.Durability, Enum.SourceType.NONE);
|
float durMod = toRepair.getBonusPercent(Enum.ModType.Durability, Enum.SourceType.None);
|
||||||
max *= (1 + (durMod * 0.01f));
|
max *= (1 + (durMod * 0.01f));
|
||||||
|
|
||||||
if (dur >= max || dur < 1) {
|
if (dur >= max || dur < 1) {
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ public class TrackWindowMsgHandler extends AbstractClientMsgHandler {
|
|||||||
else if (awo.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
else if (awo.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||||
PlayerBonuses bonus = ((PlayerCharacter) awo).getBonuses();
|
PlayerBonuses bonus = ((PlayerCharacter) awo).getBonuses();
|
||||||
|
|
||||||
if (bonus != null && bonus.getBool(Enum.ModType.CannotTrack, Enum.SourceType.NONE))
|
if (bonus != null && bonus.getBool(Enum.ModType.CannotTrack, Enum.SourceType.None))
|
||||||
it.remove();
|
it.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -529,7 +529,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
boolean canFly = false;
|
boolean canFly = false;
|
||||||
PlayerBonuses bonus = flyer.getBonuses();
|
PlayerBonuses bonus = flyer.getBonuses();
|
||||||
|
|
||||||
if (bonus != null && !bonus.getBool(ModType.NoMod, SourceType.FLY) && bonus.getBool(ModType.Fly, SourceType.NONE) && flyer.isAlive())
|
if (bonus != null && !bonus.getBool(ModType.NoMod, SourceType.Fly) && bonus.getBool(ModType.Fly, SourceType.None) && flyer.isAlive())
|
||||||
canFly = true;
|
canFly = true;
|
||||||
|
|
||||||
return canFly;
|
return canFly;
|
||||||
@@ -615,10 +615,10 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
|
|
||||||
if (abstractCharacter.bonuses != null) {
|
if (abstractCharacter.bonuses != null) {
|
||||||
// add any bonuses
|
// add any bonuses
|
||||||
defense += (short) abstractCharacter.bonuses.getFloat(ModType.DCV, SourceType.NONE);
|
defense += (short) abstractCharacter.bonuses.getFloat(ModType.DCV, SourceType.None);
|
||||||
|
|
||||||
// Finally multiply any percent modifiers. DO THIS LAST!
|
// Finally multiply any percent modifiers. DO THIS LAST!
|
||||||
float pos_Bonus = abstractCharacter.bonuses.getFloatPercentPositive(ModType.DCV, SourceType.NONE);
|
float pos_Bonus = abstractCharacter.bonuses.getFloatPercentPositive(ModType.DCV, SourceType.None);
|
||||||
defense = (short) (defense * (1 + pos_Bonus));
|
defense = (short) (defense * (1 + pos_Bonus));
|
||||||
|
|
||||||
//Lucky rune applies next
|
//Lucky rune applies next
|
||||||
@@ -627,7 +627,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
|
|
||||||
//and negative percent modifiers
|
//and negative percent modifiers
|
||||||
//already done...
|
//already done...
|
||||||
float neg_Bonus = abstractCharacter.bonuses.getFloatPercentNegative(ModType.DCV, SourceType.NONE);
|
float neg_Bonus = abstractCharacter.bonuses.getFloatPercentNegative(ModType.DCV, SourceType.None);
|
||||||
defense = (short) (defense * (1 + neg_Bonus));
|
defense = (short) (defense * (1 + neg_Bonus));
|
||||||
|
|
||||||
} else
|
} else
|
||||||
@@ -729,7 +729,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
abstractCharacter.rangeHandTwo = weapon.template.item_weapon_max_range * (1 + (abstractCharacter.statStrBase / 600));
|
abstractCharacter.rangeHandTwo = weapon.template.item_weapon_max_range * (1 + (abstractCharacter.statStrBase / 600));
|
||||||
|
|
||||||
if (abstractCharacter.bonuses != null) {
|
if (abstractCharacter.bonuses != null) {
|
||||||
float range_bonus = 1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponRange, SourceType.NONE);
|
float range_bonus = 1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponRange, SourceType.None);
|
||||||
|
|
||||||
if (mainHand)
|
if (mainHand)
|
||||||
abstractCharacter.rangeHandOne *= range_bonus;
|
abstractCharacter.rangeHandOne *= range_bonus;
|
||||||
@@ -773,10 +773,10 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
// add in any bonuses to atr
|
// add in any bonuses to atr
|
||||||
if (abstractCharacter.bonuses != null) {
|
if (abstractCharacter.bonuses != null) {
|
||||||
// Add any base bonuses
|
// Add any base bonuses
|
||||||
atr += abstractCharacter.bonuses.getFloat(ModType.OCV, SourceType.NONE);
|
atr += abstractCharacter.bonuses.getFloat(ModType.OCV, SourceType.None);
|
||||||
|
|
||||||
// Finally use any multipliers. DO THIS LAST!
|
// Finally use any multipliers. DO THIS LAST!
|
||||||
float pos_Bonus = (1 + abstractCharacter.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.NONE));
|
float pos_Bonus = (1 + abstractCharacter.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.None));
|
||||||
atr *= pos_Bonus;
|
atr *= pos_Bonus;
|
||||||
|
|
||||||
// next precise
|
// next precise
|
||||||
@@ -784,7 +784,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
// atr *= (1 + ((float) this.bonuses.getShort("rune.Attack") / 100));
|
// atr *= (1 + ((float) this.bonuses.getShort("rune.Attack") / 100));
|
||||||
|
|
||||||
//and negative percent modifiers
|
//and negative percent modifiers
|
||||||
float neg_Bonus = abstractCharacter.bonuses.getFloatPercentNegative(ModType.OCV, SourceType.NONE);
|
float neg_Bonus = abstractCharacter.bonuses.getFloatPercentNegative(ModType.OCV, SourceType.None);
|
||||||
|
|
||||||
atr *= (1 + neg_Bonus);
|
atr *= (1 + neg_Bonus);
|
||||||
}
|
}
|
||||||
@@ -804,9 +804,9 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
else
|
else
|
||||||
speed = 20f; //unarmed attack speed
|
speed = 20f; //unarmed attack speed
|
||||||
if (weapon != null)
|
if (weapon != null)
|
||||||
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.NONE));
|
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.None));
|
||||||
|
|
||||||
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.NONE));
|
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.None));
|
||||||
|
|
||||||
if (speed < 10)
|
if (speed < 10)
|
||||||
speed = 10;
|
speed = 10;
|
||||||
@@ -815,22 +815,22 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
if (weapon != null) {
|
if (weapon != null) {
|
||||||
// Add any base bonuses
|
// Add any base bonuses
|
||||||
|
|
||||||
min += weapon.getBonus(ModType.MinDamage, SourceType.NONE);
|
min += weapon.getBonus(ModType.MinDamage, SourceType.None);
|
||||||
max += weapon.getBonus(ModType.MaxDamage, SourceType.NONE);
|
max += weapon.getBonus(ModType.MaxDamage, SourceType.None);
|
||||||
|
|
||||||
min += weapon.getBonus(ModType.MeleeDamageModifier, SourceType.NONE);
|
min += weapon.getBonus(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
max += weapon.getBonus(ModType.MeleeDamageModifier, SourceType.NONE);
|
max += weapon.getBonus(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
|
|
||||||
// Finally use any multipliers. DO THIS LAST!
|
// Finally use any multipliers. DO THIS LAST!
|
||||||
|
|
||||||
float percentMinDamage = 1;
|
float percentMinDamage = 1;
|
||||||
float percentMaxDamage = 1;
|
float percentMaxDamage = 1;
|
||||||
|
|
||||||
percentMinDamage += weapon.getBonusPercent(ModType.MinDamage, SourceType.NONE);
|
percentMinDamage += weapon.getBonusPercent(ModType.MinDamage, SourceType.None);
|
||||||
percentMinDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, SourceType.NONE);
|
percentMinDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
|
|
||||||
percentMaxDamage += weapon.getBonusPercent(ModType.MaxDamage, SourceType.NONE);
|
percentMaxDamage += weapon.getBonusPercent(ModType.MaxDamage, SourceType.None);
|
||||||
percentMaxDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, SourceType.NONE);
|
percentMaxDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
|
|
||||||
|
|
||||||
min *= percentMinDamage;
|
min *= percentMinDamage;
|
||||||
@@ -867,21 +867,21 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
// add in any bonuses to damage
|
// add in any bonuses to damage
|
||||||
if (abstractCharacter.bonuses != null) {
|
if (abstractCharacter.bonuses != null) {
|
||||||
// Add any base bonuses
|
// Add any base bonuses
|
||||||
minDamage += abstractCharacter.bonuses.getFloat(ModType.MinDamage, SourceType.NONE);
|
minDamage += abstractCharacter.bonuses.getFloat(ModType.MinDamage, SourceType.None);
|
||||||
maxDamage += abstractCharacter.bonuses.getFloat(ModType.MaxDamage, SourceType.NONE);
|
maxDamage += abstractCharacter.bonuses.getFloat(ModType.MaxDamage, SourceType.None);
|
||||||
|
|
||||||
minDamage += abstractCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.NONE);
|
minDamage += abstractCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
maxDamage += abstractCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.NONE);
|
maxDamage += abstractCharacter.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
// Finally use any multipliers. DO THIS LAST!
|
// Finally use any multipliers. DO THIS LAST!
|
||||||
|
|
||||||
float percentMinDamage = 1;
|
float percentMinDamage = 1;
|
||||||
float percentMaxDamage = 1;
|
float percentMaxDamage = 1;
|
||||||
|
|
||||||
percentMinDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.NONE);
|
percentMinDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.None);
|
||||||
percentMinDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.NONE);
|
percentMinDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
|
|
||||||
percentMaxDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.NONE);
|
percentMaxDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.None);
|
||||||
percentMaxDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.NONE);
|
percentMaxDamage += abstractCharacter.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
||||||
|
|
||||||
minDamage *= percentMinDamage;
|
minDamage *= percentMinDamage;
|
||||||
maxDamage *= percentMaxDamage;
|
maxDamage *= percentMaxDamage;
|
||||||
@@ -930,8 +930,8 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
//apply item defense bonuses
|
//apply item defense bonuses
|
||||||
|
|
||||||
if (shield != null) {
|
if (shield != null) {
|
||||||
def += shield.getBonus(ModType.DR, SourceType.NONE);
|
def += shield.getBonus(ModType.DR, SourceType.None);
|
||||||
def *= (1 + shield.getBonusPercent(ModType.DR, SourceType.NONE));
|
def *= (1 + shield.getBonusPercent(ModType.DR, SourceType.None));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -974,8 +974,8 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
//apply item defense bonuses
|
//apply item defense bonuses
|
||||||
|
|
||||||
if (armor != null) {
|
if (armor != null) {
|
||||||
def += armor.getBonus(ModType.DR, SourceType.NONE);
|
def += armor.getBonus(ModType.DR, SourceType.None);
|
||||||
def *= (1 + armor.getBonusPercent(ModType.DR, SourceType.NONE));
|
def *= (1 + armor.getBonusPercent(ModType.DR, SourceType.None));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (def * (1 + ((int) armorSkill.getModifiedAmount() / 50f)));
|
return (def * (1 + ((int) armorSkill.getModifiedAmount() / 50f)));
|
||||||
@@ -2176,7 +2176,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
PowersManager.cancelOnTakeDamage(this);
|
PowersManager.cancelOnTakeDamage(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void cancelOnTakeDamage(final SourceType type, final float amount) {
|
public final void cancelOnTakeDamage(final DamageType type, final float amount) {
|
||||||
boolean changed = false;
|
boolean changed = false;
|
||||||
for (String s : this.effects.keySet()) {
|
for (String s : this.effects.keySet()) {
|
||||||
Effect eff = this.effects.get(s);
|
Effect eff = this.effects.get(s);
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter {
|
|||||||
float ret = MobAIThread.AI_BASE_AGGRO_RANGE;
|
float ret = MobAIThread.AI_BASE_AGGRO_RANGE;
|
||||||
|
|
||||||
if (this.bonuses != null)
|
if (this.bonuses != null)
|
||||||
ret *= (1 + this.bonuses.getFloatPercentAll(ModType.ScanRange, SourceType.NONE));
|
ret *= (1 + this.bonuses.getFloatPercentAll(ModType.ScanRange, SourceType.None));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -306,12 +306,12 @@ public class CharacterSkill extends AbstractGameObject {
|
|||||||
PlayerBonuses bonus = ac.getBonuses();
|
PlayerBonuses bonus = ac.getBonuses();
|
||||||
if (bonus == null)
|
if (bonus == null)
|
||||||
return atr;
|
return atr;
|
||||||
atr += bonus.getFloat(ModType.OCV, SourceType.NONE);
|
atr += bonus.getFloat(ModType.OCV, SourceType.None);
|
||||||
float pos_Bonus = bonus.getFloatPercentPositive(ModType.OCV, SourceType.NONE);
|
float pos_Bonus = bonus.getFloatPercentPositive(ModType.OCV, SourceType.None);
|
||||||
atr *= (1 + pos_Bonus);
|
atr *= (1 + pos_Bonus);
|
||||||
//rUNES will already be applied
|
//rUNES will already be applied
|
||||||
// atr *= (1 + ((float)bonus.getShort("rune.Attack") / 100)); //precise
|
// atr *= (1 + ((float)bonus.getShort("rune.Attack") / 100)); //precise
|
||||||
float neg_Bonus = bonus.getFloatPercentNegative(ModType.OCV, SourceType.NONE);
|
float neg_Bonus = bonus.getFloatPercentNegative(ModType.OCV, SourceType.None);
|
||||||
atr *= (1 + neg_Bonus);
|
atr *= (1 + neg_Bonus);
|
||||||
return atr;
|
return atr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -592,7 +592,7 @@ public class Effect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Used for verifying when damage absorbers fails
|
//Used for verifying when damage absorbers fails
|
||||||
public boolean cancelOnTakeDamage(Enum.SourceType type, float amount) {
|
public boolean cancelOnTakeDamage(Enum.DamageType type, float amount) {
|
||||||
if (!this.eb.cancelOnTakeDamage())
|
if (!this.eb.cancelOnTakeDamage())
|
||||||
return false;
|
return false;
|
||||||
if (this.eb == null || amount < 0f)
|
if (this.eb == null || amount < 0f)
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class ItemTemplate {
|
|||||||
public int item_weapon_projectile_id;
|
public int item_weapon_projectile_id;
|
||||||
public float item_weapon_projectile_speed;
|
public float item_weapon_projectile_speed;
|
||||||
public int item_weapon_combat_idle_anim;
|
public int item_weapon_combat_idle_anim;
|
||||||
public HashMap<Enum.SourceType, int[]> item_weapon_damage = new HashMap<>();
|
public HashMap<Enum.DamageType, int[]> item_weapon_damage = new HashMap<>();
|
||||||
public ArrayList<int[]> weapon_attack_anim_right = new ArrayList();
|
public ArrayList<int[]> weapon_attack_anim_right = new ArrayList();
|
||||||
public ArrayList<int[]> weapon_attack_anim_left = new ArrayList();
|
public ArrayList<int[]> weapon_attack_anim_left = new ArrayList();
|
||||||
public Enum.AttributeType item_primary_attr = Enum.AttributeType.None;
|
public Enum.AttributeType item_primary_attr = Enum.AttributeType.None;
|
||||||
@@ -227,11 +227,11 @@ public class ItemTemplate {
|
|||||||
if (weapon_damage.isEmpty() == false)
|
if (weapon_damage.isEmpty() == false)
|
||||||
for (Object o : weapon_damage) {
|
for (Object o : weapon_damage) {
|
||||||
JSONObject damage_entry = (JSONObject) o;
|
JSONObject damage_entry = (JSONObject) o;
|
||||||
Enum.SourceType sourceType = Enum.SourceType.valueOf(((String) damage_entry.get("damage_type")).toUpperCase());
|
Enum.DamageType damageType = Enum.DamageType.valueOf(((String) damage_entry.get("damage_type")));
|
||||||
int min = ((Long) damage_entry.get("damage_min")).intValue();
|
int min = ((Long) damage_entry.get("damage_min")).intValue();
|
||||||
int max = ((Long) damage_entry.get("damage_max")).intValue();
|
int max = ((Long) damage_entry.get("damage_max")).intValue();
|
||||||
int[] minMax = {min, max};
|
int[] minMax = {min, max};
|
||||||
item_weapon_damage.put(sourceType, minMax);
|
item_weapon_damage.put(damageType, minMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONArray attack_anim_right = (JSONArray) item_weapon.get("weapon_attack_anim_right");
|
JSONArray attack_anim_right = (JSONArray) item_weapon.get("weapon_attack_anim_right");
|
||||||
|
|||||||
+18
-18
@@ -710,19 +710,19 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
|||||||
// TODO modify for equipment
|
// TODO modify for equipment
|
||||||
if (this.bonuses != null) {
|
if (this.bonuses != null) {
|
||||||
// modify for effects
|
// modify for effects
|
||||||
strVal += this.bonuses.getFloat(ModType.Attr, SourceType.STRENGTH);
|
strVal += this.bonuses.getFloat(ModType.Attr, SourceType.Strength);
|
||||||
dexVal += this.bonuses.getFloat(ModType.Attr, SourceType.DEXTERITY);
|
dexVal += this.bonuses.getFloat(ModType.Attr, SourceType.Dexterity);
|
||||||
conVal += this.bonuses.getFloat(ModType.Attr, SourceType.CONSTITUTION);
|
conVal += this.bonuses.getFloat(ModType.Attr, SourceType.Constitution);
|
||||||
intVal += this.bonuses.getFloat(ModType.Attr, SourceType.INTELLIGENCE);
|
intVal += this.bonuses.getFloat(ModType.Attr, SourceType.Intelligence);
|
||||||
spiVal += this.bonuses.getFloat(ModType.Attr, SourceType.SPIRIT);
|
spiVal += this.bonuses.getFloat(ModType.Attr, SourceType.Spirit);
|
||||||
|
|
||||||
// apply dex penalty for armor
|
// apply dex penalty for armor
|
||||||
// modify percent amounts. DO THIS LAST!
|
// modify percent amounts. DO THIS LAST!
|
||||||
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.STRENGTH));
|
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Strength));
|
||||||
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.DEXTERITY));
|
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity));
|
||||||
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.CONSTITUTION));
|
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution));
|
||||||
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.INTELLIGENCE));
|
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence));
|
||||||
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.SPIRIT));
|
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set current stats
|
// Set current stats
|
||||||
@@ -739,7 +739,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
|||||||
float bonus = 1;
|
float bonus = 1;
|
||||||
if (this.bonuses != null)
|
if (this.bonuses != null)
|
||||||
// get rune and effect bonuses
|
// get rune and effect bonuses
|
||||||
bonus *= (1 + this.bonuses.getFloatPercentAll(ModType.Speed, SourceType.NONE));
|
bonus *= (1 + this.bonuses.getFloatPercentAll(ModType.Speed, SourceType.None));
|
||||||
|
|
||||||
if (this.isPlayerGuard())
|
if (this.isPlayerGuard())
|
||||||
switch (this.mobBase.getLoadID()) {
|
switch (this.mobBase.getLoadID()) {
|
||||||
@@ -836,7 +836,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
|||||||
if (!this.isMoving())
|
if (!this.isMoving())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (this.isAlive() == false || this.getBonuses().getBool(ModType.Stunned, SourceType.NONE) || this.getBonuses().getBool(ModType.CannotMove, SourceType.NONE)) {
|
if (this.isAlive() == false || this.getBonuses().getBool(ModType.Stunned, SourceType.None) || this.getBonuses().getBool(ModType.CannotMove, SourceType.None)) {
|
||||||
//Target is stunned or rooted. Don't move
|
//Target is stunned or rooted. Don't move
|
||||||
|
|
||||||
this.stopMovement(this.getMovementLoc());
|
this.stopMovement(this.getMovementLoc());
|
||||||
@@ -1072,15 +1072,15 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
|||||||
// Apply any bonuses from runes and effects
|
// Apply any bonuses from runes and effects
|
||||||
|
|
||||||
if (this.bonuses != null) {
|
if (this.bonuses != null) {
|
||||||
h += this.bonuses.getFloat(ModType.HealthFull, SourceType.NONE);
|
h += this.bonuses.getFloat(ModType.HealthFull, SourceType.None);
|
||||||
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.NONE);
|
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.None);
|
||||||
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.NONE);
|
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.None);
|
||||||
|
|
||||||
//apply effects percent modifiers. DO THIS LAST!
|
//apply effects percent modifiers. DO THIS LAST!
|
||||||
|
|
||||||
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.NONE));
|
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None));
|
||||||
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.NONE));
|
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None));
|
||||||
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.NONE));
|
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set max health, mana and stamina
|
// Set max health, mana and stamina
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ public class PlayerBonuses {
|
|||||||
|
|
||||||
//Update seeInvis if needed
|
//Update seeInvis if needed
|
||||||
|
|
||||||
float seeInvis = this.getFloat(ModType.SeeInvisible, SourceType.NONE);
|
float seeInvis = this.getFloat(ModType.SeeInvisible, SourceType.None);
|
||||||
if (pc.getSeeInvis() < seeInvis)
|
if (pc.getSeeInvis() < seeInvis)
|
||||||
pc.setSeeInvis((short) seeInvis);
|
pc.setSeeInvis((short) seeInvis);
|
||||||
|
|
||||||
@@ -458,13 +458,13 @@ public class PlayerBonuses {
|
|||||||
float percentAmountNegative = this.getFloatPercentNegative(modType, sourceType);
|
float percentAmountNegative = this.getFloatPercentNegative(modType, sourceType);
|
||||||
|
|
||||||
if (amount != 0)
|
if (amount != 0)
|
||||||
ChatManager.chatSystemInfo(pc, modType.name() + "-" + (sourceType.equals(SourceType.NONE) == false ? sourceType.name() : "") + " = " + amount);
|
ChatManager.chatSystemInfo(pc, modType.name() + "-" + (sourceType.equals(SourceType.None) == false ? sourceType.name() : "") + " = " + amount);
|
||||||
|
|
||||||
if (percentAmount != 0)
|
if (percentAmount != 0)
|
||||||
ChatManager.chatSystemInfo(pc, "Percent : " + modType.name() + "-" + (sourceType.equals(SourceType.NONE) == false ? sourceType.name() : "") + " = " + percentAmount);
|
ChatManager.chatSystemInfo(pc, "Percent : " + modType.name() + "-" + (sourceType.equals(SourceType.None) == false ? sourceType.name() : "") + " = " + percentAmount);
|
||||||
|
|
||||||
if (percentAmountNegative != 0)
|
if (percentAmountNegative != 0)
|
||||||
ChatManager.chatSystemInfo(pc, "Negative Percent : " + modType.name() + "-" + (sourceType.equals(SourceType.NONE) == false ? sourceType.name() : "") + " = " + percentAmountNegative);
|
ChatManager.chatSystemInfo(pc, "Negative Percent : " + modType.name() + "-" + (sourceType.equals(SourceType.None) == false ? sourceType.name() : "") + " = " + percentAmountNegative);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3091,7 +3091,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
|
|
||||||
if (this.bonuses != null)
|
if (this.bonuses != null)
|
||||||
// get rune and effect bonuses
|
// get rune and effect bonuses
|
||||||
bonus += this.bonuses.getFloatPercentNullZero(ModType.Speed, SourceType.NONE);
|
bonus += this.bonuses.getFloatPercentNullZero(ModType.Speed, SourceType.None);
|
||||||
|
|
||||||
// TODO get equip bonus
|
// TODO get equip bonus
|
||||||
this.update();
|
this.update();
|
||||||
@@ -3595,8 +3595,8 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
//calculateModifiedStats();
|
//calculateModifiedStats();
|
||||||
//update hide and seeInvis levels
|
//update hide and seeInvis levels
|
||||||
if (this.bonuses != null) {
|
if (this.bonuses != null) {
|
||||||
this.hidden = (int) bonuses.getFloat(ModType.Invisible, SourceType.NONE);
|
this.hidden = (int) bonuses.getFloat(ModType.Invisible, SourceType.None);
|
||||||
this.seeInvis = (int) bonuses.getFloat(ModType.SeeInvisible, SourceType.NONE);
|
this.seeInvis = (int) bonuses.getFloat(ModType.SeeInvisible, SourceType.None);
|
||||||
} else {
|
} else {
|
||||||
this.hidden = (byte) 0;
|
this.hidden = (byte) 0;
|
||||||
this.seeInvis = (byte) 0;
|
this.seeInvis = (byte) 0;
|
||||||
@@ -3664,21 +3664,21 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
// TODO modify for equipment
|
// TODO modify for equipment
|
||||||
if (this.bonuses != null) {
|
if (this.bonuses != null) {
|
||||||
// modify for effects
|
// modify for effects
|
||||||
strVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.STRENGTH));
|
strVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Strength));
|
||||||
dexVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.DEXTERITY));
|
dexVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Dexterity));
|
||||||
conVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.CONSTITUTION));
|
conVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Constitution));
|
||||||
intVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.INTELLIGENCE));
|
intVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Intelligence));
|
||||||
spiVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.SPIRIT));
|
spiVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Spirit));
|
||||||
|
|
||||||
// apply dex penalty for armor
|
// apply dex penalty for armor
|
||||||
dexVal *= this.dexPenalty;
|
dexVal *= this.dexPenalty;
|
||||||
|
|
||||||
// modify percent amounts. DO THIS LAST!
|
// modify percent amounts. DO THIS LAST!
|
||||||
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.STRENGTH));
|
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Strength));
|
||||||
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.DEXTERITY));
|
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity));
|
||||||
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.CONSTITUTION));
|
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution));
|
||||||
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.INTELLIGENCE));
|
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence));
|
||||||
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.SPIRIT));
|
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit));
|
||||||
|
|
||||||
} else
|
} else
|
||||||
// apply dex penalty for armor
|
// apply dex penalty for armor
|
||||||
@@ -3774,24 +3774,24 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
wbOff = off.template;
|
wbOff = off.template;
|
||||||
|
|
||||||
//set block if block found
|
//set block if block found
|
||||||
this.bonuses.setBool(ModType.Block, SourceType.NONE, false);
|
this.bonuses.setBool(ModType.Block, SourceType.None, false);
|
||||||
if (this.baseClass != null && (this.baseClass.getObjectUUID() == 2500 || this.baseClass.getObjectUUID() == 2501))
|
if (this.baseClass != null && (this.baseClass.getObjectUUID() == 2500 || this.baseClass.getObjectUUID() == 2501))
|
||||||
if (off != null && off.template != null && ItemTemplate.isShield(off))
|
if (off != null && off.template != null && ItemTemplate.isShield(off))
|
||||||
this.bonuses.setBool(ModType.Block, SourceType.NONE, true);
|
this.bonuses.setBool(ModType.Block, SourceType.None, true);
|
||||||
|
|
||||||
//set dodge if rogue
|
//set dodge if rogue
|
||||||
if (this.baseClass != null && this.baseClass.getObjectUUID() == 2502)
|
if (this.baseClass != null && this.baseClass.getObjectUUID() == 2502)
|
||||||
this.bonuses.setBool(ModType.Dodge, SourceType.NONE, true);
|
this.bonuses.setBool(ModType.Dodge, SourceType.None, true);
|
||||||
else
|
else
|
||||||
this.bonuses.setBool(ModType.Dodge, SourceType.NONE, false);
|
this.bonuses.setBool(ModType.Dodge, SourceType.None, false);
|
||||||
|
|
||||||
//set parry if fighter or thief and no invalid weapon found
|
//set parry if fighter or thief and no invalid weapon found
|
||||||
this.bonuses.setBool(ModType.Parry, SourceType.NONE, false);
|
this.bonuses.setBool(ModType.Parry, SourceType.None, false);
|
||||||
if ((this.baseClass != null && this.baseClass.getObjectUUID() == 2500)
|
if ((this.baseClass != null && this.baseClass.getObjectUUID() == 2500)
|
||||||
|| (this.promotionClass != null && this.promotionClass.getObjectUUID() == 2520))
|
|| (this.promotionClass != null && this.promotionClass.getObjectUUID() == 2520))
|
||||||
if (wbMain == null || wbMain.item_weapon_max_range < MBServerStatics.RANGED_WEAPON_RANGE)
|
if (wbMain == null || wbMain.item_weapon_max_range < MBServerStatics.RANGED_WEAPON_RANGE)
|
||||||
if (wbOff == null || wbOff.item_weapon_max_range < MBServerStatics.RANGED_WEAPON_RANGE)
|
if (wbOff == null || wbOff.item_weapon_max_range < MBServerStatics.RANGED_WEAPON_RANGE)
|
||||||
this.bonuses.setBool(ModType.Parry, SourceType.NONE, true);
|
this.bonuses.setBool(ModType.Parry, SourceType.None, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3890,13 +3890,13 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
|
|
||||||
|
|
||||||
//apply effects
|
//apply effects
|
||||||
h += this.bonuses.getFloat(ModType.HealthFull, SourceType.NONE);
|
h += this.bonuses.getFloat(ModType.HealthFull, SourceType.None);
|
||||||
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.NONE);
|
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.None);
|
||||||
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.NONE);
|
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.None);
|
||||||
|
|
||||||
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.NONE));
|
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None));
|
||||||
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.NONE));
|
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None));
|
||||||
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.NONE));
|
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3931,11 +3931,11 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
ModType modType = ModType.GetModType(type);
|
ModType modType = ModType.GetModType(type);
|
||||||
|
|
||||||
// must be allowed to use this passive
|
// must be allowed to use this passive
|
||||||
if (!this.bonuses.getBool(modType, SourceType.NONE))
|
if (!this.bonuses.getBool(modType, SourceType.None))
|
||||||
return 0f;
|
return 0f;
|
||||||
|
|
||||||
// must not be stunned
|
// must not be stunned
|
||||||
if (this.bonuses.getBool(ModType.Stunned, SourceType.NONE))
|
if (this.bonuses.getBool(ModType.Stunned, SourceType.None))
|
||||||
return 0f;
|
return 0f;
|
||||||
|
|
||||||
// Get base skill amount
|
// Get base skill amount
|
||||||
@@ -3947,7 +3947,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
amount = sk.getModifiedAmount();
|
amount = sk.getModifiedAmount();
|
||||||
|
|
||||||
// Add bonuses
|
// Add bonuses
|
||||||
amount += this.bonuses.getFloat(modType, SourceType.NONE);
|
amount += this.bonuses.getFloat(modType, SourceType.None);
|
||||||
|
|
||||||
// Add item bonuses and return
|
// Add item bonuses and return
|
||||||
if (type.equals(ModType.Dodge) && !fromCombat)
|
if (type.equals(ModType.Dodge) && !fromCombat)
|
||||||
@@ -4381,7 +4381,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
|
|
||||||
Vector3fImmutable newLoc = this.getMovementLoc();
|
Vector3fImmutable newLoc = this.getMovementLoc();
|
||||||
|
|
||||||
if (this.isAlive() == false || this.getBonuses().getBool(ModType.Stunned, SourceType.NONE) || this.getBonuses().getBool(ModType.CannotMove, SourceType.NONE)) {
|
if (this.isAlive() == false || this.getBonuses().getBool(ModType.Stunned, SourceType.None) || this.getBonuses().getBool(ModType.CannotMove, SourceType.None)) {
|
||||||
//Target is stunned or rooted. Don't move
|
//Target is stunned or rooted. Don't move
|
||||||
this.stopMovement(newLoc);
|
this.stopMovement(newLoc);
|
||||||
return;
|
return;
|
||||||
|
|||||||
+125
-124
@@ -26,9 +26,9 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
public class Resists {
|
public class Resists {
|
||||||
|
|
||||||
private static ConcurrentHashMap<Integer, Resists> mobResists = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
private static ConcurrentHashMap<Integer, Resists> mobResists = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||||
private ConcurrentHashMap<SourceType, Float> resists = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
private ConcurrentHashMap<Enum.DamageType, Float> resists = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||||
private ConcurrentHashMap<SourceType, Boolean> immuneTo = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
private ConcurrentHashMap<Enum.DamageType, Boolean> immuneTo = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||||
private SourceType protection;
|
private Enum.DamageType protection;
|
||||||
private int protectionTrains = 0;
|
private int protectionTrains = 0;
|
||||||
private boolean immuneToAll;
|
private boolean immuneToAll;
|
||||||
|
|
||||||
@@ -51,9 +51,9 @@ public class Resists {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Resists(Resists r) {
|
public Resists(Resists r) {
|
||||||
for (SourceType dt : r.resists.keySet())
|
for (Enum.DamageType dt : r.resists.keySet())
|
||||||
this.resists.put(dt, r.resists.get(dt));
|
this.resists.put(dt, r.resists.get(dt));
|
||||||
for (SourceType dt : r.immuneTo.keySet())
|
for (Enum.DamageType dt : r.immuneTo.keySet())
|
||||||
this.immuneTo.put(dt, r.immuneTo.get(dt));
|
this.immuneTo.put(dt, r.immuneTo.get(dt));
|
||||||
this.protection = r.protection;
|
this.protection = r.protection;
|
||||||
this.protectionTrains = r.protectionTrains;
|
this.protectionTrains = r.protectionTrains;
|
||||||
@@ -83,30 +83,30 @@ public class Resists {
|
|||||||
*/
|
*/
|
||||||
public Resists(ResultSet rs) throws SQLException {
|
public Resists(ResultSet rs) throws SQLException {
|
||||||
this.immuneToAll = false;
|
this.immuneToAll = false;
|
||||||
this.resists.put(SourceType.SLASHING, rs.getFloat("slash"));
|
this.resists.put(Enum.DamageType.Slash, rs.getFloat("slash"));
|
||||||
this.resists.put(SourceType.CRUSHING, rs.getFloat("crush"));
|
this.resists.put(Enum.DamageType.Crush, rs.getFloat("crush"));
|
||||||
this.resists.put(SourceType.PIERCING, rs.getFloat("pierce"));
|
this.resists.put(Enum.DamageType.Pierce, rs.getFloat("pierce"));
|
||||||
this.resists.put(SourceType.MAGIC, rs.getFloat("magic"));
|
this.resists.put(Enum.DamageType.Magic, rs.getFloat("magic"));
|
||||||
this.resists.put(SourceType.BLEEDING, rs.getFloat("bleed"));
|
this.resists.put(Enum.DamageType.Bleed, rs.getFloat("bleed"));
|
||||||
this.resists.put(SourceType.POISON, rs.getFloat("poison"));
|
this.resists.put(Enum.DamageType.Poison, rs.getFloat("poison"));
|
||||||
this.resists.put(SourceType.MENTAL, rs.getFloat("mental"));
|
this.resists.put(Enum.DamageType.Mental, rs.getFloat("mental"));
|
||||||
this.resists.put(SourceType.HOLY, rs.getFloat("holy"));
|
this.resists.put(Enum.DamageType.Holy, rs.getFloat("holy"));
|
||||||
this.resists.put(SourceType.UNHOLY, rs.getFloat("unholy"));
|
this.resists.put(Enum.DamageType.Unholy, rs.getFloat("unholy"));
|
||||||
this.resists.put(SourceType.LIGHTNING, rs.getFloat("lightning"));
|
this.resists.put(Enum.DamageType.Lightning, rs.getFloat("lightning"));
|
||||||
this.resists.put(SourceType.FIRE, rs.getFloat("fire"));
|
this.resists.put(Enum.DamageType.Fire, rs.getFloat("fire"));
|
||||||
this.resists.put(SourceType.COLD, rs.getFloat("cold"));
|
this.resists.put(Enum.DamageType.Cold, rs.getFloat("cold"));
|
||||||
this.resists.put(SourceType.HEALING, 0f);
|
this.resists.put(Enum.DamageType.Healing, 0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Handle Fortitudes
|
//Handle Fortitudes
|
||||||
private static float handleFortitude(AbstractCharacter target, SourceType type, float damage) {
|
private static float handleFortitude(AbstractCharacter target, Enum.DamageType type, float damage) {
|
||||||
if (target == null || !(target.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)))
|
if (target == null || !(target.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)))
|
||||||
return damage;
|
return damage;
|
||||||
PlayerBonuses bonus = target.getBonuses();
|
PlayerBonuses bonus = target.getBonuses();
|
||||||
|
|
||||||
//see if there is a fortitude
|
//see if there is a fortitude
|
||||||
float damageCap = bonus.getFloatPercentAll(ModType.DamageCap, SourceType.NONE);
|
float damageCap = bonus.getFloatPercentAll(ModType.DamageCap, SourceType.None);
|
||||||
if (damageCap == 0f || type == SourceType.HEALING)
|
if (damageCap == 0f || type == Enum.DamageType.Healing)
|
||||||
return damage;
|
return damage;
|
||||||
|
|
||||||
//is fortitude, Are we under the cap?
|
//is fortitude, Are we under the cap?
|
||||||
@@ -126,21 +126,21 @@ public class Resists {
|
|||||||
if (forts == null || !isValidDamageCapType(forts, type, exclusive))
|
if (forts == null || !isValidDamageCapType(forts, type, exclusive))
|
||||||
return damage;
|
return damage;
|
||||||
|
|
||||||
float adjustedDamage = bonus.getFloatPercentAll(ModType.AdjustAboveDmgCap, SourceType.NONE);
|
float adjustedDamage = bonus.getFloatPercentAll(ModType.AdjustAboveDmgCap, SourceType.None);
|
||||||
//Adjust damage down and return new amount
|
//Adjust damage down and return new amount
|
||||||
float aadc = 1 + adjustedDamage;
|
float aadc = 1 + adjustedDamage;
|
||||||
return capFire * aadc;
|
return capFire * aadc;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Test if Damagetype is valid for foritude
|
//Test if Damagetype is valid for foritude
|
||||||
private static boolean isValidDamageCapType(HashSet<SourceType> forts, SourceType damageType, boolean exclusive) {
|
private static boolean isValidDamageCapType(HashSet<SourceType> forts, Enum.DamageType damageType, boolean exclusive) {
|
||||||
for (SourceType fort : forts) {
|
for (SourceType fort : forts) {
|
||||||
SourceType dt = SourceType.valueOf(fort.name().toUpperCase());
|
Enum.DamageType dt = Enum.DamageType.valueOf(fort.name());
|
||||||
|
|
||||||
if (dt == SourceType.NONE)
|
if (dt.equals(Enum.DamageType.None))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (dt == damageType) {
|
if (dt.equals(damageType)) {
|
||||||
return exclusive;
|
return exclusive;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -195,19 +195,19 @@ public class Resists {
|
|||||||
*/
|
*/
|
||||||
public final void setBuildingResists() {
|
public final void setBuildingResists() {
|
||||||
this.immuneToAll = false;
|
this.immuneToAll = false;
|
||||||
this.resists.put(SourceType.SLASHING, 85f);
|
this.resists.put(Enum.DamageType.Slash, 85f);
|
||||||
this.resists.put(SourceType.CRUSHING, 85f);
|
this.resists.put(Enum.DamageType.Crush, 85f);
|
||||||
this.immuneTo.put(SourceType.PIERCING, true);
|
this.resists.put(Enum.DamageType.Siege, 0f);
|
||||||
this.immuneTo.put(SourceType.MAGIC, true);
|
this.immuneTo.put(Enum.DamageType.Pierce, true);
|
||||||
this.immuneTo.put(SourceType.BLEEDING, true);
|
this.immuneTo.put(Enum.DamageType.Magic, true);
|
||||||
this.immuneTo.put(SourceType.POISON, true);
|
this.immuneTo.put(Enum.DamageType.Bleed, true);
|
||||||
this.immuneTo.put(SourceType.MENTAL, true);
|
this.immuneTo.put(Enum.DamageType.Poison, true);
|
||||||
this.immuneTo.put(SourceType.HOLY, true);
|
this.immuneTo.put(Enum.DamageType.Mental, true);
|
||||||
this.immuneTo.put(SourceType.UNHOLY, true);
|
this.immuneTo.put(Enum.DamageType.Holy, true);
|
||||||
this.immuneTo.put(SourceType.LIGHTNING, true);
|
this.immuneTo.put(Enum.DamageType.Unholy, true);
|
||||||
this.immuneTo.put(SourceType.FIRE, true);
|
this.immuneTo.put(Enum.DamageType.Lightning, true);
|
||||||
this.immuneTo.put(SourceType.COLD, true);
|
this.immuneTo.put(Enum.DamageType.Fire, true);
|
||||||
this.resists.put(SourceType.SIEGE, 0f);
|
this.immuneTo.put(Enum.DamageType.Cold, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,19 +216,19 @@ public class Resists {
|
|||||||
*/
|
*/
|
||||||
public final void setMineResists() {
|
public final void setMineResists() {
|
||||||
this.immuneToAll = false;
|
this.immuneToAll = false;
|
||||||
this.immuneTo.put(SourceType.SLASHING, true);
|
this.immuneTo.put(Enum.DamageType.Slash, true);
|
||||||
this.immuneTo.put(SourceType.CRUSHING, true);
|
this.immuneTo.put(Enum.DamageType.Crush, true);
|
||||||
this.immuneTo.put(SourceType.PIERCING, true);
|
this.immuneTo.put(Enum.DamageType.Pierce, true);
|
||||||
this.immuneTo.put(SourceType.MAGIC, true);
|
this.immuneTo.put(Enum.DamageType.Magic, true);
|
||||||
this.immuneTo.put(SourceType.BLEEDING, true);
|
this.immuneTo.put(Enum.DamageType.Bleed, true);
|
||||||
this.immuneTo.put(SourceType.POISON, true);
|
this.immuneTo.put(Enum.DamageType.Poison, true);
|
||||||
this.immuneTo.put(SourceType.MENTAL, true);
|
this.immuneTo.put(Enum.DamageType.Mental, true);
|
||||||
this.immuneTo.put(SourceType.HOLY, true);
|
this.immuneTo.put(Enum.DamageType.Holy, true);
|
||||||
this.immuneTo.put(SourceType.UNHOLY, true);
|
this.immuneTo.put(Enum.DamageType.Unholy, true);
|
||||||
this.immuneTo.put(SourceType.LIGHTNING, true);
|
this.immuneTo.put(Enum.DamageType.Lightning, true);
|
||||||
this.immuneTo.put(SourceType.FIRE, true);
|
this.immuneTo.put(Enum.DamageType.Fire, true);
|
||||||
this.immuneTo.put(SourceType.COLD, true);
|
this.immuneTo.put(Enum.DamageType.Cold, true);
|
||||||
this.resists.put(SourceType.SIEGE, 0f);
|
this.resists.put(Enum.DamageType.Siege, 0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -236,27 +236,27 @@ public class Resists {
|
|||||||
*/
|
*/
|
||||||
public final void setGenericResists() {
|
public final void setGenericResists() {
|
||||||
this.immuneToAll = false;
|
this.immuneToAll = false;
|
||||||
this.resists.put(SourceType.SLASHING, 0f);
|
this.resists.put(Enum.DamageType.Slash, 0f);
|
||||||
this.resists.put(SourceType.CRUSHING, 0f);
|
this.resists.put(Enum.DamageType.Crush, 0f);
|
||||||
this.resists.put(SourceType.PIERCING, 0f);
|
this.resists.put(Enum.DamageType.Pierce, 0f);
|
||||||
this.resists.put(SourceType.MAGIC, 0f);
|
this.resists.put(Enum.DamageType.Magic, 0f);
|
||||||
this.resists.put(SourceType.BLEEDING, 0f);
|
this.resists.put(Enum.DamageType.Bleed, 0f);
|
||||||
this.resists.put(SourceType.POISON, 0f);
|
this.resists.put(Enum.DamageType.Poison, 0f);
|
||||||
this.resists.put(SourceType.MENTAL, 0f);
|
this.resists.put(Enum.DamageType.Mental, 0f);
|
||||||
this.resists.put(SourceType.HOLY, 0f);
|
this.resists.put(Enum.DamageType.Holy, 0f);
|
||||||
this.resists.put(SourceType.UNHOLY, 0f);
|
this.resists.put(Enum.DamageType.Unholy, 0f);
|
||||||
this.resists.put(SourceType.LIGHTNING, 0f);
|
this.resists.put(Enum.DamageType.Lightning, 0f);
|
||||||
this.resists.put(SourceType.FIRE, 0f);
|
this.resists.put(Enum.DamageType.Fire, 0f);
|
||||||
this.resists.put(SourceType.COLD, 0f);
|
this.resists.put(Enum.DamageType.Cold, 0f);
|
||||||
this.resists.put(SourceType.HEALING, 0f);
|
this.resists.put(Enum.DamageType.Healing, 0f);
|
||||||
this.immuneTo.put(SourceType.SIEGE, true);
|
this.immuneTo.put(Enum.DamageType.Siege, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a resist
|
* Get a resist
|
||||||
*/
|
*/
|
||||||
public float getResist(SourceType type, int trains) {
|
public float getResist(Enum.DamageType type, int trains) {
|
||||||
//get resisted amount
|
//get resisted amount
|
||||||
Float amount = 0f;
|
Float amount = 0f;
|
||||||
if (this.resists.containsKey(type))
|
if (this.resists.containsKey(type))
|
||||||
@@ -278,7 +278,7 @@ public class Resists {
|
|||||||
/**
|
/**
|
||||||
* get immuneTo
|
* get immuneTo
|
||||||
*/
|
*/
|
||||||
public boolean immuneTo(SourceType type) {
|
public boolean immuneTo(Enum.DamageType type) {
|
||||||
if (this.immuneTo.containsKey(type))
|
if (this.immuneTo.containsKey(type))
|
||||||
return this.immuneTo.get(type);
|
return this.immuneTo.get(type);
|
||||||
else
|
else
|
||||||
@@ -293,13 +293,13 @@ public class Resists {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean immuneToAttacks() {
|
public boolean immuneToAttacks() {
|
||||||
return immuneTo(SourceType.IMMUNETOATTACK);
|
return immuneTo(Enum.DamageType.Attack);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a resist
|
* Set a resist
|
||||||
*/
|
*/
|
||||||
public void setResist(SourceType type, float value) {
|
public void setResist(Enum.DamageType type, float value) {
|
||||||
this.resists.put(type, value);
|
this.resists.put(type, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,12 +322,12 @@ public class Resists {
|
|||||||
* get Damage after resist
|
* get Damage after resist
|
||||||
* Expects heals as negative damage and damage as positive damage for fortitudes.
|
* Expects heals as negative damage and damage as positive damage for fortitudes.
|
||||||
*/
|
*/
|
||||||
public float getResistedDamage(AbstractCharacter source, AbstractCharacter target, SourceType type, float damage, int trains) {
|
public float getResistedDamage(AbstractCharacter source, AbstractCharacter target, Enum.DamageType type, float damage, int trains) {
|
||||||
//handle fortitudes
|
//handle fortitudes
|
||||||
damage = handleFortitude(target, type, damage);
|
damage = handleFortitude(target, type, damage);
|
||||||
|
|
||||||
//calculate armor piercing
|
//calculate armor piercing
|
||||||
float ap = source.getBonuses().getFloatPercentAll(ModType.ArmorPiercing, SourceType.NONE);
|
float ap = source.getBonuses().getFloatPercentAll(ModType.ArmorPiercing, SourceType.None);
|
||||||
float damageAfterResists = damage * (1 - (this.getResist(type, trains) * 0.01f) + ap);
|
float damageAfterResists = damage * (1 - (this.getResist(type, trains) * 0.01f) + ap);
|
||||||
|
|
||||||
//check to see if any damage absorbers should cancel
|
//check to see if any damage absorbers should cancel
|
||||||
@@ -346,41 +346,41 @@ public class Resists {
|
|||||||
|
|
||||||
if (rb != null) {
|
if (rb != null) {
|
||||||
// Handle immunities
|
// Handle immunities
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.STUN))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Stun))
|
||||||
this.immuneTo.put(SourceType.STUN, true);
|
this.immuneTo.put(Enum.DamageType.Stun, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.BLIND))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Blind))
|
||||||
this.immuneTo.put(SourceType.BLIND, true);
|
this.immuneTo.put(Enum.DamageType.Blind, true);
|
||||||
if (rb.getBool(ModType.ImmuneToAttack, SourceType.NONE))
|
if (rb.getBool(ModType.ImmuneToAttack, SourceType.None))
|
||||||
this.immuneTo.put(SourceType.IMMUNETOATTACK, true);
|
this.immuneTo.put(Enum.DamageType.Attack, true);
|
||||||
if (rb.getBool(ModType.ImmuneToPowers, SourceType.NONE))
|
if (rb.getBool(ModType.ImmuneToPowers, SourceType.None))
|
||||||
this.immuneTo.put(SourceType.IMMUNETOPOWERS, true);
|
this.immuneTo.put(Enum.DamageType.Powers, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.POWERBLOCK))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Powerblock))
|
||||||
this.immuneTo.put(SourceType.POWERBLOCK, true);
|
this.immuneTo.put(Enum.DamageType.Powerblock, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.DEBUFF))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.DeBuff))
|
||||||
this.immuneTo.put(SourceType.DEBUFF, true);
|
this.immuneTo.put(Enum.DamageType.DeBuff, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.FEAR))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Fear))
|
||||||
this.immuneTo.put(SourceType.FEAR, true);
|
this.immuneTo.put(Enum.DamageType.Fear, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.CHARM))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Charm))
|
||||||
this.immuneTo.put(SourceType.CHARM, true);
|
this.immuneTo.put(Enum.DamageType.Charm, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.ROOT))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Root))
|
||||||
this.immuneTo.put(SourceType.ROOT, true);
|
this.immuneTo.put(Enum.DamageType.Root, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.SNARE))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Snare))
|
||||||
this.immuneTo.put(SourceType.SNARE, true);
|
this.immuneTo.put(Enum.DamageType.Snare, true);
|
||||||
|
|
||||||
// Handle resists
|
// Handle resists
|
||||||
slash += rb.getFloat(ModType.Resistance, SourceType.SLASHING);
|
slash += rb.getFloat(ModType.Resistance, SourceType.Slash);
|
||||||
crush += rb.getFloat(ModType.Resistance, SourceType.CRUSHING);
|
crush += rb.getFloat(ModType.Resistance, SourceType.Crush);
|
||||||
pierce += rb.getFloat(ModType.Resistance, SourceType.PIERCING);
|
pierce += rb.getFloat(ModType.Resistance, SourceType.Pierce);
|
||||||
magic += rb.getFloat(ModType.Resistance, SourceType.MAGIC);
|
magic += rb.getFloat(ModType.Resistance, SourceType.Magic);
|
||||||
bleed += rb.getFloat(ModType.Resistance, SourceType.BLEEDING);
|
bleed += rb.getFloat(ModType.Resistance, SourceType.Bleed);
|
||||||
poison += rb.getFloat(ModType.Resistance, SourceType.POISON);
|
poison += rb.getFloat(ModType.Resistance, SourceType.Poison);
|
||||||
mental += rb.getFloat(ModType.Resistance, SourceType.MENTAL);
|
mental += rb.getFloat(ModType.Resistance, SourceType.Mental);
|
||||||
holy += rb.getFloat(ModType.Resistance, SourceType.HOLY);
|
holy += rb.getFloat(ModType.Resistance, SourceType.Holy);
|
||||||
unholy += rb.getFloat(ModType.Resistance, SourceType.UNHOLY);
|
unholy += rb.getFloat(ModType.Resistance, SourceType.Unholy);
|
||||||
lightning += rb.getFloat(ModType.Resistance, SourceType.LIGHTNING);
|
lightning += rb.getFloat(ModType.Resistance, SourceType.Lightning);
|
||||||
fire += rb.getFloat(ModType.Resistance, SourceType.FIRE);
|
fire += rb.getFloat(ModType.Resistance, SourceType.Fire);
|
||||||
cold += rb.getFloat(ModType.Resistance, SourceType.COLD);
|
cold += rb.getFloat(ModType.Resistance, SourceType.Cold);
|
||||||
healing += rb.getFloat(ModType.Resistance, SourceType.HEALING); // DamageType.Healing.name());
|
healing += rb.getFloat(ModType.Resistance, SourceType.Healing); // DamageType.Healing.name());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,29 +404,30 @@ public class Resists {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.resists.put(SourceType.SLASHING, slash);
|
this.resists.put(Enum.DamageType.Slash, slash);
|
||||||
this.resists.put(SourceType.CRUSHING, crush);
|
this.resists.put(Enum.DamageType.Crush, crush);
|
||||||
this.resists.put(SourceType.PIERCING, pierce);
|
this.resists.put(Enum.DamageType.Pierce, pierce);
|
||||||
this.resists.put(SourceType.MAGIC, magic);
|
this.resists.put(Enum.DamageType.Magic, magic);
|
||||||
this.resists.put(SourceType.BLEEDING, bleed);
|
this.resists.put(Enum.DamageType.Bleed, bleed);
|
||||||
this.resists.put(SourceType.POISON, poison);
|
this.resists.put(Enum.DamageType.Poison, poison);
|
||||||
this.resists.put(SourceType.MENTAL, mental);
|
this.resists.put(Enum.DamageType.Mental, mental);
|
||||||
this.resists.put(SourceType.HOLY, holy);
|
this.resists.put(Enum.DamageType.Holy, holy);
|
||||||
this.resists.put(SourceType.UNHOLY, unholy);
|
this.resists.put(Enum.DamageType.Unholy, unholy);
|
||||||
this.resists.put(SourceType.LIGHTNING, lightning);
|
this.resists.put(Enum.DamageType.Lightning, lightning);
|
||||||
this.resists.put(SourceType.FIRE, fire);
|
this.resists.put(Enum.DamageType.Fire, fire);
|
||||||
this.resists.put(SourceType.COLD, cold);
|
this.resists.put(Enum.DamageType.Cold, cold);
|
||||||
this.resists.put(SourceType.HEALING, healing);
|
this.resists.put(Enum.DamageType.Healing, healing);
|
||||||
this.immuneTo.put(SourceType.SIEGE, true);
|
|
||||||
|
this.immuneTo.put(Enum.DamageType.Siege, true);
|
||||||
|
|
||||||
// debug printing of resists
|
// debug printing of resists
|
||||||
// printResists(pc);
|
// printResists(pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void printResistsToClient(PlayerCharacter pc) {
|
public void printResistsToClient(PlayerCharacter pc) {
|
||||||
for (SourceType dt : resists.keySet())
|
for (Enum.DamageType dt : resists.keySet())
|
||||||
ChatManager.chatSystemInfo(pc, " resist." + dt.name() + ": " + resists.get(dt));
|
ChatManager.chatSystemInfo(pc, " resist." + dt.name() + ": " + resists.get(dt));
|
||||||
for (SourceType dt : immuneTo.keySet())
|
for (Enum.DamageType dt : immuneTo.keySet())
|
||||||
ChatManager.chatSystemInfo(pc, " immuneTo." + dt.name() + ": " + immuneTo.get(dt));
|
ChatManager.chatSystemInfo(pc, " immuneTo." + dt.name() + ": " + immuneTo.get(dt));
|
||||||
ChatManager.chatSystemInfo(pc, " immuneToAll: " + this.immuneToAll);
|
ChatManager.chatSystemInfo(pc, " immuneToAll: " + this.immuneToAll);
|
||||||
if (protection != null)
|
if (protection != null)
|
||||||
@@ -439,9 +440,9 @@ public class Resists {
|
|||||||
String out = pc.getName();
|
String out = pc.getName();
|
||||||
|
|
||||||
out += "Resists: ";
|
out += "Resists: ";
|
||||||
Iterator<SourceType> it = this.resists.keySet().iterator();
|
Iterator<Enum.DamageType> it = this.resists.keySet().iterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
SourceType damType = it.next();
|
Enum.DamageType damType = it.next();
|
||||||
String dtName = damType.name();
|
String dtName = damType.name();
|
||||||
out += dtName + '=' + this.resists.get(dtName) + ", ";
|
out += dtName + '=' + this.resists.get(dtName) + ", ";
|
||||||
}
|
}
|
||||||
@@ -449,7 +450,7 @@ public class Resists {
|
|||||||
out += "ImmuneTo: ";
|
out += "ImmuneTo: ";
|
||||||
it = this.immuneTo.keySet().iterator();
|
it = this.immuneTo.keySet().iterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
SourceType damType = it.next();
|
Enum.DamageType damType = it.next();
|
||||||
|
|
||||||
String dtName = damType.name();
|
String dtName = damType.name();
|
||||||
out += dtName + '=' + this.resists.get(dtName) + ", ";
|
out += dtName + '=' + this.resists.get(dtName) + ", ";
|
||||||
|
|||||||
@@ -254,19 +254,19 @@ public class ActionsBase {
|
|||||||
//TODO make this more efficient then testing strings
|
//TODO make this more efficient then testing strings
|
||||||
if (this.stackType.equals("Stun") && bonus.getBool(ModType.ImmuneTo, SourceType.STUN))
|
if (this.stackType.equals("Stun") && bonus.getBool(ModType.ImmuneTo, SourceType.STUN))
|
||||||
return true; //Currently stun immune. Skip stun
|
return true; //Currently stun immune. Skip stun
|
||||||
else if (this.stackType.equals("Snare") && bonus.getBool(ModType.ImmuneTo, SourceType.SNARE))
|
else if (this.stackType.equals("Snare") && bonus.getBool(ModType.ImmuneTo, SourceType.Snare))
|
||||||
return true; //Currently snare immune. Skip snare
|
return true; //Currently snare immune. Skip snare
|
||||||
else if (this.stackType.equals("Blindness") && bonus.getBool(ModType.ImmuneTo, SourceType.BLIND))
|
else if (this.stackType.equals("Blindness") && bonus.getBool(ModType.ImmuneTo, SourceType.Blind))
|
||||||
return true; //Currently blind immune. Skip blind
|
return true; //Currently blind immune. Skip blind
|
||||||
else if (this.stackType.equals("PowerInhibitor") && bonus.getBool(ModType.ImmuneTo, SourceType.POWERBLOCK))
|
else if (this.stackType.equals("PowerInhibitor") && bonus.getBool(ModType.ImmuneTo, SourceType.Powerblock))
|
||||||
return true; //Currently power block immune. Skip power block
|
return true; //Currently power block immune. Skip power block
|
||||||
else if (this.stackType.equals("Root") && bonus.getBool(ModType.ImmuneTo, SourceType.ROOT))
|
else if (this.stackType.equals("Root") && bonus.getBool(ModType.ImmuneTo, SourceType.Root))
|
||||||
return true;
|
return true;
|
||||||
// else if (pb.isHeal() && (bonus.getByte("immuneTo.Heal")) >= trains)
|
// else if (pb.isHeal() && (bonus.getByte("immuneTo.Heal")) >= trains)
|
||||||
// return true; //Currently shadowmantled. Skip heals
|
// return true; //Currently shadowmantled. Skip heals
|
||||||
else if (this.stackType.equals("Flight") && bonus.getBool(ModType.NoMod, SourceType.FLY))
|
else if (this.stackType.equals("Flight") && bonus.getBool(ModType.NoMod, SourceType.Fly))
|
||||||
return true;
|
return true;
|
||||||
else if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.NONE))
|
else if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None))
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return pb.vampDrain() && bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN);
|
return pb.vampDrain() && bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN);
|
||||||
|
|||||||
@@ -13,18 +13,18 @@ import engine.Enum;
|
|||||||
|
|
||||||
public class DamageShield {
|
public class DamageShield {
|
||||||
|
|
||||||
private final Enum.SourceType damageType;
|
private final Enum.DamageType damageType;
|
||||||
private final float amount;
|
private final float amount;
|
||||||
private final boolean usePercent;
|
private final boolean usePercent;
|
||||||
|
|
||||||
public DamageShield(Enum.SourceType damageType, float amount, boolean usePercent) {
|
public DamageShield(Enum.DamageType damageType, float amount, boolean usePercent) {
|
||||||
super();
|
super();
|
||||||
this.damageType = damageType;
|
this.damageType = damageType;
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.usePercent = usePercent;
|
this.usePercent = usePercent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Enum.SourceType getDamageType() {
|
public Enum.DamageType getDamageType() {
|
||||||
return this.damageType;
|
return this.damageType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ public class EffectsBase {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean containsDamageType(Enum.SourceType dt) {
|
public boolean containsDamageType(Enum.DamageType dt) {
|
||||||
if (!EffectsBase.EffectDamageTypes.containsKey(this.token))
|
if (!EffectsBase.EffectDamageTypes.containsKey(this.token))
|
||||||
return false;
|
return false;
|
||||||
return EffectsBase.EffectDamageTypes.get(this.token).contains(dt);
|
return EffectsBase.EffectDamageTypes.get(this.token).contains(dt);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class AmbidexterityEffectModifier extends AbstractEffectModifier {
|
|||||||
@Override
|
@Override
|
||||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||||
PlayerBonuses bonus = ac.getBonuses();
|
PlayerBonuses bonus = ac.getBonuses();
|
||||||
bonus.setBool(ModType.Ambidexterity, SourceType.NONE, true);
|
bonus.setBool(ModType.Ambidexterity, SourceType.None, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class BlockedPowerTypeEffectModifier extends AbstractEffectModifier {
|
|||||||
ModType toBlock = ModType.None;
|
ModType toBlock = ModType.None;
|
||||||
|
|
||||||
switch (this.sourceType) {
|
switch (this.sourceType) {
|
||||||
case INVISIBLE:
|
case Invisible:
|
||||||
toBlock = ModType.Invisible;
|
toBlock = ModType.Invisible;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class DamageShieldEffectModifier extends AbstractEffectModifier {
|
|||||||
amount *= (1 + mod);
|
amount *= (1 + mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
Enum.SourceType dt = Enum.SourceType.valueOf(this.type.toUpperCase());
|
Enum.DamageType dt = Enum.DamageType.valueOf(this.type);
|
||||||
|
|
||||||
if (dt != null) {
|
if (dt != null) {
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
package engine.powers.effectmodifiers;
|
package engine.powers.effectmodifiers;
|
||||||
|
|
||||||
|
import engine.Enum;
|
||||||
import engine.Enum.GameObjectType;
|
import engine.Enum.GameObjectType;
|
||||||
import engine.Enum.ModType;
|
import engine.Enum.ModType;
|
||||||
import engine.Enum.SourceType;
|
import engine.Enum.SourceType;
|
||||||
@@ -27,13 +28,13 @@ import java.util.concurrent.ThreadLocalRandom;
|
|||||||
|
|
||||||
public class HealthEffectModifier extends AbstractEffectModifier {
|
public class HealthEffectModifier extends AbstractEffectModifier {
|
||||||
|
|
||||||
private SourceType damageType;
|
private Enum.DamageType damageType;
|
||||||
|
|
||||||
public HealthEffectModifier(ResultSet rs) throws SQLException {
|
public HealthEffectModifier(ResultSet rs) throws SQLException {
|
||||||
super(rs);
|
super(rs);
|
||||||
String damageTypeDB = rs.getString("type");
|
String damageTypeDB = rs.getString("type");
|
||||||
try {
|
try {
|
||||||
this.damageType = SourceType.valueOf(damageTypeDB.toUpperCase());
|
this.damageType = Enum.DamageType.valueOf(damageTypeDB);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
|
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
|
||||||
+ " value received = '" + damageTypeDB.toUpperCase() + '\'', e);
|
+ " value received = '" + damageTypeDB.toUpperCase() + '\'', e);
|
||||||
@@ -153,7 +154,7 @@ public class HealthEffectModifier extends AbstractEffectModifier {
|
|||||||
|
|
||||||
// Apply any power effect modifiers (such as stances)
|
// Apply any power effect modifiers (such as stances)
|
||||||
if (bonus != null)
|
if (bonus != null)
|
||||||
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.NONE)));
|
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None)));
|
||||||
}
|
}
|
||||||
if (modAmount == 0f)
|
if (modAmount == 0f)
|
||||||
return;
|
return;
|
||||||
@@ -192,7 +193,7 @@ public class HealthEffectModifier extends AbstractEffectModifier {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
PlayerBonuses bonus = ac.getBonuses();
|
PlayerBonuses bonus = ac.getBonuses();
|
||||||
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.HEALING) >= trains) {
|
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Healing) >= trains) {
|
||||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
||||||
mhm.setUnknown03(5); //set target is immune
|
mhm.setUnknown03(5); //set target is immune
|
||||||
DispatchMessage.sendToAllInRange(ac, mhm);
|
DispatchMessage.sendToAllInRange(ac, mhm);
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ import java.util.concurrent.ThreadLocalRandom;
|
|||||||
|
|
||||||
public class ManaEffectModifier extends AbstractEffectModifier {
|
public class ManaEffectModifier extends AbstractEffectModifier {
|
||||||
|
|
||||||
private SourceType damageType;
|
private Enum.DamageType damageType;
|
||||||
|
|
||||||
public ManaEffectModifier(ResultSet rs) throws SQLException {
|
public ManaEffectModifier(ResultSet rs) throws SQLException {
|
||||||
super(rs);
|
super(rs);
|
||||||
String damageTypeDB = rs.getString("type");
|
String damageTypeDB = rs.getString("type");
|
||||||
try {
|
try {
|
||||||
this.damageType = SourceType.valueOf(damageTypeDB.toUpperCase());
|
this.damageType = Enum.DamageType.valueOf(damageTypeDB);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
|
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
|
||||||
+ " value received = '" + damageTypeDB.toUpperCase() + '\'', e);
|
+ " value received = '" + damageTypeDB.toUpperCase() + '\'', e);
|
||||||
@@ -114,7 +114,7 @@ public class ManaEffectModifier extends AbstractEffectModifier {
|
|||||||
|
|
||||||
// Apply any power effect modifiers (such as stances)
|
// Apply any power effect modifiers (such as stances)
|
||||||
if (bonus != null)
|
if (bonus != null)
|
||||||
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.NONE));
|
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None));
|
||||||
}
|
}
|
||||||
if (modAmount == 0f)
|
if (modAmount == 0f)
|
||||||
return;
|
return;
|
||||||
@@ -142,7 +142,7 @@ public class ManaEffectModifier extends AbstractEffectModifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
PlayerBonuses bonus = ac.getBonuses();
|
PlayerBonuses bonus = ac.getBonuses();
|
||||||
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.HEALING) >= trains) {
|
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Healing) >= trains) {
|
||||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
||||||
mhm.setUnknown03(5); //set target is immune
|
mhm.setUnknown03(5); //set target is immune
|
||||||
DispatchMessage.sendToAllInRange(ac, mhm);
|
DispatchMessage.sendToAllInRange(ac, mhm);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class NoModEffectModifier extends AbstractEffectModifier {
|
|||||||
bonus.setBool(this.modType, this.sourceType, true);
|
bonus.setBool(this.modType, this.sourceType, true);
|
||||||
|
|
||||||
switch (this.sourceType) {
|
switch (this.sourceType) {
|
||||||
case FLY:
|
case Fly:
|
||||||
if (!ac.getObjectType().equals(GameObjectType.PlayerCharacter))
|
if (!ac.getObjectType().equals(GameObjectType.PlayerCharacter))
|
||||||
return;
|
return;
|
||||||
PlayerCharacter flyer = (PlayerCharacter) ac;
|
PlayerCharacter flyer = (PlayerCharacter) ac;
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ import java.util.concurrent.ThreadLocalRandom;
|
|||||||
|
|
||||||
public class StaminaEffectModifier extends AbstractEffectModifier {
|
public class StaminaEffectModifier extends AbstractEffectModifier {
|
||||||
|
|
||||||
private SourceType damageType;
|
private Enum.DamageType damageType;
|
||||||
|
|
||||||
public StaminaEffectModifier(ResultSet rs) throws SQLException {
|
public StaminaEffectModifier(ResultSet rs) throws SQLException {
|
||||||
super(rs);
|
super(rs);
|
||||||
String damageTypeDB = rs.getString("type");
|
String damageTypeDB = rs.getString("type");
|
||||||
try {
|
try {
|
||||||
this.damageType = SourceType.valueOf(damageTypeDB.toUpperCase());
|
this.damageType = Enum.DamageType.valueOf(damageTypeDB);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
|
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
|
||||||
+ " value received = '" + damageTypeDB.toUpperCase() + '\'', e);
|
+ " value received = '" + damageTypeDB.toUpperCase() + '\'', e);
|
||||||
@@ -112,7 +112,7 @@ public class StaminaEffectModifier extends AbstractEffectModifier {
|
|||||||
|
|
||||||
// Apply any power effect modifiers (such as stances)
|
// Apply any power effect modifiers (such as stances)
|
||||||
if (bonus != null)
|
if (bonus != null)
|
||||||
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.NONE)));
|
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None)));
|
||||||
}
|
}
|
||||||
if (modAmount == 0f)
|
if (modAmount == 0f)
|
||||||
return;
|
return;
|
||||||
@@ -140,7 +140,7 @@ public class StaminaEffectModifier extends AbstractEffectModifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
PlayerBonuses bonus = ac.getBonuses();
|
PlayerBonuses bonus = ac.getBonuses();
|
||||||
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.HEALING) >= trains) {
|
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Healing) >= trains) {
|
||||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
||||||
mhm.setUnknown03(5); //set target is immune
|
mhm.setUnknown03(5); //set target is immune
|
||||||
DispatchMessage.sendToAllInRange(ac, mhm);
|
DispatchMessage.sendToAllInRange(ac, mhm);
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ public class ApplyEffectPowerAction extends AbstractPowerAction {
|
|||||||
if (bonuses == null)
|
if (bonuses == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
boolean noSilence = bonuses.getBool(ModType.Silenced, SourceType.NONE);
|
boolean noSilence = bonuses.getBool(ModType.Silenced, SourceType.None);
|
||||||
|
|
||||||
if (noSilence)
|
if (noSilence)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
|
|||||||
protected float transferEfficiencyRamp;
|
protected float transferEfficiencyRamp;
|
||||||
protected boolean transferEfficiencyRampAdd;
|
protected boolean transferEfficiencyRampAdd;
|
||||||
protected boolean targetToCaster;
|
protected boolean targetToCaster;
|
||||||
protected SourceType damageType;
|
protected Enum.DamageType damageType;
|
||||||
protected EffectsBase effect;
|
protected EffectsBase effect;
|
||||||
|
|
||||||
public TransferStatPowerAction(ResultSet rs, HashMap<String, EffectsBase> effects) throws SQLException {
|
public TransferStatPowerAction(ResultSet rs, HashMap<String, EffectsBase> effects) throws SQLException {
|
||||||
@@ -78,7 +78,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
|
|||||||
// Damage type can sometimes be null in the DB.
|
// Damage type can sometimes be null in the DB.
|
||||||
|
|
||||||
if (damageString.isEmpty() == false)
|
if (damageString.isEmpty() == false)
|
||||||
this.damageType = SourceType.valueOf(damageString.toUpperCase());
|
this.damageType = Enum.DamageType.valueOf(damageString);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
this.damageType = null;
|
this.damageType = null;
|
||||||
}
|
}
|
||||||
@@ -210,7 +210,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
|
|||||||
// Apply any power effect modifiers (such as stances)
|
// Apply any power effect modifiers (such as stances)
|
||||||
PlayerBonuses bonus = source.getBonuses();
|
PlayerBonuses bonus = source.getBonuses();
|
||||||
if (bonus != null)
|
if (bonus != null)
|
||||||
damage *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.NONE));
|
damage *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None));
|
||||||
|
|
||||||
//get amount to transfer
|
//get amount to transfer
|
||||||
fromAmount = damage;
|
fromAmount = damage;
|
||||||
@@ -236,7 +236,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
|
|||||||
AbstractNetMsg mhmFrom = null;
|
AbstractNetMsg mhmFrom = null;
|
||||||
|
|
||||||
//stop if target is immune to drains
|
//stop if target is immune to drains
|
||||||
if (from.getBonuses().getBool(ModType.ImmuneTo, SourceType.DRAIN)) {
|
if (from.getBonuses().getBool(ModType.ImmuneTo, SourceType.Drain)) {
|
||||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, to, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
ModifyHealthMsg mhm = new ModifyHealthMsg(source, to, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
||||||
mhm.setUnknown03(5); //set target is immune
|
mhm.setUnknown03(5); //set target is immune
|
||||||
DispatchMessage.sendToAllInRange(from, mhm);
|
DispatchMessage.sendToAllInRange(from, mhm);
|
||||||
|
|||||||
Reference in New Issue
Block a user