mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-24 06:38:10 +07:00
Fixed build error / Added per-type drone mine config
This commit is contained in:
@ -27,7 +27,7 @@ allprojects {
|
||||
gdxVersion = '1.9.8'
|
||||
roboVMVersion = '2.3.0'
|
||||
aiVersion = '1.8.1'
|
||||
uCoreVersion = 'b93d02efe3fdbe1a10b33d59597da8693d4f7de3'
|
||||
uCoreVersion = '3352bd2408'
|
||||
|
||||
getVersionString = {
|
||||
String buildVersion = getBuildVersion()
|
||||
|
@ -1,6 +1,7 @@
|
||||
package io.anuke.mindustry.content;
|
||||
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.ObjectSet;
|
||||
import io.anuke.mindustry.entities.units.UnitType;
|
||||
import io.anuke.mindustry.entities.units.types.*;
|
||||
import io.anuke.mindustry.game.Content;
|
||||
@ -69,6 +70,7 @@ public class UnitTypes implements ContentList{
|
||||
buildPower = 0.9f;
|
||||
minePower = 1.1f;
|
||||
healSpeed = 0.09f;
|
||||
toMine = ObjectSet.with(Items.lead, Items.tungsten, Items.titanium);
|
||||
}};
|
||||
}
|
||||
|
||||
|
@ -2,11 +2,14 @@ package io.anuke.mindustry.entities.units;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.ObjectSet;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.content.Weapons;
|
||||
import io.anuke.mindustry.entities.traits.TypeTrait;
|
||||
import io.anuke.mindustry.game.Content;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.game.UnlockableContent;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.type.Weapon;
|
||||
import io.anuke.mindustry.ui.ContentDisplay;
|
||||
import io.anuke.ucore.function.Supplier;
|
||||
@ -37,7 +40,7 @@ public class UnitType implements UnlockableContent{
|
||||
public float carryWeight = 1f;
|
||||
public int ammoCapacity = 100;
|
||||
public int itemCapacity = 30;
|
||||
public int mineLevel = 2;
|
||||
public ObjectSet<Item> toMine = ObjectSet.with(Items.lead, Items.tungsten);
|
||||
public float buildPower = 0.3f, minePower = 0.7f, healSpeed = 0.1f;
|
||||
public Weapon weapon = Weapons.blaster;
|
||||
public float weaponOffsetX, weaponOffsetY;
|
||||
|
@ -1,9 +1,7 @@
|
||||
package io.anuke.mindustry.entities.units.types;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.utils.ObjectSet;
|
||||
import com.badlogic.gdx.utils.Queue;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.content.blocks.Blocks;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
@ -41,7 +39,6 @@ import java.io.IOException;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class Drone extends FlyingUnit implements BuilderTrait{
|
||||
protected static ObjectSet<Item> toMine;
|
||||
protected static float discoverRange = 120f;
|
||||
protected static boolean initialized;
|
||||
|
||||
@ -77,7 +74,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{
|
||||
|
||||
//if it's missing requirements, try and mine them
|
||||
for(ItemStack stack : entity.recipe.requirements){
|
||||
if(!core.items.has(stack.item, stack.amount) && toMine.contains(stack.item)){
|
||||
if(!core.items.has(stack.item, stack.amount) && type.toMine.contains(stack.item)){
|
||||
targetItem = stack.item;
|
||||
getPlaceQueue().clear();
|
||||
setState(mine);
|
||||
@ -270,8 +267,6 @@ public class Drone extends FlyingUnit implements BuilderTrait{
|
||||
private static void initEvents(){
|
||||
if(initialized) return;
|
||||
|
||||
toMine = ObjectSet.with(Items.lead, Items.tungsten);
|
||||
|
||||
Events.on(BlockBuildEvent.class, (team, tile) -> {
|
||||
EntityGroup<BaseUnit> group = unitGroups[team.ordinal()];
|
||||
|
||||
@ -400,7 +395,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{
|
||||
if(entity == null){
|
||||
return;
|
||||
}
|
||||
targetItem = Mathf.findMin(toMine, (a, b) -> -Integer.compare(entity.items.get(a), entity.items.get(b)));
|
||||
targetItem = Mathf.findMin(type.toMine, (a, b) -> -Integer.compare(entity.items.get(a), entity.items.get(b)));
|
||||
}
|
||||
|
||||
protected boolean findItemDrop(){
|
||||
|
Reference in New Issue
Block a user