do something when applied (#7640)
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user