use of com.solinia.solinia.Models.SoliniaAARankEffect in project solinia3-core by mixxit.
the class Utils method getTotalAAEffectStat.
public static int getTotalAAEffectStat(LivingEntity bukkitLivingEntity, String stat) {
if (!(bukkitLivingEntity instanceof Player))
return 0;
try {
ISoliniaPlayer player = SoliniaPlayerAdapter.Adapt((Player) bukkitLivingEntity);
int total = 0;
int effectIdLookup = 0;
switch(stat) {
case "STRENGTH":
effectIdLookup = Utils.getEffectIdFromEffectType(SpellEffectType.STR);
break;
case "STAMINA":
effectIdLookup = Utils.getEffectIdFromEffectType(SpellEffectType.STA);
break;
case "AGILITY":
effectIdLookup = Utils.getEffectIdFromEffectType(SpellEffectType.AGI);
break;
case "DEXTERITY":
effectIdLookup = Utils.getEffectIdFromEffectType(SpellEffectType.DEX);
break;
case "INTELLIGENCE":
effectIdLookup = Utils.getEffectIdFromEffectType(SpellEffectType.INT);
break;
case "WISDOM":
effectIdLookup = Utils.getEffectIdFromEffectType(SpellEffectType.WIS);
break;
case "CHARISMA":
effectIdLookup = Utils.getEffectIdFromEffectType(SpellEffectType.CHA);
break;
default:
break;
}
if (effectIdLookup == 0)
return 0;
for (SoliniaAARankEffect effect : player.getRanksEffectsOfEffectType(effectIdLookup)) {
total += effect.getBase1();
}
return total;
} catch (CoreStateInitException e) {
return 0;
}
}
use of com.solinia.solinia.Models.SoliniaAARankEffect in project solinia3-core by mixxit.
the class Utils method getTotalAAEffectMaxHp.
public static double getTotalAAEffectMaxHp(LivingEntity bukkitLivingEntity) {
if (!(bukkitLivingEntity instanceof Player))
return 0;
try {
ISoliniaPlayer player = SoliniaPlayerAdapter.Adapt((Player) bukkitLivingEntity);
int total = 0;
int effectIdLookup = 0;
effectIdLookup = Utils.getEffectIdFromEffectType(SpellEffectType.MaxHPChange);
if (effectIdLookup > 0) {
for (SoliniaAARankEffect effect : player.getRanksEffectsOfEffectType(effectIdLookup)) {
total += effect.getBase1();
}
}
effectIdLookup = Utils.getEffectIdFromEffectType(SpellEffectType.TotalHP);
if (effectIdLookup > 0) {
for (SoliniaAARankEffect effect : player.getRanksEffectsOfEffectType(effectIdLookup)) {
total += effect.getBase1();
}
}
return total;
} catch (CoreStateInitException e) {
return 0;
}
}
use of com.solinia.solinia.Models.SoliniaAARankEffect in project solinia3-core by mixxit.
the class Utils method getTotalAAEffectEffectType.
public static int getTotalAAEffectEffectType(LivingEntity bukkitLivingEntity, SpellEffectType effectType) {
if (!(bukkitLivingEntity instanceof Player))
return 0;
try {
ISoliniaPlayer player = SoliniaPlayerAdapter.Adapt((Player) bukkitLivingEntity);
int total = 0;
for (SoliniaAARankEffect effect : player.getRanksEffectsOfEffectType(Utils.getEffectIdFromEffectType(effectType))) {
total += effect.getBase1();
}
return total;
} catch (CoreStateInitException e) {
return 0;
}
}
Aggregations