Browse Source

Debug code removed.

combat-2
MagicBot 8 months ago
parent
commit
b8a1081544
  1. 14
      src/engine/gameManager/MovementManager.java
  2. 6
      src/engine/gameManager/PowersManager.java
  3. 84
      src/engine/objects/AbstractCharacter.java
  4. 11
      src/engine/objects/PlayerCharacter.java
  5. 22
      src/engine/objects/Resists.java
  6. 12
      src/engine/powers/effectmodifiers/HealthEffectModifier.java
  7. 17
      src/engine/powers/effectmodifiers/ManaEffectModifier.java
  8. 15
      src/engine/powers/effectmodifiers/StaminaEffectModifier.java
  9. 7
      src/engine/powers/poweractions/TransferStatPowerAction.java

14
src/engine/gameManager/MovementManager.java

@ -316,17 +316,6 @@ public enum MovementManager {
else else
Logger.debug("Movement sync is good - desyncDist = " + desyncDist); Logger.debug("Movement sync is good - desyncDist = " + desyncDist);
if (ac.getDebug(1) && ac.getObjectType().equals(GameObjectType.PlayerCharacter))
if (desyncDist > MBServerStatics.MOVEMENT_DESYNC_TOLERANCE * MBServerStatics.MOVEMENT_DESYNC_TOLERANCE) {
PlayerCharacter pc = (PlayerCharacter) ac;
ChatManager.chatSystemInfo(pc,
"Movement out of sync for " + ac.getFirstName()
+ ", Server Loc: " + serverLoc.getX() + ' ' + serverLoc.getZ()
+ " , Client loc: " + clientLoc.getX() + ' ' + clientLoc.getZ()
+ " desync distance " + desyncDist
+ " moving=" + ac.isMoving());
}
// return indicator that the two are in sync or not // return indicator that the two are in sync or not
return (desyncDist < 100f * 100f); return (desyncDist < 100f * 100f);
@ -351,9 +340,6 @@ public enum MovementManager {
+ " moving=" + ac.isMoving() + " moving=" + ac.isMoving()
+ " and current location is " + curLoc.getX() + ' ' + curLoc.getZ()); + " and current location is " + curLoc.getX() + ' ' + curLoc.getZ());
if (ac.getDebug(1) && ac.getObjectType().equals(GameObjectType.PlayerCharacter))
ChatManager.chatSystemInfo((PlayerCharacter) ac, "Finished Alt change, setting the end location to " + ac.getEndLoc().getX() + ' ' + ac.getEndLoc().getZ() + " moving=" + ac.isMoving() + " and current location is " + curLoc.getX() + ' ' + curLoc.getZ());
//Send run/walk/sit/stand to tell the client we are flying / landing etc //Send run/walk/sit/stand to tell the client we are flying / landing etc
ac.update(); ac.update();
ac.stopMovement(ac.getLoc()); ac.stopMovement(ac.getLoc());

6
src/engine/gameManager/PowersManager.java

@ -2261,12 +2261,8 @@ public enum PowersManager {
defense = tar.getDefenseRating(); defense = tar.getDefenseRating();
} else } else
defense = 0f; defense = 0f;
// Get hit chance
if (pc.getDebug(16)) { // Get hit chance
String smsg = "ATR: " + atr + ", Defense: " + defense;
ChatManager.chatSystemInfo(pc, smsg);
}
int chance; int chance;

84
src/engine/objects/AbstractCharacter.java

