Browse Source

skill loading bypass for guards

combat-2
FatBoy-DOTC 1 year ago
parent
commit
1ff0238b6e
  1. 63
      src/engine/objects/CharacterSkill.java

63
src/engine/objects/CharacterSkill.java

@ -223,7 +223,7 @@ public class CharacterSkill extends AbstractGameObject { @@ -223,7 +223,7 @@ public class CharacterSkill extends AbstractGameObject {
this.numTrains.set(0);
this.ownerUID = pc.getObjectUUID();
calculateBaseAmount();
calculateModifiedAmount();
calculateModifiedAmount(false);
this.skillType = CharacterSkills.GetCharacterSkillByToken(this.skillsBase.getToken());
}
@ -238,7 +238,7 @@ public class CharacterSkill extends AbstractGameObject { @@ -238,7 +238,7 @@ public class CharacterSkill extends AbstractGameObject {
this.ownerUID = pc.getObjectUUID();
this.trained = true;
calculateBaseAmount();
calculateModifiedAmount();
calculateModifiedAmount(false);
this.skillType = CharacterSkills.GetCharacterSkillByToken(this.skillsBase.getToken());
}
@ -254,7 +254,7 @@ public class CharacterSkill extends AbstractGameObject { @@ -254,7 +254,7 @@ public class CharacterSkill extends AbstractGameObject {
this.numTrains.set(rs.getShort("trains"));
this.ownerUID = pc.getObjectUUID();
calculateBaseAmount();
calculateModifiedAmount();
calculateModifiedAmount(false);
this.skillType = CharacterSkills.GetCharacterSkillByToken(this.skillsBase.getToken());
}
@ -264,8 +264,9 @@ public class CharacterSkill extends AbstractGameObject { @@ -264,8 +264,9 @@ public class CharacterSkill extends AbstractGameObject {
this.numTrains.set(trains);
this.ownerUID = mob.getObjectUUID();
this.isMobOwner = true;
calculateMobBaseAmount();
calculateModifiedAmount();
boolean isGuard = mob.agentType.equals(Enum.AIAgentType.GUARDCAPTAIN) || mob.agentType.equals(Enum.AIAgentType.GUARDMINION);
calculateMobBaseAmount(isGuard);
calculateModifiedAmount(isGuard);
this.skillType = CharacterSkills.GetCharacterSkillByToken(this.skillsBase.getToken());
}
@ -277,7 +278,7 @@ public class CharacterSkill extends AbstractGameObject { @@ -277,7 +278,7 @@ public class CharacterSkill extends AbstractGameObject {
this.ownerUID = rs.getInt("CharacterID");
// this.owner = DbManager.PlayerCharacterQueries.GET_PLAYER_CHARACTER(rs.getInt("CharacterID"));
calculateBaseAmount();
calculateModifiedAmount();
calculateModifiedAmount(false);
this.skillType = CharacterSkills.GetCharacterSkillByToken(this.skillsBase.getToken());
}
@ -370,7 +371,7 @@ public class CharacterSkill extends AbstractGameObject { @@ -370,7 +371,7 @@ public class CharacterSkill extends AbstractGameObject {
String name = it.next();
CharacterSkill cs = skills.get(name);
if (cs != null)
cs.calculateModifiedAmount();
cs.calculateModifiedAmount(false);
}
@ -756,7 +757,7 @@ public class CharacterSkill extends AbstractGameObject { @@ -756,7 +757,7 @@ public class CharacterSkill extends AbstractGameObject {
//recalculate this skill
calculateBaseAmount();
calculateModifiedAmount();
calculateModifiedAmount(false);
//see if any new skills or powers granted
pc.calculateSkills();
@ -848,7 +849,7 @@ public class CharacterSkill extends AbstractGameObject { @@ -848,7 +849,7 @@ public class CharacterSkill extends AbstractGameObject {
if (recalculate) {
//recalculate this skill
calculateBaseAmount();
calculateModifiedAmount();
calculateModifiedAmount(false);
//see if any skills or powers removed
pc.calculateSkills();
@ -887,7 +888,7 @@ public class CharacterSkill extends AbstractGameObject { @@ -887,7 +888,7 @@ public class CharacterSkill extends AbstractGameObject {
if (recalculate) {
//recalculate this skill
calculateBaseAmount();
calculateModifiedAmount();
calculateModifiedAmount(false);
//see if any skills or powers removed
pc.calculateSkills();
@ -1016,21 +1017,22 @@ public class CharacterSkill extends AbstractGameObject { @@ -1016,21 +1017,22 @@ public class CharacterSkill extends AbstractGameObject {
this.modifiedAmountBeforeMods = Math.round(this.baseAmountBeforeMods + calculateAmountAfterTrains());
}
public void calculateMobBaseAmount() {
if (CharacterSkill.GetOwner(this) == null) {
Logger.error("owner not found for owner uuid : " + this.ownerUID);
this.baseAmount = 1;
this.modifiedAmount = 1;
return;
}
public void calculateMobBaseAmount(boolean isGuard) {
if(!isGuard) {
if (CharacterSkill.GetOwner(this) == null) {
Logger.error("owner not found for owner uuid : " + this.ownerUID);
this.baseAmount = 1;
this.modifiedAmount = 1;
return;
}
if (this.skillsBase == null) {
Logger.error("SkillsBase not found for skill " + this.getObjectUUID());
this.baseAmount = 1;
this.modifiedAmount = 1;
return;
if (this.skillsBase == null) {
Logger.error("SkillsBase not found for skill " + this.getObjectUUID());
this.baseAmount = 1;
this.modifiedAmount = 1;
return;
}
}
//Get any rune bonus
float bonus = 0f;
//TODO SKILLS RUNES
@ -1066,14 +1068,15 @@ public class CharacterSkill extends AbstractGameObject { @@ -1066,14 +1068,15 @@ public class CharacterSkill extends AbstractGameObject {
this.modifiedAmountBeforeMods = (int) (this.baseAmountBeforeMods + calculateAmountAfterTrains());
}
public void calculateModifiedAmount() {
if (CharacterSkill.GetOwner(this) == null || this.skillsBase == null) {
Logger.error("owner or SkillsBase not found for skill " + this.getObjectUUID());
this.baseAmount = 1;
this.modifiedAmount = 1;
return;
public void calculateModifiedAmount(boolean isGuard) {
if(!isGuard) {
if (CharacterSkill.GetOwner(this) == null || this.skillsBase == null) {
Logger.error("owner or SkillsBase not found for skill " + this.getObjectUUID());
this.baseAmount = 1;
this.modifiedAmount = 1;
return;
}
}
//Get any rune bonus
float bonus = 0f;
if (CharacterSkill.GetOwner(this).getBonuses() != null) {

Loading…
Cancel
Save