mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-22 04:28:27 +07:00
Added wet shocking
This commit is contained in:
parent
56ef7ae60c
commit
236e3c7e61
1
.gitignore
vendored
1
.gitignore
vendored
@ -28,6 +28,7 @@ logs/
|
||||
/ios/src/io/anuke/mindustry/gen/
|
||||
/core/src/io/anuke/mindustry/gen/
|
||||
ios/robovm.properties
|
||||
config/
|
||||
*.gif
|
||||
|
||||
version.properties
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user