Browse Source

Uppercase enum.

combat-2
MagicBot 9 months ago
parent
commit
2e5fa69942
  1. 232
      src/engine/Enum.java
  2. 2
      src/engine/gameManager/ChatManager.java
  3. 26
      src/engine/gameManager/CombatManager.java
  4. 4
      src/engine/gameManager/MovementManager.java
  5. 6
      src/engine/gameManager/NPCManager.java
  6. 16
      src/engine/gameManager/PowersManager.java
  7. 2
      src/engine/jobs/ChantJob.java
  8. 2
      src/engine/mobileAI/MobAI.java
  9. 10
      src/engine/mobileAI/utilities/CombatUtilities.java
  10. 2
      src/engine/mobileAI/utilities/MovementUtilities.java
  11. 2
      src/engine/net/client/ClientMessagePump.java
  12. 2
      src/engine/objects/AbstractCharacter.java
  13. 2
      src/engine/objects/AbstractIntelligenceAgent.java
  14. 6
      src/engine/objects/CharacterSkill.java
  15. 60
      src/engine/objects/Mob.java
  16. 8
      src/engine/objects/PlayerBonuses.java
  17. 120
      src/engine/objects/PlayerCharacter.java
  18. 245
      src/engine/objects/Resists.java
  19. 14
      src/engine/powers/ActionsBase.java
  20. 2
      src/engine/powers/effectmodifiers/AmbidexterityEffectModifier.java
  21. 2
      src/engine/powers/effectmodifiers/BlockedPowerTypeEffectModifier.java
  22. 4
      src/engine/powers/effectmodifiers/HealthEffectModifier.java
  23. 4
      src/engine/powers/effectmodifiers/ManaEffectModifier.java
  24. 2
      src/engine/powers/effectmodifiers/NoModEffectModifier.java
  25. 4
      src/engine/powers/effectmodifiers/StaminaEffectModifier.java
  26. 2
      src/engine/powers/poweractions/ApplyEffectPowerAction.java
  27. 4
      src/engine/powers/poweractions/TransferStatPowerAction.java

232
src/engine/Enum.java

@ -775,118 +775,117 @@ public class Enum {
} }
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, BLEEDING,
Blind, BLIND,
Block, BLOCK,
Bloodcraft, BLOODCRAFT,
Bow, BOW,
Buff, BUFF,
Channeling, CHANNELING,
Charm, CHARM,
Cold, COLD,
Constitution, CONSTITUTION,
Corruption, CORRUPTION,
Crossbow, CROSSBOW,
Crushing, CRUSHING,
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,
Fly, FLY,
Giant, GIANT,
GreatAxeMastery, GREATAXEMASTERY,
GreatSwordMastery, GREATSWORDMASTERY,
Hammer, HAMMER,
Healing, HEALING,
Holy, HOLY,
ImmuneToAttack, IMMUNETOATTACK,
ImmuneToPowers, IMMUNETOPOWERS,
Intelligence, INTELLIGENCE,
Invisible, INVISIBLE,
Lightning,
LIGHTNING, LIGHTNING,
Liturgy, LITURGY,
Magic, MAGIC,
Mental, MENTAL,
NatureLore, NATURELORE,
Necromancy, NECROMANCY,
Parry, PARRY,
Piercing, PIERCING,
Poison, POISON,
PoleArm, POLEARM,
Powerblock, POWERBLOCK,
Rat, RAT,
ResistDeBuff, RESISTDEBUFF,
Restoration, RESTORATION,
Root, ROOT,
Shadowmastery, SHADOWMASTERY,
Siege, SIEGE,
Slashing, SLASHING,
Snare, SNARE,
Sorcery, SORCERY,
Spear, SPEAR,
SpearMastery, SPEARMASTERY,
Spirit, SPIRIT,
Staff, STAFF,
Steal, 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,
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,
@ -894,10 +893,8 @@ public class Enum {
BOONCLASS, BOONCLASS,
BOONRACE, BOONRACE,
BREAKFLY, BREAKFLY,
BUFF,
CHANT, CHANT,
DAMAGE, DAMAGE,
DEBUFF,
DISPEL, DISPEL,
FLIGHT, FLIGHT,
GROUPBUFF, GROUPBUFF,
@ -910,27 +907,24 @@ 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(",", "")); 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;
} }

2
src/engine/gameManager/ChatManager.java

@ -165,7 +165,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;
} }

26
src/engine/gameManager/CombatManager.java

