mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-04 06:31:42 +07:00
do something when applied (#7640)
This commit is contained in:
parent
8ae00e69cb
commit
ce23fe9d24
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user