Added function to translate mode based on source entity type

This commit is contained in:
Collin Smith 2020-11-02 18:00:31 -08:00
parent 2820ba7566
commit 60247a6699

View File

@ -84,7 +84,7 @@ public class Actioneer extends PassiveSystem {
targetVec = targetVec != null ? targetVec.cpy() : Vector2.Zero;
final Class.Type type = mClass.get(entityId).type;
byte mode = (byte) type.getMode(skill.anim);
byte mode = (byte) getMode(skill, type);
log.trace("mode: {}", mode);
if (mode == Engine.INVALID_MODE) {
mode = (byte) type.getMode("SC");
@ -101,6 +101,13 @@ public class Actioneer extends PassiveSystem {
events.dispatch(SkillStartEvent.obtain(entityId, skillId, targetId, targetVec, skill.srvstfunc, skill.cltstfunc));
}
int getMode(Skills.Entry skill, Class.Type type) {
switch (type) {
case MON: return type.getMode(skill.monanim);
default: return type.getMode(skill.anim);
}
}
@Subscribe
public void onAnimDataKeyframe(AnimDataKeyframeEvent event) {
if (!mCasting.has(event.entityId)) return;