@ -229,7 +229,7 @@ public enum CombatManager {
PlayerBonuses bonus = abstractCharacter.getBonuses(); PlayerBonuses bonus = abstractCharacter.getBonuses();
if (bonus != null && bonus.getBool(ModType.ImmuneToAttack, SourceType.None)) if (bonus != null && bonus.getBool(ModType.ImmuneToAttack, SourceType.NONE))
return 0; return 0;
AbstractWorldObject target = abstractCharacter.getCombatTarget(); AbstractWorldObject target = abstractCharacter.getCombatTarget();
@ -261,7 +261,7 @@ public enum CombatManager {
Resists res = tar.getResists(); Resists res = tar.getResists();
bonus = tar.getBonuses(); bonus = tar.getBonuses();
if (bonus != null && !bonus.getBool(ModType.NoMod, SourceType.ImmuneToAttack)) if (bonus != null && !bonus.getBool(ModType.NoMod, SourceType.IMMUNETOATTACK))
if (res != null) if (res != null)
if (res.immuneToAll() || res.immuneToAttacks()) if (res.immuneToAll() || res.immuneToAttacks())
return 0; return 0;
@ -366,7 +366,7 @@ public enum CombatManager {
bonus = abstractCharacter.getBonuses(); bonus = abstractCharacter.getBonuses();
if (bonus != null && bonus.getBool(ModType.Stunned, SourceType.None)) if (bonus != null && bonus.getBool(ModType.Stunned, SourceType.NONE))
attackFailure = true; attackFailure = true;
//Get Range of weapon //Get Range of weapon
@ -420,11 +420,11 @@ public enum CombatManager {
else { else {
int wepSpeed = (int) (wb.getSpeed()); int wepSpeed = (int) (wb.getSpeed());
if (weapon != null && weapon.getBonusPercent(ModType.WeaponSpeed, SourceType.None) != 0f) //add weapon speed bonus if (weapon != null && weapon.getBonusPercent(ModType.WeaponSpeed, SourceType.NONE) != 0f) //add weapon speed bonus
wepSpeed *= (1 + weapon.getBonus(ModType.WeaponSpeed, SourceType.None)); wepSpeed *= (1 + weapon.getBonus(ModType.WeaponSpeed, SourceType.NONE));
if (abstractCharacter.getBonuses() != null && abstractCharacter.getBonuses().getFloatPercentAll(ModType.AttackDelay, SourceType.None) != 0f) //add effects speed bonus if (abstractCharacter.getBonuses() != null && abstractCharacter.getBonuses().getFloatPercentAll(ModType.AttackDelay, SourceType.NONE) != 0f) //add effects speed bonus
wepSpeed *= (1 + abstractCharacter.getBonuses().getFloatPercentAll(ModType.AttackDelay, SourceType.None)); wepSpeed *= (1 + abstractCharacter.getBonuses().getFloatPercentAll(ModType.AttackDelay, 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.
@ -499,9 +499,9 @@ public enum CombatManager {
//Dont think we need to do this anymore. //Dont think we need to do this anymore.
if (tarIsRat) if (tarIsRat)
if (attacker.getBonuses().getFloatPercentAll(ModType.Slay, SourceType.Rat) != 0) { //strip away current % dmg buffs then add with rat % if (attacker.getBonuses().getFloatPercentAll(ModType.Slay, SourceType.RAT) != 0) { //strip away current % dmg buffs then add with rat %
float percent = 1 + attacker.getBonuses().getFloatPercentAll(ModType.Slay, SourceType.Rat); float percent = 1 + attacker.getBonuses().getFloatPercentAll(ModType.Slay, SourceType.RAT);
minDamage *= percent; minDamage *= percent;
maxDamage *= percent; maxDamage *= percent;
@ -581,7 +581,7 @@ public enum CombatManager {
boolean skipPassives = false; boolean skipPassives = false;
PlayerBonuses bonuses = attacker.getBonuses(); PlayerBonuses bonuses = attacker.getBonuses();
if (bonuses != null && bonuses.getBool(ModType.IgnorePassiveDefense, SourceType.None)) if (bonuses != null && bonuses.getBool(ModType.IgnorePassiveDefense, SourceType.NONE))
skipPassives = true; skipPassives = true;
AbstractCharacter tarAc = null; AbstractCharacter tarAc = null;
@ -691,9 +691,9 @@ public enum CombatManager {
if (wb != null) if (wb != null)
damageType = wb.getDamageType(); damageType = wb.getDamageType();
else if (attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob) attacker).isSiege()) else if (attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob) attacker).isSiege())
damageType = SourceType.Siege; damageType = SourceType.SIEGE;
else else
damageType = SourceType.Crushing; damageType = SourceType.CRUSHING;
errorTrack = 10; errorTrack = 10;
@ -1112,7 +1112,7 @@ public enum CombatManager {
return 0f; return 0f;
if (bonus != null) if (bonus != null)
rangeMod += bonus.getFloatPercentAll(ModType.WeaponRange, SourceType.None); rangeMod += bonus.getFloatPercentAll(ModType.WeaponRange, SourceType.NONE);
return weapon.getRange() * rangeMod; return weapon.getRange() * rangeMod;
} }

4
src/engine/gameManager/MovementManager.java

@ -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;
} }
@ -405,7 +405,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();

6
src/engine/gameManager/NPCManager.java

@ -425,9 +425,9 @@ public enum NPCManager {
for(MobEquipment equipped : mob.equip.values()){ for(MobEquipment equipped : mob.equip.values()){
ItemBase itemBase = equipped.getItemBase(); ItemBase itemBase = equipped.getItemBase();
if(itemBase.isHeavyArmor() || itemBase.isLightArmor() || itemBase.isMediumArmor()){ if(itemBase.isHeavyArmor() || itemBase.isLightArmor() || itemBase.isMediumArmor()){
mob.resists.setResist(Enum.SourceType.Crushing, mob.resists.getResist(Enum.SourceType.Crushing, 0) + itemBase.getCrushResist()); mob.resists.setResist(Enum.SourceType.SLASHING, mob.resists.getResist(Enum.SourceType.SLASHING, 0) + itemBase.getSlashResist());
mob.resists.setResist(Enum.SourceType.Slashing, mob.resists.getResist(Enum.SourceType.Slashing, 0) + itemBase.getCrushResist()); mob.resists.setResist(Enum.SourceType.CRUSHING, mob.resists.getResist(Enum.SourceType.CRUSHING, 0) + itemBase.getCrushResist());
mob.resists.setResist(Enum.SourceType.Piercing, mob.resists.getResist(Enum.SourceType.Piercing, 0) + itemBase.getCrushResist()); mob.resists.setResist(Enum.SourceType.PIERCING, mob.resists.getResist(Enum.SourceType.PIERCING, 0) + itemBase.getPierceResist());
} }
} }
} }

16
src/engine/gameManager/PowersManager.java

@ -330,7 +330,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
@ -466,7 +466,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;
@ -613,7 +613,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
@ -773,7 +773,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());
@ -1051,7 +1051,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))
@ -1469,7 +1469,7 @@ public enum PowersManager {
it.remove(); it.remove();
else if (awo.getObjectType().equals(GameObjectType.PlayerCharacter)) { else if (awo.getObjectType().equals(GameObjectType.PlayerCharacter)) {
PlayerBonuses bonus = ((PlayerCharacter) awo).getBonuses(); PlayerBonuses bonus = ((PlayerCharacter) awo).getBonuses();
if (bonus != null && bonus.getBool(ModType.CannotTrack, SourceType.None)) if (bonus != null && bonus.getBool(ModType.CannotTrack, SourceType.NONE))
it.remove(); it.remove();
} }
} }
@ -1943,7 +1943,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;
} }
@ -2093,7 +2093,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;
} }

