use of jackiecrazy.wardance.capability.skill.ISkillCapability in project WarDance by Jackiecrazy.
the class SkillEventHandler method damageFlags.
@SubscribeEvent(priority = EventPriority.HIGHEST)
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));
}
}
use of jackiecrazy.wardance.capability.skill.ISkillCapability in project WarDance by Jackiecrazy.
the class SkillEventHandler method hurtFlags.
@SubscribeEvent(priority = EventPriority.HIGHEST)
public static void hurtFlags(LivingHurtEvent 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 knockbackFlags.
@SubscribeEvent(priority = EventPriority.HIGHEST)
public static void knockbackFlags(MeleeKnockbackEvent 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 hurtFlagS.
@SubscribeEvent(priority = EventPriority.LOWEST)
public static void hurtFlagS(LivingHurtEvent 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 parryFlagS.
@SubscribeEvent(priority = EventPriority.LOWEST)
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()));
}
}
Aggregations