mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-08 14:57:18 +07:00
Added wet shocking
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -28,6 +28,7 @@ logs/
|
|||||||
/ios/src/io/anuke/mindustry/gen/
|
/ios/src/io/anuke/mindustry/gen/
|
||||||
/core/src/io/anuke/mindustry/gen/
|
/core/src/io/anuke/mindustry/gen/
|
||||||
ios/robovm.properties
|
ios/robovm.properties
|
||||||
|
config/
|
||||||
*.gif
|
*.gif
|
||||||
|
|
||||||
version.properties
|
version.properties
|
||||||
|
@ -11,7 +11,7 @@ import io.anuke.ucore.core.Timers;
|
|||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class StatusEffects implements ContentList{
|
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
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
@ -65,6 +65,17 @@ public class StatusEffects implements ContentList{
|
|||||||
speedMultiplier = 0.9f;
|
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
|
@Override
|
||||||
public void update(Unit unit, float time){
|
public void update(Unit unit, float time){
|
||||||
if(Mathf.chance(Timers.delta() * 0.15f)){
|
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);
|
melting.setOpposites(wet, freezing);
|
||||||
wet.setOpposites(burning);
|
wet.setOpposites(burning);
|
||||||
freezing.setOpposites(burning, melting);
|
freezing.setOpposites(burning, melting);
|
||||||
|
@ -39,6 +39,8 @@ public class TurretBullets extends BulletList implements ContentList{
|
|||||||
lifetime = Lightning.lifetime;
|
lifetime = Lightning.lifetime;
|
||||||
hiteffect = BulletFx.hitLancer;
|
hiteffect = BulletFx.hitLancer;
|
||||||
despawneffect = Fx.none;
|
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);
|
x += Angles.trnsx(rotation, hitRange/2f);
|
||||||
y += Angles.trnsy(rotation, hitRange/2f);
|
y += Angles.trnsy(rotation, hitRange/2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user