Merge
This commit is contained in:
@@ -342,67 +342,49 @@ no = No
|
|||||||
info.title = Info
|
info.title = Info
|
||||||
error.title = [crimson]An error has occured
|
error.title = [crimson]An error has occured
|
||||||
error.crashtitle = An error has occured
|
error.crashtitle = An error has occured
|
||||||
blocks.outputspeed = Drill Speed: {0}/s
|
blocks.input = Input
|
||||||
blocks.efficiency = Efficiency: {0}%
|
blocks.output = Output
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
blocks.booster = Booster
|
||||||
blocks.blockinfo = Block Info
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.powerbalance = Power: {0}
|
|
||||||
blocks.poweroutput = Power Output: {0}
|
|
||||||
blocks.powercapacity = Power Capacity
|
blocks.powercapacity = Power Capacity
|
||||||
blocks.powershot = Power/Shot
|
blocks.powershot = Power/Shot
|
||||||
blocks.targetsair = Targets Air
|
blocks.targetsair = Targets Air
|
||||||
blocks.targetsground = Targets Ground
|
blocks.targetsground = Targets Ground
|
||||||
blocks.items = Items: {0}
|
|
||||||
blocks.itemsmoved = Move Speed
|
blocks.itemsmoved = Move Speed
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = Range
|
blocks.shootrange = Range
|
||||||
blocks.size = Size
|
blocks.size = Size
|
||||||
blocks.liquidcapacity = Liquid Capacity
|
blocks.liquidcapacity = Liquid Capacity
|
||||||
blocks.maxitemssecond = Max Items
|
|
||||||
blocks.powerrange = Power Range
|
blocks.powerrange = Power Range
|
||||||
blocks.poweruse = Power Use
|
blocks.poweruse = Power Use
|
||||||
blocks.powerdamage = Power/Damage
|
blocks.powerdamage = Power/Damage
|
||||||
blocks.inputitemcapacity = Input Item Capacity
|
|
||||||
blocks.outputitemcapacity = Output Item Capacity
|
|
||||||
blocks.itemcapacity = Item Capacity
|
blocks.itemcapacity = Item Capacity
|
||||||
blocks.basepowergeneration = Base Power Generation
|
blocks.basepowergeneration = Base Power Generation
|
||||||
blocks.powertransferspeed = Power Transfer
|
blocks.productiontime = Production Time
|
||||||
blocks.craftspeed = Production Speed
|
|
||||||
blocks.repairtime = Block Full Repair Time
|
blocks.repairtime = Block Full Repair Time
|
||||||
|
blocks.speedincrease = Speed Increase
|
||||||
blocks.range = Range
|
blocks.range = Range
|
||||||
blocks.inputliquid = Input Liquid
|
|
||||||
blocks.inputliquidaux = Aux Liquid
|
|
||||||
blocks.inputitem = Input Item
|
|
||||||
blocks.inputitems = Input Items
|
|
||||||
blocks.outputitem = Output Item
|
|
||||||
blocks.drilltier = Drillables
|
blocks.drilltier = Drillables
|
||||||
blocks.drillspeed = Base Drill Speed
|
blocks.drillspeed = Base Drill Speed
|
||||||
|
blocks.boosteffect = Boost Effect
|
||||||
blocks.maxunits = Max Active Units
|
blocks.maxunits = Max Active Units
|
||||||
blocks.liquidoutput = Liquid Output
|
|
||||||
blocks.liquidoutputspeed = Liquid Output Speed
|
|
||||||
blocks.liquiduse = Liquid Use
|
|
||||||
blocks.coolant = Coolant
|
|
||||||
blocks.liquid = Liquid
|
|
||||||
blocks.coolantuse = Coolant Use
|
|
||||||
blocks.inputliquidfuel = Fuel Liquid
|
|
||||||
blocks.liquidfueluse = Liquid Fuel Use
|
|
||||||
blocks.boostitem = Boost Item
|
|
||||||
blocks.boostliquid = Boost Liquid
|
|
||||||
blocks.health = Health
|
blocks.health = Health
|
||||||
blocks.heat = Heat
|
|
||||||
blocks.power = Power
|
|
||||||
blocks.progress = Build Progress
|
|
||||||
blocks.spawned = Units: {0}/{1}
|
|
||||||
blocks.power.satisfaction = Power Satisfaction
|
|
||||||
blocks.inaccuracy = Inaccuracy
|
blocks.inaccuracy = Inaccuracy
|
||||||
blocks.shots = Shots
|
blocks.shots = Shots
|
||||||
blocks.reload = Shots/Second
|
blocks.reload = Shots/Second
|
||||||
blocks.inputfuel = Fuel
|
|
||||||
blocks.fuelburntime = Fuel Burn Time
|
|
||||||
blocks.inputcapacity = Input capacity
|
|
||||||
blocks.outputcapacity = Output capacity
|
|
||||||
blocks.ammo = Ammo
|
blocks.ammo = Ammo
|
||||||
|
|
||||||
|
bar.drillspeed = Drill Speed: {0}/s
|
||||||
|
bar.efficiency = Efficiency: {0}%
|
||||||
|
bar.powerbalance = Power: {0}
|
||||||
|
bar.poweroutput = Power Output: {0}
|
||||||
|
bar.items = Items: {0}
|
||||||
|
bar.liquid = Liquid
|
||||||
|
bar.heat = Heat
|
||||||
|
bar.power = Power
|
||||||
|
bar.progress = Build Progress
|
||||||
|
bar.spawned = Units: {0}/{1}
|
||||||
|
|
||||||
bullet.damage = [stat]{0}[lightgray] damage
|
bullet.damage = [stat]{0}[lightgray] damage
|
||||||
bullet.splashdamage = [stat]{0}[lightgray] area dmg ~[stat] {1}[lightgray] tiles
|
bullet.splashdamage = [stat]{0}[lightgray] area dmg ~[stat] {1}[lightgray] tiles
|
||||||
bullet.incendiary = [stat]incendiary
|
bullet.incendiary = [stat]incendiary
|
||||||
@@ -423,6 +405,9 @@ unit.liquidunits = liquid units
|
|||||||
unit.powerunits = power units
|
unit.powerunits = power units
|
||||||
unit.degrees = degrees
|
unit.degrees = degrees
|
||||||
unit.seconds = seconds
|
unit.seconds = seconds
|
||||||
|
unit.persecond = /sec
|
||||||
|
unit.timesspeed = x speed
|
||||||
|
unit.percent = %
|
||||||
unit.items = items
|
unit.items = items
|
||||||
category.general = General
|
category.general = General
|
||||||
category.power = Power
|
category.power = Power
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = Ne
|
|||||||
info.title = Informace
|
info.title = Informace
|
||||||
error.title = [crimson]Objevila se chyba
|
error.title = [crimson]Objevila se chyba
|
||||||
error.crashtitle = Objevila se chyba
|
error.crashtitle = Objevila se chyba
|
||||||
blocks.outputspeed = Drill Speed: {0}/s
|
bar.drillspeed = Drill Speed: {0}/s
|
||||||
blocks.efficiency = Efficiency: {0}%
|
bar.efficiency = Efficiency: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = Informace o bloku
|
blocks.blockinfo = Informace o bloku
|
||||||
blocks.powerbalance = Power: {0}
|
bar.powerbalance = Power: {0}
|
||||||
blocks.poweroutput = Power Output: {0}
|
bar.poweroutput = Power Output: {0}
|
||||||
blocks.powercapacity = Kapacita energie
|
blocks.powercapacity = Kapacita energie
|
||||||
blocks.powershot = Energie na výstřel
|
blocks.powershot = Energie na výstřel
|
||||||
blocks.targetsair = Zaměřuje vzdušné jednotky
|
blocks.targetsair = Zaměřuje vzdušné jednotky
|
||||||
blocks.targetsground = Targets Ground
|
blocks.targetsground = Targets Ground
|
||||||
blocks.items = Items: {0}
|
bar.items = Items: {0}
|
||||||
blocks.itemsmoved = Move Speed
|
blocks.itemsmoved = Move Speed
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = Dostřel
|
blocks.shootrange = Dostřel
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = Výstup tekutin
|
|||||||
blocks.liquidoutputspeed = Rychlost výstupu tekutin
|
blocks.liquidoutputspeed = Rychlost výstupu tekutin
|
||||||
blocks.liquiduse = Spotřebuje tekutin
|
blocks.liquiduse = Spotřebuje tekutin
|
||||||
blocks.coolant = Chlazení
|
blocks.coolant = Chlazení
|
||||||
blocks.liquid = Liquid
|
bar.liquid = Liquid
|
||||||
blocks.coolantuse = Spotřeba chlazení
|
blocks.coolantuse = Spotřeba chlazení
|
||||||
blocks.inputliquidfuel = Palivo-tekutina
|
blocks.inputliquidfuel = Palivo-tekutina
|
||||||
blocks.liquidfueluse = Spotřeba Paliva-tekutiny
|
blocks.liquidfueluse = Spotřeba Paliva-tekutiny
|
||||||
blocks.boostitem = Předmět pro zrychlení
|
blocks.boostitem = Předmět pro zrychlení
|
||||||
blocks.boostliquid = Tekutina pro zrychlení
|
blocks.boostliquid = Tekutina pro zrychlení
|
||||||
blocks.health = Životy
|
blocks.health = Životy
|
||||||
blocks.heat = Heat
|
bar.heat = Heat
|
||||||
blocks.power = Power
|
bar.power = Power
|
||||||
blocks.progress = Build Progress
|
bar.progress = Build Progress
|
||||||
blocks.spawned = Units: {0}/{1}
|
bar.spawned = Units: {0}/{1}
|
||||||
blocks.power.satisfaction = Power Satisfaction
|
blocks.power.satisfaction = Power Satisfaction
|
||||||
blocks.inaccuracy = Nepřesnost/výchylka
|
blocks.inaccuracy = Nepřesnost/výchylka
|
||||||
blocks.shots = Střely
|
blocks.shots = Střely
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = Nein
|
|||||||
info.title = [accent]Info
|
info.title = [accent]Info
|
||||||
error.title = [crimson] Ein Fehler ist aufgetreten
|
error.title = [crimson] Ein Fehler ist aufgetreten
|
||||||
error.crashtitle = Ein Fehler ist aufgetreten!
|
error.crashtitle = Ein Fehler ist aufgetreten!
|
||||||
blocks.outputspeed = Drill Speed: {0}/s
|
bar.drillspeed = Drill Speed: {0}/s
|
||||||
blocks.efficiency = Efficiency: {0}%
|
bar.efficiency = Efficiency: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = Blockinfo:
|
blocks.blockinfo = Blockinfo:
|
||||||
blocks.powerbalance = Power: {0}
|
bar.powerbalance = Power: {0}
|
||||||
blocks.poweroutput = Power Output: {0}
|
bar.poweroutput = Power Output: {0}
|
||||||
blocks.powercapacity = Kapazität
|
blocks.powercapacity = Kapazität
|
||||||
blocks.powershot = Stromverbrauch/Schuss
|
blocks.powershot = Stromverbrauch/Schuss
|
||||||
blocks.targetsair = Visiert Luft Einheiten an
|
blocks.targetsair = Visiert Luft Einheiten an
|
||||||
blocks.targetsground = Targets Ground
|
blocks.targetsground = Targets Ground
|
||||||
blocks.items = Items: {0}
|
bar.items = Items: {0}
|
||||||
blocks.itemsmoved = Move Speed
|
blocks.itemsmoved = Move Speed
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = Reichweite
|
blocks.shootrange = Reichweite
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = Erzeugte Flüssigkeit
|
|||||||
blocks.liquidoutputspeed = Ausgabegeschwindigkeit
|
blocks.liquidoutputspeed = Ausgabegeschwindigkeit
|
||||||
blocks.liquiduse = Flüssigkeitsverbrauch
|
blocks.liquiduse = Flüssigkeitsverbrauch
|
||||||
blocks.coolant = Kühlmittel
|
blocks.coolant = Kühlmittel
|
||||||
blocks.liquid = Liquid
|
bar.liquid = Liquid
|
||||||
blocks.coolantuse = Kühlmittelverbrauch
|
blocks.coolantuse = Kühlmittelverbrauch
|
||||||
blocks.inputliquidfuel = Kraftstoff
|
blocks.inputliquidfuel = Kraftstoff
|
||||||
blocks.liquidfueluse = Kraftstoffverbrauch
|
blocks.liquidfueluse = Kraftstoffverbrauch
|
||||||
blocks.boostitem = Boost Item
|
blocks.boostitem = Boost Item
|
||||||
blocks.boostliquid = Boost Liquid
|
blocks.boostliquid = Boost Liquid
|
||||||
blocks.health = Lebenspunkte
|
blocks.health = Lebenspunkte
|
||||||
blocks.heat = Heat
|
bar.heat = Heat
|
||||||
blocks.power = Power
|
bar.power = Power
|
||||||
blocks.progress = Build Progress
|
bar.progress = Build Progress
|
||||||
blocks.spawned = Units: {0}/{1}
|
bar.spawned = Units: {0}/{1}
|
||||||
blocks.power.satisfaction = Power Satisfaction
|
blocks.power.satisfaction = Power Satisfaction
|
||||||
blocks.inaccuracy = Ungenauigkeit
|
blocks.inaccuracy = Ungenauigkeit
|
||||||
blocks.shots = Schüsse
|
blocks.shots = Schüsse
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = No
|
|||||||
info.title = [accent]Información
|
info.title = [accent]Información
|
||||||
error.title = [crimson]Un error ha ocurrido.
|
error.title = [crimson]Un error ha ocurrido.
|
||||||
error.crashtitle = Un error ha ocurrido.
|
error.crashtitle = Un error ha ocurrido.
|
||||||
blocks.outputspeed = Drill Speed: {0}/s
|
bar.drillspeed = Drill Speed: {0}/s
|
||||||
blocks.efficiency = Efficiency: {0}%
|
bar.efficiency = Efficiency: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = Información del Bloque
|
blocks.blockinfo = Información del Bloque
|
||||||
blocks.powerbalance = Power: {0}
|
bar.powerbalance = Power: {0}
|
||||||
blocks.poweroutput = Power Output: {0}
|
bar.poweroutput = Power Output: {0}
|
||||||
blocks.powercapacity = Capacidad de Energía
|
blocks.powercapacity = Capacidad de Energía
|
||||||
blocks.powershot = Energía/Disparo
|
blocks.powershot = Energía/Disparo
|
||||||
blocks.targetsair = Apunta al Aire
|
blocks.targetsair = Apunta al Aire
|
||||||
blocks.targetsground = Targets Ground
|
blocks.targetsground = Targets Ground
|
||||||
blocks.items = Items: {0}
|
bar.items = Items: {0}
|
||||||
blocks.itemsmoved = Move Speed
|
blocks.itemsmoved = Move Speed
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = Rango
|
blocks.shootrange = Rango
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = Líquido de Salida
|
|||||||
blocks.liquidoutputspeed = Velocidad de Salida del Líquido
|
blocks.liquidoutputspeed = Velocidad de Salida del Líquido
|
||||||
blocks.liquiduse = Uso de Líquido
|
blocks.liquiduse = Uso de Líquido
|
||||||
blocks.coolant = Refrigerante
|
blocks.coolant = Refrigerante
|
||||||
blocks.liquid = Liquid
|
bar.liquid = Liquid
|
||||||
blocks.coolantuse = Uso del Refrigerante
|
blocks.coolantuse = Uso del Refrigerante
|
||||||
blocks.inputliquidfuel = Combustible Líquido
|
blocks.inputliquidfuel = Combustible Líquido
|
||||||
blocks.liquidfueluse = Uso del Combustible Líquido
|
blocks.liquidfueluse = Uso del Combustible Líquido
|
||||||
blocks.boostitem = Boost Item
|
blocks.boostitem = Boost Item
|
||||||
blocks.boostliquid = Boost Liquid
|
blocks.boostliquid = Boost Liquid
|
||||||
blocks.health = Vida
|
blocks.health = Vida
|
||||||
blocks.heat = Heat
|
bar.heat = Heat
|
||||||
blocks.power = Power
|
bar.power = Power
|
||||||
blocks.progress = Build Progress
|
bar.progress = Build Progress
|
||||||
blocks.spawned = Units: {0}/{1}
|
bar.spawned = Units: {0}/{1}
|
||||||
blocks.power.satisfaction = Power Satisfaction
|
blocks.power.satisfaction = Power Satisfaction
|
||||||
blocks.inaccuracy = Imprecisión
|
blocks.inaccuracy = Imprecisión
|
||||||
blocks.shots = Disparos
|
blocks.shots = Disparos
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = Non
|
|||||||
info.title = Info
|
info.title = Info
|
||||||
error.title = [crimson]Une erreur s'est produite
|
error.title = [crimson]Une erreur s'est produite
|
||||||
error.crashtitle = Une erreur s'est produite
|
error.crashtitle = Une erreur s'est produite
|
||||||
blocks.outputspeed = Drill Speed: {0}/s
|
bar.drillspeed = Drill Speed: {0}/s
|
||||||
blocks.efficiency = Efficiency: {0}%
|
bar.efficiency = Efficiency: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = Info sur le bloc
|
blocks.blockinfo = Info sur le bloc
|
||||||
blocks.powerbalance = Power: {0}
|
bar.powerbalance = Power: {0}
|
||||||
blocks.poweroutput = Power Output: {0}
|
bar.poweroutput = Power Output: {0}
|
||||||
blocks.powercapacity = capacité d'énergie
|
blocks.powercapacity = capacité d'énergie
|
||||||
blocks.powershot = Énergie/Tir
|
blocks.powershot = Énergie/Tir
|
||||||
blocks.targetsair = Cible les unités aériennes
|
blocks.targetsair = Cible les unités aériennes
|
||||||
blocks.targetsground = Targets Ground
|
blocks.targetsground = Targets Ground
|
||||||
blocks.items = Items: {0}
|
bar.items = Items: {0}
|
||||||
blocks.itemsmoved = Move Speed
|
blocks.itemsmoved = Move Speed
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = Portée
|
blocks.shootrange = Portée
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = Liquide en sortie
|
|||||||
blocks.liquidoutputspeed = Vitesse de production de liquide
|
blocks.liquidoutputspeed = Vitesse de production de liquide
|
||||||
blocks.liquiduse = Quantité de liquide utilisée
|
blocks.liquiduse = Quantité de liquide utilisée
|
||||||
blocks.coolant = Liquide de refroidissement
|
blocks.coolant = Liquide de refroidissement
|
||||||
blocks.liquid = Liquid
|
bar.liquid = Liquid
|
||||||
blocks.coolantuse = Quantité de liquide de refroidissement utilisée
|
blocks.coolantuse = Quantité de liquide de refroidissement utilisée
|
||||||
blocks.inputliquidfuel = Carburant liquide
|
blocks.inputliquidfuel = Carburant liquide
|
||||||
blocks.liquidfueluse = Quantité de carburant liquide utilisé
|
blocks.liquidfueluse = Quantité de carburant liquide utilisé
|
||||||
blocks.boostitem = Boost Item
|
blocks.boostitem = Boost Item
|
||||||
blocks.boostliquid = Boost Liquid
|
blocks.boostliquid = Boost Liquid
|
||||||
blocks.health = Santé
|
blocks.health = Santé
|
||||||
blocks.heat = Heat
|
bar.heat = Heat
|
||||||
blocks.power = Power
|
bar.power = Power
|
||||||
blocks.progress = Build Progress
|
bar.progress = Build Progress
|
||||||
blocks.spawned = Units: {0}/{1}
|
bar.spawned = Units: {0}/{1}
|
||||||
blocks.power.satisfaction = Power Satisfaction
|
blocks.power.satisfaction = Power Satisfaction
|
||||||
blocks.inaccuracy = Précision
|
blocks.inaccuracy = Précision
|
||||||
blocks.shots = Tir
|
blocks.shots = Tir
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = Non
|
|||||||
info.title = Info
|
info.title = Info
|
||||||
error.title = [crimson]Une erreur s'est produite
|
error.title = [crimson]Une erreur s'est produite
|
||||||
error.crashtitle = Une erreur s'est produite
|
error.crashtitle = Une erreur s'est produite
|
||||||
blocks.outputspeed = Drill Speed: {0}/s
|
bar.drillspeed = Drill Speed: {0}/s
|
||||||
blocks.efficiency = Efficiency: {0}%
|
bar.efficiency = Efficiency: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = Info sur le bloc
|
blocks.blockinfo = Info sur le bloc
|
||||||
blocks.powerbalance = Power: {0}
|
bar.powerbalance = Power: {0}
|
||||||
blocks.poweroutput = Power Output: {0}
|
bar.poweroutput = Power Output: {0}
|
||||||
blocks.powercapacity = Capacité d'énergie
|
blocks.powercapacity = Capacité d'énergie
|
||||||
blocks.powershot = Énergie/Tir
|
blocks.powershot = Énergie/Tir
|
||||||
blocks.targetsair = Cible les unités aériennes
|
blocks.targetsair = Cible les unités aériennes
|
||||||
blocks.targetsground = Targets Ground
|
blocks.targetsground = Targets Ground
|
||||||
blocks.items = Items: {0}
|
bar.items = Items: {0}
|
||||||
blocks.itemsmoved = Move Speed
|
blocks.itemsmoved = Move Speed
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = Portée
|
blocks.shootrange = Portée
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = Liquide en sortie
|
|||||||
blocks.liquidoutputspeed = Vitesse de sortie du liquide
|
blocks.liquidoutputspeed = Vitesse de sortie du liquide
|
||||||
blocks.liquiduse = Quantité de liquide utilisé
|
blocks.liquiduse = Quantité de liquide utilisé
|
||||||
blocks.coolant = Liquide de refroidissement
|
blocks.coolant = Liquide de refroidissement
|
||||||
blocks.liquid = Liquid
|
bar.liquid = Liquid
|
||||||
blocks.coolantuse = Quantité de liquide de refroidissement utilisé
|
blocks.coolantuse = Quantité de liquide de refroidissement utilisé
|
||||||
blocks.inputliquidfuel = Carburant liquide
|
blocks.inputliquidfuel = Carburant liquide
|
||||||
blocks.liquidfueluse = Quantité de carburant liquide utilisé
|
blocks.liquidfueluse = Quantité de carburant liquide utilisé
|
||||||
blocks.boostitem = Objet boostant la production
|
blocks.boostitem = Objet boostant la production
|
||||||
blocks.boostliquid = Liquide boostant la production
|
blocks.boostliquid = Liquide boostant la production
|
||||||
blocks.health = Santé
|
blocks.health = Santé
|
||||||
blocks.heat = Heat
|
bar.heat = Heat
|
||||||
blocks.power = Power
|
bar.power = Power
|
||||||
blocks.progress = Build Progress
|
bar.progress = Build Progress
|
||||||
blocks.spawned = Units: {0}/{1}
|
bar.spawned = Units: {0}/{1}
|
||||||
blocks.power.satisfaction = Power Satisfaction
|
blocks.power.satisfaction = Power Satisfaction
|
||||||
blocks.inaccuracy = Précision
|
blocks.inaccuracy = Précision
|
||||||
blocks.shots = Tirs
|
blocks.shots = Tirs
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = No
|
|||||||
info.title = [accent]Info
|
info.title = [accent]Info
|
||||||
error.title = [crimson]Telah terjadi kesalahan
|
error.title = [crimson]Telah terjadi kesalahan
|
||||||
error.crashtitle = Telah terjadi kesalahan
|
error.crashtitle = Telah terjadi kesalahan
|
||||||
blocks.outputspeed = Drill Speed: {0}/s
|
bar.drillspeed = Drill Speed: {0}/s
|
||||||
blocks.efficiency = Efficiency: {0}%
|
bar.efficiency = Efficiency: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = Info Blok
|
blocks.blockinfo = Info Blok
|
||||||
blocks.powerbalance = Power: {0}
|
bar.powerbalance = Power: {0}
|
||||||
blocks.poweroutput = Power Output: {0}
|
bar.poweroutput = Power Output: {0}
|
||||||
blocks.powercapacity = Kapasitas Tenaga
|
blocks.powercapacity = Kapasitas Tenaga
|
||||||
blocks.powershot = Tenaga/tembakan
|
blocks.powershot = Tenaga/tembakan
|
||||||
blocks.targetsair = Targets Air
|
blocks.targetsair = Targets Air
|
||||||
blocks.targetsground = Targets Ground
|
blocks.targetsground = Targets Ground
|
||||||
blocks.items = Items: {0}
|
bar.items = Items: {0}
|
||||||
blocks.itemsmoved = Move Speed
|
blocks.itemsmoved = Move Speed
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = Range
|
blocks.shootrange = Range
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = Liquid Output
|
|||||||
blocks.liquidoutputspeed = Liquid Output Speed
|
blocks.liquidoutputspeed = Liquid Output Speed
|
||||||
blocks.liquiduse = Liquid Use
|
blocks.liquiduse = Liquid Use
|
||||||
blocks.coolant = Coolant
|
blocks.coolant = Coolant
|
||||||
blocks.liquid = Liquid
|
bar.liquid = Liquid
|
||||||
blocks.coolantuse = Coolant Use
|
blocks.coolantuse = Coolant Use
|
||||||
blocks.inputliquidfuel = Fuel Liquid
|
blocks.inputliquidfuel = Fuel Liquid
|
||||||
blocks.liquidfueluse = Liquid Fuel Use
|
blocks.liquidfueluse = Liquid Fuel Use
|
||||||
blocks.boostitem = Boost Item
|
blocks.boostitem = Boost Item
|
||||||
blocks.boostliquid = Boost Liquid
|
blocks.boostliquid = Boost Liquid
|
||||||
blocks.health = Darah
|
blocks.health = Darah
|
||||||
blocks.heat = Heat
|
bar.heat = Heat
|
||||||
blocks.power = Power
|
bar.power = Power
|
||||||
blocks.progress = Build Progress
|
bar.progress = Build Progress
|
||||||
blocks.spawned = Units: {0}/{1}
|
bar.spawned = Units: {0}/{1}
|
||||||
blocks.power.satisfaction = Power Satisfaction
|
blocks.power.satisfaction = Power Satisfaction
|
||||||
blocks.inaccuracy = Ketidaktelitian
|
blocks.inaccuracy = Ketidaktelitian
|
||||||
blocks.shots = Tembakan
|
blocks.shots = Tembakan
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = No
|
|||||||
info.title = [accent] Info
|
info.title = [accent] Info
|
||||||
error.title = [crimson]Si è verificato un errore
|
error.title = [crimson]Si è verificato un errore
|
||||||
error.crashtitle = Si è verificato un errore
|
error.crashtitle = Si è verificato un errore
|
||||||
blocks.outputspeed = Drill Speed: {0}/s
|
bar.drillspeed = Drill Speed: {0}/s
|
||||||
blocks.efficiency = Efficiency: {0}%
|
bar.efficiency = Efficiency: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = info sul blocco
|
blocks.blockinfo = info sul blocco
|
||||||
blocks.powerbalance = Power: {0}
|
bar.powerbalance = Power: {0}
|
||||||
blocks.poweroutput = Power Output: {0}
|
bar.poweroutput = Power Output: {0}
|
||||||
blocks.powercapacity = Capacità Energetica
|
blocks.powercapacity = Capacità Energetica
|
||||||
blocks.powershot = Danno/Colpo
|
blocks.powershot = Danno/Colpo
|
||||||
blocks.targetsair = Attacca nemici aerei
|
blocks.targetsair = Attacca nemici aerei
|
||||||
blocks.targetsground = Targets Ground
|
blocks.targetsground = Targets Ground
|
||||||
blocks.items = Items: {0}
|
bar.items = Items: {0}
|
||||||
blocks.itemsmoved = Move Speed
|
blocks.itemsmoved = Move Speed
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = Raggio
|
blocks.shootrange = Raggio
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = Uscita liquidi
|
|||||||
blocks.liquidoutputspeed = Liquid Output Speed
|
blocks.liquidoutputspeed = Liquid Output Speed
|
||||||
blocks.liquiduse = Uso liquidi
|
blocks.liquiduse = Uso liquidi
|
||||||
blocks.coolant = Refrigerante
|
blocks.coolant = Refrigerante
|
||||||
blocks.liquid = Liquid
|
bar.liquid = Liquid
|
||||||
blocks.coolantuse = uso refrigerante
|
blocks.coolantuse = uso refrigerante
|
||||||
blocks.inputliquidfuel = carburante liquido
|
blocks.inputliquidfuel = carburante liquido
|
||||||
blocks.liquidfueluse = Utilizzo carburante liquido
|
blocks.liquidfueluse = Utilizzo carburante liquido
|
||||||
blocks.boostitem = Boost Item
|
blocks.boostitem = Boost Item
|
||||||
blocks.boostliquid = Boost Liquid
|
blocks.boostliquid = Boost Liquid
|
||||||
blocks.health = Salute
|
blocks.health = Salute
|
||||||
blocks.heat = Heat
|
bar.heat = Heat
|
||||||
blocks.power = Power
|
bar.power = Power
|
||||||
blocks.progress = Build Progress
|
bar.progress = Build Progress
|
||||||
blocks.spawned = Units: {0}/{1}
|
bar.spawned = Units: {0}/{1}
|
||||||
blocks.power.satisfaction = Power Satisfaction
|
blocks.power.satisfaction = Power Satisfaction
|
||||||
blocks.inaccuracy = Inaccuratezza
|
blocks.inaccuracy = Inaccuratezza
|
||||||
blocks.shots = Colpi
|
blocks.shots = Colpi
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = いいえ
|
|||||||
info.title = 情報
|
info.title = 情報
|
||||||
error.title = [crimson]エラーが発生しました
|
error.title = [crimson]エラーが発生しました
|
||||||
error.crashtitle = エラーが発生しました
|
error.crashtitle = エラーが発生しました
|
||||||
blocks.outputspeed = 採掘速度: {0}/秒
|
bar.drillspeed = 採掘速度: {0}/秒
|
||||||
blocks.efficiency = 効率: {0}%
|
bar.efficiency = 効率: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = ブロック情報
|
blocks.blockinfo = ブロック情報
|
||||||
blocks.powerbalance = 電力: {0}
|
bar.powerbalance = 電力: {0}
|
||||||
blocks.poweroutput = 電力発電量: {0}
|
bar.poweroutput = 電力発電量: {0}
|
||||||
blocks.powercapacity = 電力容量
|
blocks.powercapacity = 電力容量
|
||||||
blocks.powershot = 電力/ショット
|
blocks.powershot = 電力/ショット
|
||||||
blocks.targetsair = 対空攻撃
|
blocks.targetsair = 対空攻撃
|
||||||
blocks.targetsground = 対地攻撃
|
blocks.targetsground = 対地攻撃
|
||||||
blocks.items = アイテム: {0}
|
bar.items = アイテム: {0}
|
||||||
blocks.itemsmoved = 輸送速度
|
blocks.itemsmoved = 輸送速度
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = 範囲
|
blocks.shootrange = 範囲
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = 搬出液体
|
|||||||
blocks.liquidoutputspeed = 液体搬出速度
|
blocks.liquidoutputspeed = 液体搬出速度
|
||||||
blocks.liquiduse = 液体使用量
|
blocks.liquiduse = 液体使用量
|
||||||
blocks.coolant = 冷却
|
blocks.coolant = 冷却
|
||||||
blocks.liquid = 液体
|
bar.liquid = 液体
|
||||||
blocks.coolantuse = 冷却使用量
|
blocks.coolantuse = 冷却使用量
|
||||||
blocks.inputliquidfuel = 液体燃料
|
blocks.inputliquidfuel = 液体燃料
|
||||||
blocks.liquidfueluse = 液体燃料使用量
|
blocks.liquidfueluse = 液体燃料使用量
|
||||||
blocks.boostitem = 加速アイテム
|
blocks.boostitem = 加速アイテム
|
||||||
blocks.boostliquid = 加速液体
|
blocks.boostliquid = 加速液体
|
||||||
blocks.health = 耐久値
|
blocks.health = 耐久値
|
||||||
blocks.heat = 熱
|
bar.heat = 熱
|
||||||
blocks.power = 電力
|
bar.power = 電力
|
||||||
blocks.progress = 建設状況
|
bar.progress = 建設状況
|
||||||
blocks.spawned = ユニット数: {0}/{1}
|
bar.spawned = ユニット数: {0}/{1}
|
||||||
blocks.power.satisfaction = 電力需要
|
blocks.power.satisfaction = 電力需要
|
||||||
blocks.inaccuracy = 精度のずれ
|
blocks.inaccuracy = 精度のずれ
|
||||||
blocks.shots = ショット
|
blocks.shots = ショット
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = 아니오
|
|||||||
info.title = [accent]정보
|
info.title = [accent]정보
|
||||||
error.title = [crimson]오류가 발생했습니다.
|
error.title = [crimson]오류가 발생했습니다.
|
||||||
error.crashtitle = 오류가 발생했습니다.
|
error.crashtitle = 오류가 발생했습니다.
|
||||||
blocks.outputspeed = 채광 속도: {0}/s
|
bar.outputspeed = 채광 속도: {0}/s
|
||||||
blocks.efficiency = 효율성: {0}%
|
bar.efficiency = 효율성: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = 블록 정보
|
blocks.blockinfo = 블록 정보
|
||||||
blocks.powerbalance = 전력: {0}
|
bar.powerbalance = 전력: {0}
|
||||||
blocks.poweroutput = 전력 출력: {0}
|
bar.poweroutput = 전력 출력: {0}
|
||||||
blocks.powercapacity = 전력 용량
|
blocks.powercapacity = 전력 용량
|
||||||
blocks.powershot = 1발당 전력 소모량
|
blocks.powershot = 1발당 전력 소모량
|
||||||
blocks.targetsair = 공중공격 가능
|
blocks.targetsair = 공중공격 가능
|
||||||
blocks.targetsground = 지상공격 가능
|
blocks.targetsground = 지상공격 가능
|
||||||
blocks.items = Items: {0}
|
bar.items = Items: {0}
|
||||||
blocks.itemsmoved = 이동 속도
|
blocks.itemsmoved = 이동 속도
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = 사거리
|
blocks.shootrange = 사거리
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = 액체 출력
|
|||||||
blocks.liquidoutputspeed = 액체 출력속도
|
blocks.liquidoutputspeed = 액체 출력속도
|
||||||
blocks.liquiduse = 액체 사용량
|
blocks.liquiduse = 액체 사용량
|
||||||
blocks.coolant = 냉각제
|
blocks.coolant = 냉각제
|
||||||
blocks.liquid = 액체
|
bar.liquid = 액체
|
||||||
blocks.coolantuse = 냉각제 사용
|
blocks.coolantuse = 냉각제 사용
|
||||||
blocks.inputliquidfuel = 연료 액
|
blocks.inputliquidfuel = 연료 액
|
||||||
blocks.liquidfueluse = 액체 연료 사용
|
blocks.liquidfueluse = 액체 연료 사용
|
||||||
blocks.boostitem = 가속 아이템
|
blocks.boostitem = 가속 아이템
|
||||||
blocks.boostliquid = 가속 액체
|
blocks.boostliquid = 가속 액체
|
||||||
blocks.health = 체력
|
blocks.health = 체력
|
||||||
blocks.heat = 발열
|
bar.heat = 발열
|
||||||
blocks.power = 전력
|
bar.power = 전력
|
||||||
blocks.progress = 건설 진행
|
bar.progress = 건설 진행
|
||||||
blocks.spawned = 유닛: {0}/{1}
|
bar.spawned = 유닛: {0}/{1}
|
||||||
blocks.power.satisfaction = 전력 만족도
|
blocks.power.satisfaction = 전력 만족도
|
||||||
blocks.inaccuracy = 오차각
|
blocks.inaccuracy = 오차각
|
||||||
blocks.shots = 발포 횟수
|
blocks.shots = 발포 횟수
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = No
|
|||||||
info.title = Info
|
info.title = Info
|
||||||
error.title = [crimson]An error has occured
|
error.title = [crimson]An error has occured
|
||||||
error.crashtitle = An error has occured
|
error.crashtitle = An error has occured
|
||||||
blocks.outputspeed = Drill Speed: {0}/s
|
bar.drillspeed = Drill Speed: {0}/s
|
||||||
blocks.efficiency = Efficiency: {0}%
|
bar.efficiency = Efficiency: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = Block Info
|
blocks.blockinfo = Block Info
|
||||||
blocks.powerbalance = Power: {0}
|
bar.powerbalance = Power: {0}
|
||||||
blocks.poweroutput = Power Output: {0}
|
bar.poweroutput = Power Output: {0}
|
||||||
blocks.powercapacity = Power Capacity
|
blocks.powercapacity = Power Capacity
|
||||||
blocks.powershot = Power/Shot
|
blocks.powershot = Power/Shot
|
||||||
blocks.targetsair = Targets Air
|
blocks.targetsair = Targets Air
|
||||||
blocks.targetsground = Targets Ground
|
blocks.targetsground = Targets Ground
|
||||||
blocks.items = Items: {0}
|
bar.items = Items: {0}
|
||||||
blocks.itemsmoved = Move Speed
|
blocks.itemsmoved = Move Speed
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = Range
|
blocks.shootrange = Range
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = Liquid Output
|
|||||||
blocks.liquidoutputspeed = Liquid Output Speed
|
blocks.liquidoutputspeed = Liquid Output Speed
|
||||||
blocks.liquiduse = Liquid Use
|
blocks.liquiduse = Liquid Use
|
||||||
blocks.coolant = Coolant
|
blocks.coolant = Coolant
|
||||||
blocks.liquid = Liquid
|
bar.liquid = Liquid
|
||||||
blocks.coolantuse = Coolant Use
|
blocks.coolantuse = Coolant Use
|
||||||
blocks.inputliquidfuel = Fuel Liquid
|
blocks.inputliquidfuel = Fuel Liquid
|
||||||
blocks.liquidfueluse = Liquid Fuel Use
|
blocks.liquidfueluse = Liquid Fuel Use
|
||||||
blocks.boostitem = Boost Item
|
blocks.boostitem = Boost Item
|
||||||
blocks.boostliquid = Boost Liquid
|
blocks.boostliquid = Boost Liquid
|
||||||
blocks.health = Health
|
blocks.health = Health
|
||||||
blocks.heat = Heat
|
bar.heat = Heat
|
||||||
blocks.power = Power
|
bar.power = Power
|
||||||
blocks.progress = Build Progress
|
bar.progress = Build Progress
|
||||||
blocks.spawned = Units: {0}/{1}
|
bar.spawned = Units: {0}/{1}
|
||||||
blocks.power.satisfaction = Power Satisfaction
|
blocks.power.satisfaction = Power Satisfaction
|
||||||
blocks.inaccuracy = Inaccuracy
|
blocks.inaccuracy = Inaccuracy
|
||||||
blocks.shots = Shots
|
blocks.shots = Shots
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = Nie ma mowy!
|
|||||||
info.title = [accent]Informacje
|
info.title = [accent]Informacje
|
||||||
error.title = [crimson]Wystąpił błąd
|
error.title = [crimson]Wystąpił błąd
|
||||||
error.crashtitle = Wystąpił błąd
|
error.crashtitle = Wystąpił błąd
|
||||||
blocks.outputspeed = Drill Speed: {0}/s
|
bar.drillspeed = Drill Speed: {0}/s
|
||||||
blocks.efficiency = Efficiency: {0}%
|
bar.efficiency = Efficiency: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = Informacje o bloku
|
blocks.blockinfo = Informacje o bloku
|
||||||
blocks.powerbalance = Power: {0}
|
bar.powerbalance = Power: {0}
|
||||||
blocks.poweroutput = Power Output: {0}
|
bar.poweroutput = Power Output: {0}
|
||||||
blocks.powercapacity = Pojemność mocy
|
blocks.powercapacity = Pojemność mocy
|
||||||
blocks.powershot = moc/strzał
|
blocks.powershot = moc/strzał
|
||||||
blocks.targetsair = Może namierzać wrogów powietrznych
|
blocks.targetsair = Może namierzać wrogów powietrznych
|
||||||
blocks.targetsground = Targets Ground
|
blocks.targetsground = Targets Ground
|
||||||
blocks.items = Items: {0}
|
bar.items = Items: {0}
|
||||||
blocks.itemsmoved = Move Speed
|
blocks.itemsmoved = Move Speed
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = Zasięg
|
blocks.shootrange = Zasięg
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = Wyprodukowany płyn
|
|||||||
blocks.liquidoutputspeed = Prędkość odpływu cieczy
|
blocks.liquidoutputspeed = Prędkość odpływu cieczy
|
||||||
blocks.liquiduse = Zużycie płynów
|
blocks.liquiduse = Zużycie płynów
|
||||||
blocks.coolant = Płyn chłodzący
|
blocks.coolant = Płyn chłodzący
|
||||||
blocks.liquid = Płyn
|
bar.liquid = Płyn
|
||||||
blocks.coolantuse = Zużycie płynu chłodzącego
|
blocks.coolantuse = Zużycie płynu chłodzącego
|
||||||
blocks.inputliquidfuel = Paliwo
|
blocks.inputliquidfuel = Paliwo
|
||||||
blocks.liquidfueluse = Zużycie paliwa
|
blocks.liquidfueluse = Zużycie paliwa
|
||||||
blocks.boostitem = Boost Item
|
blocks.boostitem = Boost Item
|
||||||
blocks.boostliquid = Boost Liquid
|
blocks.boostliquid = Boost Liquid
|
||||||
blocks.health = Zdrowie
|
blocks.health = Zdrowie
|
||||||
blocks.heat = Heat
|
bar.heat = Heat
|
||||||
blocks.power = Prąd
|
bar.power = Prąd
|
||||||
blocks.progress = Build Progress
|
bar.progress = Build Progress
|
||||||
blocks.spawned = Units: {0}/{1}
|
bar.spawned = Units: {0}/{1}
|
||||||
blocks.power.satisfaction = Zapotrzebowanie Prądu
|
blocks.power.satisfaction = Zapotrzebowanie Prądu
|
||||||
blocks.inaccuracy = Niedokładność
|
blocks.inaccuracy = Niedokładność
|
||||||
blocks.shots = Strzały
|
blocks.shots = Strzały
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = Não
|
|||||||
info.title = [accent]Informação
|
info.title = [accent]Informação
|
||||||
error.title = [crimson]Ocorreu um Erro.
|
error.title = [crimson]Ocorreu um Erro.
|
||||||
error.crashtitle = Ocorreu um Erro
|
error.crashtitle = Ocorreu um Erro
|
||||||
blocks.outputspeed = Drill Speed: {0}/s
|
bar.drillspeed = Drill Speed: {0}/s
|
||||||
blocks.efficiency = Efficiency: {0}%
|
bar.efficiency = Efficiency: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = Informação do Bloco
|
blocks.blockinfo = Informação do Bloco
|
||||||
blocks.powerbalance = Power: {0}
|
bar.powerbalance = Power: {0}
|
||||||
blocks.poweroutput = Power Output: {0}
|
bar.poweroutput = Power Output: {0}
|
||||||
blocks.powercapacity = Capacidade de Energia
|
blocks.powercapacity = Capacidade de Energia
|
||||||
blocks.powershot = Energia/tiro
|
blocks.powershot = Energia/tiro
|
||||||
blocks.targetsair = Mirar no ar
|
blocks.targetsair = Mirar no ar
|
||||||
blocks.targetsground = Targets Ground
|
blocks.targetsground = Targets Ground
|
||||||
blocks.items = Items: {0}
|
bar.items = Items: {0}
|
||||||
blocks.itemsmoved = Move Speed
|
blocks.itemsmoved = Move Speed
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = Alcance
|
blocks.shootrange = Alcance
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = Saida de liquido
|
|||||||
blocks.liquidoutputspeed = Velocidade da saida de líquido
|
blocks.liquidoutputspeed = Velocidade da saida de líquido
|
||||||
blocks.liquiduse = Uso de liquido
|
blocks.liquiduse = Uso de liquido
|
||||||
blocks.coolant = Esfriador
|
blocks.coolant = Esfriador
|
||||||
blocks.liquid = Liquid
|
bar.liquid = Liquid
|
||||||
blocks.coolantuse = Uso do esfriador
|
blocks.coolantuse = Uso do esfriador
|
||||||
blocks.inputliquidfuel = Liquido de combustivel
|
blocks.inputliquidfuel = Liquido de combustivel
|
||||||
blocks.liquidfueluse = Uso do liquido de combustivel
|
blocks.liquidfueluse = Uso do liquido de combustivel
|
||||||
blocks.boostitem = Acelerar item
|
blocks.boostitem = Acelerar item
|
||||||
blocks.boostliquid = Acelerar líquido
|
blocks.boostliquid = Acelerar líquido
|
||||||
blocks.health = Saúde
|
blocks.health = Saúde
|
||||||
blocks.heat = Heat
|
bar.heat = Heat
|
||||||
blocks.power = Poder
|
bar.power = Poder
|
||||||
blocks.progress = Build Progress
|
bar.progress = Build Progress
|
||||||
blocks.spawned = Units: {0}/{1}
|
bar.spawned = Units: {0}/{1}
|
||||||
blocks.power.satisfaction = Power Satisfaction
|
blocks.power.satisfaction = Power Satisfaction
|
||||||
blocks.inaccuracy = Imprecisão
|
blocks.inaccuracy = Imprecisão
|
||||||
blocks.shots = Tiros
|
blocks.shots = Tiros
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = Нет
|
|||||||
info.title = Информация
|
info.title = Информация
|
||||||
error.title = [crimson]Произошла ошибка
|
error.title = [crimson]Произошла ошибка
|
||||||
error.crashtitle = Произошла ошибка
|
error.crashtitle = Произошла ошибка
|
||||||
blocks.outputspeed = Скорость сверления: {0}/с
|
bar.drillspeed = Скорость сверления: {0}/с
|
||||||
blocks.efficiency = Эффективность: {0}%
|
bar.efficiency = Эффективность: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = Информация о блоке
|
blocks.blockinfo = Информация о блоке
|
||||||
blocks.powerbalance = Энергия: {0}
|
bar.powerbalance = Энергия: {0}
|
||||||
blocks.poweroutput = Выходная энергия: {0}
|
bar.poweroutput = Выходная энергия: {0}
|
||||||
blocks.powercapacity = Вместимость энергии
|
blocks.powercapacity = Вместимость энергии
|
||||||
blocks.powershot = Энергия/выстрел
|
blocks.powershot = Энергия/выстрел
|
||||||
blocks.targetsair = Воздушные цели
|
blocks.targetsair = Воздушные цели
|
||||||
blocks.targetsground = Наземные цели
|
blocks.targetsground = Наземные цели
|
||||||
blocks.items = Предметы: {0}
|
bar.items = Предметы: {0}
|
||||||
blocks.itemsmoved = Скорость перемещения
|
blocks.itemsmoved = Скорость перемещения
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = Радиус действия
|
blocks.shootrange = Радиус действия
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = Выходящая жидкость
|
|||||||
blocks.liquidoutputspeed = Выходная скорость жидкости
|
blocks.liquidoutputspeed = Выходная скорость жидкости
|
||||||
blocks.liquiduse = Используется жидкости
|
blocks.liquiduse = Используется жидкости
|
||||||
blocks.coolant = Охлаждающая жидкость
|
blocks.coolant = Охлаждающая жидкость
|
||||||
blocks.liquid = Жидкость
|
bar.liquid = Жидкость
|
||||||
blocks.coolantuse = Охлажд. жидкости используется
|
blocks.coolantuse = Охлажд. жидкости используется
|
||||||
blocks.inputliquidfuel = Жидкое топливо
|
blocks.inputliquidfuel = Жидкое топливо
|
||||||
blocks.liquidfueluse = Жидкого топлива используется
|
blocks.liquidfueluse = Жидкого топлива используется
|
||||||
blocks.boostitem = Ускоряющий предмет
|
blocks.boostitem = Ускоряющий предмет
|
||||||
blocks.boostliquid = Ускоряющая жидкость
|
blocks.boostliquid = Ускоряющая жидкость
|
||||||
blocks.health = Здоровье
|
blocks.health = Здоровье
|
||||||
blocks.heat = Температура
|
bar.heat = Температура
|
||||||
blocks.power = Энергия
|
bar.power = Энергия
|
||||||
blocks.progress = Строительство продолжается
|
bar.progress = Строительство продолжается
|
||||||
blocks.spawned = Бой. ед.: {0}/{1}
|
bar.spawned = Бой. ед.: {0}/{1}
|
||||||
blocks.power.satisfaction = Энергия
|
blocks.power.satisfaction = Энергия
|
||||||
blocks.inaccuracy = Разброс
|
blocks.inaccuracy = Разброс
|
||||||
blocks.shots = Выстрелы
|
blocks.shots = Выстрелы
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = Hayir
|
|||||||
info.title = [accent]Bilgi
|
info.title = [accent]Bilgi
|
||||||
error.title = [crimson]Bir hata olustu
|
error.title = [crimson]Bir hata olustu
|
||||||
error.crashtitle = Bir hata olustu
|
error.crashtitle = Bir hata olustu
|
||||||
blocks.outputspeed = Drill Speed: {0}/s
|
bar.drillspeed = Drill Speed: {0}/s
|
||||||
blocks.efficiency = Efficiency: {0}%
|
bar.efficiency = Efficiency: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = Yapi bilgisi
|
blocks.blockinfo = Yapi bilgisi
|
||||||
blocks.powerbalance = Power: {0}
|
bar.powerbalance = Power: {0}
|
||||||
blocks.poweroutput = Power Output: {0}
|
bar.poweroutput = Power Output: {0}
|
||||||
blocks.powercapacity = Guc kapasitesi
|
blocks.powercapacity = Guc kapasitesi
|
||||||
blocks.powershot = Guc/Saldiri hizi
|
blocks.powershot = Guc/Saldiri hizi
|
||||||
blocks.targetsair = Havayi hedef alir mi?
|
blocks.targetsair = Havayi hedef alir mi?
|
||||||
blocks.targetsground = Targets Ground
|
blocks.targetsground = Targets Ground
|
||||||
blocks.items = Items: {0}
|
bar.items = Items: {0}
|
||||||
blocks.itemsmoved = Move Speed
|
blocks.itemsmoved = Move Speed
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = Menzil
|
blocks.shootrange = Menzil
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = Sivi cikisi
|
|||||||
blocks.liquidoutputspeed = Liquid Output Speed
|
blocks.liquidoutputspeed = Liquid Output Speed
|
||||||
blocks.liquiduse = Sivi kullanimi
|
blocks.liquiduse = Sivi kullanimi
|
||||||
blocks.coolant = Sogutma sivisi
|
blocks.coolant = Sogutma sivisi
|
||||||
blocks.liquid = Liquid
|
bar.liquid = Liquid
|
||||||
blocks.coolantuse = Sogutma sivi kullanimi
|
blocks.coolantuse = Sogutma sivi kullanimi
|
||||||
blocks.inputliquidfuel = Yakit sivisi
|
blocks.inputliquidfuel = Yakit sivisi
|
||||||
blocks.liquidfueluse = Sivi yakit kullanimi
|
blocks.liquidfueluse = Sivi yakit kullanimi
|
||||||
blocks.boostitem = Boost Item
|
blocks.boostitem = Boost Item
|
||||||
blocks.boostliquid = Boost Liquid
|
blocks.boostliquid = Boost Liquid
|
||||||
blocks.health = Can
|
blocks.health = Can
|
||||||
blocks.heat = Heat
|
bar.heat = Heat
|
||||||
blocks.power = Power
|
bar.power = Power
|
||||||
blocks.progress = Build Progress
|
bar.progress = Build Progress
|
||||||
blocks.spawned = Units: {0}/{1}
|
bar.spawned = Units: {0}/{1}
|
||||||
blocks.power.satisfaction = Power Satisfaction
|
blocks.power.satisfaction = Power Satisfaction
|
||||||
blocks.inaccuracy = sekme
|
blocks.inaccuracy = sekme
|
||||||
blocks.shots = vuruslar
|
blocks.shots = vuruslar
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = No
|
|||||||
info.title = [Vurgu] Bilgi
|
info.title = [Vurgu] Bilgi
|
||||||
error.title = [crimson] Bir hata oluştu
|
error.title = [crimson] Bir hata oluştu
|
||||||
error.crashtitle = Bir hata oluştu
|
error.crashtitle = Bir hata oluştu
|
||||||
blocks.outputspeed = Drill Speed: {0}/s
|
bar.drillspeed = Drill Speed: {0}/s
|
||||||
blocks.efficiency = Efficiency: {0}%
|
bar.efficiency = Efficiency: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = Blok Bilgisi
|
blocks.blockinfo = Blok Bilgisi
|
||||||
blocks.powerbalance = Power: {0}
|
bar.powerbalance = Power: {0}
|
||||||
blocks.poweroutput = Power Output: {0}
|
bar.poweroutput = Power Output: {0}
|
||||||
blocks.powercapacity = Güç kapasitesi
|
blocks.powercapacity = Güç kapasitesi
|
||||||
blocks.powershot = Güç / atış
|
blocks.powershot = Güç / atış
|
||||||
blocks.targetsair = Targets Air
|
blocks.targetsair = Targets Air
|
||||||
blocks.targetsground = Targets Ground
|
blocks.targetsground = Targets Ground
|
||||||
blocks.items = Items: {0}
|
bar.items = Items: {0}
|
||||||
blocks.itemsmoved = Move Speed
|
blocks.itemsmoved = Move Speed
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = Range
|
blocks.shootrange = Range
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = Liquid Output
|
|||||||
blocks.liquidoutputspeed = Liquid Output Speed
|
blocks.liquidoutputspeed = Liquid Output Speed
|
||||||
blocks.liquiduse = Liquid Use
|
blocks.liquiduse = Liquid Use
|
||||||
blocks.coolant = Coolant
|
blocks.coolant = Coolant
|
||||||
blocks.liquid = Liquid
|
bar.liquid = Liquid
|
||||||
blocks.coolantuse = Coolant Use
|
blocks.coolantuse = Coolant Use
|
||||||
blocks.inputliquidfuel = Fuel Liquid
|
blocks.inputliquidfuel = Fuel Liquid
|
||||||
blocks.liquidfueluse = Liquid Fuel Use
|
blocks.liquidfueluse = Liquid Fuel Use
|
||||||
blocks.boostitem = Boost Item
|
blocks.boostitem = Boost Item
|
||||||
blocks.boostliquid = Boost Liquid
|
blocks.boostliquid = Boost Liquid
|
||||||
blocks.health = Can
|
blocks.health = Can
|
||||||
blocks.heat = Heat
|
bar.heat = Heat
|
||||||
blocks.power = Power
|
bar.power = Power
|
||||||
blocks.progress = Build Progress
|
bar.progress = Build Progress
|
||||||
blocks.spawned = Units: {0}/{1}
|
bar.spawned = Units: {0}/{1}
|
||||||
blocks.power.satisfaction = Power Satisfaction
|
blocks.power.satisfaction = Power Satisfaction
|
||||||
blocks.inaccuracy = yanlışlık
|
blocks.inaccuracy = yanlışlık
|
||||||
blocks.shots = atışlar
|
blocks.shots = atışlar
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = Ні
|
|||||||
info.title = Інформація
|
info.title = Інформація
|
||||||
error.title = [crimson]Виникла помилка
|
error.title = [crimson]Виникла помилка
|
||||||
error.crashtitle = Виникла помилка
|
error.crashtitle = Виникла помилка
|
||||||
blocks.outputspeed = Швидкість свердління: {0}/с
|
bar.drillspeed = Швидкість свердління: {0}/с
|
||||||
blocks.efficiency = Ефективність: {0}%
|
bar.efficiency = Ефективність: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = Інформація про блок
|
blocks.blockinfo = Інформація про блок
|
||||||
blocks.powerbalance = Енергія: {0}
|
bar.powerbalance = Енергія: {0}
|
||||||
blocks.poweroutput = Вихідна енергія: {0}
|
bar.poweroutput = Вихідна енергія: {0}
|
||||||
blocks.powercapacity = Місткість енергії
|
blocks.powercapacity = Місткість енергії
|
||||||
blocks.powershot = Енергія/постріл
|
blocks.powershot = Енергія/постріл
|
||||||
blocks.targetsair = Повітряні мішені
|
blocks.targetsair = Повітряні мішені
|
||||||
blocks.targetsground = Наземні мішені
|
blocks.targetsground = Наземні мішені
|
||||||
blocks.items = Предмети: {0}
|
bar.items = Предмети: {0}
|
||||||
blocks.itemsmoved = Швидкість переміщення
|
blocks.itemsmoved = Швидкість переміщення
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = Діапазон дії
|
blocks.shootrange = Діапазон дії
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = Вихідна рідина
|
|||||||
blocks.liquidoutputspeed = Швидкість вихідної рідини
|
blocks.liquidoutputspeed = Швидкість вихідної рідини
|
||||||
blocks.liquiduse = Використовуеться рідин
|
blocks.liquiduse = Використовуеться рідин
|
||||||
blocks.coolant = Охолоджуюча рідина
|
blocks.coolant = Охолоджуюча рідина
|
||||||
blocks.liquid = Рідина
|
bar.liquid = Рідина
|
||||||
blocks.coolantuse = Охолодж. рідини використовуеться
|
blocks.coolantuse = Охолодж. рідини використовуеться
|
||||||
blocks.inputliquidfuel = Рідке паливо
|
blocks.inputliquidfuel = Рідке паливо
|
||||||
blocks.liquidfueluse = Рідкого палива використовуеться
|
blocks.liquidfueluse = Рідкого палива використовуеться
|
||||||
blocks.boostitem = Прискорюючий предмет
|
blocks.boostitem = Прискорюючий предмет
|
||||||
blocks.boostliquid = Прискорююча рідина
|
blocks.boostliquid = Прискорююча рідина
|
||||||
blocks.health = Здоров'я
|
blocks.health = Здоров'я
|
||||||
blocks.heat = Температура
|
bar.heat = Температура
|
||||||
blocks.power = Енергія
|
bar.power = Енергія
|
||||||
blocks.progress = Будівництво триває
|
bar.progress = Будівництво триває
|
||||||
blocks.spawned = Бой. од.: {0}/{1}
|
bar.spawned = Бой. од.: {0}/{1}
|
||||||
blocks.power.satisfaction = Енергія
|
blocks.power.satisfaction = Енергія
|
||||||
blocks.inaccuracy = Розкид
|
blocks.inaccuracy = Розкид
|
||||||
blocks.shots = Постріли
|
blocks.shots = Постріли
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = 不
|
|||||||
info.title = [accent]详情
|
info.title = [accent]详情
|
||||||
error.title = [crimson]发生了一个错误
|
error.title = [crimson]发生了一个错误
|
||||||
error.crashtitle = 发生了一个错误
|
error.crashtitle = 发生了一个错误
|
||||||
blocks.outputspeed = 挖掘速度: {0}/s
|
bar.drillspeed = 挖掘速度: {0}/s
|
||||||
blocks.efficiency = 效率: {0}%
|
bar.efficiency = 效率: {0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = 方块详情
|
blocks.blockinfo = 方块详情
|
||||||
blocks.powerbalance = 能量: {0}
|
bar.powerbalance = 能量: {0}
|
||||||
blocks.poweroutput = 能量输出: {0}
|
bar.poweroutput = 能量输出: {0}
|
||||||
blocks.powercapacity = 能量容量
|
blocks.powercapacity = 能量容量
|
||||||
blocks.powershot = 能量/发射
|
blocks.powershot = 能量/发射
|
||||||
blocks.targetsair = 攻击空中单位
|
blocks.targetsair = 攻击空中单位
|
||||||
blocks.targetsground = 攻击地面单位
|
blocks.targetsground = 攻击地面单位
|
||||||
blocks.items = 物体: {0}
|
bar.items = 物体: {0}
|
||||||
blocks.itemsmoved = 移动速度
|
blocks.itemsmoved = 移动速度
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = 范围
|
blocks.shootrange = 范围
|
||||||
@@ -375,18 +375,17 @@ blocks.liquidoutput = 液体输出
|
|||||||
blocks.liquidoutputspeed = 液体输出速度
|
blocks.liquidoutputspeed = 液体输出速度
|
||||||
blocks.liquiduse = 液体使用速度
|
blocks.liquiduse = 液体使用速度
|
||||||
blocks.coolant = 冷却剂
|
blocks.coolant = 冷却剂
|
||||||
blocks.liquid = 液体
|
bar.liquid = 液体
|
||||||
blocks.coolantuse = 冷却剂使用速度
|
blocks.coolantuse = 冷却剂使用速度
|
||||||
blocks.inputliquidfuel = 液体燃料输入
|
blocks.inputliquidfuel = 液体燃料输入
|
||||||
blocks.liquidfueluse = 液体燃料使用速度
|
blocks.liquidfueluse = 液体燃料使用速度
|
||||||
blocks.boostitem = 强化物件
|
blocks.boostitem = 强化物件
|
||||||
blocks.boostliquid = 强化液体
|
blocks.boostliquid = 强化液体
|
||||||
blocks.health = 生命值
|
blocks.health = 生命值
|
||||||
blocks.heat = Heat
|
bar.heat = Heat
|
||||||
blocks.power = 电力
|
bar.power = 电力
|
||||||
blocks.progress = 制造进度
|
bar.progress = 制造进度
|
||||||
blocks.spawned = 单位数量: {0}/{1}
|
bar.spawned = 单位数量: {0}/{1}
|
||||||
blocks.power.satisfaction = 电力输入
|
|
||||||
blocks.inaccuracy = 误差
|
blocks.inaccuracy = 误差
|
||||||
blocks.shots = 发射数
|
blocks.shots = 发射数
|
||||||
blocks.reload = 重新装弹
|
blocks.reload = 重新装弹
|
||||||
|
|||||||
@@ -335,17 +335,17 @@ no = 否
|
|||||||
info.title = [accent]資訊
|
info.title = [accent]資訊
|
||||||
error.title = [crimson]發生錯誤
|
error.title = [crimson]發生錯誤
|
||||||
error.crashtitle = 發生錯誤
|
error.crashtitle = 發生錯誤
|
||||||
blocks.outputspeed = 鑽頭速度:{0}/秒
|
bar.drillspeed = 鑽頭速度:{0}/秒
|
||||||
blocks.efficiency = 效率:{0}%
|
bar.efficiency = 效率:{0}%
|
||||||
blocks.unknown = [LIGHT_GRAY]???
|
block.unknown = [LIGHT_GRAY]???
|
||||||
blocks.blockinfo = 方塊資訊
|
blocks.blockinfo = 方塊資訊
|
||||||
blocks.powerbalance = 能量變化:{0}
|
bar.powerbalance = 能量變化:{0}
|
||||||
blocks.poweroutput = 能量輸出:{0}
|
bar.poweroutput = 能量輸出:{0}
|
||||||
blocks.powercapacity = 蓄電量
|
blocks.powercapacity = 蓄電量
|
||||||
blocks.powershot = 能量/射擊
|
blocks.powershot = 能量/射擊
|
||||||
blocks.targetsair = 攻擊空中目標
|
blocks.targetsair = 攻擊空中目標
|
||||||
blocks.targetsground = 攻擊地面
|
blocks.targetsground = 攻擊地面
|
||||||
blocks.items = 物品:{0}
|
bar.items = 物品:{0}
|
||||||
blocks.itemsmoved = 移動速度
|
blocks.itemsmoved = 移動速度
|
||||||
blocks.launchtime = Time Between Launches
|
blocks.launchtime = Time Between Launches
|
||||||
blocks.shootrange = 範圍
|
blocks.shootrange = 範圍
|
||||||
@@ -375,17 +375,17 @@ blocks.liquidoutput = 輸出液體
|
|||||||
blocks.liquidoutputspeed = 輸出液體速度
|
blocks.liquidoutputspeed = 輸出液體速度
|
||||||
blocks.liquiduse = 使用液體速度
|
blocks.liquiduse = 使用液體速度
|
||||||
blocks.coolant = 冷卻劑
|
blocks.coolant = 冷卻劑
|
||||||
blocks.liquid = 液體
|
bar.liquid = 液體
|
||||||
blocks.coolantuse = 使用冷卻劑
|
blocks.coolantuse = 使用冷卻劑
|
||||||
blocks.inputliquidfuel = 輸入液體燃料
|
blocks.inputliquidfuel = 輸入液體燃料
|
||||||
blocks.liquidfueluse = 使用液體燃料速度
|
blocks.liquidfueluse = 使用液體燃料速度
|
||||||
blocks.boostitem = 強化物品
|
blocks.boostitem = 強化物品
|
||||||
blocks.boostliquid = 強化液體
|
blocks.boostliquid = 強化液體
|
||||||
blocks.health = 耐久度
|
blocks.health = 耐久度
|
||||||
blocks.heat = 熱
|
bar.heat = 熱
|
||||||
blocks.power = 能量
|
bar.power = 能量
|
||||||
blocks.progress = 建造進度
|
bar.progress = 建造進度
|
||||||
blocks.spawned = 單位:{0}/{1}
|
bar.spawned = 單位:{0}/{1}
|
||||||
blocks.power.satisfaction = 能量滿意度
|
blocks.power.satisfaction = 能量滿意度
|
||||||
blocks.inaccuracy = 誤差
|
blocks.inaccuracy = 誤差
|
||||||
blocks.shots = 射擊數
|
blocks.shots = 射擊數
|
||||||
|
|||||||
@@ -3,11 +3,17 @@ package io.anuke.mindustry.content;
|
|||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.Core;
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.Color;
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
import io.anuke.arc.graphics.g2d.Draw;
|
||||||
|
import io.anuke.arc.graphics.g2d.Lines;
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||||
|
import io.anuke.arc.math.Mathf;
|
||||||
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.game.ContentList;
|
import io.anuke.mindustry.game.ContentList;
|
||||||
import io.anuke.mindustry.graphics.CacheLayer;
|
import io.anuke.mindustry.graphics.CacheLayer;
|
||||||
|
import io.anuke.mindustry.graphics.Pal;
|
||||||
|
import io.anuke.mindustry.graphics.Shaders;
|
||||||
import io.anuke.mindustry.type.Category;
|
import io.anuke.mindustry.type.Category;
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
import io.anuke.mindustry.type.ItemStack;
|
||||||
|
import io.anuke.mindustry.type.LiquidStack;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.*;
|
import io.anuke.mindustry.world.blocks.*;
|
||||||
@@ -24,9 +30,9 @@ import io.anuke.mindustry.world.blocks.storage.Vault;
|
|||||||
import io.anuke.mindustry.world.blocks.units.MechPad;
|
import io.anuke.mindustry.world.blocks.units.MechPad;
|
||||||
import io.anuke.mindustry.world.blocks.units.RepairPoint;
|
import io.anuke.mindustry.world.blocks.units.RepairPoint;
|
||||||
import io.anuke.mindustry.world.blocks.units.UnitFactory;
|
import io.anuke.mindustry.world.blocks.units.UnitFactory;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeItemFilter;
|
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
||||||
import io.anuke.mindustry.world.meta.Attribute;
|
import io.anuke.mindustry.world.meta.Attribute;
|
||||||
|
import io.anuke.mindustry.world.modules.LiquidModule;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.state;
|
import static io.anuke.mindustry.Vars.state;
|
||||||
import static io.anuke.mindustry.Vars.world;
|
import static io.anuke.mindustry.Vars.world;
|
||||||
@@ -371,7 +377,7 @@ public class Blocks implements ContentList{
|
|||||||
requirements(Category.crafting, ItemStack.with(Items.copper, 150, Items.lead, 60));
|
requirements(Category.crafting, ItemStack.with(Items.copper, 150, Items.lead, 60));
|
||||||
|
|
||||||
craftEffect = Fx.pulverizeMedium;
|
craftEffect = Fx.pulverizeMedium;
|
||||||
output = Items.graphite;
|
outputItem = new ItemStack(Items.graphite, 1);
|
||||||
craftTime = 90f;
|
craftTime = 90f;
|
||||||
size = 2;
|
size = 2;
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
@@ -383,7 +389,7 @@ public class Blocks implements ContentList{
|
|||||||
requirements(Category.crafting, ItemStack.with(Items.titanium, 200, Items.silicon, 50, Items.lead, 200, Items.graphite, 100));
|
requirements(Category.crafting, ItemStack.with(Items.titanium, 200, Items.silicon, 50, Items.lead, 200, Items.graphite, 100));
|
||||||
|
|
||||||
craftEffect = Fx.pulverizeMedium;
|
craftEffect = Fx.pulverizeMedium;
|
||||||
output = Items.graphite;
|
outputItem = new ItemStack(Items.graphite, 2);
|
||||||
craftTime = 30f;
|
craftTime = 30f;
|
||||||
size = 3;
|
size = 3;
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
@@ -391,14 +397,14 @@ public class Blocks implements ContentList{
|
|||||||
hasPower = true;
|
hasPower = true;
|
||||||
|
|
||||||
consumes.power(2f);
|
consumes.power(2f);
|
||||||
consumes.item(Items.coal, 2);
|
consumes.item(Items.coal, 4);
|
||||||
consumes.liquid(Liquids.water, 0.1f);
|
consumes.liquid(Liquids.water, 0.1f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
siliconSmelter = new PowerSmelter("silicon-smelter"){{
|
siliconSmelter = new GenericSmelter("silicon-smelter"){{
|
||||||
requirements(Category.crafting, ItemStack.with(Items.copper, 60, Items.lead, 50));
|
requirements(Category.crafting, ItemStack.with(Items.copper, 60, Items.lead, 50));
|
||||||
craftEffect = Fx.smeltsmoke;
|
craftEffect = Fx.smeltsmoke;
|
||||||
output = Items.silicon;
|
outputItem = new ItemStack(Items.silicon, 1);
|
||||||
craftTime = 40f;
|
craftTime = 40f;
|
||||||
size = 2;
|
size = 2;
|
||||||
hasLiquids = false;
|
hasLiquids = false;
|
||||||
@@ -408,10 +414,10 @@ public class Blocks implements ContentList{
|
|||||||
consumes.power(0.50f);
|
consumes.power(0.50f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
kiln = new PowerSmelter("kiln"){{
|
kiln = new GenericSmelter("kiln"){{
|
||||||
requirements(Category.crafting, ItemStack.with(Items.copper, 120, Items.graphite, 60, Items.lead, 60));
|
requirements(Category.crafting, ItemStack.with(Items.copper, 120, Items.graphite, 60, Items.lead, 60));
|
||||||
craftEffect = Fx.smeltsmoke;
|
craftEffect = Fx.smeltsmoke;
|
||||||
output = Items.metaglass;
|
outputItem = new ItemStack(Items.metaglass, 1);
|
||||||
craftTime = 30f;
|
craftTime = 30f;
|
||||||
size = 2;
|
size = 2;
|
||||||
hasPower = hasItems = true;
|
hasPower = hasItems = true;
|
||||||
@@ -421,12 +427,12 @@ public class Blocks implements ContentList{
|
|||||||
consumes.power(0.60f);
|
consumes.power(0.60f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
plastaniumCompressor = new PlastaniumCompressor("plastanium-compressor"){{
|
plastaniumCompressor = new GenericCrafter("plastanium-compressor"){{
|
||||||
requirements(Category.crafting, ItemStack.with(Items.silicon, 160, Items.lead, 230, Items.graphite, 120, Items.titanium, 160));
|
requirements(Category.crafting, ItemStack.with(Items.silicon, 160, Items.lead, 230, Items.graphite, 120, Items.titanium, 160));
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
liquidCapacity = 60f;
|
liquidCapacity = 60f;
|
||||||
craftTime = 60f;
|
craftTime = 60f;
|
||||||
output = Items.plastanium;
|
outputItem = new ItemStack(Items.plastanium, 1);
|
||||||
size = 2;
|
size = 2;
|
||||||
health = 320;
|
health = 320;
|
||||||
hasPower = hasLiquids = true;
|
hasPower = hasLiquids = true;
|
||||||
@@ -436,23 +442,69 @@ public class Blocks implements ContentList{
|
|||||||
consumes.liquid(Liquids.oil, 0.25f);
|
consumes.liquid(Liquids.oil, 0.25f);
|
||||||
consumes.power(3f);
|
consumes.power(3f);
|
||||||
consumes.item(Items.titanium, 2);
|
consumes.item(Items.titanium, 2);
|
||||||
|
|
||||||
|
int topRegion = reg("-top");
|
||||||
|
|
||||||
|
drawer = tile -> {
|
||||||
|
super.draw(tile);
|
||||||
|
|
||||||
|
GenericCrafterEntity entity = tile.entity();
|
||||||
|
|
||||||
|
Draw.alpha(Mathf.absin(entity.totalProgress, 3f, 0.9f) * entity.warmup);
|
||||||
|
Draw.rect(reg(topRegion), tile.drawx(), tile.drawy());
|
||||||
|
Draw.reset();
|
||||||
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
phaseWeaver = new PhaseWeaver("phase-weaver"){{
|
phaseWeaver = new GenericCrafter("phase-weaver"){{
|
||||||
requirements(Category.crafting, ItemStack.with(Items.silicon, 260, Items.lead, 240, Items.thorium, 150));
|
requirements(Category.crafting, ItemStack.with(Items.silicon, 260, Items.lead, 240, Items.thorium, 150));
|
||||||
craftEffect = Fx.smeltsmoke;
|
craftEffect = Fx.smeltsmoke;
|
||||||
output = Items.phasefabric;
|
outputItem = new ItemStack(Items.phasefabric, 1);
|
||||||
craftTime = 120f;
|
craftTime = 120f;
|
||||||
size = 2;
|
size = 2;
|
||||||
|
|
||||||
consumes.items(new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10));
|
consumes.items(new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10));
|
||||||
consumes.power(5f);
|
consumes.power(5f);
|
||||||
|
|
||||||
|
int bottomRegion = reg("-bottom"), weaveRegion = reg("-weave");
|
||||||
|
|
||||||
|
drawer = tile -> {
|
||||||
|
GenericCrafterEntity entity = tile.entity();
|
||||||
|
|
||||||
|
Draw.rect(reg(bottomRegion), tile.drawx(), tile.drawy());
|
||||||
|
|
||||||
|
float progress = 0.5f;
|
||||||
|
|
||||||
|
Shaders.build.region = reg(weaveRegion);
|
||||||
|
Shaders.build.progress = progress;
|
||||||
|
Shaders.build.color.set(Pal.accent);
|
||||||
|
Shaders.build.color.a = entity.warmup;
|
||||||
|
Shaders.build.time = -entity.totalProgress / 10f;
|
||||||
|
|
||||||
|
Draw.shader(Shaders.build, false);
|
||||||
|
Shaders.build.apply();
|
||||||
|
Draw.rect(reg(weaveRegion), tile.drawx(), tile.drawy(), entity.totalProgress);
|
||||||
|
Draw.shader();
|
||||||
|
|
||||||
|
Draw.color(Pal.accent);
|
||||||
|
Draw.alpha(entity.warmup);
|
||||||
|
|
||||||
|
Lines.lineAngleCenter(
|
||||||
|
tile.drawx() + Mathf.sin(entity.totalProgress, 6f, Vars.tilesize / 3f * size),
|
||||||
|
tile.drawy(),
|
||||||
|
90,
|
||||||
|
size * Vars.tilesize / 2f);
|
||||||
|
|
||||||
|
Draw.reset();
|
||||||
|
|
||||||
|
Draw.rect(region, tile.drawx(), tile.drawy());
|
||||||
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
surgeSmelter = new PowerSmelter("alloy-smelter"){{
|
surgeSmelter = new GenericSmelter("alloy-smelter"){{
|
||||||
requirements(Category.crafting, ItemStack.with(Items.silicon, 160, Items.lead, 160, Items.thorium, 140));
|
requirements(Category.crafting, ItemStack.with(Items.silicon, 160, Items.lead, 160, Items.thorium, 140));
|
||||||
craftEffect = Fx.smeltsmoke;
|
craftEffect = Fx.smeltsmoke;
|
||||||
output = Items.surgealloy;
|
outputItem = new ItemStack(Items.surgealloy, 1);
|
||||||
craftTime = 75f;
|
craftTime = 75f;
|
||||||
size = 3;
|
size = 3;
|
||||||
|
|
||||||
@@ -460,35 +512,60 @@ public class Blocks implements ContentList{
|
|||||||
consumes.items(new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.copper, 3));
|
consumes.items(new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.copper, 3));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
cryofluidMixer = new LiquidMixer("cryofluidmixer"){{
|
cryofluidMixer = new GenericCrafter("cryofluidmixer"){{
|
||||||
requirements(Category.crafting, ItemStack.with(Items.lead, 130, Items.silicon, 80, Items.thorium, 90));
|
requirements(Category.crafting, ItemStack.with(Items.lead, 130, Items.silicon, 80, Items.thorium, 90));
|
||||||
outputLiquid = Liquids.cryofluid;
|
outputLiquid = new LiquidStack(Liquids.cryofluid, 0.3f);
|
||||||
liquidPerItem = 50f;
|
craftTime = 5f;
|
||||||
size = 2;
|
size = 2;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
|
hasItems = true;
|
||||||
|
rotate = false;
|
||||||
|
solid = true;
|
||||||
|
outputsLiquid = true;
|
||||||
|
|
||||||
consumes.power(1f);
|
consumes.power(1f);
|
||||||
consumes.item(Items.titanium);
|
consumes.item(Items.titanium);
|
||||||
consumes.liquid(Liquids.water, 0.3f);
|
consumes.liquid(Liquids.water, 0.3f);
|
||||||
|
|
||||||
|
int liquidRegion = reg("-liquid"), topRegion = reg("-top"), bottomRegion = reg("-bottom");
|
||||||
|
|
||||||
|
drawIcons = () -> new TextureRegion[]{Core.atlas.find(name + "-bottom"), Core.atlas.find(name + "-top")};
|
||||||
|
|
||||||
|
drawer = tile -> {
|
||||||
|
LiquidModule mod = tile.entity.liquids;
|
||||||
|
|
||||||
|
int rotation = rotate ? tile.getRotation() * 90 : 0;
|
||||||
|
|
||||||
|
Draw.rect(reg(bottomRegion), tile.drawx(), tile.drawy(), rotation);
|
||||||
|
|
||||||
|
if(mod.total() > 0.001f){
|
||||||
|
Draw.color(outputLiquid.liquid.color);
|
||||||
|
Draw.alpha(mod.get(outputLiquid.liquid) / liquidCapacity);
|
||||||
|
Draw.rect(reg(liquidRegion), tile.drawx(), tile.drawy(), rotation);
|
||||||
|
Draw.color();
|
||||||
|
}
|
||||||
|
|
||||||
|
Draw.rect(reg(topRegion), tile.drawx(), tile.drawy(), rotation);
|
||||||
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
blastMixer = new GenericCrafter("blast-mixer"){{
|
blastMixer = new GenericCrafter("blast-mixer"){{
|
||||||
requirements(Category.crafting, ItemStack.with(Items.lead, 60, Items.titanium, 40));
|
requirements(Category.crafting, ItemStack.with(Items.lead, 60, Items.titanium, 40));
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
output = Items.blastCompound;
|
outputItem = new ItemStack(Items.blastCompound, 1);
|
||||||
size = 2;
|
size = 2;
|
||||||
|
|
||||||
consumes.items(new ItemStack(Items.pyratite, 1), new ItemStack(Items.sporePod, 1));
|
consumes.items(new ItemStack(Items.pyratite, 1), new ItemStack(Items.sporePod, 1));
|
||||||
consumes.power(0.40f);
|
consumes.power(0.40f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
pyratiteMixer = new PowerSmelter("pyratite-mixer"){{
|
pyratiteMixer = new GenericSmelter("pyratite-mixer"){{
|
||||||
requirements(Category.crafting, ItemStack.with(Items.copper, 100, Items.lead, 50));
|
requirements(Category.crafting, ItemStack.with(Items.copper, 100, Items.lead, 50));
|
||||||
flameColor = Color.CLEAR;
|
flameColor = Color.CLEAR;
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
output = Items.pyratite;
|
outputItem = new ItemStack(Items.pyratite, 1);
|
||||||
|
|
||||||
size = 2;
|
size = 2;
|
||||||
|
|
||||||
@@ -496,11 +573,10 @@ public class Blocks implements ContentList{
|
|||||||
consumes.items(new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2));
|
consumes.items(new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
melter = new PowerCrafter("melter"){{
|
melter = new GenericCrafter("melter"){{
|
||||||
requirements(Category.crafting, ItemStack.with(Items.copper, 60, Items.lead, 70, Items.graphite, 90));
|
requirements(Category.crafting, ItemStack.with(Items.copper, 60, Items.lead, 70, Items.graphite, 90));
|
||||||
health = 200;
|
health = 200;
|
||||||
outputLiquid = Liquids.slag;
|
outputLiquid = new LiquidStack(Liquids.slag, 2f);
|
||||||
outputLiquidAmount = 2f;
|
|
||||||
craftTime = 10f;
|
craftTime = 10f;
|
||||||
hasLiquids = hasPower = true;
|
hasLiquids = hasPower = true;
|
||||||
|
|
||||||
@@ -517,7 +593,7 @@ public class Blocks implements ContentList{
|
|||||||
Items.titanium, 2
|
Items.titanium, 2
|
||||||
);
|
);
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
filterTime = 35f;
|
craftTime = 35f;
|
||||||
spinnerLength = 1.5f;
|
spinnerLength = 1.5f;
|
||||||
spinnerRadius = 3.5f;
|
spinnerRadius = 3.5f;
|
||||||
spinnerThickness = 1.5f;
|
spinnerThickness = 1.5f;
|
||||||
@@ -530,7 +606,7 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
cultivator = new Cultivator("cultivator"){{
|
cultivator = new Cultivator("cultivator"){{
|
||||||
requirements(Category.crafting, ItemStack.with(Items.copper, 20, Items.lead, 50, Items.silicon, 20));
|
requirements(Category.crafting, ItemStack.with(Items.copper, 20, Items.lead, 50, Items.silicon, 20));
|
||||||
output = Items.sporePod;
|
outputItem = new ItemStack(Items.sporePod, 1);
|
||||||
craftTime = 160;
|
craftTime = 160;
|
||||||
size = 2;
|
size = 2;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
@@ -541,23 +617,41 @@ public class Blocks implements ContentList{
|
|||||||
consumes.liquid(Liquids.water, 0.15f);
|
consumes.liquid(Liquids.water, 0.15f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
sporePress = new Compressor("spore-press"){{
|
sporePress = new GenericCrafter("spore-press"){{
|
||||||
requirements(Category.crafting, ItemStack.with(Items.lead, 70, Items.silicon, 60));
|
requirements(Category.crafting, ItemStack.with(Items.lead, 70, Items.silicon, 60));
|
||||||
liquidCapacity = 60f;
|
liquidCapacity = 60f;
|
||||||
craftTime = 20f;
|
craftTime = 20f;
|
||||||
outputLiquid = Liquids.oil;
|
outputLiquid = new LiquidStack(Liquids.oil, 4f);
|
||||||
outputLiquidAmount = 4f;
|
|
||||||
size = 2;
|
size = 2;
|
||||||
health = 320;
|
health = 320;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
|
|
||||||
consumes.item(Items.sporePod, 1);
|
consumes.item(Items.sporePod, 1);
|
||||||
consumes.power(0.60f);
|
consumes.power(0.60f);
|
||||||
|
|
||||||
|
int[] frameRegions = new int[3];
|
||||||
|
for(int i = 0; i < 3; i++){
|
||||||
|
frameRegions[i] = reg("-frame" + i);
|
||||||
|
}
|
||||||
|
|
||||||
|
int liquidRegion = reg("-liquid");
|
||||||
|
int topRegion =reg("-top");
|
||||||
|
|
||||||
|
drawer = tile -> {
|
||||||
|
GenericCrafterEntity entity = tile.entity();
|
||||||
|
|
||||||
|
Draw.rect(region, tile.drawx(), tile.drawy());
|
||||||
|
Draw.rect(reg(frameRegions[(int) Mathf.absin(entity.totalProgress, 5f, 2.999f)]), tile.drawx(), tile.drawy());
|
||||||
|
Draw.color(Color.CLEAR, tile.entity.liquids.current().color, tile.entity.liquids.total() / liquidCapacity);
|
||||||
|
Draw.rect(reg(liquidRegion), tile.drawx(), tile.drawy());
|
||||||
|
Draw.color();
|
||||||
|
Draw.rect(reg(topRegion), tile.drawx(), tile.drawy());
|
||||||
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
pulverizer = new Pulverizer("pulverizer"){{
|
pulverizer = new GenericCrafter("pulverizer"){{
|
||||||
requirements(Category.crafting, ItemStack.with(Items.copper, 60, Items.lead, 50));
|
requirements(Category.crafting, ItemStack.with(Items.copper, 60, Items.lead, 50));
|
||||||
output = Items.sand;
|
outputItem = new ItemStack(Items.sand, 1);
|
||||||
craftEffect = Fx.pulverize;
|
craftEffect = Fx.pulverize;
|
||||||
craftTime = 40f;
|
craftTime = 40f;
|
||||||
updateEffect = Fx.pulverizeSmall;
|
updateEffect = Fx.pulverizeSmall;
|
||||||
@@ -565,6 +659,15 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
consumes.item(Items.scrap, 1);
|
consumes.item(Items.scrap, 1);
|
||||||
consumes.power(0.50f);
|
consumes.power(0.50f);
|
||||||
|
|
||||||
|
int rotatorRegion = reg("-rotator");
|
||||||
|
|
||||||
|
drawer = tile -> {
|
||||||
|
GenericCrafterEntity entity = tile.entity();
|
||||||
|
|
||||||
|
Draw.rect(region, tile.drawx(), tile.drawy());
|
||||||
|
Draw.rect(reg(rotatorRegion), tile.drawx(), tile.drawy(), entity.totalProgress * 2f);
|
||||||
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
incinerator = new Incinerator("incinerator"){{
|
incinerator = new Incinerator("incinerator"){{
|
||||||
@@ -725,13 +828,13 @@ public class Blocks implements ContentList{
|
|||||||
requirements(Category.effect, ItemStack.with(Items.lead, 200, Items.titanium, 150, Items.silicon, 150, Items.plastanium, 60));
|
requirements(Category.effect, ItemStack.with(Items.lead, 200, Items.titanium, 150, Items.silicon, 150, Items.plastanium, 60));
|
||||||
consumes.power(3.50f);
|
consumes.power(3.50f);
|
||||||
size = 2;
|
size = 2;
|
||||||
consumes.item(Items.phasefabric).optional(true).boost(true);
|
consumes.item(Items.phasefabric).optional(true);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
forceProjector = new ForceProjector("force-projector"){{
|
forceProjector = new ForceProjector("force-projector"){{
|
||||||
requirements(Category.effect, ItemStack.with(Items.lead, 200, Items.titanium, 150, Items.silicon, 250));
|
requirements(Category.effect, ItemStack.with(Items.lead, 200, Items.titanium, 150, Items.silicon, 250));
|
||||||
size = 3;
|
size = 3;
|
||||||
consumes.item(Items.phasefabric).optional(true).boost(true);
|
consumes.item(Items.phasefabric).optional(true);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
shockMine = new ShockMine("shock-mine"){{
|
shockMine = new ShockMine("shock-mine"){{
|
||||||
@@ -921,7 +1024,7 @@ public class Blocks implements ContentList{
|
|||||||
size = 2;
|
size = 2;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
turbineGenerator = new TurbineGenerator("turbine-generator"){{
|
turbineGenerator = new BurnerGenerator("turbine-generator"){{
|
||||||
requirements(Category.power, ItemStack.with(Items.copper, 70, Items.graphite, 50, Items.lead, 80, Items.silicon, 60));
|
requirements(Category.power, ItemStack.with(Items.copper, 70, Items.graphite, 50, Items.lead, 80, Items.silicon, 60));
|
||||||
powerProduction = 6f;
|
powerProduction = 6f;
|
||||||
itemDuration = 30f;
|
itemDuration = 30f;
|
||||||
@@ -930,15 +1033,15 @@ public class Blocks implements ContentList{
|
|||||||
size = 2;
|
size = 2;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
differentialGenerator = new DifferentialGenerator("differential-generator"){{
|
differentialGenerator = new ItemLiquidGenerator(true, true, "differential-generator"){{
|
||||||
requirements(Category.power, ItemStack.with(Items.copper, 140, Items.titanium, 100, Items.lead, 200, Items.silicon, 130, Items.metaglass, 100));
|
requirements(Category.power, ItemStack.with(Items.copper, 140, Items.titanium, 100, Items.lead, 200, Items.silicon, 130, Items.metaglass, 100));
|
||||||
powerProduction = 13f;
|
powerProduction = 13f;
|
||||||
itemDuration = 50f;
|
itemDuration = 50f;
|
||||||
consumes.remove(ConsumeItemFilter.class);
|
hasLiquids = true;
|
||||||
consumes.remove(ConsumeLiquidFilter.class);
|
size = 3;
|
||||||
|
|
||||||
consumes.item(Items.pyratite);
|
consumes.item(Items.pyratite);
|
||||||
consumes.liquid(Liquids.cryofluid, 0.2f);
|
consumes.liquid(Liquids.cryofluid, 0.2f);
|
||||||
size = 3;
|
|
||||||
}};
|
}};
|
||||||
|
|
||||||
rtgGenerator = new DecayGenerator("rtg-generator"){{
|
rtgGenerator = new DecayGenerator("rtg-generator"){{
|
||||||
@@ -973,7 +1076,7 @@ public class Blocks implements ContentList{
|
|||||||
size = 4;
|
size = 4;
|
||||||
health = 900;
|
health = 900;
|
||||||
powerProduction = 80f;
|
powerProduction = 80f;
|
||||||
useTime = 40f;
|
itemDuration = 40f;
|
||||||
consumes.power(23f);
|
consumes.power(23f);
|
||||||
consumes.item(Items.blastCompound);
|
consumes.item(Items.blastCompound);
|
||||||
consumes.liquid(Liquids.cryofluid, 0.8f);
|
consumes.liquid(Liquids.cryofluid, 0.8f);
|
||||||
@@ -988,6 +1091,7 @@ public class Blocks implements ContentList{
|
|||||||
drillTime = 600;
|
drillTime = 600;
|
||||||
size = 2;
|
size = 2;
|
||||||
drawMineItem = true;
|
drawMineItem = true;
|
||||||
|
consumes.liquid(Liquids.water, 0.05f).optional(true);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
pneumaticDrill = new Drill("pneumatic-drill"){{
|
pneumaticDrill = new Drill("pneumatic-drill"){{
|
||||||
@@ -1367,7 +1471,6 @@ public class Blocks implements ContentList{
|
|||||||
);
|
);
|
||||||
reload = 6f;
|
reload = 6f;
|
||||||
coolantMultiplier = 0.5f;
|
coolantMultiplier = 0.5f;
|
||||||
maxCoolantUsed = 1.5f;
|
|
||||||
restitution = 0.1f;
|
restitution = 0.1f;
|
||||||
ammoUseEffect = Fx.shellEjectBig;
|
ammoUseEffect = Fx.shellEjectBig;
|
||||||
range = 200f;
|
range = 200f;
|
||||||
@@ -1381,6 +1484,7 @@ public class Blocks implements ContentList{
|
|||||||
shootCone = 24f;
|
shootCone = 24f;
|
||||||
|
|
||||||
health = 155 * size * size;
|
health = 155 * size * size;
|
||||||
|
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 2f)).update(false).optional(true);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
meltdown = new LaserTurret("meltdown"){{
|
meltdown = new LaserTurret("meltdown"){{
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class Items implements ContentList{
|
|||||||
|
|
||||||
plastanium = new Item("plastanium", Color.valueOf("cbd97f")){{
|
plastanium = new Item("plastanium", Color.valueOf("cbd97f")){{
|
||||||
type = ItemType.material;
|
type = ItemType.material;
|
||||||
flammability = 0.2f;
|
flammability = 0.1f;
|
||||||
explosiveness = 0.2f;
|
explosiveness = 0.2f;
|
||||||
cost = 1.3f;
|
cost = 1.3f;
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -287,11 +287,11 @@ public class UI implements ApplicationListener{
|
|||||||
|
|
||||||
public String formatAmount(int number){
|
public String formatAmount(int number){
|
||||||
if(number >= 1000000){
|
if(number >= 1000000){
|
||||||
return Strings.toFixed(number / 1000000f, 1) + "[gray]mil[]";
|
return Strings.fixed(number / 1000000f, 1) + "[gray]mil[]";
|
||||||
}else if(number >= 10000){
|
}else if(number >= 10000){
|
||||||
return number / 1000 + "[gray]k[]";
|
return number / 1000 + "[gray]k[]";
|
||||||
}else if(number >= 1000){
|
}else if(number >= 1000){
|
||||||
return Strings.toFixed(number / 1000f, 1) + "[gray]k[]";
|
return Strings.fixed(number / 1000f, 1) + "[gray]k[]";
|
||||||
}else{
|
}else{
|
||||||
return number + "";
|
return number + "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ public class WaveInfoDialog extends FloatingDialog{
|
|||||||
}).width(80f);
|
}).width(80f);
|
||||||
|
|
||||||
a.add(" + ");
|
a.add(" + ");
|
||||||
a.addField(Strings.toFixed(Math.max((Mathf.isZero(group.unitScaling) ? 0 : 1f/group.unitScaling), 0), 2), TextFieldFilter.floatsOnly, text -> {
|
a.addField(Strings.fixed(Math.max((Mathf.isZero(group.unitScaling) ? 0 : 1f/group.unitScaling), 0), 2), TextFieldFilter.floatsOnly, text -> {
|
||||||
if(Strings.canParsePositiveFloat(text)){
|
if(Strings.canParsePositiveFloat(text)){
|
||||||
group.unitScaling = 1f / Strings.parseFloat(text);
|
group.unitScaling = 1f / Strings.parseFloat(text);
|
||||||
updateWaves();
|
updateWaves();
|
||||||
|
|||||||
@@ -5,17 +5,17 @@ import io.anuke.annotations.Annotations.Remote;
|
|||||||
import io.anuke.arc.Events;
|
import io.anuke.arc.Events;
|
||||||
import io.anuke.arc.collection.Array;
|
import io.anuke.arc.collection.Array;
|
||||||
import io.anuke.arc.collection.ObjectSet;
|
import io.anuke.arc.collection.ObjectSet;
|
||||||
import io.anuke.mindustry.entities.Effects;
|
|
||||||
import io.anuke.mindustry.entities.EntityGroup;
|
|
||||||
import io.anuke.mindustry.entities.impl.BaseEntity;
|
|
||||||
import io.anuke.mindustry.entities.traits.HealthTrait;
|
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.Mathf;
|
||||||
import io.anuke.arc.math.geom.Point2;
|
import io.anuke.arc.math.geom.Point2;
|
||||||
import io.anuke.arc.math.geom.Vector2;
|
import io.anuke.arc.math.geom.Vector2;
|
||||||
import io.anuke.arc.util.Interval;
|
import io.anuke.arc.util.Interval;
|
||||||
import io.anuke.arc.util.Time;
|
import io.anuke.arc.util.Time;
|
||||||
import io.anuke.mindustry.content.Fx;
|
import io.anuke.mindustry.content.Fx;
|
||||||
|
import io.anuke.mindustry.entities.Effects;
|
||||||
|
import io.anuke.mindustry.entities.EntityGroup;
|
||||||
import io.anuke.mindustry.entities.bullet.Bullet;
|
import io.anuke.mindustry.entities.bullet.Bullet;
|
||||||
|
import io.anuke.mindustry.entities.impl.BaseEntity;
|
||||||
|
import io.anuke.mindustry.entities.traits.HealthTrait;
|
||||||
import io.anuke.mindustry.entities.traits.TargetTrait;
|
import io.anuke.mindustry.entities.traits.TargetTrait;
|
||||||
import io.anuke.mindustry.game.EventType.BlockDestroyEvent;
|
import io.anuke.mindustry.game.EventType.BlockDestroyEvent;
|
||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
@@ -24,7 +24,6 @@ import io.anuke.mindustry.world.Block;
|
|||||||
import io.anuke.mindustry.world.Edges;
|
import io.anuke.mindustry.world.Edges;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.defense.Wall;
|
import io.anuke.mindustry.world.blocks.defense.Wall;
|
||||||
import io.anuke.mindustry.world.consumers.Consume;
|
|
||||||
import io.anuke.mindustry.world.modules.ConsumeModule;
|
import io.anuke.mindustry.world.modules.ConsumeModule;
|
||||||
import io.anuke.mindustry.world.modules.ItemModule;
|
import io.anuke.mindustry.world.modules.ItemModule;
|
||||||
import io.anuke.mindustry.world.modules.LiquidModule;
|
import io.anuke.mindustry.world.modules.LiquidModule;
|
||||||
@@ -44,6 +43,7 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
public static int sleepingEntities = 0;
|
public static int sleepingEntities = 0;
|
||||||
|
|
||||||
public Tile tile;
|
public Tile tile;
|
||||||
|
public Block block;
|
||||||
public Interval timer;
|
public Interval timer;
|
||||||
public float health;
|
public float health;
|
||||||
public float timeScale = 1f, timeScaleDuration;
|
public float timeScale = 1f, timeScaleDuration;
|
||||||
@@ -81,10 +81,10 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
this.tile = tile;
|
this.tile = tile;
|
||||||
x = tile.drawx();
|
x = tile.drawx();
|
||||||
y = tile.drawy();
|
y = tile.drawy();
|
||||||
|
block = tile.block();
|
||||||
|
|
||||||
health = tile.block().health;
|
health = block.health;
|
||||||
|
timer = new Interval(block.timers);
|
||||||
timer = new Interval(tile.block().timers);
|
|
||||||
|
|
||||||
if(shouldAdd){
|
if(shouldAdd){
|
||||||
add();
|
add();
|
||||||
@@ -139,7 +139,7 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void collision(Bullet other){
|
public void collision(Bullet other){
|
||||||
tile.block().handleBulletHit(this, other);
|
block.handleBulletHit(this, other);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void kill(){
|
public void kill(){
|
||||||
@@ -151,7 +151,7 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
|
|
||||||
float preHealth = health;
|
float preHealth = health;
|
||||||
|
|
||||||
Call.onTileDamage(tile, health - tile.block().handleDamage(tile, damage));
|
Call.onTileDamage(tile, health - block.handleDamage(tile, damage));
|
||||||
|
|
||||||
if(health <= 0){
|
if(health <= 0){
|
||||||
Call.onTileDestroyed(tile);
|
Call.onTileDestroyed(tile);
|
||||||
@@ -170,14 +170,10 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
return tile;
|
return tile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean consumed(Class<? extends Consume> type){
|
|
||||||
return tile.block().consumes.get(type).valid(tile.block(), this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeFromProximity(){
|
public void removeFromProximity(){
|
||||||
tile.block().onProximityRemoved(tile);
|
block.onProximityRemoved(tile);
|
||||||
|
|
||||||
Point2[] nearby = Edges.getEdges(tile.block().size);
|
Point2[] nearby = Edges.getEdges(block.size);
|
||||||
for(Point2 point : nearby){
|
for(Point2 point : nearby){
|
||||||
Tile other = world.tile(tile.x + point.x, tile.y + point.y);
|
Tile other = world.tile(tile.x + point.x, tile.y + point.y);
|
||||||
//remove this tile from all nearby tile's proximities
|
//remove this tile from all nearby tile's proximities
|
||||||
@@ -195,7 +191,7 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
tmpTiles.clear();
|
tmpTiles.clear();
|
||||||
proximity.clear();
|
proximity.clear();
|
||||||
|
|
||||||
Point2[] nearby = Edges.getEdges(tile.block().size);
|
Point2[] nearby = Edges.getEdges(block.size);
|
||||||
for(Point2 point : nearby){
|
for(Point2 point : nearby){
|
||||||
Tile other = world.tile(tile.x + point.x, tile.y + point.y);
|
Tile other = world.tile(tile.x + point.x, tile.y + point.y);
|
||||||
|
|
||||||
@@ -218,8 +214,8 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
proximity.add(tile);
|
proximity.add(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
tile.block().onProximityAdded(tile);
|
block.onProximityAdded(tile);
|
||||||
tile.block().onProximityUpdate(tile);
|
block.onProximityUpdate(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Array<Tile> proximity(){
|
public Array<Tile> proximity(){
|
||||||
@@ -238,7 +234,7 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float maxHealth(){
|
public float maxHealth(){
|
||||||
return tile.block().health;
|
return block.health;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -250,7 +246,6 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
public void onDeath(){
|
public void onDeath(){
|
||||||
if(!dead){
|
if(!dead){
|
||||||
dead = true;
|
dead = true;
|
||||||
Block block = tile.block();
|
|
||||||
|
|
||||||
Events.fire(new BlockDestroyEvent(tile));
|
Events.fire(new BlockDestroyEvent(tile));
|
||||||
block.onDestroyed(tile);
|
block.onDestroyed(tile);
|
||||||
@@ -273,22 +268,22 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
//TODO better smoke effect, this one is awful
|
//TODO better smoke effect, this one is awful
|
||||||
if(health != 0 && health < tile.block().health && !(tile.block() instanceof Wall) &&
|
if(health != 0 && health < block.health && !(block instanceof Wall) &&
|
||||||
Mathf.chance(0.009f * Time.delta() * (1f - health / tile.block().health))){
|
Mathf.chance(0.009f * Time.delta() * (1f - health / block.health))){
|
||||||
Effects.effect(Fx.smoke, x + Mathf.range(4), y + Mathf.range(4));
|
Effects.effect(Fx.smoke, x + Mathf.range(4), y + Mathf.range(4));
|
||||||
}
|
}
|
||||||
|
|
||||||
timeScaleDuration -= Time.delta();
|
timeScaleDuration -= Time.delta();
|
||||||
if(timeScaleDuration <= 0f || !tile.block().canOverdrive){
|
if(timeScaleDuration <= 0f || !block.canOverdrive){
|
||||||
timeScale = 1f;
|
timeScale = 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(health <= 0){
|
if(health <= 0){
|
||||||
onDeath();
|
onDeath();
|
||||||
}
|
}
|
||||||
Block previous = tile.block();
|
Block previous = block;
|
||||||
tile.block().update(tile);
|
block.update(tile);
|
||||||
if(tile.block() == previous && cons != null){
|
if(block == previous && cons != null){
|
||||||
cons.update();
|
cons.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
19
core/src/io/anuke/mindustry/type/LiquidStack.java
Normal file
19
core/src/io/anuke/mindustry/type/LiquidStack.java
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package io.anuke.mindustry.type;
|
||||||
|
|
||||||
|
public class LiquidStack{
|
||||||
|
public Liquid liquid;
|
||||||
|
public float amount;
|
||||||
|
|
||||||
|
public LiquidStack(Liquid liquid, float amount){
|
||||||
|
this.liquid = liquid;
|
||||||
|
this.amount = amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return "LiquidStack{" +
|
||||||
|
"liquid=" + liquid +
|
||||||
|
", amount=" + amount +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package io.anuke.mindustry.ui;
|
package io.anuke.mindustry.ui;
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.Core;
|
||||||
|
import io.anuke.arc.collection.Array;
|
||||||
import io.anuke.arc.collection.OrderedMap;
|
import io.anuke.arc.collection.OrderedMap;
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.Color;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
@@ -45,7 +46,7 @@ public class ContentDisplay{
|
|||||||
BlockStats stats = block.stats;
|
BlockStats stats = block.stats;
|
||||||
|
|
||||||
for(StatCategory cat : stats.toMap().keys()){
|
for(StatCategory cat : stats.toMap().keys()){
|
||||||
OrderedMap<BlockStat, StatValue> map = stats.toMap().get(cat);
|
OrderedMap<BlockStat, Array<StatValue>> map = stats.toMap().get(cat);
|
||||||
|
|
||||||
if(map.size == 0) continue;
|
if(map.size == 0) continue;
|
||||||
|
|
||||||
@@ -56,7 +57,13 @@ public class ContentDisplay{
|
|||||||
table.table(inset -> {
|
table.table(inset -> {
|
||||||
inset.left();
|
inset.left();
|
||||||
inset.add("[LIGHT_GRAY]" + stat.localized() + ":[] ");
|
inset.add("[LIGHT_GRAY]" + stat.localized() + ":[] ");
|
||||||
map.get(stat).display(inset);
|
Array<StatValue> arr = map.get(stat);
|
||||||
|
for(StatValue value : arr){
|
||||||
|
value.display(inset);
|
||||||
|
inset.add().size(10f);
|
||||||
|
}
|
||||||
|
|
||||||
|
//map.get(stat).display(inset);
|
||||||
}).fillX().padLeft(10);
|
}).fillX().padLeft(10);
|
||||||
table.row();
|
table.row();
|
||||||
}
|
}
|
||||||
@@ -201,7 +208,7 @@ public class ContentDisplay{
|
|||||||
|
|
||||||
table.add(Core.bundle.format("unit.health", unit.health));
|
table.add(Core.bundle.format("unit.health", unit.health));
|
||||||
table.row();
|
table.row();
|
||||||
table.add(Core.bundle.format("unit.speed", Strings.toFixed(unit.speed, 1)));
|
table.add(Core.bundle.format("unit.speed", Strings.fixed(unit.speed, 1)));
|
||||||
table.row();
|
table.row();
|
||||||
table.row();
|
table.row();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public class ItemDisplay extends Table{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ItemDisplay(Item item, int amount){
|
public ItemDisplay(Item item, int amount){
|
||||||
add(new ItemImage(new ItemStack(item, amount))).size(8*3);
|
add(new ItemImage(new ItemStack(item, amount))).size(8*4);
|
||||||
add(item.localizedName()).padLeft(4);
|
add(item.localizedName()).padLeft(4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class ItemImage extends Stack{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ItemImage(ItemStack stack){
|
public ItemImage(ItemStack stack){
|
||||||
add(new Image(stack.item.icon(Icon.medium)));
|
add(new Image(stack.item.icon(Icon.large)));
|
||||||
|
|
||||||
if(stack.amount != 0){
|
if(stack.amount != 0){
|
||||||
Table t = new Table().left().bottom();
|
Table t = new Table().left().bottom();
|
||||||
|
|||||||
@@ -1,14 +1,31 @@
|
|||||||
package io.anuke.mindustry.ui;
|
package io.anuke.mindustry.ui;
|
||||||
|
|
||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.arc.graphics.Color;
|
||||||
import io.anuke.arc.scene.ui.Image;
|
import io.anuke.arc.scene.ui.Image;
|
||||||
|
import io.anuke.arc.scene.ui.layout.Stack;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
|
import io.anuke.arc.util.Strings;
|
||||||
|
import io.anuke.mindustry.type.Liquid;
|
||||||
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
|
|
||||||
/**An ItemDisplay, but for liquids.*/
|
/**An ItemDisplay, but for liquids.*/
|
||||||
public class LiquidDisplay extends Table{
|
public class LiquidDisplay extends Table{
|
||||||
|
|
||||||
public LiquidDisplay(Liquid liquid){
|
public LiquidDisplay(Liquid liquid, float amount, boolean perSecond){
|
||||||
add(new Image(liquid.getContentIcon())).size(8*3);
|
add(new Stack(){{
|
||||||
add(liquid.localizedName()).padLeft(3);
|
add(new Image(liquid.getContentIcon()));
|
||||||
|
|
||||||
|
if(amount != 0){
|
||||||
|
Table t = new Table().left().bottom();
|
||||||
|
t.add(Strings.autoFixed(amount, 1));
|
||||||
|
add(t);
|
||||||
|
}
|
||||||
|
}}).size(8*4).padRight(3);
|
||||||
|
|
||||||
|
if(perSecond){
|
||||||
|
add(StatUnit.perSecond.localized()).padLeft(2).padRight(5).color(Color.LIGHT_GRAY);
|
||||||
|
}
|
||||||
|
|
||||||
|
add(liquid.localizedName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,9 +187,9 @@ public class BlockInventoryFragment extends Fragment{
|
|||||||
private String round(float f){
|
private String round(float f){
|
||||||
f = (int) f;
|
f = (int) f;
|
||||||
if(f >= 1000000){
|
if(f >= 1000000){
|
||||||
return Strings.toFixed(f / 1000000f, 1) + "[gray]mil[]";
|
return Strings.fixed(f / 1000000f, 1) + "[gray]mil[]";
|
||||||
}else if(f >= 1000){
|
}else if(f >= 1000){
|
||||||
return Strings.toFixed(f / 1000, 1) + "k";
|
return Strings.fixed(f / 1000, 1) + "k";
|
||||||
}else{
|
}else{
|
||||||
return (int) f + "";
|
return (int) f + "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ public class PlacementFragment extends Fragment{
|
|||||||
topTable.table(header -> {
|
topTable.table(header -> {
|
||||||
header.left();
|
header.left();
|
||||||
header.add(new Image(lastDisplay.icon(Icon.medium))).size(8 * 4);
|
header.add(new Image(lastDisplay.icon(Icon.medium))).size(8 * 4);
|
||||||
header.labelWrap(() -> !unlocked(lastDisplay) ? Core.bundle.get("blocks.unknown") : lastDisplay.localizedName)
|
header.labelWrap(() -> !unlocked(lastDisplay) ? Core.bundle.get("block.unknown") : lastDisplay.localizedName)
|
||||||
.left().width(190f).padLeft(5);
|
.left().width(190f).padLeft(5);
|
||||||
header.add().growX();
|
header.add().growX();
|
||||||
if(unlocked(lastDisplay)){
|
if(unlocked(lastDisplay)){
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import io.anuke.mindustry.ui.Bar;
|
|||||||
import io.anuke.mindustry.ui.ContentDisplay;
|
import io.anuke.mindustry.ui.ContentDisplay;
|
||||||
import io.anuke.mindustry.world.consumers.Consume;
|
import io.anuke.mindustry.world.consumers.Consume;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeLiquid;
|
import io.anuke.mindustry.world.consumers.ConsumeLiquid;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumePower;
|
import io.anuke.mindustry.world.consumers.ConsumeType;
|
||||||
import io.anuke.mindustry.world.meta.*;
|
import io.anuke.mindustry.world.meta.*;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -108,6 +108,9 @@ public class Block extends BlockStorage{
|
|||||||
public BooleanProvider buildVisibility = () -> false;
|
public BooleanProvider buildVisibility = () -> false;
|
||||||
public boolean alwaysUnlocked = false;
|
public boolean alwaysUnlocked = false;
|
||||||
|
|
||||||
|
protected TextureRegion[] cacheRegions = {};
|
||||||
|
protected Array<String> cacheRegionStrings = new Array<>();
|
||||||
|
|
||||||
protected Array<Tile> tempTiles = new Array<>();
|
protected Array<Tile> tempTiles = new Array<>();
|
||||||
protected TextureRegion[] icons = new TextureRegion[Icon.values().length];
|
protected TextureRegion[] icons = new TextureRegion[Icon.values().length];
|
||||||
protected TextureRegion[] generatedIcons;
|
protected TextureRegion[] generatedIcons;
|
||||||
@@ -316,12 +319,28 @@ public class Block extends BlockStorage{
|
|||||||
setStats();
|
setStats();
|
||||||
setBars();
|
setBars();
|
||||||
|
|
||||||
consumes.checkRequired(this);
|
consumes.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
region = Core.atlas.find(name);
|
region = Core.atlas.find(name);
|
||||||
|
|
||||||
|
cacheRegions = new TextureRegion[cacheRegionStrings.size];
|
||||||
|
for(int i = 0; i < cacheRegions.length; i++){
|
||||||
|
cacheRegions[i] = Core.atlas.find(cacheRegionStrings.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**Adds a region by name to be loaded, with the final name "{name}-suffix". Returns an ID to looks this region up by in {@link #reg(int)}.*/
|
||||||
|
protected int reg(String suffix){
|
||||||
|
cacheRegionStrings.add(name + suffix);
|
||||||
|
return cacheRegionStrings.size - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**Returns an internally cached region by ID.*/
|
||||||
|
protected TextureRegion reg(int id){
|
||||||
|
return cacheRegions[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Called when the block is tapped. */
|
/** Called when the block is tapped. */
|
||||||
@@ -374,7 +393,7 @@ public class Block extends BlockStorage{
|
|||||||
stats.add(BlockStat.size, "{0}x{0}", size);
|
stats.add(BlockStat.size, "{0}x{0}", size);
|
||||||
stats.add(BlockStat.health, health, StatUnit.none);
|
stats.add(BlockStat.health, health, StatUnit.none);
|
||||||
|
|
||||||
consumes.forEach(cons -> cons.display(stats));
|
consumes.display(stats);
|
||||||
|
|
||||||
// Note: Power stats are added by the consumers.
|
// Note: Power stats are added by the consumers.
|
||||||
if(hasLiquids) stats.add(BlockStat.liquidCapacity, liquidCapacity, StatUnit.liquidUnits);
|
if(hasLiquids) stats.add(BlockStat.liquidCapacity, liquidCapacity, StatUnit.liquidUnits);
|
||||||
@@ -386,25 +405,25 @@ public class Block extends BlockStorage{
|
|||||||
|
|
||||||
if(hasLiquids){
|
if(hasLiquids){
|
||||||
Function<TileEntity, Liquid> current;
|
Function<TileEntity, Liquid> current;
|
||||||
if(consumes.has(ConsumeLiquid.class)){
|
if(consumes.has(ConsumeType.liquid) && consumes.get(ConsumeType.liquid) instanceof ConsumeLiquid){
|
||||||
Liquid liquid = consumes.liquid();
|
Liquid liquid = consumes.<ConsumeLiquid>get(ConsumeType.liquid).liquid;
|
||||||
current = entity -> liquid;
|
current = entity -> liquid;
|
||||||
}else{
|
}else{
|
||||||
current = entity -> entity.liquids.current();
|
current = entity -> entity.liquids.current();
|
||||||
}
|
}
|
||||||
bars.add("liquid", entity -> new Bar(() -> entity.liquids.get(current.get(entity)) <= 0.001f ? Core.bundle.get("blocks.liquid") : current.get(entity).localizedName(), () -> current.get(entity).color, () -> entity.liquids.get(current.get(entity)) / liquidCapacity));
|
bars.add("liquid", entity -> new Bar(() -> entity.liquids.get(current.get(entity)) <= 0.001f ? Core.bundle.get("bar.liquid") : current.get(entity).localizedName(), () -> current.get(entity).color, () -> entity.liquids.get(current.get(entity)) / liquidCapacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hasPower && consumes.has(ConsumePower.class)){
|
if(hasPower && consumes.hasPower()){
|
||||||
boolean buffered = consumes.get(ConsumePower.class).isBuffered;
|
boolean buffered = consumes.getPower().isBuffered;
|
||||||
float capacity = consumes.get(ConsumePower.class).powerCapacity;
|
float capacity = consumes.getPower().powerCapacity;
|
||||||
|
|
||||||
bars.add("power", entity -> new Bar(() -> buffered ? Core.bundle.format("blocks.powerbalance", Float.isNaN(entity.power.satisfaction * capacity) ? "<ERROR>" : (int)(entity.power.satisfaction * capacity)) :
|
bars.add("power", entity -> new Bar(() -> buffered ? Core.bundle.format("bar.powerbalance", Float.isNaN(entity.power.satisfaction * capacity) ? "<ERROR>" : (int)(entity.power.satisfaction * capacity)) :
|
||||||
Core.bundle.get("blocks.power"), () -> Pal.powerBar, () -> entity.power.satisfaction));
|
Core.bundle.get("bar.power"), () -> Pal.powerBar, () -> entity.power.satisfaction));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hasItems && configurable){
|
if(hasItems && configurable){
|
||||||
bars.add("items", entity -> new Bar(() -> Core.bundle.format("blocks.items", entity.items.total()), () -> Pal.items, () -> (float)entity.items.total() / itemCapacity));
|
bars.add("items", entity -> new Bar(() -> Core.bundle.format("bar.items", entity.items.total()), () -> Pal.items, () -> (float)entity.items.total() / itemCapacity));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -456,8 +475,8 @@ public class Block extends BlockStorage{
|
|||||||
explosiveness += tile.entity.liquids.sum((liquid, amount) -> liquid.flammability * amount / 2f);
|
explosiveness += tile.entity.liquids.sum((liquid, amount) -> liquid.flammability * amount / 2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(consumes.has(ConsumePower.class) && consumes.get(ConsumePower.class).isBuffered){
|
if(consumes.hasPower() && consumes.getPower().isBuffered){
|
||||||
power += tile.entity.power.satisfaction * consumes.get(ConsumePower.class).powerCapacity;
|
power += tile.entity.power.satisfaction * consumes.getPower().powerCapacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hasLiquids){
|
if(hasLiquids){
|
||||||
|
|||||||
@@ -12,15 +12,10 @@ import io.anuke.mindustry.entities.type.TileEntity;
|
|||||||
import io.anuke.mindustry.entities.type.Unit;
|
import io.anuke.mindustry.entities.type.Unit;
|
||||||
import io.anuke.mindustry.game.UnlockableContent;
|
import io.anuke.mindustry.game.UnlockableContent;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
|
||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeItem;
|
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeItems;
|
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeLiquid;
|
|
||||||
import io.anuke.mindustry.world.consumers.Consumers;
|
import io.anuke.mindustry.world.consumers.Consumers;
|
||||||
import io.anuke.mindustry.world.meta.BlockBars;
|
import io.anuke.mindustry.world.meta.BlockBars;
|
||||||
import io.anuke.mindustry.world.meta.BlockStats;
|
import io.anuke.mindustry.world.meta.BlockStats;
|
||||||
import io.anuke.mindustry.world.meta.Producers;
|
|
||||||
|
|
||||||
public abstract class BlockStorage extends UnlockableContent{
|
public abstract class BlockStorage extends UnlockableContent{
|
||||||
public boolean hasItems;
|
public boolean hasItems;
|
||||||
@@ -28,7 +23,6 @@ public abstract class BlockStorage extends UnlockableContent{
|
|||||||
public boolean hasPower;
|
public boolean hasPower;
|
||||||
|
|
||||||
public boolean outputsLiquid = false;
|
public boolean outputsLiquid = false;
|
||||||
public boolean singleLiquid = true;
|
|
||||||
public boolean consumesPower = true;
|
public boolean consumesPower = true;
|
||||||
public boolean outputsPower = false;
|
public boolean outputsPower = false;
|
||||||
|
|
||||||
@@ -39,7 +33,6 @@ public abstract class BlockStorage extends UnlockableContent{
|
|||||||
public final BlockStats stats = new BlockStats();
|
public final BlockStats stats = new BlockStats();
|
||||||
public final BlockBars bars = new BlockBars();
|
public final BlockBars bars = new BlockBars();
|
||||||
public final Consumers consumes = new Consumers();
|
public final Consumers consumes = new Consumers();
|
||||||
public final Producers produces = new Producers();
|
|
||||||
|
|
||||||
public BlockStorage(String name){
|
public BlockStorage(String name){
|
||||||
super(name);
|
super(name);
|
||||||
@@ -98,21 +91,11 @@ public abstract class BlockStorage extends UnlockableContent{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean acceptItem(Item item, Tile tile, Tile source){
|
public boolean acceptItem(Item item, Tile tile, Tile source){
|
||||||
if(tile.entity != null && consumes.has(ConsumeItems.class)){
|
return consumes.itemFilters[item.id] && tile.entity.items.get(item) < getMaximumAccepted(tile, item);
|
||||||
for(ItemStack stack : consumes.items()){
|
|
||||||
if(stack.item == item){
|
|
||||||
return tile.entity.items.get(item) < getMaximumAccepted(tile, item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return tile.entity != null && consumes.has(ConsumeItem.class) && consumes.item() == item &&
|
|
||||||
tile.entity.items.get(item) < getMaximumAccepted(tile, item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
||||||
return hasLiquids && tile.entity.liquids.get(liquid) + amount < liquidCapacity &&
|
return hasLiquids && tile.entity.liquids.get(liquid) + amount < liquidCapacity && consumes.liquidfilters[liquid.id];
|
||||||
(!singleLiquid || (tile.entity.liquids.current() == liquid || tile.entity.liquids.get(tile.entity.liquids.current()) < 0.2f)) &&
|
|
||||||
(!consumes.has(ConsumeLiquid.class) || consumes.liquid() == liquid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
public void handleLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
||||||
@@ -128,7 +111,7 @@ public abstract class BlockStorage extends UnlockableContent{
|
|||||||
Tile other = proximity.get((i + dump) % proximity.size);
|
Tile other = proximity.get((i + dump) % proximity.size);
|
||||||
Tile in = Edges.getFacingEdge(tile, other);
|
Tile in = Edges.getFacingEdge(tile, other);
|
||||||
|
|
||||||
if(other.getTeamID() == tile.getTeamID() && other.block().hasLiquids && canDumpLiquid(tile, other, liquid)){
|
if(other.getTeam() == tile.getTeam() && other.block().hasLiquids && canDumpLiquid(tile, other, liquid)){
|
||||||
float ofract = other.entity.liquids.get(liquid) / other.block().liquidCapacity;
|
float ofract = other.entity.liquids.get(liquid) / other.block().liquidCapacity;
|
||||||
float fract = tile.entity.liquids.get(liquid) / liquidCapacity;
|
float fract = tile.entity.liquids.get(liquid) / liquidCapacity;
|
||||||
|
|
||||||
@@ -156,7 +139,7 @@ public abstract class BlockStorage extends UnlockableContent{
|
|||||||
|
|
||||||
next = next.target();
|
next = next.target();
|
||||||
|
|
||||||
if(next.getTeamID() == tile.getTeamID() && next.block().hasLiquids && tile.entity.liquids.get(liquid) > 0f){
|
if(next.getTeam() == tile.getTeam() && next.block().hasLiquids && tile.entity.liquids.get(liquid) > 0f){
|
||||||
|
|
||||||
if(next.block().acceptLiquid(next, tile, liquid, 0f)){
|
if(next.block().acceptLiquid(next, tile, liquid, 0f)){
|
||||||
float ofract = next.entity.liquids.get(liquid) / next.block().liquidCapacity;
|
float ofract = next.entity.liquids.get(liquid) / next.block().liquidCapacity;
|
||||||
@@ -206,7 +189,7 @@ public abstract class BlockStorage extends UnlockableContent{
|
|||||||
incrementDump(tile, proximity.size);
|
incrementDump(tile, proximity.size);
|
||||||
Tile other = proximity.get((i + dump) % proximity.size);
|
Tile other = proximity.get((i + dump) % proximity.size);
|
||||||
Tile in = Edges.getFacingEdge(tile, other);
|
Tile in = Edges.getFacingEdge(tile, other);
|
||||||
if(other.getTeamID() == tile.getTeamID() && other.block().acceptItem(item, other, in) && canDump(tile, other, item)){
|
if(other.getTeam() == tile.getTeam() && other.block().acceptItem(item, other, in) && canDump(tile, other, item)){
|
||||||
other.block().handleItem(item, other, in);
|
other.block().handleItem(item, other, in);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -215,9 +198,7 @@ public abstract class BlockStorage extends UnlockableContent{
|
|||||||
handleItem(item, tile, tile);
|
handleItem(item, tile, tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**Try dumping any item near the tile.*/
|
||||||
* Try dumping any item near the tile.
|
|
||||||
*/
|
|
||||||
public boolean tryDump(Tile tile){
|
public boolean tryDump(Tile tile){
|
||||||
return tryDump(tile, null);
|
return tryDump(tile, null);
|
||||||
}
|
}
|
||||||
@@ -246,7 +227,7 @@ public abstract class BlockStorage extends UnlockableContent{
|
|||||||
for(int ii = 0; ii < Vars.content.items().size; ii++){
|
for(int ii = 0; ii < Vars.content.items().size; ii++){
|
||||||
Item item = Vars.content.item(ii);
|
Item item = Vars.content.item(ii);
|
||||||
|
|
||||||
if(other.getTeamID() == tile.getTeamID() && entity.items.has(item) && other.block().acceptItem(item, other, in) && canDump(tile, other, item)){
|
if(other.getTeam() == tile.getTeam() && entity.items.has(item) && other.block().acceptItem(item, other, in) && canDump(tile, other, item)){
|
||||||
other.block().handleItem(item, other, in);
|
other.block().handleItem(item, other, in);
|
||||||
tile.entity.items.remove(item, 1);
|
tile.entity.items.remove(item, 1);
|
||||||
incrementDump(tile, proximity.size);
|
incrementDump(tile, proximity.size);
|
||||||
@@ -255,7 +236,7 @@ public abstract class BlockStorage extends UnlockableContent{
|
|||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
if(other.getTeamID() == tile.getTeamID() && other.block().acceptItem(todump, other, in) && canDump(tile, other, todump)){
|
if(other.getTeam() == tile.getTeam() && other.block().acceptItem(todump, other, in) && canDump(tile, other, todump)){
|
||||||
other.block().handleItem(todump, other, in);
|
other.block().handleItem(todump, other, in);
|
||||||
tile.entity.items.remove(todump, 1);
|
tile.entity.items.remove(todump, 1);
|
||||||
incrementDump(tile, proximity.size);
|
incrementDump(tile, proximity.size);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import io.anuke.mindustry.world.Block;
|
|||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumePower;
|
import io.anuke.mindustry.world.consumers.ConsumePower;
|
||||||
|
import io.anuke.mindustry.world.consumers.ConsumeType;
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
import io.anuke.mindustry.world.meta.StatUnit;
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
|
|
||||||
@@ -54,7 +55,7 @@ public class ForceProjector extends Block {
|
|||||||
canOverdrive = false;
|
canOverdrive = false;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.1f)).optional(true).boost(true).update(false);
|
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.1f)).optional(true).update(false);
|
||||||
consumePower = new ConsumeForceProjectorPower(60f, 60f);
|
consumePower = new ConsumeForceProjectorPower(60f, 60f);
|
||||||
consumes.add(consumePower);
|
consumes.add(consumePower);
|
||||||
}
|
}
|
||||||
@@ -71,6 +72,8 @@ public class ForceProjector extends Block {
|
|||||||
|
|
||||||
stats.add(BlockStat.powerUse, basePowerDraw * 60f, StatUnit.powerSecond);
|
stats.add(BlockStat.powerUse, basePowerDraw * 60f, StatUnit.powerSecond);
|
||||||
stats.add(BlockStat.powerDamage, powerDamage, StatUnit.powerUnits);
|
stats.add(BlockStat.powerDamage, powerDamage, StatUnit.powerUnits);
|
||||||
|
|
||||||
|
stats.add(BlockStat.boostEffect, phaseRadiusBoost/tilesize, StatUnit.blocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -83,10 +86,10 @@ public class ForceProjector extends Block {
|
|||||||
entity.shield.add();
|
entity.shield.add();
|
||||||
}
|
}
|
||||||
|
|
||||||
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, (float)entity.items.get(consumes.item()) / itemCapacity, 0.1f);
|
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, Mathf.num(entity.cons.optionalValid()), 0.1f);
|
||||||
|
|
||||||
if(entity.cons.valid() && !entity.broken && entity.timer.get(timerUse, phaseUseTime) && entity.items.total() > 0){
|
if(entity.cons.optionalValid() && !entity.broken && entity.timer.get(timerUse, phaseUseTime)){
|
||||||
entity.items.remove(consumes.item(), 1);
|
entity.cons.trigger();
|
||||||
}
|
}
|
||||||
|
|
||||||
entity.radscl = Mathf.lerpDelta(entity.radscl, entity.broken ? 0f : 1f, 0.05f);
|
entity.radscl = Mathf.lerpDelta(entity.radscl, entity.broken ? 0f : 1f, 0.05f);
|
||||||
@@ -95,7 +98,7 @@ public class ForceProjector extends Block {
|
|||||||
Effects.effect(Fx.reactorsmoke, tile.drawx() + Mathf.range(tilesize/2f), tile.drawy() + Mathf.range(tilesize/2f));
|
Effects.effect(Fx.reactorsmoke, tile.drawx() + Mathf.range(tilesize/2f), tile.drawy() + Mathf.range(tilesize/2f));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use Cases:
|
//use cases:
|
||||||
// - There is enough power in the buffer, and there are no shots fired => Draw base power and keep shield up
|
// - There is enough power in the buffer, and there are no shots fired => Draw base power and keep shield up
|
||||||
// - There is enough power in the buffer, but not enough power to cope for shots being fired => Draw all power and break shield
|
// - There is enough power in the buffer, but not enough power to cope for shots being fired => Draw all power and break shield
|
||||||
// - There is enough power in the buffer and enough power to cope for shots being fired => Draw base power + additional power based on shots absorbed
|
// - There is enough power in the buffer and enough power to cope for shots being fired => Draw base power + additional power based on shots absorbed
|
||||||
@@ -120,8 +123,9 @@ public class ForceProjector extends Block {
|
|||||||
|
|
||||||
if(entity.buildup > 0){
|
if(entity.buildup > 0){
|
||||||
float scale = !entity.broken ? cooldownNormal : cooldownBrokenBase;
|
float scale = !entity.broken ? cooldownNormal : cooldownBrokenBase;
|
||||||
if(consumes.get(ConsumeLiquidFilter.class).valid(this, entity)){
|
ConsumeLiquidFilter cons = consumes.get(ConsumeType.liquid);
|
||||||
consumes.get(ConsumeLiquidFilter.class).update(this, entity);
|
if(cons.valid(entity)){
|
||||||
|
cons.update(entity);
|
||||||
scale *= (cooldownLiquid * (1f+(entity.liquids.current().heatCapacity-0.4f)*0.9f));
|
scale *= (cooldownLiquid * (1f+(entity.liquids.current().heatCapacity-0.4f)*0.9f));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,8 +272,8 @@ public class ForceProjector extends Block {
|
|||||||
super(powerCapacity / ticksToFill, powerCapacity, true);
|
super(powerCapacity / ticksToFill, powerCapacity, true);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean valid(Block block, TileEntity entity){
|
public boolean valid(TileEntity entity){
|
||||||
return entity.power.satisfaction >= basePowerDraw / powerCapacity && super.valid(block, entity);
|
return entity.power.satisfaction >= basePowerDraw / powerCapacity && super.valid(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,9 @@ public class MendProjector extends Block{
|
|||||||
|
|
||||||
stats.add(BlockStat.repairTime, (int)(100f / healPercent * reload / 60f), StatUnit.seconds);
|
stats.add(BlockStat.repairTime, (int)(100f / healPercent * reload / 60f), StatUnit.seconds);
|
||||||
stats.add(BlockStat.range, range / tilesize, StatUnit.blocks);
|
stats.add(BlockStat.range, range / tilesize, StatUnit.blocks);
|
||||||
|
|
||||||
|
stats.add(BlockStat.boostEffect, phaseRangeBoost/tilesize, StatUnit.blocks);
|
||||||
|
stats.add(BlockStat.boostEffect, (phaseBoost + healPercent) / healPercent, StatUnit.timesSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -68,10 +71,10 @@ public class MendProjector extends Block{
|
|||||||
entity.heat = Mathf.lerpDelta(entity.heat, entity.cons.valid() || tile.isEnemyCheat() ? 1f : 0f, 0.08f);
|
entity.heat = Mathf.lerpDelta(entity.heat, entity.cons.valid() || tile.isEnemyCheat() ? 1f : 0f, 0.08f);
|
||||||
entity.charge += entity.heat * entity.delta();
|
entity.charge += entity.heat * entity.delta();
|
||||||
|
|
||||||
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, (float)entity.items.get(consumes.item()) / itemCapacity, 0.1f);
|
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, Mathf.num(entity.cons.optionalValid()), 0.1f);
|
||||||
|
|
||||||
if(entity.cons.valid() && entity.timer.get(timerUse, useTime) && entity.items.total() > 0){
|
if(entity.cons.optionalValid() && entity.timer.get(timerUse, useTime)){
|
||||||
entity.items.remove(consumes.item(), 1);
|
entity.cons.trigger();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(entity.charge >= reload){
|
if(entity.charge >= reload){
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import io.anuke.arc.util.Time;
|
|||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
import io.anuke.mindustry.entities.type.TileEntity;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
|
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
@@ -50,16 +52,27 @@ public class OverdriveProjector extends Block{
|
|||||||
topRegion = Core.atlas.find(name + "-top");
|
topRegion = Core.atlas.find(name + "-top");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setStats(){
|
||||||
|
super.setStats();
|
||||||
|
|
||||||
|
stats.add(BlockStat.speedIncrease, (int)(100f * speedBoost), StatUnit.percent);
|
||||||
|
stats.add(BlockStat.range, range / tilesize, StatUnit.blocks);
|
||||||
|
|
||||||
|
stats.add(BlockStat.boostEffect, phaseRangeBoost/tilesize, StatUnit.blocks);
|
||||||
|
stats.add(BlockStat.boostEffect, (int)((speedBoost + speedBoostPhase) * 100f), StatUnit.percent);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Tile tile){
|
public void update(Tile tile){
|
||||||
OverdriveEntity entity = tile.entity();
|
OverdriveEntity entity = tile.entity();
|
||||||
entity.heat = Mathf.lerpDelta(entity.heat, entity.cons.valid() ? 1f : 0f, 0.08f);
|
entity.heat = Mathf.lerpDelta(entity.heat, entity.cons.valid() ? 1f : 0f, 0.08f);
|
||||||
entity.charge += entity.heat * Time.delta();
|
entity.charge += entity.heat * Time.delta();
|
||||||
|
|
||||||
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, (float)entity.items.get(consumes.item()) / itemCapacity, 0.1f);
|
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, Mathf.num(entity.cons.optionalValid()), 0.1f);
|
||||||
|
|
||||||
if(entity.timer.get(timerUse, useTime) && entity.items.total() > 0){
|
if(entity.timer.get(timerUse, useTime)){
|
||||||
entity.items.remove(consumes.item(), 1);
|
entity.cons.trigger();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(entity.charge >= reload){
|
if(entity.charge >= reload){
|
||||||
|
|||||||
@@ -1,21 +1,23 @@
|
|||||||
package io.anuke.mindustry.world.blocks.defense.turrets;
|
package io.anuke.mindustry.world.blocks.defense.turrets;
|
||||||
|
|
||||||
|
import io.anuke.arc.math.Mathf;
|
||||||
|
import io.anuke.arc.util.Time;
|
||||||
import io.anuke.mindustry.content.Fx;
|
import io.anuke.mindustry.content.Fx;
|
||||||
import io.anuke.mindustry.type.Liquid;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
|
||||||
import io.anuke.mindustry.entities.Effects;
|
import io.anuke.mindustry.entities.Effects;
|
||||||
import io.anuke.mindustry.entities.Effects.Effect;
|
import io.anuke.mindustry.entities.Effects.Effect;
|
||||||
import io.anuke.arc.util.Time;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
import io.anuke.mindustry.world.consumers.ConsumeLiquidBase;
|
||||||
|
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
||||||
|
import io.anuke.mindustry.world.consumers.ConsumeType;
|
||||||
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.tilesize;
|
import static io.anuke.mindustry.Vars.tilesize;
|
||||||
|
|
||||||
public class CooledTurret extends Turret{
|
public class CooledTurret extends Turret{
|
||||||
/**How much reload is lowered by for each unit of liquid of heat capacity 1.*/
|
/**How much reload is lowered by for each unit of liquid of heat capacity.*/
|
||||||
protected float coolantMultiplier = 1f;
|
protected float coolantMultiplier = 2f;
|
||||||
/**Max coolant used per tick.*/
|
|
||||||
protected float maxCoolantUsed = 1f;
|
|
||||||
protected Effect coolEffect = Fx.fuelburn;
|
protected Effect coolEffect = Fx.fuelburn;
|
||||||
|
|
||||||
public CooledTurret(String name){
|
public CooledTurret(String name){
|
||||||
@@ -23,17 +25,28 @@ public class CooledTurret extends Turret{
|
|||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
liquidCapacity = 20f;
|
liquidCapacity = 20f;
|
||||||
|
|
||||||
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.01f)).update(false).optional(true);
|
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.5f)).update(false).optional(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setStats(){
|
||||||
|
super.setStats();
|
||||||
|
|
||||||
|
float maxUsed = consumes.<ConsumeLiquidBase>get(ConsumeType.liquid).amount;
|
||||||
|
|
||||||
|
stats.add(BlockStat.boostEffect, 1f + maxUsed * coolantMultiplier, StatUnit.timesSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateShooting(Tile tile){
|
protected void updateShooting(Tile tile){
|
||||||
super.updateShooting(tile);
|
super.updateShooting(tile);
|
||||||
|
|
||||||
|
float maxUsed = consumes.<ConsumeLiquidBase>get(ConsumeType.liquid).amount;
|
||||||
|
|
||||||
TurretEntity entity = tile.entity();
|
TurretEntity entity = tile.entity();
|
||||||
Liquid liquid = entity.liquids.current();
|
Liquid liquid = entity.liquids.current();
|
||||||
|
|
||||||
float used = Math.min(Math.min(entity.liquids.get(liquid), maxCoolantUsed * Time.delta()), Math.max(0, ((reload - entity.reload) / coolantMultiplier) / liquid.heatCapacity));
|
float used = Math.min(Math.min(entity.liquids.get(liquid), maxUsed * Time.delta()), Math.max(0, ((reload - entity.reload) / coolantMultiplier) / liquid.heatCapacity));
|
||||||
entity.reload += (used * liquid.heatCapacity) / liquid.heatCapacity;
|
entity.reload += (used * liquid.heatCapacity) / liquid.heatCapacity;
|
||||||
entity.liquids.remove(liquid, used);
|
entity.liquids.remove(liquid, used);
|
||||||
|
|
||||||
@@ -41,9 +54,4 @@ public class CooledTurret extends Turret{
|
|||||||
Effects.effect(coolEffect, tile.drawx() + Mathf.range(size * tilesize / 2f), tile.drawy() + Mathf.range(size * tilesize / 2f));
|
Effects.effect(coolEffect, tile.drawx() + Mathf.range(size * tilesize / 2f), tile.drawy() + Mathf.range(size * tilesize / 2f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
|
||||||
return super.acceptLiquid(tile, source, liquid, amount) && liquid.temperature <= 0.5f;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
package io.anuke.mindustry.world.blocks.defense.turrets;
|
package io.anuke.mindustry.world.blocks.defense.turrets;
|
||||||
|
|
||||||
import io.anuke.mindustry.entities.Effects;
|
|
||||||
import io.anuke.arc.math.Angles;
|
import io.anuke.arc.math.Angles;
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.Mathf;
|
||||||
import io.anuke.arc.util.Time;
|
import io.anuke.arc.util.Time;
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
import io.anuke.mindustry.entities.Effects;
|
||||||
import io.anuke.mindustry.entities.bullet.Bullet;
|
import io.anuke.mindustry.entities.bullet.Bullet;
|
||||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||||
|
import io.anuke.mindustry.entities.type.TileEntity;
|
||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
import io.anuke.mindustry.world.consumers.ConsumeLiquidBase;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
||||||
|
import io.anuke.mindustry.world.consumers.ConsumeType;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.tilesize;
|
import static io.anuke.mindustry.Vars.tilesize;
|
||||||
|
|
||||||
@@ -21,7 +23,6 @@ public class LaserTurret extends PowerTurret{
|
|||||||
super(name);
|
super(name);
|
||||||
canOverdrive = false;
|
canOverdrive = false;
|
||||||
|
|
||||||
consumes.remove(ConsumeLiquidFilter.class);
|
|
||||||
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.01f)).update(false);
|
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.01f)).update(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,8 +62,9 @@ public class LaserTurret extends PowerTurret{
|
|||||||
entity.reload = 0f;
|
entity.reload = 0f;
|
||||||
}else{
|
}else{
|
||||||
Liquid liquid = entity.liquids.current();
|
Liquid liquid = entity.liquids.current();
|
||||||
|
float maxUsed = consumes.<ConsumeLiquidBase>get(ConsumeType.liquid).amount;
|
||||||
|
|
||||||
float used = Math.min(Math.min(entity.liquids.get(liquid), maxCoolantUsed * Time.delta()), Math.max(0, ((reload - entity.reload) / coolantMultiplier) / liquid.heatCapacity));
|
float used = Math.min(Math.min(entity.liquids.get(liquid), maxUsed * Time.delta()), Math.max(0, ((reload - entity.reload) / coolantMultiplier) / liquid.heatCapacity));
|
||||||
entity.reload += (used * liquid.heatCapacity) / liquid.heatCapacity;
|
entity.reload += (used * liquid.heatCapacity) / liquid.heatCapacity;
|
||||||
entity.liquids.remove(liquid, used);
|
entity.liquids.remove(liquid, used);
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package io.anuke.mindustry.world.blocks.defense.turrets;
|
|||||||
|
|
||||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumePower;
|
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
import io.anuke.mindustry.world.meta.StatUnit;
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
|
|
||||||
@@ -20,7 +19,7 @@ public abstract class PowerTurret extends CooledTurret{
|
|||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
|
|
||||||
stats.add(BlockStat.powerShot, powerUsed * consumes.get(ConsumePower.class).powerCapacity, StatUnit.powerUnits);
|
stats.add(BlockStat.powerShot, powerUsed * consumes.getPower().powerCapacity, StatUnit.powerUnits);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ public class MassDriver extends Block{
|
|||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
|
|
||||||
stats.add(BlockStat.powerShot, consumes.get(ConsumePower.class).powerCapacity * powerPercentageUsed, StatUnit.powerUnits);
|
stats.add(BlockStat.powerShot, consumes.getPower().powerCapacity * powerPercentageUsed, StatUnit.powerUnits);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.blocks.power;
|
|
||||||
|
|
||||||
import io.anuke.mindustry.type.Item;
|
|
||||||
import io.anuke.mindustry.type.Liquid;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeItem;
|
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeLiquid;
|
|
||||||
|
|
||||||
public class DifferentialGenerator extends TurbineGenerator{
|
|
||||||
|
|
||||||
public DifferentialGenerator(String name){
|
|
||||||
super(name);
|
|
||||||
|
|
||||||
hasLiquids = true;
|
|
||||||
consumes.require(ConsumeItem.class);
|
|
||||||
consumes.require(ConsumeLiquid.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean acceptItem(Item item, Tile tile, Tile source){
|
|
||||||
return hasItems && consumes.item() == item && tile.entity.items.total() < itemCapacity;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
|
||||||
return hasLiquids && consumes.liquid() == liquid && tile.entity.liquids.get(liquid) < liquidCapacity;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -16,7 +16,8 @@ import io.anuke.mindustry.entities.type.TileEntity;
|
|||||||
import io.anuke.mindustry.graphics.Pal;
|
import io.anuke.mindustry.graphics.Pal;
|
||||||
import io.anuke.mindustry.ui.Bar;
|
import io.anuke.mindustry.ui.Bar;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumePower;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
|
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
@@ -29,7 +30,7 @@ public class ImpactReactor extends PowerGenerator{
|
|||||||
|
|
||||||
protected int plasmas = 4;
|
protected int plasmas = 4;
|
||||||
protected float warmupSpeed = 0.001f;
|
protected float warmupSpeed = 0.001f;
|
||||||
protected float useTime = 60f;
|
protected float itemDuration = 60f;
|
||||||
protected int explosionRadius = 30;
|
protected int explosionRadius = 30;
|
||||||
protected int explosionDamage = 180;
|
protected int explosionDamage = 180;
|
||||||
|
|
||||||
@@ -51,12 +52,21 @@ public class ImpactReactor extends PowerGenerator{
|
|||||||
super.setBars();
|
super.setBars();
|
||||||
|
|
||||||
bars.add("poweroutput", entity -> new Bar(() ->
|
bars.add("poweroutput", entity -> new Bar(() ->
|
||||||
Core.bundle.format("blocks.poweroutput",
|
Core.bundle.format("bar.poweroutput",
|
||||||
Strings.toFixed(Math.max(entity.tile.block().getPowerProduction(entity.tile) - consumes.get(ConsumePower.class).powerPerTick, 0)*60 * entity.delta(), 1)),
|
Strings.fixed(Math.max(entity.tile.block().getPowerProduction(entity.tile) - consumes.getPower().powerPerTick, 0)*60 * entity.delta(), 1)),
|
||||||
() -> Pal.powerBar,
|
() -> Pal.powerBar,
|
||||||
() -> ((GeneratorEntity)entity).productionEfficiency));
|
() -> ((GeneratorEntity)entity).productionEfficiency));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setStats(){
|
||||||
|
super.setStats();
|
||||||
|
|
||||||
|
if(hasItems){
|
||||||
|
stats.add(BlockStat.productionTime, itemDuration / 60f, StatUnit.seconds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Tile tile){
|
public void update(Tile tile){
|
||||||
FusionReactorEntity entity = tile.entity();
|
FusionReactorEntity entity = tile.entity();
|
||||||
@@ -64,8 +74,8 @@ public class ImpactReactor extends PowerGenerator{
|
|||||||
if(entity.cons.valid()){
|
if(entity.cons.valid()){
|
||||||
entity.warmup = Mathf.lerpDelta(entity.warmup, 1f, warmupSpeed);
|
entity.warmup = Mathf.lerpDelta(entity.warmup, 1f, warmupSpeed);
|
||||||
|
|
||||||
if(entity.timer.get(timerUse, useTime)){
|
if(entity.timer.get(timerUse, itemDuration)){
|
||||||
entity.items.remove(consumes.item(), consumes.itemAmount());
|
entity.cons.trigger();
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
entity.warmup = Mathf.lerpDelta(entity.warmup, 0f, 0.01f);
|
entity.warmup = Mathf.lerpDelta(entity.warmup, 0f, 0.01f);
|
||||||
|
|||||||
@@ -1,19 +1,21 @@
|
|||||||
package io.anuke.mindustry.world.blocks.power;
|
package io.anuke.mindustry.world.blocks.power;
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.Core;
|
||||||
import io.anuke.mindustry.entities.Effects;
|
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.Color;
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
import io.anuke.arc.graphics.g2d.Draw;
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.Mathf;
|
||||||
import io.anuke.arc.util.Time;
|
import io.anuke.arc.util.Time;
|
||||||
import io.anuke.mindustry.content.Fx;
|
import io.anuke.mindustry.content.Fx;
|
||||||
|
import io.anuke.mindustry.entities.Effects;
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
import io.anuke.mindustry.entities.type.TileEntity;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeItemFilter;
|
import io.anuke.mindustry.world.consumers.ConsumeItemFilter;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
||||||
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.content;
|
import static io.anuke.mindustry.Vars.content;
|
||||||
import static io.anuke.mindustry.Vars.tilesize;
|
import static io.anuke.mindustry.Vars.tilesize;
|
||||||
@@ -44,11 +46,11 @@ public class ItemLiquidGenerator extends PowerGenerator{
|
|||||||
this.hasLiquids = hasLiquids;
|
this.hasLiquids = hasLiquids;
|
||||||
|
|
||||||
if(hasItems){
|
if(hasItems){
|
||||||
consumes.add(new ConsumeItemFilter(item -> getItemEfficiency(item) >= minItemEfficiency)).update(false).optional(true);
|
consumes.add(new ConsumeItemFilter(item -> getItemEfficiency(item) >= minItemEfficiency)).update(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hasLiquids){
|
if(hasLiquids){
|
||||||
consumes.add(new ConsumeLiquidFilter(liquid -> getLiquidEfficiency(liquid) >= minLiquidEfficiency, 0.001f, true)).update(false).optional(true);
|
consumes.add(new ConsumeLiquidFilter(liquid -> getLiquidEfficiency(liquid) >= minLiquidEfficiency, maxLiquidGenerate)).update(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,6 +62,15 @@ public class ItemLiquidGenerator extends PowerGenerator{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setStats(){
|
||||||
|
super.setStats();
|
||||||
|
|
||||||
|
if(hasItems){
|
||||||
|
stats.add(BlockStat.productionTime, itemDuration / 60f, StatUnit.seconds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Tile tile){
|
public void update(Tile tile){
|
||||||
ItemLiquidGeneratorEntity entity = tile.entity();
|
ItemLiquidGeneratorEntity entity = tile.entity();
|
||||||
|
|||||||
@@ -12,9 +12,15 @@ import io.anuke.mindustry.entities.Damage;
|
|||||||
import io.anuke.mindustry.entities.Effects;
|
import io.anuke.mindustry.entities.Effects;
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
import io.anuke.mindustry.entities.type.TileEntity;
|
||||||
import io.anuke.mindustry.graphics.Pal;
|
import io.anuke.mindustry.graphics.Pal;
|
||||||
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.mindustry.ui.Bar;
|
import io.anuke.mindustry.ui.Bar;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
import io.anuke.mindustry.world.consumers.ConsumeItems;
|
||||||
|
import io.anuke.mindustry.world.consumers.ConsumeLiquid;
|
||||||
|
import io.anuke.mindustry.world.consumers.ConsumeType;
|
||||||
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
|
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
@@ -29,7 +35,7 @@ public class NuclearReactor extends PowerGenerator{
|
|||||||
|
|
||||||
protected Color coolColor = new Color(1, 1, 1, 0f);
|
protected Color coolColor = new Color(1, 1, 1, 0f);
|
||||||
protected Color hotColor = Color.valueOf("ff9575a3");
|
protected Color hotColor = Color.valueOf("ff9575a3");
|
||||||
protected int fuelUseTime = 120; //time to consume 1 fuel
|
protected int itemDuration = 120; //time to consume 1 fuel
|
||||||
protected float heating = 0.01f; //heating per frame * fullness
|
protected float heating = 0.01f; //heating per frame * fullness
|
||||||
protected float smokeThreshold = 0.3f; //threshold at which block starts smoking
|
protected float smokeThreshold = 0.3f; //threshold at which block starts smoking
|
||||||
protected int explosionRadius = 19;
|
protected int explosionRadius = 19;
|
||||||
@@ -47,6 +53,15 @@ public class NuclearReactor extends PowerGenerator{
|
|||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setStats(){
|
||||||
|
super.setStats();
|
||||||
|
|
||||||
|
if(hasItems){
|
||||||
|
stats.add(BlockStat.productionTime, itemDuration / 60f, StatUnit.seconds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
super.load();
|
super.load();
|
||||||
@@ -58,27 +73,30 @@ public class NuclearReactor extends PowerGenerator{
|
|||||||
@Override
|
@Override
|
||||||
public void setBars(){
|
public void setBars(){
|
||||||
super.setBars();
|
super.setBars();
|
||||||
bars.add("heat", entity -> new Bar("blocks.heat", Pal.lightOrange, () -> ((NuclearReactorEntity)entity).heat));
|
bars.add("heat", entity -> new Bar("bar.heat", Pal.lightOrange, () -> ((NuclearReactorEntity)entity).heat));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Tile tile){
|
public void update(Tile tile){
|
||||||
NuclearReactorEntity entity = tile.entity();
|
NuclearReactorEntity entity = tile.entity();
|
||||||
|
|
||||||
int fuel = entity.items.get(consumes.item());
|
ConsumeLiquid cliquid = consumes.get(ConsumeType.liquid);
|
||||||
|
Item item = consumes.<ConsumeItems>get(ConsumeType.item).items[0].item;
|
||||||
|
|
||||||
|
int fuel = entity.items.get(item);
|
||||||
float fullness = (float) fuel / itemCapacity;
|
float fullness = (float) fuel / itemCapacity;
|
||||||
entity.productionEfficiency = fullness;
|
entity.productionEfficiency = fullness;
|
||||||
|
|
||||||
if(fuel > 0){
|
if(fuel > 0){
|
||||||
entity.heat += fullness * heating * Math.min(entity.delta(), 4f);
|
entity.heat += fullness * heating * Math.min(entity.delta(), 4f);
|
||||||
|
|
||||||
if(entity.timer.get(timerFuel, fuelUseTime)){
|
if(entity.timer.get(timerFuel, itemDuration)){
|
||||||
entity.cons.trigger();
|
entity.cons.trigger();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Liquid liquid = consumes.liquid();
|
Liquid liquid = cliquid.liquid;
|
||||||
float liquidAmount = consumes.liquidAmount();
|
float liquidAmount = cliquid.amount;
|
||||||
|
|
||||||
if(entity.heat > 0){
|
if(entity.heat > 0){
|
||||||
float maxUsed = Math.min(Math.min(entity.liquids.get(liquid), entity.heat / coolantPower), liquidAmount * entity.delta());
|
float maxUsed = Math.min(Math.min(entity.liquids.get(liquid), entity.heat / coolantPower), liquidAmount * entity.delta());
|
||||||
@@ -109,7 +127,7 @@ public class NuclearReactor extends PowerGenerator{
|
|||||||
|
|
||||||
NuclearReactorEntity entity = tile.entity();
|
NuclearReactorEntity entity = tile.entity();
|
||||||
|
|
||||||
int fuel = entity.items.get(consumes.item());
|
int fuel = entity.items.get(consumes.<ConsumeItems>get(ConsumeType.item).items[0].item);
|
||||||
|
|
||||||
if(fuel < 5 && entity.heat < 0.5f) return;
|
if(fuel < 5 && entity.heat < 0.5f) return;
|
||||||
|
|
||||||
|
|||||||
@@ -37,10 +37,10 @@ public class PowerGenerator extends PowerDistributor{
|
|||||||
public void setBars(){
|
public void setBars(){
|
||||||
super.setBars();
|
super.setBars();
|
||||||
|
|
||||||
if(hasPower && outputsPower && !consumes.has(ConsumePower.class)){
|
if(hasPower && outputsPower && !consumes.hasPower()){
|
||||||
bars.add("power", entity -> new Bar(() ->
|
bars.add("power", entity -> new Bar(() ->
|
||||||
Core.bundle.format("blocks.poweroutput",
|
Core.bundle.format("bar.poweroutput",
|
||||||
Strings.toFixed(entity.tile.block().getPowerProduction(entity.tile)*60 * entity.timeScale, 1)),
|
Strings.fixed(entity.tile.block().getPowerProduction(entity.tile)*60 * entity.timeScale, 1)),
|
||||||
() -> Pal.powerBar,
|
() -> Pal.powerBar,
|
||||||
() -> ((GeneratorEntity)entity).productionEfficiency));
|
() -> ((GeneratorEntity)entity).productionEfficiency));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ public class PowerGraph{
|
|||||||
float powerNeeded = 0f;
|
float powerNeeded = 0f;
|
||||||
for(Tile consumer : consumers){
|
for(Tile consumer : consumers){
|
||||||
Consumers consumes = consumer.block().consumes;
|
Consumers consumes = consumer.block().consumes;
|
||||||
if(consumes.has(ConsumePower.class)){
|
if(consumes.hasPower()){
|
||||||
ConsumePower consumePower = consumes.get(ConsumePower.class);
|
ConsumePower consumePower = consumes.getPower();
|
||||||
if(otherConsumersAreValid(consumer, consumePower)){
|
if(otherConsumersAreValid(consumer, consumePower)){
|
||||||
powerNeeded += consumePower.requestedPower(consumer.block(), consumer.entity) * consumer.entity.delta();
|
powerNeeded += consumePower.requestedPower(consumer.block(), consumer.entity) * consumer.entity.delta();
|
||||||
}
|
}
|
||||||
@@ -68,8 +68,8 @@ public class PowerGraph{
|
|||||||
float totalAccumulator = 0f;
|
float totalAccumulator = 0f;
|
||||||
for(Tile battery : batteries){
|
for(Tile battery : batteries){
|
||||||
Consumers consumes = battery.block().consumes;
|
Consumers consumes = battery.block().consumes;
|
||||||
if(consumes.has(ConsumePower.class)){
|
if(consumes.hasPower()){
|
||||||
totalAccumulator += battery.entity.power.satisfaction * consumes.get(ConsumePower.class).powerCapacity;
|
totalAccumulator += battery.entity.power.satisfaction * consumes.getPower().powerCapacity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return totalAccumulator;
|
return totalAccumulator;
|
||||||
@@ -79,8 +79,8 @@ public class PowerGraph{
|
|||||||
float totalCapacity = 0f;
|
float totalCapacity = 0f;
|
||||||
for(Tile battery : batteries){
|
for(Tile battery : batteries){
|
||||||
Consumers consumes = battery.block().consumes;
|
Consumers consumes = battery.block().consumes;
|
||||||
if(consumes.has(ConsumePower.class)){
|
if(consumes.hasPower()){
|
||||||
totalCapacity += consumes.get(ConsumePower.class).requestedPower(battery.block(), battery.entity) * battery.entity.delta();
|
totalCapacity += consumes.getPower().requestedPower(battery.block(), battery.entity) * battery.entity.delta();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return totalCapacity;
|
return totalCapacity;
|
||||||
@@ -94,8 +94,8 @@ public class PowerGraph{
|
|||||||
float consumedPowerPercentage = Math.min(1.0f, needed / stored);
|
float consumedPowerPercentage = Math.min(1.0f, needed / stored);
|
||||||
for(Tile battery : batteries){
|
for(Tile battery : batteries){
|
||||||
Consumers consumes = battery.block().consumes;
|
Consumers consumes = battery.block().consumes;
|
||||||
if(consumes.has(ConsumePower.class)){
|
if(consumes.hasPower()){
|
||||||
ConsumePower consumePower = consumes.get(ConsumePower.class);
|
ConsumePower consumePower = consumes.getPower();
|
||||||
if(consumePower.powerCapacity > 0f){
|
if(consumePower.powerCapacity > 0f){
|
||||||
battery.entity.power.satisfaction = Math.max(0.0f, battery.entity.power.satisfaction - consumedPowerPercentage);
|
battery.entity.power.satisfaction = Math.max(0.0f, battery.entity.power.satisfaction - consumedPowerPercentage);
|
||||||
}
|
}
|
||||||
@@ -110,8 +110,8 @@ public class PowerGraph{
|
|||||||
|
|
||||||
for(Tile battery : batteries){
|
for(Tile battery : batteries){
|
||||||
Consumers consumes = battery.block().consumes;
|
Consumers consumes = battery.block().consumes;
|
||||||
if(consumes.has(ConsumePower.class)){
|
if(consumes.hasPower()){
|
||||||
ConsumePower consumePower = consumes.get(ConsumePower.class);
|
ConsumePower consumePower = consumes.getPower();
|
||||||
if(consumePower.powerCapacity > 0f){
|
if(consumePower.powerCapacity > 0f){
|
||||||
float additionalPowerPercentage = Math.min(1.0f, excess / consumePower.powerCapacity);
|
float additionalPowerPercentage = Math.min(1.0f, excess / consumePower.powerCapacity);
|
||||||
battery.entity.power.satisfaction = Math.min(1.0f, battery.entity.power.satisfaction + additionalPowerPercentage);
|
battery.entity.power.satisfaction = Math.min(1.0f, battery.entity.power.satisfaction + additionalPowerPercentage);
|
||||||
@@ -126,8 +126,8 @@ public class PowerGraph{
|
|||||||
float coverage = Mathf.isZero(needed) ? 1f : Math.min(1, produced / needed);
|
float coverage = Mathf.isZero(needed) ? 1f : Math.min(1, produced / needed);
|
||||||
for(Tile consumer : consumers){
|
for(Tile consumer : consumers){
|
||||||
Consumers consumes = consumer.block().consumes;
|
Consumers consumes = consumer.block().consumes;
|
||||||
if(consumes.has(ConsumePower.class)){
|
if(consumes.hasPower()){
|
||||||
ConsumePower consumePower = consumes.get(ConsumePower.class);
|
ConsumePower consumePower = consumes.getPower();
|
||||||
//currently satisfies power even if it's not required yet
|
//currently satisfies power even if it's not required yet
|
||||||
if(consumePower.isBuffered){
|
if(consumePower.isBuffered){
|
||||||
if(!Mathf.isZero(consumePower.powerCapacity)){
|
if(!Mathf.isZero(consumePower.powerCapacity)){
|
||||||
@@ -176,7 +176,7 @@ public class PowerGraph{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void add(Tile tile){
|
public void add(Tile tile){
|
||||||
if(tile.block().consumes.has(ConsumePower.class) && !tile.block().consumes.get(ConsumePower.class).isBuffered){
|
if(tile.block().consumes.hasPower() && !tile.block().consumes.getPower().isBuffered){
|
||||||
//reset satisfaction to zero in case of direct consumer. There is no reason to clear power from buffered consumers.
|
//reset satisfaction to zero in case of direct consumer. There is no reason to clear power from buffered consumers.
|
||||||
tile.entity.power.satisfaction = 0.0f;
|
tile.entity.power.satisfaction = 0.0f;
|
||||||
}
|
}
|
||||||
@@ -184,7 +184,7 @@ public class PowerGraph{
|
|||||||
tile.entity.power.graph = this;
|
tile.entity.power.graph = this;
|
||||||
all.add(tile);
|
all.add(tile);
|
||||||
|
|
||||||
if(tile.block().outputsPower && tile.block().consumesPower && !tile.block().consumes.get(ConsumePower.class).isBuffered){
|
if(tile.block().outputsPower && tile.block().consumesPower && !tile.block().consumes.getPower().isBuffered){
|
||||||
producers.add(tile);
|
producers.add(tile);
|
||||||
consumers.add(tile);
|
consumers.add(tile);
|
||||||
}else if(tile.block().outputsPower && tile.block().consumesPower){
|
}else if(tile.block().outputsPower && tile.block().consumesPower){
|
||||||
@@ -259,7 +259,7 @@ public class PowerGraph{
|
|||||||
|
|
||||||
private boolean otherConsumersAreValid(Tile tile, Consume consumePower){
|
private boolean otherConsumersAreValid(Tile tile, Consume consumePower){
|
||||||
for(Consume cons : tile.block().consumes.all()){
|
for(Consume cons : tile.block().consumes.all()){
|
||||||
if(cons != consumePower && !cons.isOptional() && !cons.valid(tile.block(), tile.entity())){
|
if(cons != consumePower && !cons.isOptional() && !cons.valid(tile.entity())){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,8 +92,8 @@ public class PowerNode extends PowerBlock{
|
|||||||
public void setBars(){
|
public void setBars(){
|
||||||
super.setBars();
|
super.setBars();
|
||||||
bars.add("power", entity -> new Bar(() ->
|
bars.add("power", entity -> new Bar(() ->
|
||||||
Core.bundle.format("blocks.powerbalance",
|
Core.bundle.format("bar.powerbalance",
|
||||||
((entity.power.graph.getPowerBalance() >= 0 ? "+" : "") + Strings.toFixed(entity.power.graph.getPowerBalance()*60, 1))),
|
((entity.power.graph.getPowerBalance() >= 0 ? "+" : "") + Strings.fixed(entity.power.graph.getPowerBalance()*60, 1))),
|
||||||
() -> Pal.powerBar,
|
() -> Pal.powerBar,
|
||||||
() -> Mathf.clamp(entity.power.graph.getPowerProduced() / entity.power.graph.getPowerNeeded())));
|
() -> Mathf.clamp(entity.power.graph.getPowerProduced() / entity.power.graph.getPowerNeeded())));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class ThermalGenerator extends PowerGenerator{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||||
drawPlaceText(Core.bundle.formatDouble("blocks.efficiency", sumAttribute(Attribute.heat, x, y)*100, 1), x, y, valid);
|
drawPlaceText(Core.bundle.formatFloat("bar.efficiency", sumAttribute(Attribute.heat, x, y)*100, 1), x, y, valid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.blocks.power;
|
|
||||||
|
|
||||||
import io.anuke.mindustry.type.Liquid;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeLiquid;
|
|
||||||
|
|
||||||
public class TurbineGenerator extends BurnerGenerator{
|
|
||||||
|
|
||||||
public TurbineGenerator(String name){
|
|
||||||
super(name);
|
|
||||||
singleLiquid = false;
|
|
||||||
|
|
||||||
consumes.require(ConsumeLiquid.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
|
||||||
return (liquid == consumes.liquid() && tile.entity.liquids.get(consumes.liquid()) < liquidCapacity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.blocks.production;
|
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
|
||||||
import io.anuke.arc.graphics.Color;
|
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
import io.anuke.mindustry.world.blocks.production.GenericCrafter.GenericCrafterEntity;
|
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
|
||||||
import io.anuke.arc.math.Mathf;
|
|
||||||
|
|
||||||
public class Compressor extends PowerCrafter{
|
|
||||||
protected TextureRegion liquidRegion, topRegion;
|
|
||||||
protected TextureRegion[] frameRegions;
|
|
||||||
|
|
||||||
public Compressor(String name){
|
|
||||||
super(name);
|
|
||||||
hasLiquids = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void load(){
|
|
||||||
super.load();
|
|
||||||
|
|
||||||
frameRegions = new TextureRegion[3];
|
|
||||||
for(int i = 0; i < 3; i++){
|
|
||||||
frameRegions[i] = Core.atlas.find(name + "-frame" + i);
|
|
||||||
}
|
|
||||||
|
|
||||||
liquidRegion = Core.atlas.find(name + "-liquid");
|
|
||||||
topRegion = Core.atlas.find(name + "-top");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void draw(Tile tile){
|
|
||||||
GenericCrafterEntity entity = tile.entity();
|
|
||||||
|
|
||||||
Draw.rect(region, tile.drawx(), tile.drawy());
|
|
||||||
Draw.rect(frameRegions[(int) Mathf.absin(entity.totalProgress, 5f, 2.999f)], tile.drawx(), tile.drawy());
|
|
||||||
Draw.color(Color.CLEAR, tile.entity.liquids.current().color, tile.entity.liquids.total() / liquidCapacity);
|
|
||||||
Draw.rect(liquidRegion, tile.drawx(), tile.drawy());
|
|
||||||
Draw.color();
|
|
||||||
Draw.rect(topRegion, tile.drawx(), tile.drawy());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TextureRegion[] generateIcons(){
|
|
||||||
return new TextureRegion[]{Core.atlas.find(name), Core.atlas.find(name + "-top")};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -53,7 +53,7 @@ public class Cultivator extends GenericCrafter{
|
|||||||
public void setBars(){
|
public void setBars(){
|
||||||
super.setBars();
|
super.setBars();
|
||||||
bars.add("multiplier", entity -> new Bar(() ->
|
bars.add("multiplier", entity -> new Bar(() ->
|
||||||
Core.bundle.formatDouble("blocks.efficiency",
|
Core.bundle.formatFloat("bar.efficiency",
|
||||||
((((CultivatorEntity)entity).boost + 1f) * ((CultivatorEntity)entity).warmup)*100f,1),
|
((((CultivatorEntity)entity).boost + 1f) * ((CultivatorEntity)entity).warmup)*100f,1),
|
||||||
() -> Pal.ammo,
|
() -> Pal.ammo,
|
||||||
() -> ((CultivatorEntity)entity).warmup));
|
() -> ((CultivatorEntity)entity).warmup));
|
||||||
@@ -61,7 +61,7 @@ public class Cultivator extends GenericCrafter{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||||
drawPlaceText(Core.bundle.formatDouble("blocks.efficiency", (1+sumAttribute(Attribute.spores, x, y))*100, 1), x, y, valid);
|
drawPlaceText(Core.bundle.formatFloat("bar.efficiency", (1+sumAttribute(Attribute.spores, x, y))*100, 1), x, y, valid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import io.anuke.arc.math.Mathf;
|
|||||||
import io.anuke.arc.util.Strings;
|
import io.anuke.arc.util.Strings;
|
||||||
import io.anuke.arc.util.Time;
|
import io.anuke.arc.util.Time;
|
||||||
import io.anuke.mindustry.content.Fx;
|
import io.anuke.mindustry.content.Fx;
|
||||||
import io.anuke.mindustry.content.Liquids;
|
|
||||||
import io.anuke.mindustry.entities.Effects;
|
import io.anuke.mindustry.entities.Effects;
|
||||||
import io.anuke.mindustry.entities.Effects.Effect;
|
import io.anuke.mindustry.entities.Effects.Effect;
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
import io.anuke.mindustry.entities.type.TileEntity;
|
||||||
@@ -22,7 +21,6 @@ import io.anuke.mindustry.type.ItemType;
|
|||||||
import io.anuke.mindustry.ui.Bar;
|
import io.anuke.mindustry.ui.Bar;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeLiquid;
|
|
||||||
import io.anuke.mindustry.world.meta.BlockGroup;
|
import io.anuke.mindustry.world.meta.BlockGroup;
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
import io.anuke.mindustry.world.meta.StatUnit;
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
@@ -33,7 +31,6 @@ public class Drill extends Block{
|
|||||||
protected final static float hardnessDrillMultiplier = 50f;
|
protected final static float hardnessDrillMultiplier = 50f;
|
||||||
protected final int timerDump = timers++;
|
protected final int timerDump = timers++;
|
||||||
|
|
||||||
protected final Array<Tile> drawTiles = new Array<>();
|
|
||||||
protected final ObjectIntMap<Item> oreCount = new ObjectIntMap<>();
|
protected final ObjectIntMap<Item> oreCount = new ObjectIntMap<>();
|
||||||
protected final Array<Item> itemArray = new Array<>();
|
protected final Array<Item> itemArray = new Array<>();
|
||||||
|
|
||||||
@@ -41,8 +38,6 @@ public class Drill extends Block{
|
|||||||
protected int tier;
|
protected int tier;
|
||||||
/**Base time to drill one ore, in frames.*/
|
/**Base time to drill one ore, in frames.*/
|
||||||
protected float drillTime = 300;
|
protected float drillTime = 300;
|
||||||
/**Whether the liquid is required to drill. If false, then it will be used as a speed booster.*/
|
|
||||||
protected boolean liquidRequired = false;
|
|
||||||
/**How many times faster the drill will progress when boosted by liquid.*/
|
/**How many times faster the drill will progress when boosted by liquid.*/
|
||||||
protected float liquidBoostIntensity = 1.6f;
|
protected float liquidBoostIntensity = 1.6f;
|
||||||
/**Speed at which the drill speeds up.*/
|
/**Speed at which the drill speeds up.*/
|
||||||
@@ -75,8 +70,6 @@ public class Drill extends Block{
|
|||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
liquidCapacity = 5f;
|
liquidCapacity = 5f;
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
|
|
||||||
consumes.liquid(Liquids.water, 0.05f).optional(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -86,7 +79,7 @@ public class Drill extends Block{
|
|||||||
bars.add("drillspeed", e -> {
|
bars.add("drillspeed", e -> {
|
||||||
DrillEntity entity = (DrillEntity)e;
|
DrillEntity entity = (DrillEntity)e;
|
||||||
|
|
||||||
return new Bar(() -> Core.bundle.format("blocks.outputspeed", Strings.toFixed(entity.lastDrillSpeed * 60 * entity.timeScale, 2)), () -> Pal.ammo, () -> entity.warmup);
|
return new Bar(() -> Core.bundle.format("bar.drillspeed", Strings.fixed(entity.lastDrillSpeed * 60 * entity.timeScale, 2)), () -> Pal.ammo, () -> entity.warmup);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,6 +155,7 @@ public class Drill extends Block{
|
|||||||
});
|
});
|
||||||
|
|
||||||
stats.add(BlockStat.drillSpeed, 60f / drillTime * size * size, StatUnit.itemsSecond);
|
stats.add(BlockStat.drillSpeed, 60f / drillTime * size * size, StatUnit.itemsSecond);
|
||||||
|
stats.add(BlockStat.boostEffect, liquidBoostIntensity, StatUnit.timesSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -210,9 +204,10 @@ public class Drill extends Block{
|
|||||||
|
|
||||||
float speed = 1f;
|
float speed = 1f;
|
||||||
|
|
||||||
if(entity.consumed(ConsumeLiquid.class) && !liquidRequired){
|
if(entity.cons.optionalValid()){
|
||||||
speed = liquidBoostIntensity;
|
speed = liquidBoostIntensity;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hasPower){
|
if(hasPower){
|
||||||
speed *= entity.power.satisfaction; // Drill slower when not at full power
|
speed *= entity.power.satisfaction; // Drill slower when not at full power
|
||||||
}
|
}
|
||||||
@@ -275,14 +270,14 @@ public class Drill extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class DrillEntity extends TileEntity{
|
public static class DrillEntity extends TileEntity{
|
||||||
public float progress;
|
float progress;
|
||||||
public int index;
|
int index;
|
||||||
public float warmup;
|
float warmup;
|
||||||
public float drillTime;
|
float drillTime;
|
||||||
public float lastDrillSpeed;
|
float lastDrillSpeed;
|
||||||
|
|
||||||
public int dominantItems;
|
int dominantItems;
|
||||||
public Item dominantItem;
|
Item dominantItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package io.anuke.mindustry.world.blocks.production;
|
package io.anuke.mindustry.world.blocks.production;
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.Core;
|
||||||
|
import io.anuke.arc.graphics.g2d.Draw;
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
import io.anuke.mindustry.entities.type.TileEntity;
|
||||||
import io.anuke.mindustry.type.Item;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeItem;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
|
|
||||||
public class Fracker extends SolidPump{
|
public class Fracker extends SolidPump{
|
||||||
protected final float itemUseTime = 100f;
|
protected final float itemUseTime = 100f;
|
||||||
@@ -18,9 +18,13 @@ public class Fracker extends SolidPump{
|
|||||||
public Fracker(String name){
|
public Fracker(String name){
|
||||||
super(name);
|
super(name);
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
singleLiquid = false;
|
}
|
||||||
|
|
||||||
consumes.require(ConsumeItem.class);
|
@Override
|
||||||
|
public void setStats(){
|
||||||
|
super.setStats();
|
||||||
|
|
||||||
|
stats.add(BlockStat.productionTime, itemUseTime / 60f, StatUnit.seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -55,14 +59,13 @@ public class Fracker extends SolidPump{
|
|||||||
@Override
|
@Override
|
||||||
public void update(Tile tile){
|
public void update(Tile tile){
|
||||||
FrackerEntity entity = tile.entity();
|
FrackerEntity entity = tile.entity();
|
||||||
Item item = consumes.item();
|
|
||||||
|
|
||||||
while(entity.accumulator >= itemUseTime && entity.items.has(item, 1)){
|
|
||||||
entity.items.remove(item, 1);
|
|
||||||
entity.accumulator -= itemUseTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(entity.cons.valid() && entity.accumulator < itemUseTime){
|
if(entity.cons.valid() && entity.accumulator < itemUseTime){
|
||||||
|
if(entity.accumulator >= itemUseTime){
|
||||||
|
entity.cons.trigger();
|
||||||
|
entity.accumulator -= itemUseTime;
|
||||||
|
}
|
||||||
|
|
||||||
super.update(tile);
|
super.update(tile);
|
||||||
entity.accumulator += entity.delta() * entity.power.satisfaction;
|
entity.accumulator += entity.delta() * entity.power.satisfaction;
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package io.anuke.mindustry.world.blocks.production;
|
package io.anuke.mindustry.world.blocks.production;
|
||||||
|
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
import io.anuke.arc.function.Consumer;
|
||||||
|
import io.anuke.arc.function.Supplier;
|
||||||
|
import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.Mathf;
|
||||||
import io.anuke.arc.util.Time;
|
import io.anuke.arc.util.Time;
|
||||||
import io.anuke.mindustry.content.Fx;
|
import io.anuke.mindustry.content.Fx;
|
||||||
@@ -8,8 +10,12 @@ import io.anuke.mindustry.entities.Effects;
|
|||||||
import io.anuke.mindustry.entities.Effects.Effect;
|
import io.anuke.mindustry.entities.Effects.Effect;
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
import io.anuke.mindustry.entities.type.TileEntity;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
|
import io.anuke.mindustry.type.ItemStack;
|
||||||
|
import io.anuke.mindustry.type.LiquidStack;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
import io.anuke.mindustry.world.consumers.ConsumeLiquidBase;
|
||||||
|
import io.anuke.mindustry.world.consumers.ConsumeType;
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
import io.anuke.mindustry.world.meta.StatUnit;
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
|
|
||||||
@@ -20,13 +26,17 @@ import java.io.IOException;
|
|||||||
public class GenericCrafter extends Block{
|
public class GenericCrafter extends Block{
|
||||||
protected final int timerDump = timers++;
|
protected final int timerDump = timers++;
|
||||||
|
|
||||||
protected Item output;
|
protected ItemStack outputItem;
|
||||||
|
protected LiquidStack outputLiquid;
|
||||||
|
|
||||||
protected float craftTime = 80;
|
protected float craftTime = 80;
|
||||||
protected Effect craftEffect = Fx.purify;
|
protected Effect craftEffect = Fx.purify;
|
||||||
protected Effect updateEffect = Fx.none;
|
protected Effect updateEffect = Fx.none;
|
||||||
protected float updateEffectChance = 0.04f;
|
protected float updateEffectChance = 0.04f;
|
||||||
|
|
||||||
|
protected Consumer<Tile> drawer = null;
|
||||||
|
protected Supplier<TextureRegion[]> drawIcons = null;
|
||||||
|
|
||||||
public GenericCrafter(String name){
|
public GenericCrafter(String name){
|
||||||
super(name);
|
super(name);
|
||||||
update = true;
|
update = true;
|
||||||
@@ -34,44 +44,52 @@ public class GenericCrafter extends Block{
|
|||||||
health = 60;
|
health = 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init(){
|
|
||||||
super.init();
|
|
||||||
|
|
||||||
produces.set(output);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setStats(){
|
public void setStats(){
|
||||||
|
if(consumes.has(ConsumeType.liquid)){
|
||||||
|
ConsumeLiquidBase cons = consumes.get(ConsumeType.liquid);
|
||||||
|
cons.timePeriod = craftTime;
|
||||||
|
}
|
||||||
|
|
||||||
super.setStats();
|
super.setStats();
|
||||||
stats.add(BlockStat.craftSpeed, 60f / craftTime, StatUnit.itemsSecond);
|
stats.add(BlockStat.productionTime, craftTime / 60f, StatUnit.seconds);
|
||||||
stats.add(BlockStat.outputItem, output);
|
|
||||||
|
if(outputItem != null){
|
||||||
|
stats.add(BlockStat.output, outputItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(outputLiquid != null){
|
||||||
|
stats.add(BlockStat.output, outputLiquid.liquid, outputLiquid.amount, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Tile tile){
|
public void draw(Tile tile){
|
||||||
Draw.rect(name, tile.drawx(), tile.drawy());
|
if(drawer == null){
|
||||||
|
super.draw(tile);
|
||||||
|
}else{
|
||||||
|
drawer.accept(tile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!hasLiquids) return;
|
@Override
|
||||||
|
public TextureRegion[] generateIcons(){
|
||||||
Draw.color(tile.entity.liquids.current().color);
|
return drawIcons == null ? super.generateIcons() : drawIcons.get();
|
||||||
Draw.alpha(tile.entity.liquids.total() / liquidCapacity);
|
|
||||||
Draw.rect("blank", tile.drawx(), tile.drawy(), 2, 2);
|
|
||||||
Draw.color();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Tile tile){
|
public void update(Tile tile){
|
||||||
GenericCrafterEntity entity = tile.entity();
|
GenericCrafterEntity entity = tile.entity();
|
||||||
|
|
||||||
if(entity.cons.valid() && tile.entity.items.get(output) < itemCapacity){
|
if(entity.cons.valid()){
|
||||||
|
|
||||||
entity.progress += getProgressIncrease(entity, craftTime);
|
entity.progress += getProgressIncrease(entity, craftTime);
|
||||||
entity.totalProgress += entity.delta();
|
entity.totalProgress += entity.delta();
|
||||||
entity.warmup = Mathf.lerpDelta(entity.warmup, 1f, 0.02f);
|
entity.warmup = Mathf.lerpDelta(entity.warmup, 1f, 0.02f);
|
||||||
|
|
||||||
if(Mathf.chance(Time.delta() * updateEffectChance))
|
if(Mathf.chance(Time.delta() * updateEffectChance)){
|
||||||
Effects.effect(updateEffect, entity.x + Mathf.range(size * 4f), entity.y + Mathf.range(size * 4));
|
Effects.effect(updateEffect, entity.x + Mathf.range(size * 4f), entity.y + Mathf.range(size * 4));
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
entity.warmup = Mathf.lerp(entity.warmup, 0f, 0.02f);
|
entity.warmup = Mathf.lerp(entity.warmup, 0f, 0.02f);
|
||||||
}
|
}
|
||||||
@@ -79,14 +97,28 @@ public class GenericCrafter extends Block{
|
|||||||
if(entity.progress >= 1f){
|
if(entity.progress >= 1f){
|
||||||
entity.cons.trigger();
|
entity.cons.trigger();
|
||||||
|
|
||||||
useContent(tile, output);
|
if(outputItem != null){
|
||||||
offloadNear(tile, output);
|
useContent(tile, outputItem.item);
|
||||||
|
for(int i = 0; i < outputItem.amount; i++){
|
||||||
|
offloadNear(tile, outputItem.item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(outputLiquid != null){
|
||||||
|
useContent(tile, outputLiquid.liquid);
|
||||||
|
handleLiquid(tile, tile, outputLiquid.liquid, outputLiquid.amount);
|
||||||
|
}
|
||||||
|
|
||||||
Effects.effect(craftEffect, tile.drawx(), tile.drawy());
|
Effects.effect(craftEffect, tile.drawx(), tile.drawy());
|
||||||
entity.progress = 0f;
|
entity.progress = 0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tile.entity.timer.get(timerDump, 5)){
|
if(outputItem != null && tile.entity.timer.get(timerDump, 5)){
|
||||||
tryDump(tile, output);
|
tryDump(tile, outputItem.item);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(outputLiquid != null){
|
||||||
|
tryDumpLiquid(tile, outputLiquid.liquid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package io.anuke.mindustry.world.blocks.production;
|
||||||
|
|
||||||
|
import io.anuke.arc.Core;
|
||||||
|
import io.anuke.arc.graphics.Color;
|
||||||
|
import io.anuke.arc.graphics.g2d.Draw;
|
||||||
|
import io.anuke.arc.graphics.g2d.Fill;
|
||||||
|
import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||||
|
import io.anuke.arc.math.Mathf;
|
||||||
|
import io.anuke.arc.util.Time;
|
||||||
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
|
||||||
|
/**A GenericCrafter with a new glowing region drawn on top.*/
|
||||||
|
public class GenericSmelter extends GenericCrafter{
|
||||||
|
protected Color flameColor = Color.valueOf("ffc999");
|
||||||
|
protected TextureRegion topRegion;
|
||||||
|
|
||||||
|
public GenericSmelter(String name){
|
||||||
|
super(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void load(){
|
||||||
|
super.load();
|
||||||
|
topRegion = Core.atlas.find(name + "-top");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(Tile tile){
|
||||||
|
super.draw(tile);
|
||||||
|
|
||||||
|
GenericCrafterEntity entity = tile.entity();
|
||||||
|
|
||||||
|
//draw glowing center
|
||||||
|
if(entity.warmup > 0f && flameColor.a > 0.001f){
|
||||||
|
float g = 0.3f;
|
||||||
|
float r = 0.06f;
|
||||||
|
float cr = Mathf.random(0.1f);
|
||||||
|
|
||||||
|
Draw.alpha(((1f - g) + Mathf.absin(Time.time(), 8f, g) + Mathf.random(r) - r) * entity.warmup);
|
||||||
|
|
||||||
|
Draw.tint(flameColor);
|
||||||
|
Fill.circle(tile.drawx(), tile.drawy(), 3f + Mathf.absin(Time.time(), 5f, 2f) + cr);
|
||||||
|
Draw.color(1f, 1f, 1f, entity.warmup);
|
||||||
|
Draw.rect(topRegion, tile.drawx(), tile.drawy());
|
||||||
|
Fill.circle(tile.drawx(), tile.drawy(), 1.9f + Mathf.absin(Time.time(), 5f, 1f) + cr);
|
||||||
|
|
||||||
|
Draw.color();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.blocks.production;
|
|
||||||
|
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
|
||||||
import io.anuke.mindustry.type.Liquid;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
import io.anuke.mindustry.world.blocks.LiquidBlock;
|
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeLiquid;
|
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
|
||||||
import io.anuke.mindustry.world.meta.StatUnit;
|
|
||||||
import io.anuke.mindustry.world.modules.LiquidModule;
|
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
|
||||||
|
|
||||||
public class LiquidMixer extends LiquidBlock{
|
|
||||||
protected Liquid outputLiquid;
|
|
||||||
protected float liquidPerItem = 50f;
|
|
||||||
|
|
||||||
public LiquidMixer(String name){
|
|
||||||
super(name);
|
|
||||||
hasItems = true;
|
|
||||||
rotate = false;
|
|
||||||
solid = true;
|
|
||||||
singleLiquid = false;
|
|
||||||
outputsLiquid = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init(){
|
|
||||||
super.init();
|
|
||||||
|
|
||||||
produces.set(outputLiquid);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setStats(){
|
|
||||||
super.setStats();
|
|
||||||
|
|
||||||
stats.add(BlockStat.liquidOutput, outputLiquid);
|
|
||||||
stats.add(BlockStat.liquidOutputSpeed, 60f * consumes.get(ConsumeLiquid.class).used(), StatUnit.liquidSecond);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean shouldConsume(Tile tile){
|
|
||||||
return tile.entity.liquids.get(outputLiquid) < liquidCapacity;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update(Tile tile){
|
|
||||||
LiquidMixerEntity entity = tile.entity();
|
|
||||||
|
|
||||||
if(tile.entity.cons.valid()){
|
|
||||||
float use = Math.min(consumes.get(ConsumeLiquid.class).used() * entity.delta(), liquidCapacity - entity.liquids.get(outputLiquid));
|
|
||||||
if(hasPower){
|
|
||||||
use *= entity.power.satisfaction; // Produce less liquid if power is not maxed
|
|
||||||
}
|
|
||||||
entity.accumulator += use;
|
|
||||||
entity.liquids.add(outputLiquid, use);
|
|
||||||
for(int i = 0; i < (int) (entity.accumulator / liquidPerItem); i++){
|
|
||||||
if(!entity.items.has(consumes.item())) break;
|
|
||||||
entity.items.remove(consumes.item(), 1);
|
|
||||||
entity.accumulator -= liquidPerItem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tryDumpLiquid(tile, outputLiquid);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void draw(Tile tile){
|
|
||||||
LiquidModule mod = tile.entity.liquids;
|
|
||||||
|
|
||||||
int rotation = rotate ? tile.getRotation() * 90 : 0;
|
|
||||||
|
|
||||||
Draw.rect(bottomRegion, tile.drawx(), tile.drawy(), rotation);
|
|
||||||
|
|
||||||
if(mod.total() > 0.001f){
|
|
||||||
Draw.color(outputLiquid.color);
|
|
||||||
Draw.alpha(mod.get(outputLiquid) / liquidCapacity);
|
|
||||||
Draw.rect(liquidRegion, tile.drawx(), tile.drawy(), rotation);
|
|
||||||
Draw.color();
|
|
||||||
}
|
|
||||||
|
|
||||||
Draw.rect(topRegion, tile.drawx(), tile.drawy(), rotation);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TileEntity newEntity(){
|
|
||||||
return new LiquidMixerEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
static class LiquidMixerEntity extends TileEntity{
|
|
||||||
float accumulator;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.blocks.production;
|
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
|
||||||
import io.anuke.arc.graphics.g2d.Lines;
|
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
|
||||||
import io.anuke.arc.math.Mathf;
|
|
||||||
import io.anuke.mindustry.Vars;
|
|
||||||
import io.anuke.mindustry.graphics.Pal;
|
|
||||||
import io.anuke.mindustry.graphics.Shaders;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
|
|
||||||
public class PhaseWeaver extends PowerSmelter{
|
|
||||||
protected TextureRegion bottomRegion;
|
|
||||||
protected TextureRegion weaveRegion;
|
|
||||||
|
|
||||||
public PhaseWeaver(String name){
|
|
||||||
super(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void load(){
|
|
||||||
super.load();
|
|
||||||
|
|
||||||
bottomRegion = Core.atlas.find(name + "-bottom");
|
|
||||||
weaveRegion = Core.atlas.find(name + "-weave");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TextureRegion[] generateIcons(){
|
|
||||||
return new TextureRegion[]{Core.atlas.find(name + "-bottom"), Core.atlas.find(name)};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void draw(Tile tile){
|
|
||||||
PowerSmelterEntity entity = tile.entity();
|
|
||||||
|
|
||||||
Draw.rect(bottomRegion, tile.drawx(), tile.drawy());
|
|
||||||
|
|
||||||
float progress = 0.5f;
|
|
||||||
|
|
||||||
Shaders.build.region = weaveRegion;
|
|
||||||
Shaders.build.progress = progress;
|
|
||||||
Shaders.build.color.set(Pal.accent);
|
|
||||||
Shaders.build.color.a = entity.heat;
|
|
||||||
Shaders.build.time = -entity.time / 10f;
|
|
||||||
|
|
||||||
Draw.shader(Shaders.build, false);
|
|
||||||
Shaders.build.apply();
|
|
||||||
Draw.rect(weaveRegion, tile.drawx(), tile.drawy(), entity.time);
|
|
||||||
Draw.shader();
|
|
||||||
|
|
||||||
Draw.color(Pal.accent);
|
|
||||||
Draw.alpha(entity.heat);
|
|
||||||
|
|
||||||
Lines.lineAngleCenter(
|
|
||||||
tile.drawx() + Mathf.sin(entity.time, 6f, Vars.tilesize / 3f * size),
|
|
||||||
tile.drawy(),
|
|
||||||
90,
|
|
||||||
size * Vars.tilesize / 2f);
|
|
||||||
|
|
||||||
Draw.reset();
|
|
||||||
|
|
||||||
Draw.rect(region, tile.drawx(), tile.drawy());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.blocks.production;
|
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
|
||||||
import io.anuke.arc.math.Mathf;
|
|
||||||
|
|
||||||
public class PlastaniumCompressor extends GenericCrafter{
|
|
||||||
protected TextureRegion topRegion;
|
|
||||||
|
|
||||||
public PlastaniumCompressor(String name){
|
|
||||||
super(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void load(){
|
|
||||||
super.load();
|
|
||||||
|
|
||||||
topRegion = Core.atlas.find(name + "-top");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void draw(Tile tile){
|
|
||||||
super.draw(tile);
|
|
||||||
|
|
||||||
GenericCrafterEntity entity = tile.entity();
|
|
||||||
|
|
||||||
Draw.alpha(Mathf.absin(entity.totalProgress, 3f, 0.9f) * entity.warmup);
|
|
||||||
Draw.rect(topRegion, tile.drawx(), tile.drawy());
|
|
||||||
Draw.reset();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.blocks.production;
|
|
||||||
|
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
|
||||||
import io.anuke.mindustry.type.Item;
|
|
||||||
import io.anuke.mindustry.type.Liquid;
|
|
||||||
import io.anuke.mindustry.world.Block;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
import io.anuke.mindustry.world.blocks.production.GenericCrafter.GenericCrafterEntity;
|
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
|
||||||
|
|
||||||
/**Similar to GenericCrafter, but also optionally outputs liquids.
|
|
||||||
* TODO consolidate into one class*/
|
|
||||||
public class PowerCrafter extends Block{
|
|
||||||
protected final int timerDump = timers++;
|
|
||||||
protected final int timerContentCheck = timers++;
|
|
||||||
|
|
||||||
/**Optional.*/
|
|
||||||
protected Item outputItem;
|
|
||||||
/**Optional. Set hasLiquids to true when using.*/
|
|
||||||
protected Liquid outputLiquid;
|
|
||||||
protected float outputLiquidAmount;
|
|
||||||
protected float craftTime;
|
|
||||||
|
|
||||||
public PowerCrafter(String name){
|
|
||||||
super(name);
|
|
||||||
solid = true;
|
|
||||||
update = true;
|
|
||||||
hasPower = true;
|
|
||||||
hasItems = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init(){
|
|
||||||
super.init();
|
|
||||||
|
|
||||||
if(outputLiquid != null){
|
|
||||||
outputsLiquid = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(outputLiquid != null){
|
|
||||||
produces.set(outputLiquid);
|
|
||||||
}else if(outputItem != null){
|
|
||||||
produces.set(outputItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setStats(){
|
|
||||||
super.setStats();
|
|
||||||
|
|
||||||
if(outputItem != null){
|
|
||||||
stats.add(BlockStat.outputItem, outputItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(outputLiquid != null){
|
|
||||||
stats.add(BlockStat.liquidOutput, outputLiquid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canProduce(Tile tile){
|
|
||||||
if(outputItem != null && tile.entity.items.get(outputItem) >= itemCapacity){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return outputLiquid == null || !(tile.entity.liquids.get(outputLiquid) >= liquidCapacity - 0.01f);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update(Tile tile){
|
|
||||||
GenericCrafterEntity entity = tile.entity();
|
|
||||||
|
|
||||||
if(entity.cons.valid()){
|
|
||||||
entity.progress += getProgressIncrease(entity, craftTime);
|
|
||||||
entity.totalProgress += entity.delta();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(entity.progress >= 1f){
|
|
||||||
entity.items.remove(consumes.item(), consumes.itemAmount());
|
|
||||||
if(outputItem != null){
|
|
||||||
offloadNear(tile, outputItem);
|
|
||||||
useContent(tile, outputItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(outputLiquid != null){
|
|
||||||
handleLiquid(tile, tile, outputLiquid, outputLiquidAmount);
|
|
||||||
if(tile.entity.liquids.currentAmount() > 0f && tile.entity.timer.get(timerContentCheck, 10)){
|
|
||||||
useContent(tile, outputLiquid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
entity.progress = 0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(outputItem != null && entity.timer.get(timerDump, 5)){
|
|
||||||
tryDump(tile, outputItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(outputLiquid != null){
|
|
||||||
tryDumpLiquid(tile, entity.liquids.current());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TileEntity newEntity(){
|
|
||||||
return new GenericCrafterEntity();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,175 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.blocks.production;
|
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
|
||||||
import io.anuke.mindustry.entities.Effects;
|
|
||||||
import io.anuke.mindustry.entities.Effects.Effect;
|
|
||||||
import io.anuke.arc.graphics.Color;
|
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
|
||||||
import io.anuke.arc.graphics.g2d.Fill;
|
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
|
||||||
import io.anuke.arc.math.Mathf;
|
|
||||||
import io.anuke.arc.util.Time;
|
|
||||||
import io.anuke.mindustry.content.Fx;
|
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
|
||||||
import io.anuke.mindustry.type.Item;
|
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
import io.anuke.mindustry.world.blocks.PowerBlock;
|
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
|
||||||
import io.anuke.mindustry.world.meta.StatUnit;
|
|
||||||
|
|
||||||
import java.io.DataInput;
|
|
||||||
import java.io.DataOutput;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class PowerSmelter extends PowerBlock{
|
|
||||||
protected final int timerDump = timers++;
|
|
||||||
|
|
||||||
protected Item output;
|
|
||||||
|
|
||||||
protected float heatUpTime = 80f;
|
|
||||||
protected float minHeat = 0.5f;
|
|
||||||
|
|
||||||
protected float craftTime = 20f; //time to craft one item, so max 3 items per second by default
|
|
||||||
protected float burnEffectChance = 0.01f;
|
|
||||||
protected Effect craftEffect = Fx.smelt,
|
|
||||||
burnEffect = Fx.fuelburn;
|
|
||||||
protected Color flameColor = Color.valueOf("ffc999");
|
|
||||||
|
|
||||||
protected TextureRegion topRegion;
|
|
||||||
|
|
||||||
public PowerSmelter(String name){
|
|
||||||
super(name);
|
|
||||||
hasItems = true;
|
|
||||||
update = true;
|
|
||||||
solid = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init(){
|
|
||||||
super.init();
|
|
||||||
|
|
||||||
produces.set(output);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void load(){
|
|
||||||
super.load();
|
|
||||||
topRegion = Core.atlas.find(name + "-top");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setStats(){
|
|
||||||
super.setStats();
|
|
||||||
|
|
||||||
stats.add(BlockStat.outputItem, output);
|
|
||||||
stats.add(BlockStat.craftSpeed, 60f / craftTime, StatUnit.itemsSecond);
|
|
||||||
stats.add(BlockStat.inputItemCapacity, itemCapacity, StatUnit.items);
|
|
||||||
stats.add(BlockStat.outputItemCapacity, itemCapacity, StatUnit.items);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update(Tile tile){
|
|
||||||
|
|
||||||
PowerSmelterEntity entity = tile.entity();
|
|
||||||
|
|
||||||
if(entity.timer.get(timerDump, 5) && entity.items.has(output)){
|
|
||||||
tryDump(tile, output);
|
|
||||||
}
|
|
||||||
|
|
||||||
//heat it up if there's enough power
|
|
||||||
if(entity.cons.valid()){
|
|
||||||
entity.heat += 1f / heatUpTime * entity.delta();
|
|
||||||
if(Mathf.chance(entity.delta() * burnEffectChance))
|
|
||||||
Effects.effect(burnEffect, entity.x + Mathf.range(size * 4f), entity.y + Mathf.range(size * 4));
|
|
||||||
}else{
|
|
||||||
entity.heat -= 1f / heatUpTime * Time.delta();
|
|
||||||
}
|
|
||||||
|
|
||||||
entity.heat = Mathf.clamp(entity.heat);
|
|
||||||
entity.time += entity.heat * entity.delta();
|
|
||||||
|
|
||||||
if(!entity.cons.valid()){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
entity.craftTime += entity.delta() * entity.power.satisfaction;
|
|
||||||
|
|
||||||
if(entity.items.get(output) >= itemCapacity //output full
|
|
||||||
|| entity.heat <= minHeat //not burning
|
|
||||||
|| entity.craftTime < craftTime){ //not yet time
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
entity.craftTime = 0f;
|
|
||||||
|
|
||||||
for(ItemStack item : consumes.items()){
|
|
||||||
entity.items.remove(item.item, item.amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
offloadNear(tile, output);
|
|
||||||
Effects.effect(craftEffect, flameColor, tile.drawx(), tile.drawy());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean acceptItem(Item item, Tile tile, Tile source){
|
|
||||||
|
|
||||||
for(ItemStack stack : consumes.items()){
|
|
||||||
if(stack.item == item){
|
|
||||||
return tile.entity.items.get(item) < itemCapacity;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMaximumAccepted(Tile tile, Item item){
|
|
||||||
return itemCapacity;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void draw(Tile tile){
|
|
||||||
super.draw(tile);
|
|
||||||
|
|
||||||
PowerSmelterEntity entity = tile.entity();
|
|
||||||
|
|
||||||
//draw glowing center
|
|
||||||
if(entity.heat > 0f && flameColor.a > 0.001f){
|
|
||||||
float g = 0.3f;
|
|
||||||
float r = 0.06f;
|
|
||||||
float cr = Mathf.random(0.1f);
|
|
||||||
|
|
||||||
Draw.alpha(((1f - g) + Mathf.absin(Time.time(), 8f, g) + Mathf.random(r) - r) * entity.heat);
|
|
||||||
|
|
||||||
Draw.tint(flameColor);
|
|
||||||
Fill.circle(tile.drawx(), tile.drawy(), 3f + Mathf.absin(Time.time(), 5f, 2f) + cr);
|
|
||||||
Draw.color(1f, 1f, 1f, entity.heat);
|
|
||||||
Draw.rect(topRegion, tile.drawx(), tile.drawy());
|
|
||||||
Fill.circle(tile.drawx(), tile.drawy(), 1.9f + Mathf.absin(Time.time(), 5f, 1f) + cr);
|
|
||||||
|
|
||||||
Draw.color();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TileEntity newEntity(){
|
|
||||||
return new PowerSmelterEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
class PowerSmelterEntity extends TileEntity{
|
|
||||||
public float heat;
|
|
||||||
public float time;
|
|
||||||
public float craftTime;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void write(DataOutput stream) throws IOException{
|
|
||||||
stream.writeFloat(heat);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void read(DataInput stream) throws IOException{
|
|
||||||
heat = stream.readFloat();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.blocks.production;
|
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
|
||||||
|
|
||||||
public class Pulverizer extends GenericCrafter{
|
|
||||||
protected TextureRegion rotatorRegion;
|
|
||||||
|
|
||||||
public Pulverizer(String name){
|
|
||||||
super(name);
|
|
||||||
hasItems = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void load(){
|
|
||||||
super.load();
|
|
||||||
|
|
||||||
rotatorRegion = Core.atlas.find(name + "-rotator");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void draw(Tile tile){
|
|
||||||
GenericCrafterEntity entity = tile.entity();
|
|
||||||
|
|
||||||
Draw.rect(region, tile.drawx(), tile.drawy());
|
|
||||||
Draw.rect(rotatorRegion, tile.drawx(), tile.drawy(), entity.totalProgress * 2f);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TextureRegion[] generateIcons(){
|
|
||||||
return new TextureRegion[]{Core.atlas.find(name), Core.atlas.find(name + "-rotator")};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +1,16 @@
|
|||||||
package io.anuke.mindustry.world.blocks.production;
|
package io.anuke.mindustry.world.blocks.production;
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.Core;
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
|
||||||
import io.anuke.arc.collection.Array;
|
import io.anuke.arc.collection.Array;
|
||||||
|
import io.anuke.arc.graphics.g2d.Draw;
|
||||||
|
import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||||
import io.anuke.mindustry.graphics.Layer;
|
import io.anuke.mindustry.graphics.Layer;
|
||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.LiquidBlock;
|
import io.anuke.mindustry.world.blocks.LiquidBlock;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeLiquid;
|
|
||||||
import io.anuke.mindustry.world.meta.BlockGroup;
|
import io.anuke.mindustry.world.meta.BlockGroup;
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
import io.anuke.mindustry.world.meta.StatUnit;
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
|
||||||
|
|
||||||
public class Pump extends LiquidBlock{
|
public class Pump extends LiquidBlock{
|
||||||
protected final Array<Tile> drawTiles = new Array<>();
|
protected final Array<Tile> drawTiles = new Array<>();
|
||||||
@@ -40,7 +39,7 @@ public class Pump extends LiquidBlock{
|
|||||||
@Override
|
@Override
|
||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
stats.add(BlockStat.liquidOutputSpeed, 60f * pumpAmount, StatUnit.liquidSecond);
|
stats.add(BlockStat.output, 60f * pumpAmount, StatUnit.liquidSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -107,11 +106,6 @@ public class Pump extends LiquidBlock{
|
|||||||
tryDumpLiquid(tile, tile.entity.liquids.current());
|
tryDumpLiquid(tile, tile.entity.liquids.current());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
|
||||||
return consumes.has(ConsumeLiquid.class) && consumes.liquid() == liquid && super.acceptLiquid(tile, source, liquid, amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean isValid(Tile tile){
|
protected boolean isValid(Tile tile){
|
||||||
return tile != null && tile.floor().liquidDrop != null;
|
return tile != null && tile.floor().liquidDrop != null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
package io.anuke.mindustry.world.blocks.production;
|
package io.anuke.mindustry.world.blocks.production;
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.Color;
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
import io.anuke.arc.graphics.g2d.Draw;
|
||||||
import io.anuke.arc.graphics.g2d.Lines;
|
import io.anuke.arc.graphics.g2d.Lines;
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.Mathf;
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
import io.anuke.mindustry.entities.type.TileEntity;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
@@ -12,8 +10,10 @@ import io.anuke.mindustry.type.ItemStack;
|
|||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.production.GenericCrafter.GenericCrafterEntity;
|
import io.anuke.mindustry.world.blocks.production.GenericCrafter.GenericCrafterEntity;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeItem;
|
import io.anuke.mindustry.world.consumers.ConsumeLiquidBase;
|
||||||
|
import io.anuke.mindustry.world.consumers.ConsumeType;
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
import io.anuke.mindustry.world.meta.values.ItemFilterValue;
|
import io.anuke.mindustry.world.meta.values.ItemFilterValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,14 +23,14 @@ public class Separator extends Block{
|
|||||||
protected final int timerDump = timers++;
|
protected final int timerDump = timers++;
|
||||||
|
|
||||||
protected ItemStack[] results;
|
protected ItemStack[] results;
|
||||||
protected float filterTime;
|
protected float craftTime;
|
||||||
protected float spinnerRadius = 2.5f;
|
protected float spinnerRadius = 2.5f;
|
||||||
protected float spinnerLength = 1f;
|
protected float spinnerLength = 1f;
|
||||||
protected float spinnerThickness = 1f;
|
protected float spinnerThickness = 1f;
|
||||||
protected float spinnerSpeed = 2f;
|
protected float spinnerSpeed = 2f;
|
||||||
|
|
||||||
protected Color color = Color.valueOf("858585");
|
protected Color color = Color.valueOf("858585");
|
||||||
protected TextureRegion liquidRegion;
|
protected int liquidRegion;
|
||||||
|
|
||||||
public Separator(String name){
|
public Separator(String name){
|
||||||
super(name);
|
super(name);
|
||||||
@@ -38,25 +38,28 @@ public class Separator extends Block{
|
|||||||
solid = true;
|
solid = true;
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
liquidRegion = reg("liquid");
|
||||||
public void load(){
|
|
||||||
super.load();
|
|
||||||
|
|
||||||
liquidRegion = Core.atlas.find(name + "-liquid");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setStats(){
|
public void setStats(){
|
||||||
|
if(consumes.has(ConsumeType.liquid)){
|
||||||
|
ConsumeLiquidBase cons = consumes.get(ConsumeType.liquid);
|
||||||
|
cons.timePeriod = craftTime;
|
||||||
|
}
|
||||||
|
|
||||||
super.setStats();
|
super.setStats();
|
||||||
|
|
||||||
stats.add(BlockStat.outputItem, new ItemFilterValue(item -> {
|
stats.add(BlockStat.output, new ItemFilterValue(item -> {
|
||||||
for(ItemStack i : results){
|
for(ItemStack i : results){
|
||||||
if(item == i.item) return true;
|
if(item == i.item) return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
stats.add(BlockStat.productionTime, craftTime / 60f, StatUnit.seconds);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -67,7 +70,7 @@ public class Separator extends Block{
|
|||||||
|
|
||||||
Draw.color(tile.entity.liquids.current().color);
|
Draw.color(tile.entity.liquids.current().color);
|
||||||
Draw.alpha(tile.entity.liquids.total() / liquidCapacity);
|
Draw.alpha(tile.entity.liquids.total() / liquidCapacity);
|
||||||
Draw.rect(liquidRegion, tile.drawx(), tile.drawy());
|
Draw.rect(reg(liquidRegion), tile.drawx(), tile.drawy());
|
||||||
|
|
||||||
Draw.color(color);
|
Draw.color(color);
|
||||||
Lines.stroke(spinnerThickness);
|
Lines.stroke(spinnerThickness);
|
||||||
@@ -82,7 +85,7 @@ public class Separator extends Block{
|
|||||||
entity.totalProgress += entity.warmup * entity.delta();
|
entity.totalProgress += entity.warmup * entity.delta();
|
||||||
|
|
||||||
if(entity.cons.valid()){
|
if(entity.cons.valid()){
|
||||||
entity.progress += getProgressIncrease(entity, filterTime);
|
entity.progress += getProgressIncrease(entity, craftTime);
|
||||||
entity.warmup = Mathf.lerpDelta(entity.warmup, 1f, 0.02f);
|
entity.warmup = Mathf.lerpDelta(entity.warmup, 1f, 0.02f);
|
||||||
}else{
|
}else{
|
||||||
entity.warmup = Mathf.lerpDelta(entity.warmup, 0f, 0.02f);
|
entity.warmup = Mathf.lerpDelta(entity.warmup, 0f, 0.02f);
|
||||||
@@ -106,9 +109,7 @@ public class Separator extends Block{
|
|||||||
count += stack.amount;
|
count += stack.amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(consumes.has(ConsumeItem.class)){
|
entity.cons.trigger();
|
||||||
entity.items.remove(consumes.item(), consumes.itemAmount());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(item != null && entity.items.get(item) < itemCapacity){
|
if(item != null && entity.items.get(item) < itemCapacity){
|
||||||
offloadNear(tile, item);
|
offloadNear(tile, item);
|
||||||
|
|||||||
@@ -1,148 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.blocks.production;
|
|
||||||
|
|
||||||
import io.anuke.mindustry.entities.Effects;
|
|
||||||
import io.anuke.mindustry.entities.Effects.Effect;
|
|
||||||
import io.anuke.arc.graphics.Color;
|
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
|
||||||
import io.anuke.arc.graphics.g2d.Fill;
|
|
||||||
import io.anuke.arc.math.Mathf;
|
|
||||||
import io.anuke.arc.util.Time;
|
|
||||||
import io.anuke.mindustry.content.Fx;
|
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
|
||||||
import io.anuke.mindustry.type.Item;
|
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
|
||||||
import io.anuke.mindustry.world.Block;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeItem;
|
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeItems;
|
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
|
||||||
import io.anuke.mindustry.world.meta.StatUnit;
|
|
||||||
|
|
||||||
public class Smelter extends Block{
|
|
||||||
protected final int timerDump = timers++;
|
|
||||||
|
|
||||||
protected Item result;
|
|
||||||
|
|
||||||
protected float craftTime = 20f;
|
|
||||||
protected float burnDuration = 50f;
|
|
||||||
protected Effect craftEffect = Fx.smelt, burnEffect = Fx.fuelburn;
|
|
||||||
protected Color flameColor = Color.valueOf("ffb879");
|
|
||||||
|
|
||||||
public Smelter(String name){
|
|
||||||
super(name);
|
|
||||||
update = true;
|
|
||||||
hasItems = true;
|
|
||||||
solid = true;
|
|
||||||
|
|
||||||
consumes.require(ConsumeItems.class);
|
|
||||||
consumes.require(ConsumeItem.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setStats(){
|
|
||||||
super.setStats();
|
|
||||||
|
|
||||||
stats.add(BlockStat.fuelBurnTime, burnDuration / 60f, StatUnit.seconds);
|
|
||||||
stats.add(BlockStat.outputItem, result);
|
|
||||||
stats.add(BlockStat.craftSpeed, 60f / craftTime, StatUnit.itemsSecond);
|
|
||||||
stats.add(BlockStat.inputItemCapacity, itemCapacity, StatUnit.items);
|
|
||||||
stats.add(BlockStat.outputItemCapacity, itemCapacity, StatUnit.items);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init(){
|
|
||||||
super.init();
|
|
||||||
produces.set(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update(Tile tile){
|
|
||||||
SmelterEntity entity = tile.entity();
|
|
||||||
|
|
||||||
if(entity.timer.get(timerDump, 5) && entity.items.has(result)){
|
|
||||||
tryDump(tile, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
//add fuel
|
|
||||||
if(entity.consumed(ConsumeItem.class) && entity.burnTime <= 0f){
|
|
||||||
entity.items.remove(consumes.item(), 1);
|
|
||||||
entity.burnTime += burnDuration;
|
|
||||||
Effects.effect(burnEffect, entity.x + Mathf.range(2f), entity.y + Mathf.range(2f));
|
|
||||||
}
|
|
||||||
|
|
||||||
//decrement burntime
|
|
||||||
if(entity.burnTime > 0){
|
|
||||||
entity.burnTime -= entity.delta();
|
|
||||||
entity.heat = Mathf.lerpDelta(entity.heat, 1f, 0.02f);
|
|
||||||
}else{
|
|
||||||
entity.heat = Mathf.lerpDelta(entity.heat, 0f, 0.02f);
|
|
||||||
}
|
|
||||||
|
|
||||||
//make sure it has all the items
|
|
||||||
if(!entity.cons.valid()){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
entity.craftTime += entity.delta();
|
|
||||||
|
|
||||||
if(entity.items.get(result) >= itemCapacity //output full
|
|
||||||
|| entity.burnTime <= 0 //not burning
|
|
||||||
|| entity.craftTime < craftTime){ //not yet time
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
entity.craftTime = 0f;
|
|
||||||
for(ItemStack item : consumes.items()){
|
|
||||||
entity.items.remove(item.item, item.amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
offloadNear(tile, result);
|
|
||||||
Effects.effect(craftEffect, flameColor, tile.drawx(), tile.drawy());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean acceptItem(Item item, Tile tile, Tile source){
|
|
||||||
boolean isInput = false;
|
|
||||||
|
|
||||||
for(ItemStack req : consumes.items()){
|
|
||||||
if(req.item == item){
|
|
||||||
isInput = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (isInput && tile.entity.items.get(item) < itemCapacity) || (item == consumes.item() && tile.entity.items.get(consumes.item()) < itemCapacity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void draw(Tile tile){
|
|
||||||
super.draw(tile);
|
|
||||||
|
|
||||||
SmelterEntity entity = tile.entity();
|
|
||||||
|
|
||||||
//draw glowing center
|
|
||||||
if(entity.heat > 0f){
|
|
||||||
float g = 0.1f;
|
|
||||||
|
|
||||||
Draw.alpha(((1f - g) + Mathf.absin(Time.time(), 8f, g)) * entity.heat);
|
|
||||||
|
|
||||||
Draw.tint(flameColor);
|
|
||||||
Fill.circle(tile.drawx(), tile.drawy(), 2f + Mathf.absin(Time.time(), 5f, 0.8f));
|
|
||||||
Draw.color(1f, 1f, 1f, entity.heat);
|
|
||||||
Fill.circle(tile.drawx(), tile.drawy(), 1f + Mathf.absin(Time.time(), 5f, 0.7f));
|
|
||||||
|
|
||||||
Draw.color();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TileEntity newEntity(){
|
|
||||||
return new SmelterEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SmelterEntity extends TileEntity{
|
|
||||||
public float burnTime;
|
|
||||||
public float heat;
|
|
||||||
public float craftTime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -42,7 +42,7 @@ public class SolidPump extends Pump{
|
|||||||
@Override
|
@Override
|
||||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||||
if(attribute != null){
|
if(attribute != null){
|
||||||
drawPlaceText(Core.bundle.formatDouble("blocks.efficiency", (sumAttribute(attribute, x, y) + 1f)*100, 1), x, y, valid);
|
drawPlaceText(Core.bundle.formatFloat("bar.efficiency", (sumAttribute(attribute, x, y) + 1f)*100, 1), x, y, valid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ public class SolidPump extends Pump{
|
|||||||
public void setBars(){
|
public void setBars(){
|
||||||
super.setBars();
|
super.setBars();
|
||||||
bars.add("efficiency", entity -> new Bar(() ->
|
bars.add("efficiency", entity -> new Bar(() ->
|
||||||
Core.bundle.formatDouble("blocks.efficiency",
|
Core.bundle.formatFloat("bar.efficiency",
|
||||||
((((SolidPumpEntity)entity).boost + 1f) * ((SolidPumpEntity)entity).warmup) * 100, 1),
|
((((SolidPumpEntity)entity).boost + 1f) * ((SolidPumpEntity)entity).warmup) * 100, 1),
|
||||||
() -> Pal.ammo,
|
() -> Pal.ammo,
|
||||||
() -> ((SolidPumpEntity)entity).warmup));
|
() -> ((SolidPumpEntity)entity).warmup));
|
||||||
@@ -60,7 +60,8 @@ public class SolidPump extends Pump{
|
|||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
|
|
||||||
stats.add(BlockStat.liquidOutput, result);
|
stats.remove(BlockStat.output);
|
||||||
|
stats.add(BlockStat.output, result, 60f * pumpAmount, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ import io.anuke.mindustry.graphics.Shaders;
|
|||||||
import io.anuke.mindustry.type.Mech;
|
import io.anuke.mindustry.type.Mech;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
|
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
@@ -45,6 +47,13 @@ public class MechPad extends Block{
|
|||||||
hasPower = true;
|
hasPower = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setStats(){
|
||||||
|
super.setStats();
|
||||||
|
|
||||||
|
stats.add(BlockStat.productionTime, buildTime/60f, StatUnit.seconds);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(){
|
public void init(){
|
||||||
super.init();
|
super.init();
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ import io.anuke.mindustry.ui.Bar;
|
|||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeItems;
|
import io.anuke.mindustry.world.consumers.ConsumeItems;
|
||||||
|
import io.anuke.mindustry.world.consumers.ConsumeType;
|
||||||
import io.anuke.mindustry.world.meta.BlockFlag;
|
import io.anuke.mindustry.world.meta.BlockFlag;
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
import io.anuke.mindustry.world.meta.StatUnit;
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
import io.anuke.mindustry.world.modules.ItemModule;
|
|
||||||
|
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
@@ -45,6 +45,7 @@ public class UnitFactory extends Block{
|
|||||||
protected float launchVelocity = 0f;
|
protected float launchVelocity = 0f;
|
||||||
protected TextureRegion topRegion;
|
protected TextureRegion topRegion;
|
||||||
protected int maxSpawn = 2;
|
protected int maxSpawn = 2;
|
||||||
|
protected int[] capacities;
|
||||||
|
|
||||||
public UnitFactory(String name){
|
public UnitFactory(String name){
|
||||||
super(name);
|
super(name);
|
||||||
@@ -53,8 +54,6 @@ public class UnitFactory extends Block{
|
|||||||
hasItems = true;
|
hasItems = true;
|
||||||
solid = false;
|
solid = false;
|
||||||
flags = EnumSet.of(BlockFlag.producer);
|
flags = EnumSet.of(BlockFlag.producer);
|
||||||
|
|
||||||
consumes.require(ConsumeItems.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Remote(called = Loc.server)
|
@Remote(called = Loc.server)
|
||||||
@@ -79,6 +78,19 @@ public class UnitFactory extends Block{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(){
|
||||||
|
super.init();
|
||||||
|
|
||||||
|
capacities = new int[Vars.content.items().size];
|
||||||
|
if(consumes.has(ConsumeType.item)){
|
||||||
|
ConsumeItems cons = consumes.get(ConsumeType.item);
|
||||||
|
for(ItemStack stack : cons.items){
|
||||||
|
capacities[stack.item.id] = stack.amount*2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
super.load();
|
super.load();
|
||||||
@@ -89,8 +101,8 @@ public class UnitFactory extends Block{
|
|||||||
@Override
|
@Override
|
||||||
public void setBars(){
|
public void setBars(){
|
||||||
super.setBars();
|
super.setBars();
|
||||||
bars.add("progress", entity -> new Bar("blocks.progress", Pal.ammo, () -> ((UnitFactoryEntity)entity).buildTime / produceTime));
|
bars.add("progress", entity -> new Bar("bar.progress", Pal.ammo, () -> ((UnitFactoryEntity)entity).buildTime / produceTime));
|
||||||
bars.add("spawned", entity -> new Bar(() -> Core.bundle.format("blocks.spawned", ((UnitFactoryEntity)entity).spawned, maxSpawn), () -> Pal.command, () -> (float)((UnitFactoryEntity)entity).spawned / maxSpawn));
|
bars.add("spawned", entity -> new Bar(() -> Core.bundle.format("bar.spawned", ((UnitFactoryEntity)entity).spawned, maxSpawn), () -> Pal.command, () -> (float)((UnitFactoryEntity)entity).spawned / maxSpawn));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -102,7 +114,8 @@ public class UnitFactory extends Block{
|
|||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
|
|
||||||
stats.add(BlockStat.craftSpeed, produceTime / 60f, StatUnit.seconds);
|
stats.remove(BlockStat.itemCapacity);
|
||||||
|
stats.add(BlockStat.productionTime, produceTime / 60f, StatUnit.seconds);
|
||||||
stats.add(BlockStat.maxUnits, maxSpawn, StatUnit.none);
|
stats.add(BlockStat.maxUnits, maxSpawn, StatUnit.none);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +175,7 @@ public class UnitFactory extends Block{
|
|||||||
|
|
||||||
if(!tile.isEnemyCheat()){
|
if(!tile.isEnemyCheat()){
|
||||||
//player-made spawners have default behavior
|
//player-made spawners have default behavior
|
||||||
if(hasRequirements(entity.items, entity.buildTime / produceTime) && entity.cons.valid()){
|
if(entity.cons.valid()){
|
||||||
entity.time += entity.delta() * entity.speedScl;
|
entity.time += entity.delta() * entity.speedScl;
|
||||||
entity.buildTime += entity.delta() * entity.power.satisfaction;
|
entity.buildTime += entity.delta() * entity.power.satisfaction;
|
||||||
entity.speedScl = Mathf.lerpDelta(entity.speedScl, 1f, 0.05f);
|
entity.speedScl = Mathf.lerpDelta(entity.speedScl, 1f, 0.05f);
|
||||||
@@ -186,30 +199,13 @@ public class UnitFactory extends Block{
|
|||||||
Call.onUnitFactorySpawn(tile, entity.spawned + 1);
|
Call.onUnitFactorySpawn(tile, entity.spawned + 1);
|
||||||
useContent(tile, type);
|
useContent(tile, type);
|
||||||
|
|
||||||
for(ItemStack stack : consumes.items()){
|
entity.cons.trigger();
|
||||||
entity.items.remove(stack.item, stack.amount);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean acceptItem(Item item, Tile tile, Tile source){
|
|
||||||
for(ItemStack stack : consumes.items()){
|
|
||||||
if(item == stack.item && tile.entity.items.get(item) < stack.amount * 2){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaximumAccepted(Tile tile, Item item){
|
public int getMaximumAccepted(Tile tile, Item item){
|
||||||
for(ItemStack stack : consumes.items()){
|
return capacities[item.id];
|
||||||
if(item == stack.item){
|
|
||||||
return stack.amount * 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -223,21 +219,12 @@ public class UnitFactory extends Block{
|
|||||||
return entity.spawned < maxSpawn;
|
return entity.spawned < maxSpawn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean hasRequirements(ItemModule inv, float fraction){
|
|
||||||
for(ItemStack stack : consumes.items()){
|
|
||||||
if(!inv.has(stack.item, (int) (fraction * stack.amount))){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class UnitFactoryEntity extends TileEntity{
|
public static class UnitFactoryEntity extends TileEntity{
|
||||||
public float buildTime;
|
float buildTime;
|
||||||
public float time;
|
float time;
|
||||||
public float speedScl;
|
float speedScl;
|
||||||
public float warmup; //only for enemy spawners
|
float warmup; //only for enemy spawners
|
||||||
public int spawned;
|
int spawned;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(DataOutput stream) throws IOException{
|
public void write(DataOutput stream) throws IOException{
|
||||||
|
|||||||
@@ -2,14 +2,25 @@ package io.anuke.mindustry.world.consumers;
|
|||||||
|
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
import io.anuke.mindustry.entities.type.TileEntity;
|
||||||
import io.anuke.mindustry.world.Block;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.meta.BlockStats;
|
import io.anuke.mindustry.world.meta.BlockStats;
|
||||||
|
|
||||||
/**An abstract class that defines a type of resource that a block can consume.*/
|
/**An abstract class that defines a type of resource that a block can consume.*/
|
||||||
public abstract class Consume{
|
public abstract class Consume{
|
||||||
protected boolean optional;
|
protected boolean optional;
|
||||||
protected boolean update = true, boost = false;
|
protected boolean update = true;
|
||||||
|
|
||||||
|
/**Apply a filter to items accepted.
|
||||||
|
* This should set all item IDs that are present in the filter to true.*/
|
||||||
|
public void applyItemFilter(boolean[] filter){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**Apply a filter to liquids accepted.
|
||||||
|
* This should set all liquid IDs that are present in the filter to true.*/
|
||||||
|
public void applyLiquidFilter(boolean[] filter){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public Consume optional(boolean optional){
|
public Consume optional(boolean optional){
|
||||||
this.optional = optional;
|
this.optional = optional;
|
||||||
@@ -21,11 +32,6 @@ public abstract class Consume{
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Consume boost(boolean boost){
|
|
||||||
this.boost = boost;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isOptional(){
|
public boolean isOptional(){
|
||||||
return optional;
|
return optional;
|
||||||
}
|
}
|
||||||
@@ -34,18 +40,20 @@ public abstract class Consume{
|
|||||||
return update;
|
return update;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract ConsumeType type();
|
||||||
|
|
||||||
public abstract void build(Tile tile, Table table);
|
public abstract void build(Tile tile, Table table);
|
||||||
|
|
||||||
/**Called when a consumption is triggered manually.*/
|
/**Called when a consumption is triggered manually.*/
|
||||||
public void trigger(Block block, TileEntity entity){
|
public void trigger(TileEntity entity){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract String getIcon();
|
public abstract String getIcon();
|
||||||
|
|
||||||
public abstract void update(Block block, TileEntity entity);
|
public abstract void update(TileEntity entity);
|
||||||
|
|
||||||
public abstract boolean valid(Block block, TileEntity entity);
|
public abstract boolean valid(TileEntity entity);
|
||||||
|
|
||||||
public abstract void display(BlockStats stats);
|
public abstract void display(BlockStats stats);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.consumers;
|
|
||||||
|
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
|
||||||
import io.anuke.mindustry.type.Item;
|
|
||||||
import io.anuke.mindustry.type.Item.Icon;
|
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
|
||||||
import io.anuke.mindustry.ui.ItemImage;
|
|
||||||
import io.anuke.mindustry.ui.ReqImage;
|
|
||||||
import io.anuke.mindustry.world.Block;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
|
||||||
import io.anuke.mindustry.world.meta.BlockStats;
|
|
||||||
|
|
||||||
public class ConsumeItem extends Consume{
|
|
||||||
private final Item item;
|
|
||||||
private final int amount;
|
|
||||||
|
|
||||||
public ConsumeItem(Item item){
|
|
||||||
this.item = item;
|
|
||||||
this.amount = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ConsumeItem(Item item, int amount){
|
|
||||||
this.item = item;
|
|
||||||
this.amount = amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getAmount(){
|
|
||||||
return amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Item get(){
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void trigger(Block block, TileEntity entity){
|
|
||||||
entity.items.remove(item, amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void build(Tile tile, Table table){
|
|
||||||
table.add(new ReqImage(new ItemImage(item.icon(Icon.large), amount), () -> valid(tile.block(), tile.entity))).size(8*4);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getIcon(){
|
|
||||||
return "icon-item";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update(Block block, TileEntity entity){
|
|
||||||
//doesn't update because consuming items is very specific
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean valid(Block block, TileEntity entity){
|
|
||||||
return entity != null && entity.items != null && entity.items.has(item, amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void display(BlockStats stats){
|
|
||||||
stats.add(boost ? BlockStat.boostItem : BlockStat.inputItem, new ItemStack(item, amount));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -9,7 +9,6 @@ import io.anuke.mindustry.type.Item.Icon;
|
|||||||
import io.anuke.mindustry.ui.ItemImage;
|
import io.anuke.mindustry.ui.ItemImage;
|
||||||
import io.anuke.mindustry.ui.MultiReqImage;
|
import io.anuke.mindustry.ui.MultiReqImage;
|
||||||
import io.anuke.mindustry.ui.ReqImage;
|
import io.anuke.mindustry.ui.ReqImage;
|
||||||
import io.anuke.mindustry.world.Block;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
import io.anuke.mindustry.world.meta.BlockStats;
|
import io.anuke.mindustry.world.meta.BlockStats;
|
||||||
@@ -18,12 +17,22 @@ import io.anuke.mindustry.world.meta.values.ItemFilterValue;
|
|||||||
import static io.anuke.mindustry.Vars.content;
|
import static io.anuke.mindustry.Vars.content;
|
||||||
|
|
||||||
public class ConsumeItemFilter extends Consume{
|
public class ConsumeItemFilter extends Consume{
|
||||||
private final Predicate<Item> filter;
|
public final Predicate<Item> filter;
|
||||||
|
|
||||||
public ConsumeItemFilter(Predicate<Item> item){
|
public ConsumeItemFilter(Predicate<Item> item){
|
||||||
this.filter = item;
|
this.filter = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void applyItemFilter(boolean[] arr){
|
||||||
|
content.items().each(filter, item -> arr[item.id] = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConsumeType type(){
|
||||||
|
return ConsumeType.item;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void build(Tile tile, Table table){
|
public void build(Tile tile, Table table){
|
||||||
Array<Item> list = content.items().select(filter);
|
Array<Item> list = content.items().select(filter);
|
||||||
@@ -39,12 +48,12 @@ public class ConsumeItemFilter extends Consume{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Block block, TileEntity entity){
|
public void update(TileEntity entity){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void trigger(Block block, TileEntity entity){
|
public void trigger(TileEntity entity){
|
||||||
for(int i = 0; i < content.items().size; i++){
|
for(int i = 0; i < content.items().size; i++){
|
||||||
Item item = content.item(i);
|
Item item = content.item(i);
|
||||||
if(entity.items != null && entity.items.has(item) && this.filter.test(item)){
|
if(entity.items != null && entity.items.has(item) && this.filter.test(item)){
|
||||||
@@ -55,7 +64,7 @@ public class ConsumeItemFilter extends Consume{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean valid(Block block, TileEntity entity){
|
public boolean valid(TileEntity entity){
|
||||||
for(int i = 0; i < content.items().size; i++){
|
for(int i = 0; i < content.items().size; i++){
|
||||||
Item item = content.item(i);
|
Item item = content.item(i);
|
||||||
if(entity.items != null && entity.items.has(item) && this.filter.test(item)){
|
if(entity.items != null && entity.items.has(item) && this.filter.test(item)){
|
||||||
@@ -67,6 +76,6 @@ public class ConsumeItemFilter extends Consume{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void display(BlockStats stats){
|
public void display(BlockStats stats){
|
||||||
stats.add(boost ? BlockStat.boostItem : BlockStat.inputItem, new ItemFilterValue(filter));
|
stats.add(optional ? BlockStat.booster : BlockStat.input, new ItemFilterValue(filter));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,21 +6,28 @@ import io.anuke.mindustry.type.Item.Icon;
|
|||||||
import io.anuke.mindustry.type.ItemStack;
|
import io.anuke.mindustry.type.ItemStack;
|
||||||
import io.anuke.mindustry.ui.ItemImage;
|
import io.anuke.mindustry.ui.ItemImage;
|
||||||
import io.anuke.mindustry.ui.ReqImage;
|
import io.anuke.mindustry.ui.ReqImage;
|
||||||
import io.anuke.mindustry.world.Block;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
import io.anuke.mindustry.world.meta.BlockStats;
|
import io.anuke.mindustry.world.meta.BlockStats;
|
||||||
import io.anuke.mindustry.world.meta.values.ItemListValue;
|
import io.anuke.mindustry.world.meta.values.ItemListValue;
|
||||||
|
|
||||||
public class ConsumeItems extends Consume{
|
public class ConsumeItems extends Consume{
|
||||||
private ItemStack[] items;
|
public final ItemStack[] items;
|
||||||
|
|
||||||
public ConsumeItems(ItemStack[] items){
|
public ConsumeItems(ItemStack[] items){
|
||||||
this.items = items;
|
this.items = items;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack[] getItems(){
|
@Override
|
||||||
return items;
|
public void applyItemFilter(boolean[] filter){
|
||||||
|
for(ItemStack stack : items){
|
||||||
|
filter[stack.item.id] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConsumeType type(){
|
||||||
|
return ConsumeType.item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -36,24 +43,24 @@ public class ConsumeItems extends Consume{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Block block, TileEntity entity){
|
public void update(TileEntity entity){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void trigger(Block block, TileEntity entity){
|
public void trigger(TileEntity entity){
|
||||||
for(ItemStack stack : items){
|
for(ItemStack stack : items){
|
||||||
entity.items.remove(stack);
|
entity.items.remove(stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean valid(Block block, TileEntity entity){
|
public boolean valid(TileEntity entity){
|
||||||
return entity.items != null && entity.items.has(items);
|
return entity.items != null && entity.items.has(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void display(BlockStats stats){
|
public void display(BlockStats stats){
|
||||||
stats.add(boost ? BlockStat.boostItem : BlockStat.inputItems, new ItemListValue(items));
|
stats.add(optional ? BlockStat.booster : BlockStat.input, new ItemListValue(items));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,32 +4,26 @@ import io.anuke.arc.scene.ui.layout.Table;
|
|||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
import io.anuke.mindustry.entities.type.TileEntity;
|
||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.mindustry.ui.ReqImage;
|
import io.anuke.mindustry.ui.ReqImage;
|
||||||
import io.anuke.mindustry.world.Block;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
import io.anuke.mindustry.world.meta.BlockStats;
|
import io.anuke.mindustry.world.meta.BlockStats;
|
||||||
import io.anuke.mindustry.world.meta.StatUnit;
|
|
||||||
|
|
||||||
public class ConsumeLiquid extends Consume{
|
public class ConsumeLiquid extends ConsumeLiquidBase{
|
||||||
protected final float use;
|
public final Liquid liquid;
|
||||||
protected final Liquid liquid;
|
|
||||||
|
|
||||||
public ConsumeLiquid(Liquid liquid, float use){
|
public ConsumeLiquid(Liquid liquid, float amount){
|
||||||
|
super(amount);
|
||||||
this.liquid = liquid;
|
this.liquid = liquid;
|
||||||
this.use = use;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float used(){
|
@Override
|
||||||
return use;
|
public void applyLiquidFilter(boolean[] filter){
|
||||||
}
|
filter[liquid.id] = true;
|
||||||
|
|
||||||
public Liquid get(){
|
|
||||||
return liquid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void build(Tile tile, Table table){
|
public void build(Tile tile, Table table){
|
||||||
table.add(new ReqImage(liquid.getContentIcon(), () -> valid(tile.block(), tile.entity))).size(8*4);
|
table.add(new ReqImage(liquid.getContentIcon(), () -> valid(tile.entity))).size(8*4);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -38,26 +32,17 @@ public class ConsumeLiquid extends Consume{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Block block, TileEntity entity){
|
public void update(TileEntity entity){
|
||||||
entity.liquids.remove(liquid, Math.min(use(block, entity), entity.liquids.get(liquid)));
|
entity.liquids.remove(liquid, Math.min(use(entity), entity.liquids.get(liquid)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean valid(Block block, TileEntity entity){
|
public boolean valid(TileEntity entity){
|
||||||
return entity != null && entity.liquids != null && entity.liquids.get(liquid) >= use(block, entity);
|
return entity != null && entity.liquids != null && entity.liquids.get(liquid) >= use(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void display(BlockStats stats){
|
public void display(BlockStats stats){
|
||||||
if(!boost){
|
stats.add(optional ? BlockStat.booster : BlockStat.input, liquid, amount * timePeriod, timePeriod == 60);
|
||||||
stats.add(BlockStat.liquidUse, use * 60f, StatUnit.liquidSecond);
|
|
||||||
stats.add(BlockStat.inputLiquid, liquid);
|
|
||||||
}else{
|
|
||||||
stats.add(BlockStat.boostLiquid, liquid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
float use(Block block, TileEntity entity){
|
|
||||||
return Math.min(use * entity.delta(), block.liquidCapacity);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package io.anuke.mindustry.world.consumers;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.entities.type.TileEntity;
|
||||||
|
|
||||||
|
public abstract class ConsumeLiquidBase extends Consume{
|
||||||
|
/**amount used per frame*/
|
||||||
|
public final float amount;
|
||||||
|
/**How much time is taken to use this liquid, in ticks. Used only for visual purposes.
|
||||||
|
* Example: a normal ConsumeLiquid with 10/s and a 10 second timePeriod would display as "100 seconds".
|
||||||
|
* Without a time override, it would display as "10 liquid/second".
|
||||||
|
* This is used for generic crafters.*/
|
||||||
|
public float timePeriod = 60;
|
||||||
|
|
||||||
|
public ConsumeLiquidBase(float amount){
|
||||||
|
this.amount = amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConsumeType type(){
|
||||||
|
return ConsumeType.liquid;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected float use(TileEntity entity){
|
||||||
|
return Math.min(amount * entity.delta(), entity.block.liquidCapacity);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,35 +7,31 @@ import io.anuke.mindustry.entities.type.TileEntity;
|
|||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.mindustry.ui.MultiReqImage;
|
import io.anuke.mindustry.ui.MultiReqImage;
|
||||||
import io.anuke.mindustry.ui.ReqImage;
|
import io.anuke.mindustry.ui.ReqImage;
|
||||||
import io.anuke.mindustry.world.Block;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
import io.anuke.mindustry.world.meta.BlockStats;
|
import io.anuke.mindustry.world.meta.BlockStats;
|
||||||
import io.anuke.mindustry.world.meta.StatUnit;
|
|
||||||
import io.anuke.mindustry.world.meta.values.LiquidFilterValue;
|
import io.anuke.mindustry.world.meta.values.LiquidFilterValue;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.content;
|
import static io.anuke.mindustry.Vars.content;
|
||||||
|
|
||||||
public class ConsumeLiquidFilter extends Consume{
|
public class ConsumeLiquidFilter extends ConsumeLiquidBase{
|
||||||
private final Predicate<Liquid> filter;
|
public final Predicate<Liquid> filter;
|
||||||
private final float use;
|
|
||||||
private final boolean isFuel;
|
|
||||||
|
|
||||||
public ConsumeLiquidFilter(Predicate<Liquid> liquid, float amount, boolean isFuel){
|
|
||||||
this.filter = liquid;
|
|
||||||
this.use = amount;
|
|
||||||
this.isFuel = isFuel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ConsumeLiquidFilter(Predicate<Liquid> liquid, float amount){
|
public ConsumeLiquidFilter(Predicate<Liquid> liquid, float amount){
|
||||||
this(liquid, amount, false);
|
super(amount);
|
||||||
|
this.filter = liquid;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void applyLiquidFilter(boolean[] arr){
|
||||||
|
content.liquids().each(filter, item -> arr[item.id] = true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void build(Tile tile, Table table){
|
public void build(Tile tile, Table table){
|
||||||
Array<Liquid> list = content.liquids().select(l -> !l.isHidden() && filter.test(l));
|
Array<Liquid> list = content.liquids().select(l -> !l.isHidden() && filter.test(l));
|
||||||
MultiReqImage image = new MultiReqImage();
|
MultiReqImage image = new MultiReqImage();
|
||||||
list.each(liquid -> image.add(new ReqImage(liquid.getContentIcon(), () -> tile.entity != null && tile.entity.liquids != null && tile.entity.liquids.get(liquid) >= use(tile.block(), tile.entity))));
|
list.each(liquid -> image.add(new ReqImage(liquid.getContentIcon(), () -> tile.entity != null && tile.entity.liquids != null && tile.entity.liquids.get(liquid) >= use(tile.entity))));
|
||||||
|
|
||||||
table.add(image).size(8*4);
|
table.add(image).size(8*4);
|
||||||
}
|
}
|
||||||
@@ -46,29 +42,17 @@ public class ConsumeLiquidFilter extends Consume{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Block block, TileEntity entity){
|
public void update(TileEntity entity){
|
||||||
entity.liquids.remove(entity.liquids.current(), use(block, entity));
|
entity.liquids.remove(entity.liquids.current(), use(entity));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean valid(Block block, TileEntity entity){
|
public boolean valid(TileEntity entity){
|
||||||
return entity != null && entity.liquids != null && filter.test(entity.liquids.current()) && entity.liquids.currentAmount() >= use(block, entity);
|
return entity != null && entity.liquids != null && filter.test(entity.liquids.current()) && entity.liquids.currentAmount() >= use(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void display(BlockStats stats){
|
public void display(BlockStats stats){
|
||||||
if(boost){
|
stats.add(optional ? BlockStat.booster : BlockStat.input, new LiquidFilterValue(filter, amount * timePeriod, timePeriod == 60f));
|
||||||
stats.add(BlockStat.boostLiquid, new LiquidFilterValue(filter));
|
|
||||||
}else if(isFuel){
|
|
||||||
stats.add(BlockStat.inputLiquidFuel, new LiquidFilterValue(filter));
|
|
||||||
stats.add(BlockStat.liquidFuelUse, 60f * use, StatUnit.liquidSecond);
|
|
||||||
}else {
|
|
||||||
stats.add(BlockStat.inputLiquid, new LiquidFilterValue(filter));
|
|
||||||
stats.add(BlockStat.liquidUse, 60f * use, StatUnit.liquidSecond);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
float use(Block block, TileEntity entity){
|
|
||||||
return Math.min(use * entity.delta(), block.liquidCapacity);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ public class ConsumePower extends Consume{
|
|||||||
this.isBuffered = isBuffered;
|
this.isBuffered = isBuffered;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConsumeType type(){
|
||||||
|
return ConsumeType.power;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void build(Tile tile, Table table){
|
public void build(Tile tile, Table table){
|
||||||
//No tooltip for power, for now
|
//No tooltip for power, for now
|
||||||
@@ -35,12 +40,12 @@ public class ConsumePower extends Consume{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Block block, TileEntity entity){
|
public void update(TileEntity entity){
|
||||||
// Nothing to do since PowerGraph directly updates entity.power.satisfaction
|
// Nothing to do since PowerGraph directly updates entity.power.satisfaction
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean valid(Block block, TileEntity entity){
|
public boolean valid(TileEntity entity){
|
||||||
if(isBuffered){
|
if(isBuffered){
|
||||||
return true;
|
return true;
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package io.anuke.mindustry.world.consumers;
|
||||||
|
|
||||||
|
public enum ConsumeType{
|
||||||
|
item,
|
||||||
|
power,
|
||||||
|
liquid
|
||||||
|
}
|
||||||
@@ -1,39 +1,39 @@
|
|||||||
package io.anuke.mindustry.world.consumers;
|
package io.anuke.mindustry.world.consumers;
|
||||||
|
|
||||||
import io.anuke.arc.collection.Array;
|
import io.anuke.arc.util.Structs;
|
||||||
import io.anuke.arc.collection.ObjectMap;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.arc.collection.ObjectSet;
|
|
||||||
import io.anuke.arc.function.Consumer;
|
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
import io.anuke.mindustry.type.ItemStack;
|
||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.meta.BlockStats;
|
||||||
|
|
||||||
public class Consumers{
|
public class Consumers{
|
||||||
private ObjectMap<Class<? extends Consume>, Consume> map = new ObjectMap<>();
|
private Consume[] map = new Consume[ConsumeType.values().length];
|
||||||
private ObjectSet<Class<? extends Consume>> required = new ObjectSet<>();
|
private Consume[] results, optionalResults;
|
||||||
private Array<Consume> results = new Array<>();
|
|
||||||
|
|
||||||
public void require(Class<? extends Consume> type){
|
public final boolean[] itemFilters = new boolean[Vars.content.items().size];
|
||||||
required.add(type);
|
public final boolean[] liquidfilters = new boolean[Vars.content.liquids().size];
|
||||||
|
|
||||||
|
public void init(){
|
||||||
|
results = Structs.filter(Consume.class, map, m -> m != null);
|
||||||
|
optionalResults = Structs.filter(Consume.class, map, m -> m != null && m.isOptional());
|
||||||
|
|
||||||
|
for(Consume cons : results){
|
||||||
|
cons.applyItemFilter(itemFilters);
|
||||||
|
cons.applyLiquidFilter(liquidfilters);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkRequired(Block block){
|
public ConsumePower getPower(){
|
||||||
for(Class<? extends Consume> c : required){
|
return get(ConsumeType.power);
|
||||||
if(!map.containsKey(c)){
|
}
|
||||||
throw new RuntimeException("Missing required consumer of type \"" + c + "\" in block \"" + block.name + "\"!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(Consume cons : map.values()){
|
public boolean hasPower(){
|
||||||
results.add(cons);
|
return has(ConsumeType.power);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConsumeLiquid liquid(Liquid liquid, float amount){
|
public ConsumeLiquid liquid(Liquid liquid, float amount){
|
||||||
ConsumeLiquid c = new ConsumeLiquid(liquid, amount);
|
return add(new ConsumeLiquid(liquid, amount));
|
||||||
add(c);
|
|
||||||
return c;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,9 +42,7 @@ public class Consumers{
|
|||||||
* @return the created consumer object.
|
* @return the created consumer object.
|
||||||
*/
|
*/
|
||||||
public ConsumePower power(float powerPerTick){
|
public ConsumePower power(float powerPerTick){
|
||||||
ConsumePower c = new ConsumePower(powerPerTick, 0.0f, false);
|
return add(new ConsumePower(powerPerTick, 0.0f, false));
|
||||||
add(c);
|
|
||||||
return c;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -62,83 +60,55 @@ public class Consumers{
|
|||||||
* @param ticksToFill The number of ticks it shall take to fill the buffer.
|
* @param ticksToFill The number of ticks it shall take to fill the buffer.
|
||||||
*/
|
*/
|
||||||
public ConsumePower powerBuffered(float powerCapacity, float ticksToFill){
|
public ConsumePower powerBuffered(float powerCapacity, float ticksToFill){
|
||||||
ConsumePower c = new ConsumePower(powerCapacity / ticksToFill, powerCapacity, true);
|
return add(new ConsumePower(powerCapacity / ticksToFill, powerCapacity, true));
|
||||||
add(c);
|
|
||||||
return c;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConsumeItem item(Item item){
|
public ConsumeItems item(Item item){
|
||||||
return item(item, 1);
|
return item(item, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConsumeItem item(Item item, int amount){
|
public ConsumeItems item(Item item, int amount){
|
||||||
ConsumeItem i = new ConsumeItem(item, amount);
|
return add(new ConsumeItems(new ItemStack[]{new ItemStack(item, amount)}));
|
||||||
add(i);
|
|
||||||
return i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConsumeItems items(ItemStack... items){
|
public ConsumeItems items(ItemStack... items){
|
||||||
ConsumeItems i = new ConsumeItems(items);
|
return add(new ConsumeItems(items));
|
||||||
add(i);
|
|
||||||
return i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Item item(){
|
public <T extends Consume> T add(T consume){
|
||||||
return get(ConsumeItem.class).get();
|
map[consume.type().ordinal()] = consume;
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack[] items(){
|
|
||||||
return get(ConsumeItems.class).getItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int itemAmount(){
|
|
||||||
return get(ConsumeItem.class).getAmount();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Liquid liquid(){
|
|
||||||
return get(ConsumeLiquid.class).get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public float liquidAmount(){
|
|
||||||
return get(ConsumeLiquid.class).use;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Consume add(Consume consume){
|
|
||||||
map.put((consume instanceof ConsumePower ? ConsumePower.class : consume.getClass()), consume);
|
|
||||||
return consume;
|
return consume;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove(Class<? extends Consume> type){
|
public void remove(ConsumeType type){
|
||||||
map.remove(type);
|
map[type.ordinal()] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean has(Class<? extends Consume> type){
|
public boolean has(ConsumeType type){
|
||||||
return map.containsKey(type);
|
return map[type.ordinal()] != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public <T extends Consume> T get(Class<T> type){
|
public <T extends Consume> T get(ConsumeType type){
|
||||||
if(!map.containsKey(type)){
|
if(map[type.ordinal()] == null){
|
||||||
throw new IllegalArgumentException("Block does not contain consumer of type '" + type + "'!");
|
throw new IllegalArgumentException("Block does not contain consumer of type '" + type + "'!");
|
||||||
}
|
}
|
||||||
return (T) map.get(type);
|
return (T) map[type.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public Iterable<Consume> all(){
|
public Consume[] all(){
|
||||||
return map.values();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Array<Consume> array(){
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasAny(){
|
public Consume[] optionals(){
|
||||||
return map.size > 0;
|
return optionalResults;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void forEach(Consumer<Consume> cons){
|
public void display(BlockStats stats){
|
||||||
for(Consume c : all()){
|
for(Consume c : map){
|
||||||
cons.accept(c);
|
if(c != null){
|
||||||
|
c.display(stats);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,38 +10,25 @@ public enum BlockStat{
|
|||||||
size(StatCategory.general),
|
size(StatCategory.general),
|
||||||
|
|
||||||
itemCapacity(StatCategory.items),
|
itemCapacity(StatCategory.items),
|
||||||
inputItemCapacity(StatCategory.items),
|
|
||||||
outputItemCapacity(StatCategory.items),
|
|
||||||
itemsMoved(StatCategory.items),
|
itemsMoved(StatCategory.items),
|
||||||
launchTime(StatCategory.items),
|
launchTime(StatCategory.items),
|
||||||
|
|
||||||
liquidCapacity(StatCategory.liquids),
|
liquidCapacity(StatCategory.liquids),
|
||||||
liquidOutput(StatCategory.liquids),
|
|
||||||
liquidOutputSpeed(StatCategory.liquids),
|
|
||||||
coolant(StatCategory.liquids),
|
|
||||||
coolantUse(StatCategory.liquids),
|
|
||||||
|
|
||||||
powerCapacity(StatCategory.power),
|
powerCapacity(StatCategory.power),
|
||||||
powerUse(StatCategory.power),
|
powerUse(StatCategory.power),
|
||||||
powerDamage(StatCategory.power),
|
powerDamage(StatCategory.power),
|
||||||
powerRange(StatCategory.power),
|
powerRange(StatCategory.power),
|
||||||
powerTransferSpeed(StatCategory.power),
|
|
||||||
basePowerGeneration(StatCategory.power),
|
basePowerGeneration(StatCategory.power),
|
||||||
inputLiquidFuel(StatCategory.power),
|
|
||||||
liquidFuelUse(StatCategory.power),
|
|
||||||
|
|
||||||
inputLiquid(StatCategory.crafting),
|
input(StatCategory.crafting),
|
||||||
liquidUse(StatCategory.crafting),
|
output(StatCategory.crafting),
|
||||||
inputItem(StatCategory.crafting),
|
productionTime(StatCategory.crafting),
|
||||||
inputItems(StatCategory.crafting),
|
|
||||||
inputFuel(StatCategory.crafting),
|
|
||||||
fuelBurnTime(StatCategory.crafting),
|
|
||||||
craftSpeed(StatCategory.crafting),
|
|
||||||
outputItem(StatCategory.crafting),
|
|
||||||
drillTier(StatCategory.crafting),
|
drillTier(StatCategory.crafting),
|
||||||
drillSpeed(StatCategory.crafting),
|
drillSpeed(StatCategory.crafting),
|
||||||
maxUnits(StatCategory.crafting),
|
maxUnits(StatCategory.crafting),
|
||||||
|
|
||||||
|
speedIncrease(StatCategory.shooting),
|
||||||
repairTime(StatCategory.shooting),
|
repairTime(StatCategory.shooting),
|
||||||
range(StatCategory.shooting),
|
range(StatCategory.shooting),
|
||||||
shootRange(StatCategory.shooting),
|
shootRange(StatCategory.shooting),
|
||||||
@@ -53,9 +40,8 @@ public enum BlockStat{
|
|||||||
targetsGround(StatCategory.shooting),
|
targetsGround(StatCategory.shooting),
|
||||||
ammo(StatCategory.shooting),
|
ammo(StatCategory.shooting),
|
||||||
|
|
||||||
boostItem(StatCategory.optional),
|
booster(StatCategory.optional),
|
||||||
boostLiquid(StatCategory.optional),
|
boostEffect(StatCategory.optional)
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
public final StatCategory category;
|
public final StatCategory category;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package io.anuke.mindustry.world.meta;
|
package io.anuke.mindustry.world.meta;
|
||||||
|
|
||||||
|
import io.anuke.arc.collection.Array;
|
||||||
import io.anuke.arc.collection.ObjectMap.Entry;
|
import io.anuke.arc.collection.ObjectMap.Entry;
|
||||||
import io.anuke.arc.collection.OrderedMap;
|
import io.anuke.arc.collection.OrderedMap;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
@@ -9,7 +10,7 @@ import io.anuke.mindustry.world.meta.values.*;
|
|||||||
|
|
||||||
/**Hold and organizes a list of block stats.*/
|
/**Hold and organizes a list of block stats.*/
|
||||||
public class BlockStats{
|
public class BlockStats{
|
||||||
private final OrderedMap<StatCategory, OrderedMap<BlockStat, StatValue>> map = new OrderedMap<>();
|
private final OrderedMap<StatCategory, OrderedMap<BlockStat, Array<StatValue>>> map = new OrderedMap<>();
|
||||||
private boolean dirty;
|
private boolean dirty;
|
||||||
|
|
||||||
/**Adds a single float value with this stat, formatted to 2 decimal places.*/
|
/**Adds a single float value with this stat, formatted to 2 decimal places.*/
|
||||||
@@ -24,17 +25,17 @@ public class BlockStats{
|
|||||||
|
|
||||||
/**Adds an item value.*/
|
/**Adds an item value.*/
|
||||||
public void add(BlockStat stat, Item item){
|
public void add(BlockStat stat, Item item){
|
||||||
add(stat, new ItemValue(new ItemStack(item, 1)));
|
add(stat, new ItemListValue(new ItemStack(item, 1)));
|
||||||
}
|
|
||||||
|
|
||||||
/**Adds a liquid value.*/
|
|
||||||
public void add(BlockStat stat, Liquid liquid){
|
|
||||||
add(stat, new LiquidValue(liquid));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**Adds an item value.*/
|
/**Adds an item value.*/
|
||||||
public void add(BlockStat stat, ItemStack item){
|
public void add(BlockStat stat, ItemStack item){
|
||||||
add(stat, new ItemValue(item));
|
add(stat, new ItemListValue(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**Adds an item value.*/
|
||||||
|
public void add(BlockStat stat, Liquid liquid, float amount, boolean perSecond){
|
||||||
|
add(stat, new LiquidValue(liquid, amount, perSecond));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**Adds a single string value with this stat.*/
|
/**Adds a single string value with this stat.*/
|
||||||
@@ -44,15 +45,11 @@ public class BlockStats{
|
|||||||
|
|
||||||
/**Adds a stat value.*/
|
/**Adds a stat value.*/
|
||||||
public void add(BlockStat stat, StatValue value){
|
public void add(BlockStat stat, StatValue value){
|
||||||
if(map.containsKey(stat.category) && map.get(stat.category).containsKey(stat)){
|
|
||||||
throw new RuntimeException("Duplicate stat entry: \"" + stat + "\" in block.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!map.containsKey(stat.category)){
|
if(!map.containsKey(stat.category)){
|
||||||
map.put(stat.category, new OrderedMap<>());
|
map.put(stat.category, new OrderedMap<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
map.get(stat.category).put(stat, value);
|
map.get(stat.category).getOr(stat, Array::new).add(value);
|
||||||
|
|
||||||
dirty = true;
|
dirty = true;
|
||||||
}
|
}
|
||||||
@@ -68,11 +65,11 @@ public class BlockStats{
|
|||||||
dirty = true;
|
dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrderedMap<StatCategory, OrderedMap<BlockStat, StatValue>> toMap(){
|
public OrderedMap<StatCategory, OrderedMap<BlockStat, Array<StatValue>>> toMap(){
|
||||||
//sort stats by index if they've been modified
|
//sort stats by index if they've been modified
|
||||||
if(dirty){
|
if(dirty){
|
||||||
map.orderedKeys().sort();
|
map.orderedKeys().sort();
|
||||||
for(Entry<StatCategory, OrderedMap<BlockStat, StatValue>> entry : map.entries()){
|
for(Entry<StatCategory, OrderedMap<BlockStat, Array<StatValue>>> entry : map.entries()){
|
||||||
entry.value.orderedKeys().sort();
|
entry.value.orderedKeys().sort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.meta;
|
|
||||||
|
|
||||||
import io.anuke.mindustry.game.UnlockableContent;
|
|
||||||
|
|
||||||
public interface ContentStatValue extends StatValue{
|
|
||||||
UnlockableContent[] getValueContent();
|
|
||||||
}
|
|
||||||
@@ -16,9 +16,22 @@ public enum StatUnit{
|
|||||||
powerUnits,
|
powerUnits,
|
||||||
degrees,
|
degrees,
|
||||||
seconds,
|
seconds,
|
||||||
|
perSecond,
|
||||||
|
timesSpeed(false),
|
||||||
|
percent(false),
|
||||||
none,
|
none,
|
||||||
items;
|
items;
|
||||||
|
|
||||||
|
public final boolean space;
|
||||||
|
|
||||||
|
StatUnit(boolean space){
|
||||||
|
this.space = space;
|
||||||
|
}
|
||||||
|
|
||||||
|
StatUnit(){
|
||||||
|
this(true);
|
||||||
|
}
|
||||||
|
|
||||||
public String localized(){
|
public String localized(){
|
||||||
if(this == none) return "";
|
if(this == none) return "";
|
||||||
return Core.bundle.get("unit." + name().toLowerCase(Locale.ROOT));
|
return Core.bundle.get("unit." + name().toLowerCase(Locale.ROOT));
|
||||||
|
|||||||
@@ -38,14 +38,14 @@ public class AmmoListValue<T extends UnlockableContent> implements StatValue{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(type.splashDamage > 0){
|
if(type.splashDamage > 0){
|
||||||
sep(bt, Core.bundle.format("bullet.splashdamage", (int)type.splashDamage, Strings.toFixed(type.splashDamageRadius / tilesize, 1)));
|
sep(bt, Core.bundle.format("bullet.splashdamage", (int)type.splashDamage, Strings.fixed(type.splashDamageRadius / tilesize, 1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Mathf.isEqual(type.ammoMultiplier, 1f)) sep(bt, Core.bundle.format("bullet.multiplier", (int)type.ammoMultiplier));
|
if(!Mathf.isEqual(type.ammoMultiplier, 1f)) sep(bt, Core.bundle.format("bullet.multiplier", (int)type.ammoMultiplier));
|
||||||
if(!Mathf.isEqual(type.reloadMultiplier, 1f)) sep(bt, Core.bundle.format("bullet.reload", Strings.toFixed(type.reloadMultiplier, 1)));
|
if(!Mathf.isEqual(type.reloadMultiplier, 1f)) sep(bt, Core.bundle.format("bullet.reload", Strings.fixed(type.reloadMultiplier, 1)));
|
||||||
|
|
||||||
if(type.knockback > 0){
|
if(type.knockback > 0){
|
||||||
sep(bt, Core.bundle.format("bullet.knockback", Strings.toFixed(type.knockback, 1)));
|
sep(bt, Core.bundle.format("bullet.knockback", Strings.fixed(type.knockback, 1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if((type.status == StatusEffects.burning || type.status == StatusEffects.melting) || type.incendAmount > 0){
|
if((type.status == StatusEffects.burning || type.status == StatusEffects.melting) || type.incendAmount > 0){
|
||||||
|
|||||||
@@ -1,49 +1,21 @@
|
|||||||
package io.anuke.mindustry.world.meta.values;
|
package io.anuke.mindustry.world.meta.values;
|
||||||
|
|
||||||
import io.anuke.mindustry.game.UnlockableContent;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.mindustry.type.Item;
|
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
import io.anuke.mindustry.type.ItemStack;
|
||||||
import io.anuke.mindustry.ui.ItemDisplay;
|
import io.anuke.mindustry.ui.ItemDisplay;
|
||||||
import io.anuke.mindustry.world.meta.ContentStatValue;
|
import io.anuke.mindustry.world.meta.StatValue;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
|
||||||
|
|
||||||
public class ItemListValue implements ContentStatValue{
|
public class ItemListValue implements StatValue{
|
||||||
private final Item[] items;
|
|
||||||
private final ItemStack[] stacks;
|
private final ItemStack[] stacks;
|
||||||
|
|
||||||
public ItemListValue(Item[] items){
|
public ItemListValue(ItemStack... stacks){
|
||||||
this.items = items;
|
|
||||||
this.stacks = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemListValue(ItemStack[] stacks){
|
|
||||||
this.stacks = stacks;
|
this.stacks = stacks;
|
||||||
this.items = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public UnlockableContent[] getValueContent(){
|
|
||||||
if(items != null){
|
|
||||||
return items;
|
|
||||||
}else{
|
|
||||||
Item[] res = new Item[stacks.length];
|
|
||||||
for(int i = 0; i < res.length; i++){
|
|
||||||
res[i] = stacks[i].item;
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void display(Table table){
|
public void display(Table table){
|
||||||
if(items != null){
|
for(ItemStack stack : stacks){
|
||||||
for(Item item : items){
|
table.add(new ItemDisplay(stack.item, stack.amount)).padRight(5);
|
||||||
table.add(new ItemDisplay(item)).padRight(5);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
for(ItemStack stack : stacks){
|
|
||||||
table.add(new ItemDisplay(stack.item, stack.amount)).padRight(5);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.meta.values;
|
|
||||||
|
|
||||||
import io.anuke.mindustry.game.UnlockableContent;
|
|
||||||
import io.anuke.mindustry.type.Item;
|
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
|
||||||
import io.anuke.mindustry.ui.ItemDisplay;
|
|
||||||
import io.anuke.mindustry.world.meta.ContentStatValue;
|
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
|
||||||
|
|
||||||
public class ItemValue implements ContentStatValue{
|
|
||||||
private final ItemStack item;
|
|
||||||
|
|
||||||
public ItemValue(ItemStack item){
|
|
||||||
this.item = item;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public UnlockableContent[] getValueContent(){
|
|
||||||
return new Item[]{item.item};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void display(Table table){
|
|
||||||
table.add(new ItemDisplay(item.item, item.amount));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -11,9 +11,13 @@ import static io.anuke.mindustry.Vars.content;
|
|||||||
|
|
||||||
public class LiquidFilterValue implements StatValue{
|
public class LiquidFilterValue implements StatValue{
|
||||||
private final Predicate<Liquid> filter;
|
private final Predicate<Liquid> filter;
|
||||||
|
private final float amount;
|
||||||
|
private final boolean perSecond;
|
||||||
|
|
||||||
public LiquidFilterValue(Predicate<Liquid> filter){
|
public LiquidFilterValue(Predicate<Liquid> filter, float amount, boolean perSecond){
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
|
this.amount = amount;
|
||||||
|
this.perSecond = perSecond;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -25,7 +29,7 @@ public class LiquidFilterValue implements StatValue{
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < list.size; i++){
|
for(int i = 0; i < list.size; i++){
|
||||||
table.add(new LiquidDisplay(list.get(i))).padRight(5);
|
table.add(new LiquidDisplay(list.get(i), amount, perSecond)).padRight(5);
|
||||||
|
|
||||||
if(i != list.size - 1){
|
if(i != list.size - 1){
|
||||||
table.add("/");
|
table.add("/");
|
||||||
|
|||||||
@@ -1,25 +1,23 @@
|
|||||||
package io.anuke.mindustry.world.meta.values;
|
package io.anuke.mindustry.world.meta.values;
|
||||||
|
|
||||||
import io.anuke.mindustry.game.UnlockableContent;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.mindustry.ui.LiquidDisplay;
|
import io.anuke.mindustry.ui.LiquidDisplay;
|
||||||
import io.anuke.mindustry.world.meta.ContentStatValue;
|
import io.anuke.mindustry.world.meta.StatValue;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
|
||||||
|
|
||||||
public class LiquidValue implements ContentStatValue{
|
public class LiquidValue implements StatValue{
|
||||||
private final Liquid liquid;
|
private final Liquid liquid;
|
||||||
|
private final float amount;
|
||||||
|
private final boolean perSecond;
|
||||||
|
|
||||||
public LiquidValue(Liquid liquid){
|
public LiquidValue(Liquid liquid, float amount, boolean perSecond){
|
||||||
this.liquid = liquid;
|
this.liquid = liquid;
|
||||||
}
|
this.amount = amount;
|
||||||
|
this.perSecond = perSecond;
|
||||||
@Override
|
|
||||||
public UnlockableContent[] getValueContent(){
|
|
||||||
return new UnlockableContent[]{liquid};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void display(Table table){
|
public void display(Table table){
|
||||||
table.add(new LiquidDisplay(liquid));
|
table.add(new LiquidDisplay(liquid, amount, perSecond));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,10 +20,9 @@ public class NumberValue implements StatValue{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void display(Table table){
|
public void display(Table table){
|
||||||
float diff = Math.abs((int) value - value);
|
int precision = Math.abs((int) value - value) <= 0.001f ? 0 : Math.abs((int) (value * 10) - value * 10) <= 0.001f ? 1 : 2;
|
||||||
int precision = diff <= 0.01f ? 0 : diff <= 0.1f ? 1 : 2;
|
|
||||||
|
|
||||||
table.add(Strings.toFixed(value, precision));
|
table.add(Strings.fixed(value, precision));
|
||||||
table.add(" " + unit.localized());
|
table.add((unit.space ? " " : "") + unit.localized());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import java.io.DataOutput;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class ConsumeModule extends BlockModule{
|
public class ConsumeModule extends BlockModule{
|
||||||
private boolean valid;
|
private boolean valid, optionalValid;
|
||||||
private final TileEntity entity;
|
private final TileEntity entity;
|
||||||
|
|
||||||
public ConsumeModule(TileEntity entity){
|
public ConsumeModule(TileEntity entity){
|
||||||
@@ -18,22 +18,31 @@ public class ConsumeModule extends BlockModule{
|
|||||||
public void update(){
|
public void update(){
|
||||||
boolean prevValid = valid();
|
boolean prevValid = valid();
|
||||||
valid = true;
|
valid = true;
|
||||||
|
optionalValid = true;
|
||||||
boolean docons = entity.tile.block().shouldConsume(entity.tile);
|
boolean docons = entity.tile.block().shouldConsume(entity.tile);
|
||||||
|
|
||||||
for(Consume cons : entity.tile.block().consumes.all()){
|
for(Consume cons : entity.tile.block().consumes.all()){
|
||||||
if(docons && cons.isUpdate() && prevValid && cons.valid(entity.getTile().block(), entity)){
|
if(docons && cons.isUpdate() && prevValid && cons.valid(entity)){
|
||||||
cons.update(entity.getTile().block(), entity);
|
cons.update(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!cons.isOptional()){
|
if(!cons.isOptional()){
|
||||||
valid &= cons.valid(entity.getTile().block(), entity);
|
valid &= cons.valid(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(Consume cons : entity.tile.block().consumes.optionals()){
|
||||||
|
if(docons && cons.isUpdate() && prevValid && cons.valid(entity)){
|
||||||
|
cons.update(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
optionalValid &= cons.valid(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void trigger(){
|
public void trigger(){
|
||||||
for(Consume cons : entity.tile.block().consumes.all()){
|
for(Consume cons : entity.tile.block().consumes.all()){
|
||||||
cons.trigger(entity.tile.block(), entity);
|
cons.trigger(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,6 +50,10 @@ public class ConsumeModule extends BlockModule{
|
|||||||
return valid && entity.tile.block().canProduce(entity.tile);
|
return valid && entity.tile.block().canProduce(entity.tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean optionalValid(){
|
||||||
|
return valid() && optionalValid;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(DataOutput stream) throws IOException{
|
public void write(DataOutput stream) throws IOException{
|
||||||
stream.writeBoolean(valid);
|
stream.writeBoolean(valid);
|
||||||
|
|||||||
@@ -176,9 +176,9 @@ public class PowerTests extends PowerTestFixture{
|
|||||||
powerGraph.update();
|
powerGraph.update();
|
||||||
|
|
||||||
assertEquals(0.0f, consumerTile.entity.power.satisfaction, Mathf.FLOAT_ROUNDING_ERROR);
|
assertEquals(0.0f, consumerTile.entity.power.satisfaction, Mathf.FLOAT_ROUNDING_ERROR);
|
||||||
if(consumerTile.block().consumes.has(ConsumePower.class)){
|
if(consumerTile.block().consumes.hasPower()){
|
||||||
ConsumePower consumePower = consumerTile.block().consumes.get(ConsumePower.class);
|
ConsumePower consumePower = consumerTile.block().consumes.getPower();
|
||||||
assertFalse(consumePower.valid(consumerTile.block(), consumerTile.entity()));
|
assertFalse(consumePower.valid(consumerTile.entity()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user