do something when applied (#7640)

This commit is contained in:
MEEPofFaith 2022-09-30 11:37:58 -07:00 committed by GitHub
parent 8ae00e69cb
commit ce23fe9d24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -46,6 +46,7 @@ abstract class StatusComp implements Posc, Flyingc{
//extend effect
if(entry.effect == effect){
entry.time = Math.max(entry.time, duration);
effect.applied(self(), entry.time, true);
return;
}else if(entry.effect.applyTransition(self(), effect, entry, duration)){ //find reaction
//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);
entry.set(effect, duration);
statuses.add(entry);
effect.applied(self(), duration, false);
}
}

View File

@ -187,6 +187,8 @@ public class StatusEffect extends UnlockableContent{
return false;
}
public void applied(Unit unit, float time, boolean extend){}
@Override
public void createIcons(MultiPacker packer){
super.createIcons(packer);