2
src/engine/jobs/ChantJob.java

@ -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();

2
src/engine/mobileAI/MobAI.java

@ -1013,7 +1013,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());

10
src/engine/mobileAI/utilities/CombatUtilities.java

@ -126,7 +126,7 @@ public class CombatUtilities {
} }
public static boolean canSwing(Mob agent) { public static boolean canSwing(Mob agent) {
return (agent.isAlive() && !agent.getBonuses().getBool(ModType.Stunned, SourceType.None)); return (agent.isAlive() && !agent.getBonuses().getBool(ModType.Stunned, SourceType.NONE));
} }
public static void swingIsMiss(Mob agent, AbstractWorldObject target, int animation) { public static void swingIsMiss(Mob agent, AbstractWorldObject target, int animation) {
@ -216,10 +216,10 @@ public class CombatUtilities {
else else
speed = agent.getSpeedHandTwo(); speed = agent.getSpeedHandTwo();
SourceType dt = SourceType.Crushing; SourceType dt = SourceType.CRUSHING;
if (agent.isSiege()) if (agent.isSiege())
dt = SourceType.Siege; dt = SourceType.SIEGE;
if (wb != null) { if (wb != null) {
anim = CombatManager.getSwingAnimation(wb, null, mainHand); anim = CombatManager.getSwingAnimation(wb, null, mainHand);
dt = wb.getDamageType(); dt = wb.getDamageType();
@ -246,7 +246,7 @@ public class CombatUtilities {
//must not be immune to all or immune to attack //must not be immune to all or immune to attack
if (bonus != null && !bonus.getBool(ModType.NoMod, SourceType.ImmuneToAttack)) if (bonus != null && !bonus.getBool(ModType.NoMod, SourceType.IMMUNETOATTACK))
if (res != null && (res.immuneToAll() || res.immuneToAttacks() || res.immuneTo(dt))) if (res != null && (res.immuneToAll() || res.immuneToAttacks() || res.immuneTo(dt)))
return; return;
@ -330,7 +330,7 @@ public class CombatUtilities {
} }
public static SourceType getDamageType(Mob agent) { public static SourceType getDamageType(Mob agent) {
SourceType dt = SourceType.Crushing; SourceType dt = SourceType.CRUSHING;
if (agent.getEquip().get(1) != null) { if (agent.getEquip().get(1) != null) {
return agent.getEquip().get(1).getItemBase().getDamageType(); return agent.getEquip().get(1).getItemBase().getDamageType();
} }

2
src/engine/mobileAI/utilities/MovementUtilities.java

@ -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) {

2
src/engine/net/client/ClientMessagePump.java

@ -1642,7 +1642,7 @@ public class ClientMessagePump implements NetMsgHandler {
short dur = toRepair.getDurabilityCurrent(); short dur = toRepair.getDurabilityCurrent();
short max = toRepair.getDurabilityMax(); short max = toRepair.getDurabilityMax();
//account for durability modifications //account for durability modifications
float durMod = toRepair.getBonusPercent(ModType.Durability, SourceType.None); float durMod = toRepair.getBonusPercent(ModType.Durability, SourceType.NONE);
max *= (1 + (durMod * 0.01f)); max *= (1 + (durMod * 0.01f));
if (dur >= max || dur < 1) { if (dur >= max || dur < 1) {
//redundancy message to clear item from window in client //redundancy message to clear item from window in client

2
src/engine/objects/AbstractCharacter.java

@ -515,7 +515,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;

2
src/engine/objects/AbstractIntelligenceAgent.java

@ -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;
} }

6
src/engine/objects/CharacterSkill.java

@ -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;
} }

60
src/engine/objects/Mob.java

@ -712,19 +712,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
@ -741,7 +741,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()) {
@ -838,7 +838,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());
@ -1079,15 +1079,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
@ -1191,18 +1191,18 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
// add any bonuses // add any bonuses
defense += (short) this.bonuses.getFloat(ModType.DCV, SourceType.None); defense += (short) this.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 = 1 + this.bonuses.getFloatPercentPositive(ModType.DCV, SourceType.None); float pos_Bonus = 1 + this.bonuses.getFloatPercentPositive(ModType.DCV, SourceType.NONE);
defense = (short) (defense * pos_Bonus); defense = (short) (defense * pos_Bonus);
//Lucky rune applies next //Lucky rune applies next
float neg_Bonus = this.bonuses.getFloatPercentNegative(ModType.DCV, SourceType.None); float neg_Bonus = this.bonuses.getFloatPercentNegative(ModType.DCV, SourceType.NONE);
defense = (short) (defense * (1 + neg_Bonus)); defense = (short) (defense * (1 + neg_Bonus));
@ -1397,16 +1397,16 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
// add in any bonuses to atr // add in any bonuses to atr
if (this.bonuses != null) { if (this.bonuses != null) {
atr += this.bonuses.getFloat(ModType.OCV, SourceType.None); atr += this.bonuses.getFloat(ModType.OCV, SourceType.NONE);
// Finally use any multipliers. DO THIS LAST! // Finally use any multipliers. DO THIS LAST!
float pos_Bonus = 1 + this.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.None); float pos_Bonus = 1 + this.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.NONE);
atr *= pos_Bonus; atr *= pos_Bonus;
//and negative percent modifiers //and negative percent modifiers
//TODO DO DEBUFFS AFTER?? wILL TEst when finished //TODO DO DEBUFFS AFTER?? wILL TEst when finished
float neg_Bonus = this.bonuses.getFloatPercentNegative(ModType.OCV, SourceType.None); float neg_Bonus = this.bonuses.getFloatPercentNegative(ModType.OCV, SourceType.NONE);
atr *= (1 + neg_Bonus); atr *= (1 + neg_Bonus);
} }
@ -1427,8 +1427,8 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
else else
speed = 20f; //unarmed attack speed speed = 20f; //unarmed attack speed
if (this.bonuses != null && this.bonuses.getFloat(ModType.AttackDelay, SourceType.None) != 0f) //add effects speed bonus if (this.bonuses != null && this.bonuses.getFloat(ModType.AttackDelay, SourceType.NONE) != 0f) //add effects speed bonus
speed *= (1 + this.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.None)); speed *= (1 + this.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.NONE));
if (speed < 10) if (speed < 10)
speed = 10; speed = 10;
@ -1460,12 +1460,12 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
if (this.bonuses != null) { if (this.bonuses != null) {
// Add any base bonuses // Add any base bonuses
minDamage += this.bonuses.getFloat(ModType.MinDamage, SourceType.None); minDamage += this.bonuses.getFloat(ModType.MinDamage, SourceType.NONE);
maxDamage += this.bonuses.getFloat(ModType.MaxDamage, SourceType.None); maxDamage += this.bonuses.getFloat(ModType.MaxDamage, SourceType.NONE);
// Finally use any multipliers. DO THIS LAST! // Finally use any multipliers. DO THIS LAST!
minDamage *= (1 + this.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.None)); minDamage *= (1 + this.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.NONE));
maxDamage *= (1 + this.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.None)); maxDamage *= (1 + this.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.NONE));
} }
// set damages // set damages

