Compare commits
64 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ab090f28d | ||
|
|
8a5bd7571e | ||
|
|
3cb0cc9a3c | ||
|
|
ff93c21269 | ||
|
|
0512e54df5 | ||
|
|
cec1eb5608 | ||
|
|
1c6ebd3f6a | ||
|
|
16f7a8e9d2 | ||
|
|
889c53dc1b | ||
|
|
f4d0dfd0da | ||
|
|
aee5d46dfa | ||
|
|
6286b0b275 | ||
|
|
5223a89bf1 | ||
|
|
5b11dbc085 | ||
|
|
df1f8b8bb4 | ||
|
|
ffa7256e5a | ||
|
|
bbf84185cc | ||
|
|
901c23f295 | ||
|
|
1c8d368d3b | ||
|
|
37ebae20d7 | ||
|
|
e25f0c6ae2 | ||
|
|
484b480076 | ||
|
|
926497ba77 | ||
|
|
ddd9f2259c | ||
|
|
d6546a38c0 | ||
|
|
d171048004 | ||
|
|
4aebba0a0c | ||
|
|
8afb6006ce | ||
|
|
d117eb249e | ||
|
|
768d14088a | ||
|
|
86f16bfc94 | ||
|
|
8fa6b76bf9 | ||
|
|
19af1a0cc8 | ||
|
|
409d27e3df | ||
|
|
d47abd4f83 | ||
|
|
e6c4a6cf69 | ||
|
|
7c80af85e3 | ||
|
|
6983f57459 | ||
|
|
adeeaa6e27 | ||
|
|
075e7cf5d8 | ||
|
|
98c4ee6e74 | ||
|
|
87f9a077ac | ||
|
|
bc26d3ba7b | ||
|
|
daaea591e4 | ||
|
|
175d66ad72 | ||
|
|
c444cbf623 | ||
|
|
c54f398063 | ||
|
|
2d6db1583b | ||
|
|
b3beb92557 | ||
|
|
0f8304674f | ||
|
|
3b3daf0e25 | ||
|
|
28e18332a0 | ||
|
|
dcc4764914 | ||
|
|
ee4ace1146 | ||
|
|
1faffadcab | ||
|
|
2da7afc081 | ||
|
|
e5b341c63e | ||
|
|
a544888f16 | ||
|
|
57ad1d5366 | ||
|
|
42d66d1136 | ||
|
|
999cc9c651 | ||
|
|
881491d151 | ||
|
|
863159a5fe | ||
|
|
81b593c031 |
@@ -1,7 +1,7 @@
|
|||||||
### Adding a server to the list
|
### Adding a server to the list
|
||||||
|
|
||||||
Mindustry now has a public list of servers that everyone can see and connect to.
|
Mindustry now has a public list of servers that everyone can see and connect to.
|
||||||
This is done by letting clients `GET` a [JSON list of servers](https://github.com/Anuken/Mindustry/blob/master/servers.json) in this repository.
|
This is done by letting clients `GET` a [JSON list of servers](https://github.com/Anuken/Mindustry/blob/master/servers_v6.json) in this repository.
|
||||||
|
|
||||||
You may want to add your server to this list. The steps for getting this done are as follows:
|
You may want to add your server to this list. The steps for getting this done are as follows:
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ You'll need to either hire some moderators, or make use of (currently non-existe
|
|||||||
3. **Get some good maps.** *(optional, but highly recommended)*. Add some maps to your server and set the map rotation to custom-only. You can get maps from the Steam workshop by subscribing and exporting them; using the `#maps` channel on Discord is also an option.
|
3. **Get some good maps.** *(optional, but highly recommended)*. Add some maps to your server and set the map rotation to custom-only. You can get maps from the Steam workshop by subscribing and exporting them; using the `#maps` channel on Discord is also an option.
|
||||||
4. **Check your server configuration.** *(optional)* I would recommend adding a message rate limit of 1 second (`config messageRateLimit 1`), and disabling connect/disconnect messages to reduce spam (`config showConnectMessages false`).
|
4. **Check your server configuration.** *(optional)* I would recommend adding a message rate limit of 1 second (`config messageRateLimit 1`), and disabling connect/disconnect messages to reduce spam (`config showConnectMessages false`).
|
||||||
5. Finally, **submit a pull request** to add your server's IP to the list.
|
5. Finally, **submit a pull request** to add your server's IP to the list.
|
||||||
This should be fairly straightforward: Press the edit button on the [server file](https://github.com/Anuken/Mindustry/blob/master/servers.json), then add a JSON object with a single key, indicating your server address.
|
This should be fairly straightforward: Press the edit button on the [server file](https://github.com/Anuken/Mindustry/blob/master/servers_v6.json), then add a JSON object with a single key, indicating your server address.
|
||||||
For example, if your server address is `google.com`, you would add a comma after the last entry and insert:
|
For example, if your server address is `google.com`, you would add a comma after the last entry and insert:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -383,7 +383,6 @@ project(":annotations"){
|
|||||||
dependencies{
|
dependencies{
|
||||||
implementation 'com.squareup:javapoet:1.12.1'
|
implementation 'com.squareup:javapoet:1.12.1'
|
||||||
implementation "com.github.Anuken.Arc:arc-core:$arcHash"
|
implementation "com.github.Anuken.Arc:arc-core:$arcHash"
|
||||||
implementation files("${System.getProperty('java.home')}/../lib/tools.jar")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ link.google-play.description = Google Play store listing
|
|||||||
link.f-droid.description = F-Droid listing
|
link.f-droid.description = F-Droid listing
|
||||||
link.wiki.description = Official Mindustry wiki
|
link.wiki.description = Official Mindustry wiki
|
||||||
link.suggestions.description = Suggest new features
|
link.suggestions.description = Suggest new features
|
||||||
|
link.bug.description = Found one? Report it here
|
||||||
linkfail = Failed to open link!\nThe URL has been copied to your clipboard.
|
linkfail = Failed to open link!\nThe URL has been copied to your clipboard.
|
||||||
screenshot = Screenshot saved to {0}
|
screenshot = Screenshot saved to {0}
|
||||||
screenshot.invalid = Map too large, potentially not enough memory for screenshot.
|
screenshot.invalid = Map too large, potentially not enough memory for screenshot.
|
||||||
@@ -832,6 +833,7 @@ setting.chatopacity.name = Chat Opacity
|
|||||||
setting.lasersopacity.name = Power Laser Opacity
|
setting.lasersopacity.name = Power Laser Opacity
|
||||||
setting.bridgeopacity.name = Bridge Opacity
|
setting.bridgeopacity.name = Bridge Opacity
|
||||||
setting.playerchat.name = Display Player Bubble Chat
|
setting.playerchat.name = Display Player Bubble Chat
|
||||||
|
setting.showweather.name = Show Weather Graphics
|
||||||
public.confirm = Do you want to make your game public?\n[accent]Anyone will be able to join your games.\n[lightgray]This can be changed later in Settings->Game->Public Game Visibility.
|
public.confirm = Do you want to make your game public?\n[accent]Anyone will be able to join your games.\n[lightgray]This can be changed later in Settings->Game->Public Game Visibility.
|
||||||
public.beta = Note that beta versions of the game cannot make public lobbies.
|
public.beta = Note that beta versions of the game cannot make public lobbies.
|
||||||
uiscale.reset = UI scale has been changed.\nPress "OK" to confirm this scale.\n[scarlet]Reverting and exiting in[accent] {0}[] seconds...
|
uiscale.reset = UI scale has been changed.\nPress "OK" to confirm this scale.\n[scarlet]Reverting and exiting in[accent] {0}[] seconds...
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ link.google-play.description = Google Play 스토어 목록
|
|||||||
link.f-droid.description = F-Droid 카탈로그 목록
|
link.f-droid.description = F-Droid 카탈로그 목록
|
||||||
link.wiki.description = 공식 Mindustry 위키
|
link.wiki.description = 공식 Mindustry 위키
|
||||||
link.suggestions.description = 새 기능 제안하기
|
link.suggestions.description = 새 기능 제안하기
|
||||||
|
link.bug.description = 버그 제보하기
|
||||||
linkfail = 링크를 열지 못했습니다!\nURL이 클립보드에 복사되었습니다.
|
linkfail = 링크를 열지 못했습니다!\nURL이 클립보드에 복사되었습니다.
|
||||||
screenshot = 스크린 캡처가 {0} 에 저장되었습니다.
|
screenshot = 스크린 캡처가 {0} 에 저장되었습니다.
|
||||||
screenshot.invalid = 맵이 너무 커서 스크린 캡처에 사용될 메모리가 부족합니다.
|
screenshot.invalid = 맵이 너무 커서 스크린 캡처에 사용될 메모리가 부족합니다.
|
||||||
@@ -299,7 +300,7 @@ cancelbuilding = [accent][[{0}][] 를 눌러 건설 계획을 초기화
|
|||||||
selectschematic = [accent][[{0}][] 를 눌러 선택+복사
|
selectschematic = [accent][[{0}][] 를 눌러 선택+복사
|
||||||
pausebuilding = [accent][[{0}][] 를 눌러 건설을 일시중지
|
pausebuilding = [accent][[{0}][] 를 눌러 건설을 일시중지
|
||||||
resumebuilding = [scarlet][[{0}][] 를 눌러 건설을 재개
|
resumebuilding = [scarlet][[{0}][] 를 눌러 건설을 재개
|
||||||
showui = UI를 .\n[accent][[{0}][] 키를 눌러 UI를 활성화
|
showui = [accent][[{0}][] 키를 눌러 UI를 활성화
|
||||||
wave = [accent]{0} 단계
|
wave = [accent]{0} 단계
|
||||||
wave.cap = [accent]단계 {0}/{1}
|
wave.cap = [accent]단계 {0}/{1}
|
||||||
wave.waiting = 다음 단계까지[lightgray] {0}초
|
wave.waiting = 다음 단계까지[lightgray] {0}초
|
||||||
@@ -832,6 +833,7 @@ setting.chatopacity.name = 채팅창 투명도
|
|||||||
setting.lasersopacity.name = 전선 투명도
|
setting.lasersopacity.name = 전선 투명도
|
||||||
setting.bridgeopacity.name = 터널 투명도
|
setting.bridgeopacity.name = 터널 투명도
|
||||||
setting.playerchat.name = 채팅 말풍선 표시
|
setting.playerchat.name = 채팅 말풍선 표시
|
||||||
|
setting.showweather.name = 날씨 그래픽 표시
|
||||||
public.confirm = 게임을 모두에게 공개하시겠습니까?\n[accent]모든 플레이어가 게임에 참여할 수 있습니다.\n[lightgray]설정->게임->멀티플레이 공용 서버로 표시에서 나중에 변경할 수 있습니다.\n\n[sky]번역자 추가[]\n[accent]친구끼리 하려고 이 기능을 활성화 한 뒤에, 친구 외에 다른 플레이어가 들어왔을 때\n해당 플레이어를 차단하는 행위는 비매너를 넘어서는 얌체 행위 그 자체입니다.\n정말로 [scarlet]많은 다른 플레이어들이 오길 원한다[]면 확인하세요.
|
public.confirm = 게임을 모두에게 공개하시겠습니까?\n[accent]모든 플레이어가 게임에 참여할 수 있습니다.\n[lightgray]설정->게임->멀티플레이 공용 서버로 표시에서 나중에 변경할 수 있습니다.\n\n[sky]번역자 추가[]\n[accent]친구끼리 하려고 이 기능을 활성화 한 뒤에, 친구 외에 다른 플레이어가 들어왔을 때\n해당 플레이어를 차단하는 행위는 비매너를 넘어서는 얌체 행위 그 자체입니다.\n정말로 [scarlet]많은 다른 플레이어들이 오길 원한다[]면 확인하세요.
|
||||||
public.beta = 베타 버전의 게임은 공개 서버를 만들 수 없습니다.
|
public.beta = 베타 버전의 게임은 공개 서버를 만들 수 없습니다.
|
||||||
uiscale.reset = UI 스케일이 변경되었습니다.\n"확인"버튼을 눌러 저장하세요.\n[accent] {0}[][scarlet]초 후에 예전 설정으로 되돌리고 게임을 종료합니다...
|
uiscale.reset = UI 스케일이 변경되었습니다.\n"확인"버튼을 눌러 저장하세요.\n[accent] {0}[][scarlet]초 후에 예전 설정으로 되돌리고 게임을 종료합니다...
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ link.google-play.description = Strona w sklepie Google Play
|
|||||||
link.f-droid.description = Wykaz Katalogu F-Droid
|
link.f-droid.description = Wykaz Katalogu F-Droid
|
||||||
link.wiki.description = Oficjana Wiki Mindustry
|
link.wiki.description = Oficjana Wiki Mindustry
|
||||||
link.suggestions.description = Zaproponuj nowe funkcje
|
link.suggestions.description = Zaproponuj nowe funkcje
|
||||||
|
link.bug.description = Znalazłeś błąd? Zgłoś go tutaj
|
||||||
linkfail = Nie udało się otworzyć linku!\nURL został skopiowany.
|
linkfail = Nie udało się otworzyć linku!\nURL został skopiowany.
|
||||||
screenshot = Zapisano zrzut ekranu w {0}
|
screenshot = Zapisano zrzut ekranu w {0}
|
||||||
screenshot.invalid = Zrzut ekranu jest zbyt duży. Najprawdopodobniej brakuje miejsca w pamięci urządzenia.
|
screenshot.invalid = Zrzut ekranu jest zbyt duży. Najprawdopodobniej brakuje miejsca w pamięci urządzenia.
|
||||||
@@ -511,7 +512,7 @@ resources = Zasoby
|
|||||||
bannedblocks = Zabronione bloki
|
bannedblocks = Zabronione bloki
|
||||||
addall = Dodaj wszystkie
|
addall = Dodaj wszystkie
|
||||||
launch.from = Wstrzelony Z: [accent]{0}
|
launch.from = Wstrzelony Z: [accent]{0}
|
||||||
launch.destination = Cell: {0}
|
launch.destination = Cel: {0}
|
||||||
configure.invalid = Ilość musi być liczbą pomiędzy 0 a {0}.
|
configure.invalid = Ilość musi być liczbą pomiędzy 0 a {0}.
|
||||||
add = Dodaj...
|
add = Dodaj...
|
||||||
boss.health = Zdrowie Strażnika
|
boss.health = Zdrowie Strażnika
|
||||||
@@ -832,6 +833,7 @@ setting.chatopacity.name = Przezroczystość czatu
|
|||||||
setting.lasersopacity.name = Przezroczystość laserów zasilających
|
setting.lasersopacity.name = Przezroczystość laserów zasilających
|
||||||
setting.bridgeopacity.name = Przezroczystość mostów
|
setting.bridgeopacity.name = Przezroczystość mostów
|
||||||
setting.playerchat.name = Wyświetlaj czat w grze
|
setting.playerchat.name = Wyświetlaj czat w grze
|
||||||
|
setting.showweather.name = Pokaż pogodę
|
||||||
public.confirm = Czy chcesz ustawić swoją grę jako publiczną?\n[accent]Każdy będzie mógł dołączyć do Twojej gry.\n[lightgray]Można to później zmienić w Ustawienia->Gra->Widoczność Gry Publicznej.
|
public.confirm = Czy chcesz ustawić swoją grę jako publiczną?\n[accent]Każdy będzie mógł dołączyć do Twojej gry.\n[lightgray]Można to później zmienić w Ustawienia->Gra->Widoczność Gry Publicznej.
|
||||||
public.beta = Wersje beta gry nie mogą tworzyć publicznych pokoi.
|
public.beta = Wersje beta gry nie mogą tworzyć publicznych pokoi.
|
||||||
uiscale.reset = Skala interfejsu uległa zmianie.\nNaciśnij "OK" by potwierdzić zmiany.\n[scarlet]Cofanie zmian i wyjście z gry za[accent] {0}[]
|
uiscale.reset = Skala interfejsu uległa zmianie.\nNaciśnij "OK" by potwierdzić zmiany.\n[scarlet]Cofanie zmian i wyjście z gry za[accent] {0}[]
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ link.google-play.description = Google Play
|
|||||||
link.f-droid.description = Catalogul F-Droid
|
link.f-droid.description = Catalogul F-Droid
|
||||||
link.wiki.description = Wikiul oficial al Mindustry
|
link.wiki.description = Wikiul oficial al Mindustry
|
||||||
link.suggestions.description = Sugerează noi funcții
|
link.suggestions.description = Sugerează noi funcții
|
||||||
|
link.bug.description = Ai găsit vreunul? Raportează-l aici
|
||||||
linkfail = Linkul nu a putut fi deschis!\nAdresa URL a fost copiată.
|
linkfail = Linkul nu a putut fi deschis!\nAdresa URL a fost copiată.
|
||||||
screenshot = Captură de ecran salvată la {0}
|
screenshot = Captură de ecran salvată la {0}
|
||||||
screenshot.invalid = Harta e prea mare. Se poate să nu existe suficientă memorie pentru captura de ecran.
|
screenshot.invalid = Harta e prea mare. Se poate să nu existe suficientă memorie pentru captura de ecran.
|
||||||
@@ -832,6 +833,7 @@ setting.chatopacity.name = Opacitate Chat
|
|||||||
setting.lasersopacity.name = Opacitate Laser Electric
|
setting.lasersopacity.name = Opacitate Laser Electric
|
||||||
setting.bridgeopacity.name = Opacitate Poduri
|
setting.bridgeopacity.name = Opacitate Poduri
|
||||||
setting.playerchat.name = Vezi Chat Temporar
|
setting.playerchat.name = Vezi Chat Temporar
|
||||||
|
setting.showweather.name = Vezi Vremea
|
||||||
public.confirm = Vrei să îți faci jocul public?\n[accent]Oricine va putea intra în jocurile tale.\n[lightgray]Asta se poate schimba mai târziu în Setări->Joc->Vizibilitatea Jocurilor Publice.
|
public.confirm = Vrei să îți faci jocul public?\n[accent]Oricine va putea intra în jocurile tale.\n[lightgray]Asta se poate schimba mai târziu în Setări->Joc->Vizibilitatea Jocurilor Publice.
|
||||||
public.beta = De reținut că versiunile beta ale jocului nu poate face servere publice.
|
public.beta = De reținut că versiunile beta ale jocului nu poate face servere publice.
|
||||||
uiscale.reset = Scara interfeței a fost schimbată.\nApasă "OK" pt a confirma această scară.\n[scarlet]Revin setările și se iese în [accent] {0}[] secunde...
|
uiscale.reset = Scara interfeței a fost schimbată.\nApasă "OK" pt a confirma această scară.\n[scarlet]Revin setările și se iese în [accent] {0}[] secunde...
|
||||||
|
|||||||
Binary file not shown.
@@ -50,5 +50,5 @@ const cons = method => new Cons(){get: method}
|
|||||||
const prov = method => new Prov(){get: method}
|
const prov = method => new Prov(){get: method}
|
||||||
const func = method => new Func(){get: method}
|
const func = method => new Func(){get: method}
|
||||||
|
|
||||||
const newEffect = (lifetime, renderer) => new Effects.Effect(lifetime, new Effects.EffectRenderer({render: renderer}))
|
const newEffect = (lifetime, renderer) => new Effect.Effect(lifetime, new Effect.EffectRenderer({render: renderer}))
|
||||||
Call = Packages.mindustry.gen.Call
|
Call = Packages.mindustry.gen.Call
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ const cons = method => new Cons(){get: method}
|
|||||||
const prov = method => new Prov(){get: method}
|
const prov = method => new Prov(){get: method}
|
||||||
const func = method => new Func(){get: method}
|
const func = method => new Func(){get: method}
|
||||||
|
|
||||||
const newEffect = (lifetime, renderer) => new Effects.Effect(lifetime, new Effects.EffectRenderer({render: renderer}))
|
const newEffect = (lifetime, renderer) => new Effect.Effect(lifetime, new Effect.EffectRenderer({render: renderer}))
|
||||||
Call = Packages.mindustry.gen.Call
|
Call = Packages.mindustry.gen.Call
|
||||||
|
|
||||||
importPackage(Packages.arc)
|
importPackage(Packages.arc)
|
||||||
@@ -165,6 +165,7 @@ const SectorInvasionEvent = Packages.mindustry.game.EventType.SectorInvasionEven
|
|||||||
const SectorLoseEvent = Packages.mindustry.game.EventType.SectorLoseEvent
|
const SectorLoseEvent = Packages.mindustry.game.EventType.SectorLoseEvent
|
||||||
const WorldLoadEvent = Packages.mindustry.game.EventType.WorldLoadEvent
|
const WorldLoadEvent = Packages.mindustry.game.EventType.WorldLoadEvent
|
||||||
const ClientLoadEvent = Packages.mindustry.game.EventType.ClientLoadEvent
|
const ClientLoadEvent = Packages.mindustry.game.EventType.ClientLoadEvent
|
||||||
|
const ContentInitEvent = Packages.mindustry.game.EventType.ContentInitEvent
|
||||||
const BlockInfoEvent = Packages.mindustry.game.EventType.BlockInfoEvent
|
const BlockInfoEvent = Packages.mindustry.game.EventType.BlockInfoEvent
|
||||||
const CoreItemDeliverEvent = Packages.mindustry.game.EventType.CoreItemDeliverEvent
|
const CoreItemDeliverEvent = Packages.mindustry.game.EventType.CoreItemDeliverEvent
|
||||||
const TurretAmmoDeliverEvent = Packages.mindustry.game.EventType.TurretAmmoDeliverEvent
|
const TurretAmmoDeliverEvent = Packages.mindustry.game.EventType.TurretAmmoDeliverEvent
|
||||||
|
|||||||
@@ -130,6 +130,6 @@ public class BuilderAI extends AIController{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldShoot(){
|
public boolean shouldShoot(){
|
||||||
return !((Builderc)unit).isBuilding();
|
return !unit.isBuilding();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public class FlyingAI extends AIController{
|
|||||||
@Override
|
@Override
|
||||||
public void updateMovement(){
|
public void updateMovement(){
|
||||||
if(target != null && unit.hasWeapons() && command() == UnitCommand.attack){
|
if(target != null && unit.hasWeapons() && command() == UnitCommand.attack){
|
||||||
if(unit.type.weapons.first().rotate){
|
if(unit.type.circleTarget){
|
||||||
moveTo(target, unit.range() * 0.8f);
|
moveTo(target, unit.range() * 0.8f);
|
||||||
unit.lookAt(target);
|
unit.lookAt(target);
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -33,11 +33,10 @@ public class FormationAI extends AIController implements FormationMember{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(unit.type.canBoost){
|
if(unit.type.canBoost){
|
||||||
unit.elevation = Mathf.approachDelta(unit.elevation, !unit.canPassOn() ? 1f : leader.type.canBoost ? leader.elevation : 0f, 0.08f);
|
unit.elevation = Mathf.approachDelta(unit.elevation, unit.onSolid() ? 1f : leader.type.canBoost ? leader.elevation : 0f, 0.08f);
|
||||||
}
|
}
|
||||||
|
|
||||||
unit.controlWeapons(true, leader.isShooting);
|
unit.controlWeapons(true, leader.isShooting);
|
||||||
// unit.moveAt(Tmp.v1.set(deltaX, deltaY).limit(unit.type().speed));
|
|
||||||
|
|
||||||
unit.aim(leader.aimX(), leader.aimY());
|
unit.aim(leader.aimX(), leader.aimY());
|
||||||
|
|
||||||
@@ -47,17 +46,10 @@ public class FormationAI extends AIController implements FormationMember{
|
|||||||
unit.lookAt(unit.vel.angle());
|
unit.lookAt(unit.vel.angle());
|
||||||
}
|
}
|
||||||
|
|
||||||
Vec2 realtarget = vec.set(target);
|
Vec2 realtarget = vec.set(target).add(leader.vel.x, leader.vel.y);
|
||||||
|
|
||||||
float margin = 4f;
|
float speed = unit.realSpeed() * unit.floorSpeedMultiplier();
|
||||||
|
unit.approach(Mathf.arrive(unit.x, unit.y, realtarget.x, realtarget.y, unit.vel, 0f, 0.01f, speed, 1f));
|
||||||
float speed = unit.realSpeed();
|
|
||||||
|
|
||||||
if(unit.dst(realtarget) <= margin){
|
|
||||||
//unit.vel.approachDelta(Vec2.ZERO, speed * type.accel / 2f);
|
|
||||||
}else{
|
|
||||||
unit.moveAt(realtarget.sub(unit).limit(speed));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(unit.canMine() && leader.canMine()){
|
if(unit.canMine() && leader.canMine()){
|
||||||
if(leader.mineTile != null && unit.validMine(leader.mineTile)){
|
if(leader.mineTile != null && unit.validMine(leader.mineTile)){
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package mindustry.ai.types;
|
package mindustry.ai.types;
|
||||||
|
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
|
import arc.math.geom.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.ai.*;
|
import mindustry.ai.*;
|
||||||
@@ -67,7 +68,7 @@ public class LogicAI extends AIController{
|
|||||||
moveTo(Tmp.v1.set(moveX, moveY), 1f, 30f);
|
moveTo(Tmp.v1.set(moveX, moveY), 1f, 30f);
|
||||||
}
|
}
|
||||||
case approach -> {
|
case approach -> {
|
||||||
moveTo(Tmp.v1.set(moveX, moveY), moveRad - 8f, 8f);
|
moveTo(Tmp.v1.set(moveX, moveY), moveRad - 7f, 7);
|
||||||
}
|
}
|
||||||
case pathfind -> {
|
case pathfind -> {
|
||||||
Building core = unit.closestEnemyCore();
|
Building core = unit.closestEnemyCore();
|
||||||
@@ -112,6 +113,24 @@ public class LogicAI extends AIController{
|
|||||||
return radars.add(radar);
|
return radars.add(radar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void moveTo(Position target, float circleLength, float smooth){
|
||||||
|
if(target == null) return;
|
||||||
|
|
||||||
|
vec.set(target).sub(unit);
|
||||||
|
|
||||||
|
float length = circleLength <= 0.001f ? 1f : Mathf.clamp((unit.dst(target) - circleLength) / smooth, -1f, 1f);
|
||||||
|
|
||||||
|
vec.setLength(unit.realSpeed() * length);
|
||||||
|
if(length < -0.5f){
|
||||||
|
vec.rotate(180f);
|
||||||
|
}else if(length < 0){
|
||||||
|
vec.setZero();
|
||||||
|
}
|
||||||
|
|
||||||
|
unit.approach(vec);
|
||||||
|
}
|
||||||
|
|
||||||
//always retarget
|
//always retarget
|
||||||
@Override
|
@Override
|
||||||
protected boolean retarget(){
|
protected boolean retarget(){
|
||||||
|
|||||||
@@ -983,7 +983,7 @@ public class Blocks implements ContentList{
|
|||||||
junction = new Junction("junction"){{
|
junction = new Junction("junction"){{
|
||||||
requirements(Category.distribution, with(Items.copper, 2), true);
|
requirements(Category.distribution, with(Items.copper, 2), true);
|
||||||
speed = 26;
|
speed = 26;
|
||||||
capacity = 12;
|
capacity = 6;
|
||||||
health = 30;
|
health = 30;
|
||||||
buildCostMultiplier = 6f;
|
buildCostMultiplier = 6f;
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public class Items implements ContentList{
|
|||||||
|
|
||||||
sand = new Item("sand", Color.valueOf("f7cba4")){{
|
sand = new Item("sand", Color.valueOf("f7cba4")){{
|
||||||
alwaysUnlocked = true;
|
alwaysUnlocked = true;
|
||||||
|
lowPriority = true;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
coal = new Item("coal", Color.valueOf("272727")){{
|
coal = new Item("coal", Color.valueOf("272727")){{
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class StatusEffects implements ContentList{
|
|||||||
opposite(wet, freezing);
|
opposite(wet, freezing);
|
||||||
trans(tarred, ((unit, time, newTime, result) -> {
|
trans(tarred, ((unit, time, newTime, result) -> {
|
||||||
unit.damagePierce(8f);
|
unit.damagePierce(8f);
|
||||||
Fx.burning.at(unit.x() + Mathf.range(unit.bounds() / 2f), unit.y() + Mathf.range(unit.bounds() / 2f));
|
Fx.burning.at(unit.x + Mathf.range(unit.bounds() / 2f), unit.y + Mathf.range(unit.bounds() / 2f));
|
||||||
result.set(this, Math.min(time + newTime, 300f));
|
result.set(this, Math.min(time + newTime, 300f));
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
@@ -93,8 +93,12 @@ public class StatusEffects implements ContentList{
|
|||||||
effect = Fx.melting;
|
effect = Fx.melting;
|
||||||
|
|
||||||
init(() -> {
|
init(() -> {
|
||||||
trans(tarred, ((unit, time, newTime, result) -> result.set(this, Math.min(time + newTime / 2f, 140f))));
|
|
||||||
opposite(wet, freezing);
|
opposite(wet, freezing);
|
||||||
|
trans(tarred, ((unit, time, newTime, result) -> {
|
||||||
|
unit.damagePierce(8f);
|
||||||
|
Fx.burning.at(unit.x + Mathf.range(unit.bounds() / 2f), unit.y + Mathf.range(unit.bounds() / 2f));
|
||||||
|
result.set(this, Math.min(time + newTime, 200f));
|
||||||
|
}));
|
||||||
});
|
});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -119,7 +123,7 @@ public class StatusEffects implements ContentList{
|
|||||||
effect = Fx.oily;
|
effect = Fx.oily;
|
||||||
|
|
||||||
init(() -> {
|
init(() -> {
|
||||||
trans(melting, ((unit, time, newTime, result) -> result.set(burning, newTime + time)));
|
trans(melting, ((unit, time, newTime, result) -> result.set(melting, newTime + time)));
|
||||||
trans(burning, ((unit, time, newTime, result) -> result.set(burning, newTime + time)));
|
trans(burning, ((unit, time, newTime, result) -> result.set(burning, newTime + time)));
|
||||||
});
|
});
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -760,7 +760,7 @@ public class UnitTypes implements ContentList{
|
|||||||
ejectEffect = Fx.casing1;
|
ejectEffect = Fx.casing1;
|
||||||
shootSound = Sounds.artillery;
|
shootSound = Sounds.artillery;
|
||||||
rotate = true;
|
rotate = true;
|
||||||
occlusion = 8f;
|
shadow = 8f;
|
||||||
recoil = 3f;
|
recoil = 3f;
|
||||||
|
|
||||||
bullet = new ArtilleryBulletType(2f, 12){{
|
bullet = new ArtilleryBulletType(2f, 12){{
|
||||||
@@ -827,7 +827,7 @@ public class UnitTypes implements ContentList{
|
|||||||
ejectEffect = Fx.casing1;
|
ejectEffect = Fx.casing1;
|
||||||
shootSound = Sounds.shootBig;
|
shootSound = Sounds.shootBig;
|
||||||
rotate = true;
|
rotate = true;
|
||||||
occlusion = 12f;
|
shadow = 12f;
|
||||||
recoil = 3f;
|
recoil = 3f;
|
||||||
shots = 2;
|
shots = 2;
|
||||||
spacing = 17f;
|
spacing = 17f;
|
||||||
@@ -859,7 +859,7 @@ public class UnitTypes implements ContentList{
|
|||||||
ejectEffect = Fx.casing3;
|
ejectEffect = Fx.casing3;
|
||||||
shootSound = Sounds.artillery;
|
shootSound = Sounds.artillery;
|
||||||
rotate = true;
|
rotate = true;
|
||||||
occlusion = 30f;
|
shadow = 30f;
|
||||||
|
|
||||||
bullet = new ArtilleryBulletType(3f, 50){{
|
bullet = new ArtilleryBulletType(3f, 50){{
|
||||||
hitEffect = Fx.sapExplosion;
|
hitEffect = Fx.sapExplosion;
|
||||||
@@ -918,6 +918,7 @@ public class UnitTypes implements ContentList{
|
|||||||
range = 140f;
|
range = 140f;
|
||||||
targetAir = false;
|
targetAir = false;
|
||||||
commandLimit = 4;
|
commandLimit = 4;
|
||||||
|
circleTarget = true;
|
||||||
|
|
||||||
weapons.add(new Weapon(){{
|
weapons.add(new Weapon(){{
|
||||||
y = 0f;
|
y = 0f;
|
||||||
@@ -950,6 +951,7 @@ public class UnitTypes implements ContentList{
|
|||||||
armor = 3f;
|
armor = 3f;
|
||||||
targetFlag = BlockFlag.factory;
|
targetFlag = BlockFlag.factory;
|
||||||
commandLimit = 5;
|
commandLimit = 5;
|
||||||
|
circleTarget = true;
|
||||||
|
|
||||||
weapons.add(new Weapon(){{
|
weapons.add(new Weapon(){{
|
||||||
minShootVelocity = 0.75f;
|
minShootVelocity = 0.75f;
|
||||||
@@ -1059,7 +1061,7 @@ public class UnitTypes implements ContentList{
|
|||||||
bullet = missiles;
|
bullet = missiles;
|
||||||
shootSound = Sounds.missile;
|
shootSound = Sounds.missile;
|
||||||
rotate = true;
|
rotate = true;
|
||||||
occlusion = 6f;
|
shadow = 6f;
|
||||||
}},
|
}},
|
||||||
new Weapon("missiles-mount"){{
|
new Weapon("missiles-mount"){{
|
||||||
y = -8f;
|
y = -8f;
|
||||||
@@ -1070,7 +1072,7 @@ public class UnitTypes implements ContentList{
|
|||||||
bullet = missiles;
|
bullet = missiles;
|
||||||
shootSound = Sounds.missile;
|
shootSound = Sounds.missile;
|
||||||
rotate = true;
|
rotate = true;
|
||||||
occlusion = 6f;
|
shadow = 6f;
|
||||||
}},
|
}},
|
||||||
new Weapon("large-bullet-mount"){{
|
new Weapon("large-bullet-mount"){{
|
||||||
y = 2f;
|
y = 2f;
|
||||||
@@ -1082,7 +1084,7 @@ public class UnitTypes implements ContentList{
|
|||||||
ejectEffect = Fx.casing1;
|
ejectEffect = Fx.casing1;
|
||||||
shootSound = Sounds.shootBig;
|
shootSound = Sounds.shootBig;
|
||||||
rotate = true;
|
rotate = true;
|
||||||
occlusion = 8f;
|
shadow = 8f;
|
||||||
bullet = new BasicBulletType(7f, 50){{
|
bullet = new BasicBulletType(7f, 50){{
|
||||||
width = 12f;
|
width = 12f;
|
||||||
height = 18f;
|
height = 18f;
|
||||||
@@ -1130,7 +1132,7 @@ public class UnitTypes implements ContentList{
|
|||||||
reload = 45f;
|
reload = 45f;
|
||||||
recoil = 4f;
|
recoil = 4f;
|
||||||
shootSound = Sounds.laser;
|
shootSound = Sounds.laser;
|
||||||
occlusion = 20f;
|
shadow = 20f;
|
||||||
rotate = true;
|
rotate = true;
|
||||||
|
|
||||||
bullet = new LaserBulletType(){{
|
bullet = new LaserBulletType(){{
|
||||||
@@ -1150,7 +1152,7 @@ public class UnitTypes implements ContentList{
|
|||||||
rotateSpeed = 2f;
|
rotateSpeed = 2f;
|
||||||
reload = 9f;
|
reload = 9f;
|
||||||
shootSound = Sounds.shoot;
|
shootSound = Sounds.shoot;
|
||||||
occlusion = 7f;
|
shadow = 7f;
|
||||||
rotate = true;
|
rotate = true;
|
||||||
recoil = 0.5f;
|
recoil = 0.5f;
|
||||||
|
|
||||||
@@ -1165,7 +1167,7 @@ public class UnitTypes implements ContentList{
|
|||||||
shake = 1f;
|
shake = 1f;
|
||||||
shootSound = Sounds.shoot;
|
shootSound = Sounds.shoot;
|
||||||
rotate = true;
|
rotate = true;
|
||||||
occlusion = 12f;
|
shadow = 12f;
|
||||||
bullet = fragBullet;
|
bullet = fragBullet;
|
||||||
}});
|
}});
|
||||||
}};
|
}};
|
||||||
@@ -1517,7 +1519,7 @@ public class UnitTypes implements ContentList{
|
|||||||
shootY = 7f;
|
shootY = 7f;
|
||||||
shake = 5f;
|
shake = 5f;
|
||||||
recoil = 4f;
|
recoil = 4f;
|
||||||
occlusion = 12f;
|
shadow = 12f;
|
||||||
|
|
||||||
shots = 1;
|
shots = 1;
|
||||||
inaccuracy = 3f;
|
inaccuracy = 3f;
|
||||||
@@ -1553,7 +1555,7 @@ public class UnitTypes implements ContentList{
|
|||||||
x = 8.5f;
|
x = 8.5f;
|
||||||
y = -9f;
|
y = -9f;
|
||||||
|
|
||||||
occlusion = 6f;
|
shadow = 6f;
|
||||||
|
|
||||||
rotateSpeed = 4f;
|
rotateSpeed = 4f;
|
||||||
rotate = true;
|
rotate = true;
|
||||||
@@ -1609,7 +1611,7 @@ public class UnitTypes implements ContentList{
|
|||||||
rotateSpeed = 4f;
|
rotateSpeed = 4f;
|
||||||
mirror = false;
|
mirror = false;
|
||||||
|
|
||||||
occlusion = 20f;
|
shadow = 20f;
|
||||||
|
|
||||||
shootY = 2f;
|
shootY = 2f;
|
||||||
recoil = 4f;
|
recoil = 4f;
|
||||||
@@ -1655,7 +1657,7 @@ public class UnitTypes implements ContentList{
|
|||||||
shootY = 7f;
|
shootY = 7f;
|
||||||
shake = 2f;
|
shake = 2f;
|
||||||
recoil = 3f;
|
recoil = 3f;
|
||||||
occlusion = 12f;
|
shadow = 12f;
|
||||||
ejectEffect = Fx.casing3;
|
ejectEffect = Fx.casing3;
|
||||||
shootSound = Sounds.shootBig;
|
shootSound = Sounds.shootBig;
|
||||||
|
|
||||||
@@ -1701,7 +1703,7 @@ public class UnitTypes implements ContentList{
|
|||||||
shootY = 23f;
|
shootY = 23f;
|
||||||
shake = 6f;
|
shake = 6f;
|
||||||
recoil = 10.5f;
|
recoil = 10.5f;
|
||||||
occlusion = 50f;
|
shadow = 50f;
|
||||||
shootSound = Sounds.railgun;
|
shootSound = Sounds.railgun;
|
||||||
|
|
||||||
shots = 1;
|
shots = 1;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package mindustry.core;
|
package mindustry.core;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import arc.files.*;
|
import arc.files.*;
|
||||||
import arc.func.*;
|
import arc.func.*;
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
@@ -7,8 +8,10 @@ import arc.struct.*;
|
|||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.ctype.*;
|
import mindustry.ctype.*;
|
||||||
|
import mindustry.game.EventType.*;
|
||||||
import mindustry.entities.bullet.*;
|
import mindustry.entities.bullet.*;
|
||||||
import mindustry.mod.Mods.*;
|
import mindustry.mod.Mods.*;
|
||||||
|
import mindustry.net.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
@@ -97,6 +100,7 @@ public class ContentLoader{
|
|||||||
public void init(){
|
public void init(){
|
||||||
initialize(Content::init);
|
initialize(Content::init);
|
||||||
if(constants != null) constants.init();
|
if(constants != null) constants.init();
|
||||||
|
Events.fire(new ContentInitEvent());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Calls Content#load() on everything. Use only after all modules have been created on the client.*/
|
/** Calls Content#load() on everything. Use only after all modules have been created on the client.*/
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
state.rules.waves = true;
|
state.rules.waves = true;
|
||||||
|
|
||||||
//reset win wave??
|
//reset win wave??
|
||||||
state.rules.winWave = state.rules.attackMode ? -1 : sector.preset != null && sector.preset.captureWave > 0 ? sector.preset.captureWave : state.rules.winWave > state.wave ? state.rules.winWave : 40;
|
state.rules.winWave = state.rules.attackMode ? -1 : sector.preset != null && sector.preset.captureWave > 0 ? sector.preset.captureWave : state.rules.winWave > state.wave ? state.rules.winWave : 30;
|
||||||
|
|
||||||
//if there's still an enemy base left, fix it
|
//if there's still an enemy base left, fix it
|
||||||
if(state.rules.attackMode){
|
if(state.rules.attackMode){
|
||||||
@@ -424,7 +424,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
net.dispose();
|
net.dispose();
|
||||||
Musics.dispose();
|
Musics.dispose();
|
||||||
Sounds.dispose();
|
Sounds.dispose();
|
||||||
ui.editor.dispose();
|
if(ui != null && ui.editor != null) ui.editor.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ public interface Platform{
|
|||||||
|
|
||||||
/** Dynamically loads a jar file. */
|
/** Dynamically loads a jar file. */
|
||||||
default Class<?> loadJar(Fi jar, String mainClass) throws Exception{
|
default Class<?> loadJar(Fi jar, String mainClass) throws Exception{
|
||||||
URLClassLoader classLoader = new URLClassLoader(new URL[]{jar.file().toURI().toURL()}, ClassLoader.getSystemClassLoader());
|
URLClassLoader classLoader = new URLClassLoader(new URL[]{jar.file().toURI().toURL()}, getClass().getClassLoader());
|
||||||
return classLoader.loadClass(mainClass);
|
return Class.forName(mainClass, true, classLoader);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Steam: Update lobby visibility.*/
|
/** Steam: Update lobby visibility.*/
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class Renderer implements ApplicationListener{
|
|||||||
|
|
||||||
float dest = Mathf.round(targetscale, 0.5f);
|
float dest = Mathf.round(targetscale, 0.5f);
|
||||||
camerascale = Mathf.lerpDelta(camerascale, dest, 0.1f);
|
camerascale = Mathf.lerpDelta(camerascale, dest, 0.1f);
|
||||||
if(Mathf.within(camerascale, dest, 0.001f)) camerascale = dest;
|
if(Mathf.equal(camerascale, dest, 0.001f)) camerascale = dest;
|
||||||
laserOpacity = Core.settings.getInt("lasersopacity") / 100f;
|
laserOpacity = Core.settings.getInt("lasersopacity") / 100f;
|
||||||
|
|
||||||
if(landTime > 0){
|
if(landTime > 0){
|
||||||
@@ -111,7 +111,10 @@ public class Renderer implements ApplicationListener{
|
|||||||
minimap.dispose();
|
minimap.dispose();
|
||||||
effectBuffer.dispose();
|
effectBuffer.dispose();
|
||||||
blocks.dispose();
|
blocks.dispose();
|
||||||
|
if(planets != null){
|
||||||
planets.dispose();
|
planets.dispose();
|
||||||
|
planets = null;
|
||||||
|
}
|
||||||
if(bloom != null){
|
if(bloom != null){
|
||||||
bloom.dispose();
|
bloom.dispose();
|
||||||
bloom = null;
|
bloom = null;
|
||||||
|
|||||||
@@ -186,14 +186,14 @@ public class World{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Call to signify the beginning of map loading.
|
* Call to signify the beginning of map loading.
|
||||||
* BuildinghangeEvents will not be fired until endMapLoad().
|
* TileEvents will not be fired until endMapLoad().
|
||||||
*/
|
*/
|
||||||
public void beginMapLoad(){
|
public void beginMapLoad(){
|
||||||
generating = true;
|
generating = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call to signify the end of map loading. Updates tile occlusions and sets up physics for the world.
|
* Call to signify the end of map loading. Updates tile proximities and sets up physics for the world.
|
||||||
* A WorldLoadEvent will be fire.
|
* A WorldLoadEvent will be fire.
|
||||||
*/
|
*/
|
||||||
public void endMapLoad(){
|
public void endMapLoad(){
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class Damage{
|
|||||||
private static Tile furthest;
|
private static Tile furthest;
|
||||||
private static Rect rect = new Rect();
|
private static Rect rect = new Rect();
|
||||||
private static Rect hitrect = new Rect();
|
private static Rect hitrect = new Rect();
|
||||||
private static Vec2 tr = new Vec2();
|
private static Vec2 tr = new Vec2(), seg1 = new Vec2(), seg2 = new Vec2();
|
||||||
private static Seq<Unit> units = new Seq<>();
|
private static Seq<Unit> units = new Seq<>();
|
||||||
private static GridBits bits = new GridBits(30, 30);
|
private static GridBits bits = new GridBits(30, 30);
|
||||||
private static IntQueue propagation = new IntQueue();
|
private static IntQueue propagation = new IntQueue();
|
||||||
@@ -120,6 +120,7 @@ public class Damage{
|
|||||||
|
|
||||||
collidedBlocks.clear();
|
collidedBlocks.clear();
|
||||||
tr.trns(angle, length);
|
tr.trns(angle, length);
|
||||||
|
|
||||||
Intc2 collider = (cx, cy) -> {
|
Intc2 collider = (cx, cy) -> {
|
||||||
Building tile = world.build(cx, cy);
|
Building tile = world.build(cx, cy);
|
||||||
boolean collide = tile != null && collidedBlocks.add(tile.pos());
|
boolean collide = tile != null && collidedBlocks.add(tile.pos());
|
||||||
@@ -131,17 +132,21 @@ public class Damage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//try to heal the tile
|
//try to heal the tile
|
||||||
if(collide && hitter.type.collides(hitter, tile)){
|
if(collide && hitter.type.testCollision(hitter, tile)){
|
||||||
hitter.type.hitTile(hitter, tile, tile.health, false);
|
hitter.type.hitTile(hitter, tile, tile.health, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if(hitter.type.collidesGround){
|
if(hitter.type.collidesGround){
|
||||||
world.raycastEachWorld(x, y, x + tr.x, y + tr.y, (cx, cy) -> {
|
seg1.set(x, y);
|
||||||
|
seg2.set(seg1).add(tr);
|
||||||
|
world.raycastEachWorld(x, y, seg2.x, seg2.y, (cx, cy) -> {
|
||||||
collider.get(cx, cy);
|
collider.get(cx, cy);
|
||||||
if(large){
|
|
||||||
for(Point2 p : Geometry.d4){
|
for(Point2 p : Geometry.d4){
|
||||||
|
Tile other = world.tile(p.x + cx, p.y + cy);
|
||||||
|
if(other != null && (large || Intersector.intersectSegmentRectangle(seg1, seg2, other.getBounds(Tmp.r1)))){
|
||||||
collider.get(cx + p.x, cy + p.y);
|
collider.get(cx + p.x, cy + p.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ public class Predict{
|
|||||||
ddy += h.deltaY();
|
ddy += h.deltaY();
|
||||||
}
|
}
|
||||||
if(src instanceof Hitboxc h){
|
if(src instanceof Hitboxc h){
|
||||||
ddx -= h.deltaX()/(Time.delta);
|
ddx -= h.deltaX();
|
||||||
ddy -= h.deltaY()/(Time.delta);
|
ddy -= h.deltaY();
|
||||||
}
|
}
|
||||||
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(), ddx, ddy, v);
|
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(), ddx, ddy, v);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ public abstract class BulletType extends Content{
|
|||||||
return Math.max(speed * lifetime * (1f - drag), maxRange);
|
return Math.max(speed * lifetime * (1f - drag), maxRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean collides(Bullet bullet, Building tile){
|
public boolean testCollision(Bullet bullet, Building tile){
|
||||||
return healPercent <= 0.001f || tile.team != bullet.team || tile.healthf() < 1f;
|
return healPercent <= 0.001f || tile.team != bullet.team || tile.healthf() < 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ abstract class BuilderComp implements Posc, Teamc, Rotc{
|
|||||||
|
|
||||||
if(!(tile.block() instanceof ConstructBlock)){
|
if(!(tile.block() instanceof ConstructBlock)){
|
||||||
if(!current.initialized && !current.breaking && Build.validPlace(current.block, team, current.x, current.y, current.rotation)){
|
if(!current.initialized && !current.breaking && Build.validPlace(current.block, team, current.x, current.y, current.rotation)){
|
||||||
boolean hasAll = infinite || !Structs.contains(current.block.requirements, i -> core != null && !core.items.has(i.item));
|
boolean hasAll = infinite || current.isRotation(team) || !Structs.contains(current.block.requirements, i -> core != null && !core.items.has(i.item));
|
||||||
|
|
||||||
if(hasAll){
|
if(hasAll){
|
||||||
Call.beginPlace(self(), current.block, team, current.x, current.y, current.rotation);
|
Call.beginPlace(self(), current.block, team, current.x, current.y, current.rotation);
|
||||||
@@ -138,7 +138,8 @@ abstract class BuilderComp implements Posc, Teamc, Rotc{
|
|||||||
/** @return whether this request should be skipped, in favor of the next one. */
|
/** @return whether this request should be skipped, in favor of the next one. */
|
||||||
boolean shouldSkip(BuildPlan request, @Nullable Building core){
|
boolean shouldSkip(BuildPlan request, @Nullable Building core){
|
||||||
//requests that you have at least *started* are considered
|
//requests that you have at least *started* are considered
|
||||||
if(state.rules.infiniteResources || team.rules().infiniteResources || request.breaking || core == null) return false;
|
if(state.rules.infiniteResources || team.rules().infiniteResources || request.breaking || core == null || request.isRotation(team)) return false;
|
||||||
|
|
||||||
return (request.stuck && !core.items.has(request.block.requirements)) || (Structs.contains(request.block.requirements, i -> !core.items.has(i.item) && Mathf.round(i.amount * state.rules.buildCostMultiplier) > 0) && !request.initialized);
|
return (request.stuck && !core.items.has(request.block.requirements)) || (Structs.contains(request.block.requirements, i -> !core.items.has(i.item) && Mathf.round(i.amount * state.rules.buildCostMultiplier) > 0) && !request.initialized);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
|
|||||||
Building tile = world.build(x, y);
|
Building tile = world.build(x, y);
|
||||||
if(tile == null || !isAdded()) return false;
|
if(tile == null || !isAdded()) return false;
|
||||||
|
|
||||||
if(tile.collide(self()) && type.collides(self(), tile) && !tile.dead() && (type.collidesTeam || tile.team != team) && !(type.pierceBuilding && collided.contains(tile.id))){
|
if(tile.collide(self()) && type.testCollision(self(), tile) && !tile.dead() && (type.collidesTeam || tile.team != team) && !(type.pierceBuilding && collided.contains(tile.id))){
|
||||||
boolean remove = false;
|
boolean remove = false;
|
||||||
|
|
||||||
float health = tile.health;
|
float health = tile.health;
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
|
|||||||
if(isFlying() != wasFlying){
|
if(isFlying() != wasFlying){
|
||||||
if(wasFlying){
|
if(wasFlying){
|
||||||
if(tileOn() != null){
|
if(tileOn() != null){
|
||||||
Fx.unitLand.at(x, y, floorOn().isLiquid ? 1f : 0.5f, floorOn().mapColor);
|
Fx.unitLand.at(x, y, floorOn().isLiquid ? 1f : 0.5f, tileOn().floor().mapColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,4 +83,12 @@ abstract class MechComp implements Posc, Flyingc, Hitboxc, Unitc, Mechc, Elevati
|
|||||||
walked = true;
|
walked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void approach(Vec2 vector){
|
||||||
|
if(!vector.isZero(0.09f)){
|
||||||
|
//mark walking state when moving in a controlled manner
|
||||||
|
walked = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,4 +29,15 @@ abstract class PhysicsComp implements Velc, Hitboxc, Flyingc{
|
|||||||
void impulse(Vec2 v){
|
void impulse(Vec2 v){
|
||||||
impulse(v.x, v.y);
|
impulse(v.x, v.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void impulseNet(Vec2 v){
|
||||||
|
impulse(v.x, v.y);
|
||||||
|
|
||||||
|
//manually move units to simulate velocity for remote players
|
||||||
|
if(isRemote()){
|
||||||
|
float mass = mass();
|
||||||
|
move(v.x / mass, v.y / mass);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ abstract class PuddleComp implements Posc, Puddlec, Drawc{
|
|||||||
float addSpeed = accepting > 0 ? 3f : 0f;
|
float addSpeed = accepting > 0 ? 3f : 0f;
|
||||||
|
|
||||||
amount -= Time.delta * (1f - liquid.viscosity) / (5f + addSpeed);
|
amount -= Time.delta * (1f - liquid.viscosity) / (5f + addSpeed);
|
||||||
|
|
||||||
amount += accepting;
|
amount += accepting;
|
||||||
accepting = 0f;
|
accepting = 0f;
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
@Import Team team;
|
@Import Team team;
|
||||||
@Import int id;
|
@Import int id;
|
||||||
@Import @Nullable Tile mineTile;
|
@Import @Nullable Tile mineTile;
|
||||||
|
@Import Vec2 vel;
|
||||||
|
|
||||||
private UnitController controller;
|
private UnitController controller;
|
||||||
UnitType type;
|
UnitType type;
|
||||||
@@ -51,6 +52,10 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
moveAt(vector, type.accel);
|
moveAt(vector, type.accel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void approach(Vec2 vector){
|
||||||
|
vel.approachDelta(vector, type.accel * realSpeed() * floorSpeedMultiplier());
|
||||||
|
}
|
||||||
|
|
||||||
public void aimLook(Position pos){
|
public void aimLook(Position pos){
|
||||||
aim(pos);
|
aim(pos);
|
||||||
lookAt(pos);
|
lookAt(pos);
|
||||||
@@ -397,6 +402,8 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
|
|
||||||
/** Actually destroys the unit, removing it and creating explosions. **/
|
/** Actually destroys the unit, removing it and creating explosions. **/
|
||||||
public void destroy(){
|
public void destroy(){
|
||||||
|
if(!isAdded()) return;
|
||||||
|
|
||||||
float explosiveness = 2f + item().explosiveness * stack().amount * 1.53f;
|
float explosiveness = 2f + item().explosiveness * stack().amount * 1.53f;
|
||||||
float flammability = item().flammability * stack().amount / 1.9f;
|
float flammability = item().flammability * stack().amount / 1.9f;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package mindustry.entities.units;
|
|||||||
import arc.func.*;
|
import arc.func.*;
|
||||||
import arc.math.geom.*;
|
import arc.math.geom.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
|
import mindustry.game.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
@@ -61,6 +62,12 @@ public class BuildPlan implements Position{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isRotation(Team team){
|
||||||
|
if(breaking) return false;
|
||||||
|
Tile tile = tile();
|
||||||
|
return tile != null && tile.team() == team && tile.block() == block && tile.build != null && tile.build.rotation != rotation;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean samePos(BuildPlan other){
|
public boolean samePos(BuildPlan other){
|
||||||
return x == other.x && y == other.y;
|
return x == other.x && y == other.y;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ public class EventType{
|
|||||||
public static class CoreItemDeliverEvent{}
|
public static class CoreItemDeliverEvent{}
|
||||||
/** Called when the player opens info for a specific block.*/
|
/** Called when the player opens info for a specific block.*/
|
||||||
public static class BlockInfoEvent{}
|
public static class BlockInfoEvent{}
|
||||||
|
/** Called *after* all content has been initialized. */
|
||||||
|
public static class ContentInitEvent{}
|
||||||
/** Called when the client game is first loaded. */
|
/** Called when the client game is first loaded. */
|
||||||
public static class ClientLoadEvent{}
|
public static class ClientLoadEvent{}
|
||||||
/** Called when a game begins and the world is loaded. */
|
/** Called when a game begins and the world is loaded. */
|
||||||
|
|||||||
@@ -778,7 +778,7 @@ public class LExecutor{
|
|||||||
Var va = exec.var(a);
|
Var va = exec.var(a);
|
||||||
Var vb = exec.var(b);
|
Var vb = exec.var(b);
|
||||||
|
|
||||||
if(op.objFunction2 != null && (va.isobj || vb.isobj)){
|
if(op.objFunction2 != null && va.isobj && vb.isobj){
|
||||||
//use object function if provided, and one of the variables is an object
|
//use object function if provided, and one of the variables is an object
|
||||||
exec.setnum(dest, op.objFunction2.get(exec.obj(a), exec.obj(b)));
|
exec.setnum(dest, op.objFunction2.get(exec.obj(a), exec.obj(b)));
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
|
|||||||
float scl = 5f;
|
float scl = 5f;
|
||||||
float waterOffset = 0.07f;
|
float waterOffset = 0.07f;
|
||||||
|
|
||||||
//TODO fix sand near snow (sector 173)
|
|
||||||
Block[][] arr =
|
Block[][] arr =
|
||||||
{
|
{
|
||||||
{Blocks.water, Blocks.darksandWater, Blocks.darksand, Blocks.darksand, Blocks.darksand, Blocks.darksand, Blocks.sand, Blocks.sand, Blocks.sand, Blocks.sand, Blocks.darksandTaintedWater, Blocks.stone, Blocks.stone},
|
{Blocks.water, Blocks.darksandWater, Blocks.darksand, Blocks.darksand, Blocks.darksand, Blocks.darksand, Blocks.sand, Blocks.sand, Blocks.sand, Blocks.sand, Blocks.darksandTaintedWater, Blocks.stone, Blocks.stone},
|
||||||
@@ -55,7 +54,6 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
|
|||||||
|
|
||||||
float water = 2f / arr[0].length;
|
float water = 2f / arr[0].length;
|
||||||
|
|
||||||
|
|
||||||
float rawHeight(Vec3 position){
|
float rawHeight(Vec3 position){
|
||||||
position = Tmp.v33.set(position).scl(scl);
|
position = Tmp.v33.set(position).scl(scl);
|
||||||
return (Mathf.pow((float)noise.octaveNoise3D(7, 0.5f, 1f/3f, position.x, position.y, position.z), 2.3f) + waterOffset) / (1f + waterOffset);
|
return (Mathf.pow((float)noise.octaveNoise3D(7, 0.5f, 1f/3f, position.x, position.y, position.z), 2.3f) + waterOffset) / (1f + waterOffset);
|
||||||
@@ -340,11 +338,12 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
|
|||||||
}
|
}
|
||||||
}else if(floor != Blocks.basalt && floor != Blocks.ice && floor.asFloor().hasSurface()){
|
}else if(floor != Blocks.basalt && floor != Blocks.ice && floor.asFloor().hasSurface()){
|
||||||
float noise = noise(x + 782, y, 5, 0.75f, 260f, 1f);
|
float noise = noise(x + 782, y, 5, 0.75f, 260f, 1f);
|
||||||
|
if(noise > 0.67f && !enemies.contains(e -> Mathf.within(x, y, e.x, e.y, 8))){
|
||||||
if(noise > 0.72f){
|
if(noise > 0.72f){
|
||||||
floor = noise > 0.78f ? Blocks.taintedWater : (floor == Blocks.sand ? Blocks.sandWater : Blocks.darksandTaintedWater);
|
floor = noise > 0.78f ? Blocks.taintedWater : (floor == Blocks.sand ? Blocks.sandWater : Blocks.darksandTaintedWater);
|
||||||
ore = Blocks.air;
|
}else{
|
||||||
}else if(noise > 0.67f){
|
|
||||||
floor = (floor == Blocks.sand ? floor : Blocks.darksand);
|
floor = (floor == Blocks.sand ? floor : Blocks.darksand);
|
||||||
|
}
|
||||||
ore = Blocks.air;
|
ore = Blocks.air;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -647,6 +647,14 @@ public class Mods implements Loadable{
|
|||||||
meta.hidden = true;
|
meta.hidden = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//disallow putting a description after the version
|
||||||
|
if(meta.version != null){
|
||||||
|
int line = meta.version.indexOf('\n');
|
||||||
|
if(line != -1){
|
||||||
|
meta.version = meta.version.substring(0, line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!headless){
|
if(!headless){
|
||||||
Log.info("Loaded mod '@' in @ms", meta.name, Time.elapsed());
|
Log.info("Loaded mod '@' in @ms", meta.name, Time.elapsed());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ public class BeControl{
|
|||||||
Fi dest = Fi.get(System.getProperty("becopy"));
|
Fi dest = Fi.get(System.getProperty("becopy"));
|
||||||
Fi self = Fi.get(BeControl.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
|
Fi self = Fi.get(BeControl.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
|
||||||
|
|
||||||
|
for(Fi file : self.parent().findAll(f -> !f.equals(self))) file.delete();
|
||||||
|
|
||||||
self.copyTo(dest);
|
self.copyTo(dest);
|
||||||
}catch(Throwable e){
|
}catch(Throwable e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ public class Item extends UnlockableContent{
|
|||||||
* 1 cost = 1 tick added to build time
|
* 1 cost = 1 tick added to build time
|
||||||
*/
|
*/
|
||||||
public float cost = 1f;
|
public float cost = 1f;
|
||||||
|
/** if true, this item is of lowest priority to drills. */
|
||||||
|
public boolean lowPriority;
|
||||||
|
|
||||||
public Item(String name, Color color){
|
public Item(String name, Color color){
|
||||||
super(name);
|
super(name);
|
||||||
|
|||||||
@@ -152,10 +152,6 @@ public class Sector{
|
|||||||
return res % 2 == 0 ? res : res + 1;
|
return res % 2 == 0 ? res : res + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addItem(Item item, int amount){
|
|
||||||
removeItem(item, -amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeItems(ItemSeq items){
|
public void removeItems(ItemSeq items){
|
||||||
ItemSeq copy = items.copy();
|
ItemSeq copy = items.copy();
|
||||||
copy.each((i, a) -> copy.set(i, -a));
|
copy.each((i, a) -> copy.set(i, -a));
|
||||||
@@ -169,7 +165,6 @@ public class Sector{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addItems(ItemSeq items){
|
public void addItems(ItemSeq items){
|
||||||
if(net.client()) return;
|
|
||||||
|
|
||||||
if(isBeingPlayed()){
|
if(isBeingPlayed()){
|
||||||
if(state.rules.defaultTeam.core() != null){
|
if(state.rules.defaultTeam.core() != null){
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
public float health = 200f, range = -1, armor = 0f, maxRange = -1f;
|
public float health = 200f, range = -1, armor = 0f, maxRange = -1f;
|
||||||
public float crashDamageMultiplier = 1f;
|
public float crashDamageMultiplier = 1f;
|
||||||
public boolean targetAir = true, targetGround = true;
|
public boolean targetAir = true, targetGround = true;
|
||||||
public boolean faceTarget = true, rotateShooting = true, isCounted = true, lowAltitude = false;
|
public boolean faceTarget = true, rotateShooting = true, isCounted = true, lowAltitude = false, circleTarget = true;
|
||||||
public boolean canBoost = false;
|
public boolean canBoost = false;
|
||||||
public boolean destructibleWreck = true;
|
public boolean destructibleWreck = true;
|
||||||
public float groundLayer = Layer.groundUnit;
|
public float groundLayer = Layer.groundUnit;
|
||||||
@@ -106,7 +106,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
|
|
||||||
public Seq<Weapon> weapons = new Seq<>();
|
public Seq<Weapon> weapons = new Seq<>();
|
||||||
public TextureRegion baseRegion, legRegion, region, shadowRegion, cellRegion,
|
public TextureRegion baseRegion, legRegion, region, shadowRegion, cellRegion,
|
||||||
occlusionRegion, jointRegion, footRegion, legBaseRegion, baseJointRegion, outlineRegion;
|
softShadowRegion, jointRegion, footRegion, legBaseRegion, baseJointRegion, outlineRegion;
|
||||||
public TextureRegion[] wreckRegions;
|
public TextureRegion[] wreckRegions;
|
||||||
|
|
||||||
protected @Nullable ItemStack[] cachedRequirements;
|
protected @Nullable ItemStack[] cachedRequirements;
|
||||||
@@ -351,7 +351,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
legBaseRegion = Core.atlas.find(name + "-leg-base", name + "-leg");
|
legBaseRegion = Core.atlas.find(name + "-leg-base", name + "-leg");
|
||||||
baseRegion = Core.atlas.find(name + "-base");
|
baseRegion = Core.atlas.find(name + "-base");
|
||||||
cellRegion = Core.atlas.find(name + "-cell", Core.atlas.find("power-cell"));
|
cellRegion = Core.atlas.find(name + "-cell", Core.atlas.find("power-cell"));
|
||||||
occlusionRegion = Core.atlas.find("circle-shadow");
|
softShadowRegion = Core.atlas.find("circle-shadow");
|
||||||
outlineRegion = Core.atlas.find(name + "-outline");
|
outlineRegion = Core.atlas.find(name + "-outline");
|
||||||
shadowRegion = icon(Cicon.full);
|
shadowRegion = icon(Cicon.full);
|
||||||
|
|
||||||
@@ -439,7 +439,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
drawPayload((Unit & Payloadc)unit);
|
drawPayload((Unit & Payloadc)unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
drawOcclusion(unit);
|
drawSoftShadow(unit);
|
||||||
|
|
||||||
Draw.z(z - outlineSpace);
|
Draw.z(z - outlineSpace);
|
||||||
|
|
||||||
@@ -501,11 +501,11 @@ public class UnitType extends UnlockableContent{
|
|||||||
Draw.color();
|
Draw.color();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawOcclusion(Unit unit){
|
public void drawSoftShadow(Unit unit){
|
||||||
Draw.color(0, 0, 0, 0.4f);
|
Draw.color(0, 0, 0, 0.4f);
|
||||||
float rad = 1.6f;
|
float rad = 1.6f;
|
||||||
float size = Math.max(region.width, region.height) * Draw.scl;
|
float size = Math.max(region.width, region.height) * Draw.scl;
|
||||||
Draw.rect(occlusionRegion, unit, size * rad, size * rad);
|
Draw.rect(softShadowRegion, unit, size * rad, size * rad);
|
||||||
Draw.color();
|
Draw.color();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -580,8 +580,8 @@ public class UnitType extends UnlockableContent{
|
|||||||
float wx = unit.x + Angles.trnsx(rotation, weapon.x, weapon.y) + Angles.trnsx(weaponRotation, 0, recoil),
|
float wx = unit.x + Angles.trnsx(rotation, weapon.x, weapon.y) + Angles.trnsx(weaponRotation, 0, recoil),
|
||||||
wy = unit.y + Angles.trnsy(rotation, weapon.x, weapon.y) + Angles.trnsy(weaponRotation, 0, recoil);
|
wy = unit.y + Angles.trnsy(rotation, weapon.x, weapon.y) + Angles.trnsy(weaponRotation, 0, recoil);
|
||||||
|
|
||||||
if(weapon.occlusion > 0){
|
if(weapon.shadow > 0){
|
||||||
Drawf.shadow(wx, wy, weapon.occlusion);
|
Drawf.shadow(wx, wy, weapon.shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(weapon.outlineRegion.found()){
|
if(weapon.outlineRegion.found()){
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ public class Weapon{
|
|||||||
public float x = 5f, y = 0f;
|
public float x = 5f, y = 0f;
|
||||||
/** random spread on the X axis */
|
/** random spread on the X axis */
|
||||||
public float xRand = 0f;
|
public float xRand = 0f;
|
||||||
/** radius of occlusion drawn under the weapon; <0 to disable */
|
/** radius of shadow drawn under the weapon; <0 to disable */
|
||||||
public float occlusion = -1f;
|
public float shadow = -1f;
|
||||||
/** fraction of velocity that is random */
|
/** fraction of velocity that is random */
|
||||||
public float velocityRnd = 0f;
|
public float velocityRnd = 0f;
|
||||||
/** delay in ticks between shots */
|
/** delay in ticks between shots */
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ public class Weather extends UnlockableContent{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
if(renderer.weatherAlpha() > 0.0001f){
|
if(renderer.weatherAlpha() > 0.0001f && Core.settings.getBool("showweather")){
|
||||||
Draw.draw(Layer.weather, () -> {
|
Draw.draw(Layer.weather, () -> {
|
||||||
weather.rand.setSeed(0);
|
weather.rand.setSeed(0);
|
||||||
Draw.alpha(renderer.weatherAlpha() * opacity * weather.opacityMultiplier);
|
Draw.alpha(renderer.weatherAlpha() * opacity * weather.opacityMultiplier);
|
||||||
|
|||||||
@@ -4,8 +4,11 @@ import arc.*;
|
|||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
import arc.scene.style.*;
|
import arc.scene.style.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
|
import mindustry.*;
|
||||||
|
import mindustry.core.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
|
import mindustry.mod.Mods.*;
|
||||||
|
|
||||||
public class Links{
|
public class Links{
|
||||||
private static LinkEntry[] links;
|
private static LinkEntry[] links;
|
||||||
@@ -22,7 +25,8 @@ public class Links{
|
|||||||
new LinkEntry("google-play", "https://play.google.com/store/apps/details?id=io.anuke.mindustry", Icon.googleplay, Color.valueOf("689f38")),
|
new LinkEntry("google-play", "https://play.google.com/store/apps/details?id=io.anuke.mindustry", Icon.googleplay, Color.valueOf("689f38")),
|
||||||
new LinkEntry("f-droid", "https://f-droid.org/packages/io.anuke.mindustry/", Icon.android, Color.valueOf("026aa7")),
|
new LinkEntry("f-droid", "https://f-droid.org/packages/io.anuke.mindustry/", Icon.android, Color.valueOf("026aa7")),
|
||||||
new LinkEntry("github", "https://github.com/Anuken/Mindustry/", Icon.github, Color.valueOf("24292e")),
|
new LinkEntry("github", "https://github.com/Anuken/Mindustry/", Icon.github, Color.valueOf("24292e")),
|
||||||
new LinkEntry("dev-builds", "https://github.com/Anuken/MindustryBuilds", Icon.githubSquare, Color.valueOf("fafbfc"))
|
new LinkEntry("dev-builds", "https://github.com/Anuken/MindustryBuilds", Icon.githubSquare, Color.valueOf("fafbfc")),
|
||||||
|
new LinkEntry("bug", report(), Icon.wrench, Color.valueOf("cbd97f"))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,4 +52,23 @@ public class Links{
|
|||||||
this.title = Core.bundle.get("link." + name + ".title", Strings.capitalize(name.replace("-", " ")));
|
this.title = Core.bundle.get("link." + name + ".title", Strings.capitalize(name.replace("-", " ")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String report(){
|
||||||
|
return "https://github.com/Anuken/Mindustry/issues/new?assignees=&labels=bug&body=" +
|
||||||
|
Strings.encode(Strings.format(
|
||||||
|
"**Platform**: `@`\n" +
|
||||||
|
"\n**Build**: `@`\n" +
|
||||||
|
"\n**Issue**: *Explain your issue in detail.*\n" +
|
||||||
|
"\n**Steps to reproduce**: *How you happened across the issue, and what exactly you did to make the bug happen.*\n" +
|
||||||
|
"\n**Link(s) to mod(s) used**: `@`\n" +
|
||||||
|
"\n**Save file**: *The (zipped) save file you were playing on when the bug happened. THIS IS REQUIRED FOR ANY ISSUE HAPPENING IN-GAME, REGARDLESS OF WHETHER YOU THINK IT HAPPENS EVERYWHERE. DO NOT DELETE OR OMIT THIS LINE UNLESS YOU ARE SURE THAT THE ISSUE DOES NOT HAPPEN IN-GAME.*\n" +
|
||||||
|
"\n**Crash report**: *The contents of relevant crash report files. REQUIRED if you are reporting a crash.*\n" +
|
||||||
|
"\n---\n" +
|
||||||
|
"\n*Place an X (no spaces) between the brackets to confirm that you have read the line below.*" +
|
||||||
|
"\n- [ ] **I have updated to the latest release (https://github.com/Anuken/Mindustry/releases) to make sure my issue has not been fixed.**" +
|
||||||
|
"\n- [ ] **I have searched the closed and open issues to make sure that this problem has not already been reported.**",
|
||||||
|
OS.isAndroid ? "Android " + Core.app.getVersion() : (System.getProperty("os.name") + (OS.is64Bit ? " x64" : " x32")),
|
||||||
|
Version.combined(),
|
||||||
|
Vars.mods.list().any() ? Vars.mods.list().select(LoadedMod::enabled).map(l -> l.meta.author + "/" + l.name + ":" + l.meta.version) : "none"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -413,7 +413,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
public void tap(InputEvent event, float x, float y, int count, KeyCode button){
|
public void tap(InputEvent event, float x, float y, int count, KeyCode button){
|
||||||
if(showing()) return;
|
if(showing()) return;
|
||||||
|
|
||||||
if(selected == hovered && count == 2){
|
if(hovered != null && selected == hovered && count == 2){
|
||||||
playSelected();
|
playSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -766,9 +766,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
sector.isBeingPlayed() ? "@sectors.resume" :
|
sector.isBeingPlayed() ? "@sectors.resume" :
|
||||||
sector.hasBase() ? "@sectors.go" :
|
sector.hasBase() ? "@sectors.go" :
|
||||||
locked ? "@locked" : "@sectors.launch",
|
locked ? "@locked" : "@sectors.launch",
|
||||||
locked ? Icon.lock : Icon.play, () -> {
|
locked ? Icon.lock : Icon.play, this::playSelected).growX().height(54f).minWidth(170f).padTop(4).disabled(locked);
|
||||||
playSelected();
|
|
||||||
}).growX().height(54f).minWidth(170f).padTop(4).disabled(locked);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stable.pack();
|
stable.pack();
|
||||||
@@ -795,6 +793,8 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void playSelected(){
|
void playSelected(){
|
||||||
|
if(selected == null) return;
|
||||||
|
|
||||||
Sector sector = selected;
|
Sector sector = selected;
|
||||||
|
|
||||||
if(sector.isBeingPlayed()){
|
if(sector.isBeingPlayed()){
|
||||||
|
|||||||
@@ -404,6 +404,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
graphics.checkPref("fps", false);
|
graphics.checkPref("fps", false);
|
||||||
graphics.checkPref("playerindicators", true);
|
graphics.checkPref("playerindicators", true);
|
||||||
graphics.checkPref("indicators", true);
|
graphics.checkPref("indicators", true);
|
||||||
|
graphics.checkPref("showweather", true);
|
||||||
graphics.checkPref("animatedwater", true);
|
graphics.checkPref("animatedwater", true);
|
||||||
if(Shaders.shield != null){
|
if(Shaders.shield != null){
|
||||||
graphics.checkPref("animatedshields", !mobile);
|
graphics.checkPref("animatedshields", !mobile);
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ public class PlacementFragment extends Fragment{
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(blockSelectEnd || Time.timeSinceMillis(blockSelectSeqMillis) > 750){ //1st number of combo, select category
|
}else if(blockSelectEnd || Time.timeSinceMillis(blockSelectSeqMillis) > 400){ //1st number of combo, select category
|
||||||
//select only visible categories
|
//select only visible categories
|
||||||
if(!getUnlockedByCategory(Category.all[i]).isEmpty()){
|
if(!getUnlockedByCategory(Category.all[i]).isEmpty()){
|
||||||
currentCategory = Category.all[i];
|
currentCategory = Category.all[i];
|
||||||
|
|||||||
@@ -377,7 +377,8 @@ public class Block extends UnlockableContent{
|
|||||||
|
|
||||||
public boolean canReplace(Block other){
|
public boolean canReplace(Block other){
|
||||||
if(other.alwaysReplace) return true;
|
if(other.alwaysReplace) return true;
|
||||||
return (other != this || rotate) && this.group != BlockGroup.none && other.group == this.group && (size == other.size || (size >= other.size && subclass != null && subclass == other.subclass));
|
return (other != this || rotate) && this.group != BlockGroup.none && other.group == this.group &&
|
||||||
|
(size == other.size || (size >= other.size && ((subclass != null && subclass == other.subclass) || group.anyReplace)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return a possible replacement for this block when placed in a line by the player. */
|
/** @return a possible replacement for this block when placed in a line by the player. */
|
||||||
|
|||||||
@@ -441,6 +441,10 @@ public class Tile implements Position, QuadTreeObject, Displayable{
|
|||||||
return rect.setCentered(drawx(), drawy(), block.size * tilesize, block.size * tilesize);
|
return rect.setCentered(drawx(), drawy(), block.size * tilesize, block.size * tilesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Rect getBounds(Rect rect){
|
||||||
|
return rect.set(x * tilesize - tilesize/2f, y * tilesize - tilesize/2f, tilesize, tilesize);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void hitbox(Rect rect){
|
public void hitbox(Rect rect){
|
||||||
getHitbox(rect);
|
getHitbox(rect);
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ public class Accelerator extends Block{
|
|||||||
super.init();
|
super.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean outputsItems(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public class AcceleratorBuild extends Building{
|
public class AcceleratorBuild extends Building{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -69,12 +69,6 @@ public class Wall extends Block{
|
|||||||
return new TextureRegion[]{Core.atlas.find(Core.atlas.has(name) ? name : name + "1")};
|
return new TextureRegion[]{Core.atlas.find(Core.atlas.has(name) ? name : name + "1")};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canReplace(Block other){
|
|
||||||
if(other.alwaysReplace) return true;
|
|
||||||
return (other != this || rotate) && this.group != BlockGroup.none && other.group == this.group && other != this && size >= other.size;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class WallBuild extends Building{
|
public class WallBuild extends Building{
|
||||||
public float hit;
|
public float hit;
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ public class LiquidTurret extends Turret{
|
|||||||
public boolean acceptLiquid(Building source, Liquid liquid){
|
public boolean acceptLiquid(Building source, Liquid liquid){
|
||||||
return ammoTypes.get(liquid) != null
|
return ammoTypes.get(liquid) != null
|
||||||
&& (liquids.current() == liquid || (ammoTypes.containsKey(liquid)
|
&& (liquids.current() == liquid || (ammoTypes.containsKey(liquid)
|
||||||
&& liquids.get(liquids.current()) <= 1f / ammoTypes.get(liquids.current()).ammoMultiplier + 0.001f));
|
&& (!ammoTypes.containsKey(liquids.current()) || liquids.get(liquids.current()) <= 1f / ammoTypes.get(liquids.current()).ammoMultiplier + 0.001f)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class TractorBeamTurret extends BaseTurret{
|
|||||||
}
|
}
|
||||||
|
|
||||||
any = true;
|
any = true;
|
||||||
target.impulse(Tmp.v1.set(this).sub(target).limit((force + (1f - target.dst(this) / range) * scaledForce) * efficiency() * timeScale));
|
target.impulseNet(Tmp.v1.set(this).sub(target).limit((force + (1f - target.dst(this) / range) * scaledForce) * efficiency() * timeScale));
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
strength = Mathf.lerpDelta(strength, 0, 0.1f);
|
strength = Mathf.lerpDelta(strength, 0, 0.1f);
|
||||||
|
|||||||
@@ -23,12 +23,6 @@ public class Router extends Block{
|
|||||||
noUpdateDisabled = true;
|
noUpdateDisabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canReplace(Block other){
|
|
||||||
if(other.alwaysReplace) return true;
|
|
||||||
return (other != this || rotate) && this.group != BlockGroup.none && other.group == this.group && size >= other.size;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class RouterBuild extends Building implements ControlBlock{
|
public class RouterBuild extends Building implements ControlBlock{
|
||||||
public Item lastItem;
|
public Item lastItem;
|
||||||
public Tile lastInput;
|
public Tile lastInput;
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class LogicBlock extends Block{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static String getLinkName(Block block){
|
public static String getLinkName(Block block){
|
||||||
String name = block.name;
|
String name = block.name;
|
||||||
if(name.contains("-")){
|
if(name.contains("-")){
|
||||||
String[] split = name.split("-");
|
String[] split = name.split("-");
|
||||||
@@ -82,11 +82,11 @@ public class LogicBlock extends Block{
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static byte[] compress(String code, Seq<LogicLink> links){
|
public static byte[] compress(String code, Seq<LogicLink> links){
|
||||||
return compress(code.getBytes(charset), links);
|
return compress(code.getBytes(charset), links);
|
||||||
}
|
}
|
||||||
|
|
||||||
static byte[] compress(byte[] bytes, Seq<LogicLink> links){
|
public static byte[] compress(byte[] bytes, Seq<LogicLink> links){
|
||||||
try{
|
try{
|
||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
DataOutputStream stream = new DataOutputStream(new DeflaterOutputStream(baos));
|
DataOutputStream stream = new DataOutputStream(new DeflaterOutputStream(baos));
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ public class Drill extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
itemArray.sort((item1, item2) -> {
|
itemArray.sort((item1, item2) -> {
|
||||||
int type = Boolean.compare(item1 != Items.sand, item2 != Items.sand);
|
int type = Boolean.compare(!item1.lowPriority, !item2.lowPriority);
|
||||||
if(type != 0) return type;
|
if(type != 0) return type;
|
||||||
int amounts = Integer.compare(oreCount.get(item1, 0), oreCount.get(item2, 0));
|
int amounts = Integer.compare(oreCount.get(item1, 0), oreCount.get(item2, 0));
|
||||||
if(amounts != 0) return amounts;
|
if(amounts != 0) return amounts;
|
||||||
|
|||||||
@@ -17,7 +17,11 @@ public class LiquidConverter extends GenericCrafter{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(){
|
public void init(){
|
||||||
ConsumeLiquidBase cl = consumes.get(ConsumeType.liquid);
|
if(!consumes.has(ConsumeType.liquid) || !(consumes.get(ConsumeType.liquid) instanceof ConsumeLiquid)){
|
||||||
|
throw new RuntimeException("LiquidsConverters must have a ConsumeLiquid. Note that filters are not supported.");
|
||||||
|
}
|
||||||
|
|
||||||
|
ConsumeLiquid cl = consumes.get(ConsumeType.liquid);
|
||||||
cl.update(false);
|
cl.update(false);
|
||||||
outputLiquid.amount = cl.amount;
|
outputLiquid.amount = cl.amount;
|
||||||
super.init();
|
super.init();
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ public class CoreBlock extends StorageBlock{
|
|||||||
|
|
||||||
for(Building other : state.teams.cores(team)){
|
for(Building other : state.teams.cores(team)){
|
||||||
if(other.tile() == tile) continue;
|
if(other.tile() == tile) continue;
|
||||||
storageCapacity += other.block.itemCapacity + other.proximity().sum(e -> owns(e) && owns(other, e) ? e.block.itemCapacity : 0);
|
storageCapacity += other.block.itemCapacity + other.proximity().sum(e -> owns(other, e) ? e.block.itemCapacity : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Team.sharded.core().items.set(Items.surgeAlloy, 12000)
|
//Team.sharded.core().items.set(Items.surgeAlloy, 12000)
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ public class Unloader extends Block{
|
|||||||
saveConfig = true;
|
saveConfig = true;
|
||||||
itemCapacity = 0;
|
itemCapacity = 0;
|
||||||
noUpdateDisabled = true;
|
noUpdateDisabled = true;
|
||||||
|
unloadable = false;
|
||||||
|
|
||||||
config(Item.class, (UnloaderBuild tile, Item item) -> tile.sortItem = item);
|
config(Item.class, (UnloaderBuild tile, Item item) -> tile.sortItem = item);
|
||||||
configClear((UnloaderBuild tile) -> tile.sortItem = null);
|
configClear((UnloaderBuild tile) -> tile.sortItem = null);
|
||||||
@@ -47,10 +48,15 @@ public class Unloader extends Block{
|
|||||||
public Item sortItem = null;
|
public Item sortItem = null;
|
||||||
public Building dumpingTo;
|
public Building dumpingTo;
|
||||||
public int offset = 0;
|
public int offset = 0;
|
||||||
|
public int[] rotations;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateTile(){
|
public void updateTile(){
|
||||||
if(timer(timerUnload, speed / timeScale())){
|
if(timer(timerUnload, speed / timeScale())){
|
||||||
|
if(rotations == null || rotations.length != proximity.size){
|
||||||
|
rotations = new int[proximity.size];
|
||||||
|
}
|
||||||
|
|
||||||
for(int i = 0; i < proximity.size; i++){
|
for(int i = 0; i < proximity.size; i++){
|
||||||
int pos = (offset + i) % proximity.size;
|
int pos = (offset + i) % proximity.size;
|
||||||
var other = proximity.get(pos);
|
var other = proximity.get(pos);
|
||||||
@@ -61,18 +67,19 @@ public class Unloader extends Block{
|
|||||||
dumpingTo = other;
|
dumpingTo = other;
|
||||||
|
|
||||||
//get item to be taken
|
//get item to be taken
|
||||||
Item item = sortItem == null ? other.items.beginTake() : sortItem;
|
Item item = sortItem == null ? other.items.takeIndex(rotations[pos]) : sortItem;
|
||||||
|
|
||||||
//remove item if it's dumped correctly
|
//remove item if it's dumped correctly
|
||||||
if(put(item)){
|
if(put(item)){
|
||||||
if(sortItem == null){
|
|
||||||
other.items.endTake(item);
|
|
||||||
}else{
|
|
||||||
other.items.remove(item, 1);
|
other.items.remove(item, 1);
|
||||||
|
|
||||||
|
if(sortItem == null){
|
||||||
|
rotations[pos] = item.id + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
other.itemTaken(item);
|
other.itemTaken(item);
|
||||||
}else if(sortItem == null){
|
}else if(sortItem == null){
|
||||||
other.items.failTake();
|
rotations[pos] = other.items.nextIndex(rotations[pos]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,16 @@
|
|||||||
package mindustry.world.meta;
|
package mindustry.world.meta;
|
||||||
|
|
||||||
public enum BlockGroup{
|
public enum BlockGroup{
|
||||||
none, walls, projectors, turrets, transportation, power, liquids, drills, storage, units, logic
|
none, walls(true), projectors(true), turrets, transportation(true), power, liquids(true), drills, storage, units, logic(true);
|
||||||
|
|
||||||
|
/** if true, any block in this category replaces any other block in this category. */
|
||||||
|
public final boolean anyReplace;
|
||||||
|
|
||||||
|
BlockGroup(boolean anyReplace){
|
||||||
|
this.anyReplace = anyReplace;
|
||||||
|
}
|
||||||
|
|
||||||
|
BlockGroup(){
|
||||||
|
this(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ public class ItemModule extends BlockModule{
|
|||||||
|
|
||||||
/** Begins a speculative take operation. This returns the item that would be returned by #take(), but does not change state. */
|
/** Begins a speculative take operation. This returns the item that would be returned by #take(), but does not change state. */
|
||||||
@Nullable
|
@Nullable
|
||||||
public Item beginTake(){
|
public Item takeIndex(int takeRotation){
|
||||||
for(int i = 0; i < items.length; i++){
|
for(int i = 0; i < items.length; i++){
|
||||||
int index = (i + takeRotation);
|
int index = (i + takeRotation);
|
||||||
if(index >= items.length) index -= items.length;
|
if(index >= items.length) index -= items.length;
|
||||||
@@ -217,23 +217,15 @@ public class ItemModule extends BlockModule{
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Finishes a take operation. Updates take state, removes the item. */
|
public int nextIndex(int takeRotation){
|
||||||
public void endTake(Item item){
|
|
||||||
items[item.id] --;
|
|
||||||
total --;
|
|
||||||
takeRotation = item.id + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void failTake(){
|
|
||||||
for(int i = 1; i < items.length; i++){
|
for(int i = 1; i < items.length; i++){
|
||||||
int index = (i + takeRotation);
|
int index = (i + takeRotation);
|
||||||
if(index >= items.length) index -= items.length;
|
if(index >= items.length) index -= items.length;
|
||||||
if(items[index] > 0){
|
if(items[index] > 0){
|
||||||
takeRotation += i;
|
return (takeRotation + i) % items.length;
|
||||||
takeRotation %= items.length;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return takeRotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int get(int id){
|
public int get(int id){
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package mindustry.desktop.steam;
|
package mindustry.desktop.steam;
|
||||||
|
|
||||||
import arc.*;
|
import arc.*;
|
||||||
import arc.math.*;
|
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import com.codedisaster.steamworks.*;
|
import com.codedisaster.steamworks.*;
|
||||||
@@ -26,6 +25,7 @@ public class SStats implements SteamUserStatsCallback{
|
|||||||
|
|
||||||
private ObjectSet<String> blocksBuilt = new ObjectSet<>(), unitsBuilt = new ObjectSet<>();
|
private ObjectSet<String> blocksBuilt = new ObjectSet<>(), unitsBuilt = new ObjectSet<>();
|
||||||
private ObjectSet<UnitType> t5s = new ObjectSet<>();
|
private ObjectSet<UnitType> t5s = new ObjectSet<>();
|
||||||
|
private IntSet checked = new IntSet();
|
||||||
|
|
||||||
public SStats(){
|
public SStats(){
|
||||||
stats.requestCurrentStats();
|
stats.requestCurrentStats();
|
||||||
@@ -78,7 +78,7 @@ public class SStats implements SteamUserStatsCallback{
|
|||||||
private void registerEvents(){
|
private void registerEvents(){
|
||||||
|
|
||||||
Events.on(UnitDestroyEvent.class, e -> {
|
Events.on(UnitDestroyEvent.class, e -> {
|
||||||
if(ncustom()){
|
if(campaign()){
|
||||||
if(e.unit.team != Vars.player.team()){
|
if(e.unit.team != Vars.player.team()){
|
||||||
SStat.unitsDestroyed.add();
|
SStat.unitsDestroyed.add();
|
||||||
|
|
||||||
@@ -137,9 +137,11 @@ public class SStats implements SteamUserStatsCallback{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(e.tile.block() instanceof Conveyor){
|
if(e.tile.block() instanceof Conveyor){
|
||||||
|
checked.clear();
|
||||||
check: {
|
check: {
|
||||||
Tile current = e.tile;
|
Tile current = e.tile;
|
||||||
for(int i = 0; i < 4; i++){
|
for(int i = 0; i < 4; i++){
|
||||||
|
checked.add(current.pos());
|
||||||
if(current.build == null) break check;
|
if(current.build == null) break check;
|
||||||
Tile next = current.nearby(current.build.rotation);
|
Tile next = current.nearby(current.build.rotation);
|
||||||
if(next != null && next.block() instanceof Conveyor){
|
if(next != null && next.block() instanceof Conveyor){
|
||||||
@@ -149,7 +151,7 @@ public class SStats implements SteamUserStatsCallback{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(current == e.tile){
|
if(current == e.tile && checked.size == 4){
|
||||||
circleConveyor.complete();
|
circleConveyor.complete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -253,7 +255,7 @@ public class SStats implements SteamUserStatsCallback{
|
|||||||
});
|
});
|
||||||
|
|
||||||
Events.on(WaveEvent.class, e -> {
|
Events.on(WaveEvent.class, e -> {
|
||||||
if(ncustom()){
|
if(campaign()){
|
||||||
SStat.maxWavesSurvived.max(Vars.state.wave);
|
SStat.maxWavesSurvived.max(Vars.state.wave);
|
||||||
|
|
||||||
if(state.stats.buildingsBuilt == 0 && state.wave >= 10){
|
if(state.stats.buildingsBuilt == 0 && state.wave >= 10){
|
||||||
@@ -326,10 +328,6 @@ public class SStats implements SteamUserStatsCallback{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean ncustom(){
|
|
||||||
return campaign();
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean campaign(){
|
private boolean campaign(){
|
||||||
return Vars.state.isCampaign();
|
return Vars.state.isCampaign();
|
||||||
}
|
}
|
||||||
|
|||||||
8
fastlane/metadata/android/en-US/changelogs/29772.txt
Normal file
8
fastlane/metadata/android/en-US/changelogs/29772.txt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[This is a truncated changelog, see Github for full notes]
|
||||||
|
- Slightly increased Lancer build cost
|
||||||
|
- Double-tapping now enters a campaign map (Contributed by @joshuaptfan)
|
||||||
|
- Minor logic memory optimizations - block/sensor constants are no longer stored in every processor
|
||||||
|
- Doubled surge smelter item capacity
|
||||||
|
- Made Fungal Pass slightly easier
|
||||||
|
- Fixed some rare crashes
|
||||||
|
- Fixed unit spawn shockwave appearing too late
|
||||||
2
fastlane/metadata/android/en-US/changelogs/29775.txt
Normal file
2
fastlane/metadata/android/en-US/changelogs/29775.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[This is a truncated changelog, see Github for full notes]
|
||||||
|
- Fixed a common crash related to planet selection
|
||||||
@@ -105,5 +105,27 @@
|
|||||||
"NEW_ACHIEVEMENT_21_22_DESC" "Zacznij w strefie z 10.000 lub większą ilością surowców."
|
"NEW_ACHIEVEMENT_21_22_DESC" "Zacznij w strefie z 10.000 lub większą ilością surowców."
|
||||||
"NEW_ACHIEVEMENT_21_23_NAME" "Zapłon"
|
"NEW_ACHIEVEMENT_21_23_NAME" "Zapłon"
|
||||||
"NEW_ACHIEVEMENT_21_23_DESC" "Aktywuj Reaktor Uderzeniowy."
|
"NEW_ACHIEVEMENT_21_23_DESC" "Aktywuj Reaktor Uderzeniowy."
|
||||||
|
"NEW_ACHIEVEMENT_21_24_NAME" "Przyspieszenie"
|
||||||
|
"NEW_ACHIEVEMENT_21_24_DESC" "Aktwuj Przyspiszacz Międzyplanetarny."
|
||||||
|
"NEW_ACHIEVEMENT_21_25_NAME" "Spirala"
|
||||||
|
"NEW_ACHIEVEMENT_21_25_DESC" "I się kręci i kręci..."
|
||||||
|
"NEW_ACHIEVEMENT_21_26_NAME" "Eskalacja"
|
||||||
|
"NEW_ACHIEVEMENT_21_26_DESC" "Zbuduj jednostkę poziomu 5."
|
||||||
|
"NEW_ACHIEVEMENT_21_27_NAME" "Architekt"
|
||||||
|
"NEW_ACHIEVEMENT_21_27_DESC" "Stwóż 20 schematów."
|
||||||
|
"NEW_ACHIEVEMENT_21_28_NAME" "Globalna Dominacja"
|
||||||
|
"NEW_ACHIEVEMENT_21_28_DESC" "Podbij każdy sektor na Serpulo."
|
||||||
|
"NEW_ACHIEVEMENT_21_29_NAME" "Most Lotniczy"
|
||||||
|
"NEW_ACHIEVEMENT_21_29_DESC" "Podnieś jednostkę poziomu 5 używając jednostki Oct."
|
||||||
|
"NEW_ACHIEVEMENT_21_30_NAME" "Ostateczna Forma"
|
||||||
|
"NEW_ACHIEVEMENT_21_30_DESC" "Dołącz do nich."
|
||||||
|
"NEW_ACHIEVEMENT_21_31_NAME" "Produkcja I"
|
||||||
|
"NEW_ACHIEVEMENT_21_31_DESC" "Osiągnij 5000 przedmiotów/minute w kampani."
|
||||||
|
"NEW_ACHIEVEMENT_26_0_NAME" "Production II"
|
||||||
|
"NEW_ACHIEVEMENT_26_0_DESC" "Osiągnij 50000 przedmiotów/minute w kampani."
|
||||||
|
"NEW_ACHIEVEMENT_26_1_NAME" "Pewne Zwycięstwo"
|
||||||
|
"NEW_ACHIEVEMENT_26_1_DESC" "Podbij sektor grając na innym sektorze."
|
||||||
|
"NEW_ACHIEVEMENT_26_2_NAME" "Małe Królestwo"
|
||||||
|
"NEW_ACHIEVEMENT_26_2_DESC" "Kontroluj 10 sektorów na raz."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=08d81cd26f74ea2e490c5ddc6e5a509f30f48368
|
archash=b35bc6c3431e51204335b9b9378451cc320df575
|
||||||
|
|||||||
@@ -53,15 +53,6 @@
|
|||||||
{
|
{
|
||||||
"address": "twsmindustry.24x7.hk:6568"
|
"address": "twsmindustry.24x7.hk:6568"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"address": "Chaotic-Neutral.ddns.net:1111"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"address": "Chaotic-Neutral.ddns.net:4444"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"address": "Chaotic-Neutral.ddns.net:3333"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"address": "mindustryranked.ddns.net"
|
"address": "mindustryranked.ddns.net"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
"address": ["md.surrealment.com"]
|
"address": ["md.surrealment.com"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "MindustryBR",
|
"name": "ALEX",
|
||||||
"address": ["mindustryptbr.ddns.net", "mindustryptbr.ddns.net:4444", "mindustryptbr.myddns.me:6666", "mindustryptbr.myddns.me:5555"]
|
"address": ["alexmindustry.ddns.net:6568", "alexmindustry.ddns.net:6569"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -429,3 +429,10 @@ task icongen(dependsOn: classes, type: JavaExec){
|
|||||||
standardInput = System.in
|
standardInput = System.in
|
||||||
workingDir = "../core/assets-raw"
|
workingDir = "../core/assets-raw"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task updateScripts(dependsOn: classes, type: JavaExec){
|
||||||
|
main = "mindustry.tools.ScriptMainGenerator"
|
||||||
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
|
standardInput = System.in
|
||||||
|
workingDir = "../"
|
||||||
|
}
|
||||||
@@ -38,7 +38,10 @@ public class ScriptMainGenerator{
|
|||||||
getClasses("arc.struct"),
|
getClasses("arc.struct"),
|
||||||
getClasses("arc.scene"),
|
getClasses("arc.scene"),
|
||||||
getClasses("arc.math"),
|
getClasses("arc.math"),
|
||||||
getClasses("arc.audio")
|
getClasses("arc.audio"),
|
||||||
|
getClasses("arc.input"),
|
||||||
|
getClasses("arc.util"),
|
||||||
|
getClasses("arc.struct")
|
||||||
);
|
);
|
||||||
classes.addAll(whitelist);
|
classes.addAll(whitelist);
|
||||||
classes.sort(Structs.comparing(Class::getName));
|
classes.sort(Structs.comparing(Class::getName));
|
||||||
|
|||||||
Reference in New Issue
Block a user