Mutual status effect transitions
This commit is contained in:
@@ -21,7 +21,7 @@ public class StatusEffects implements ContentList{
|
|||||||
|
|
||||||
burning = new StatusEffect("burning"){{
|
burning = new StatusEffect("burning"){{
|
||||||
color = Pal.lightFlame;
|
color = Pal.lightFlame;
|
||||||
damage = 0.12f; //over 8 seconds, this would be 60 damage
|
damage = 0.12f; //over 8 seconds, this would be ~60 damage
|
||||||
effect = Fx.burning;
|
effect = Fx.burning;
|
||||||
|
|
||||||
init(() -> {
|
init(() -> {
|
||||||
@@ -29,7 +29,7 @@ public class StatusEffects implements ContentList{
|
|||||||
trans(tarred, ((unit, time, newTime, result) -> {
|
trans(tarred, ((unit, time, newTime, result) -> {
|
||||||
unit.damagePierce(8f);
|
unit.damagePierce(8f);
|
||||||
Fx.burning.at(unit.x + Mathf.range(unit.bounds() / 2f), unit.y + Mathf.range(unit.bounds() / 2f));
|
Fx.burning.at(unit.x + Mathf.range(unit.bounds() / 2f), unit.y + Mathf.range(unit.bounds() / 2f));
|
||||||
result.set(this, Math.min(time + newTime, 300f));
|
result.set(burning, Math.min(time + newTime, 300f));
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}};
|
}};
|
||||||
@@ -45,7 +45,7 @@ public class StatusEffects implements ContentList{
|
|||||||
|
|
||||||
trans(blasted, ((unit, time, newTime, result) -> {
|
trans(blasted, ((unit, time, newTime, result) -> {
|
||||||
unit.damagePierce(18f);
|
unit.damagePierce(18f);
|
||||||
result.set(this, time);
|
result.set(freezing, time);
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}};
|
}};
|
||||||
@@ -72,7 +72,7 @@ public class StatusEffects implements ContentList{
|
|||||||
if(unit.team == state.rules.waveTeam){
|
if(unit.team == state.rules.waveTeam){
|
||||||
Events.fire(Trigger.shock);
|
Events.fire(Trigger.shock);
|
||||||
}
|
}
|
||||||
result.set(this, time);
|
result.set(wet, time);
|
||||||
}));
|
}));
|
||||||
opposite(burning);
|
opposite(burning);
|
||||||
});
|
});
|
||||||
@@ -97,7 +97,7 @@ public class StatusEffects implements ContentList{
|
|||||||
trans(tarred, ((unit, time, newTime, result) -> {
|
trans(tarred, ((unit, time, newTime, result) -> {
|
||||||
unit.damagePierce(8f);
|
unit.damagePierce(8f);
|
||||||
Fx.burning.at(unit.x + Mathf.range(unit.bounds() / 2f), unit.y + Mathf.range(unit.bounds() / 2f));
|
Fx.burning.at(unit.x + Mathf.range(unit.bounds() / 2f), unit.y + Mathf.range(unit.bounds() / 2f));
|
||||||
result.set(this, Math.min(time + newTime, 200f));
|
result.set(melting, Math.min(time + newTime, 200f));
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -61,6 +61,10 @@ abstract class StatusComp implements Posc, Flyingc{
|
|||||||
statuses.add(entry);
|
statuses.add(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clearStatuses(){
|
||||||
|
statuses.clear();
|
||||||
|
}
|
||||||
|
|
||||||
/** Removes a status effect. */
|
/** Removes a status effect. */
|
||||||
void unapply(StatusEffect effect){
|
void unapply(StatusEffect effect){
|
||||||
statuses.remove(e -> {
|
statuses.remove(e -> {
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ public class StatusEffect extends MappableContent{
|
|||||||
|
|
||||||
protected void trans(StatusEffect effect, TransitionHandler handler){
|
protected void trans(StatusEffect effect, TransitionHandler handler){
|
||||||
transitions.put(effect, handler);
|
transitions.put(effect, handler);
|
||||||
|
effect.transitions.put(this, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void opposite(StatusEffect... effect){
|
protected void opposite(StatusEffect... effect){
|
||||||
|
|||||||
Reference in New Issue
Block a user