Added tractor beam turret

This commit is contained in:
Anuken
2020-07-02 14:02:33 -04:00
parent 0a7e40bd23
commit cecb5cf4b4
45 changed files with 4825 additions and 4509 deletions

View File

@@ -514,7 +514,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
return flow;
}else if(ofract > 0.1f && fract > 0.1f){
//TODO these are incorrect effect positions
float fx = (x + next.x()) / 2f, fy = (y + next.y()) / 2f;
float fx = (x + next.x) / 2f, fy = (y + next.y) / 2f;
Liquid other = next.liquids().current();
if((other.flammability > 0.3f && liquid.temperature > 0.7f) || (liquid.flammability > 0.3f && other.temperature > 0.7f)){

View File

@@ -22,6 +22,10 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
transient float drownTime;
transient float splashTimer;
boolean checkTarget(boolean targetAir, boolean targetGround){
return (isGrounded() && targetGround) || (isFlying() && targetAir);
}
boolean isGrounded(){
return elevation < 0.001f;
}

View File

@@ -82,7 +82,7 @@ abstract class HealthComp implements Entityc{
}
void damageContinuous(float amount){
damage(amount * Time.delta(), hitTime <= -20 + hitDuration);
damage(amount * Time.delta(), hitTime <= -10 + hitDuration);
}
void damageContinuousPierce(float amount){

View File

@@ -1,6 +1,7 @@
package mindustry.entities.comp;
import arc.math.*;
import arc.math.geom.*;
import mindustry.annotations.Annotations.*;
import mindustry.async.PhysicsProcess.*;
import mindustry.gen.*;
@@ -11,6 +12,7 @@ import mindustry.gen.*;
@Component
abstract class PhysicsComp implements Velc, Hitboxc, Flyingc{
@Import float hitSize;
@Import Vec2 vel;
transient PhysicRef physref;
@@ -21,6 +23,10 @@ abstract class PhysicsComp implements Velc, Hitboxc, Flyingc{
void impulse(float x, float y){
float mass = mass();
vel().add(x / mass, y / mass);
vel.add(x / mass, y / mass);
}
void impulse(Vec2 v){
impulse(v.x, v.y);
}
}