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 { @@ -775,118 +775,117 @@ public class Enum {
}
public enum SourceType {
None,
Abjuration,
Acid,
AntiSiege,
Archery,
Axe,
Bardsong,
Beastcraft,
Benediction,
BladeWeaving,
Bleeding,
Blind,
Block,
Bloodcraft,
Bow,
Buff,
Channeling,
Charm,
Cold,
Constitution,
Corruption,
Crossbow,
Crushing,
Dagger,
DaggerMastery,
DeBuff,
Dexterity,
Disease,
Dodge,
Dragon,
Drain,
Earth,
Effect,
Exorcism,
Fear,
Fire,
Fly,
Giant,
GreatAxeMastery,
GreatSwordMastery,
Hammer,
Healing,
Holy,
ImmuneToAttack,
ImmuneToPowers,
Intelligence,
Invisible,
Lightning,
NONE,
ABJURATION,
ACID,
ANTISIEGE,
ARCHERY,
AXE,
BARDSONG,
BEASTCRAFT,
BENEDICTION,
BLADEWEAVING,
BLEEDING,
BLIND,
BLOCK,
BLOODCRAFT,
BOW,
BUFF,
CHANNELING,
CHARM,
COLD,
CONSTITUTION,
CORRUPTION,
CROSSBOW,
CRUSHING,
DAGGER,
DAGGERMASTERY,
DEBUFF,
DEXTERITY,
DISEASE,
DODGE,
DRAGON,
DRAIN,
EARTH,
EFFECT,
EXORCISM,
FEAR,
FIRE,
FLY,
GIANT,
GREATAXEMASTERY,
GREATSWORDMASTERY,
HAMMER,
HEALING,
HOLY,
IMMUNETOATTACK,
IMMUNETOPOWERS,
INTELLIGENCE,
INVISIBLE,
LIGHTNING,
Liturgy,
Magic,
Mental,
NatureLore,
Necromancy,
Parry,
Piercing,
Poison,
PoleArm,
Powerblock,
Rat,
ResistDeBuff,
Restoration,
Root,
Shadowmastery,
Siege,
Slashing,
Snare,
Sorcery,
Spear,
SpearMastery,
Spirit,
Staff,
Steal,
Stormcalling,
Strength,
Stun,
Summon,
Sword,
SwordMastery,
Thaumaturgy,
Theurgy,
Transform,
UnarmedCombat,
UnarmedCombatMastery,
Unholy,
Unknown,
Warding,
Warlockry,
WayoftheGaana,
WearArmorHeavy,
WearArmorLight,
WearArmorMedium,
Wereform,
Athletics,
AxeMastery,
Bargaining,
BladeMastery,
FlameCalling,
GreatHammerMastery,
HammerMastery,
Leadership,
PoleArmMastery,
Running,
StaffMastery,
Throwing,
Toughness,
WayoftheWolf,
WayoftheRat,
WayoftheBear,
Orthanatos,
SunDancing,
//Power categories.
LITURGY,
MAGIC,
MENTAL,
NATURELORE,
NECROMANCY,
PARRY,
PIERCING,
POISON,
POLEARM,
POWERBLOCK,
RAT,
RESISTDEBUFF,
RESTORATION,
ROOT,
SHADOWMASTERY,
SIEGE,
SLASHING,
SNARE,
SORCERY,
SPEAR,
SPEARMASTERY,
SPIRIT,
STAFF,
STEAL,
STORMCALLING,
STRENGTH,
STUN,
SUMMON,
SWORD,
SWORDMASTERY,
THAUMATURGY,
THEURGY,
TRANSFORM,
UNARMEDCOMBAT,
UNARMEDCOMBATMASTERY,
UNHOLY,
UNKNOWN,
WARDING,
WARLOCKRY,
WAYOFTHEGAANA,
WEARARMORHEAVY,
WEARARMORLIGHT,
WEARARMORMEDIUM,
WEREFORM,
ATHLETICS,
AXEMASTERY,
BARGAINING,
BLADEMASTERY,
FLAMECALLING,
GREATHAMMERMASTERY,
HAMMERMASTERY,
LEADERSHIP,
POLEARMMASTERY,
RUNNING,
STAFFMASTERY,
THROWING,
TOUGHNESS,
WAYOFTHEWOLF,
WAYOFTHERAT,
WAYOFTHEBEAR,
ORTHANATOS,
SUNDANCING,
//POWER CATEGORIES.
AE,
AEDAMAGE,
BEHAVIOR,
@ -894,10 +893,8 @@ public class Enum { @@ -894,10 +893,8 @@ public class Enum {
BOONCLASS,
BOONRACE,
BREAKFLY,
BUFF,
CHANT,
DAMAGE,
DEBUFF,
DISPEL,
FLIGHT,
GROUPBUFF,
@ -910,27 +907,24 @@ public class Enum { @@ -910,27 +907,24 @@ public class Enum {
SPIREDISABLE,
SPIREPROOFTELEPORT,
STANCE,
STUN,
SUMMON,
TELEPORT,
THIEF,
TRACK,
TRANSFORM,
VAMPDRAIN,
WEAPON,
Wizardry;
WIZARDRY;
public static SourceType GetSourceType(String modName) {
SourceType returnMod;
if (modName.isEmpty())
return SourceType.None;
return SourceType.NONE;
try {
returnMod = SourceType.valueOf(modName.replace(",", ""));
} catch (Exception e) {
Logger.error(modName);
Logger.error(e);
return SourceType.None;
return SourceType.NONE;
}
return returnMod;
}

2
src/engine/gameManager/ChatManager.java

@ -165,7 +165,7 @@ public enum ChatManager { @@ -165,7 +165,7 @@ public enum ChatManager {
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);
return true;
}

26
src/engine/gameManager/CombatManager.java

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

4
src/engine/gameManager/MovementManager.java

@ -75,7 +75,7 @@ public enum MovementManager { @@ -75,7 +75,7 @@ public enum MovementManager {
toMove.setIsCasting(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;
}
@ -405,7 +405,7 @@ public enum MovementManager { @@ -405,7 +405,7 @@ public enum MovementManager {
//don't move if player is stunned or rooted
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;
member.update();

6
src/engine/gameManager/NPCManager.java

@ -425,9 +425,9 @@ public enum NPCManager { @@ -425,9 +425,9 @@ public enum NPCManager {
for(MobEquipment equipped : mob.equip.values()){
ItemBase itemBase = equipped.getItemBase();
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.getCrushResist());
mob.resists.setResist(Enum.SourceType.Piercing, mob.resists.getResist(Enum.SourceType.Piercing, 0) + itemBase.getCrushResist());
mob.resists.setResist(Enum.SourceType.SLASHING, mob.resists.getResist(Enum.SourceType.SLASHING, 0) + itemBase.getSlashResist());
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.getPierceResist());
}
}
}

16
src/engine/gameManager/PowersManager.java

@ -330,7 +330,7 @@ public enum PowersManager { @@ -330,7 +330,7 @@ public enum PowersManager {
// verify player is not stunned or prohibited from casting
PlayerBonuses bonus = playerCharacter.getBonuses();
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;
// if moving make sure spell valid for movement
@ -466,7 +466,7 @@ public enum PowersManager { @@ -466,7 +466,7 @@ public enum PowersManager {
cost = 0;
if (bonus != null)
cost *= (1 + bonus.getFloatPercentAll(ModType.PowerCost, SourceType.None));
cost *= (1 + bonus.getFloatPercentAll(ModType.PowerCost, SourceType.NONE));
if (playerCharacter.getAltitude() > 0)
cost *= 1.5f;
@ -613,7 +613,7 @@ public enum PowersManager { @@ -613,7 +613,7 @@ public enum PowersManager {
// verify player is not stunned or prohibited from casting
PlayerBonuses bonus = caster.getBonuses();
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;
// if moving make sure spell valid for movement
@ -773,7 +773,7 @@ public enum PowersManager { @@ -773,7 +773,7 @@ public enum PowersManager {
PlayerBonuses bonus = playerCharacter.getBonuses();
if (bonus != null) {
if (bonus.getBool(ModType.Stunned, SourceType.None))
if (bonus.getBool(ModType.Stunned, SourceType.NONE))
return;
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
@ -1051,7 +1051,7 @@ public enum PowersManager { @@ -1051,7 +1051,7 @@ public enum PowersManager {
// verify player is not stunned or power type is blocked
PlayerBonuses bonus = caster.getBonuses();
if (bonus != null) {
if (bonus.getBool(ModType.Stunned, SourceType.None))
if (bonus.getBool(ModType.Stunned, SourceType.NONE))
return;
SourceType sourceType = SourceType.GetSourceType(pb.getCategory());
if (bonus.getBool(ModType.BlockedPowerType, sourceType))
@ -1469,7 +1469,7 @@ public enum PowersManager { @@ -1469,7 +1469,7 @@ public enum PowersManager {
it.remove();
else if (awo.getObjectType().equals(GameObjectType.PlayerCharacter)) {
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();
}
}
@ -1943,7 +1943,7 @@ public enum PowersManager { @@ -1943,7 +1943,7 @@ public enum PowersManager {
PlayerCharacter pcc = (PlayerCharacter) awo;
PlayerBonuses bonuses = pcc.getBonuses();
if (bonuses != null && bonuses.getBool(ModType.ImmuneToPowers, SourceType.None)) {
if (bonuses != null && bonuses.getBool(ModType.ImmuneToPowers, SourceType.NONE)) {
awolist.remove();
continue;
}
@ -2093,7 +2093,7 @@ public enum PowersManager { @@ -2093,7 +2093,7 @@ public enum PowersManager {
// Remove players who are in safe mode
PlayerCharacter pcc = (PlayerCharacter) awo;
PlayerBonuses bonuses = pcc.getBonuses();
if (bonuses != null && bonuses.getBool(ModType.ImmuneToPowers, SourceType.None)) {
if (bonuses != null && bonuses.getBool(ModType.ImmuneToPowers, SourceType.NONE)) {
awolist.remove();
continue;
}

2
src/engine/jobs/ChantJob.java

@ -52,7 +52,7 @@ public class ChantJob extends AbstractEffectJob { @@ -52,7 +52,7 @@ public class ChantJob extends AbstractEffectJob {
PowersManager.finishEffectTime(this.source, this.target, this.action, this.trains);
if (AbstractWorldObject.IsAbstractCharacter(source))
((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);
if (AbstractWorldObject.IsAbstractCharacter(source))
((AbstractCharacter) source).cancelLastChant();

2
src/engine/mobileAI/MobAI.java

@ -1013,7 +1013,7 @@ public class MobAI { @@ -1013,7 +1013,7 @@ public class MobAI {
if (mob.isSit() && mob.getTimeStamp("HEALTHRECOVERED") < System.currentTimeMillis() + 3000)
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.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis());

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

@ -126,7 +126,7 @@ public class CombatUtilities { @@ -126,7 +126,7 @@ public class CombatUtilities {
}
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) {
@ -216,10 +216,10 @@ public class CombatUtilities { @@ -216,10 +216,10 @@ public class CombatUtilities {
else
speed = agent.getSpeedHandTwo();
SourceType dt = SourceType.Crushing;
SourceType dt = SourceType.CRUSHING;
if (agent.isSiege())
dt = SourceType.Siege;
dt = SourceType.SIEGE;
if (wb != null) {
anim = CombatManager.getSwingAnimation(wb, null, mainHand);
dt = wb.getDamageType();
@ -246,7 +246,7 @@ public class CombatUtilities { @@ -246,7 +246,7 @@ public class CombatUtilities {
//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)))
return;
@ -330,7 +330,7 @@ public class CombatUtilities { @@ -330,7 +330,7 @@ public class CombatUtilities {
}
public static SourceType getDamageType(Mob agent) {
SourceType dt = SourceType.Crushing;
SourceType dt = SourceType.CRUSHING;
if (agent.getEquip().get(1) != null) {
return agent.getEquip().get(1).getItemBase().getDamageType();
}

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

@ -169,7 +169,7 @@ public class MovementUtilities { @@ -169,7 +169,7 @@ public class MovementUtilities {
if (agent.getMobBase() != null && Enum.MobFlagType.SENTINEL.elementOf(agent.getMobBase().getFlags()))
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) {

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

@ -1642,7 +1642,7 @@ public class ClientMessagePump implements NetMsgHandler { @@ -1642,7 +1642,7 @@ public class ClientMessagePump implements NetMsgHandler {
short dur = toRepair.getDurabilityCurrent();
short max = toRepair.getDurabilityMax();
//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));
if (dur >= max || dur < 1) {
//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 { @@ -515,7 +515,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
boolean canFly = false;
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;
return canFly;

2
src/engine/objects/AbstractIntelligenceAgent.java

@ -141,7 +141,7 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter { @@ -141,7 +141,7 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter {
float ret = MobAIThread.AI_BASE_AGGRO_RANGE;
if (this.bonuses != null)
ret *= (1 + this.bonuses.getFloatPercentAll(ModType.ScanRange, SourceType.None));
ret *= (1 + this.bonuses.getFloatPercentAll(ModType.ScanRange, SourceType.NONE));
return ret;
}

6
src/engine/objects/CharacterSkill.java

@ -306,12 +306,12 @@ public class CharacterSkill extends AbstractGameObject { @@ -306,12 +306,12 @@ public class CharacterSkill extends AbstractGameObject {
PlayerBonuses bonus = ac.getBonuses();
if (bonus == null)
return atr;
atr += bonus.getFloat(ModType.OCV, SourceType.None);
float pos_Bonus = bonus.getFloatPercentPositive(ModType.OCV, SourceType.None);
atr += bonus.getFloat(ModType.OCV, SourceType.NONE);
float pos_Bonus = bonus.getFloatPercentPositive(ModType.OCV, SourceType.NONE);
atr *= (1 + pos_Bonus);
//rUNES will already be applied
// 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);
return atr;
}

60
src/engine/objects/Mob.java

@ -712,19 +712,19 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed { @@ -712,19 +712,19 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
// TODO modify for equipment
if (this.bonuses != null) {
// modify for effects
strVal += this.bonuses.getFloat(ModType.Attr, SourceType.Strength);
dexVal += this.bonuses.getFloat(ModType.Attr, SourceType.Dexterity);
conVal += this.bonuses.getFloat(ModType.Attr, SourceType.Constitution);
intVal += this.bonuses.getFloat(ModType.Attr, SourceType.Intelligence);
spiVal += this.bonuses.getFloat(ModType.Attr, SourceType.Spirit);
strVal += this.bonuses.getFloat(ModType.Attr, SourceType.STRENGTH);
dexVal += this.bonuses.getFloat(ModType.Attr, SourceType.DEXTERITY);
conVal += this.bonuses.getFloat(ModType.Attr, SourceType.CONSTITUTION);
intVal += this.bonuses.getFloat(ModType.Attr, SourceType.INTELLIGENCE);
spiVal += this.bonuses.getFloat(ModType.Attr, SourceType.SPIRIT);
// apply dex penalty for armor
// modify percent amounts. DO THIS LAST!
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Strength));
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity));
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution));
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence));
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit));
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.STRENGTH));
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.DEXTERITY));
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.CONSTITUTION));
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.INTELLIGENCE));
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.SPIRIT));
}
// Set current stats
@ -741,7 +741,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed { @@ -741,7 +741,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
float bonus = 1;
if (this.bonuses != null)
// 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())
switch (this.mobBase.getLoadID()) {
@ -838,7 +838,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed { @@ -838,7 +838,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
if (!this.isMoving())
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
this.stopMovement(this.getMovementLoc());
@ -1079,15 +1079,15 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed { @@ -1079,15 +1079,15 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
// Apply any bonuses from runes and effects
if (this.bonuses != null) {
h += this.bonuses.getFloat(ModType.HealthFull, SourceType.None);
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.None);
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.None);
h += this.bonuses.getFloat(ModType.HealthFull, SourceType.NONE);
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.NONE);
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.NONE);
//apply effects percent modifiers. DO THIS LAST!
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None));
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None));
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None));
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.NONE));
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.NONE));
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.NONE));
}
// Set max health, mana and stamina
@ -1191,18 +1191,18 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed { @@ -1191,18 +1191,18 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
// 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!
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);
//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));
@ -1397,16 +1397,16 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed { @@ -1397,16 +1397,16 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
// add in any bonuses to atr
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!
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;
//and negative percent modifiers
//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);
}
@ -1427,8 +1427,8 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed { @@ -1427,8 +1427,8 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
else
speed = 20f; //unarmed attack speed
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));
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));
if (speed < 10)
speed = 10;
@ -1460,12 +1460,12 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed { @@ -1460,12 +1460,12 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
if (this.bonuses != null) {
// Add any base bonuses
minDamage += this.bonuses.getFloat(ModType.MinDamage, SourceType.None);
maxDamage += this.bonuses.getFloat(ModType.MaxDamage, SourceType.None);
minDamage += this.bonuses.getFloat(ModType.MinDamage, SourceType.NONE);
maxDamage += this.bonuses.getFloat(ModType.MaxDamage, SourceType.NONE);
// Finally use any multipliers. DO THIS LAST!
minDamage *= (1 + this.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.None));
maxDamage *= (1 + this.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.None));
minDamage *= (1 + this.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.NONE));
maxDamage *= (1 + this.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.NONE));
}
// set damages

8
src/engine/objects/PlayerBonuses.java

@ -229,7 +229,7 @@ public class PlayerBonuses { @@ -229,7 +229,7 @@ public class PlayerBonuses {
//Update seeInvis if needed
float seeInvis = this.getFloat(ModType.SeeInvisible, SourceType.None);
float seeInvis = this.getFloat(ModType.SeeInvisible, SourceType.NONE);
if (pc.getSeeInvis() < seeInvis)
pc.setSeeInvis((short) seeInvis);
@ -458,13 +458,13 @@ public class PlayerBonuses { @@ -458,13 +458,13 @@ public class PlayerBonuses {
float percentAmountNegative = this.getFloatPercentNegative(modType, sourceType);
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)
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)
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 { @@ -3110,7 +3110,7 @@ public class PlayerCharacter extends AbstractCharacter {
if (this.bonuses != null)
// 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
this.update();
@ -3614,8 +3614,8 @@ public class PlayerCharacter extends AbstractCharacter { @@ -3614,8 +3614,8 @@ public class PlayerCharacter extends AbstractCharacter {
//calculateModifiedStats();
//update hide and seeInvis levels
if (this.bonuses != null) {
this.hidden = (int) bonuses.getFloat(ModType.Invisible, SourceType.None);
this.seeInvis = (int) bonuses.getFloat(ModType.SeeInvisible, SourceType.None);
this.hidden = (int) bonuses.getFloat(ModType.Invisible, SourceType.NONE);
this.seeInvis = (int) bonuses.getFloat(ModType.SeeInvisible, SourceType.NONE);
} else {
this.hidden = (byte) 0;
this.seeInvis = (byte) 0;
@ -3683,21 +3683,21 @@ public class PlayerCharacter extends AbstractCharacter { @@ -3683,21 +3683,21 @@ public class PlayerCharacter extends AbstractCharacter {
// TODO modify for equipment
if (this.bonuses != null) {
// modify for effects
strVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Strength));
dexVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Dexterity));
conVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Constitution));
intVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Intelligence));
spiVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.Spirit));
strVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.STRENGTH));
dexVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.DEXTERITY));
conVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.CONSTITUTION));
intVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.INTELLIGENCE));
spiVal += Math.round(this.bonuses.getFloat(ModType.Attr, SourceType.SPIRIT));
// apply dex penalty for armor
dexVal *= this.dexPenalty;
// modify percent amounts. DO THIS LAST!
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Strength));
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity));
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution));
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence));
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit));
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.STRENGTH));
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.DEXTERITY));
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.CONSTITUTION));
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.INTELLIGENCE));
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.SPIRIT));
} else
// apply dex penalty for armor
@ -3823,10 +3823,10 @@ public class PlayerCharacter extends AbstractCharacter { @@ -3823,10 +3823,10 @@ public class PlayerCharacter extends AbstractCharacter {
if (this.bonuses != null) {
// 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!
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));
//Lucky rune applies next
@ -3835,7 +3835,7 @@ public class PlayerCharacter extends AbstractCharacter { @@ -3835,7 +3835,7 @@ public class PlayerCharacter extends AbstractCharacter {
//and negative percent modifiers
//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));
} else
@ -3907,7 +3907,7 @@ public class PlayerCharacter extends AbstractCharacter { @@ -3907,7 +3907,7 @@ public class PlayerCharacter extends AbstractCharacter {
this.rangeHandTwo = weapon.getItemBase().getRange() * (1 + (this.statStrBase / 600));
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)
this.rangeHandOne *= range_bonus;
@ -3958,10 +3958,10 @@ public class PlayerCharacter extends AbstractCharacter { @@ -3958,10 +3958,10 @@ public class PlayerCharacter extends AbstractCharacter {
// add in any bonuses to atr
if (this.bonuses != null) {
// 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!
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;
// next precise
@ -3969,7 +3969,7 @@ public class PlayerCharacter extends AbstractCharacter { @@ -3969,7 +3969,7 @@ public class PlayerCharacter extends AbstractCharacter {
// atr *= (1 + ((float) this.bonuses.getShort("rune.Attack") / 100));
//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);
}
@ -3989,8 +3989,8 @@ public class PlayerCharacter extends AbstractCharacter { @@ -3989,8 +3989,8 @@ public class PlayerCharacter extends AbstractCharacter {
else
speed = 20f; //unarmed attack speed
if (weapon != null)
speed *= (1 + this.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.None));
speed *= (1 + this.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.None));
speed *= (1 + this.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.NONE));
speed *= (1 + this.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.NONE));
if (speed < 10)
speed = 10;
@ -3998,21 +3998,21 @@ public class PlayerCharacter extends AbstractCharacter { @@ -3998,21 +3998,21 @@ public class PlayerCharacter extends AbstractCharacter {
if (weapon != null) {
// Add any base bonuses
min += weapon.getBonus(ModType.MinDamage, SourceType.None);
max += weapon.getBonus(ModType.MaxDamage, SourceType.None);
min += weapon.getBonus(ModType.MinDamage, SourceType.NONE);
max += weapon.getBonus(ModType.MaxDamage, SourceType.NONE);
min += weapon.getBonus(ModType.MeleeDamageModifier, SourceType.None);
max += weapon.getBonus(ModType.MeleeDamageModifier, SourceType.None);
min += weapon.getBonus(ModType.MeleeDamageModifier, SourceType.NONE);
max += weapon.getBonus(ModType.MeleeDamageModifier, SourceType.NONE);
// Finally use any multipliers. DO THIS LAST!
float percentMinDamage = 1;
float percentMaxDamage = 1;
percentMinDamage += weapon.getBonusPercent(ModType.MinDamage, SourceType.None);
percentMinDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, SourceType.None);
percentMinDamage += weapon.getBonusPercent(ModType.MinDamage, SourceType.NONE);
percentMinDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, SourceType.NONE);
percentMaxDamage += weapon.getBonusPercent(ModType.MaxDamage, SourceType.None);
percentMaxDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, SourceType.None);
percentMaxDamage += weapon.getBonusPercent(ModType.MaxDamage, SourceType.NONE);
percentMaxDamage += weapon.getBonusPercent(ModType.MeleeDamageModifier, SourceType.NONE);
min *= percentMinDamage;
@ -4047,21 +4047,21 @@ public class PlayerCharacter extends AbstractCharacter { @@ -4047,21 +4047,21 @@ public class PlayerCharacter extends AbstractCharacter {
// add in any bonuses to damage
if (this.bonuses != null) {
// Add any base bonuses
minDamage += this.bonuses.getFloat(ModType.MinDamage, SourceType.None);
maxDamage += this.bonuses.getFloat(ModType.MaxDamage, SourceType.None);
minDamage += this.bonuses.getFloat(ModType.MinDamage, SourceType.NONE);
maxDamage += this.bonuses.getFloat(ModType.MaxDamage, SourceType.NONE);
minDamage += this.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.None);
maxDamage += this.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.None);
minDamage += this.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.NONE);
maxDamage += this.bonuses.getFloat(ModType.MeleeDamageModifier, SourceType.NONE);
// Finally use any multipliers. DO THIS LAST!
float percentMinDamage = 1;
float percentMaxDamage = 1;
percentMinDamage += this.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.None);
percentMinDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
percentMinDamage += this.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.NONE);
percentMinDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.NONE);
percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.None);
percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.NONE);
percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.NONE);
minDamage *= percentMinDamage;
maxDamage *= percentMaxDamage;
@ -4099,8 +4099,8 @@ public class PlayerCharacter extends AbstractCharacter { @@ -4099,8 +4099,8 @@ public class PlayerCharacter extends AbstractCharacter {
float def = ab.getDefense();
//apply item defense bonuses
if (shield != null) {
def += shield.getBonus(ModType.DR, SourceType.None);
def *= (1 + shield.getBonusPercent(ModType.DR, SourceType.None));
def += shield.getBonus(ModType.DR, SourceType.NONE);
def *= (1 + shield.getBonusPercent(ModType.DR, SourceType.NONE));
}
@ -4121,24 +4121,24 @@ public class PlayerCharacter extends AbstractCharacter { @@ -4121,24 +4121,24 @@ public class PlayerCharacter extends AbstractCharacter {
wbOff = off.getItemBase();
//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 (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
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
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
this.bonuses.setBool(ModType.Parry, SourceType.None, false);
this.bonuses.setBool(ModType.Parry, SourceType.NONE, false);
if ((this.baseClass != null && this.baseClass.getObjectUUID() == 2500)
|| (this.promotionClass != null && this.promotionClass.getObjectUUID() == 2520))
if (wbMain == null || wbMain.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 { @@ -4171,8 +4171,8 @@ public class PlayerCharacter extends AbstractCharacter {
float def = ib.getDefense();
//apply item defense bonuses
if (armor != null) {
def += armor.getBonus(ModType.DR, SourceType.None);
def *= (1 + armor.getBonusPercent(ModType.DR, SourceType.None));
def += armor.getBonus(ModType.DR, SourceType.NONE);
def *= (1 + armor.getBonusPercent(ModType.DR, SourceType.NONE));
}
@ -4354,13 +4354,13 @@ public class PlayerCharacter extends AbstractCharacter { @@ -4354,13 +4354,13 @@ public class PlayerCharacter extends AbstractCharacter {
//apply effects
h += this.bonuses.getFloat(ModType.HealthFull, SourceType.None);
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.None);
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.None);
h += this.bonuses.getFloat(ModType.HealthFull, SourceType.NONE);
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.NONE);
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.NONE);
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None));
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None));
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None));
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.NONE));
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.NONE));
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.NONE));
}
@ -4395,11 +4395,11 @@ public class PlayerCharacter extends AbstractCharacter { @@ -4395,11 +4395,11 @@ public class PlayerCharacter extends AbstractCharacter {
ModType modType = ModType.GetModType(type);
// must be allowed to use this passive
if (!this.bonuses.getBool(modType, SourceType.None))
if (!this.bonuses.getBool(modType, SourceType.NONE))
return 0f;
// must not be stunned
if (this.bonuses.getBool(ModType.Stunned, SourceType.None))
if (this.bonuses.getBool(ModType.Stunned, SourceType.NONE))
return 0f;
// Get base skill amount
@ -4411,7 +4411,7 @@ public class PlayerCharacter extends AbstractCharacter { @@ -4411,7 +4411,7 @@ public class PlayerCharacter extends AbstractCharacter {
amount = sk.getModifiedAmount();
// Add bonuses
amount += this.bonuses.getFloat(modType, SourceType.None);
amount += this.bonuses.getFloat(modType, SourceType.NONE);
// Add item bonuses and return
if (type.equals(ModType.Dodge) && !fromCombat)
@ -4429,7 +4429,7 @@ public class PlayerCharacter extends AbstractCharacter { @@ -4429,7 +4429,7 @@ public class PlayerCharacter extends AbstractCharacter {
return 0f;
// must not be stunned
if (this.bonuses.getBool(ModType.Stunned, SourceType.None))
if (this.bonuses.getBool(ModType.Stunned, SourceType.NONE))
return 0f;
// Get base skill amount
@ -4444,7 +4444,7 @@ public class PlayerCharacter extends AbstractCharacter { @@ -4444,7 +4444,7 @@ public class PlayerCharacter extends AbstractCharacter {
amount += this.bonuses.getFloat(modType, sourceType);
// Add item bonuses and return
if (sourceType.equals(SourceType.Dodge) && !fromCombat)
if (sourceType.equals(SourceType.DODGE) && !fromCombat)
return ((amount / 4) - attackerLevel + this.getLevel()) / 4;
else
return (amount - attackerLevel + this.getLevel()) / 4;
@ -4913,7 +4913,7 @@ public class PlayerCharacter extends AbstractCharacter { @@ -4913,7 +4913,7 @@ public class PlayerCharacter extends AbstractCharacter {
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
this.stopMovement(newLoc);
return;

245
src/engine/objects/Resists.java

@ -84,19 +84,19 @@ public class Resists { @@ -84,19 +84,19 @@ public class Resists {
*/
public Resists(ResultSet rs) throws SQLException {
this.immuneToAll = false;
this.resists.put(SourceType.Slashing, rs.getFloat("slash"));
this.resists.put(SourceType.Crushing, rs.getFloat("crush"));
this.resists.put(SourceType.Piercing, rs.getFloat("pierce"));
this.resists.put(SourceType.Magic, rs.getFloat("magic"));
this.resists.put(SourceType.Bleeding, rs.getFloat("bleed"));
this.resists.put(SourceType.Poison, rs.getFloat("poison"));
this.resists.put(SourceType.Mental, rs.getFloat("mental"));
this.resists.put(SourceType.Holy, rs.getFloat("holy"));
this.resists.put(SourceType.Unholy, rs.getFloat("unholy"));
this.resists.put(SourceType.Lightning, rs.getFloat("lightning"));
this.resists.put(SourceType.Fire, rs.getFloat("fire"));
this.resists.put(SourceType.Cold, rs.getFloat("cold"));
this.resists.put(SourceType.Healing, 0f);
this.resists.put(SourceType.SLASHING, rs.getFloat("slash"));
this.resists.put(SourceType.CRUSHING, rs.getFloat("crush"));
this.resists.put(SourceType.PIERCING, rs.getFloat("pierce"));
this.resists.put(SourceType.MAGIC, rs.getFloat("magic"));
this.resists.put(SourceType.BLEEDING, rs.getFloat("bleed"));
this.resists.put(SourceType.POISON, rs.getFloat("poison"));
this.resists.put(SourceType.MENTAL, rs.getFloat("mental"));
this.resists.put(SourceType.HOLY, rs.getFloat("holy"));
this.resists.put(SourceType.UNHOLY, rs.getFloat("unholy"));
this.resists.put(SourceType.LIGHTNING, rs.getFloat("lightning"));
this.resists.put(SourceType.FIRE, rs.getFloat("fire"));
this.resists.put(SourceType.COLD, rs.getFloat("cold"));
this.resists.put(SourceType.HEALING, 0f);
}
//Handle Fortitudes
@ -106,8 +106,8 @@ public class Resists { @@ -106,8 +106,8 @@ public class Resists {
PlayerBonuses bonus = target.getBonuses();
//see if there is a fortitude
float damageCap = bonus.getFloatPercentAll(ModType.DamageCap, SourceType.None);
if (damageCap == 0f || type == SourceType.Healing)
float damageCap = bonus.getFloatPercentAll(ModType.DamageCap, SourceType.NONE);
if (damageCap == 0f || type == SourceType.HEALING)
return damage;
//is fortitude, Are we under the cap?
@ -127,7 +127,7 @@ public class Resists { @@ -127,7 +127,7 @@ public class Resists {
if (forts == null || !isValidDamageCapType(forts, type, exclusive))
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
float aadc = 1 + adjustedDamage;
return capFire * aadc;
@ -138,7 +138,7 @@ public class Resists { @@ -138,7 +138,7 @@ public class Resists {
for (SourceType fort : forts) {
SourceType dt = SourceType.valueOf(fort.name());
if (dt == SourceType.None)
if (dt == SourceType.NONE)
continue;
if (dt == damageType) {
@ -194,19 +194,19 @@ public class Resists { @@ -194,19 +194,19 @@ public class Resists {
*/
public final void setBuildingResists() {
this.immuneToAll = false;
this.resists.put(SourceType.Slashing, 85f);
this.resists.put(SourceType.Crushing, 85f);
this.resists.put(SourceType.Siege, 0f);
this.immuneTo.put(SourceType.Piercing, true);
this.immuneTo.put(SourceType.Magic, true);
this.immuneTo.put(SourceType.Bleeding, true);
this.immuneTo.put(SourceType.Poison, true);
this.immuneTo.put(SourceType.Mental, true);
this.immuneTo.put(SourceType.Holy, true);
this.immuneTo.put(SourceType.Unholy, true);
this.immuneTo.put(SourceType.Lightning, true);
this.immuneTo.put(SourceType.Fire, true);
this.immuneTo.put(SourceType.Cold, true);
this.resists.put(SourceType.SLASHING, 85f);
this.resists.put(SourceType.CRUSHING, 85f);
this.immuneTo.put(SourceType.PIERCING, true);
this.immuneTo.put(SourceType.MAGIC, true);
this.immuneTo.put(SourceType.BLEEDING, true);
this.immuneTo.put(SourceType.POISON, true);
this.immuneTo.put(SourceType.MENTAL, true);
this.immuneTo.put(SourceType.HOLY, true);
this.immuneTo.put(SourceType.UNHOLY, true);
this.immuneTo.put(SourceType.LIGHTNING, true);
this.immuneTo.put(SourceType.FIRE, true);
this.immuneTo.put(SourceType.COLD, true);
this.resists.put(SourceType.SIEGE, 0f);
}
@ -215,19 +215,19 @@ public class Resists { @@ -215,19 +215,19 @@ public class Resists {
*/
public final void setMineResists() {
this.immuneToAll = false;
this.immuneTo.put(SourceType.Slashing, true);
this.immuneTo.put(SourceType.Crushing, true);
this.immuneTo.put(SourceType.Piercing, true);
this.immuneTo.put(SourceType.Magic, true);
this.immuneTo.put(SourceType.Bleeding, true);
this.immuneTo.put(SourceType.Poison, true);
this.immuneTo.put(SourceType.Mental, true);
this.immuneTo.put(SourceType.Holy, true);
this.immuneTo.put(SourceType.Unholy, true);
this.immuneTo.put(SourceType.Lightning, true);
this.immuneTo.put(SourceType.Fire, true);
this.immuneTo.put(SourceType.Cold, true);
this.resists.put(SourceType.Siege, 0f);
this.immuneTo.put(SourceType.SLASHING, true);
this.immuneTo.put(SourceType.CRUSHING, true);
this.immuneTo.put(SourceType.PIERCING, true);
this.immuneTo.put(SourceType.MAGIC, true);
this.immuneTo.put(SourceType.BLEEDING, true);
this.immuneTo.put(SourceType.POISON, true);
this.immuneTo.put(SourceType.MENTAL, true);
this.immuneTo.put(SourceType.HOLY, true);
this.immuneTo.put(SourceType.UNHOLY, true);
this.immuneTo.put(SourceType.LIGHTNING, true);
this.immuneTo.put(SourceType.FIRE, true);
this.immuneTo.put(SourceType.COLD, true);
this.resists.put(SourceType.SIEGE, 0f);
}
/**
@ -235,20 +235,20 @@ public class Resists { @@ -235,20 +235,20 @@ public class Resists {
*/
public final void setGenericResists() {
this.immuneToAll = false;
this.resists.put(SourceType.Slashing, 0f);
this.resists.put(SourceType.Crushing, 0f);
this.resists.put(SourceType.Piercing, 0f);
this.resists.put(SourceType.Magic, 0f);
this.resists.put(SourceType.Bleeding, 0f);
this.resists.put(SourceType.Poison, 0f);
this.resists.put(SourceType.Mental, 0f);
this.resists.put(SourceType.Holy, 0f);
this.resists.put(SourceType.Unholy, 0f);
this.resists.put(SourceType.Lightning, 0f);
this.resists.put(SourceType.Fire, 0f);
this.resists.put(SourceType.Cold, 0f);
this.resists.put(SourceType.Healing, 0f);
this.immuneTo.put(SourceType.Siege, true);
this.resists.put(SourceType.SLASHING, 0f);
this.resists.put(SourceType.CRUSHING, 0f);
this.resists.put(SourceType.PIERCING, 0f);
this.resists.put(SourceType.MAGIC, 0f);
this.resists.put(SourceType.BLEEDING, 0f);
this.resists.put(SourceType.POISON, 0f);
this.resists.put(SourceType.MENTAL, 0f);
this.resists.put(SourceType.HOLY, 0f);
this.resists.put(SourceType.UNHOLY, 0f);
this.resists.put(SourceType.LIGHTNING, 0f);
this.resists.put(SourceType.FIRE, 0f);
this.resists.put(SourceType.COLD, 0f);
this.resists.put(SourceType.HEALING, 0f);
this.immuneTo.put(SourceType.SIEGE, true);
}
@ -292,10 +292,9 @@ public class Resists { @@ -292,10 +292,9 @@ public class Resists {
}
public boolean immuneToAttacks() {
return immuneTo(SourceType.ImmuneToAttack);
return immuneTo(SourceType.IMMUNETOATTACK);
}
/**
* Set a resist
*/
@ -303,37 +302,6 @@ public class Resists { @@ -303,37 +302,6 @@ public class Resists {
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
*/
@ -357,7 +325,7 @@ public class Resists { @@ -357,7 +325,7 @@ public class Resists {
//handle fortitudes
damage = handleFortitude(target, type, damage);
//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);
//check to see if any damage absorbers should cancel
if (target != null) {
@ -390,41 +358,41 @@ public class Resists { @@ -390,41 +358,41 @@ public class Resists {
if (rb != null) {
// Handle immunities
if (rb.getBool(ModType.ImmuneTo, SourceType.Stun))
this.immuneTo.put(SourceType.Stun, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.Blind))
this.immuneTo.put(SourceType.Blind, true);
if (rb.getBool(ModType.ImmuneToAttack, SourceType.None))
this.immuneTo.put(SourceType.ImmuneToAttack, true);
if (rb.getBool(ModType.ImmuneToPowers, SourceType.None))
this.immuneTo.put(SourceType.ImmuneToPowers, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.Powerblock))
this.immuneTo.put(SourceType.Powerblock, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.DeBuff))
this.immuneTo.put(SourceType.DeBuff, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.Fear))
this.immuneTo.put(SourceType.Fear, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.Charm))
this.immuneTo.put(SourceType.Charm, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.Root))
this.immuneTo.put(SourceType.Root, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.Snare))
this.immuneTo.put(SourceType.Snare, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.STUN))
this.immuneTo.put(SourceType.STUN, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.BLIND))
this.immuneTo.put(SourceType.BLIND, true);
if (rb.getBool(ModType.ImmuneToAttack, SourceType.NONE))
this.immuneTo.put(SourceType.IMMUNETOATTACK, true);
if (rb.getBool(ModType.ImmuneToPowers, SourceType.NONE))
this.immuneTo.put(SourceType.IMMUNETOPOWERS, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.POWERBLOCK))
this.immuneTo.put(SourceType.POWERBLOCK, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.DEBUFF))
this.immuneTo.put(SourceType.DEBUFF, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.FEAR))
this.immuneTo.put(SourceType.FEAR, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.CHARM))
this.immuneTo.put(SourceType.CHARM, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.ROOT))
this.immuneTo.put(SourceType.ROOT, true);
if (rb.getBool(ModType.ImmuneTo, SourceType.SNARE))
this.immuneTo.put(SourceType.SNARE, true);
// Handle resists
slash += rb.getFloat(ModType.Resistance, SourceType.Slashing);
crush += rb.getFloat(ModType.Resistance, SourceType.Crushing);
pierce += rb.getFloat(ModType.Resistance, SourceType.Piercing);
magic += rb.getFloat(ModType.Resistance, SourceType.Magic);
bleed += rb.getFloat(ModType.Resistance, SourceType.Bleeding);
poison += rb.getFloat(ModType.Resistance, SourceType.Poison);
mental += rb.getFloat(ModType.Resistance, SourceType.Mental);
holy += rb.getFloat(ModType.Resistance, SourceType.Holy);
unholy += rb.getFloat(ModType.Resistance, SourceType.Unholy);
lightning += rb.getFloat(ModType.Resistance, SourceType.Lightning);
fire += rb.getFloat(ModType.Resistance, SourceType.Fire);
cold += rb.getFloat(ModType.Resistance, SourceType.Cold);
healing += rb.getFloat(ModType.Resistance, SourceType.Healing); // DamageType.Healing.name());
slash += rb.getFloat(ModType.Resistance, SourceType.SLASHING);
crush += rb.getFloat(ModType.Resistance, SourceType.CRUSHING);
pierce += rb.getFloat(ModType.Resistance, SourceType.PIERCING);
magic += rb.getFloat(ModType.Resistance, SourceType.MAGIC);
bleed += rb.getFloat(ModType.Resistance, SourceType.BLEEDING);
poison += rb.getFloat(ModType.Resistance, SourceType.POISON);
mental += rb.getFloat(ModType.Resistance, SourceType.MENTAL);
holy += rb.getFloat(ModType.Resistance, SourceType.HOLY);
unholy += rb.getFloat(ModType.Resistance, SourceType.UNHOLY);
lightning += rb.getFloat(ModType.Resistance, SourceType.LIGHTNING);
fire += rb.getFloat(ModType.Resistance, SourceType.FIRE);
cold += rb.getFloat(ModType.Resistance, SourceType.COLD);
healing += rb.getFloat(ModType.Resistance, SourceType.HEALING); // DamageType.Healing.name());
}
@ -448,21 +416,20 @@ public class Resists { @@ -448,21 +416,20 @@ public class Resists {
}
}
this.resists.put(SourceType.Slashing, slash);
this.resists.put(SourceType.Crushing, crush);
this.resists.put(SourceType.Piercing, pierce);
this.resists.put(SourceType.Magic, magic);
this.resists.put(SourceType.Bleeding, bleed);
this.resists.put(SourceType.Poison, poison);
this.resists.put(SourceType.Mental, mental);
this.resists.put(SourceType.Holy, holy);
this.resists.put(SourceType.Unholy, unholy);
this.resists.put(SourceType.Lightning, lightning);
this.resists.put(SourceType.Fire, fire);
this.resists.put(SourceType.Cold, cold);
this.resists.put(SourceType.Healing, healing);
this.immuneTo.put(SourceType.Siege, true);
this.resists.put(SourceType.SLASHING, slash);
this.resists.put(SourceType.CRUSHING, crush);
this.resists.put(SourceType.PIERCING, pierce);
this.resists.put(SourceType.MAGIC, magic);
this.resists.put(SourceType.BLEEDING, bleed);
this.resists.put(SourceType.POISON, poison);
this.resists.put(SourceType.MENTAL, mental);
this.resists.put(SourceType.HOLY, holy);
this.resists.put(SourceType.UNHOLY, unholy);
this.resists.put(SourceType.LIGHTNING, lightning);
this.resists.put(SourceType.FIRE, fire);
this.resists.put(SourceType.COLD, cold);
this.resists.put(SourceType.HEALING, healing);
this.immuneTo.put(SourceType.SIEGE, true);
// debug printing of resists
// printResists(pc);

14
src/engine/powers/ActionsBase.java

@ -245,21 +245,21 @@ public class ActionsBase { @@ -245,21 +245,21 @@ public class ActionsBase {
return false;
//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
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
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
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
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;
// else if (pb.isHeal() && (bonus.getByte("immuneTo.Heal")) >= trains)
// 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;
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;
else
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 { @@ -32,7 +32,7 @@ public class AmbidexterityEffectModifier extends AbstractEffectModifier {
@Override
public void applyBonus(AbstractCharacter ac, int trains) {
PlayerBonuses bonus = ac.getBonuses();
bonus.setBool(ModType.Ambidexterity, SourceType.None, true);
bonus.setBool(ModType.Ambidexterity, SourceType.NONE, true);
}
@Override

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

@ -40,7 +40,7 @@ public class BlockedPowerTypeEffectModifier extends AbstractEffectModifier { @@ -40,7 +40,7 @@ public class BlockedPowerTypeEffectModifier extends AbstractEffectModifier {
ModType toBlock = ModType.None;
switch (this.sourceType) {
case Invisible:
case INVISIBLE:
toBlock = ModType.Invisible;
break;
}

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

@ -164,7 +164,7 @@ public class HealthEffectModifier extends AbstractEffectModifier { @@ -164,7 +164,7 @@ public class HealthEffectModifier extends AbstractEffectModifier {
// Apply any power effect modifiers (such as stances)
if (bonus != null)
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None)));
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.NONE)));
}
if (modAmount == 0f)
return;
@ -203,7 +203,7 @@ public class HealthEffectModifier extends AbstractEffectModifier { @@ -203,7 +203,7 @@ public class HealthEffectModifier extends AbstractEffectModifier {
}*/
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);
mhm.setUnknown03(5); //set target is immune
DispatchMessage.sendToAllInRange(ac, mhm);

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

@ -129,7 +129,7 @@ public class ManaEffectModifier extends AbstractEffectModifier { @@ -129,7 +129,7 @@ public class ManaEffectModifier extends AbstractEffectModifier {
// Apply any power effect modifiers (such as stances)
if (bonus != null)
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None));
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.NONE));
}
if (modAmount == 0f)
return;
@ -157,7 +157,7 @@ public class ManaEffectModifier extends AbstractEffectModifier { @@ -157,7 +157,7 @@ public class ManaEffectModifier extends AbstractEffectModifier {
}
}
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);
mhm.setUnknown03(5); //set target is immune
DispatchMessage.sendToAllInRange(ac, mhm);

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

@ -33,7 +33,7 @@ public class NoModEffectModifier extends AbstractEffectModifier { @@ -33,7 +33,7 @@ public class NoModEffectModifier extends AbstractEffectModifier {
bonus.setBool(this.modType, this.sourceType, true);
switch (this.sourceType) {
case Fly:
case FLY:
if (!ac.getObjectType().equals(GameObjectType.PlayerCharacter))
return;
PlayerCharacter flyer = (PlayerCharacter) ac;

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

@ -125,7 +125,7 @@ public class StaminaEffectModifier extends AbstractEffectModifier { @@ -125,7 +125,7 @@ public class StaminaEffectModifier extends AbstractEffectModifier {
// Apply any power effect modifiers (such as stances)
if (bonus != null)
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None)));
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.NONE)));
}
if (modAmount == 0f)
return;
@ -153,7 +153,7 @@ public class StaminaEffectModifier extends AbstractEffectModifier { @@ -153,7 +153,7 @@ public class StaminaEffectModifier extends AbstractEffectModifier {
}
}
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);
mhm.setUnknown03(5); //set target is immune
DispatchMessage.sendToAllInRange(ac, mhm);

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

@ -187,7 +187,7 @@ public class ApplyEffectPowerAction extends AbstractPowerAction { @@ -187,7 +187,7 @@ public class ApplyEffectPowerAction extends AbstractPowerAction {
if (bonuses == null)
return;
boolean noSilence = bonuses.getBool(ModType.Silenced, SourceType.None);
boolean noSilence = bonuses.getBool(ModType.Silenced, SourceType.NONE);
if (noSilence)
return;

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

@ -217,7 +217,7 @@ public class TransferStatPowerAction extends AbstractPowerAction { @@ -217,7 +217,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
// Apply any power effect modifiers (such as stances)
PlayerBonuses bonus = source.getBonuses();
if (bonus != null)
damage *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None));
damage *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.NONE));
//get amount to transfer
fromAmount = damage;
@ -243,7 +243,7 @@ public class TransferStatPowerAction extends AbstractPowerAction { @@ -243,7 +243,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
AbstractNetMsg mhmFrom = null;
//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);
mhm.setUnknown03(5); //set target is immune
DispatchMessage.sendToAllInRange(from, mhm);

Loading…
Cancel
Save