New mech drowning algorithm
This commit is contained in:
@@ -170,6 +170,7 @@ public class UnitTypes implements ContentList{
|
||||
mechStepParticles = true;
|
||||
mechStepShake = 0.15f;
|
||||
singleTarget = true;
|
||||
drownTimeMultiplier = 4f;
|
||||
|
||||
weapons.add(
|
||||
new Weapon("scepter-weapon"){{
|
||||
@@ -227,7 +228,7 @@ public class UnitTypes implements ContentList{
|
||||
armor = 14f;
|
||||
mechStepParticles = true;
|
||||
mechStepShake = 0.75f;
|
||||
canDrown = false;
|
||||
drownTimeMultiplier = 6f;
|
||||
mechFrontSway = 1.9f;
|
||||
mechSideSway = 0.6f;
|
||||
ammoType = new ItemAmmoType(Items.thorium);
|
||||
|
||||
@@ -44,9 +44,7 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
|
||||
return isGrounded() && !hovering;
|
||||
}
|
||||
|
||||
//TODO
|
||||
@Nullable
|
||||
Floor drownFloor(){
|
||||
@Nullable Floor drownFloor(){
|
||||
return canDrown() ? floorOn() : null;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import mindustry.entities.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.environment.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@@ -62,6 +63,21 @@ abstract class MechComp implements Posc, Flyingc, Hitboxc, Unitc, Mechc, Elevati
|
||||
walkExtension = extendScl;
|
||||
}
|
||||
|
||||
@Replace
|
||||
@Override
|
||||
public @Nullable Floor drownFloor(){
|
||||
//large mechs can only drown when all the nearby floors are deep
|
||||
if(hitSize >= 12 && canDrown()){
|
||||
for(Point2 p : Geometry.d8){
|
||||
Floor f = world.floorWorld(x + p.x * tilesize, y + p.y * tilesize);
|
||||
if(!f.isDeep()){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return canDrown() ? floorOn() : null;
|
||||
}
|
||||
|
||||
public float walkExtend(boolean scaled){
|
||||
|
||||
//now ranges from -maxExtension to maxExtension*3
|
||||
|
||||
Reference in New Issue
Block a user