do something when applied (#7640)

This commit is contained in:
MEEPofFaith
2022-09-30 14:37:58 -04:00
committed by GitHub
parent 8ae00e69cb
commit ce23fe9d24
2 changed files with 4 additions and 0 deletions
@@ -46,6 +46,7 @@ abstract class StatusComp implements Posc, Flyingc{
//extend effect //extend effect
if(entry.effect == effect){ if(entry.effect == effect){
entry.time = Math.max(entry.time, duration); entry.time = Math.max(entry.time, duration);
effect.applied(self(), entry.time, true);
return; return;
}else if(entry.effect.applyTransition(self(), effect, entry, duration)){ //find reaction }else if(entry.effect.applyTransition(self(), effect, entry, duration)){ //find reaction
//TODO effect may react with multiple other effects //TODO effect may react with multiple other effects
@@ -60,6 +61,7 @@ abstract class StatusComp implements Posc, Flyingc{
StatusEntry entry = Pools.obtain(StatusEntry.class, StatusEntry::new); StatusEntry entry = Pools.obtain(StatusEntry.class, StatusEntry::new);
entry.set(effect, duration); entry.set(effect, duration);
statuses.add(entry); statuses.add(entry);
effect.applied(self(), duration, false);
} }
} }
@@ -187,6 +187,8 @@ public class StatusEffect extends UnlockableContent{
return false; return false;
} }
public void applied(Unit unit, float time, boolean extend){}
@Override @Override
public void createIcons(MultiPacker packer){ public void createIcons(MultiPacker packer){
super.createIcons(packer); super.createIcons(packer);