New base parts
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
mschxœE’}r›@ŵ|Ã.0ÉôÜ%ôÄÞºLlp×�4éiz47Cß[eÚa˜Z==ieËé�dóxñò°N>|ý¼ZÞð5†NúÃ2ž‡ƒŸ×0}ÛN^Úóôc›ŽÃmÙÂ!Ö¬ã<m—á°Ì¯þ} bòŽá}¸n—ë?yX¶Õi¯Ûùæ©=nÓ*ö3‹i®ì:ÌËÑKÿ¦ãÉÿ7íßFÔþçÆÃÊ.·å<†á:ÎþŒ`P¯4ÀH[xžf?œüìÃHqñÙ^dÄ+•ty&‰IÄH#VáDRIðò'9P#DeBIr àhšJ+&E‰0—!–¥˜‘Ò}�¦Éþgÿ@e&®Zj{˜<ºFdŠ\Q+…U81Ð2*tÀ‚’
|
||||
på¾ï¿ðþž¶L–ô.�¼ªb_#é~ß?ðÜ1ZiÃýY¢²’×Ë00FË…Þi␍`‡D#)WIƒ R‰›Š;¨iÅÈ)ZEGe£Ê†JÞªÜ •†V“QjUj¹"ç=¬•‰m¸Œ’óYšV�VEG"“øÛÁÃá)Ä•3¹xœRëZkµ®es�æ:ÍuzÙŽž”üct´fTKB4*Á�9•´ì×ÑÎI¯#õ:R¯#õ)—ä¢RXE+I-�ü¥r æ™ã!VðG§u
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
mschxś5Í[ŽĂ ĐkôĄiŐ5ô;‹B4EĘK„Tęî{]k>ĐÁćÚŕG�źÓ”qJµ•qĚőáź©Ś¸·ŇŇ\ö©–ů•ßKĹőݦőYZîך·␍±.{˶¦~[ö:dÜÖ9ďSječ+WxđŔÁ DŃ»hĄwçĐńU„°ęŕ-éY‹âŤŔő-č:Gtń:µ)„żh.2Ř8X˙¨Â˙oDt‚“EÎ˙�6ĎšT:ĂÁ�ĆA·\8÷ĹŢ`äŇ#`
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
mschxś-ÎMnÄ `ţŇÉbÔt5»ŠI\‰$# jŹ?~q�˘đ32Mt3äö´1}ţpĺž—TľVţć˝q¤Ř–Ô;W
|
||||
ő8á´ćÖk~žý¨tí|nIzćµćRčţ›$4ó_ŻiAbjGIu~ĄťMąó6·ă¬ŃC~dÉ€ąÎ‚SFĚ0Ŕ’A‰�X4 2�“2úp
|
||||
˛FD<"FĐçĺÚ8ÁéeŔÓ^łH^␍AG
|
||||
Ř âȸ°ŠSţkA‰ŕS«8Ĺ+A‰dÝČËŚŁ}Â)*o
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
mschxœ-Ík à)[‹¶úËSôPHI$¡mB©‰·w×5°ùL´¸70«_"ú=øZc™¼·è¶¾ãg+¸-1¼üš‚ÏÓ\RÎhÿA¸9íµ¤çQ)çR�Ë´oG ÀƒÐ#´¢ƒ¢EÐåïÄ£$¢8¢¡åAÃÐжÂIh…N8½à„‹p®5\ÄÆrƒ¡;K½êø¥%
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
mschxœMIƒ0—„"qhû�Üú¡,‰É8¢Ï¯ÓƒÇ£YlL˜®ÆÂ˜OåXÂÆ5¼G<®¨,�¿*1é!xi“%Wî–Ø¥9+—pMãY8}bÍ)îa•¼ïv°ÉÆA�‹-»æS%/�Ù7ÁÞƒŒáîoÂëƒÁr€ äm;s␍þ¦ë&Á÷.Œ›ø^±'�
|
||||
@@ -0,0 +1 @@
|
||||
mschxś=‘ n�0E›} !]U˝—čMśÄJ‘Ŕ¦ĆnŐŰ×Ă—Š@_~üç‘�Ţ)K(5jŃÔo«uzµ?Úł2ľ¦úf?}+ouóô¦űčlđÚQqłć&O�î:=>´ŃnŻ6›ť•WeôLů˘Í]3îˇGĎŰ˙o¶ŮŕnšŠ«ňqÓ_jý§v‹šÇ5,+}®$>‚„�!Iň*%!#Ţa«xóŰŚxÍśv"ˇK4%t =Lˇg\äH(1v=‡žŁ™Cϡ€ôÓKL/ˇWĐ+4+čô°†Ţ`z�é␍ôz‹f˝…ŢvĐ\ĚběÓĐ{č=š=ôúđ}ŔôÓ†9ťH”|XF'F‚žĎ�Ä+GAçxüt/ź”t‰#âąđ?1"¬čŤĹÜV9ť
|
||||
@@ -0,0 +1 @@
|
||||
mschxœ-‹Kƒ0D'Ÿ†Ð®Ú]Á™�E¬lB@D�_!ËcûÍÁÀWšŸ|�$N㺜,c]wè6Î3×Ï‹�‘L…êÄ‚×vHæao6âJB¥ÐA¿’ ׆…5ЊN‡[Uæaœúšñ-␍¾xۇo‚]þ¡&þ
|
||||
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
mschxœMŽan„ …Š®ºmMÿöŠètC‚`ºí‰{Š]:àŸ&ïñ˜=Þ¤Óázh·ª`öÝÒWiS‡Oa!Ìw)(úŽA/ѼzcÿÉyw”6Í¢Ö`¬å^)ÜHE'¾]¼¶j!ƒùL7Â{4Q;“6µx÷E?Ü¡>ñL{y¢œ_‰½ú̇±†“êØÈ–ðÁ…¶$ÊŽ†ˆ¶êj7CÃn‹6ÿŠŽõѳ!Ot-G+ĉæëoíÀè†.?ó£dò␍—Ì�œkr/‰Ô8N4@Ϩƒd41úSq± c%
|
||||
ÆÄÉ�M
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -26,6 +26,7 @@ public class BaseGenerator{
|
||||
private Tiles tiles;
|
||||
private Team team;
|
||||
private ObjectMap<Item, OreBlock> ores = new ObjectMap<>();
|
||||
private ObjectMap<Item, Floor> oreFloors = new ObjectMap<>();
|
||||
private Seq<Tile> cores;
|
||||
|
||||
public void generate(Tiles tiles, Seq<Tile> cores, Tile spawn, Team team, Sector sector){
|
||||
@@ -41,6 +42,8 @@ public class BaseGenerator{
|
||||
for(Block block : content.blocks()){
|
||||
if(block instanceof OreBlock && block.asFloor().itemDrop != null){
|
||||
ores.put(block.asFloor().itemDrop, (OreBlock)block);
|
||||
}else if(block.isFloor() && block.asFloor().itemDrop != null && !oreFloors.containsKey(block.asFloor().itemDrop)){
|
||||
oreFloors.put(block.asFloor().itemDrop, block.asFloor());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +76,8 @@ public class BaseGenerator{
|
||||
pass(tile -> {
|
||||
if(!tile.block().alwaysReplace) return;
|
||||
|
||||
if((tile.drop() != null || (tile.floor().liquidDrop != null && Mathf.chance(nonResourceChance * 2))) && Mathf.chance(resourceChance)){
|
||||
if(((tile.overlay().asFloor().itemDrop != null || (tile.drop() != null && Mathf.chance(nonResourceChance)))
|
||||
|| (tile.floor().liquidDrop != null && Mathf.chance(nonResourceChance * 2))) && Mathf.chance(resourceChance)){
|
||||
Seq<BasePart> parts = bases.forResource(tile.drop() != null ? tile.drop() : tile.floor().liquidDrop);
|
||||
if(!parts.isEmpty()){
|
||||
tryPlace(parts.random(), tile.x, tile.y);
|
||||
@@ -94,10 +98,6 @@ public class BaseGenerator{
|
||||
|
||||
//small walls
|
||||
pass(tile -> {
|
||||
//no walls around cores
|
||||
if(cores.contains(t -> t.within(tile, (3 + 4) * tilesize))){
|
||||
return;
|
||||
}
|
||||
|
||||
if(tile.block().alwaysReplace){
|
||||
boolean any = false;
|
||||
@@ -175,19 +175,20 @@ public class BaseGenerator{
|
||||
}
|
||||
|
||||
if(part.required instanceof Item){
|
||||
Item item = (Item)part.required;
|
||||
for(Stile tile : result.tiles){
|
||||
if(tile.block instanceof Drill){
|
||||
|
||||
tile.block.iterateTaken(tile.x + cx, tile.y + cy, (ex, ey) -> {
|
||||
|
||||
if(!tiles.getn(ex, ey).floor().isLiquid){
|
||||
tiles.getn(ex, ey).setOverlay(ores.get((Item)part.required));
|
||||
set(tiles.getn(ex, ey), item);
|
||||
}
|
||||
|
||||
Tile rand = tiles.getc(ex + Mathf.range(1), ey + Mathf.range(1));
|
||||
if(!rand.floor().isLiquid){
|
||||
//random ores nearby to make it look more natural
|
||||
rand.setOverlay(ores.get((Item)part.required));
|
||||
set(rand, item);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -196,9 +197,32 @@ public class BaseGenerator{
|
||||
|
||||
Schematics.place(result, cx + result.width/2, cy + result.height/2, team);
|
||||
|
||||
//fill drills with items after placing
|
||||
if(part.required instanceof Item){
|
||||
Item item = (Item)part.required;
|
||||
for(Stile tile : result.tiles){
|
||||
if(tile.block instanceof Drill){
|
||||
|
||||
Building build = world.tile(tile.x + cx, tile.y + cy).build;
|
||||
|
||||
if(build != null){
|
||||
build.items.add(item, build.block.itemCapacity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void set(Tile tile, Item item){
|
||||
if(ores.containsKey(item)){
|
||||
tile.setOverlay(ores.get(item));
|
||||
}else if(oreFloors.containsKey(item)){
|
||||
tile.setFloor(oreFloors.get(item));
|
||||
}
|
||||
}
|
||||
|
||||
boolean isTaken(Block block, int x, int y){
|
||||
int offsetx = -(block.size - 1) / 2;
|
||||
int offsety = -(block.size - 1) / 2;
|
||||
|
||||
@@ -326,7 +326,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{
|
||||
setOverlay(content.block(ore));
|
||||
}
|
||||
|
||||
public void setOverlay(Block block){
|
||||
public void setOverlay(@NonNull Block block){
|
||||
this.overlay = (Floor)block;
|
||||
|
||||
recache();
|
||||
|
||||
Reference in New Issue
Block a user