8
src/engine/objects/PlayerBonuses.java

@ -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);
} }
} }

120
src/engine/objects/PlayerCharacter.java

@ -3110,7 +3110,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();
@ -3614,8 +3614,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;
@ -3683,21 +3683,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
@ -3823,10 +3823,10 @@ public class PlayerCharacter extends AbstractCharacter {
if (this.bonuses != null) { if (this.bonuses != null) {
// add any bonuses // add any bonuses
defense += (short) this.bonuses.getFloat(ModType.DCV, SourceType.None); defense += (short) this.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 = this.bonuses.getFloatPercentPositive(ModType.DCV, SourceType.None); float pos_Bonus = this.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
@ -3835,7 +3835,7 @@ public class PlayerCharacter extends AbstractCharacter {
//and negative percent modifiers //and negative percent modifiers
//already done... //already done...
float neg_Bonus = this.bonuses.getFloatPercentNegative(ModType.DCV, SourceType.None); float neg_Bonus = this.bonuses.getFloatPercentNegative(ModType.DCV, SourceType.NONE);
defense = (short) (defense * (1 + neg_Bonus)); defense = (short) (defense * (1 + neg_Bonus));
} else } else
@ -3907,7 +3907,7 @@ public class PlayerCharacter extends AbstractCharacter {
this.rangeHandTwo = weapon.getItemBase().getRange() * (1 + (this.statStrBase / 600)); this.rangeHandTwo = weapon.getItemBase().getRange() * (1 + (this.statStrBase / 600));
if (this.bonuses != null) { if (this.bonuses != null) {
float range_bonus = 1 + this.bonuses.getFloatPercentAll(ModType.WeaponRange, SourceType.None); float range_bonus = 1 + this.bonuses.getFloatPercentAll(ModType.WeaponRange, SourceType.NONE);
if (mainHand) if (mainHand)
this.rangeHandOne *= range_bonus; this.rangeHandOne *= range_bonus;
@ -3958,10 +3958,10 @@ public class PlayerCharacter extends AbstractCharacter {
// add in any bonuses to atr // add in any bonuses to atr
if (this.bonuses != null) { if (this.bonuses != null) {
// Add any base bonuses // Add any base bonuses
atr += this.bonuses.getFloat(ModType.OCV, SourceType.None); atr += this.bonuses.getFloat(ModType.OCV, SourceType.NONE);
// Finally use any multipliers. DO THIS LAST! // Finally use any multipliers. DO THIS LAST!
float pos_Bonus = (1 + this.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.None)); float pos_Bonus = (1 + this.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.NONE));
atr *= pos_Bonus; atr *= pos_Bonus;
// next precise // next precise
@ -3969,7 +3969,7 @@ public class PlayerCharacter extends AbstractCharacter {
// 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 = this.bonuses.getFloatPercentNegative(ModType.OCV, SourceType.None); float neg_Bonus = this.bonuses.getFloatPercentNegative(ModType.OCV, SourceType.NONE);
atr *= (1 + neg_Bonus); atr *= (1 + neg_Bonus);
} }
@ -3989,8 +3989,8 @@ public class PlayerCharacter extends AbstractCharacter {
else else
speed = 20f; //unarmed attack speed speed = 20f; //unarmed attack speed
if (weapon != null) if (weapon != null)
speed *= (1 + this.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.None)); speed *= (1 + this.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.NONE));
speed *= (1 + this.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.None)); speed *= (1 + this.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.NONE));
if (speed < 10) if (speed < 10)
speed = 10; speed = 10;
@ -3998,21 +3998,21 @@ public class PlayerCharacter extends AbstractCharacter {
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;
@ -4047,21 +4047,21 @@ public class PlayerCharacter extends AbstractCharacter {
// add in any bonuses to damage // add in any bonuses to damage
if (this.bonuses != null) { if (this.bonuses != null) {
// Add any base bonuses // Add any base bonuses
minDamage += this.bonuses.getFloat(ModType.MinDamage, SourceType.None); minDamage += this.bonuses.getFloat(ModType.MinDamage, SourceType.NONE);
maxDamage += this.bonuses.getFloat(ModType.MaxDamage, SourceType.None); maxDamage += this.bonuses.getFloat(ModType.MaxDamage, SourceType.NONE);
minDamage += this.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.None); minDamage += this.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.NONE);
maxDamage += this.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.None); maxDamage += this.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 += this.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.None); percentMinDamage += this.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.NONE);
percentMinDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None); percentMinDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.NONE);
percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.None); percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.NONE);
percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None); percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.NONE);
minDamage *= percentMinDamage; minDamage *= percentMinDamage;
maxDamage *= percentMaxDamage; maxDamage *= percentMaxDamage;
@ -4099,8 +4099,8 @@ public class PlayerCharacter extends AbstractCharacter {
float def = ab.getDefense(); float def = ab.getDefense();
//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));
} }
@ -4121,24 +4121,24 @@ public class PlayerCharacter extends AbstractCharacter {
wbOff = off.getItemBase(); wbOff = off.getItemBase();
//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.getItemBase() != null && off.getItemBase().isShield()) if (off != null && off.getItemBase() != null && off.getItemBase().isShield())
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.getRange() < MBServerStatics.RANGED_WEAPON_RANGE) if (wbMain == null || wbMain.getRange() < MBServerStatics.RANGED_WEAPON_RANGE)
if (wbOff == null || wbOff.getRange() < MBServerStatics.RANGED_WEAPON_RANGE) if (wbOff == null || wbOff.getRange() < MBServerStatics.RANGED_WEAPON_RANGE)
this.bonuses.setBool(ModType.Parry, SourceType.None, true); this.bonuses.setBool(ModType.Parry, SourceType.NONE, true);
} }
@ -4171,8 +4171,8 @@ public class PlayerCharacter extends AbstractCharacter {
float def = ib.getDefense(); float def = ib.getDefense();
//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));
} }
@ -4354,13 +4354,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));
} }
@ -4395,11 +4395,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
@ -4411,7 +4411,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)
@ -4429,7 +4429,7 @@ public class PlayerCharacter extends AbstractCharacter {
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
@ -4444,7 +4444,7 @@ public class PlayerCharacter extends AbstractCharacter {
amount += this.bonuses.getFloat(modType, sourceType); amount += this.bonuses.getFloat(modType, sourceType);
// Add item bonuses and return // Add item bonuses and return
if (sourceType.equals(SourceType.Dodge) && !fromCombat) if (sourceType.equals(SourceType.DODGE) && !fromCombat)
return ((amount / 4) - attackerLevel + this.getLevel()) / 4; return ((amount / 4) - attackerLevel + this.getLevel()) / 4;
else else
return (amount - attackerLevel + this.getLevel()) / 4; return (amount - attackerLevel + this.getLevel()) / 4;
@ -4913,7 +4913,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;

245
src/engine/objects/Resists.java

@ -84,19 +84,19 @@ 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(SourceType.SLASHING, rs.getFloat("slash"));
this.resists.put(SourceType.Crushing, rs.getFloat("crush")); this.resists.put(SourceType.CRUSHING, rs.getFloat("crush"));
this.resists.put(SourceType.Piercing, rs.getFloat("pierce")); this.resists.put(SourceType.PIERCING, rs.getFloat("pierce"));
this.resists.put(SourceType.Magic, rs.getFloat("magic")); this.resists.put(SourceType.MAGIC, rs.getFloat("magic"));
this.resists.put(SourceType.Bleeding, rs.getFloat("bleed")); this.resists.put(SourceType.BLEEDING, rs.getFloat("bleed"));
this.resists.put(SourceType.Poison, rs.getFloat("poison")); this.resists.put(SourceType.POISON, rs.getFloat("poison"));
this.resists.put(SourceType.Mental, rs.getFloat("mental")); this.resists.put(SourceType.MENTAL, rs.getFloat("mental"));
this.resists.put(SourceType.Holy, rs.getFloat("holy")); this.resists.put(SourceType.HOLY, rs.getFloat("holy"));
this.resists.put(SourceType.Unholy, rs.getFloat("unholy")); this.resists.put(SourceType.UNHOLY, rs.getFloat("unholy"));
this.resists.put(SourceType.Lightning, rs.getFloat("lightning")); this.resists.put(SourceType.LIGHTNING, rs.getFloat("lightning"));
this.resists.put(SourceType.Fire, rs.getFloat("fire")); this.resists.put(SourceType.FIRE, rs.getFloat("fire"));
this.resists.put(SourceType.Cold, rs.getFloat("cold")); this.resists.put(SourceType.COLD, rs.getFloat("cold"));
this.resists.put(SourceType.Healing, 0f); this.resists.put(SourceType.HEALING, 0f);
} }
//Handle Fortitudes //Handle Fortitudes
@ -106,8 +106,8 @@ public class Resists {
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 == SourceType.HEALING)
return damage; return damage;
//is fortitude, Are we under the cap? //is fortitude, Are we under the cap?
@ -127,7 +127,7 @@ 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;
@ -138,7 +138,7 @@ public class Resists {
for (SourceType fort : forts) { for (SourceType fort : forts) {
SourceType dt = SourceType.valueOf(fort.name()); SourceType dt = SourceType.valueOf(fort.name());
if (dt == SourceType.None) if (dt == SourceType.NONE)
continue; continue;
if (dt == damageType) { if (dt == damageType) {
@ -194,19 +194,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(SourceType.SLASHING, 85f);
this.resists.put(SourceType.Crushing, 85f); this.resists.put(SourceType.CRUSHING, 85f);
this.resists.put(SourceType.Siege, 0f); this.immuneTo.put(SourceType.PIERCING, true);
this.immuneTo.put(SourceType.Piercing, true); this.immuneTo.put(SourceType.MAGIC, true);
this.immuneTo.put(SourceType.Magic, true); this.immuneTo.put(SourceType.BLEEDING, true);
this.immuneTo.put(SourceType.Bleeding, true); this.immuneTo.put(SourceType.POISON, true);
this.immuneTo.put(SourceType.Poison, true); this.immuneTo.put(SourceType.MENTAL, true);
this.immuneTo.put(SourceType.Mental, true); this.immuneTo.put(SourceType.HOLY, true);
this.immuneTo.put(SourceType.Holy, true); this.immuneTo.put(SourceType.UNHOLY, true);
this.immuneTo.put(SourceType.Unholy, true); this.immuneTo.put(SourceType.LIGHTNING, true);
this.immuneTo.put(SourceType.Lightning, true); this.immuneTo.put(SourceType.FIRE, true);
this.immuneTo.put(SourceType.Fire, true); this.immuneTo.put(SourceType.COLD, true);
this.immuneTo.put(SourceType.Cold, true); this.resists.put(SourceType.SIEGE, 0f);
} }
@ -215,19 +215,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(SourceType.SLASHING, true);
this.immuneTo.put(SourceType.Crushing, true); this.immuneTo.put(SourceType.CRUSHING, true);
this.immuneTo.put(SourceType.Piercing, true); this.immuneTo.put(SourceType.PIERCING, true);
this.immuneTo.put(SourceType.Magic, true); this.immuneTo.put(SourceType.MAGIC, true);
this.immuneTo.put(SourceType.Bleeding, true); this.immuneTo.put(SourceType.BLEEDING, true);
this.immuneTo.put(SourceType.Poison, true); this.immuneTo.put(SourceType.POISON, true);
this.immuneTo.put(SourceType.Mental, true); this.immuneTo.put(SourceType.MENTAL, true);
this.immuneTo.put(SourceType.Holy, true); this.immuneTo.put(SourceType.HOLY, true);
this.immuneTo.put(SourceType.Unholy, true); this.immuneTo.put(SourceType.UNHOLY, true);
this.immuneTo.put(SourceType.Lightning, true); this.immuneTo.put(SourceType.LIGHTNING, true);
this.immuneTo.put(SourceType.Fire, true); this.immuneTo.put(SourceType.FIRE, true);
this.immuneTo.put(SourceType.Cold, true); this.immuneTo.put(SourceType.COLD, true);
this.resists.put(SourceType.Siege, 0f); this.resists.put(SourceType.SIEGE, 0f);
} }
/** /**
@ -235,20 +235,20 @@ 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(SourceType.SLASHING, 0f);
this.resists.put(SourceType.Crushing, 0f); this.resists.put(SourceType.CRUSHING, 0f);
this.resists.put(SourceType.Piercing, 0f); this.resists.put(SourceType.PIERCING, 0f);
this.resists.put(SourceType.Magic, 0f); this.resists.put(SourceType.MAGIC, 0f);
this.resists.put(SourceType.Bleeding, 0f); this.resists.put(SourceType.BLEEDING, 0f);
this.resists.put(SourceType.Poison, 0f); this.resists.put(SourceType.POISON, 0f);
this.resists.put(SourceType.Mental, 0f); this.resists.put(SourceType.MENTAL, 0f);
this.resists.put(SourceType.Holy, 0f); this.resists.put(SourceType.HOLY, 0f);
this.resists.put(SourceType.Unholy, 0f); this.resists.put(SourceType.UNHOLY, 0f);
this.resists.put(SourceType.Lightning, 0f); this.resists.put(SourceType.LIGHTNING, 0f);
this.resists.put(SourceType.Fire, 0f); this.resists.put(SourceType.FIRE, 0f);
this.resists.put(SourceType.Cold, 0f); this.resists.put(SourceType.COLD, 0f);
this.resists.put(SourceType.Healing, 0f); this.resists.put(SourceType.HEALING, 0f);
this.immuneTo.put(SourceType.Siege, true); this.immuneTo.put(SourceType.SIEGE, true);
} }
@ -292,10 +292,9 @@ public class Resists {
} }
public boolean immuneToAttacks() { public boolean immuneToAttacks() {
return immuneTo(SourceType.ImmuneToAttack); return immuneTo(SourceType.IMMUNETOATTACK);
} }
/** /**
* Set a resist * Set a resist
*/ */
@ -303,37 +302,6 @@ public class Resists {
this.resists.put(type, value); this.resists.put(type, value);
} }
/**
* set immunities from mobbase
*/
public void setImmuneTo(int immune) {
setImmuneTo(SourceType.Stun, ((immune & 1) != 0));
setImmuneTo(SourceType.Powerblock, ((immune & 2) != 0));
setImmuneTo(SourceType.Drain, ((immune & 4) != 0));
setImmuneTo(SourceType.Snare, ((immune & 8) != 0));
setImmuneTo(SourceType.Siege, ((immune & 16) != 0));
setImmuneTo(SourceType.Slashing, ((immune & 32) != 0));
setImmuneTo(SourceType.Crushing, ((immune & 64) != 0));
setImmuneTo(SourceType.Piercing, ((immune & 128) != 0));
setImmuneTo(SourceType.Magic, ((immune & 256) != 0));
setImmuneTo(SourceType.Bleeding, ((immune & 512) != 0));
setImmuneTo(SourceType.Poison, ((immune & 1024) != 0));
setImmuneTo(SourceType.Mental, ((immune & 2048) != 0));
setImmuneTo(SourceType.Holy, ((immune & 4096) != 0));
setImmuneTo(SourceType.Unholy, ((immune & 8192) != 0));
setImmuneTo(SourceType.Lightning, ((immune & 16384) != 0));
setImmuneTo(SourceType.Fire, ((immune & 32768) != 0));
setImmuneTo(SourceType.Cold, ((immune & 65536) != 0));
setImmuneTo(SourceType.Steal, ((immune & 131072) != 0));
}
/**
* set/unset immuneTo
*/
public void setImmuneTo(SourceType type, boolean value) {
this.immuneTo.put(type, value);
}
/** /**
* set immuneToAll * set immuneToAll
*/ */
@ -357,7 +325,7 @@ public class Resists {
//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
if (target != null) { if (target != null) {
@ -390,41 +358,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(SourceType.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(SourceType.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(SourceType.IMMUNETOATTACK, true);
if (rb.getBool(ModType.ImmuneToPowers, SourceType.None)) if (rb.getBool(ModType.ImmuneToPowers, SourceType.NONE))
this.immuneTo.put(SourceType.ImmuneToPowers, true); this.immuneTo.put(SourceType.IMMUNETOPOWERS, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.Powerblock)) if (rb.getBool(ModType.ImmuneTo, SourceType.POWERBLOCK))
this.immuneTo.put(SourceType.Powerblock, true); this.immuneTo.put(SourceType.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(SourceType.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(SourceType.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(SourceType.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(SourceType.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(SourceType.SNARE, true);
// Handle resists // Handle resists
slash += rb.getFloat(ModType.Resistance, SourceType.Slashing); slash += rb.getFloat(ModType.Resistance, SourceType.SLASHING);
crush += rb.getFloat(ModType.Resistance, SourceType.Crushing); crush += rb.getFloat(ModType.Resistance, SourceType.CRUSHING);
pierce += rb.getFloat(ModType.Resistance, SourceType.Piercing); pierce += rb.getFloat(ModType.Resistance, SourceType.PIERCING);
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.BLEEDING);
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());
} }
@ -448,21 +416,20 @@ public class Resists {
} }
} }
this.resists.put(SourceType.Slashing, slash); this.resists.put(SourceType.SLASHING, slash);
this.resists.put(SourceType.Crushing, crush); this.resists.put(SourceType.CRUSHING, crush);
this.resists.put(SourceType.Piercing, pierce); this.resists.put(SourceType.PIERCING, pierce);
this.resists.put(SourceType.Magic, magic); this.resists.put(SourceType.MAGIC, magic);
this.resists.put(SourceType.Bleeding, bleed); this.resists.put(SourceType.BLEEDING, bleed);
this.resists.put(SourceType.Poison, poison); this.resists.put(SourceType.POISON, poison);
this.resists.put(SourceType.Mental, mental); this.resists.put(SourceType.MENTAL, mental);
this.resists.put(SourceType.Holy, holy); this.resists.put(SourceType.HOLY, holy);
this.resists.put(SourceType.Unholy, unholy); this.resists.put(SourceType.UNHOLY, unholy);
this.resists.put(SourceType.Lightning, lightning); this.resists.put(SourceType.LIGHTNING, lightning);
this.resists.put(SourceType.Fire, fire); this.resists.put(SourceType.FIRE, fire);
this.resists.put(SourceType.Cold, cold); this.resists.put(SourceType.COLD, cold);
this.resists.put(SourceType.Healing, healing); this.resists.put(SourceType.HEALING, healing);
this.immuneTo.put(SourceType.SIEGE, true);
this.immuneTo.put(SourceType.Siege, true);
// debug printing of resists // debug printing of resists
// printResists(pc); // printResists(pc);

14
src/engine/powers/ActionsBase.java

@ -245,21 +245,21 @@ public class ActionsBase {
return false; return false;
//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);

2
src/engine/powers/effectmodifiers/AmbidexterityEffectModifier.java

@ -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

2
src/engine/powers/effectmodifiers/BlockedPowerTypeEffectModifier.java

@ -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;
} }

4
src/engine/powers/effectmodifiers/HealthEffectModifier.java

@ -164,7 +164,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;
@ -203,7 +203,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);

4
src/engine/powers/effectmodifiers/ManaEffectModifier.java

@ -129,7 +129,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;
@ -157,7 +157,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);

2
src/engine/powers/effectmodifiers/NoModEffectModifier.java

@ -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;

4
src/engine/powers/effectmodifiers/StaminaEffectModifier.java

@ -125,7 +125,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;
@ -153,7 +153,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);

2
src/engine/powers/poweractions/ApplyEffectPowerAction.java

@ -187,7 +187,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;

4
src/engine/powers/poweractions/TransferStatPowerAction.java

@ -217,7 +217,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;
@ -243,7 +243,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);

Loading…
Cancel
Save