@ -672,28 +672,28 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
// make sure weapon exists // make sure weapon exists
boolean noWeapon = false; boolean noWeapon = false;
ItemTemplate wb = null; ItemTemplate weaponTemplate = null;
if (weapon == null) if (weapon == null)
noWeapon = true; noWeapon = true;
else { else {
ItemTemplate ib = weapon.template; ItemTemplate itemTemplate = weapon.template;
if (ib == null)
if (itemTemplate == null)
noWeapon = true; noWeapon = true;
else if (!weapon.template.item_type.equals(ItemType.WEAPON)) { else if (!weapon.template.item_type.equals(ItemType.WEAPON)) {
defaultAtrAndDamage(abstractCharacter, mainHand); defaultAtrAndDamage(abstractCharacter, mainHand);
return; return;
} else } else
wb = ib; weaponTemplate = itemTemplate;
} }
float skillPercentage, masteryPercentage; float skillPercentage, masteryPercentage;
float mastDam; float mastDam;
int min, max; int min, max;
float speed = 20f; float speed = 20f;
boolean strBased = false; boolean strBased = false;
ItemTemplate wbMain = (weapon != null) ? weapon.template : null;
ItemTemplate wbOff = (otherHand != null) ? otherHand.template : null;
// get skill percentages and min and max damage for weapons // get skill percentages and min and max damage for weapons
if (noWeapon) { if (noWeapon) {
if (mainHand) { if (mainHand) {
@ -711,6 +711,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
skillPercentage = getModifiedAmount(abstractCharacter.skills.get("Unarmed Combat")); skillPercentage = getModifiedAmount(abstractCharacter.skills.get("Unarmed Combat"));
masteryPercentage = getModifiedAmount(abstractCharacter.skills.get("Unarmed Combat Mastery")); masteryPercentage = getModifiedAmount(abstractCharacter.skills.get("Unarmed Combat Mastery"));
if (masteryPercentage == 0f) if (masteryPercentage == 0f)
mastDam = CharacterSkill.getQuickMastery(abstractCharacter, "Unarmed Combat Mastery"); mastDam = CharacterSkill.getQuickMastery(abstractCharacter, "Unarmed Combat Mastery");
else else
@ -733,17 +734,21 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
abstractCharacter.rangeHandTwo *= range_bonus; abstractCharacter.rangeHandTwo *= range_bonus;
} }
skillPercentage = getModifiedAmount(abstractCharacter.skills.get(weapon.template.item_skill_used)); skillPercentage = getModifiedAmount(abstractCharacter.skills.get(weapon.template.item_skill_used));
masteryPercentage = getModifiedAmount(abstractCharacter.skills.get(wb.item_skill_mastery_used)); masteryPercentage = getModifiedAmount(abstractCharacter.skills.get(weaponTemplate.item_skill_mastery_used));
if (masteryPercentage == 0f) if (masteryPercentage == 0f)
mastDam = 0f; mastDam = 0f;
// mastDam = CharacterSkill.getQuickMastery(this, wb.getMastery()); // mastDam = CharacterSkill.getQuickMastery(this, wb.getMastery());
else else
mastDam = masteryPercentage; mastDam = masteryPercentage;
int[] damages = (int[]) wb.item_weapon_damage.values().toArray()[0]; int[] damages = (int[]) weaponTemplate.item_weapon_damage.values().toArray()[0];
min = damages[0]; min = damages[0];
max = damages[1]; max = damages[1];
strBased = wb.item_primary_attr.equals(AttributeType.Strength);
strBased = weaponTemplate.item_primary_attr.equals(AttributeType.Strength);
// //
// Add parry bonus for weapon and allow parry if needed // Add parry bonus for weapon and allow parry if needed
@ -803,13 +808,15 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
} }
//calculate speed //calculate speed
if (wb != null) if (weaponTemplate != null)
speed = wb.item_weapon_wepspeed; speed = weaponTemplate.item_weapon_wepspeed;
else else
speed = 20f; //unarmed attack speed speed = 20f; //unarmed attack speed
if (weapon != null) if (weapon != null)
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.NONE)); speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.NONE));
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.NONE)); speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.NONE));
if (speed < 10) if (speed < 10)
speed = 10; speed = 10;
@ -822,6 +829,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
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;
@ -839,8 +847,10 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
} }
//if duel wielding, cut damage by 30% //if duel wielding, cut damage by 30%
if (otherHand != null) { if (otherHand != null) {
ItemTemplate ibo = otherHand.template; ItemTemplate ibo = otherHand.template;
if (ibo != null && otherHand.template.equals(ItemType.WEAPON)) { if (ibo != null && otherHand.template.equals(ItemType.WEAPON)) {
min *= 0.7f; min *= 0.7f;
max *= 0.7f; max *= 0.7f;
@ -910,9 +920,9 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
if (ItemTemplate.isShield(shield) == false) if (ItemTemplate.isShield(shield) == false)
return 0; return 0;
ItemTemplate ab = shield.template; ItemTemplate template = shield.template;
if (ab == null) if (template == null)
return 0; return 0;
CharacterSkill blockSkill = abstractCharacter.skills.get("Block"); CharacterSkill blockSkill = abstractCharacter.skills.get("Block");
@ -924,9 +934,10 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
} else } else
skillMod = blockSkill.getModifiedAmount(); skillMod = blockSkill.getModifiedAmount();
float def = ab.item_defense_rating; float def = template.item_defense_rating;
//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));
@ -983,39 +994,45 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
* @ Calculates Defense for weapon * @ Calculates Defense for weapon
*/ */
private static float getWeaponDefense(AbstractCharacter abstractCharacter, ConcurrentHashMap<EquipSlotType, Item> equipped) { private static float getWeaponDefense(AbstractCharacter abstractCharacter, ConcurrentHashMap<EquipSlotType, Item> equipped) {
Item weapon = equipped.get(EquipSlotType.RHELD); Item weapon = equipped.get(EquipSlotType.RHELD);
ItemTemplate wb = null; ItemTemplate weaponTemplate = null;
CharacterSkill skill, mastery; CharacterSkill skill, mastery;
float val = 0; float val = 0;
boolean unarmed = false; boolean unarmed = false;
if (weapon == null) { if (weapon == null) {
weapon = equipped.get(EquipSlotType.LHELD); weapon = equipped.get(EquipSlotType.LHELD);
if (weapon == null || ItemTemplate.isShield(weapon)) if (weapon == null || ItemTemplate.isShield(weapon))
unarmed = true; unarmed = true;
else else
wb = weapon.template; weaponTemplate = weapon.template;
} else } else
wb = weapon.template; weaponTemplate = weapon.template;
if (wb == null)
if (weaponTemplate == null)
unarmed = true; unarmed = true;
if (unarmed) { if (unarmed) {
skill = abstractCharacter.skills.get("Unarmed Combat"); skill = abstractCharacter.skills.get("Unarmed Combat");
mastery = abstractCharacter.skills.get("Unarmed Combat Mastery"); mastery = abstractCharacter.skills.get("Unarmed Combat Mastery");
} else { } else {
skill = abstractCharacter.skills.get(weapon.template.item_skill_used); skill = abstractCharacter.skills.get(weapon.template.item_skill_used);
mastery = abstractCharacter.skills.get(wb.item_skill_mastery_used); mastery = abstractCharacter.skills.get(weaponTemplate.item_skill_mastery_used);
} }
if (skill != null) if (skill != null)
val += (int) skill.getModifiedAmount() / 2f; val += (int) skill.getModifiedAmount() / 2f;
if (mastery != null) if (mastery != null)
val += (int) mastery.getModifiedAmount() / 2f; val += (int) mastery.getModifiedAmount() / 2f;
return val; return val;
} }
//Don't call this function directly. linked from pc.calculateSkills() //Don't call this function directly. linked from pc.calculateSkills()
//through SkillCalcJob. Designed to only run from one worker thread //through SkillCalcJob. Designed to only run from one worker thread
public static void runSkillCalc(AbstractCharacter abstractCharacter) { public static void runSkillCalc(AbstractCharacter abstractCharacter) {
try {
//see if any new skills or powers granted //see if any new skills or powers granted
CharacterSkill.calculateSkills(abstractCharacter); CharacterSkill.calculateSkills(abstractCharacter);
@ -1024,18 +1041,20 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
//see if any new powers unlocked from previous check //see if any new powers unlocked from previous check
CharacterPower.calculatePowers(abstractCharacter); CharacterPower.calculatePowers(abstractCharacter);
} catch (Exception e) {
}
} }
//calculate item bonuses here //calculate item bonuses here
public static void calculateItemBonuses(AbstractCharacter abstractCharacter) { public static void calculateItemBonuses(AbstractCharacter abstractCharacter) {
if (abstractCharacter.charItemManager == null || abstractCharacter.bonuses == null) if (abstractCharacter.charItemManager == null || abstractCharacter.bonuses == null)
return; return;
ConcurrentHashMap<EquipSlotType, Item> equipped = abstractCharacter.charItemManager.getEquipped(); ConcurrentHashMap<EquipSlotType, Item> equipped = abstractCharacter.charItemManager.getEquipped();
for (Item item : equipped.values()) { for (Item item : equipped.values()) {
ItemTemplate ib = item.template; ItemTemplate ib = item.template;
if (ib == null) if (ib == null)
continue; continue;
//TODO add effect bonuses in here for equipped items //TODO add effect bonuses in here for equipped items
@ -1046,6 +1065,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
* @ Defaults ATR, Defense and Damage for player * @ Defaults ATR, Defense and Damage for player
*/ */
private static void defaultAtrAndDamage(AbstractCharacter abstractCharacter, boolean mainHand) { private static void defaultAtrAndDamage(AbstractCharacter abstractCharacter, boolean mainHand) {
if (mainHand) { if (mainHand) {
abstractCharacter.atrHandOne = 0; abstractCharacter.atrHandOne = 0;
abstractCharacter.minDamageHandOne = 0; abstractCharacter.minDamageHandOne = 0;
@ -1136,22 +1156,6 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
public final short getUnusedStatPoints() { public final short getUnusedStatPoints() {
return this.unusedStatPoints; return this.unusedStatPoints;
} }
public final void setDebug(
final int value,
final boolean toggle
) {
if (toggle) {
this.debug |= value; //turn on debug
} else {
this.debug &= ~value; //turn off debug
}
}
public final boolean getDebug(final int value) {
return ((this.debug & value) != 0);
}
@Override @Override
public String getName() { public String getName() {
if (this.firstName.length() == 0 && this.lastName.length() == 0) { if (this.firstName.length() == 0 && this.lastName.length() == 0) {

11
src/engine/objects/PlayerCharacter.java

@ -2760,8 +2760,6 @@ public class PlayerCharacter extends AbstractCharacter {
} }
public int getSeeInvis() { public int getSeeInvis() {
if (this.getDebug(8)) //<-added for see invis debug devcmd
return 10000;
return this.seeInvis; return this.seeInvis;
} }
@ -4389,21 +4387,14 @@ public class PlayerCharacter extends AbstractCharacter {
this.stopMovement(newLoc); this.stopMovement(newLoc);
return; return;
} }
if (newLoc.equals(this.getEndLoc())) { if (newLoc.equals(this.getEndLoc())) {
this.stopMovement(newLoc); this.stopMovement(newLoc);
if (this.getDebug(1))
ChatManager.chatSystemInfo(this,
"Arrived at End location. " + this.getEndLoc());
return; return;
//Next upda
} }
setLoc(newLoc); setLoc(newLoc);
if (this.getDebug(1))
ChatManager.chatSystemInfo(this,
"Distance to target " + this.getEndLoc().distance2D(this.getLoc()) + " speed " + this.getSpeed());
if (this.getStamina() < 10) if (this.getStamina() < 10)
MovementManager.sendOOS(this); MovementManager.sendOOS(this);

22
src/engine/objects/Resists.java

@ -14,7 +14,6 @@ import engine.Enum.ModType;
import engine.Enum.SourceType; import engine.Enum.SourceType;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.powers.EffectsBase;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -326,28 +325,15 @@ public class Resists {
public float getResistedDamage(AbstractCharacter source, AbstractCharacter target, SourceType type, float damage, int trains) { public float getResistedDamage(AbstractCharacter source, AbstractCharacter target, SourceType type, float damage, int trains) {
//handle fortitudes //handle fortitudes
damage = handleFortitude(target, type, damage); damage = handleFortitude(target, type, damage);
//calculate armor piercing //calculate armor piercing
float ap = source.getBonuses().getFloatPercentAll(ModType.ArmorPiercing, SourceType.NONE); float ap = source.getBonuses().getFloatPercentAll(ModType.ArmorPiercing, SourceType.NONE);
float damageAfterResists = damage * (1 - (this.getResist(type, trains) * 0.01f) + ap); float damageAfterResists = damage * (1 - (this.getResist(type, trains) * 0.01f) + ap);
//check to see if any damage absorbers should cancel //check to see if any damage absorbers should cancel
if (target != null) { if (target != null)
//debug damage shields if any found
if (source.getDebug(2) && source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
Effect da = target.getDamageAbsorber();
if (da != null && da.getEffectsBase() != null) {
EffectsBase eb = da.getEffectsBase();
String text = "Damage: " + damage + '\n';
text += "Damage after resists: " + damageAfterResists + '\n';
text += "Attack damage type: " + type.name() + '\n';
text += "Fortitude damage types; " + eb.getDamageTypes() + '\n';
text += "Fortitude damage before attack: " + da.getDamageAmount() + '\n';
text += "Fortitude total health: " + eb.getDamageAmount(da.getTrains()) + '\n';
text += "Fortitude trains: " + da.getTrains();
ChatManager.chatSystemInfo((PlayerCharacter) source, text);
}
}
target.cancelOnTakeDamage(type, (damageAfterResists)); target.cancelOnTakeDamage(type, (damageAfterResists));
}
return damageAfterResists; return damageAfterResists;
} }

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

@ -12,7 +12,6 @@ package engine.powers.effectmodifiers;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.Enum.ModType; import engine.Enum.ModType;
import engine.Enum.SourceType; import engine.Enum.SourceType;
import engine.gameManager.ChatManager;
import engine.jobs.AbstractEffectJob; import engine.jobs.AbstractEffectJob;
import engine.jobs.DamageOverTimeJob; import engine.jobs.DamageOverTimeJob;
import engine.net.AbstractNetMsg; import engine.net.AbstractNetMsg;
@ -83,12 +82,6 @@ public class HealthEffectModifier extends AbstractEffectModifier {
modAmount *= 2.5f; modAmount *= 2.5f;
} }
//debug for spell damage and atr
if (source.getDebug(16) && source.getObjectType().equals(GameObjectType.PlayerCharacter)) {
PlayerCharacter pc = (PlayerCharacter) source;
String smsg = "Percent Damage: " + mod * 100 + '%';
ChatManager.chatSystemInfo(pc, smsg);
}
} }
// Modify health by min/max amount // Modify health by min/max amount
@ -124,11 +117,6 @@ public class HealthEffectModifier extends AbstractEffectModifier {
min = HealthEffectModifier.getMinDamage(min, intt, spi, focus); min = HealthEffectModifier.getMinDamage(min, intt, spi, focus);
max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus); max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus);
//debug for spell damage and atr
if (pc.getDebug(16)) {
String smsg = "Damage: " + (int) Math.abs(min) + " - " + (int) Math.abs(max);
ChatManager.chatSystemInfo(pc, smsg);
}
} else if (source.getObjectType() == GameObjectType.Mob) { } else if (source.getObjectType() == GameObjectType.Mob) {
Mob pc = (Mob) source; Mob pc = (Mob) source;

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

@ -12,7 +12,6 @@ package engine.powers.effectmodifiers;
import engine.Enum; import engine.Enum;
import engine.Enum.ModType; import engine.Enum.ModType;
import engine.Enum.SourceType; import engine.Enum.SourceType;
import engine.gameManager.ChatManager;
import engine.jobs.AbstractEffectJob; import engine.jobs.AbstractEffectJob;
import engine.jobs.DamageOverTimeJob; import engine.jobs.DamageOverTimeJob;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
@ -74,15 +73,6 @@ public class ManaEffectModifier extends AbstractEffectModifier {
if (awoac.isSit()) if (awoac.isSit())
modAmount *= 2.5f; modAmount *= 2.5f;
//debug for spell damage and atr
if (source.getDebug(16) && source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
PlayerCharacter pc = (PlayerCharacter) source;
String smsg = "Percent Damage: " + mod * 100 + '%';
ChatManager.chatSystemInfo(pc, smsg);
}
} }
// Modify health by min/max amount // Modify health by min/max amount
@ -117,13 +107,8 @@ public class ManaEffectModifier extends AbstractEffectModifier {
// max *= (intt * 0.0117 + 0.13 * (float)Math.sqrt(intt - 0.5) + spi * 0.0024 + (float)Math.sqrt(spi - 0.5) * 0.021 + 0.015 * (int)focus); // max *= (intt * 0.0117 + 0.13 * (float)Math.sqrt(intt - 0.5) + spi * 0.0024 + (float)Math.sqrt(spi - 0.5) * 0.021 + 0.015 * (int)focus);
min = HealthEffectModifier.getMinDamage(min, intt, spi, focus); min = HealthEffectModifier.getMinDamage(min, intt, spi, focus);
max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus); max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus);
//debug for spell damage and atr
if (pc.getDebug(16)) {
String smsg = "Damage: " + (int) Math.abs(min) + " - " + (int) Math.abs(max);
ChatManager.chatSystemInfo(pc, smsg);
}
} }
modAmount = calculateDamage(source, awoac, min, max, awo, trains); modAmount = calculateDamage(source, awoac, min, max, awo, trains);
PlayerBonuses bonus = source.getBonuses(); PlayerBonuses bonus = source.getBonuses();

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

@ -12,7 +12,6 @@ package engine.powers.effectmodifiers;
import engine.Enum; import engine.Enum;
import engine.Enum.ModType; import engine.Enum.ModType;
import engine.Enum.SourceType; import engine.Enum.SourceType;
import engine.gameManager.ChatManager;
import engine.jobs.AbstractEffectJob; import engine.jobs.AbstractEffectJob;
import engine.jobs.DamageOverTimeJob; import engine.jobs.DamageOverTimeJob;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
@ -72,13 +71,6 @@ public class StaminaEffectModifier extends AbstractEffectModifier {
modAmount = mod * awoac.getStaminaMax(); modAmount = mod * awoac.getStaminaMax();
if (awoac.isSit()) if (awoac.isSit())
modAmount *= 2.5f; modAmount *= 2.5f;
//debug for spell damage and atr
if (source.getDebug(16) && source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
PlayerCharacter pc = (PlayerCharacter) source;
String smsg = "Percent Damage: " + mod * 100 + '%';
ChatManager.chatSystemInfo(pc, smsg);
}
} }
// Modify Stamina by min/max amount // Modify Stamina by min/max amount
@ -113,13 +105,8 @@ public class StaminaEffectModifier extends AbstractEffectModifier {
// max *= (intt * 0.0117 + 0.13 * (float)Math.sqrt(intt - 0.5) + spi * 0.0024 + (float)Math.sqrt(spi - 0.5) * 0.021 + 0.015 * (int)focus); // max *= (intt * 0.0117 + 0.13 * (float)Math.sqrt(intt - 0.5) + spi * 0.0024 + (float)Math.sqrt(spi - 0.5) * 0.021 + 0.015 * (int)focus);
min = HealthEffectModifier.getMinDamage(min, intt, spi, focus); min = HealthEffectModifier.getMinDamage(min, intt, spi, focus);
max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus); max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus);
//debug for spell damage and atr
if (pc.getDebug(16)) {
String smsg = "Damage: " + (int) Math.abs(min) + " - " + (int) Math.abs(max);
ChatManager.chatSystemInfo(pc, smsg);
}
} }
modAmount = calculateDamage(source, awoac, min, max, awo, trains); modAmount = calculateDamage(source, awoac, min, max, awo, trains);
PlayerBonuses bonus = source.getBonuses(); PlayerBonuses bonus = source.getBonuses();

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

@ -12,7 +12,6 @@ package engine.powers.poweractions;
import engine.Enum; import engine.Enum;
import engine.Enum.ModType; import engine.Enum.ModType;
import engine.Enum.SourceType; import engine.Enum.SourceType;
import engine.gameManager.ChatManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.net.AbstractNetMsg; import engine.net.AbstractNetMsg;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
@ -200,12 +199,6 @@ public class TransferStatPowerAction extends AbstractPowerAction {
// get range between min and max // get range between min and max
float range = max - min; float range = max - min;
//debug for spell damage and atr
if (pc.getDebug(16)) {
String smsg = "Damage: " + (int) Math.abs(min) + " - " + (int) Math.abs(max);
ChatManager.chatSystemInfo(pc, smsg);
}
// Damage is calculated twice to average a more central point // Damage is calculated twice to average a more central point
damage = ThreadLocalRandom.current().nextFloat() * range; damage = ThreadLocalRandom.current().nextFloat() * range;
damage = (damage + (ThreadLocalRandom.current().nextFloat() * range)) / 2; damage = (damage + (ThreadLocalRandom.current().nextFloat() * range)) / 2;

Loading…
Cancel
Save