Merged current master to branch
This commit is contained in:
@@ -11,7 +11,7 @@ import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class StatusEffects implements ContentList{
|
||||
public static StatusEffect none, burning, freezing, wet, melting, tarred, overdrive, shielded;
|
||||
public static StatusEffect none, burning, freezing, wet, melting, tarred, overdrive, shielded, shocked;
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
@@ -47,7 +47,8 @@ public class StatusEffects implements ContentList{
|
||||
freezing = new StatusEffect(5 * 60f){
|
||||
{
|
||||
oppositeScale = 0.4f;
|
||||
speedMultiplier = 0.5f;
|
||||
speedMultiplier = 0.6f;
|
||||
armorMultiplier = 0.8f;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,6 +66,17 @@ public class StatusEffects implements ContentList{
|
||||
speedMultiplier = 0.9f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatusEntry getTransition(Unit unit, StatusEffect to, float time, float newTime, StatusEntry result){
|
||||
if(to == shocked){
|
||||
//get shocked when wet
|
||||
unit.damage(15f);
|
||||
return result.set(this, time);
|
||||
}
|
||||
|
||||
return super.getTransition(unit, to, time, newTime, result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Unit unit, float time){
|
||||
if(Mathf.chance(Timers.delta() * 0.15f)){
|
||||
@@ -145,6 +157,13 @@ public class StatusEffects implements ContentList{
|
||||
}
|
||||
};
|
||||
|
||||
shocked = new StatusEffect(1f){
|
||||
{
|
||||
armorMultiplier = 3f;
|
||||
}
|
||||
};
|
||||
|
||||
wet.setOpposites(shocked);
|
||||
melting.setOpposites(wet, freezing);
|
||||
wet.setOpposites(burning);
|
||||
freezing.setOpposites(burning, melting);
|
||||
|
||||
@@ -39,6 +39,8 @@ public class TurretBullets extends BulletList implements ContentList{
|
||||
lifetime = Lightning.lifetime;
|
||||
hiteffect = BulletFx.hitLancer;
|
||||
despawneffect = Fx.none;
|
||||
status = StatusEffects.shocked;
|
||||
statusIntensity = 1f;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -71,7 +73,7 @@ public class TurretBullets extends BulletList implements ContentList{
|
||||
super.hit(b);
|
||||
tile = tile.target();
|
||||
|
||||
if(tile.getTeam() == b.getTeam() && !(tile.block() instanceof BuildBlock)){
|
||||
if(tile != null && tile.getTeam() == b.getTeam() && !(tile.block() instanceof BuildBlock)){
|
||||
Effects.effect(BlockFx.healBlockFull, Palette.heal, tile.drawx(), tile.drawy(), tile.block().size);
|
||||
tile.entity.healBy(healPercent / 100f * tile.entity.maxHealth());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user