mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-25 10:25:42 +07:00
Fixed #3204
This commit is contained in:
parent
583e286ada
commit
b75a03aed8
@ -1066,38 +1066,40 @@ public class Fx{
|
||||
|
||||
shellEjectSmall = new Effect(30f, e -> {
|
||||
color(Pal.lightOrange, Color.lightGray, Pal.lightishGray, e.fin());
|
||||
alpha(e.fout(0.2f));
|
||||
float rot = Math.abs(e.rotation) + 90f;
|
||||
|
||||
int i = Mathf.sign(e.rotation);
|
||||
int i = -Mathf.sign(e.rotation);
|
||||
|
||||
float len = (2f + e.finpow() * 6f) * i;
|
||||
float lr = rot + e.fin() * 30f * i;
|
||||
Fill.rect(e.x + trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
|
||||
e.y + trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
|
||||
1f, 2f, rot + e.fin() * 50f * i);
|
||||
e.y + trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
|
||||
1f, 2f, rot + e.fin() * 50f * i);
|
||||
|
||||
}).layer(Layer.debris, 400f),
|
||||
|
||||
shellEjectMedium = new Effect(34f, e -> {
|
||||
color(Pal.lightOrange, Color.lightGray, Pal.lightishGray, e.fin());
|
||||
float rot = e.rotation + 90f;
|
||||
for(int i : Mathf.signs){
|
||||
float rot = Math.abs(e.rotation) + 90f;
|
||||
int i = Mathf.sign(e.rotation);
|
||||
//for(int i : Mathf.signs){
|
||||
float len = (2f + e.finpow() * 10f) * i;
|
||||
float lr = rot + e.fin() * 20f * i;
|
||||
rect(Core.atlas.find("casing"),
|
||||
e.x + trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
|
||||
e.y + trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
|
||||
2f, 3f, rot);
|
||||
}
|
||||
//}
|
||||
|
||||
color(Color.lightGray, Color.gray, e.fin());
|
||||
|
||||
for(int i : Mathf.signs){
|
||||
//for(int i : Mathf.signs){
|
||||
float ex = e.x, ey = e.y, fout = e.fout();
|
||||
randLenVectors(e.id, 4, 1f + e.finpow() * 11f, e.rotation + 90f * i, 20f, (x, y) -> {
|
||||
Fill.circle(ex + x, ey + y, fout * 1.5f);
|
||||
});
|
||||
}
|
||||
//}
|
||||
|
||||
}).layer(Layer.debris, 400f),
|
||||
|
||||
|
@ -180,18 +180,8 @@ public class Logic implements ApplicationListener{
|
||||
//if there's a "win" wave and no enemies are present, win automatically
|
||||
if(state.rules.waves && (state.enemies == 0 && state.rules.winWave > 0 && state.wave >= state.rules.winWave && !spawner.isSpawning()) ||
|
||||
(state.rules.attackMode && state.rules.waveTeam.cores().isEmpty())){
|
||||
//the sector has been conquered - waves get disabled
|
||||
state.rules.waves = false;
|
||||
//disable attack mode
|
||||
state.rules.attackMode = false;
|
||||
|
||||
//fire capture event
|
||||
Events.fire(new SectorCaptureEvent(state.rules.sector));
|
||||
|
||||
//save, just in case
|
||||
if(!headless){
|
||||
control.saves.saveSector(state.rules.sector);
|
||||
}
|
||||
Call.sectorCapture();
|
||||
}
|
||||
}else{
|
||||
if(!state.rules.attackMode && state.teams.playerCores().size == 0 && !state.gameOver){
|
||||
@ -227,6 +217,24 @@ public class Logic implements ApplicationListener{
|
||||
}
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void sectorCapture(){
|
||||
//the sector has been conquered - waves get disabled
|
||||
state.rules.waves = false;
|
||||
//disable attack mode
|
||||
state.rules.attackMode = false;
|
||||
|
||||
if(state.rules.sector == null) return;
|
||||
|
||||
//fire capture event
|
||||
Events.fire(new SectorCaptureEvent(state.rules.sector));
|
||||
|
||||
//save, just in case
|
||||
if(!headless){
|
||||
control.saves.saveSector(state.rules.sector);
|
||||
}
|
||||
}
|
||||
|
||||
@Remote(called = Loc.both)
|
||||
public static void updateGameOver(Team winner){
|
||||
state.gameOver = true;
|
||||
|
@ -4,6 +4,7 @@ import arc.graphics.*;
|
||||
import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.core.*;
|
||||
import mindustry.entities.bullet.*;
|
||||
@ -33,11 +34,11 @@ public class Lightning{
|
||||
createLightningInternal(bullet, lastSeed++, bullet.team, color, damage, x, y, targetAngle, length);
|
||||
}
|
||||
|
||||
private static void createLightningInternal(Bullet hitter, int seed, Team team, Color color, float damage, float x, float y, float rotation, int length){
|
||||
private static void createLightningInternal(@Nullable Bullet hitter, int seed, Team team, Color color, float damage, float x, float y, float rotation, int length){
|
||||
random.setSeed(seed);
|
||||
hit.clear();
|
||||
|
||||
BulletType hitCreate = hitter.type.lightningType;
|
||||
BulletType hitCreate = hitter == null ? Bullets.damageLightning : hitter.type.lightningType;
|
||||
Seq<Vec2> lines = new Seq<>();
|
||||
bhit = false;
|
||||
|
||||
|
@ -152,7 +152,7 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc, Velc, Statusc{
|
||||
mount.reload <= 0.0001f && //reload has to be 0
|
||||
Angles.within(weapon.rotate ? mount.rotation : this.rotation, mount.targetRotation, mount.weapon.shootCone) //has to be within the cone
|
||||
){
|
||||
shoot(mount, shootX, shootY, mount.aimX, mount.aimY, shootAngle, Mathf.sign(weapon.x));
|
||||
shoot(mount, shootX, shootY, mount.aimX, mount.aimY, mountX, mountY, shootAngle, Mathf.sign(weapon.x));
|
||||
|
||||
mount.reload = weapon.reload;
|
||||
|
||||
@ -162,7 +162,7 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc, Velc, Statusc{
|
||||
}
|
||||
}
|
||||
|
||||
private void shoot(WeaponMount mount, float x, float y, float aimX, float aimY, float rotation, int side){
|
||||
private void shoot(WeaponMount mount, float x, float y, float aimX, float aimY, float mountX, float mountY, float rotation, int side){
|
||||
Weapon weapon = mount.weapon;
|
||||
|
||||
float baseX = this.x, baseY = this.y;
|
||||
@ -203,7 +203,7 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc, Velc, Statusc{
|
||||
mount.heat = 1f;
|
||||
}
|
||||
|
||||
weapon.ejectEffect.at(x, y, rotation * side);
|
||||
weapon.ejectEffect.at(mountX, mountY, rotation * side);
|
||||
ammo.shootEffect.at(x, y, rotation, parentize ? this : null);
|
||||
ammo.smokeEffect.at(x, y, rotation, parentize ? this : null);
|
||||
apply(weapon.shootStatus, weapon.shootStatusDuration);
|
||||
|
@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=57726650a54aa55dae98cf4d5f17cd6cd3218a3d
|
||||
archash=947eb46d0619baf4f029910ca384ed2ad4b59095
|
||||
|
Loading…
Reference in New Issue
Block a user