1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-09-11 08:15:35 +03:00

Added wet shocking

This commit is contained in:
Anuken 2018-11-30 23:12:48 -05:00
parent 56ef7ae60c
commit 236e3c7e61
4 changed files with 22 additions and 2 deletions

1
.gitignore vendored
View File

@ -28,6 +28,7 @@ logs/
/ios/src/io/anuke/mindustry/gen/
/core/src/io/anuke/mindustry/gen/
ios/robovm.properties
config/
*.gif
version.properties

View File

@ -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(){
@ -65,6 +65,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 +156,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);

View File

@ -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;
}
};

View File

@ -91,7 +91,6 @@ public class Lightning extends TimedEntity implements DrawTrait, SyncTrait, Time
x += Angles.trnsx(rotation, hitRange/2f);
y += Angles.trnsy(rotation, hitRange/2f);
}
}
}