use of jackiecrazy.wardance.capability.skill.ISkillCapability in project WarDance by Jackiecrazy.
the class SkillEventHandler method parryFlags.
@SubscribeEvent(priority = EventPriority.HIGHEST)
public static void parryFlags(ParryEvent e) {
if (!e.getEntityLiving().isEffectiveAi())
return;
if (e.getAttacker() != null) {
LivingEntity attacker = e.getAttacker();
ISkillCapability isc = CasterData.getCap(attacker);
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(attacker, e, d.getState(), d, e.getEntityLiving()));
}
}
ISkillCapability isc = CasterData.getCap(e.getEntityLiving());
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(e.getEntityLiving(), e, d.getState(), d, e.getAttacker()));
}
}
use of jackiecrazy.wardance.capability.skill.ISkillCapability in project WarDance by Jackiecrazy.
the class SkillEventHandler method deathFlag.
@SubscribeEvent(priority = EventPriority.HIGHEST)
public static void deathFlag(LivingDeathEvent e) {
if (!e.getEntityLiving().isEffectiveAi())
return;
if (e.getSource().getEntity() instanceof LivingEntity) {
LivingEntity attacker = (LivingEntity) e.getSource().getEntity();
ISkillCapability isc = CasterData.getCap(attacker);
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(attacker, e, d.getState(), d, e.getEntityLiving()));
}
}
ISkillCapability isc = CasterData.getCap(e.getEntityLiving());
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(e.getEntityLiving(), e, d.getState(), d, null));
}
}
use of jackiecrazy.wardance.capability.skill.ISkillCapability in project WarDance by Jackiecrazy.
the class SkillEventHandler method drops.
@SubscribeEvent(priority = EventPriority.HIGHEST)
public static void drops(LivingDropsEvent e) {
if (e.getEntityLiving() != null && !e.getEntityLiving().isEffectiveAi())
return;
if (e.getSource().getEntity() instanceof LivingEntity) {
LivingEntity attacker = (LivingEntity) e.getSource().getEntity();
ISkillCapability isc = CasterData.getCap(attacker);
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(attacker, e, d.getState(), d, e.getEntityLiving()));
}
}
ISkillCapability isc = CasterData.getCap(e.getEntityLiving());
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(e.getEntityLiving(), e, d.getState(), d, null));
}
}
use of jackiecrazy.wardance.capability.skill.ISkillCapability in project WarDance by Jackiecrazy.
the class SkillEventHandler method staggerFlags.
@SubscribeEvent(priority = EventPriority.HIGHEST)
public static void staggerFlags(StaggerEvent e) {
if (!e.getEntityLiving().isEffectiveAi())
return;
if (e.getAttacker() != null) {
LivingEntity attacker = e.getAttacker();
ISkillCapability isc = CasterData.getCap(attacker);
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(attacker, e, d.getState(), d, e.getEntityLiving()));
}
}
ISkillCapability isc = CasterData.getCap(e.getEntityLiving());
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(e.getEntityLiving(), e, d.getState(), d, e.getAttacker()));
}
}
use of jackiecrazy.wardance.capability.skill.ISkillCapability in project WarDance by Jackiecrazy.
the class SkillEventHandler method damageFlagS.
@SubscribeEvent(priority = EventPriority.LOWEST)
public static void damageFlagS(LivingDamageEvent e) {
if (!e.getEntityLiving().isEffectiveAi())
return;
if (e.getSource().getEntity() instanceof LivingEntity) {
LivingEntity attacker = (LivingEntity) e.getSource().getEntity();
ISkillCapability isc = CasterData.getCap(attacker);
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(attacker, e, d.getState(), d, e.getEntityLiving()));
}
}
ISkillCapability isc = CasterData.getCap(e.getEntityLiving());
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(e.getEntityLiving(), e, d.getState(), d, null));
}
}
Aggregations