This commit is contained in:
Anuken
2020-06-26 14:27:26 -04:00
parent eabc5c15c7
commit fdf7c88083
228 changed files with 1219 additions and 1163 deletions

View File

@@ -24,7 +24,7 @@ public class ArtilleryBulletType extends BasicBulletType{
}
@Override
public void update(Bulletc b){
public void update(Bullet b){
super.update(b);
if(b.timer(0, 3 + b.fslope() * 2f)){
@@ -33,7 +33,7 @@ public class ArtilleryBulletType extends BasicBulletType{
}
@Override
public void draw(Bulletc b){
public void draw(Bullet b){
float baseScale = 0.7f;
float scale = (baseScale + b.fslope() * (1f - baseScale));

View File

@@ -39,7 +39,7 @@ public class BasicBulletType extends BulletType{
}
@Override
public void draw(Bulletc b){
public void draw(Bullet b){
float height = this.height * ((1f - shrinkY) + shrinkY * b.fout());
float width = this.width * ((1f - shrinkX) + shrinkX * b.fout());

View File

@@ -110,19 +110,19 @@ public abstract class BulletType extends Content{
return speed * lifetime * (1f - drag);
}
public boolean collides(Bulletc bullet, Tilec tile){
public boolean collides(Bullet bullet, Building tile){
return true;
}
public void hitTile(Bulletc b, Tilec tile){
public void hitTile(Bullet b, Building tile){
hit(b);
}
public void hit(Bulletc b){
public void hit(Bullet b){
hit(b, b.getX(), b.getY());
}
public void hit(Bulletc b, float x, float y){
public void hit(Bullet b, float x, float y){
hitEffect.at(x, y, b.rotation(), hitColor);
hitSound.at(b);
@@ -153,7 +153,7 @@ public abstract class BulletType extends Content{
}
}
public void despawned(Bulletc b){
public void despawned(Bullet b){
despawnEffect.at(b.getX(), b.getY(), b.rotation());
hitSound.at(b);
@@ -162,14 +162,14 @@ public abstract class BulletType extends Content{
}
}
public void draw(Bulletc b){
public void draw(Bullet b){
}
public void drawLight(Bulletc b){
public void drawLight(Bullet b){
Drawf.light(b.team(), b, lightRadius, lightColor, lightOpacity);
}
public void init(Bulletc b){
public void init(Bullet b){
if(killShooter && b.owner() instanceof Healthc){
((Healthc)b.owner()).kill();
}
@@ -179,7 +179,7 @@ public abstract class BulletType extends Content{
}
}
public void update(Bulletc b){
public void update(Bullet b){
if(homingPower > 0.0001f){
Teamc target = Units.closestTarget(b.team(), b.getX(), b.getY(), homingRange, e -> (e.isGrounded() && collidesGround) || (e.isFlying() && collidesAir), t -> collidesGround);
if(target != null){
@@ -197,32 +197,32 @@ public abstract class BulletType extends Content{
return ContentType.bullet;
}
public Bulletc create(Teamc owner, float x, float y, float angle){
public Bullet create(Teamc owner, float x, float y, float angle){
return create(owner, owner.team(), x, y, angle);
}
public Bulletc create(Entityc owner, Team team, float x, float y, float angle){
public Bullet create(Entityc owner, Team team, float x, float y, float angle){
return create(owner, team, x, y, angle, 1f);
}
public Bulletc create(Entityc owner, Team team, float x, float y, float angle, float velocityScl){
public Bullet create(Entityc owner, Team team, float x, float y, float angle, float velocityScl){
return create(owner, team, x, y, angle, -1, velocityScl, 1f, null);
}
public Bulletc create(Entityc owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl){
public Bullet create(Entityc owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl){
return create(owner, team, x, y, angle, -1, velocityScl, lifetimeScl, null);
}
public Bulletc create(Bulletc parent, float x, float y, float angle){
public Bullet create(Bullet parent, float x, float y, float angle){
return create(parent.owner(), parent.team(), x, y, angle);
}
public Bulletc create(Bulletc parent, float x, float y, float angle, float velocityScl){
public Bullet create(Bullet parent, float x, float y, float angle, float velocityScl){
return create(parent.owner(), parent.team(), x, y, angle, velocityScl);
}
public Bulletc create(@Nullable Entityc owner, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl, Object data){
Bulletc bullet = BulletEntity.create();
public Bullet create(@Nullable Entityc owner, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl, Object data){
Bullet bullet = Bullet.create();
bullet.type(this);
bullet.owner(owner);
bullet.team(team);

View File

@@ -43,7 +43,7 @@ public class ContinuousLaserBulletType extends BulletType{
}
@Override
public void update(Bulletc b){
public void update(Bullet b){
//TODO possible laser absorption from blocks
//damage every 5 ticks
@@ -57,7 +57,7 @@ public class ContinuousLaserBulletType extends BulletType{
}
@Override
public void draw(Bulletc b){
public void draw(Bullet b){
float baseLen = length * b.fout();
Lines.lineAngle(b.x(), b.y(), b.rotation(), baseLen);
@@ -77,7 +77,7 @@ public class ContinuousLaserBulletType extends BulletType{
}
@Override
public void drawLight(Bulletc b){
public void drawLight(Bullet b){
//no light drawn here
}

View File

@@ -23,7 +23,7 @@ public class FlakBulletType extends BasicBulletType{
}
@Override
public void update(Bulletc b){
public void update(Bullet b){
super.update(b);
if(b.data() instanceof Integer) return;

View File

@@ -28,12 +28,12 @@ public class HealBulletType extends BulletType{
}
@Override
public boolean collides(Bulletc b, Tilec tile){
public boolean collides(Bullet b, Building tile){
return tile.team() != b.team() || tile.healthf() < 1f;
}
@Override
public void draw(Bulletc b){
public void draw(Bullet b){
Draw.color(backColor);
Lines.stroke(bulletWidth);
Lines.lineAngleCenter(b.x(), b.y(), b.rotation(), bulletHeight);
@@ -43,7 +43,7 @@ public class HealBulletType extends BulletType{
}
@Override
public void hitTile(Bulletc b, Tilec tile){
public void hitTile(Bullet b, Building tile){
super.hit(b);
if(tile.team() == b.team() && !(tile.block() instanceof BuildBlock)){

View File

@@ -48,7 +48,7 @@ public class LaserBulletType extends BulletType{
}
@Override
public void init(Bulletc b){
public void init(Bullet b){
Tmp.v1.trns(b.rotation(), length);
furthest = null;
@@ -65,7 +65,7 @@ public class LaserBulletType extends BulletType{
}
@Override
public void draw(Bulletc b){
public void draw(Bullet b){
float realLength = b.data() == null ? length : (Float)b.data();
float f = Mathf.curve(b.fin(), 0f, 0.2f);
@@ -97,7 +97,7 @@ public class LaserBulletType extends BulletType{
}
@Override
public void drawLight(Bulletc b){
public void drawLight(Bullet b){
//no light drawn here
}
}

View File

@@ -26,11 +26,11 @@ public class LightningBulletType extends BulletType{
}
@Override
public void draw(Bulletc b){
public void draw(Bullet b){
}
@Override
public void init(Bulletc b){
public void init(Bullet b){
Lightning.create(b.team(), lightningColor, damage, b.x(), b.y(), b.rotation(), lightningLength);
}
}

View File

@@ -44,7 +44,7 @@ public class LiquidBulletType extends BulletType{
}
@Override
public void update(Bulletc b){
public void update(Bullet b){
super.update(b);
if(liquid.canExtinguish()){
@@ -58,21 +58,21 @@ public class LiquidBulletType extends BulletType{
}
@Override
public void draw(Bulletc b){
public void draw(Bullet b){
Draw.color(liquid.color, Color.white, b.fout() / 100f);
Fill.circle(b.x(), b.y(), 3f);
}
@Override
public void despawned(Bulletc b){
public void despawned(Bullet b){
super.despawned(b);
hit(b, b.x(), b.y());
}
@Override
public void hit(Bulletc b, float hitx, float hity){
public void hit(Bullet b, float hitx, float hity){
hitEffect.at(hitx, hity, liquid.color);
Puddles.deposit(world.tileWorld(hitx, hity), liquid, puddleSize);

View File

@@ -22,7 +22,7 @@ public class MassDriverBolt extends BulletType{
}
@Override
public void draw(Bulletc b){
public void draw(Bullet b){
float w = 11f, h = 13f;
Draw.color(Pal.bulletYellowBack);
@@ -35,7 +35,7 @@ public class MassDriverBolt extends BulletType{
}
@Override
public void update(Bulletc b){
public void update(Bullet b){
//data MUST be an instance of DriverBulletData
if(!(b.data() instanceof DriverBulletData)){
hit(b);
@@ -81,7 +81,7 @@ public class MassDriverBolt extends BulletType{
}
@Override
public void despawned(Bulletc b){
public void despawned(Bullet b){
super.despawned(b);
if(!(b.data() instanceof DriverBulletData)) return;
@@ -98,7 +98,7 @@ public class MassDriverBolt extends BulletType{
}
@Override
public void hit(Bulletc b, float hitx, float hity){
public void hit(Bullet b, float hitx, float hity){
super.hit(b, hitx, hity);
despawned(b);
}

View File

@@ -22,7 +22,7 @@ public class MissileBulletType extends BasicBulletType{
}
@Override
public void update(Bulletc b){
public void update(Bullet b){
super.update(b);
if(Mathf.chanceDelta(0.2)){