Browse Source

Reworked CharacterSkill enum.

combat-2
MagicBot 9 months ago
parent
commit
4e2578f3e0
  1. 195
      src/engine/Enum.java
  2. 11
      src/engine/objects/CharacterSkill.java

195
src/engine/Enum.java

@ -1390,109 +1390,100 @@ public class Enum { @@ -1390,109 +1390,100 @@ public class Enum {
public enum CharacterSkills {
Archery((1L << 1), -529201545, 20),
Athletics((1L << 2), -327713877, 15),
AxeMastery((1L << 3), 1103042709, 20),
Axe((1L << 4), 73505, 1),
Bardsong((1L << 5), 454246953, 10),
Bargaining((1L << 6), 372927577, 10),
Beastcraft((1L << 7), 56772766, 10),
Benediction((1L << 8), 1464998706, 1),
BladeMastery((1L << 9), -59908956, 20),
BladeWeaving((1L << 10), -1839362429, 20),
Block((1L << 11), 76592546, 3),
Bow((1L << 12), 87490, 1),
Channeling((1L << 13), -1899060872, 20),
Crossbow((1L << 14), 1092138184, 1),
DaggerMastery((1L << 15), -1549224741, 20),
Dagger((1L << 16), -1603103740, 1),
Dodge((1L << 17), 74619332, 5),
FlameCalling((1L << 18), -1839578206, 20),
GreatAxeMastery((1L << 19), 1427003458, 20),
GreatHammerMastery((1L << 20), -309659310, 20),
GreatSwordMastery((1L << 21), 2054956946, 20),
HammerMastery((1L << 22), -1548903209, 20),
Hammer((1L << 23), -1602765816, 1),
Leadership((1L << 24), 1618560984, 20),
Liturgy((1L << 25), -888415974, 10),
NatureLore((1L << 26), -1911171474, 10),
Parry((1L << 27), 95961104, 5),
PoleArmMastery((1L << 28), -1432303709, 20),
PoleArm((1L << 29), -1037845588, 1),
Restoration((1L << 30), -504697054, 1),
Running((1L << 31), 1488335491, 10),
Shadowmastery((1L << 32), 1389222957, 10),
Sorcery((1L << 33), -529481275, 1),
SpearMastery((1L << 34), -48279755, 20),
Spear((1L << 35), 83992115, 1),
StaffMastery((1L << 36), -61022283, 20),
Staff((1L << 37), 71438003, 1),
Stormcalling((1L << 38), -532064061, 10),
SwordMastery((1L << 39), -59316267, 20),
Sword((1L << 40), 73938643, 1),
Thaumaturgy((1L << 41), -2020131447, 10),
Theurgy((1L << 42), -888431326, 10),
Throwing((1L << 43), 391562015, 20),
Toughness((1L << 44), -660435875, 10),
UnarmedCombatMastery((1L << 45), 1692733771, 20),
UnarmedCombat((1L << 46), -1094332856, 1),
Warding((1L << 47), 1488142342, 1),
Warlockry((1L << 48), 1121393557, 10),
WayoftheGaana((1L << 49), -1954832975, 10),
WearArmorHeavy((1L << 50), 1112121635, 15),
WearArmorLight((1L << 51), 38031547, 1),
WearArmorMedium((1L << 52), 468015203, 5),
Wizardry((1L << 53), 218227659, 10),
Corruption((1L << 54), -1519268706, 10),
Abjuration((1L << 55), -2029900484, 10),
WayoftheWolf((1L << 56), 1668913067, 20),
WayoftheRat((1L << 57), -2114353637, 20),
WayoftheBear((1L << 58), -906390863, 20),
Orthanatos((1L << 59), -666929185, 20),
Bloodcraft((1L << 60), 40661438, 10),
Exorcism((1L << 61), 1444427097, 10),
Necromancy((1L << 62), -556571154, 10),
SunDancing((1L << 63), 22329752, 20);
private final int reqLvl;
private long flag;
private int token;
CharacterSkills(long flag, int token, int reqLvl) {
this.flag = flag;
this.token = token;
this.reqLvl = reqLvl;
}
public static CharacterSkills GetCharacterSkillByToken(int token) {
for (CharacterSkills skill : CharacterSkills.values()) {
if (skill.token == token)
return skill;
}
Logger.info("Returned No Skill for token " + token + ". Defaulting to Axe");
return CharacterSkills.Axe;
}
public long getFlag() {
return flag;
}
public void setFlag(long flag) {
this.flag = flag;
}
public int getReqLvl() {
return this.reqLvl;
}
public int getToken() {
return token;
}
Animation,
Archery,
Athletics,
AxeMastery,
Axe,
Bardsong,
Bargaining,
Beastcraft,
Benediction,
BladeMastery,
BladeWeaving,
Block,
Bow,
Channeling,
Cloth,
Conditioning,
Crossbow,
DaggerMastery,
Dagger,
Dodge,
Dueling,
Enchantment,
Endurance,
FlameCalling,
Focus,
GreatAxeMastery,
GreatHammerMastery,
GreatSwordMastery,
HammerMastery,
HammerLeadership,
Learning,
Liturgy,
Meditation,
NatureLore,
None,
Opening,
Parry,
PoleArmMastery,
PoleArm,
ResistanceAcid,
ResistanceCold,
ResistanceCrushing,
ResistanceDisease,
ResistanceEarth,
ResistanceFire,
ResistanceHoly,
ResistanceLightning,
ResistanceMagic,
ResistanceMental,
ResistancePiercing,
ResistancePoison,
ResistanceSlashing,
ResistanceUnholy,
Restoration,
Runecarving,
Running,
Shadowmastery,
Shapechanging,
Sorcery,
SpearMastery,
Spear,
StaffMastery,
Staff,
Stormcalling,
Subterfuge,
Summoning,
SwordMastery,
Sword,
Thaumaturgy,
Theurgy,
Throwing,
Toughness,
UnarmedCombatMastery,
UnarmedCombat,
Unknown,
Warding,
Warlockry,
WayoftheGaana,
WearArmorHeavy,
WearArmorLight,
WearArmorMedium,
Willpower,
Wizardry,
Corruption,
Abjuration,
WayoftheWolf,
WayoftheRat,
WayoftheBear,
Orthanatos,
Bloodcraft,
Exorcism,
Necromancy,
SunDancing;
public void setToken(int token) {
this.token = token;
}
}
public enum GuildHistoryType {

11
src/engine/objects/CharacterSkill.java

@ -10,7 +10,6 @@ @@ -10,7 +10,6 @@
package engine.objects;
import engine.Enum;
import engine.Enum.CharacterSkills;
import engine.Enum.ModType;
import engine.Enum.SourceType;
import engine.gameManager.DbManager;
@ -195,8 +194,6 @@ public class CharacterSkill extends AbstractGameObject { @@ -195,8 +194,6 @@ public class CharacterSkill extends AbstractGameObject {
private SkillsBase skillsBase;
private AtomicInteger numTrains = new AtomicInteger();
private CharacterSkills skillType;
//Skill% before trains and before any effects or item bonuses
private float baseAmountBeforeMods;
@ -224,7 +221,6 @@ public class CharacterSkill extends AbstractGameObject { @@ -224,7 +221,6 @@ public class CharacterSkill extends AbstractGameObject {
this.ownerUID = pc.getObjectUUID();
calculateBaseAmount();
calculateModifiedAmount(false);
this.skillType = CharacterSkills.GetCharacterSkillByToken(this.skillsBase.getToken());
}
/**
@ -239,7 +235,7 @@ public class CharacterSkill extends AbstractGameObject { @@ -239,7 +235,7 @@ public class CharacterSkill extends AbstractGameObject {
this.trained = true;
calculateBaseAmount();
calculateModifiedAmount(false);
this.skillType = CharacterSkills.GetCharacterSkillByToken(this.skillsBase.getToken());
}
@ -255,7 +251,7 @@ public class CharacterSkill extends AbstractGameObject { @@ -255,7 +251,7 @@ public class CharacterSkill extends AbstractGameObject {
this.ownerUID = pc.getObjectUUID();
calculateBaseAmount();
calculateModifiedAmount(false);
this.skillType = CharacterSkills.GetCharacterSkillByToken(this.skillsBase.getToken());
}
public CharacterSkill(SkillsBase sb, Mob mob, int trains) {
@ -267,7 +263,7 @@ public class CharacterSkill extends AbstractGameObject { @@ -267,7 +263,7 @@ public class CharacterSkill extends AbstractGameObject {
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());
}
public CharacterSkill(ResultSet rs) throws SQLException {
@ -279,7 +275,6 @@ public class CharacterSkill extends AbstractGameObject { @@ -279,7 +275,6 @@ public class CharacterSkill extends AbstractGameObject {
// this.owner = DbManager.PlayerCharacterQueries.GET_PLAYER_CHARACTER(rs.getInt("CharacterID"));
calculateBaseAmount();
calculateModifiedAmount(false);
this.skillType = CharacterSkills.GetCharacterSkillByToken(this.skillsBase.getToken());
}
public static AbstractCharacter GetOwner(CharacterSkill cs) {

Loading…
Cancel
Save