diff --git a/.gitignore b/.gitignore index 62ef5bbfad..b33484f175 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -##Packr, build stuff - logs/ /core/assets/mindustry-saves/ /core/assets/mindustry-maps/ diff --git a/core/assets-raw/sprites/blocks/power/powerinfinite.png b/core/assets-raw/sprites/blocks/power/power-source.png similarity index 100% rename from core/assets-raw/sprites/blocks/power/powerinfinite.png rename to core/assets-raw/sprites/blocks/power/power-source.png diff --git a/core/assets-raw/sprites/blocks/power/powervoid.png b/core/assets-raw/sprites/blocks/power/power-void.png similarity index 100% rename from core/assets-raw/sprites/blocks/power/powervoid.png rename to core/assets-raw/sprites/blocks/power/power-void.png diff --git a/core/assets-raw/sprites/blocks/production/itemsource.png b/core/assets-raw/sprites/blocks/production/item-source.png similarity index 100% rename from core/assets-raw/sprites/blocks/production/itemsource.png rename to core/assets-raw/sprites/blocks/production/item-source.png diff --git a/core/assets-raw/sprites/blocks/production/itemvoid.png b/core/assets-raw/sprites/blocks/production/item-void.png similarity index 100% rename from core/assets-raw/sprites/blocks/production/itemvoid.png rename to core/assets-raw/sprites/blocks/production/item-void.png diff --git a/core/assets-raw/sprites/blocks/production/liquidsource.png b/core/assets-raw/sprites/blocks/production/liquid-source.png similarity index 100% rename from core/assets-raw/sprites/blocks/production/liquidsource.png rename to core/assets-raw/sprites/blocks/production/liquid-source.png diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 1226ab8965..d012ff4be7 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -580,11 +580,11 @@ block.omega-mech-pad.name = Omega Mech Pad block.tau-mech-pad.name = Tau Mech Pad block.conduit.name = Conduit block.mechanical-pump.name = Mechanical Pump -block.itemsource.name = Item Source -block.itemvoid.name = Item Void -block.liquidsource.name = Liquid Source -block.powervoid.name = Power Void -block.powerinfinite.name = Power Infinite +block.item-source.name = Item Source +block.item-void.name = Item Void +block.liquid-source.name = Liquid Source +block.power-void.name = Power Void +block.power-source.name = Power Infinite block.unloader.name = Unloader block.vault.name = Vault block.wave.name = Wave @@ -782,11 +782,11 @@ block.router.description = Accepts items from one direction and outputs them to block.distributor.description = An advanced router which splits items to up to 7 other directions equally. block.bridge-conveyor.description = Advanced item transport block. Allows transporting items over up to 3 tiles of any terrain or building. block.alpha-mech-pad.description = When given enough power, rebuilds your ship into the[accent] Alpha[] mech. -block.itemsource.description = Infinitely outputs items. Sandbox only. -block.liquidsource.description = Infinitely outputs liquids. Sandbox only. -block.itemvoid.description = Destroys any items which go into it without using power. Sandbox only. -block.powerinfinite.description = Infinitely outputs power. Sandbox only. -block.powervoid.description = Voids all power inputted into it. Sandbox only. +block.item-source.description = Infinitely outputs items. Sandbox only. +block.liquid-source.description = Infinitely outputs liquids. Sandbox only. +block.item-void.description = Destroys any items which go into it without using power. Sandbox only. +block.power-source.description = Infinitely outputs power. Sandbox only. +block.power-void.description = Voids all power inputted into it. Sandbox only. liquid.water.description = Commonly used for cooling machines and waste processing. liquid.lava.description = Can be transformed into[LIGHT_GRAY] stone[], used for generating power or used as ammo for certain turrets. liquid.oil.description = Can be burnt, exploded or used as a coolant. diff --git a/core/assets/bundles/bundle_cs.properties b/core/assets/bundles/bundle_cs.properties index bc230d8ef4..db3fa556b1 100644 --- a/core/assets/bundles/bundle_cs.properties +++ b/core/assets/bundles/bundle_cs.properties @@ -578,11 +578,11 @@ block.omega-mech-pad.name = Plošina pro Omega Mech block.tau-mech-pad.name = Plošina pro Tau Mech block.conduit.name = Potrubí block.mechanical-pump.name = Mechanická pumpa -block.itemsource.name = Zdroj předmětů -block.itemvoid.name = Prázdnota pro předměty -block.liquidsource.name = Zdroj tekutin -block.powervoid.name = Prázdnota pro energii -block.powerinfinite.name = Nekonečný zdroj energie +block.item-source.name = Zdroj předmětů +block.item-void.name = Prázdnota pro předměty +block.liquid-source.name = Zdroj tekutin +block.power-void.name = Prázdnota pro energii +block.power-source.name = Nekonečný zdroj energie block.unloader.name = Odbavovač block.vault.name = Trezor block.wave.name = Vlna @@ -780,11 +780,11 @@ block.router.description = Příijmá předměty z jednoho směru a posílá je block.distributor.description = Pokročilý směrovač, který z libovolného počtu vstupů vytvoří libovolný počet výstupu a rozdělí přísun předmětů rovnoměrně do každého z nich, obdoba Multiplexeru a Demultiplexeru. block.bridge-conveyor.description = Pokročilý blok přepravy předmětů. Dovoluje transport předmětů až přez tři pole jakéhokoliv terénu nebo budovy. block.alpha-mech-pad.description = Když je dodán dostatek energie, Přestaví tvoji loď na[accent] Alfa[] mecha. -block.itemsource.description = Nekonečný zdroj předmětů. Jen pro Sandbox. -block.liquidsource.description = Nekonečný zdroj tekutin. Jen pro Sandbox. -block.itemvoid.description = Likviduje jakéhokoliv vstupní předmět bež použití energie. Jen pro Sandbox. -block.powerinfinite.description = Nekonečný zdroj energie. Jen pro Sandbox. -block.powervoid.description = Prázdnota pro veškerou energii vstupující do něj. Jen pro Sandbox. +block.item-source.description = Nekonečný zdroj předmětů. Jen pro Sandbox. +block.liquid-source.description = Nekonečný zdroj tekutin. Jen pro Sandbox. +block.item-void.description = Likviduje jakéhokoliv vstupní předmět bež použití energie. Jen pro Sandbox. +block.power-source.description = Nekonečný zdroj energie. Jen pro Sandbox. +block.power-void.description = Prázdnota pro veškerou energii vstupující do něj. Jen pro Sandbox. liquid.water.description = Nejčastěji se používá ke chlazení a zpracování odpadu. liquid.lava.description = Může být transformován na[LIGHT_GRAY] kámen[], nebo pro generátor energie nebo jako střelivo pro určitý druh střílen. liquid.oil.description = Může být spálen, vybouchnout nebo použit jako chlazení. diff --git a/core/assets/bundles/bundle_de.properties b/core/assets/bundles/bundle_de.properties index d7840e685c..60211fa662 100644 --- a/core/assets/bundles/bundle_de.properties +++ b/core/assets/bundles/bundle_de.properties @@ -567,11 +567,11 @@ block.omega-mech-pad.name = Omega Mech Pad block.tau-mech-pad.name = Tau Mech Pad block.conduit.name = Leitungsrohr block.mechanical-pump.name = Mechanische Pumpe -block.itemsource.name = Materialquelle -block.itemvoid.name = Materialschlucker -block.liquidsource.name = Flüssigkeitsquelle -block.powervoid.name = Stromsenke -block.powerinfinite.name = Unendliche Stromquelle +block.item-source.name = Materialquelle +block.item-void.name = Materialschlucker +block.liquid-source.name = Flüssigkeitsquelle +block.power-void.name = Stromsenke +block.power-source.name = Unendliche Stromquelle block.unloader.name = Entlader block.vault.name = Tresor block.wave.name = Welle @@ -769,11 +769,11 @@ block.router.description = Akzeptiert Materialien aus einer Richtung und leitet block.distributor.description = Ein weiterentwickelter Router, der Materialien in bis zu sieben Richtungen gleichmäßig verteilt. block.bridge-conveyor.description = Verbesserter Transportblock. Erlaubt es, Materialien über bis zu 3 Kacheln beliebigen Terrains oder Inhalts zu transportieren. block.alpha-mech-pad.description = Sofern genügend Strom zur Verfügung steht, baut dieses Pad deinen Schiff in einen [accent]Alpha[] mech zurück. -block.itemsource.description = Produziert unendlich items. Nur im Sandkasten verfügbar. -block.liquidsource.description = Produziert unendlich Flüssigkeiten. Nur im Sandkasten verfügbar. -block.itemvoid.description = Zerstört Materialien, die hereingegeben werden, ohne Strom zu verbrauchen. Nur im Sandkasten verfügbar. -block.powerinfinite.description = Erzeugt unendlich viel Strom. Nur im Sandkasten verfügbar. -block.powervoid.description = Verschlingt den kompletten übrigen Strom. Nur im Sandkasten verfügbar. +block.item-source.description = Produziert unendlich items. Nur im Sandkasten verfügbar. +block.liquid-source.description = Produziert unendlich Flüssigkeiten. Nur im Sandkasten verfügbar. +block.item-void.description = Zerstört Materialien, die hereingegeben werden, ohne Strom zu verbrauchen. Nur im Sandkasten verfügbar. +block.power-source.description = Erzeugt unendlich viel Strom. Nur im Sandkasten verfügbar. +block.power-void.description = Verschlingt den kompletten übrigen Strom. Nur im Sandkasten verfügbar. liquid.water.description = Wird überlicherweise zum Kühlen von Maschinen und zur Müllverarbeitung verwendet. liquid.lava.description = Kann zu [LIGHT_GRAY] Stein[] verarbeitet werden, zur Stromerzeugung verwendet werden oder als Munition für bestimmte Geschütztürme verwendet werden. liquid.oil.description = Kann verbrannt, zum explodieren gebracht, oder als Kühlung verwendet werden. diff --git a/core/assets/bundles/bundle_es.properties b/core/assets/bundles/bundle_es.properties index cd975d0fb1..e03d2ef7a8 100644 --- a/core/assets/bundles/bundle_es.properties +++ b/core/assets/bundles/bundle_es.properties @@ -567,11 +567,11 @@ block.omega-mech-pad.name = Pad de mecanoide Omega block.tau-mech-pad.name = Pad de mecanoide Tau block.conduit.name = Conducto block.mechanical-pump.name = Bomba Mecánica -block.itemsource.name = Fuente de objetos -block.itemvoid.name = Vacío de objetos -block.liquidsource.name = Fuente de líquidos -block.powervoid.name = Vacío de energía -block.powerinfinite.name = Energía Infinita +block.item-source.name = Fuente de objetos +block.item-void.name = Vacío de objetos +block.liquid-source.name = Fuente de líquidos +block.power-void.name = Vacío de energía +block.power-source.name = Energía Infinita block.unloader.name = Descargador block.vault.name = Bóveda block.wave.name = Horda @@ -769,11 +769,11 @@ block.router.description = Acepta objetos de una dirección y deja objetos equit block.distributor.description = Un enrutador avanzado que distribuye objetos equitativamente en hasta otras 7 direcciones. block.bridge-conveyor.description = Bloque avanado de transporte. Puede transportar objetos por encima hasta 3 casillas de cualquier terreno o construcción. block.alpha-mech-pad.description = Cuando se le da suficiente energía, reconstruye tu nave en el mecanoide[accent] Alpha[]. -block.itemsource.description = Da objetos infinitos. Solo en sandbox. -block.liquidsource.description = Da líquido infinito. Solo en sandbox. -block.itemvoid.description = Destruye cuanquier objeto que va a él sin necesitar energía. Solo en sandbox. -block.powerinfinite.description = Da energía infinita. Solo en sandbox. -block.powervoid.description = Elimina toda la energía que se le da. Solo en sandbox. +block.item-source.description = Da objetos infinitos. Solo en sandbox. +block.liquid-source.description = Da líquido infinito. Solo en sandbox. +block.item-void.description = Destruye cuanquier objeto que va a él sin necesitar energía. Solo en sandbox. +block.power-source.description = Da energía infinita. Solo en sandbox. +block.power-void.description = Elimina toda la energía que se le da. Solo en sandbox. liquid.water.description = Usado comúnmente para enfriar máquinas y para procesar residuos. liquid.lava.description = Puede usarse para ser transformado en[LIGHT_GRAY] stone[], para generar energía o para munición de ciertas torres. liquid.oil.description = Puede ser quemado, explotado o como un enfriador. diff --git a/core/assets/bundles/bundle_fr.properties b/core/assets/bundles/bundle_fr.properties index 42f1fd7640..c00f0245c7 100644 --- a/core/assets/bundles/bundle_fr.properties +++ b/core/assets/bundles/bundle_fr.properties @@ -567,11 +567,11 @@ block.omega-mech-pad.name = Reconstructeur de mécha "Oméga" block.tau-mech-pad.name = Reconstructeur de mécha "Tau" block.conduit.name = Conduit block.mechanical-pump.name = Pompe mécanique -block.itemsource.name = Source d'objets -block.itemvoid.name = Destructeur d'objets -block.liquidsource.name = Source de liquide -block.powervoid.name = absorbeur énergétique -block.powerinfinite.name = Puissance infinie +block.item-source.name = Source d'objets +block.item-void.name = Destructeur d'objets +block.liquid-source.name = Source de liquide +block.power-void.name = absorbeur énergétique +block.power-source.name = Puissance infinie block.unloader.name = Déchargeur block.vault.name = Coffre-Fort block.wave.name = Vague @@ -769,11 +769,11 @@ block.router.description = Accepte les objets depuis une ou plus directions et l block.distributor.description = Un routeur avancé qui sépare les objets jusqu'à 7 autres directions équitablement. block.bridge-conveyor.description = bloc de transport avancé permettant de traverser jusqu'à 3 blocs de n'importe quel terrain ou batiment. block.alpha-mech-pad.description = Avec assez d'énergie, reconstruit votre vaisseau en un mécha [accent] Alpha[]. -block.itemsource.description = Produit des objets à l'infini. Bac à sable uniquement . -block.liquidsource.description = Source de liquide infinie . Bac à sable uniquement. -block.itemvoid.description = Désintègre n'importe quel objet qui va à l'intérieur sans utiliser d'énergie. Bac à sable uniquement. -block.powerinfinite.description = Produit de l'énergie à l'infini. Bac à sable uniquement. -block.powervoid.description = Supprime toute l'énergie allant à l'intérieur.Bac à sable uniquement +block.item-source.description = Produit des objets à l'infini. Bac à sable uniquement . +block.liquid-source.description = Source de liquide infinie . Bac à sable uniquement. +block.item-void.description = Désintègre n'importe quel objet qui va à l'intérieur sans utiliser d'énergie. Bac à sable uniquement. +block.power-source.description = Produit de l'énergie à l'infini. Bac à sable uniquement. +block.power-void.description = Supprime toute l'énergie allant à l'intérieur.Bac à sable uniquement liquid.water.description = Couramment utilisé pour le refroidissement et le traitement des déchets. liquid.lava.description = Peut être transformé en [LIGHT_GRAY]pierre[], utilisé pour produire de l'énergie ou utilisé comme munition par certaines tourelles. liquid.oil.description = Peut être brûlé, utilisé comme explosif ou comme liquide de refroidissement. diff --git a/core/assets/bundles/bundle_fr_BE.properties b/core/assets/bundles/bundle_fr_BE.properties index a4af1a5971..aea8596d1a 100644 --- a/core/assets/bundles/bundle_fr_BE.properties +++ b/core/assets/bundles/bundle_fr_BE.properties @@ -575,11 +575,11 @@ block.omega-mech-pad.name = Omega Mech Pad block.tau-mech-pad.name = Tau Mech Pad block.conduit.name = Conduit block.mechanical-pump.name = Pompe Méchanique -block.itemsource.name = Source d'objets -block.itemvoid.name = Destructeur d'objets -block.liquidsource.name = Source de liquide -block.powervoid.name = Absorbeur énergétique -block.powerinfinite.name = Puissance infinie +block.item-source.name = Source d'objets +block.item-void.name = Destructeur d'objets +block.liquid-source.name = Source de liquide +block.power-void.name = Absorbeur énergétique +block.power-source.name = Puissance infinie block.unloader.name = Déchargeur block.vault.name = Coffre-Fort block.wave.name = Vague @@ -777,11 +777,11 @@ block.router.description = Accepte les éléments d'une direction et les envoie block.distributor.description = Un routeur avancé qui divise les articles en 7 autres directions de manière égale. [scarlet]Seule et unique ![] block.bridge-conveyor.description = Bloc de transport d'articles avancé. Permet de transporter des objets sur plus de 3 tuiles de n'importe quel terrain ou bâtiment. block.alpha-mech-pad.description = Lorsque vous avez assez de puissance, reconstruisez votre vaisseau dans le [accent]Alpha[] mech. -block.itemsource.description = Sort infiniment les articles. Bac à sable seulement. -block.liquidsource.description = Débit infini de liquides. Bac à sable seulement. -block.itemvoid.description = Détruit tous les objets qui y entrent sans utiliser d'énergie. Bac à sable seulement. -block.powerinfinite.description = Débit infini d'énergie. Bac à sable seulement. -block.powervoid.description = Annule toute l'énergie qui y est introduite. Bac à sable seulement. +block.item-source.description = Sort infiniment les articles. Bac à sable seulement. +block.liquid-source.description = Débit infini de liquides. Bac à sable seulement. +block.item-void.description = Détruit tous les objets qui y entrent sans utiliser d'énergie. Bac à sable seulement. +block.power-source.description = Débit infini d'énergie. Bac à sable seulement. +block.power-void.description = Annule toute l'énergie qui y est introduite. Bac à sable seulement. liquid.water.description = Couramment utilisé pour les machines de refroidissement et le traitement des déchets. liquid.lava.description = Peut être transformé en [LIGHT_GRAY]pierre[], utilisé pour générer de l'énergie ou utilisé comme munition pour certaines tourelles. liquid.oil.description = Peut être brûlé, explosé ou utilisé comme liquide de refroidissement. diff --git a/core/assets/bundles/bundle_in_ID.properties b/core/assets/bundles/bundle_in_ID.properties index a3d1721f67..425feb8d32 100644 --- a/core/assets/bundles/bundle_in_ID.properties +++ b/core/assets/bundles/bundle_in_ID.properties @@ -567,11 +567,11 @@ block.omega-mech-pad.name = Omega Mech Pad block.tau-mech-pad.name = Tau Mech Pad block.conduit.name = saluran block.mechanical-pump.name = Mechanical Pump -block.itemsource.name = Item Source -block.itemvoid.name = Item Void -block.liquidsource.name = Liquid Source -block.powervoid.name = Power Void -block.powerinfinite.name = Power Infinite +block.item-source.name = Item Source +block.item-void.name = Item Void +block.liquid-source.name = Liquid Source +block.power-void.name = Power Void +block.power-source.name = Power Infinite block.unloader.name = Unloader block.vault.name = Vault block.wave.name = Wave @@ -769,11 +769,11 @@ block.router.description = Accepts items from one direction and outputs them to block.distributor.description = An advanced router which splits items to up to 7 other directions equally. block.bridge-conveyor.description = Advanced item transport block. Allows transporting items over up to 3 tiles of any terrain or building. block.alpha-mech-pad.description = When given enough power, rebuilds your ship into the[accent] Alpha[] mech. -block.itemsource.description = Infinitely outputs items. Sandbox only. -block.liquidsource.description = Infinitely outputs liquids. Sandbox only. -block.itemvoid.description = Destroys any items which go into it without using power. Sandbox only. -block.powerinfinite.description = Infinitely outputs power. Sandbox only. -block.powervoid.description = Voids all power inputted into it. Sandbox only. +block.item-source.description = Infinitely outputs items. Sandbox only. +block.liquid-source.description = Infinitely outputs liquids. Sandbox only. +block.item-void.description = Destroys any items which go into it without using power. Sandbox only. +block.power-source.description = Infinitely outputs power. Sandbox only. +block.power-void.description = Voids all power inputted into it. Sandbox only. liquid.water.description = Commonly used for cooling machines and waste processing. liquid.lava.description = Can be transformed into[LIGHT_GRAY] stone[], used for generating power or used as ammo for certain turrets. liquid.oil.description = Can be burnt, exploded or used as a coolant. diff --git a/core/assets/bundles/bundle_it.properties b/core/assets/bundles/bundle_it.properties index 514ff0569f..5e5b9be96f 100644 --- a/core/assets/bundles/bundle_it.properties +++ b/core/assets/bundles/bundle_it.properties @@ -567,11 +567,11 @@ block.omega-mech-pad.name = Omega Mech Pad block.tau-mech-pad.name = Tau Mech Pad block.conduit.name = Condotto block.mechanical-pump.name = Pompa meccanica -block.itemsource.name = Sorgente oggetti -block.itemvoid.name = Vuoto oggetti -block.liquidsource.name = Sorgente liquida -block.powervoid.name = Energia nulla -block.powerinfinite.name = Energia infinita +block.item-source.name = Sorgente oggetti +block.item-void.name = Vuoto oggetti +block.liquid-source.name = Sorgente liquida +block.power-void.name = Energia nulla +block.power-source.name = Energia infinita block.unloader.name = Scaricatore block.vault.name = Deposito block.wave.name = Idrogetto @@ -769,11 +769,11 @@ block.router.description = Accepts items from one direction and outputs them to block.distributor.description = An advanced router which splits items to up to 7 other directions equally. block.bridge-conveyor.description = Advanced item transport block. Allows transporting items over up to 3 tiles of any terrain or building. block.alpha-mech-pad.description = When given enough power, rebuilds your ship into the[accent] Alpha[] mech. -block.itemsource.description = Infinitely outputs items. Sandbox only. -block.liquidsource.description = Infinitely outputs liquids. Sandbox only. -block.itemvoid.description = Destroys any items which go into it without using power. Sandbox only. -block.powerinfinite.description = Infinitely outputs power. Sandbox only. -block.powervoid.description = Voids all power inputted into it. Sandbox only. +block.item-source.description = Infinitely outputs items. Sandbox only. +block.liquid-source.description = Infinitely outputs liquids. Sandbox only. +block.item-void.description = Destroys any items which go into it without using power. Sandbox only. +block.power-source.description = Infinitely outputs power. Sandbox only. +block.power-void.description = Voids all power inputted into it. Sandbox only. liquid.water.description = Commonly used for cooling machines and waste processing. liquid.lava.description = Can be transformed into[LIGHT_GRAY] stone[], used for generating power or used as ammo for certain turrets. liquid.oil.description = Can be burnt, exploded or used as a coolant. diff --git a/core/assets/bundles/bundle_ja.properties b/core/assets/bundles/bundle_ja.properties index ad32034bc4..a1c9a94c7a 100644 --- a/core/assets/bundles/bundle_ja.properties +++ b/core/assets/bundles/bundle_ja.properties @@ -576,11 +576,11 @@ block.omega-mech-pad.name = オメガパッド block.tau-mech-pad.name = タウパッド block.conduit.name = パイプ block.mechanical-pump.name = 機械ポンプ -block.itemsource.name = アイテムソース -block.itemvoid.name = アイテムボイド -block.liquidsource.name = 液体ソース -block.powervoid.name = 電力ボイド -block.powerinfinite.name = 無限電源 +block.item-source.name = アイテムソース +block.item-void.name = アイテムボイド +block.liquid-source.name = 液体ソース +block.power-void.name = 電力ボイド +block.power-source.name = 無限電源 block.unloader.name = アンローダー block.vault.name = ボールト block.wave.name = ウェーブ @@ -778,11 +778,11 @@ block.router.description = 一つの方向から受け取ったアイテムを block.distributor.description = 高度なルーターです。アイテムを7方向に均等に分けて搬出します。 block.bridge-conveyor.description = 高度な輸送ブロックです。地形や建物を超えて、3ブロック離れた場所にアイテムを輸送することができます。 block.alpha-mech-pad.description = 電力を使用して、機体を[accent]アルファ[]機体に作り替えます。 -block.itemsource.description = アイテムを無限に搬出します。サンドボックスのみ。 -block.liquidsource.description = 液体を無限に搬出します。サンドボックスのみ。 -block.itemvoid.description = 電力なしでアイテムを廃棄します。サンドボックスのみ。 -block.powerinfinite.description = 無限に電力を搬出します。サンドボックスのみ。 -block.powervoid.description = 入力されたすべての電力を破棄します。サンドボックスのみ。 +block.item-source.description = アイテムを無限に搬出します。サンドボックスのみ。 +block.liquid-source.description = 液体を無限に搬出します。サンドボックスのみ。 +block.item-void.description = 電力なしでアイテムを廃棄します。サンドボックスのみ。 +block.power-source.description = 無限に電力を搬出します。サンドボックスのみ。 +block.power-void.description = 入力されたすべての電力を破棄します。サンドボックスのみ。 liquid.water.description = 一般的に機械の冷却や廃棄物の処理などに使用されます。 liquid.lava.description = 冷却して石にしたり、発電や一部ターレットの弾薬として使用することができます。 liquid.oil.description = 燃焼させたり、爆発させたり、冷却水としても使われます。 diff --git a/core/assets/bundles/bundle_ko.properties b/core/assets/bundles/bundle_ko.properties index 00d11c78d8..a7b519112a 100644 --- a/core/assets/bundles/bundle_ko.properties +++ b/core/assets/bundles/bundle_ko.properties @@ -570,11 +570,11 @@ block.omega-mech-pad.name = 오메가 기체 패드 block.tau-mech-pad.name = 타우 기체 패드 block.conduit.name = 파이프 block.mechanical-pump.name = 기계식 펌프 -block.itemsource.name = 아이템 소스 -block.itemvoid.name = 아이템 삭제 장치 -block.liquidsource.name = 무한 액체공급 장치 -block.powervoid.name = 방전장치 -block.powerinfinite.name = 무한 전력공급 장치 +block.item-source.name = 아이템 소스 +block.item-void.name = 아이템 삭제 장치 +block.liquid-source.name = 무한 액체공급 장치 +block.power-void.name = 방전장치 +block.power-source.name = 무한 전력공급 장치 block.unloader.name = 언로더 block.vault.name = 창고 block.wave.name = 파도 @@ -772,11 +772,11 @@ block.router.description = 한 방향에서 아이템을 받은 후 최대 3개 block.distributor.description = 아이템을 최대 7개의 다른 방향으로 똑같이 분할하는 고급 분배기. block.bridge-conveyor.description = 고급 자원 수송 블록.\n지형이나 건물을 넘어 최대 3개 타일을 건너뛰고 자원을 운송할 수 있습니다. block.alpha-mech-pad.description = 알파 기체로 바꿀 수 있는 패드입니다. -block.itemsource.description = 자원을 선택하면 그 자원이 무한하게 생성되는 블록입니다. -block.liquidsource.description = 무한한 액체를 출력해냅니다. -block.itemvoid.description = 아이템을 사라지게 만듭니다. -block.powerinfinite.description = 무한한 전력을 공급해주는 블록입니다. -block.powervoid.description = 설정된 아이템을 계속해서 출력하는 블록입니다. +block.item-source.description = 자원을 선택하면 그 자원이 무한하게 생성되는 블록입니다. +block.liquid-source.description = 무한한 액체를 출력해냅니다. +block.item-void.description = 아이템을 사라지게 만듭니다. +block.power-source.description = 무한한 전력을 공급해주는 블록입니다. +block.power-void.description = 설정된 아이템을 계속해서 출력하는 블록입니다. liquid.water.description = 지상 유닛이 이 위를 지나가면 이동속도가 느려지고, 깊은 물에 빠지면 죽습니다. liquid.lava.description = 지상 유닛이 이 위를 지나가면 이동속도가 매우 느려지고, 지속적으로 데미지를 입습니다. liquid.oil.description = 일부 조합 블록에서 사용되는 자원입니다. diff --git a/core/assets/bundles/bundle_pl.properties b/core/assets/bundles/bundle_pl.properties index 5c602156e2..16defe23ae 100644 --- a/core/assets/bundles/bundle_pl.properties +++ b/core/assets/bundles/bundle_pl.properties @@ -567,11 +567,11 @@ block.omega-mech-pad.name = Omega Mech Pad block.tau-mech-pad.name = Tau Mech Pad block.conduit.name = Rura block.mechanical-pump.name = Mechaniczna Pompa -block.itemsource.name = Źródło przedmiotów -block.itemvoid.name = Próżnia przedmiotów -block.liquidsource.name = Źródło płynów -block.powervoid.name = Próżnia prądu -block.powerinfinite.name = Nieskończony Prąd +block.item-source.name = Źródło przedmiotów +block.item-void.name = Próżnia przedmiotów +block.liquid-source.name = Źródło płynów +block.power-void.name = Próżnia prądu +block.power-source.name = Nieskończony Prąd block.unloader.name = Wyciągacz block.vault.name = Magazyn block.wave.name = Działo Płynowe @@ -769,11 +769,11 @@ block.router.description = Akceptuje przedmioty z jednego miejsca i rozdziela je block.distributor.description = Zaawansowany rozdzielacz, rozdzielający przedmioty do 7 innych kierunków. block.bridge-conveyor.description = Zaawansowany blok transportujący. Pozwala na przenoszenie przedmiotów nawet do 3 bloków na każdym terenie, przez każdy budynek. block.alpha-mech-pad.description = When given enough power, rebuilds your ship into the[accent] Alpha[] mech. -block.itemsource.description = Wydziela przedmioty w nieskończoność. Dostępny tylko w trybie sandbox. -block.liquidsource.description = Wydziela ciecz w nieskończoność. Dostępny tylko w trybie sandbox. -block.itemvoid.description = Niszczy wszystkie przedmioty, które idą do tego bloku, który nie wymaga prądu. Dostępny tylko w trybie sandbox. -block.powerinfinite.description = Wydziela prąd w nieskończoność. Dostępny tylko w trybie sandbox. -block.powervoid.description = Niszczy całą energię wprowadzoną do tego bloku. Dostępny tylko w trybie sandbox. +block.item-source.description = Wydziela przedmioty w nieskończoność. Dostępny tylko w trybie sandbox. +block.liquid-source.description = Wydziela ciecz w nieskończoność. Dostępny tylko w trybie sandbox. +block.item-void.description = Niszczy wszystkie przedmioty, które idą do tego bloku, który nie wymaga prądu. Dostępny tylko w trybie sandbox. +block.power-source.description = Wydziela prąd w nieskończoność. Dostępny tylko w trybie sandbox. +block.power-void.description = Niszczy całą energię wprowadzoną do tego bloku. Dostępny tylko w trybie sandbox. liquid.water.description = Powszechnie używana do schładzania budowli i przetwarzania odpadów. liquid.lava.description = Może być przekształcona w [LIGHT_GRAY] kamień[]; używana do generowania prądu lub używana jako amunicja dla niektórych działek. liquid.oil.description = Może się palić, eksplodować lub być używana do schładzania. diff --git a/core/assets/bundles/bundle_pt_BR.properties b/core/assets/bundles/bundle_pt_BR.properties index cb44f65e08..51d539d334 100644 --- a/core/assets/bundles/bundle_pt_BR.properties +++ b/core/assets/bundles/bundle_pt_BR.properties @@ -567,11 +567,11 @@ block.omega-mech-pad.name = Controle do meca Omega block.tau-mech-pad.name = Controle do meca Tau block.conduit.name = Cano block.mechanical-pump.name = Bomba Mecanica -block.itemsource.name = Fonte do item -block.itemvoid.name = Item Void -block.liquidsource.name = Liquid Source -block.powervoid.name = Power Void -block.powerinfinite.name = Power Infinite +block.item-source.name = Fonte do item +block.item-void.name = Item Void +block.liquid-source.name = Liquid Source +block.power-void.name = Power Void +block.power-source.name = Power Infinite block.unloader.name = Unloader block.vault.name = Cofre block.wave.name = Wave @@ -769,11 +769,11 @@ block.router.description = Aceita itens de uma direção e os divide em 3 direç block.distributor.description = Um roteador avancada que espalhas os itens em 7 outras direções igualmente. block.bridge-conveyor.description = Bloco de transporte de itens avancado. Possibilita o transporte de itens acima de 3 blocos de construção ou paredes. block.alpha-mech-pad.description = Quando dado energia o suficiente, Reconstrua sua nave em [accent] Alpha[] mech. -block.itemsource.description = Infinivamente da itens. Apenas caixa de areia. -block.liquidsource.description = Infinitivamente da Liquidos. Apenas caixa de areia. -block.itemvoid.description = Destroi qualquer item que entre sem requerir energia. Apenas caixa de areia. -block.powerinfinite.description = Infinitivamente da energia. Apenas caixa de areia. -block.powervoid.description = Destroi qualquer energia que entre dentro. Apenas caixa de areia. +block.item-source.description = Infinivamente da itens. Apenas caixa de areia. +block.liquid-source.description = Infinitivamente da Liquidos. Apenas caixa de areia. +block.item-void.description = Destroi qualquer item que entre sem requerir energia. Apenas caixa de areia. +block.power-source.description = Infinitivamente da energia. Apenas caixa de areia. +block.power-void.description = Destroi qualquer energia que entre dentro. Apenas caixa de areia. liquid.water.description = Comumente usado em resfriamento e no processo de perda. liquid.lava.description = Pode ser transformado em[LIGHT_GRAY] pedra[], usado para gerar energia ou usado como munição para certas torres. liquid.oil.description = Pode ser queimado, explodido ou usado como resfriador. diff --git a/core/assets/bundles/bundle_ru.properties b/core/assets/bundles/bundle_ru.properties index 000b995f43..ec792c0440 100644 --- a/core/assets/bundles/bundle_ru.properties +++ b/core/assets/bundles/bundle_ru.properties @@ -569,11 +569,11 @@ block.omega-mech-pad.name = Реконструктор мехов "Омега" block.tau-mech-pad.name = Реконструктор мехов "Тау" block.conduit.name = Трубопровод block.mechanical-pump.name = Механическая помпа -block.itemsource.name = Источник предметов -block.itemvoid.name = Предметный вакуум -block.liquidsource.name = Источник жидкостей -block.powervoid.name = Энергетический вакуум -block.powerinfinite.name = Источник энергии +block.item-source.name = Источник предметов +block.item-void.name = Предметный вакуум +block.liquid-source.name = Источник жидкостей +block.power-void.name = Энергетический вакуум +block.power-source.name = Источник энергии block.unloader.name = Разгрузчик block.vault.name = Хранилище block.wave.name = Волна @@ -771,11 +771,11 @@ block.router.description = Принимает предметы из одного block.distributor.description = Передовой маршрутизатор, который равномерно разбивает элементы до 7 других направлений. block.bridge-conveyor.description = Улучшенный транспортный блок элементов. Позволяет транспортировать предметы до 3-х блоков над любым ландшафтом или зданием. block.alpha-mech-pad.description = Превращает вас в мех [accent] Альфа[]. Требует энергию. -block.itemsource.description = Бесконечно выводит предметы. Работает только в песочнице. -block.liquidsource.description = Бесконечно выводит жидкости. Работает только в песочнице. -block.itemvoid.description = Уничтожает любые предметы, которые входят в него, без использования энергии. Работает только в режиме песочницы. -block.powerinfinite.description = Бесконечность — не предел. Бесконечно выводит энергию. Доступен только в режиме песочницы. -block.powervoid.description = Энергия просто уходит в пустоту. Присутствует только в песочнице. +block.item-source.description = Бесконечно выводит предметы. Работает только в песочнице. +block.liquid-source.description = Бесконечно выводит жидкости. Работает только в песочнице. +block.item-void.description = Уничтожает любые предметы, которые входят в него, без использования энергии. Работает только в режиме песочницы. +block.power-source.description = Бесконечность — не предел. Бесконечно выводит энергию. Доступен только в режиме песочницы. +block.power-void.description = Энергия просто уходит в пустоту. Присутствует только в песочнице. liquid.water.description = Намного лучше чем [BLUE]монооксид дигидрогена[].\n\n Для получения воды используйте помпу(насос) на источнике(блоке) или экстрактор воды.\n\n Эту жидкость можно подвести к бурам для ускорения скорости добычи или к турелям для ускорения стрельбы. liquid.lava.description = [accent]Горячо...\nВещество расплавленное из горно-каменных пород. liquid.oil.description = Кто-то писал о добавлении золота в игру. Его добавили, правда оно какое-то чёрное...\nСмесь жидких углеводородов, выделяющаяся из природного газа в результате снижения температуры и пластового давления. diff --git a/core/assets/bundles/bundle_tk.properties b/core/assets/bundles/bundle_tk.properties index e0476393f0..65701c2094 100644 --- a/core/assets/bundles/bundle_tk.properties +++ b/core/assets/bundles/bundle_tk.properties @@ -567,11 +567,11 @@ block.omega-mech-pad.name = Omega Mech Pad block.tau-mech-pad.name = Tau Mech Pad block.conduit.name = boru block.mechanical-pump.name = Mekanikal pompa -block.itemsource.name = esya kaynagi -block.itemvoid.name = esya deligi -block.liquidsource.name = sivi kaynagi -block.powervoid.name = guc deligi -block.powerinfinite.name = sonsuz guc +block.item-source.name = esya kaynagi +block.item-void.name = esya deligi +block.liquid-source.name = sivi kaynagi +block.power-void.name = guc deligi +block.power-source.name = sonsuz guc block.unloader.name = bekletici block.vault.name = kasa block.wave.name = Dalga @@ -769,11 +769,11 @@ block.router.description = Accepts items from one direction and outputs them to block.distributor.description = An advanced router which splits items to up to 7 other directions equally. block.bridge-conveyor.description = Advanced item transport block. Allows transporting items over up to 3 tiles of any terrain or building. block.alpha-mech-pad.description = When given enough power, rebuilds your ship into the[accent] Alpha[] mech. -block.itemsource.description = Infinitely outputs items. Sandbox only. -block.liquidsource.description = Infinitely outputs liquids. Sandbox only. -block.itemvoid.description = Destroys any items which go into it without using power. Sandbox only. -block.powerinfinite.description = Infinitely outputs power. Sandbox only. -block.powervoid.description = Voids all power inputted into it. Sandbox only. +block.item-source.description = Infinitely outputs items. Sandbox only. +block.liquid-source.description = Infinitely outputs liquids. Sandbox only. +block.item-void.description = Destroys any items which go into it without using power. Sandbox only. +block.power-source.description = Infinitely outputs power. Sandbox only. +block.power-void.description = Voids all power inputted into it. Sandbox only. liquid.water.description = Commonly used for cooling machines and waste processing. liquid.lava.description = Can be transformed into[LIGHT_GRAY] stone[], used for generating power or used as ammo for certain turrets. liquid.oil.description = Can be burnt, exploded or used as a coolant. diff --git a/core/assets/bundles/bundle_tr.properties b/core/assets/bundles/bundle_tr.properties index 616b2c03b4..2bd8915ce8 100644 --- a/core/assets/bundles/bundle_tr.properties +++ b/core/assets/bundles/bundle_tr.properties @@ -569,11 +569,11 @@ block.omega-mech-pad.name = Omega Mech Pad block.tau-mech-pad.name = Tau Mech Pad block.conduit.name = sıvı borusu block.mechanical-pump.name = Mechanical Pump -block.itemsource.name = Item Source -block.itemvoid.name = Item Void -block.liquidsource.name = Liquid Source -block.powervoid.name = Power Void -block.powerinfinite.name = Power Infinite +block.item-source.name = Item Source +block.item-void.name = Item Void +block.liquid-source.name = Liquid Source +block.power-void.name = Power Void +block.power-source.name = Power Infinite block.unloader.name = Unloader block.vault.name = Vault block.wave.name = Wave @@ -771,11 +771,11 @@ block.router.description = Accepts items from one direction and outputs them to block.distributor.description = An advanced router which splits items to up to 7 other directions equally. block.bridge-conveyor.description = Advanced item transport block. Allows transporting items over up to 3 tiles of any terrain or building. block.alpha-mech-pad.description = When given enough power, rebuilds your ship into the[accent] Alpha[] mech. -block.itemsource.description = Infinitely outputs items. Sandbox only. -block.liquidsource.description = Infinitely outputs liquids. Sandbox only. -block.itemvoid.description = Destroys any items which go into it without using power. Sandbox only. -block.powerinfinite.description = Infinitely outputs power. Sandbox only. -block.powervoid.description = Voids all power inputted into it. Sandbox only. +block.item-source.description = Infinitely outputs items. Sandbox only. +block.liquid-source.description = Infinitely outputs liquids. Sandbox only. +block.item-void.description = Destroys any items which go into it without using power. Sandbox only. +block.power-source.description = Infinitely outputs power. Sandbox only. +block.power-void.description = Voids all power inputted into it. Sandbox only. liquid.water.description = Commonly used for cooling machines and waste processing. liquid.lava.description = Can be transformed into[LIGHT_GRAY] stone[], used for generating power or used as ammo for certain turrets. liquid.oil.description = Can be burnt, exploded or used as a coolant. diff --git a/core/assets/bundles/bundle_uk_UA.properties b/core/assets/bundles/bundle_uk_UA.properties index c78427623f..3dd40bb0f5 100644 --- a/core/assets/bundles/bundle_uk_UA.properties +++ b/core/assets/bundles/bundle_uk_UA.properties @@ -580,11 +580,11 @@ block.omega-mech-pad.name = Реконструктор "Омега" block.tau-mech-pad.name = Реконструктор "Тау" block.conduit.name = Трубопровід block.mechanical-pump.name = Механічний насос -block.itemsource.name = Джерело предметів -block.itemvoid.name = Предметний вакуум -block.liquidsource.name = Рідке джерело -block.powervoid.name = Енергетичний вакуум -block.powerinfinite.name = Нескінченна енергія +block.item-source.name = Джерело предметів +block.item-void.name = Предметний вакуум +block.liquid-source.name = Рідке джерело +block.power-void.name = Енергетичний вакуум +block.power-source.name = Нескінченна енергія block.unloader.name = Розвантажувач block.vault.name = Сховище block.wave.name = Хвиля @@ -782,11 +782,11 @@ block.router.description = Приймає елементи з одного на block.distributor.description = Розширений маршрутизатор, який рівномірно розбиває елементи на 7 різних напрямків. block.bridge-conveyor.description = Покращений блок транспортування предметів. Дозволяє транспортувати предмети понад 3 блоки над будь-якої місцевостю або будівлеє. block.alpha-mech-pad.description = Коли ви отримаєте достатньо енергії, перебудовує ваш корабель у [accent] Альфа[] мех. -block.itemsource.description = Безліченно виводить предмети. -block.liquidsource.description = Безліченно виводить рідини. -block.itemvoid.description = Знищує будь-які предмети, які входять, без використання енергії. -block.powerinfinite.description = Нескінченність не межа. Безмежно виводить енергію. -block.powervoid.description = Енергія просто йде в порожнечу. +block.item-source.description = Безліченно виводить предмети. +block.liquid-source.description = Безліченно виводить рідини. +block.item-void.description = Знищує будь-які предмети, які входять, без використання енергії. +block.power-source.description = Нескінченність не межа. Безмежно виводить енергію. +block.power-void.description = Енергія просто йде в порожнечу. liquid.water.description = Цю рідину можно підвести до бурів для прискорення швидкості видобутку або к турелям для прискорення стрілянини. liquid.lava.description = Можна перетворити в[LIGHT_GRAY] камінь[]. liquid.oil.description = Можна спалити, взірвати або використовувати для охолодження. diff --git a/core/assets/bundles/bundle_zh_CN.properties b/core/assets/bundles/bundle_zh_CN.properties index cc6dbb00bb..a3e85d08d8 100644 --- a/core/assets/bundles/bundle_zh_CN.properties +++ b/core/assets/bundles/bundle_zh_CN.properties @@ -567,11 +567,11 @@ block.omega-mech-pad.name = Omega 机甲平台 block.tau-mech-pad.name = Tau 机甲平台 block.conduit.name = 导管 block.mechanical-pump.name = 机械泵 -block.itemsource.name = 物品源 -block.itemvoid.name = 物品黑洞 -block.liquidsource.name = 液体源 -block.powervoid.name = 能源黑洞 -block.powerinfinite.name = 无限能源 +block.item-source.name = 物品源 +block.item-void.name = 物品黑洞 +block.liquid-source.name = 液体源 +block.power-void.name = 能源黑洞 +block.power-source.name = 无限能源 block.unloader.name = 装卸器 block.vault.name = 仓库 block.wave.name = 波浪 @@ -769,11 +769,11 @@ block.router.description = 从一个方向接受物品,并将它们平均输 block.distributor.description = 一个高级路由器,可以将物品分成最多7个方向。 block.bridge-conveyor.description = 高级项目传输块。允许在跨越任何地形或建筑物上运输物品,最多跨越3个块。 block.alpha-mech-pad.description = 当给予足够的电力时,将你的装置重建为[accent] Alpha []机甲。 -block.itemsource.description = 无限输出物品。仅限沙箱。 -block.liquidsource.description = 无限输出液体。仅限沙箱。 -block.itemvoid.description = 在不使用电源的情况下销毁任何进入它的物品。仅限沙箱。 -block.powerinfinite.description = 无限输出功率。仅限沙箱。 -block.powervoid.description = 消耗输入的所有功率。仅限沙箱。 +block.item-source.description = 无限输出物品。仅限沙箱。 +block.liquid-source.description = 无限输出液体。仅限沙箱。 +block.item-void.description = 在不使用电源的情况下销毁任何进入它的物品。仅限沙箱。 +block.power-source.description = 无限输出功率。仅限沙箱。 +block.power-void.description = 消耗输入的所有功率。仅限沙箱。 liquid.water.description = 通常用于冷却和废物处理。 liquid.lava.description = 可以转换成[LIGHT_GRAY] 石头 [],用于发电或用作某些炮塔的弹药。 liquid.oil.description = 可以燃烧,爆炸或用作冷却液。 diff --git a/core/assets/bundles/bundle_zh_TW.properties b/core/assets/bundles/bundle_zh_TW.properties index d7f8aaf123..6796aaaf6d 100644 --- a/core/assets/bundles/bundle_zh_TW.properties +++ b/core/assets/bundles/bundle_zh_TW.properties @@ -578,11 +578,11 @@ block.omega-mech-pad.name = 奧米伽機甲墊 block.tau-mech-pad.name = Tau機甲墊 block.conduit.name = 管線 block.mechanical-pump.name = 機械泵 -block.itemsource.name = 物品源 -block.itemvoid.name = 物品虚 -block.liquidsource.name = 液體源 -block.powervoid.name = 能量空虛 -block.powerinfinite.name = 無限能量 +block.item-source.name = 物品源 +block.item-void.name = 物品虚 +block.liquid-source.name = 液體源 +block.power-void.name = 能量空虛 +block.power-source.name = 無限能量 block.unloader.name = 裝卸器 block.vault.name = 存儲庫 block.wave.name = 波浪炮 @@ -780,11 +780,11 @@ block.router.description = 接受來自一個方向的物品並將它們平均 block.distributor.description = 高級的分配器,可將物品均分到最多7個其他方向。 block.bridge-conveyor.description = 高級的物品運輸方塊。允許跨過最多3個任何地形或建築物的方塊運輸物品。 block.alpha-mech-pad.description = 當給予足夠能量時,將你的船重建為[accent]阿爾法[]機甲。 -block.itemsource.description = 不限地輸出物品。僅限沙盒。 -block.liquidsource.description = 不限地輸出液體。僅限沙盒。 -block.itemvoid.description = 不使用能量銷毀任何進入它的物品。僅限沙盒。 -block.powerinfinite.description = 不限地輸出能量。僅限沙盒。 -block.powervoid.description = 銷毀所有輸入的能量。僅限沙盒。 +block.item-source.description = 不限地輸出物品。僅限沙盒。 +block.liquid-source.description = 不限地輸出液體。僅限沙盒。 +block.item-void.description = 不使用能量銷毀任何進入它的物品。僅限沙盒。 +block.power-source.description = 不限地輸出能量。僅限沙盒。 +block.power-void.description = 銷毀所有輸入的能量。僅限沙盒。 liquid.water.description = 常用於冷卻機器和廢物處理。 liquid.lava.description = 可以轉換為[LIGHT_GRAY]石頭[]、用於發電或用作某些砲塔的彈藥。 liquid.oil.description = 可以燃燒、爆炸或用作冷卻劑。 diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index d5145aeba9..842c5712f2 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -2944,28 +2944,28 @@ incinerator orig: 32, 32 offset: 0, 0 index: -1 -block-icon-itemsource +block-icon-item-source rotate: false xy: 483, 425 size: 32, 32 orig: 32, 32 offset: 0, 0 index: -1 -itemsource +item-source rotate: false xy: 483, 425 size: 32, 32 orig: 32, 32 offset: 0, 0 index: -1 -block-icon-itemvoid +block-icon-item-void rotate: false xy: 415, 357 size: 32, 32 orig: 32, 32 offset: 0, 0 index: -1 -itemvoid +item-void rotate: false xy: 415, 357 size: 32, 32 @@ -3042,6 +3042,20 @@ block-icon-liquid-router orig: 32, 32 offset: 0, 0 index: -1 +block-icon-liquid-source + rotate: false + xy: 483, 357 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +liquid-source + rotate: false + xy: 483, 357 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 block-icon-liquid-tank rotate: false xy: 261, 1243 @@ -3049,20 +3063,6 @@ block-icon-liquid-tank orig: 96, 96 offset: 0, 0 index: -1 -block-icon-liquidsource - rotate: false - xy: 483, 357 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: -1 -liquidsource - rotate: false - xy: 483, 357 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: -1 block-icon-mass-driver rotate: false xy: 359, 1341 @@ -3308,14 +3308,28 @@ block-icon-power-node-large orig: 64, 64 offset: 0, 0 index: -1 -block-icon-powerinfinite +block-icon-power-source rotate: false xy: 229, 310 size: 32, 32 orig: 32, 32 offset: 0, 0 index: -1 -block-icon-powervoid +power-source + rotate: false + xy: 229, 310 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +block-icon-power-void + rotate: false + xy: 229, 276 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +power-void rotate: false xy: 229, 276 size: 32, 32 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index eb3273ed02..ed95b1de59 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/src/io/anuke/mindustry/ai/BlockIndexer.java b/core/src/io/anuke/mindustry/ai/BlockIndexer.java index 9269a205bc..6e96b6cb36 100644 --- a/core/src/io/anuke/mindustry/ai/BlockIndexer.java +++ b/core/src/io/anuke/mindustry/ai/BlockIndexer.java @@ -5,7 +5,7 @@ import io.anuke.arc.collection.*; import io.anuke.arc.function.Predicate; import io.anuke.arc.math.Mathf; import io.anuke.arc.math.geom.Geometry; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.game.EventType.TileChangeEvent; import io.anuke.mindustry.game.EventType.WorldLoadEvent; diff --git a/core/src/io/anuke/mindustry/ai/WaveSpawner.java b/core/src/io/anuke/mindustry/ai/WaveSpawner.java index 414daba785..5096d1c670 100644 --- a/core/src/io/anuke/mindustry/ai/WaveSpawner.java +++ b/core/src/io/anuke/mindustry/ai/WaveSpawner.java @@ -5,7 +5,7 @@ import io.anuke.arc.collection.Array; import io.anuke.arc.collection.GridBits; import io.anuke.arc.math.Mathf; import io.anuke.arc.util.Structs; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.entities.units.BaseUnit; import io.anuke.mindustry.entities.units.Squad; import io.anuke.mindustry.game.EventType.WorldLoadEvent; diff --git a/core/src/io/anuke/mindustry/content/AmmoTypes.java b/core/src/io/anuke/mindustry/content/AmmoTypes.java deleted file mode 100644 index cd96e8344b..0000000000 --- a/core/src/io/anuke/mindustry/content/AmmoTypes.java +++ /dev/null @@ -1,254 +0,0 @@ -package io.anuke.mindustry.content; - -import io.anuke.mindustry.content.bullets.*; -import io.anuke.mindustry.content.fx.BulletFx; -import io.anuke.mindustry.content.fx.Fx; -import io.anuke.mindustry.content.fx.ShootFx; -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.type.AmmoType; -import io.anuke.mindustry.type.ContentType; - -public class AmmoTypes implements ContentList{ - public static AmmoType - bulletCopper, bulletDense, bulletThorium, bulletSilicon, bulletPyratite, - bulletDenseBig, bulletPyratiteBig, bulletThoriumBig, - shock, bombExplosive, bombIncendiary, bombOil, shellCarbide, flamerThermite, weaponMissile, weaponMissileSwarm, bulletMech, - healBlaster, bulletGlaive, - flakExplosive, flakPlastic, flakSurge, - missileExplosive, missileIncindiary, missileSurge, - artilleryDense, artilleryPlastic, artilleryHoming, artilleryIncindiary, artilleryExplosive, unitArtillery, - basicFlame, lancerLaser, lightning, meltdownLaser, burstLaser, - fuseShotgun, oil, water, lava, cryofluid, arc; - - @Override - public void load(){ - - //weapon specific - - bulletMech = new AmmoType(StandardBullets.mechSmall){{ - shootEffect = ShootFx.shootSmall; - smokeEffect = ShootFx.shootSmallSmoke; - reloadMultiplier = 1f; - inaccuracy = 5f; - }}; - - bulletGlaive = new AmmoType(Items.pyratite, StandardBullets.glaive, 3){{ - shootEffect = ShootFx.shootSmall; - smokeEffect = ShootFx.shootSmallSmoke; - inaccuracy = 3f; - }}; - - healBlaster = new AmmoType(TurretBullets.healBullet){{ - shootEffect = ShootFx.shootHeal; - smokeEffect = BulletFx.hitLaser; - reloadMultiplier = 1f; - inaccuracy = 2f; - }}; - - shock = new AmmoType(TurretBullets.lightning){{ - shootEffect = BulletFx.hitLancer; - smokeEffect = Fx.none; - }}; - - shellCarbide = new AmmoType(WeaponBullets.shellCarbide){{ - shootEffect = ShootFx.shootBig; - smokeEffect = ShootFx.shootBigSmoke; - }}; - - bombExplosive = new AmmoType(WeaponBullets.bombExplosive){{ - shootEffect = Fx.none; - smokeEffect = Fx.none; - }}; - - bombIncendiary = new AmmoType(WeaponBullets.bombIncendiary){{ - shootEffect = Fx.none; - smokeEffect = Fx.none; - }}; - - bombOil = new AmmoType(WeaponBullets.bombOil){{ - shootEffect = Fx.none; - smokeEffect = Fx.none; - }}; - - flamerThermite = new AmmoType(TurretBullets.basicFlame){{ - shootEffect = ShootFx.shootSmallFlame; - }}; - - weaponMissile = new AmmoType(MissileBullets.javelin){{ - shootEffect = BulletFx.hitBulletSmall; - smokeEffect = Fx.none; - reloadMultiplier = 1.2f; - }}; - - weaponMissileSwarm = new AmmoType(MissileBullets.swarm){{ - shootEffect = BulletFx.hitBulletSmall; - smokeEffect = ShootFx.shootSmallSmoke; - reloadMultiplier = 1.2f; - }}; - - //bullets - - bulletCopper = new AmmoType(Items.copper, StandardBullets.copper, 5){{ - shootEffect = ShootFx.shootSmall; - smokeEffect = ShootFx.shootSmallSmoke; - reloadMultiplier = 1f; - inaccuracy = 5f; - }}; - - bulletDense = new AmmoType(Items.densealloy, StandardBullets.dense, 2){{ - shootEffect = ShootFx.shootSmall; - smokeEffect = ShootFx.shootSmallSmoke; - reloadMultiplier = 0.6f; - }}; - - bulletThorium = new AmmoType(Items.thorium, StandardBullets.thorium, 2){{ - shootEffect = ShootFx.shootBig; - smokeEffect = ShootFx.shootBigSmoke; - }}; - - bulletSilicon = new AmmoType(Items.silicon, StandardBullets.homing, 5){{ - shootEffect = ShootFx.shootSmall; - smokeEffect = ShootFx.shootSmallSmoke; - reloadMultiplier = 1.4f; - }}; - - bulletPyratite = new AmmoType(Items.pyratite, StandardBullets.tracer, 3){{ - shootEffect = ShootFx.shootSmall; - smokeEffect = ShootFx.shootSmallSmoke; - inaccuracy = 3f; - }}; - - bulletDenseBig = new AmmoType(Items.densealloy, StandardBullets.denseBig, 1){{ - shootEffect = ShootFx.shootBig; - smokeEffect = ShootFx.shootBigSmoke; - }}; - - bulletThoriumBig = new AmmoType(Items.thorium, StandardBullets.thoriumBig, 1){{ - shootEffect = ShootFx.shootBig; - smokeEffect = ShootFx.shootBigSmoke; - }}; - - bulletPyratiteBig = new AmmoType(Items.pyratite, StandardBullets.tracerBig, 2){{ - shootEffect = ShootFx.shootBig; - smokeEffect = ShootFx.shootBigSmoke; - inaccuracy = 3f; - }}; - - //flak - - flakExplosive = new AmmoType(Items.blastCompound, FlakBullets.explosive, 5){{ - shootEffect = ShootFx.shootBig; - smokeEffect = ShootFx.shootBigSmoke; - }}; - - flakPlastic = new AmmoType(Items.plastanium, FlakBullets.plastic, 5){{ - shootEffect = ShootFx.shootBig; - smokeEffect = ShootFx.shootBigSmoke; - }}; - - flakSurge = new AmmoType(Items.surgealloy, FlakBullets.surge, 5){{ - shootEffect = ShootFx.shootBig; - smokeEffect = ShootFx.shootBigSmoke; - reloadMultiplier = 1/2f; - }}; - - //missiles - - missileExplosive = new AmmoType(Items.blastCompound, MissileBullets.explosive, 1){{ - shootEffect = ShootFx.shootBig2; - smokeEffect = ShootFx.shootBigSmoke2; - reloadMultiplier = 1.2f; - }}; - - missileIncindiary = new AmmoType(Items.pyratite, MissileBullets.incindiary, 1){{ - shootEffect = ShootFx.shootBig2; - smokeEffect = ShootFx.shootBigSmoke2; - reloadMultiplier = 1.0f; - }}; - - missileSurge = new AmmoType(Items.surgealloy, MissileBullets.surge, 1){{ - shootEffect = ShootFx.shootBig2; - smokeEffect = ShootFx.shootBigSmoke2; - reloadMultiplier = 1.1f; - }}; - - //artillery - - artilleryDense = new AmmoType(Items.densealloy, ArtilleryBullets.dense, 2){{ - shootEffect = ShootFx.shootBig2; - smokeEffect = ShootFx.shootBigSmoke2; - }}; - - artilleryPlastic = new AmmoType(Items.plastanium, ArtilleryBullets.plastic, 2){{ - shootEffect = ShootFx.shootBig2; - smokeEffect = ShootFx.shootBigSmoke2; - reloadMultiplier = 1.4f; - }}; - - artilleryHoming = new AmmoType(Items.silicon, ArtilleryBullets.homing, 1){{ - shootEffect = ShootFx.shootBig2; - smokeEffect = ShootFx.shootBigSmoke2; - reloadMultiplier = 0.9f; - }}; - - artilleryIncindiary = new AmmoType(Items.pyratite, ArtilleryBullets.incindiary, 2){{ - shootEffect = ShootFx.shootBig2; - smokeEffect = ShootFx.shootBigSmoke2; - reloadMultiplier = 1.2f; - }}; - - artilleryExplosive = new AmmoType(Items.blastCompound, ArtilleryBullets.explosive, 1){{ - shootEffect = ShootFx.shootBig2; - smokeEffect = ShootFx.shootBigSmoke2; - reloadMultiplier = 1.6f; - }}; - - unitArtillery = new AmmoType(Items.blastCompound, ArtilleryBullets.unit, 1){{ - shootEffect = ShootFx.shootBig2; - smokeEffect = ShootFx.shootBigSmoke2; - reloadMultiplier = 1.6f; - }}; - - - //flame - - basicFlame = new AmmoType(Liquids.oil, TurretBullets.basicFlame, 0.3f){{ - shootEffect = ShootFx.shootSmallFlame; - }}; - - //power - - lancerLaser = new AmmoType(TurretBullets.lancerLaser); - - burstLaser = new AmmoType(TurretBullets.burstLaser){{ - range = 60f; - }}; - - lightning = new AmmoType(TurretBullets.lightning); - - arc = new AmmoType(TurretBullets.arc); - - meltdownLaser = new AmmoType(TurretBullets.meltdownLaser); - - fuseShotgun = new AmmoType(Items.densealloy, TurretBullets.fuseShot, 1f){{ - shootEffect = Fx.none; - smokeEffect = ShootFx.shootBigSmoke2; - }}; - - //liquid - - oil = new AmmoType(Liquids.oil, TurretBullets.oilShot, 0.3f); - - water = new AmmoType(Liquids.water, TurretBullets.waterShot, 0.3f); - - lava = new AmmoType(Liquids.lava, TurretBullets.lavaShot, 0.3f); - - cryofluid = new AmmoType(Liquids.cryofluid, TurretBullets.cryoShot, 0.3f); - - } - - @Override - public ContentType type(){ - return ContentType.ammo; - } -} diff --git a/core/src/io/anuke/mindustry/content/Blocks.java b/core/src/io/anuke/mindustry/content/Blocks.java new file mode 100644 index 0000000000..4c5ad492f1 --- /dev/null +++ b/core/src/io/anuke/mindustry/content/Blocks.java @@ -0,0 +1,1106 @@ +package io.anuke.mindustry.content; + +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Time; +import io.anuke.mindustry.game.ContentList; +import io.anuke.mindustry.graphics.CacheLayer; +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.blocks.*; +import io.anuke.mindustry.world.blocks.defense.*; +import io.anuke.mindustry.world.blocks.defense.turrets.*; +import io.anuke.mindustry.world.blocks.distribution.*; +import io.anuke.mindustry.world.blocks.power.*; +import io.anuke.mindustry.world.blocks.production.*; +import io.anuke.mindustry.world.blocks.sandbox.*; +import io.anuke.mindustry.world.blocks.storage.CoreBlock; +import io.anuke.mindustry.world.blocks.storage.SortedUnloader; +import io.anuke.mindustry.world.blocks.storage.Vault; +import io.anuke.mindustry.world.blocks.units.*; + +import static io.anuke.mindustry.Vars.content; + +public class Blocks implements ContentList{ + public static Block + + air, blockpart, spawn, space, metalfloor, deepwater, water, lava, tar, stone, + blackstone, dirt, sand, ice, snow, grass, shrub, rock, icerock, blackrock, smelter, siliconSmelter, + plastaniumCompressor, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidmixer, melter, separator, + centrifuge, biomatterCompressor, pulverizer, incinerator, powerVoid, powerSource, itemSource, liquidSource, + itemVoid, copperWall, copperWallLarge, graphiteWall, graphiteWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge, + phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mendProjector, overdriveProjector, forceProjector, shockMine, conveyor, + titaniumconveyor, distributor, junction, itemBridge, phaseConveyor, sorter, router, overflowGate, massDriver, mechanicalPump, + rotaryPump, thermalPump, conduit, pulseConduit, liquidRouter, liquidtank, liquidJunction, bridgeConduit, phaseConduit, + combustionGenerator, thermalGenerator, turbineGenerator, rtgGenerator, solarPanel, largeSolarPanel, thoriumReactor, + fusionReactor, battery, batteryLarge, powerNode, powerNodeLarge, mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, + plasmaDrill, waterExtractor, oilExtractor, cultivator, core, vault, container, unloader, duo, scorch, hail, wave, lancer, + arc, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown, spiritFactory, phantomFactory, wraithFactory, ghoulFactory, + revenantFactory, daggerFactory, titanFactory, fortressFactory, reconstructor, repairPoint, commandCenter, alphaPad, deltaPad, + tauPad, omegaPad, dartPad, javelinPad, tridentPad, glaivePad; + + @Override + public void load(){ + //region environment blocks + + air = new Floor("air"){ + { + blend = false; + alwaysReplace = true; + } + + public void draw(Tile tile){} + public void load(){} + public void init(){} + }; + + blockpart = new BlockPart(); + + spawn = new Block("spawn"){ + + public void drawShadow(Tile tile){} + + public void draw(Tile tile){ + Draw.color(Color.SCARLET); + Lines.circle(tile.worldx(), tile.worldy(), 4f +Mathf.absin(Time.time(), 6f, 6f)); + Draw.color(); + } + }; + + //Registers build blocks from size 1-6 + //no reference is needed here since they can be looked up by name later + for(int i = 1; i <= 6; i++){ + new BuildBlock("build" + i); + } + + space = new Floor("space"){{ + placeableOn = false; + variants = 0; + cacheLayer = CacheLayer.space; + solid = true; + blend = false; + minimapColor = Color.valueOf("000001"); + }}; + + metalfloor = new Floor("metalfloor"){{ + variants = 6; + }}; + + deepwater = new Floor("deepwater"){{ + liquidColor = Color.valueOf("546bb3"); + speedMultiplier = 0.2f; + variants = 0; + liquidDrop = Liquids.water; + isLiquid = true; + status = StatusEffects.wet; + statusIntensity = 1f; + drownTime = 140f; + cacheLayer = CacheLayer.water; + minimapColor = Color.valueOf("465a96"); + }}; + + water = new Floor("water"){{ + liquidColor = Color.valueOf("546bb3"); + speedMultiplier = 0.5f; + variants = 0; + status = StatusEffects.wet; + statusIntensity = 0.9f; + liquidDrop = Liquids.water; + isLiquid = true; + cacheLayer = CacheLayer.water; + minimapColor = Color.valueOf("506eb4"); + }}; + + tar = new Floor("tar"){{ + drownTime = 150f; + liquidColor = Color.valueOf("292929"); + status = StatusEffects.tarred; + statusIntensity = 1f; + speedMultiplier = 0.19f; + variants = 0; + liquidDrop = Liquids.oil; + isLiquid = true; + cacheLayer = CacheLayer.oil; + minimapColor = Color.valueOf("292929"); + }}; + + stone = new Floor("stone"){{ + hasOres = true; + blends = block -> block != this && !(block instanceof OreBlock); + minimapColor = Color.valueOf("323232"); + playerUnmineable = true; + }}; + + blackstone = new Floor("blackstone"){{ + minimapColor = Color.valueOf("252525"); + playerUnmineable = true; + hasOres = true; + }}; + + dirt = new Floor("dirt"){{ + minimapColor = Color.valueOf("6e501e"); + }}; + + sand = new Floor("sand"){{ + drops = new ItemStack(Items.sand, 1); + minimapColor = Color.valueOf("988a67"); + hasOres = true; + playerUnmineable = true; + }}; + + ice = new Floor("ice"){{ + dragMultiplier = 0.2f; + speedMultiplier = 0.4f; + minimapColor = Color.valueOf("b8eef8"); + hasOres = true; + }}; + + snow = new Floor("snow"){{ + minimapColor = Color.valueOf("c2d1d2"); + hasOres = true; + }}; + + grass = new Floor("grass"){{ + hasOres = true; + minimapColor = Color.valueOf("549d5b"); + }}; + + shrub = new Rock("shrub"); + + rock = new Rock("rock"){{ + variants = 2; + }}; + + icerock = new Rock("icerock"){{ + variants = 2; + }}; + + blackrock = new Rock("blackrock"){{ + variants = 1; + }}; + + //endregion + //region crafting + + siliconSmelter = new PowerSmelter("silicon-smelter"){{ + health = 90; + craftEffect = Fx.smeltsmoke; + result = Items.silicon; + craftTime = 40f; + size = 2; + hasLiquids = false; + flameColor = Color.valueOf("ffef99"); + + consumes.items(new ItemStack(Items.coal, 1), new ItemStack(Items.sand, 2)); + consumes.power(0.05f); + }}; + + plastaniumCompressor = new PlastaniumCompressor("plastanium-compressor"){{ + hasItems = true; + liquidCapacity = 60f; + craftTime = 60f; + output = Items.plastanium; + size = 2; + health = 320; + hasPower = hasLiquids = true; + craftEffect = Fx.formsmoke; + updateEffect = Fx.plasticburn; + + consumes.liquid(Liquids.oil, 0.25f); + consumes.power(0.3f); + consumes.item(Items.titanium, 2); + }}; + + phaseWeaver = new PhaseWeaver("phase-weaver"){{ + craftEffect = Fx.smeltsmoke; + result = Items.phasefabric; + craftTime = 120f; + size = 2; + + consumes.items(new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10)); + consumes.power(0.5f); + }}; + + surgeSmelter = new PowerSmelter("alloy-smelter"){{ + craftEffect = Fx.smeltsmoke; + result = Items.surgealloy; + craftTime = 75f; + size = 2; + + useFlux = true; + fluxNeeded = 3; + + consumes.power(0.4f); + 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"){{ + outputLiquid = Liquids.cryofluid; + liquidPerItem = 50f; + size = 2; + hasPower = true; + + consumes.power(0.1f); + consumes.item(Items.titanium); + consumes.liquid(Liquids.water, 0.3f); + }}; + + blastMixer = new GenericCrafter("blast-mixer"){{ + hasItems = true; + hasPower = true; + hasLiquids = true; + output = Items.blastCompound; + size = 2; + + consumes.liquid(Liquids.oil, 0.05f); + consumes.item(Items.pyratite, 1); + consumes.power(0.04f); + }}; + + pyratiteMixer = new PowerSmelter("pyratite-mixer"){{ + flameColor = Color.CLEAR; + hasItems = true; + hasPower = true; + result = Items.pyratite; + + size = 2; + + consumes.power(0.02f); + consumes.items(new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2)); + }}; + + melter = new PowerCrafter("melter"){{ + health = 200; + outputLiquid = Liquids.slag; + outputLiquidAmount = 1.5f; + craftTime = 10f; + hasLiquids = hasPower = true; + + consumes.power(0.1f); + consumes.item(Items.scrap, 1); + }}; + + separator = new Separator("separator"){{ + results = new ItemStack[]{ + new ItemStack(Items.copper, 5), + new ItemStack(Items.lead, 3), + new ItemStack(Items.titanium, 2), + new ItemStack(Items.thorium, 1) + }; + hasPower = true; + filterTime = 15f; + health = 50 * 4; + spinnerLength = 1.5f; + spinnerRadius = 3.5f; + spinnerThickness = 1.5f; + spinnerSpeed = 3f; + size = 2; + + consumes.liquid(Liquids.slag, 0.3f); + }}; + + biomatterCompressor = new Compressor("biomattercompressor"){{ + liquidCapacity = 60f; + craftTime = 20f; + outputLiquid = Liquids.oil; + outputLiquidAmount = 2.5f; + size = 2; + health = 320; + hasLiquids = true; + + consumes.item(Items.biomatter, 1); + consumes.power(0.06f); + }}; + + pulverizer = new Pulverizer("pulverizer"){{ + output = Items.sand; + craftEffect = Fx.pulverize; + craftTime = 40f; + updateEffect = Fx.pulverizeSmall; + hasItems = hasPower = true; + + consumes.item(Items.scrap, 1); + consumes.power(0.05f); + }}; + + incinerator = new Incinerator("incinerator"){{ + health = 90; + }}; + + //endregion + //region sandbox + + powerVoid = new PowerVoid("power-void"); + powerSource = new PowerSource("power-source"); + itemSource = new ItemSource("item-source"); + itemVoid = new ItemVoid("item-void"); + liquidSource = new LiquidSource("liquid-source"); + + //endregion + //region defense + + int wallHealthMultiplier = 3; + + copperWall = new Wall("copper-wall"){{ + health = 80 * wallHealthMultiplier; + }}; + + copperWallLarge = new Wall("copper-wall-large"){{ + health = 80 * 4 * wallHealthMultiplier; + size = 2; + }}; + + graphiteWall = new Wall("dense-alloy-wall"){{ + health = 110 * wallHealthMultiplier; + }}; + + graphiteWallLarge = new Wall("dense-alloy-wall-large"){{ + health = 110 * wallHealthMultiplier * 4; + size = 2; + }}; + + thoriumWall = new Wall("thorium-wall"){{ + health = 200 * wallHealthMultiplier; + }}; + + thoriumWallLarge = new Wall("thorium-wall-large"){{ + health = 200 * wallHealthMultiplier * 4; + size = 2; + }}; + + phaseWall = new DeflectorWall("phase-wall"){{ + health = 150 * wallHealthMultiplier; + }}; + + phaseWallLarge = new DeflectorWall("phase-wall-large"){{ + health = 150 * 4 * wallHealthMultiplier; + size = 2; + }}; + + surgeWall = new SurgeWall("surge-wall"){{ + health = 230 * wallHealthMultiplier; + }}; + + surgeWallLarge = new SurgeWall("surge-wall-large"){{ + health = 230 * 4 * wallHealthMultiplier; + size = 2; + }}; + + door = new Door("door"){{ + health = 100 * wallHealthMultiplier; + }}; + + doorLarge = new Door("door-large"){{ + openfx = Fx.dooropenlarge; + closefx = Fx.doorcloselarge; + health = 100 * 4 * wallHealthMultiplier; + size = 2; + }}; + + mendProjector = new MendProjector("mend-projector"){{ + consumes.power(0.2f, 1.0f); + size = 2; + consumes.item(Items.phasefabric).optional(true); + }}; + + overdriveProjector = new OverdriveProjector("overdrive-projector"){{ + consumes.power(0.35f, 1.0f); + size = 2; + consumes.item(Items.phasefabric).optional(true); + }}; + + forceProjector = new ForceProjector("force-projector"){{ + size = 3; + consumes.item(Items.phasefabric).optional(true); + }}; + + shockMine = new ShockMine("shock-mine"){{ + health = 40; + damage = 11; + tileDamage = 7f; + length = 10; + tendrils = 5; + }}; + + //endregion + //region distribution + + conveyor = new Conveyor("conveyor"){{ + health = 45; + speed = 0.03f; + }}; + + titaniumconveyor = new Conveyor("titanium-conveyor"){{ + health = 65; + speed = 0.07f; + }}; + + junction = new Junction("junction"){{ + speed = 26; + capacity = 32; + }}; + + itemBridge = new BufferedItemBridge("bridge-conveyor"){{ + range = 4; + speed = 60f; + bufferCapacity = 15; + }}; + + phaseConveyor = new ItemBridge("phase-conveyor"){{ + range = 12; + hasPower = true; + consumes.power(0.03f, 1.0f); + }}; + + sorter = new Sorter("sorter"); + + router = new Router("router"); + + distributor = new Router("distributor"){{ + size = 2; + }}; + + overflowGate = new OverflowGate("overflow-gate"); + + massDriver = new MassDriver("mass-driver"){{ + size = 3; + itemCapacity = 60; + range = 440f; + }}; + + //endregion + //region liquid + + mechanicalPump = new Pump("mechanical-pump"){{ + pumpAmount = 0.1f; + tier = 0; + }}; + + rotaryPump = new Pump("rotary-pump"){{ + pumpAmount = 0.2f; + consumes.power(0.015f); + liquidCapacity = 30f; + hasPower = true; + size = 2; + tier = 1; + }}; + + thermalPump = new Pump("thermal-pump"){{ + pumpAmount = 0.275f; + consumes.power(0.03f); + liquidCapacity = 40f; + hasPower = true; + size = 2; + tier = 2; + }}; + + conduit = new Conduit("conduit"){{ + health = 45; + }}; + + pulseConduit = new Conduit("pulse-conduit"){{ + liquidCapacity = 16f; + liquidFlowFactor = 4.9f; + health = 90; + }}; + + liquidRouter = new LiquidRouter("liquid-router"){{ + liquidCapacity = 20f; + }}; + + liquidtank = new LiquidTank("liquid-tank"){{ + size = 3; + liquidCapacity = 1500f; + health = 500; + }}; + + liquidJunction = new LiquidJunction("liquid-junction"); + + bridgeConduit = new LiquidExtendingBridge("bridge-conduit"){{ + range = 4; + hasPower = false; + }}; + + phaseConduit = new LiquidBridge("phase-conduit"){{ + range = 12; + hasPower = true; + consumes.power(0.03f, 1.0f); + }}; + + //endregion + //region power + + combustionGenerator = new BurnerGenerator("combustion-generator"){{ + powerProduction = 0.09f; + itemDuration = 40f; + }}; + + thermalGenerator = new LiquidHeatGenerator("thermal-generator"){{ + maxLiquidGenerate = 2f; + powerProduction = 2f; + generateEffect = Fx.redgeneratespark; + size = 2; + }}; + + turbineGenerator = new TurbineGenerator("turbine-generator"){{ + powerProduction = 0.28f; + itemDuration = 30f; + consumes.liquid(Liquids.water, 0.05f); + size = 2; + }}; + + rtgGenerator = new DecayGenerator("rtg-generator"){{ + size = 2; + powerProduction = 0.3f; + itemDuration = 220f; + }}; + + solarPanel = new SolarGenerator("solar-panel"){{ + powerProduction = 0.0045f; + }}; + + largeSolarPanel = new SolarGenerator("solar-panel-large"){{ + size = 3; + powerProduction = 0.055f; + }}; + + thoriumReactor = new NuclearReactor("thorium-reactor"){{ + size = 3; + health = 700; + powerProduction = 1.1f; + }}; + + fusionReactor = new FusionReactor("fusion-reactor"){{ + size = 4; + health = 600; + }}; + + battery = new Battery("battery"){{ + consumes.powerBuffered(320f, 1f); + }}; + + batteryLarge = new Battery("battery-large"){{ + size = 3; + consumes.powerBuffered(2000f, 1f); + }}; + + powerNode = new PowerNode("power-node"){{ + maxNodes = 4; + laserRange = 6; + }}; + + powerNodeLarge = new PowerNode("power-node-large"){{ + size = 2; + maxNodes = 6; + laserRange = 9.5f; + }}; + + //endregion power + //region production + + mechanicalDrill = new Drill("mechanical-drill"){{ + tier = 2; + drillTime = 300; + size = 2; + drawMineItem = true; + }}; + + pneumaticDrill = new Drill("pneumatic-drill"){{ + tier = 3; + drillTime = 240; + size = 2; + drawMineItem = true; + }}; + + laserDrill = new Drill("laser-drill"){{ + drillTime = 140; + size = 2; + hasPower = true; + tier = 4; + updateEffect = Fx.pulverizeMedium; + drillEffect = Fx.mineBig; + + consumes.power(0.11f); + }}; + + blastDrill = new Drill("blast-drill"){{ + drillTime = 60; + size = 3; + drawRim = true; + hasPower = true; + tier = 5; + updateEffect = Fx.pulverizeRed; + updateEffectChance = 0.03f; + drillEffect = Fx.mineHuge; + rotateSpeed = 6f; + warmupSpeed = 0.01f; + + consumes.power(0.3f); + }}; + + plasmaDrill = new Drill("plasma-drill"){{ + heatColor = Color.valueOf("ff461b"); + drillTime = 50; + size = 4; + hasLiquids = true; + hasPower = true; + tier = 5; + rotateSpeed = 9f; + drawRim = true; + updateEffect = Fx.pulverizeRedder; + updateEffectChance = 0.04f; + drillEffect = Fx.mineHuge; + warmupSpeed = 0.005f; + + consumes.power(0.7f); + }}; + + waterExtractor = new SolidPump("water-extractor"){{ + result = Liquids.water; + pumpAmount = 0.065f; + size = 2; + liquidCapacity = 30f; + rotateSpeed = 1.4f; + + consumes.power(0.09f); + }}; + + oilExtractor = new Fracker("oil-extractor"){{ + result = Liquids.oil; + updateEffect = Fx.pulverize; + liquidCapacity = 50f; + updateEffectChance = 0.05f; + pumpAmount = 0.09f; + size = 3; + liquidCapacity = 30f; + + consumes.item(Items.sand); + consumes.power(0.3f); + consumes.liquid(Liquids.water, 0.15f); + }}; + + cultivator = new Cultivator("cultivator"){{ + result = Items.biomatter; + drillTime = 200; + size = 2; + hasLiquids = true; + hasPower = true; + + consumes.power(0.08f); + consumes.liquid(Liquids.water, 0.15f); + }}; + + //endregion + //region storage + + core = new CoreBlock("core"){{ + health = 1100; + itemCapacity = 3000; + }}; + + vault = new Vault("vault"){{ + size = 3; + itemCapacity = 1000; + }}; + + container = new Vault("container"){{ + size = 2; + itemCapacity = 300; + }}; + + unloader = new SortedUnloader("unloader"){{ + speed = 7f; + }}; + + //endregion + //region turrets + + duo = new DoubleTurret("duo"){{ + ammo( + Items.copper, Bullets.standardCopper, + Items.graphite, Bullets.standardDense, + Items.pyratite, Bullets.standardIncendiary, + Items.silicon, Bullets.standardHoming + ); + reload = 25f; + restitution = 0.03f; + range = 90f; + shootCone = 15f; + ammoUseEffect = Fx.shellEjectSmall; + health = 80; + inaccuracy = 2f; + rotatespeed = 10f; + }}; + + hail = new ArtilleryTurret("hail"){{ + ammo( + Items.graphite, Bullets.artilleryDense, + Items.silicon, Bullets.artilleryHoming, + Items.pyratite, Bullets.artlleryIncendiary + ); + reload = 60f; + recoil = 2f; + range = 230f; + inaccuracy = 1f; + shootCone = 10f; + health = 120; + }}; + + scorch = new LiquidTurret("scorch"){{ + ammo(Liquids.oil, Bullets.basicFlame); + recoil = 0f; + reload = 4f; + shootCone = 50f; + ammoUseEffect = Fx.shellEjectSmall; + health = 160; + }}; + + wave = new LiquidTurret("wave"){{ + ammo( + Liquids.water, Bullets.waterShot, + Liquids.slag, Bullets.slagShot, + Liquids.cryofluid, Bullets.cryoShot, + Liquids.oil, Bullets.oilShot + ); + size = 2; + recoil = 0f; + reload = 4f; + inaccuracy = 5f; + shootCone = 50f; + shootEffect = Fx.shootLiquid; + range = 90f; + health = 360; + + drawer = (tile, entity) -> { + Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90); + + Draw.color(entity.liquids.current().color); + Draw.alpha(entity.liquids.total() / liquidCapacity); + Draw.rect(name + "-liquid", tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90); + Draw.color(); + }; + }}; + + lancer = new ChargeTurret("lancer"){{ + range = 90f; + chargeTime = 60f; + chargeMaxDelay = 30f; + chargeEffects = 7; + shootType = Bullets.lancerLaser; + recoil = 2f; + reload = 100f; + cooldown = 0.03f; + powerUsed = 1 / 3f; + consumes.powerBuffered(60f); + shootShake = 2f; + shootEffect = Fx.lancerLaserShoot; + smokeEffect = Fx.lancerLaserShootSmoke; + chargeEffect = Fx.lancerLaserCharge; + chargeBeginEffect = Fx.lancerLaserChargeBegin; + heatColor = Color.RED; + size = 2; + health = 320; + targetAir = false; + }}; + + arc = new PowerTurret("arc"){{ + shootType = Bullets.arc; + reload = 85f; + shootShake = 1f; + shootCone = 40f; + rotatespeed = 8f; + powerUsed = 1f / 3f; + consumes.powerBuffered(30f); + range = 150f; + shootEffect = Fx.lightningShoot; + heatColor = Color.RED; + recoil = 1f; + size = 1; + }}; + + swarmer = new BurstTurret("swarmer"){{ + ammo( + Items.blastCompound, Bullets.missileExplosive, + Items.pyratite, Bullets.missileIncendiary, + Items.surgealloy, Bullets.missileSurge + ); + reload = 50f; + shots = 4; + burstSpacing = 5; + inaccuracy = 10f; + range = 140f; + xRand = 6f; + size = 2; + health = 380; + }}; + + salvo = new BurstTurret("salvo"){{ + ammo( + Items.copper, Bullets.standardCopper, + Items.graphite, Bullets.standardDense, + Items.pyratite, Bullets.standardIncendiary, + Items.silicon, Bullets.standardHoming, + Items.thorium, Bullets.standardThorium + ); + + size = 2; + range = 120f; + reload = 35f; + restitution = 0.03f; + ammoEjectBack = 3f; + cooldown = 0.03f; + recoil = 3f; + shootShake = 2f; + burstSpacing = 4; + shots = 3; + ammoUseEffect = Fx.shellEjectBig; + health = 360; + }}; + + ripple = new ArtilleryTurret("ripple"){{ + ammo( + Items.graphite, Bullets.artilleryDense, + Items.silicon, Bullets.artilleryHoming, + Items.pyratite, Bullets.artlleryIncendiary, + Items.blastCompound, Bullets.artilleryExplosive, + Items.plastanium, Bullets.arilleryPlastic + ); + size = 3; + shots = 4; + inaccuracy = 12f; + reload = 60f; + ammoEjectBack = 5f; + ammoUseEffect = Fx.shellEjectBig; + cooldown = 0.03f; + velocityInaccuracy = 0.2f; + restitution = 0.02f; + recoil = 6f; + shootShake = 2f; + range = 320f; + + health = 550; + }}; + + cyclone = new ItemTurret("cyclone"){{ + ammo( + Items.blastCompound, Bullets.flakExplosive, + Items.plastanium, Bullets.flakPlastic, + Items.surgealloy, Bullets.flakSurge + ); + xRand = 4f; + reload = 8f; + range = 145f; + size = 3; + recoil = 3f; + rotatespeed = 10f; + inaccuracy = 13f; + shootCone = 30f; + + health = 145 * size * size; + }}; + + fuse = new ItemTurret("fuse"){{ + ammo(Items.graphite, Bullets.fuseShot); + reload = 50f; + shootShake = 4f; + range = 80f; + recoil = 5f; + restitution = 0.1f; + size = 3; + + health = 155 * size * size; + }}; + + spectre = new DoubleTurret("spectre"){{ + ammo( + Items.graphite, Bullets.standardDenseBig, + Items.pyratite, Bullets.standardIncendiaryBig, + Items.thorium, Bullets.standardThoriumBig + ); + reload = 6f; + coolantMultiplier = 0.5f; + maxCoolantUsed = 1.5f; + restitution = 0.1f; + ammoUseEffect = Fx.shellEjectBig; + range = 200f; + inaccuracy = 3f; + recoil = 3f; + xRand = 3f; + shotWidth = 4f; + shootShake = 2f; + shots = 2; + size = 4; + shootCone = 24f; + + health = 155 * size * size; + }}; + + meltdown = new LaserTurret("meltdown"){{ + shootType = Bullets.meltdownLaser; + shootEffect = Fx.shootBigSmoke2; + shootCone = 40f; + recoil = 4f; + size = 4; + shootShake = 2f; + powerUsed = 0.5f; + consumes.powerBuffered(120f); + range = 160f; + reload = 200f; + firingMoveFract = 0.1f; + shootDuration = 220f; + + health = 165 * size * size; + }}; + + //endregion + //region units + + spiritFactory = new UnitFactory("spirit-factory"){{ + type = UnitTypes.spirit; + produceTime = 5700; + size = 2; + consumes.power(0.08f); + consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.lead, 30)); + }}; + + phantomFactory = new UnitFactory("phantom-factory"){{ + type = UnitTypes.phantom; + produceTime = 7300; + size = 2; + consumes.power(0.2f); + consumes.items(new ItemStack(Items.silicon, 70), new ItemStack(Items.lead, 80), new ItemStack(Items.titanium, 80)); + }}; + + wraithFactory = new UnitFactory("wraith-factory"){{ + type = UnitTypes.wraith; + produceTime = 1800; + size = 2; + consumes.power(0.1f); + consumes.items(new ItemStack(Items.silicon, 10), new ItemStack(Items.titanium, 10)); + }}; + + ghoulFactory = new UnitFactory("ghoul-factory"){{ + type = UnitTypes.ghoul; + produceTime = 3600; + size = 3; + consumes.power(0.2f); + consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.titanium, 30), new ItemStack(Items.plastanium, 20)); + }}; + + revenantFactory = new UnitFactory("revenant-factory"){{ + type = UnitTypes.revenant; + produceTime = 8000; + size = 4; + consumes.power(0.3f); + consumes.items(new ItemStack(Items.silicon, 80), new ItemStack(Items.titanium, 80), new ItemStack(Items.plastanium, 50)); + }}; + + daggerFactory = new UnitFactory("dagger-factory"){{ + type = UnitTypes.dagger; + produceTime = 1700; + size = 2; + consumes.power(0.05f); + consumes.items(new ItemStack(Items.silicon, 10)); + }}; + + titanFactory = new UnitFactory("titan-factory"){{ + type = UnitTypes.titan; + produceTime = 3400; + size = 3; + consumes.power(0.15f); + consumes.items(new ItemStack(Items.silicon, 20), new ItemStack(Items.thorium, 30)); + }}; + + fortressFactory = new UnitFactory("fortress-factory"){{ + type = UnitTypes.fortress; + produceTime = 5000; + size = 3; + consumes.power(0.2f); + consumes.items(new ItemStack(Items.silicon, 40), new ItemStack(Items.thorium, 50)); + }}; + + repairPoint = new RepairPoint("repair-point"){{ + repairSpeed = 0.1f; + }}; + + reconstructor = new Reconstructor("reconstructor"){{ + size = 2; + }}; + + commandCenter = new CommandCenter("command-center"){{ + size = 2; + }}; + + //endregion + //region upgrades + + alphaPad = new MechPad("alpha-mech-pad"){{ + mech = Mechs.alpha; + size = 2; + consumes.powerBuffered(50f); + }}; + + deltaPad = new MechPad("delta-mech-pad"){{ + mech = Mechs.delta; + size = 2; + consumes.powerBuffered(70f); + }}; + + tauPad = new MechPad("tau-mech-pad"){{ + mech = Mechs.tau; + size = 2; + consumes.powerBuffered(100f); + }}; + + omegaPad = new MechPad("omega-mech-pad"){{ + mech = Mechs.omega; + size = 3; + consumes.powerBuffered(120f); + }}; + + dartPad = new MechPad("dart-ship-pad"){{ + mech = Mechs.dart; + size = 2; + consumes.powerBuffered(50f); + }}; + + javelinPad = new MechPad("javelin-ship-pad"){{ + mech = Mechs.javelin; + size = 2; + consumes.powerBuffered(80f); + }}; + + tridentPad = new MechPad("trident-ship-pad"){{ + mech = Mechs.trident; + size = 2; + consumes.powerBuffered(100f); + }}; + + glaivePad = new MechPad("glaive-ship-pad"){{ + mech = Mechs.glaive; + size = 3; + consumes.powerBuffered(120f); + }}; + + //endregion + + //region ores + + //create ores for every floor and item combination necessary + for(Item item : content.items()){ + if(!item.genOre) continue; + + for(Block block : content.blocks()){ + if(block instanceof Floor && ((Floor) block).hasOres){ + new OreBlock(item, (Floor) block); + } + } + } + + //endregion + } +} diff --git a/core/src/io/anuke/mindustry/content/Bullets.java b/core/src/io/anuke/mindustry/content/Bullets.java new file mode 100644 index 0000000000..e5386f98d4 --- /dev/null +++ b/core/src/io/anuke/mindustry/content/Bullets.java @@ -0,0 +1,646 @@ +package io.anuke.mindustry.content; + +import io.anuke.arc.entities.Effects; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.CapStyle; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.Tmp; +import io.anuke.mindustry.entities.Damage; +import io.anuke.mindustry.entities.bullet.*; +import io.anuke.mindustry.entities.effect.Fire; +import io.anuke.mindustry.entities.effect.Lightning; +import io.anuke.mindustry.entities.effect.Puddle; +import io.anuke.mindustry.game.ContentList; +import io.anuke.mindustry.graphics.Palette; +import io.anuke.mindustry.graphics.Shapes; +import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.world.blocks.BuildBlock; + +import static io.anuke.mindustry.Vars.world; + +public class Bullets implements ContentList{ + public static BulletType + + //artillery + artilleryDense, arilleryPlastic, artilleryPlasticFrag, artilleryHoming, artlleryIncendiary, artilleryExplosive, artilleryUnit, + + //flak + flakPlastic, flakExplosive, flakSurge, + + //missiles + missileExplosive, missileIncendiary, missileSurge, missileJavelin, missileSwarm, + + //standard + standardCopper, standardDense, standardThorium, standardHoming, standardIncendiary, standardMechSmall, + standardGlaive, standardDenseBig, standardThoriumBig, standardIncendiaryBig, + + //electric + lancerLaser, meltdownLaser, lightning, arc, damageLightning, + + //liquid + waterShot, cryoShot, slagShot, oilShot, + + //environment, misc. + fireball, basicFlame, fuseShot, driverBolt, healBullet, frag, + + //bombs + bombExplosive, bombIncendiary, bombOil; + + @Override + public void load(){ + + artilleryDense = new ArtilleryBulletType(3f, 0, "shell"){{ + hitEffect = Fx.flakExplosion; + knockback = 0.8f; + lifetime = 50f; + bulletWidth = bulletHeight = 11f; + collidesTiles = false; + splashDamageRadius = 25f; + splashDamage = 33f; + }}; + + artilleryPlasticFrag = new BasicBulletType(2.5f, 6, "bullet"){{ + bulletWidth = 10f; + bulletHeight = 12f; + bulletShrink = 1f; + lifetime = 15f; + backColor = Palette.plastaniumBack; + frontColor = Palette.plastaniumFront; + despawnEffect = Fx.none; + }}; + + arilleryPlastic = new ArtilleryBulletType(3.3f, 0, "shell"){{ + hitEffect = Fx.plasticExplosion; + knockback = 1f; + lifetime = 55f; + bulletWidth = bulletHeight = 13f; + collidesTiles = false; + splashDamageRadius = 35f; + splashDamage = 35f; + fragBullet = artilleryPlasticFrag; + fragBullets = 9; + backColor = Palette.plastaniumBack; + frontColor = Palette.plastaniumFront; + }}; + + artilleryHoming = new ArtilleryBulletType(3f, 0, "shell"){{ + hitEffect = Fx.flakExplosion; + knockback = 0.8f; + lifetime = 45f; + bulletWidth = bulletHeight = 11f; + collidesTiles = false; + splashDamageRadius = 25f; + splashDamage = 33f; + homingPower = 2f; + homingRange = 50f; + }}; + + artlleryIncendiary = new ArtilleryBulletType(3f, 0, "shell"){{ + hitEffect = Fx.blastExplosion; + knockback = 0.8f; + lifetime = 60f; + bulletWidth = bulletHeight = 13f; + collidesTiles = false; + splashDamageRadius = 25f; + splashDamage = 30f; + incendAmount = 4; + incendSpread = 11f; + frontColor = Palette.lightishOrange; + backColor = Palette.lightOrange; + trailEffect = Fx.incendTrail; + }}; + + artilleryExplosive = new ArtilleryBulletType(2f, 0, "shell"){{ + hitEffect = Fx.blastExplosion; + knockback = 0.8f; + lifetime = 70f; + bulletWidth = bulletHeight = 14f; + collidesTiles = false; + splashDamageRadius = 45f; + splashDamage = 50f; + backColor = Palette.missileYellowBack; + frontColor = Palette.missileYellow; + }}; + + artilleryUnit = new ArtilleryBulletType(2f, 0, "shell"){{ + hitEffect = Fx.blastExplosion; + knockback = 0.8f; + lifetime = 90f; + bulletWidth = bulletHeight = 14f; + collides = true; + collidesTiles = true; + splashDamageRadius = 45f; + splashDamage = 50f; + backColor = Palette.bulletYellowBack; + frontColor = Palette.bulletYellow; + }}; + + flakPlastic = new FlakBulletType(4f, 5){{ + splashDamageRadius = 40f; + fragBullet = artilleryPlasticFrag; + fragBullets = 4; + hitEffect = Fx.plasticExplosion; + frontColor = Palette.plastaniumFront; + backColor = Palette.plastaniumBack; + }}; + + flakExplosive = new FlakBulletType(4f, 5){{ + //default bullet type, no changes + }}; + + flakSurge = new FlakBulletType(4f, 7){{ + splashDamage = 33f; + lightining = 2; + lightningLength = 12; + }}; + + missileExplosive = new MissileBulletType(1.8f, 10, "missile"){{ + bulletWidth = 8f; + bulletHeight = 8f; + bulletShrink = 0f; + drag = -0.01f; + splashDamageRadius = 30f; + splashDamage = 30f; + lifetime = 150f; + hitEffect = Fx.blastExplosion; + despawnEffect = Fx.blastExplosion; + }}; + + missileIncendiary = new MissileBulletType(2f, 12, "missile"){{ + frontColor = Palette.lightishOrange; + backColor = Palette.lightOrange; + bulletWidth = 7f; + bulletHeight = 8f; + bulletShrink = 0f; + drag = -0.01f; + homingPower = 7f; + splashDamageRadius = 10f; + splashDamage = 10f; + lifetime = 160f; + hitEffect = Fx.blastExplosion; + incendSpread = 10f; + incendAmount = 3; + }}; + + missileSurge = new MissileBulletType(3.5f, 15, "bullet"){{ + bulletWidth = 8f; + bulletHeight = 8f; + bulletShrink = 0f; + drag = -0.01f; + splashDamageRadius = 30f; + splashDamage = 22f; + lifetime = 150f; + hitEffect = Fx.blastExplosion; + despawnEffect = Fx.blastExplosion; + lightining = 2; + lightningLength = 14; + }}; + + missileJavelin = new MissileBulletType(5f, 10.5f, "missile"){{ + bulletWidth = 8f; + bulletHeight = 8f; + bulletShrink = 0f; + drag = -0.003f; + keepVelocity = false; + splashDamageRadius = 20f; + splashDamage = 1f; + lifetime = 90f; + trailColor = Color.valueOf("b6c6fd"); + hitEffect = Fx.blastExplosion; + despawnEffect = Fx.blastExplosion; + backColor = Palette.bulletYellowBack; + frontColor = Palette.bulletYellow; + weaveScale = 8f; + weaveMag = 2f; + }}; + + missileSwarm = new MissileBulletType(2.7f, 12, "missile"){{ + bulletWidth = 8f; + bulletHeight = 8f; + bulletShrink = 0f; + drag = -0.003f; + homingRange = 60f; + keepVelocity = false; + splashDamageRadius = 25f; + splashDamage = 10f; + lifetime = 120f; + trailColor = Color.GRAY; + backColor = Palette.bulletYellowBack; + frontColor = Palette.bulletYellow; + hitEffect = Fx.blastExplosion; + despawnEffect = Fx.blastExplosion; + weaveScale = 8f; + weaveMag = 2f; + }}; + + standardCopper = new BasicBulletType(2.5f, 7, "bullet"){{ + bulletWidth = 7f; + bulletHeight = 9f; + shootEffect = Fx.shootSmall; + smokeEffect = Fx.shootSmallSmoke; + ammoMultiplier = 5; + }}; + + standardDense = new BasicBulletType(3.5f, 18, "bullet"){{ + bulletWidth = 9f; + bulletHeight = 12f; + armorPierce = 0.2f; + reloadMultiplier = 0.6f; + ammoMultiplier = 2; + }}; + + standardThorium = new BasicBulletType(4f, 29, "bullet"){{ + bulletWidth = 10f; + bulletHeight = 13f; + armorPierce = 0.5f; + shootEffect = Fx.shootBig; + smokeEffect = Fx.shootBigSmoke; + ammoMultiplier = 2; + }}; + + standardHoming = new BasicBulletType(3f, 9, "bullet"){{ + bulletWidth = 7f; + bulletHeight = 9f; + homingPower = 5f; + reloadMultiplier = 1.4f; + ammoMultiplier = 5; + }}; + + standardIncendiary = new BasicBulletType(3.2f, 11, "bullet"){{ + bulletWidth = 10f; + bulletHeight = 12f; + frontColor = Palette.lightishOrange; + backColor = Palette.lightOrange; + incendSpread = 3f; + incendAmount = 1; + incendChance = 0.3f; + inaccuracy = 3f; + }}; + + standardGlaive = new BasicBulletType(4f, 7.5f, "bullet"){{ + bulletWidth = 10f; + bulletHeight = 12f; + frontColor = Color.valueOf("feb380"); + backColor = Color.valueOf("ea8878"); + incendSpread = 3f; + incendAmount = 1; + incendChance = 0.3f; + }}; + + standardMechSmall = new BasicBulletType(4f, 9, "bullet"){{ + bulletWidth = 11f; + bulletHeight = 14f; + lifetime = 40f; + inaccuracy = 5f; + despawnEffect = Fx.hitBulletSmall; + }}; + + standardDenseBig = new BasicBulletType(7f, 42, "bullet"){{ + bulletWidth = 15f; + bulletHeight = 21f; + armorPierce = 0.2f; + }}; + + standardThoriumBig = new BasicBulletType(8f, 65, "bullet"){{ + bulletWidth = 16f; + bulletHeight = 23f; + armorPierce = 0.5f; + }}; + + standardIncendiaryBig = new BasicBulletType(7f, 38, "bullet"){{ + bulletWidth = 16f; + bulletHeight = 21f; + frontColor = Palette.lightishOrange; + backColor = Palette.lightOrange; + incendSpread = 3f; + incendAmount = 2; + incendChance = 0.3f; + }}; + + damageLightning = new BulletType(0.0001f, 0f){ + { + lifetime = Lightning.lifetime; + hitEffect = Fx.hitLancer; + despawnEffect = Fx.none; + status = StatusEffects.shocked; + statusIntensity = 1f; + } + }; + + healBullet = new BulletType(5.2f, 13){ + float healPercent = 3f; + + { + hitEffect = Fx.hitLaser; + despawnEffect = Fx.hitLaser; + collidesTeam = true; + } + + @Override + public boolean collides(Bullet b, Tile tile){ + return tile.getTeam() != b.getTeam() || tile.entity.healthf() < 1f; + } + + @Override + public void draw(Bullet b){ + Draw.color(Palette.heal); + Lines.stroke(2f); + Lines.lineAngleCenter(b.x, b.y, b.rot(), 7f); + Draw.color(Color.WHITE); + Lines.lineAngleCenter(b.x, b.y, b.rot(), 3f); + Draw.reset(); + } + + @Override + public void hitTile(Bullet b, Tile tile){ + super.hit(b); + tile = tile.target(); + + if(tile != null && tile.getTeam() == b.getTeam() && !(tile.block() instanceof BuildBlock)){ + Effects.effect(Fx.healBlockFull, Palette.heal, tile.drawx(), tile.drawy(), tile.block().size); + tile.entity.healBy(healPercent / 100f * tile.entity.maxHealth()); + } + } + }; + + fireball = new BulletType(1f, 4){ + { + pierce = true; + hitTiles = false; + collides = false; + collidesTiles = false; + drag = 0.03f; + hitEffect = despawnEffect = Fx.none; + } + + @Override + public void init(Bullet b){ + b.velocity().setLength(0.6f + Mathf.random(2f)); + } + + @Override + public void draw(Bullet b){ + //TODO add color to the bullet depending on the color of the flame it came from + Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, b.fin()); + Fill.circle(b.x, b.y, 3f * b.fout()); + Draw.reset(); + } + + @Override + public void update(Bullet b){ + if(Mathf.chance(0.04 * Time.delta())){ + Tile tile = world.tileWorld(b.x, b.y); + if(tile != null){ + Fire.create(tile); + } + } + + if(Mathf.chance(0.1 * Time.delta())){ + Effects.effect(Fx.fireballsmoke, b.x, b.y); + } + + if(Mathf.chance(0.1 * Time.delta())){ + Effects.effect(Fx.ballfire, b.x, b.y); + } + } + }; + + basicFlame = new BulletType(2.3f, 5){ + { + hitSize = 7f; + lifetime = 35f; + pierce = true; + drag = 0.05f; + hitEffect = Fx.hitFlameSmall; + despawnEffect = Fx.none; + status = StatusEffects.burning; + } + + @Override + public void draw(Bullet b){ + } + }; + + lancerLaser = new BulletType(0.001f, 140){ + Color[] colors = {Palette.lancerLaser.cpy().mul(1f, 1f, 1f, 0.4f), Palette.lancerLaser, Color.WHITE}; + float[] tscales = {1f, 0.7f, 0.5f, 0.2f}; + float[] lenscales = {1f, 1.1f, 1.13f, 1.14f}; + float length = 100f; + + { + hitEffect = Fx.hitLancer; + despawnEffect = Fx.none; + hitSize = 4; + lifetime = 16f; + pierce = true; + } + + @Override + public void init(Bullet b){ + Damage.collideLine(b, b.getTeam(), hitEffect, b.x, b.y, b.rot(), length); + } + + @Override + public void draw(Bullet b){ + float f = Mathf.curve(b.fin(), 0f, 0.2f); + float baseLen = length * f; + + Lines.lineAngle(b.x, b.y, b.rot(), baseLen); + for(int s = 0; s < 3; s++){ + Draw.color(colors[s]); + for(int i = 0; i < tscales.length; i++){ + Lines.stroke(7f * b.fout() * (s == 0 ? 1.5f : s == 1 ? 1f : 0.3f) * tscales[i]); + Lines.lineAngle(b.x, b.y, b.rot(), baseLen * lenscales[i]); + } + } + Draw.reset(); + } + }; + + meltdownLaser = new BulletType(0.001f, 26){ + Color tmpColor = new Color(); + Color[] colors = {Color.valueOf("ec745855"), Color.valueOf("ec7458aa"), Color.valueOf("ff9c5a"), Color.WHITE}; + float[] tscales = {1f, 0.7f, 0.5f, 0.2f}; + float[] strokes = {2f, 1.5f, 1f, 0.3f}; + float[] lenscales = {1f, 1.12f, 1.15f, 1.17f}; + float length = 200f; + + { + hitEffect = Fx.hitMeltdown; + despawnEffect = Fx.none; + hitSize = 4; + drawSize = 420f; + lifetime = 16f; + pierce = true; + } + + @Override + public void update(Bullet b){ + if(b.timer.get(1, 5f)){ + Damage.collideLine(b, b.getTeam(), hitEffect, b.x, b.y, b.rot(), length); + } + Effects.shake(1f, 1f, b.x, b.y); + } + + @Override + public void hit(Bullet b, float hitx, float hity){ + Effects.effect(hitEffect, colors[2], hitx, hity); + if(Mathf.chance(0.4)){ + Fire.create(world.tileWorld(hitx+Mathf.range(5f), hity+Mathf.range(5f))); + } + } + + @Override + public void draw(Bullet b){ + float baseLen = (length) * b.fout(); + + Lines.lineAngle(b.x, b.y, b.rot(), baseLen); + for(int s = 0; s < colors.length; s++){ + Draw.color(tmpColor.set(colors[s]).mul(1f + Mathf.absin(Time.time(), 1f, 0.1f))); + for(int i = 0; i < tscales.length; i++){ + Tmp.v1.trns(b.rot() + 180f, (lenscales[i] - 1f) * 35f); + Lines.stroke((9f + Mathf.absin(Time.time(), 0.8f, 1.5f)) * b.fout() * strokes[s] * tscales[i]); + Lines.lineAngle(b.x + Tmp.v1.x, b.y + Tmp.v1.y, b.rot(), baseLen * lenscales[i], CapStyle.none); + } + } + Draw.reset(); + } + }; + + fuseShot = new BulletType(0.01f, 70){ + int rays = 3; + float raySpace = 2f; + float rayLength = 80f; + { + hitEffect = Fx.hitFuse; + lifetime = 13f; + despawnEffect = Fx.none; + pierce = true; + } + + @Override + public void init(Bullet b) { + for (int i = 0; i < rays; i++) { + Damage.collideLine(b, b.getTeam(), hitEffect, b.x, b.y, b.rot(), rayLength - Math.abs(i - (rays/2))*20f); + } + } + + @Override + public void draw(Bullet b) { + super.draw(b); + Draw.color(Color.WHITE, Palette.surge, b.fin()); + for(int i = 0; i < 7; i++){ + Tmp.v1.trns(b.rot(), i * 8f); + float sl = Mathf.clamp(b.fout()-0.5f) * (80f - i *10); + Shapes.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, 4f, sl, b.rot() + 90); + Shapes.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, 4f, sl, b.rot() - 90); + } + Shapes.tri(b.x, b.y, 13f, (rayLength+50) * b.fout(), b.rot()); + Shapes.tri(b.x, b.y, 13f, 10f * b.fout(), b.rot() + 180f); + Draw.reset(); + } + }; + + waterShot = new LiquidBulletType(Liquids.water){{ + knockback = 0.65f; + }}; + + cryoShot = new LiquidBulletType(Liquids.cryofluid){{ + + }}; + + slagShot = new LiquidBulletType(Liquids.slag){{ + damage = 4; + speed = 1.9f; + drag = 0.03f; + }}; + + oilShot = new LiquidBulletType(Liquids.oil){{ + speed = 2f; + drag = 0.03f; + }}; + + lightning = new BulletType(0.001f, 12f){ + { + lifetime = 1f; + despawnEffect = Fx.none; + hitEffect = Fx.hitLancer; + keepVelocity = false; + } + + @Override + public void draw(Bullet b){ + } + + @Override + public void init(Bullet b){ + Lightning.create(b.getTeam(), Palette.lancerLaser, damage, b.x, b.y, b.rot(), 30); + } + }; + + arc = new BulletType(0.001f, 26){{ + lifetime = 1; + despawnEffect = Fx.none; + hitEffect = Fx.hitLancer; + } + + @Override + public void draw(Bullet b){} + + @Override + public void init(Bullet b){ + Lightning.create(b.getTeam(), Palette.lancerLaser, damage, b.x, b.y, b.rot(), 36); + } + }; + + driverBolt = new MassDriverBolt(); + + frag = new BasicBulletType(5f, 8, "bullet"){{ + bulletWidth = 8f; + bulletHeight = 9f; + bulletShrink = 0.5f; + lifetime = 50f; + drag = 0.04f; + }}; + + bombExplosive = new BombBulletType(10f, 20f, "shell"){{ + bulletWidth = 9f; + bulletHeight = 13f; + hitEffect = Fx.flakExplosion; + }}; + + bombIncendiary = new BombBulletType(7f, 10f, "shell"){{ + bulletWidth = 8f; + bulletHeight = 12f; + hitEffect = Fx.flakExplosion; + backColor = Palette.lightOrange; + frontColor = Palette.lightishOrange; + incendChance = 1f; + incendAmount = 3; + incendSpread = 10f; + }}; + + bombOil = new BombBulletType(2f, 3f, "shell"){{ + bulletWidth = 8f; + bulletHeight = 12f; + hitEffect = Fx.pulverize; + backColor = new Color(0x4f4f4fff); + frontColor = Color.GRAY; + } + + @Override + public void hit(Bullet b, float x, float y){ + super.hit(b, x, y); + + for(int i = 0; i < 3; i++){ + Tile tile = world.tileWorld(x + Mathf.range(8f), y + Mathf.range(8f)); + Puddle.deposit(tile, Liquids.oil, 5f); + } + } + }; + } +} diff --git a/core/src/io/anuke/mindustry/content/Fx.java b/core/src/io/anuke/mindustry/content/Fx.java new file mode 100644 index 0000000000..07277b8d1f --- /dev/null +++ b/core/src/io/anuke/mindustry/content/Fx.java @@ -0,0 +1,1112 @@ +package io.anuke.mindustry.content; + +import io.anuke.arc.Core; +import io.anuke.arc.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.Lines; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Tmp; +import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect; +import io.anuke.mindustry.game.ContentList; +import io.anuke.mindustry.graphics.Palette; +import io.anuke.mindustry.graphics.Shapes; +import io.anuke.mindustry.type.Item; + +import static io.anuke.mindustry.Vars.tilesize; + +public class Fx implements ContentList{ + public static Effect + + none, placeBlock, breakBlock, smoke, spawn, tapBlock, select, + vtolHover, unitDrop, unitPickup, unitLand, pickup, healWave, heal, landShock, reactorsmoke, nuclearsmoke, nuclearcloud, + redgeneratespark, generatespark, fuelburn, plasticburn, pulverize, pulverizeRed, pulverizeRedder, pulverizeSmall, pulverizeMedium, + producesmoke, smeltsmoke, formsmoke, blastsmoke, lava, doorclose, dooropen, dooropenlarge, doorcloselarge, purify, purifyoil, purifystone, generate, + mine, mineBig, mineHuge, smelt, teleportActivate, teleport, teleportOut, ripple, bubble, commandSend, + healBlock, healBlockFull, healWaveMend, overdriveWave, overdriveBlockFull, shieldBreak, hitBulletSmall, hitFuse, + hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, hitMeltdown, despawn, flakExplosion, blastExplosion, + plasticExplosion, artilleryTrail, incendTrail, missileTrail, absorb, flakExplosionBig, plasticExplosionFlak, burning, fire, + fireSmoke, steam, fireballsmoke, ballfire, freezing, melting, wet, oily, overdriven, dropItem, shockwave, + bigShockwave, nuclearShockwave, explosion, blockExplosion, blockExplosionSmoke, shootSmall, shootHeal, shootSmallSmoke, shootBig, shootBig2, shootBigSmoke, + shootBigSmoke2, shootSmallFlame, shootLiquid, shellEjectSmall, shellEjectMedium, + shellEjectBig, lancerLaserShoot, lancerLaserShootSmoke, lancerLaserCharge, lancerLaserChargeBegin, lightningCharge, lightningShoot; + + @Override + public void load(){ + + none = new Effect(0, 0f, e -> {}); + + placeBlock = new Effect(16, e -> { + Draw.color(Palette.accent); + Lines.stroke(3f - e.fin() * 2f); + Lines.square(e.x, e.y, tilesize / 2f * e.rotation + e.fin() * 3f); + Draw.reset(); + }); + + tapBlock = new Effect(12, e -> { + Draw.color(Palette.accent); + Lines.stroke(3f - e.fin() * 2f); + Lines.circle(e.x, e.y, 4f + (tilesize / 1.5f * e.rotation) * e.fin()); + Draw.reset(); + }); + + breakBlock = new Effect(12, e -> { + Draw.color(Palette.remove); + Lines.stroke(3f - e.fin() * 2f); + Lines.square(e.x, e.y, tilesize / 2f * e.rotation + e.fin() * 3f); + + Angles.randLenVectors(e.id, 3 + (int) (e.rotation * 3), e.rotation * 2f + (tilesize * e.rotation) * e.finpow(), (x, y) -> { + Fill.square(e.x + x, e.y + y, 1f + e.fout() * (3f + e.rotation)); + }); + Draw.reset(); + }); + + select = new Effect(23, e -> { + Draw.color(Palette.accent); + Lines.stroke(e.fout() * 3f); + Lines.circle(e.x, e.y, 3f + e.fin() * 14f); + Draw.reset(); + }); + + smoke = new Effect(100, e -> { + Draw.color(Color.GRAY, Palette.darkishGray, e.fin()); + float size = 7f - e.fin() * 7f; + Draw.rect("circle", e.x, e.y, size, size); + Draw.reset(); + }); + + spawn = new Effect(23, e -> { + Lines.stroke(2f * e.fout()); + Draw.color(Palette.accent); + Lines.poly(e.x, e.y, 4, 3f + e.fin() * 8f); + Draw.reset(); + }); + + vtolHover = new Effect(40f, e -> { + float len = e.finpow() * 10f; + float ang = e.rotation + Mathf.randomSeedRange(e.id, 30f); + Draw.color(Palette.lightFlame, Palette.lightOrange, e.fin()); + Fill.circle(e.x + Angles.trnsx(ang, len), e.y + Angles.trnsy(ang, len), 2f * e.fout()); + Draw.reset(); + }); + + unitDrop = new GroundEffect(30, e -> { + Draw.color(Palette.lightishGray); + Angles.randLenVectors(e.id, 9, 3 + 20f * e.finpow(), (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.4f); + }); + Draw.reset(); + }); + + unitLand = new GroundEffect(30, e -> { + Draw.color(Palette.lightishGray, e.color, e.rotation); + Angles.randLenVectors(e.id, 6, 17f * e.finpow(), (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.3f); + }); + Draw.reset(); + }); + + unitPickup = new GroundEffect(18, e -> { + Draw.color(Palette.lightishGray); + Lines.stroke(e.fin() * 2f); + Lines.poly(e.x, e.y, 4, 13f * e.fout()); + Draw.reset(); + }); + + landShock = new GroundEffect(12, e -> { + Draw.color(Palette.lancerLaser); + Lines.stroke(e.fout() * 3f); + Lines.poly(e.x, e.y, 12, 20f * e.fout()); + Draw.reset(); + }); + + pickup = new Effect(18, e -> { + Draw.color(Palette.lightishGray); + Lines.stroke(e.fout() * 2f); + Lines.spikes(e.x, e.y, 1f + e.fin() * 6f, e.fout() * 4f, 6); + Draw.reset(); + }); + + healWave = new Effect(22, e -> { + Draw.color(Palette.heal); + Lines.stroke(e.fout() * 2f); + Lines.poly(e.x, e.y, 30, 4f + e.finpow() * 60f); + Draw.color(); + }); + + heal = new Effect(11, e -> { + Draw.color(Palette.heal); + Lines.stroke(e.fout() * 2f); + Lines.poly(e.x, e.y, 10, 2f + e.finpow() * 7f); + Draw.color(); + }); + + + hitBulletSmall = new Effect(14, e -> { + Draw.color(Color.WHITE, Palette.lightOrange, e.fin()); + + e.scaled(7f, s -> { + Lines.stroke(0.5f + s.fout()); + Lines.circle(e.x, e.y, s.fin()*5f); + }); + + + Lines.stroke(0.5f + e.fout()); + + Angles.randLenVectors(e.id, 5, e.fin() * 15f, (x, y) -> { + float ang = Mathf.angle(x, y); + Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f); + }); + + Draw.reset(); + }); + + hitFuse = new Effect(14, e -> { + Draw.color(Color.WHITE, Palette.surge, e.fin()); + + e.scaled(7f, s -> { + Lines.stroke(0.5f + s.fout()); + Lines.circle(e.x, e.y, s.fin()*7f); + }); + + + Lines.stroke(0.5f + e.fout()); + + Angles.randLenVectors(e.id, 6, e.fin() * 15f, (x, y) -> { + float ang = Mathf.angle(x, y); + Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f); + }); + + Draw.reset(); + }); + + hitBulletBig = new Effect(13, e -> { + Draw.color(Color.WHITE, Palette.lightOrange, e.fin()); + Lines.stroke(0.5f + e.fout() * 1.5f); + + Angles.randLenVectors(e.id, 8, e.finpow() * 30f, e.rotation, 50f, (x, y) -> { + float ang = Mathf.angle(x, y); + Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1.5f); + }); + + Draw.reset(); + }); + + hitFlameSmall = new Effect(14, e -> { + Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin()); + Lines.stroke(0.5f + e.fout()); + + Angles.randLenVectors(e.id, 5, e.fin() * 15f, e.rotation, 50f, (x, y) -> { + float ang = Mathf.angle(x, y); + Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f); + }); + + Draw.reset(); + }); + + hitLiquid = new Effect(16, e -> { + Draw.color(e.color); + + Angles.randLenVectors(e.id, 5, e.fin() * 15f, e.rotation + 180f, 60f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 2f); + }); + + Draw.reset(); + }); + + hitLancer = new Effect(12, e -> { + Draw.color(Color.WHITE); + Lines.stroke(e.fout() * 1.5f); + + Angles.randLenVectors(e.id, 8, e.finpow() * 17f, e.rotation, 360f, (x, y) -> { + float ang = Mathf.angle(x, y); + Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f); + }); + + Draw.reset(); + }); + + hitMeltdown = new Effect(12, e -> { + Draw.color(Palette.meltdownHit); + Lines.stroke(e.fout() * 2f); + + Angles.randLenVectors(e.id, 6, e.finpow() * 18f, e.rotation, 360f, (x, y) -> { + float ang = Mathf.angle(x, y); + Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f); + }); + + Draw.reset(); + }); + + hitLaser = new Effect(8, e -> { + Draw.color(Color.WHITE, Palette.heal, e.fin()); + Lines.stroke(0.5f + e.fout()); + Lines.circle(e.x, e.y, e.fin()*5f); + Draw.reset(); + }); + + despawn = new Effect(12, e -> { + Draw.color(Palette.lighterOrange, Color.GRAY, e.fin()); + Lines.stroke(e.fout()); + + Angles.randLenVectors(e.id, 7, e.fin() * 7f, e.rotation, 40f, (x, y) -> { + float ang = Mathf.angle(x, y); + Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 2 + 1f); + }); + + Draw.reset(); + }); + + flakExplosion = new Effect(20, e -> { + + Draw.color(Palette.bulletYellow); + e.scaled(6, i -> { + Lines.stroke(3f * i.fout()); + Lines.circle(e.x, e.y, 3f + i.fin() * 10f); + }); + + Draw.color(Color.GRAY); + + Angles.randLenVectors(e.id, 5, 2f + 23f * e.finpow(), (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f); + }); + + Draw.color(Palette.lighterOrange); + Lines.stroke(1f * e.fout()); + + Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> { + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); + }); + + Draw.reset(); + }); + + plasticExplosion = new Effect(24, e -> { + + Draw.color(Palette.plastaniumFront); + e.scaled(7, i -> { + Lines.stroke(3f * i.fout()); + Lines.circle(e.x, e.y, 3f + i.fin() * 24f); + }); + + Draw.color(Color.GRAY); + + Angles.randLenVectors(e.id, 7, 2f + 28f * e.finpow(), (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f); + }); + + Draw.color(Palette.plastaniumBack); + Lines.stroke(1f * e.fout()); + + Angles.randLenVectors(e.id + 1, 4, 1f + 25f * e.finpow(), (x, y) -> { + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); + }); + + Draw.reset(); + }); + + plasticExplosionFlak = new Effect(28, e -> { + + Draw.color(Palette.plastaniumFront); + e.scaled(7, i -> { + Lines.stroke(3f * i.fout()); + Lines.circle(e.x, e.y, 3f + i.fin() * 34f); + }); + + Draw.color(Color.GRAY); + + Angles.randLenVectors(e.id, 7, 2f + 30f * e.finpow(), (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f); + }); + + Draw.color(Palette.plastaniumBack); + Lines.stroke(1f * e.fout()); + + Angles.randLenVectors(e.id + 1, 4, 1f + 30f * e.finpow(), (x, y) -> { + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); + }); + + Draw.reset(); + }); + + blastExplosion = new Effect(22, e -> { + + Draw.color(Palette.missileYellow); + e.scaled(6, i -> { + Lines.stroke(3f * i.fout()); + Lines.circle(e.x, e.y, 3f + i.fin() * 15f); + }); + + Draw.color(Color.GRAY); + + Angles.randLenVectors(e.id, 5, 2f + 23f * e.finpow(), (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f); + }); + + Draw.color(Palette.missileYellowBack); + Lines.stroke(1f * e.fout()); + + Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> { + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); + }); + + Draw.reset(); + }); + + artilleryTrail = new Effect(50, e -> { + Draw.color(e.color); + Fill.circle(e.x, e.y, e.rotation * e.fout()); + Draw.reset(); + }); + + incendTrail = new Effect(50, e -> { + Draw.color(Palette.lightOrange); + Fill.circle(e.x, e.y, e.rotation * e.fout()); + Draw.reset(); + }); + + missileTrail = new Effect(50, e -> { + Draw.color(e.color); + Fill.circle(e.x, e.y, e.rotation * e.fout()); + Draw.reset(); + }); + + absorb = new Effect(12, e -> { + Draw.color(Palette.accent); + Lines.stroke(2f * e.fout()); + Lines.circle(e.x, e.y, 5f * e.fout()); + Draw.reset(); + }); + + flakExplosionBig = new Effect(30, e -> { + + Draw.color(Palette.bulletYellowBack); + e.scaled(6, i -> { + Lines.stroke(3f * i.fout()); + Lines.circle(e.x, e.y, 3f + i.fin() * 25f); + }); + + Draw.color(Color.GRAY); + + Angles.randLenVectors(e.id, 6, 2f + 23f * e.finpow(), (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f); + }); + + Draw.color(Palette.bulletYellow); + Lines.stroke(1f * e.fout()); + + Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> { + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); + }); + + Draw.reset(); + }); + + + burning = new Effect(35f, e -> { + Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin()); + + Angles.randLenVectors(e.id, 3, 2f + e.fin() * 7f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, 0.1f + e.fout() * 1.4f); + }); + + Draw.color(); + }); + + fire = new Effect(35f, e -> { + Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin()); + + Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f); + }); + + Draw.color(); + }); + + fireSmoke = new Effect(35f, e -> { + Draw.color(Color.GRAY); + + Angles.randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f); + }); + + Draw.color(); + }); + + steam = new Effect(35f, e -> { + Draw.color(Color.LIGHT_GRAY); + + Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f); + }); + + Draw.color(); + }); + + fireballsmoke = new Effect(25f, e -> { + Draw.color(Color.GRAY); + + Angles.randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f); + }); + + Draw.color(); + }); + + ballfire = new Effect(25f, e -> { + Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin()); + + Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f); + }); + + Draw.color(); + }); + + freezing = new Effect(40f, e -> { + Draw.color(Liquids.cryofluid.color); + + Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 1.2f); + }); + + Draw.color(); + }); + + melting = new Effect(40f, e -> { + Draw.color(Liquids.lava.color, Color.WHITE, e.fout() / 5f + Mathf.randomSeedRange(e.id, 0.12f)); + + Angles.randLenVectors(e.id, 2, 1f + e.fin() * 3f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, .2f + e.fout() * 1.2f); + }); + + Draw.color(); + }); + + wet = new Effect(40f, e -> { + Draw.color(Liquids.water.color); + + Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 1f); + }); + + Draw.color(); + }); + + oily = new Effect(42f, e -> { + Draw.color(Liquids.oil.color); + + Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 1f); + }); + + Draw.color(); + }); + + overdriven = new Effect(20f, e -> { + Draw.color(Palette.accent); + + Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { + Fill.square(e.x + x, e.y + y, e.fout() * 2.3f+0.5f); + }); + + Draw.color(); + }); + + dropItem = new Effect(20f, e -> { + float length = 20f * e.finpow(); + float size = 7f * e.fout(); + + Draw.rect(((Item) e.data).region, e.x + Angles.trnsx(e.rotation, length), e.y + Angles.trnsy(e.rotation, length), size, size); + }); + + + shockwave = new Effect(10f, 80f, e -> { + Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin()); + Lines.stroke(e.fout() * 2f + 0.2f); + Lines.circle(e.x, e.y, e.fin() * 28f); + Draw.reset(); + }); + + bigShockwave = new Effect(10f, 80f, e -> { + Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin()); + Lines.stroke(e.fout() * 3f); + Lines.circle(e.x, e.y, e.fin() * 50f); + Draw.reset(); + }); + + nuclearShockwave = new Effect(10f, 200f, e -> { + Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin()); + Lines.stroke(e.fout() * 3f + 0.2f); + Lines.poly(e.x, e.y, 40, e.fin() * 140f); + Draw.reset(); + }); + + explosion = new Effect(30, e -> { + e.scaled(7, i -> { + Lines.stroke(3f * i.fout()); + Lines.circle(e.x, e.y, 3f + i.fin() * 10f); + }); + + Draw.color(Color.GRAY); + + Angles.randLenVectors(e.id, 6, 2f + 19f * e.finpow(), (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f); + Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f); + }); + + Draw.color(Palette.lighterOrange, Palette.lightOrange, Color.GRAY, e.fin()); + Lines.stroke(1.5f * e.fout()); + + Angles.randLenVectors(e.id + 1, 8, 1f + 23f * e.finpow(), (x, y) -> { + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); + }); + + Draw.reset(); + }); + + blockExplosion = new Effect(30, e -> { + e.scaled(7, i -> { + Lines.stroke(3.1f * i.fout()); + Lines.circle(e.x, e.y, 3f + i.fin() * 14f); + }); + + Draw.color(Color.GRAY); + + Angles.randLenVectors(e.id, 6, 2f + 19f * e.finpow(), (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f); + Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f); + }); + + Draw.color(Palette.lighterOrange, Palette.lightOrange, Color.GRAY, e.fin()); + Lines.stroke(1.7f * e.fout()); + + Angles.randLenVectors(e.id + 1, 9, 1f + 23f * e.finpow(), (x, y) -> { + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); + }); + + Draw.reset(); + }); + + blockExplosionSmoke = new Effect(30, e -> { + Draw.color(Color.GRAY); + + Angles.randLenVectors(e.id, 6, 4f + 30f * e.finpow(), (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 3f); + Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f); + }); + + Draw.reset(); + }); + + + shootSmall = new Effect(8, e -> { + Draw.color(Palette.lighterOrange, Palette.lightOrange, e.fin()); + float w = 1f + 5 * e.fout(); + Shapes.tri(e.x, e.y, w, 15f * e.fout(), e.rotation); + Shapes.tri(e.x, e.y, w, 3f * e.fout(), e.rotation + 180f); + Draw.reset(); + }); + + shootHeal = new Effect(8, e -> { + Draw.color(Palette.heal); + float w = 1f + 5 * e.fout(); + Shapes.tri(e.x, e.y, w, 17f * e.fout(), e.rotation); + Shapes.tri(e.x, e.y, w, 4f * e.fout(), e.rotation + 180f); + Draw.reset(); + }); + + shootSmallSmoke = new Effect(20f, e -> { + Draw.color(Palette.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin()); + + Angles.randLenVectors(e.id, 5, e.finpow() * 6f, e.rotation, 20f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 1.5f); + }); + + Draw.reset(); + }); + + shootBig = new Effect(9, e -> { + Draw.color(Palette.lighterOrange, Palette.lightOrange, e.fin()); + float w = 1.2f + 7 * e.fout(); + Shapes.tri(e.x, e.y, w, 25f * e.fout(), e.rotation); + Shapes.tri(e.x, e.y, w, 4f * e.fout(), e.rotation + 180f); + Draw.reset(); + }); + + shootBig2 = new Effect(10, e -> { + Draw.color(Palette.lightOrange, Color.GRAY, e.fin()); + float w = 1.2f + 8 * e.fout(); + Shapes.tri(e.x, e.y, w, 29f * e.fout(), e.rotation); + Shapes.tri(e.x, e.y, w, 5f * e.fout(), e.rotation + 180f); + Draw.reset(); + }); + + shootBigSmoke = new Effect(17f, e -> { + Draw.color(Palette.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin()); + + Angles.randLenVectors(e.id, 8, e.finpow() * 19f, e.rotation, 10f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 2f + 0.2f); + }); + + Draw.reset(); + }); + + shootBigSmoke2 = new Effect(18f, e -> { + Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin()); + + Angles.randLenVectors(e.id, 9, e.finpow() * 23f, e.rotation, 20f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 2.4f + 0.2f); + }); + + Draw.reset(); + }); + + shootSmallFlame = new Effect(30f, e -> { + Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, e.fin()); + + Angles.randLenVectors(e.id, 8, e.finpow() * 36f, e.rotation, 10f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.5f); + }); + + Draw.reset(); + }); + + shootLiquid = new Effect(40f, e -> { + Draw.color(e.color, Color.WHITE, e.fout() / 6f + Mathf.randomSeedRange(e.id, 0.1f)); + + Angles.randLenVectors(e.id, 6, e.finpow() * 60f, e.rotation, 11f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, 0.5f + e.fout() * 2.5f); + }); + + Draw.reset(); + }); + + shellEjectSmall = new GroundEffect(30f, 400f, e -> { + Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin()); + float rot = Math.abs(e.rotation) + 90f; + + int i = Mathf.sign(e.rotation); + + float len = (2f + e.finpow() * 6f) * i; + float lr = rot + e.fin() * 30f * i; + Fill.rect(e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()), + e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()), + 1f, 2f, rot + e.fin() * 50f * i); + + Draw.color(); + }); + + shellEjectMedium = new GroundEffect(34f, 400f, e -> { + Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin()); + float rot = e.rotation + 90f; + for(int i : Mathf.signs){ + float len = (2f + e.finpow() * 10f) * i; + float lr = rot + e.fin() * 20f * i; + Draw.rect(Core.atlas.find("casing"), + e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()), + e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()), + 2f, 3f, rot); + } + + Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin()); + + for(int i : Mathf.signs){ + Angles.randLenVectors(e.id, 4, 1f + e.finpow() * 11f, e.rotation + 90f * i, 20f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 1.5f); + }); + } + + Draw.color(); + }); + + shellEjectBig = new GroundEffect(22f, 400f, e -> { + Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin()); + float rot = e.rotation + 90f; + for(int i : Mathf.signs){ + float len = (4f + e.finpow() * 8f) * i; + float lr = rot + Mathf.randomSeedRange(e.id + i + 6, 20f * e.fin()) * i; + Draw.rect(Core.atlas.find("casing"), + e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()), + e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()), + 2.5f, 4f, + rot + e.fin() * 30f * i + Mathf.randomSeedRange(e.id + i + 9, 40f * e.fin())); + } + + Draw.color(Color.LIGHT_GRAY); + + for(int i : Mathf.signs){ + Angles.randLenVectors(e.id, 4, -e.finpow() * 15f, e.rotation + 90f * i, 25f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 2f); + }); + } + + Draw.color(); + }); + + lancerLaserShoot = new Effect(21f, e -> { + Draw.color(Palette.lancerLaser); + + for(int i : Mathf.signs){ + Shapes.tri(e.x, e.y, 4f * e.fout(), 29f, e.rotation + 90f * i); + } + + Draw.reset(); + }); + + lancerLaserShootSmoke = new Effect(26f, e -> { + Draw.color(Palette.lancerLaser); + + Angles.randLenVectors(e.id, 7, 80f, e.rotation, 0f, (x, y) -> { + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fout() * 9f); + }); + + Draw.reset(); + }); + + lancerLaserCharge = new Effect(38f, e -> { + Draw.color(Palette.lancerLaser); + + Angles.randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> { + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 3f + 1f); + }); + + Draw.reset(); + }); + + lancerLaserChargeBegin = new Effect(71f, e -> { + Draw.color(Palette.lancerLaser); + Fill.circle(e.x, e.y, e.fin() * 3f); + + Draw.color(); + Fill.circle(e.x, e.y, e.fin() * 2f); + }); + + lightningCharge = new Effect(38f, e -> { + Draw.color(Palette.lancerLaser); + + Angles.randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> { + Shapes.tri(e.x + x, e.y + y, e.fslope() * 3f + 1, e.fslope() * 3f + 1, Mathf.angle(x, y)); + }); + + Draw.reset(); + }); + + lightningShoot = new Effect(12f, e -> { + Draw.color(Color.WHITE, Palette.lancerLaser, e.fin()); + Lines.stroke(e.fout() * 1.2f + 0.5f); + + Angles.randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 50f, (x, y) -> { + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 5f + 2f); + }); + + Draw.reset(); + }); + + + reactorsmoke = new Effect(17, e -> { + Angles.randLenVectors(e.id, 4, e.fin() * 8f, (x, y) -> { + float size = 1f + e.fout() * 5f; + Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin()); + Draw.rect("circle", e.x + x, e.y + y, size, size); + Draw.reset(); + }); + }); + nuclearsmoke = new Effect(40, e -> { + Angles.randLenVectors(e.id, 4, e.fin() * 13f, (x, y) -> { + float size = e.fslope() * 4f; + Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin()); + Draw.rect("circle", e.x + x, e.y + y, size, size); + Draw.reset(); + }); + }); + nuclearcloud = new Effect(90, 200f, e -> { + Angles.randLenVectors(e.id, 10, e.finpow() * 90f, (x, y) -> { + float size = e.fout() * 14f; + Draw.color(Color.LIME, Color.GRAY, e.fin()); + Draw.rect("circle", e.x + x, e.y + y, size, size); + Draw.reset(); + }); + }); + redgeneratespark = new Effect(18, e -> { + Angles.randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> { + float len = e.fout() * 4f; + Draw.color(Palette.redSpark, Color.GRAY, e.fin()); + //Draw.alpha(e.fout()); + Draw.rect("circle", e.x + x, e.y + y, len, len); + Draw.reset(); + }); + }); + generatespark = new Effect(18, e -> { + Angles.randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> { + float len = e.fout() * 4f; + Draw.color(Palette.orangeSpark, Color.GRAY, e.fin()); + Draw.rect("circle", e.x + x, e.y + y, len, len); + Draw.reset(); + }); + }); + fuelburn = new Effect(23, e -> { + Angles.randLenVectors(e.id, 5, e.fin() * 9f, (x, y) -> { + float len = e.fout() * 4f; + Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin()); + Draw.rect("circle", e.x + x, e.y + y, len, len); + Draw.reset(); + }); + }); + plasticburn = new Effect(40, e -> { + Angles.randLenVectors(e.id, 5, 3f + e.fin() * 5f, (x, y) -> { + Draw.color(Color.valueOf("e9ead3"), Color.GRAY, e.fin()); + Fill.circle(e.x + x, e.y + y, e.fout() * 1f); + Draw.reset(); + }); + }); + pulverize = new Effect(40, e -> { + Angles.randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { + Draw.color(Palette.stoneGray); + Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45); + Draw.reset(); + }); + }); + pulverizeRed = new Effect(40, e -> { + Angles.randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { + Draw.color(Palette.redDust, Palette.stoneGray, e.fin()); + Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45); + Draw.reset(); + }); + }); + pulverizeRedder = new Effect(40, e -> { + Angles.randLenVectors(e.id, 5, 3f + e.fin() * 9f, (x, y) -> { + Draw.color(Palette.redderDust, Palette.stoneGray, e.fin()); + Fill.square(e.x + x, e.y + y, e.fout() * 2.5f + 0.5f, 45); + Draw.reset(); + }); + }); + pulverizeSmall = new Effect(30, e -> { + Angles.randLenVectors(e.id, 3, e.fin() * 5f, (x, y) -> { + Draw.color(Palette.stoneGray); + Fill.square(e.x + x, e.y + y, e.fout() * 1f + 0.5f, 45); + Draw.reset(); + }); + }); + pulverizeMedium = new Effect(30, e -> { + Angles.randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { + Draw.color(Palette.stoneGray); + Fill.square(e.x + x, e.y + y, e.fout() * 1f + 0.5f, 45); + Draw.reset(); + }); + }); + producesmoke = new Effect(12, e -> { + Angles.randLenVectors(e.id, 8, 4f + e.fin() * 18f, (x, y) -> { + Draw.color(Color.WHITE, Palette.accent, e.fin()); + Fill.square(e.x + x, e.y + y, 1f + e.fout() * 3f, 45); + Draw.reset(); + }); + }); + smeltsmoke = new Effect(15, e -> { + Angles.randLenVectors(e.id, 6, 4f + e.fin() * 5f, (x, y) -> { + Draw.color(Color.WHITE, e.color, e.fin()); + Fill.square(e.x + x, e.y + y, 0.5f + e.fout() * 2f, 45); + Draw.reset(); + }); + }); + formsmoke = new Effect(40, e -> { + Angles.randLenVectors(e.id, 6, 5f + e.fin() * 8f, (x, y) -> { + Draw.color(Palette.plasticSmoke, Color.LIGHT_GRAY, e.fin()); + Fill.square(e.x + x, e.y + y, 0.2f + e.fout() * 2f, 45); + Draw.reset(); + }); + }); + blastsmoke = new Effect(26, e -> { + Angles.randLenVectors(e.id, 12, 1f + e.fin() * 23f, (x, y) -> { + float size = 2f + e.fout() * 6f; + Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.fin()); + Draw.rect("circle", e.x + x, e.y + y, size, size); + Draw.reset(); + }); + }); + lava = new Effect(18, e -> { + Angles.randLenVectors(e.id, 3, 1f + e.fin() * 10f, (x, y) -> { + float size = e.fslope() * 4f; + Draw.color(Color.ORANGE, Color.GRAY, e.fin()); + Draw.rect("circle", e.x + x, e.y + y, size, size); + Draw.reset(); + }); + }); + dooropen = new Effect(10, e -> { + Lines.stroke(e.fout() * 1.6f); + Lines.square(e.x, e.y, tilesize / 2f + e.fin() * 2f); + Draw.reset(); + }); + doorclose = new Effect(10, e -> { + Lines.stroke(e.fout() * 1.6f); + Lines.square(e.x, e.y, tilesize / 2f + e.fout() * 2f); + Draw.reset(); + }); + dooropenlarge = new Effect(10, e -> { + Lines.stroke(e.fout() * 1.6f); + Lines.square(e.x, e.y, tilesize + e.fin() * 2f); + Draw.reset(); + }); + doorcloselarge = new Effect(10, e -> { + Lines.stroke(e.fout() * 1.6f); + Lines.square(e.x, e.y, tilesize + e.fout() * 2f); + Draw.reset(); + }); + purify = new Effect(10, e -> { + Draw.color(Color.ROYAL, Color.GRAY, e.fin()); + Lines.stroke(2f); + Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6); + Draw.reset(); + }); + purifyoil = new Effect(10, e -> { + Draw.color(Color.BLACK, Color.GRAY, e.fin()); + Lines.stroke(2f); + Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6); + Draw.reset(); + }); + purifystone = new Effect(10, e -> { + Draw.color(Color.ORANGE, Color.GRAY, e.fin()); + Lines.stroke(2f); + Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6); + Draw.reset(); + }); + generate = new Effect(11, e -> { + Draw.color(Color.ORANGE, Color.YELLOW, e.fin()); + Lines.stroke(1f); + Lines.spikes(e.x, e.y, e.fin() * 5f, 2, 8); + Draw.reset(); + }); + mine = new Effect(20, e -> { + Angles.randLenVectors(e.id, 6, 3f + e.fin() * 6f, (x, y) -> { + Draw.color(e.color, Color.LIGHT_GRAY, e.fin()); + Fill.square(e.x + x, e.y + y, e.fout() * 2f, 45); + Draw.reset(); + }); + }); + mineBig = new Effect(30, e -> { + Angles.randLenVectors(e.id, 6, 4f + e.fin() * 8f, (x, y) -> { + Draw.color(e.color, Color.LIGHT_GRAY, e.fin()); + Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.2f, 45); + Draw.reset(); + }); + }); + mineHuge = new Effect(40, e -> { + Angles.randLenVectors(e.id, 8, 5f + e.fin() * 10f, (x, y) -> { + Draw.color(e.color, Color.LIGHT_GRAY, e.fin()); + Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45); + Draw.reset(); + }); + }); + smelt = new Effect(20, e -> { + Angles.randLenVectors(e.id, 6, 2f + e.fin() * 5f, (x, y) -> { + Draw.color(Color.WHITE, e.color, e.fin()); + Fill.square(e.x + x, e.y + y, 0.5f + e.fout() * 2f, 45); + Draw.reset(); + }); + }); + teleportActivate = new Effect(50, e -> { + Draw.color(e.color); + + e.scaled(8f, e2 -> { + Lines.stroke(e2.fout() * 4f); + Lines.circle(e2.x, e2.y, 4f + e2.fin() * 27f); + }); + + Lines.stroke(e.fout() * 2f); + + Angles.randLenVectors(e.id, 30, 4f + 40f * e.fin(), (x, y) -> { + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f); + }); + + Draw.reset(); + }); + teleport = new Effect(60, e -> { + Draw.color(e.color); + Lines.stroke(e.fin() * 2f); + Lines.circle(e.x, e.y, 7f + e.fout() * 8f); + + Angles.randLenVectors(e.id, 20, 6f + 20f * e.fout(), (x, y) -> { + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f); + }); + + Draw.reset(); + }); + teleportOut = new Effect(20, e -> { + Draw.color(e.color); + Lines.stroke(e.fout() * 2f); + Lines.circle(e.x, e.y, 7f + e.fin() * 8f); + + Angles.randLenVectors(e.id, 20, 4f + 20f * e.fin(), (x, y) -> { + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 4f + 1f); + }); + + Draw.reset(); + }); + ripple = new GroundEffect(false, 30, e -> { + Draw.color(Tmp.c1.set(e.color).shiftValue(0.1f)); + Lines.stroke(e.fout() + 0.4f); + Lines.circle(e.x, e.y, 2f + e.fin() * 4f); + Draw.reset(); + }); + + bubble = new Effect(20, e -> { + Draw.color(Tmp.c1.set(e.color).shiftValue(0.1f)); + Lines.stroke(e.fout() + 0.2f); + Angles.randLenVectors(e.id, 2, 8f, (x, y) -> { + Lines.circle(e.x + x, e.y + y, 1f + e.fin() * 3f); + }); + Draw.reset(); + }); + + commandSend = new Effect(28, e -> { + Draw.color(Palette.command); + Lines.stroke(e.fout() * 2f); + Lines.poly(e.x, e.y, 40, 4f + e.finpow() * 120f); + Draw.color(); + }); + + healWaveMend = new Effect(40, e -> { + Draw.color(e.color); + Lines.stroke(e.fout() * 2f); + Lines.poly(e.x, e.y, 30, e.finpow() * e.rotation); + Draw.color(); + }); + + overdriveWave = new Effect(50, e -> { + Draw.color(e.color); + Lines.stroke(e.fout() * 1f); + Lines.poly(e.x, e.y, 30, e.finpow() * e.rotation); + Draw.color(); + }); + + healBlock = new Effect(20, e -> { + Draw.color(Palette.heal); + Lines.stroke(2f * e.fout() + 0.5f); + Lines.square(e.x, e.y, 1f + (e.fin() * e.rotation * tilesize/2f-1f)); + Draw.color(); + }); + + healBlockFull = new Effect(20, e -> { + Draw.color(e.color); + Draw.alpha(e.fout()); + Fill.square(e.x, e.y, e.rotation * tilesize / 2f); + Draw.color(); + }); + + overdriveBlockFull = new Effect(60, e -> { + Draw.color(e.color); + Draw.alpha(e.fslope() * 0.4f); + Fill.square(e.x, e.y, e.rotation * tilesize); + Draw.color(); + }); + + shieldBreak = new Effect(40, e -> { + Draw.color(Palette.accent); + Lines.stroke(3f * e.fout()); + Lines.poly(e.x, e.y, 6, e.rotation + e.fin(), 90); + Draw.reset(); + }); + } +} diff --git a/core/src/io/anuke/mindustry/content/Items.java b/core/src/io/anuke/mindustry/content/Items.java index 8879f460ef..0e67c8e5a0 100644 --- a/core/src/io/anuke/mindustry/content/Items.java +++ b/core/src/io/anuke/mindustry/content/Items.java @@ -2,7 +2,6 @@ package io.anuke.mindustry.content; import io.anuke.arc.graphics.Color; import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.ItemType; @@ -101,9 +100,4 @@ public class Items implements ContentList{ explosiveness = 0.2f; }}; } - - @Override - public ContentType type(){ - return ContentType.item; - } } diff --git a/core/src/io/anuke/mindustry/content/Liquids.java b/core/src/io/anuke/mindustry/content/Liquids.java index c366b4a79a..6219f46626 100644 --- a/core/src/io/anuke/mindustry/content/Liquids.java +++ b/core/src/io/anuke/mindustry/content/Liquids.java @@ -2,7 +2,6 @@ package io.anuke.mindustry.content; import io.anuke.arc.graphics.Color; import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.Liquid; public class Liquids implements ContentList{ @@ -47,9 +46,4 @@ public class Liquids implements ContentList{ effect = StatusEffects.freezing; }}; } - - @Override - public ContentType type(){ - return ContentType.liquid; - } } diff --git a/core/src/io/anuke/mindustry/content/Mechs.java b/core/src/io/anuke/mindustry/content/Mechs.java index bb3f266f65..9124d484d3 100644 --- a/core/src/io/anuke/mindustry/content/Mechs.java +++ b/core/src/io/anuke/mindustry/content/Mechs.java @@ -9,15 +9,12 @@ import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.math.Mathf; import io.anuke.arc.math.geom.Rectangle; import io.anuke.arc.util.Time; -import io.anuke.mindustry.content.fx.BulletFx; -import io.anuke.mindustry.content.fx.UnitFx; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.effect.Lightning; import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.graphics.Shaders; -import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.Mech; public class Mechs implements ContentList{ @@ -68,7 +65,7 @@ public class Mechs implements ContentList{ public void onLand(Player player){ if(player.timer.get(Player.timerAbility, cooldown)){ Effects.shake(1f, 1f, player); - Effects.effect(UnitFx.landShock, player); + Effects.effect(Fx.landShock, player); for(int i = 0; i < 8; i++){ Time.run(Mathf.random(8f), () -> Lightning.create(player.getTeam(), Palette.lancerLaser, 17f, player.x, player.y, Mathf.random(360f), 14)); } @@ -109,7 +106,7 @@ public class Mechs implements ContentList{ Units.getNearby(player.getTeam(), rect, unit -> { if(unit.dst(player) <= healRange){ if(unit.health < unit.maxHealth()){ - Effects.effect(UnitFx.heal, unit); + Effects.effect(Fx.heal, unit); wasHealed = true; } unit.healBy(healAmount); @@ -117,7 +114,7 @@ public class Mechs implements ContentList{ }); if(wasHealed){ - Effects.effect(UnitFx.healWave, player); + Effects.effect(Fx.healWave, player); } } } @@ -160,7 +157,7 @@ public class Mechs implements ContentList{ @Override public void updateAlt(Player player){ float scl = 1f - player.shootHeat/2f; - player.getVelocity().scl(scl); + player.velocity().scl(scl); } @Override @@ -228,9 +225,9 @@ public class Mechs implements ContentList{ public void updateAlt(Player player){ float scl = scld(player); if(Mathf.chance(Time.delta() * (0.15*scl))){ - Effects.effect(BulletFx.hitLancer, Palette.lancerLaser, player.x, player.y); + Effects.effect(Fx.hitLancer, Palette.lancerLaser, player.x, player.y); Lightning.create(player.getTeam(), Palette.lancerLaser, 10f, - player.x + player.getVelocity().x, player.y + player.getVelocity().y, player.rotation, 14); + player.x + player.velocity().x, player.y + player.velocity().y, player.rotation, 14); } } @@ -251,7 +248,7 @@ public class Mechs implements ContentList{ } float scld(Player player){ - return Mathf.clamp((player.getVelocity().len() - minV) / (maxV - minV)); + return Mathf.clamp((player.velocity().len() - minV) / (maxV - minV)); } }; @@ -271,7 +268,7 @@ public class Mechs implements ContentList{ @Override public boolean canShoot(Player player){ - return player.getVelocity().len() > 1.2f; + return player.velocity().len() > 1.2f; } }; @@ -293,9 +290,4 @@ public class Mechs implements ContentList{ starterDesktop = alpha; starterMobile = dart; } - - @Override - public ContentType type(){ - return ContentType.mech; - } } diff --git a/core/src/io/anuke/mindustry/content/Recipes.java b/core/src/io/anuke/mindustry/content/Recipes.java index 91a6f52f1d..f0d86e9214 100644 --- a/core/src/io/anuke/mindustry/content/Recipes.java +++ b/core/src/io/anuke/mindustry/content/Recipes.java @@ -1,9 +1,7 @@ package io.anuke.mindustry.content; -import io.anuke.mindustry.content.blocks.*; import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.game.GameMode; -import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.ItemStack; import io.anuke.mindustry.type.Recipe; import io.anuke.mindustry.type.Recipe.RecipeVisibility; @@ -15,179 +13,174 @@ public class Recipes implements ContentList{ @Override public void load(){ //DEBUG - new Recipe(distribution, DebugBlocks.itemSource).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true); - new Recipe(distribution, DebugBlocks.itemVoid).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true); - new Recipe(liquid, DebugBlocks.liquidSource).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true); - new Recipe(power, DebugBlocks.powerVoid).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true); - new Recipe(power, DebugBlocks.powerInfinite).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true); + new Recipe(distribution, Blocks.itemSource).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true); + new Recipe(distribution, Blocks.itemVoid).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true); + new Recipe(liquid, Blocks.liquidSource).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true); + new Recipe(power, Blocks.powerVoid).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true); + new Recipe(power, Blocks.powerSource).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true); //DEFENSE //walls - new Recipe(defense, DefenseBlocks.copperWall, new ItemStack(Items.copper, 12)).setAlwaysUnlocked(true); - new Recipe(defense, DefenseBlocks.copperWallLarge, new ItemStack(Items.copper, 12 * 4)).setAlwaysUnlocked(true); + new Recipe(defense, Blocks.copperWall, new ItemStack(Items.copper, 12)).setAlwaysUnlocked(true); + new Recipe(defense, Blocks.copperWallLarge, new ItemStack(Items.copper, 12 * 4)).setAlwaysUnlocked(true); - new Recipe(defense, DefenseBlocks.denseAlloyWall, new ItemStack(Items.titanium, 12)); - new Recipe(defense, DefenseBlocks.denseAlloyWallLarge, new ItemStack(Items.titanium, 12 * 4)); + new Recipe(defense, Blocks.denseAlloyWall, new ItemStack(Items.titanium, 12)); + new Recipe(defense, Blocks.denseAlloyWallLarge, new ItemStack(Items.titanium, 12 * 4)); - new Recipe(defense, DefenseBlocks.door, new ItemStack(Items.titanium, 12), new ItemStack(Items.silicon, 8)); - new Recipe(defense, DefenseBlocks.doorLarge, new ItemStack(Items.titanium, 12 * 4), new ItemStack(Items.silicon, 8 * 4)); + new Recipe(defense, Blocks.door, new ItemStack(Items.titanium, 12), new ItemStack(Items.silicon, 8)); + new Recipe(defense, Blocks.doorLarge, new ItemStack(Items.titanium, 12 * 4), new ItemStack(Items.silicon, 8 * 4)); - new Recipe(defense, DefenseBlocks.thoriumWall, new ItemStack(Items.thorium, 12)); - new Recipe(defense, DefenseBlocks.thoriumWallLarge, new ItemStack(Items.thorium, 12 * 4)); + new Recipe(defense, Blocks.thoriumWall, new ItemStack(Items.thorium, 12)); + new Recipe(defense, Blocks.thoriumWallLarge, new ItemStack(Items.thorium, 12 * 4)); - new Recipe(defense, DefenseBlocks.phaseWall, new ItemStack(Items.phasefabric, 12)); - new Recipe(defense, DefenseBlocks.phaseWallLarge, new ItemStack(Items.phasefabric, 12 * 4)); + new Recipe(defense, Blocks.phaseWall, new ItemStack(Items.phasefabric, 12)); + new Recipe(defense, Blocks.phaseWallLarge, new ItemStack(Items.phasefabric, 12 * 4)); - new Recipe(defense, DefenseBlocks.surgeWall, new ItemStack(Items.surgealloy, 12)); - new Recipe(defense, DefenseBlocks.surgeWallLarge, new ItemStack(Items.surgealloy, 12 * 4)); + new Recipe(defense, Blocks.surgeWall, new ItemStack(Items.surgealloy, 12)); + new Recipe(defense, Blocks.surgeWallLarge, new ItemStack(Items.surgealloy, 12 * 4)); - new Recipe(effect, StorageBlocks.container, new ItemStack(Items.titanium, 200)); - new Recipe(effect, StorageBlocks.vault, new ItemStack(Items.titanium, 500), new ItemStack(Items.thorium, 250)); + new Recipe(effect, Blocks.container, new ItemStack(Items.titanium, 200)); + new Recipe(effect, Blocks.vault, new ItemStack(Items.titanium, 500), new ItemStack(Items.thorium, 250)); - new Recipe(effect, StorageBlocks.core, + new Recipe(effect, Blocks.core, new ItemStack(Items.copper, 2000), new ItemStack(Items.titanium, 2000), new ItemStack(Items.silicon, 1750), new ItemStack(Items.thorium, 1000), new ItemStack(Items.surgealloy, 500), new ItemStack(Items.phasefabric, 750) ); //projectors - new Recipe(effect, DefenseBlocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.titanium, 150), new ItemStack(Items.titanium, 50), new ItemStack(Items.silicon, 180)); - new Recipe(effect, DefenseBlocks.overdriveProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.titanium, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250)); - new Recipe(effect, DefenseBlocks.forceProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.titanium, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250)); + new Recipe(effect, Blocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.titanium, 150), new ItemStack(Items.titanium, 50), new ItemStack(Items.silicon, 180)); + new Recipe(effect, Blocks.overdriveProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.titanium, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250)); + new Recipe(effect, Blocks.forceProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.titanium, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250)); - new Recipe(effect, DefenseBlocks.shockMine, new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 25)); + new Recipe(effect, Blocks.shockMine, new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 25)); //TURRETS - new Recipe(turret, TurretBlocks.duo, new ItemStack(Items.copper, 40)).setAlwaysUnlocked(true); - new Recipe(turret, TurretBlocks.arc, new ItemStack(Items.copper, 50), new ItemStack(Items.lead, 30), new ItemStack(Items.silicon, 20)); - new Recipe(turret, TurretBlocks.hail, new ItemStack(Items.copper, 60), new ItemStack(Items.graphite, 35)); - new Recipe(turret, TurretBlocks.lancer, new ItemStack(Items.copper, 50), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 90)); - new Recipe(turret, TurretBlocks.wave, new ItemStack(Items.titanium, 70), new ItemStack(Items.lead, 150)); - new Recipe(turret, TurretBlocks.salvo, new ItemStack(Items.copper, 210), new ItemStack(Items.graphite, 190), new ItemStack(Items.thorium, 130)); - new Recipe(turret, TurretBlocks.swarmer, new ItemStack(Items.graphite, 70), new ItemStack(Items.titanium, 70), new ItemStack(Items.plastanium, 90), new ItemStack(Items.silicon, 60)); - new Recipe(turret, TurretBlocks.ripple, new ItemStack(Items.copper, 300), new ItemStack(Items.graphite, 220), new ItemStack(Items.thorium, 120)); - new Recipe(turret, TurretBlocks.cyclone, new ItemStack(Items.copper, 400), new ItemStack(Items.surgealloy, 200), new ItemStack(Items.plastanium, 150)); - new Recipe(turret, TurretBlocks.fuse, new ItemStack(Items.copper, 450), new ItemStack(Items.graphite, 450), new ItemStack(Items.surgealloy, 250)); - new Recipe(turret, TurretBlocks.spectre, new ItemStack(Items.copper, 700), new ItemStack(Items.graphite, 600), new ItemStack(Items.surgealloy, 500), new ItemStack(Items.plastanium, 350), new ItemStack(Items.thorium, 500)); - new Recipe(turret, TurretBlocks.meltdown, new ItemStack(Items.copper, 500), new ItemStack(Items.lead, 700), new ItemStack(Items.graphite, 600), new ItemStack(Items.surgealloy, 650), new ItemStack(Items.silicon, 650)); + new Recipe(turret, Blocks.duo, new ItemStack(Items.copper, 40)).setAlwaysUnlocked(true); + new Recipe(turret, Blocks.arc, new ItemStack(Items.copper, 50), new ItemStack(Items.lead, 30), new ItemStack(Items.silicon, 20)); + new Recipe(turret, Blocks.hail, new ItemStack(Items.copper, 60), new ItemStack(Items.graphite, 35)); + new Recipe(turret, Blocks.lancer, new ItemStack(Items.copper, 50), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 90)); + new Recipe(turret, Blocks.wave, new ItemStack(Items.titanium, 70), new ItemStack(Items.lead, 150)); + new Recipe(turret, Blocks.salvo, new ItemStack(Items.copper, 210), new ItemStack(Items.graphite, 190), new ItemStack(Items.thorium, 130)); + new Recipe(turret, Blocks.swarmer, new ItemStack(Items.graphite, 70), new ItemStack(Items.titanium, 70), new ItemStack(Items.plastanium, 90), new ItemStack(Items.silicon, 60)); + new Recipe(turret, Blocks.ripple, new ItemStack(Items.copper, 300), new ItemStack(Items.graphite, 220), new ItemStack(Items.thorium, 120)); + new Recipe(turret, Blocks.cyclone, new ItemStack(Items.copper, 400), new ItemStack(Items.surgealloy, 200), new ItemStack(Items.plastanium, 150)); + new Recipe(turret, Blocks.fuse, new ItemStack(Items.copper, 450), new ItemStack(Items.graphite, 450), new ItemStack(Items.surgealloy, 250)); + new Recipe(turret, Blocks.spectre, new ItemStack(Items.copper, 700), new ItemStack(Items.graphite, 600), new ItemStack(Items.surgealloy, 500), new ItemStack(Items.plastanium, 350), new ItemStack(Items.thorium, 500)); + new Recipe(turret, Blocks.meltdown, new ItemStack(Items.copper, 500), new ItemStack(Items.lead, 700), new ItemStack(Items.graphite, 600), new ItemStack(Items.surgealloy, 650), new ItemStack(Items.silicon, 650)); //DISTRIBUTION - new Recipe(distribution, DistributionBlocks.conveyor, new ItemStack(Items.copper, 1)).setAlwaysUnlocked(true); - new Recipe(distribution, DistributionBlocks.titaniumconveyor, new ItemStack(Items.copper, 2), new ItemStack(Items.titanium, 1)); - new Recipe(distribution, DistributionBlocks.phaseConveyor, new ItemStack(Items.phasefabric, 10), new ItemStack(Items.silicon, 15), new ItemStack(Items.lead, 20), new ItemStack(Items.densealloy, 20)); + new Recipe(distribution, Blocks.conveyor, new ItemStack(Items.copper, 1)).setAlwaysUnlocked(true); + new Recipe(distribution, Blocks.titaniumconveyor, new ItemStack(Items.copper, 2), new ItemStack(Items.titanium, 1)); + new Recipe(distribution, Blocks.phaseConveyor, new ItemStack(Items.phasefabric, 10), new ItemStack(Items.silicon, 15), new ItemStack(Items.lead, 20), new ItemStack(Items.graphite, 20)); //starter transport - new Recipe(distribution, DistributionBlocks.junction, new ItemStack(Items.copper, 2)).setAlwaysUnlocked(true); - new Recipe(distribution, DistributionBlocks.router, new ItemStack(Items.copper, 6)).setAlwaysUnlocked(true); + new Recipe(distribution, Blocks.junction, new ItemStack(Items.copper, 2)).setAlwaysUnlocked(true); + new Recipe(distribution, Blocks.router, new ItemStack(Items.copper, 6)).setAlwaysUnlocked(true); //more advanced transport - new Recipe(distribution, DistributionBlocks.distributor, new ItemStack(Items.titanium, 8), new ItemStack(Items.copper, 8)); - new Recipe(distribution, DistributionBlocks.sorter, new ItemStack(Items.titanium, 4), new ItemStack(Items.copper, 4)); - new Recipe(distribution, DistributionBlocks.overflowGate, new ItemStack(Items.titanium, 4), new ItemStack(Items.copper, 8)); - new Recipe(distribution, DistributionBlocks.itemBridge, new ItemStack(Items.titanium, 8), new ItemStack(Items.copper, 8)); - new Recipe(distribution, StorageBlocks.unloader, new ItemStack(Items.titanium, 50), new ItemStack(Items.silicon, 60)); - new Recipe(distribution, DistributionBlocks.massDriver, new ItemStack(Items.titanium, 250), new ItemStack(Items.silicon, 150), new ItemStack(Items.lead, 250), new ItemStack(Items.thorium, 100)); + new Recipe(distribution, Blocks.distributor, new ItemStack(Items.titanium, 8), new ItemStack(Items.copper, 8)); + new Recipe(distribution, Blocks.sorter, new ItemStack(Items.titanium, 4), new ItemStack(Items.copper, 4)); + new Recipe(distribution, Blocks.overflowGate, new ItemStack(Items.titanium, 4), new ItemStack(Items.copper, 8)); + new Recipe(distribution, Blocks.itemBridge, new ItemStack(Items.titanium, 8), new ItemStack(Items.copper, 8)); + new Recipe(distribution, Blocks.unloader, new ItemStack(Items.titanium, 50), new ItemStack(Items.silicon, 60)); + new Recipe(distribution, Blocks.massDriver, new ItemStack(Items.titanium, 250), new ItemStack(Items.silicon, 150), new ItemStack(Items.lead, 250), new ItemStack(Items.thorium, 100)); //CRAFTING //smelting - new Recipe(crafting, CraftingBlocks.siliconSmelter, new ItemStack(Items.copper, 60), new ItemStack(Items.lead, 50)); + new Recipe(crafting, Blocks.siliconSmelter, new ItemStack(Items.copper, 60), new ItemStack(Items.lead, 50)); //advanced fabrication - new Recipe(crafting, CraftingBlocks.plastaniumCompressor, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 230), new ItemStack(Items.graphite, 120), new ItemStack(Items.titanium, 160)); - new Recipe(crafting, CraftingBlocks.phaseWeaver, new ItemStack(Items.silicon, 260), new ItemStack(Items.lead, 240), new ItemStack(Items.thorium, 150)); - new Recipe(crafting, CraftingBlocks.surgeSmelter, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 160), new ItemStack(Items.thorium, 140)); + new Recipe(crafting, Blocks.plastaniumCompressor, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 230), new ItemStack(Items.graphite, 120), new ItemStack(Items.titanium, 160)); + new Recipe(crafting, Blocks.phaseWeaver, new ItemStack(Items.silicon, 260), new ItemStack(Items.lead, 240), new ItemStack(Items.thorium, 150)); + new Recipe(crafting, Blocks.surgeSmelter, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 160), new ItemStack(Items.thorium, 140)); //misc - new Recipe(crafting, CraftingBlocks.pulverizer, new ItemStack(Items.copper, 60), new ItemStack(Items.lead, 50)); - new Recipe(crafting, CraftingBlocks.pyratiteMixer, new ItemStack(Items.copper, 100), new ItemStack(Items.lead, 50)); - new Recipe(crafting, CraftingBlocks.blastMixer, new ItemStack(Items.lead, 60), new ItemStack(Items.titanium, 40)); - new Recipe(crafting, CraftingBlocks.cryofluidmixer, new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 80), new ItemStack(Items.thorium, 90)); + new Recipe(crafting, Blocks.pulverizer, new ItemStack(Items.copper, 60), new ItemStack(Items.lead, 50)); + new Recipe(crafting, Blocks.pyratiteMixer, new ItemStack(Items.copper, 100), new ItemStack(Items.lead, 50)); + new Recipe(crafting, Blocks.blastMixer, new ItemStack(Items.lead, 60), new ItemStack(Items.titanium, 40)); + new Recipe(crafting, Blocks.cryofluidmixer, new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 80), new ItemStack(Items.thorium, 90)); - new Recipe(crafting, CraftingBlocks.melter, new ItemStack(Items.copper, 60), new ItemStack(Items.lead, 70), new ItemStack(Items.graphite, 90)); - new Recipe(crafting, CraftingBlocks.incinerator, new ItemStack(Items.graphite, 10), new ItemStack(Items.lead, 30)); + new Recipe(crafting, Blocks.melter, new ItemStack(Items.copper, 60), new ItemStack(Items.lead, 70), new ItemStack(Items.graphite, 90)); + new Recipe(crafting, Blocks.incinerator, new ItemStack(Items.graphite, 10), new ItemStack(Items.lead, 30)); //processing - new Recipe(crafting, CraftingBlocks.biomatterCompressor, new ItemStack(Items.lead, 70), new ItemStack(Items.silicon, 60)); - new Recipe(crafting, CraftingBlocks.separator, new ItemStack(Items.copper, 60), new ItemStack(Items.titanium, 50)); + new Recipe(crafting, Blocks.biomatterCompressor, new ItemStack(Items.lead, 70), new ItemStack(Items.silicon, 60)); + new Recipe(crafting, Blocks.separator, new ItemStack(Items.copper, 60), new ItemStack(Items.titanium, 50)); //POWER - new Recipe(power, PowerBlocks.powerNode, new ItemStack(Items.copper, 2), new ItemStack(Items.lead, 6)); - new Recipe(power, PowerBlocks.powerNodeLarge, new ItemStack(Items.titanium, 10), new ItemStack(Items.lead, 20), new ItemStack(Items.silicon, 6)); - new Recipe(power, PowerBlocks.battery, new ItemStack(Items.copper, 8), new ItemStack(Items.lead, 30), new ItemStack(Items.silicon, 4)); - new Recipe(power, PowerBlocks.batteryLarge, new ItemStack(Items.titanium, 40), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 30)); + new Recipe(power, Blocks.powerNode, new ItemStack(Items.copper, 2), new ItemStack(Items.lead, 6)); + new Recipe(power, Blocks.powerNodeLarge, new ItemStack(Items.titanium, 10), new ItemStack(Items.lead, 20), new ItemStack(Items.silicon, 6)); + new Recipe(power, Blocks.battery, new ItemStack(Items.copper, 8), new ItemStack(Items.lead, 30), new ItemStack(Items.silicon, 4)); + new Recipe(power, Blocks.batteryLarge, new ItemStack(Items.titanium, 40), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 30)); //generators - combustion - new Recipe(power, PowerBlocks.combustionGenerator, new ItemStack(Items.copper, 50), new ItemStack(Items.lead, 30)); - new Recipe(power, PowerBlocks.turbineGenerator, new ItemStack(Items.copper, 70), new ItemStack(Items.graphite, 50), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 60)); - new Recipe(power, PowerBlocks.thermalGenerator, new ItemStack(Items.copper, 80), new ItemStack(Items.graphite, 70), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 70), new ItemStack(Items.thorium, 70)); + new Recipe(power, Blocks.combustionGenerator, new ItemStack(Items.copper, 50), new ItemStack(Items.lead, 30)); + new Recipe(power, Blocks.turbineGenerator, new ItemStack(Items.copper, 70), new ItemStack(Items.graphite, 50), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 60)); + new Recipe(power, Blocks.thermalGenerator, new ItemStack(Items.copper, 80), new ItemStack(Items.graphite, 70), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 70), new ItemStack(Items.thorium, 70)); //generators - solar - new Recipe(power, PowerBlocks.solarPanel, new ItemStack(Items.lead, 20), new ItemStack(Items.silicon, 30)); - new Recipe(power, PowerBlocks.largeSolarPanel, new ItemStack(Items.lead, 200), new ItemStack(Items.silicon, 290), new ItemStack(Items.phasefabric, 30)); + new Recipe(power, Blocks.solarPanel, new ItemStack(Items.lead, 20), new ItemStack(Items.silicon, 30)); + new Recipe(power, Blocks.largeSolarPanel, new ItemStack(Items.lead, 200), new ItemStack(Items.silicon, 290), new ItemStack(Items.phasefabric, 30)); //generators - nuclear - new Recipe(power, PowerBlocks.thoriumReactor, new ItemStack(Items.lead, 600), new ItemStack(Items.silicon, 400), new ItemStack(Items.graphite, 300), new ItemStack(Items.thorium, 300)); - new Recipe(power, PowerBlocks.rtgGenerator, new ItemStack(Items.lead, 200), new ItemStack(Items.silicon, 150), new ItemStack(Items.phasefabric, 50), new ItemStack(Items.plastanium, 150), new ItemStack(Items.thorium, 100)); + new Recipe(power, Blocks.thoriumReactor, new ItemStack(Items.lead, 600), new ItemStack(Items.silicon, 400), new ItemStack(Items.graphite, 300), new ItemStack(Items.thorium, 300)); + new Recipe(power, Blocks.rtgGenerator, new ItemStack(Items.lead, 200), new ItemStack(Items.silicon, 150), new ItemStack(Items.phasefabric, 50), new ItemStack(Items.plastanium, 150), new ItemStack(Items.thorium, 100)); //DRILLS, PRODUCERS - new Recipe(production, ProductionBlocks.mechanicalDrill, new ItemStack(Items.copper, 45)).setAlwaysUnlocked(true); - new Recipe(production, ProductionBlocks.pneumaticDrill, new ItemStack(Items.copper, 60), new ItemStack(Items.graphite, 50)); - new Recipe(production, ProductionBlocks.laserDrill, new ItemStack(Items.copper, 70), new ItemStack(Items.graphite, 90), new ItemStack(Items.silicon, 60), new ItemStack(Items.titanium, 50)); - new Recipe(production, ProductionBlocks.blastDrill, new ItemStack(Items.copper, 130), new ItemStack(Items.silicon, 120), new ItemStack(Items.titanium, 100), new ItemStack(Items.thorium, 60)); + new Recipe(production, Blocks.mechanicalDrill, new ItemStack(Items.copper, 45)).setAlwaysUnlocked(true); + new Recipe(production, Blocks.pneumaticDrill, new ItemStack(Items.copper, 60), new ItemStack(Items.graphite, 50)); + new Recipe(production, Blocks.laserDrill, new ItemStack(Items.copper, 70), new ItemStack(Items.graphite, 90), new ItemStack(Items.silicon, 60), new ItemStack(Items.titanium, 50)); + new Recipe(production, Blocks.blastDrill, new ItemStack(Items.copper, 130), new ItemStack(Items.silicon, 120), new ItemStack(Items.titanium, 100), new ItemStack(Items.thorium, 60)); - new Recipe(production, ProductionBlocks.waterExtractor, new ItemStack(Items.copper, 50), new ItemStack(Items.graphite, 50), new ItemStack(Items.lead, 40)); - new Recipe(production, ProductionBlocks.cultivator, new ItemStack(Items.copper, 20), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 20)); - new Recipe(production, ProductionBlocks.oilExtractor, new ItemStack(Items.copper, 300), new ItemStack(Items.graphite, 350), new ItemStack(Items.lead, 230), new ItemStack(Items.thorium, 230), new ItemStack(Items.silicon, 150)); + new Recipe(production, Blocks.waterExtractor, new ItemStack(Items.copper, 50), new ItemStack(Items.graphite, 50), new ItemStack(Items.lead, 40)); + new Recipe(production, Blocks.cultivator, new ItemStack(Items.copper, 20), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 20)); + new Recipe(production, Blocks.oilExtractor, new ItemStack(Items.copper, 300), new ItemStack(Items.graphite, 350), new ItemStack(Items.lead, 230), new ItemStack(Items.thorium, 230), new ItemStack(Items.silicon, 150)); //UNITS //upgrades - new Recipe(upgrade, UpgradeBlocks.dartPad, new ItemStack(Items.lead, 150), new ItemStack(Items.copper, 150), new ItemStack(Items.silicon, 200), new ItemStack(Items.titanium, 240)).setVisible(RecipeVisibility.desktopOnly); - new Recipe(upgrade, UpgradeBlocks.tridentPad, new ItemStack(Items.lead, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250), new ItemStack(Items.titanium, 300), new ItemStack(Items.plastanium, 200)); - new Recipe(upgrade, UpgradeBlocks.javelinPad, new ItemStack(Items.lead, 350), new ItemStack(Items.silicon, 450), new ItemStack(Items.titanium, 500), new ItemStack(Items.plastanium, 400), new ItemStack(Items.phasefabric, 200)); - new Recipe(upgrade, UpgradeBlocks.glaivePad, new ItemStack(Items.lead, 450), new ItemStack(Items.silicon, 650), new ItemStack(Items.titanium, 700), new ItemStack(Items.plastanium, 600), new ItemStack(Items.surgealloy, 200)); + new Recipe(upgrade, Blocks.dartPad, new ItemStack(Items.lead, 150), new ItemStack(Items.copper, 150), new ItemStack(Items.silicon, 200), new ItemStack(Items.titanium, 240)).setVisible(RecipeVisibility.desktopOnly); + new Recipe(upgrade, Blocks.tridentPad, new ItemStack(Items.lead, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250), new ItemStack(Items.titanium, 300), new ItemStack(Items.plastanium, 200)); + new Recipe(upgrade, Blocks.javelinPad, new ItemStack(Items.lead, 350), new ItemStack(Items.silicon, 450), new ItemStack(Items.titanium, 500), new ItemStack(Items.plastanium, 400), new ItemStack(Items.phasefabric, 200)); + new Recipe(upgrade, Blocks.glaivePad, new ItemStack(Items.lead, 450), new ItemStack(Items.silicon, 650), new ItemStack(Items.titanium, 700), new ItemStack(Items.plastanium, 600), new ItemStack(Items.surgealloy, 200)); - new Recipe(upgrade, UpgradeBlocks.alphaPad, new ItemStack(Items.lead, 200), new ItemStack(Items.graphite, 100), new ItemStack(Items.copper, 150)).setVisible(RecipeVisibility.mobileOnly); - new Recipe(upgrade, UpgradeBlocks.tauPad, new ItemStack(Items.lead, 250), new ItemStack(Items.titanium, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250)); - new Recipe(upgrade, UpgradeBlocks.deltaPad, new ItemStack(Items.lead, 350), new ItemStack(Items.titanium, 350), new ItemStack(Items.copper, 400), new ItemStack(Items.silicon, 450), new ItemStack(Items.thorium, 300)); - new Recipe(upgrade, UpgradeBlocks.omegaPad, new ItemStack(Items.lead, 450), new ItemStack(Items.graphite, 550), new ItemStack(Items.silicon, 650), new ItemStack(Items.thorium, 600), new ItemStack(Items.surgealloy, 240)); + new Recipe(upgrade, Blocks.alphaPad, new ItemStack(Items.lead, 200), new ItemStack(Items.graphite, 100), new ItemStack(Items.copper, 150)).setVisible(RecipeVisibility.mobileOnly); + new Recipe(upgrade, Blocks.tauPad, new ItemStack(Items.lead, 250), new ItemStack(Items.titanium, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250)); + new Recipe(upgrade, Blocks.deltaPad, new ItemStack(Items.lead, 350), new ItemStack(Items.titanium, 350), new ItemStack(Items.copper, 400), new ItemStack(Items.silicon, 450), new ItemStack(Items.thorium, 300)); + new Recipe(upgrade, Blocks.omegaPad, new ItemStack(Items.lead, 450), new ItemStack(Items.graphite, 550), new ItemStack(Items.silicon, 650), new ItemStack(Items.thorium, 600), new ItemStack(Items.surgealloy, 240)); //unit factories - new Recipe(units, UnitBlocks.spiritFactory, new ItemStack(Items.copper, 70), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 130)); - new Recipe(units, UnitBlocks.phantomFactory, new ItemStack(Items.titanium, 90), new ItemStack(Items.thorium, 80), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 210)); + new Recipe(units, Blocks.spiritFactory, new ItemStack(Items.copper, 70), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 130)); + new Recipe(units, Blocks.phantomFactory, new ItemStack(Items.titanium, 90), new ItemStack(Items.thorium, 80), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 210)); - new Recipe(units, UnitBlocks.daggerFactory, new ItemStack(Items.lead, 90), new ItemStack(Items.silicon, 70)); - new Recipe(units, UnitBlocks.titanFactory, new ItemStack(Items.thorium, 90), new ItemStack(Items.lead, 140), new ItemStack(Items.silicon, 90)); - new Recipe(units, UnitBlocks.fortressFactory, new ItemStack(Items.thorium, 200), new ItemStack(Items.lead, 220), new ItemStack(Items.silicon, 150), new ItemStack(Items.surgealloy, 100), new ItemStack(Items.phasefabric, 50)); + new Recipe(units, Blocks.daggerFactory, new ItemStack(Items.lead, 90), new ItemStack(Items.silicon, 70)); + new Recipe(units, Blocks.titanFactory, new ItemStack(Items.thorium, 90), new ItemStack(Items.lead, 140), new ItemStack(Items.silicon, 90)); + new Recipe(units, Blocks.fortressFactory, new ItemStack(Items.thorium, 200), new ItemStack(Items.lead, 220), new ItemStack(Items.silicon, 150), new ItemStack(Items.surgealloy, 100), new ItemStack(Items.phasefabric, 50)); - new Recipe(units, UnitBlocks.wraithFactory, new ItemStack(Items.titanium, 60), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 90)); - new Recipe(units, UnitBlocks.ghoulFactory, new ItemStack(Items.plastanium, 80), new ItemStack(Items.titanium, 100), new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 220)); - new Recipe(units, UnitBlocks.revenantFactory, new ItemStack(Items.plastanium, 300), new ItemStack(Items.titanium, 400), new ItemStack(Items.lead, 300), new ItemStack(Items.silicon, 400), new ItemStack(Items.surgealloy, 100)); + new Recipe(units, Blocks.wraithFactory, new ItemStack(Items.titanium, 60), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 90)); + new Recipe(units, Blocks.ghoulFactory, new ItemStack(Items.plastanium, 80), new ItemStack(Items.titanium, 100), new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 220)); + new Recipe(units, Blocks.revenantFactory, new ItemStack(Items.plastanium, 300), new ItemStack(Items.titanium, 400), new ItemStack(Items.lead, 300), new ItemStack(Items.silicon, 400), new ItemStack(Items.surgealloy, 100)); - new Recipe(units, UnitBlocks.repairPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.copper, 30), new ItemStack(Items.silicon, 30)); + new Recipe(units, Blocks.repairPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.copper, 30), new ItemStack(Items.silicon, 30)); //removed for testing MOBA-style unit production - //new Recipe(units, UnitBlocks.commandCenter, new ItemStack(Items.lead, 100), new ItemStack(Items.densealloy, 100), new ItemStack(Items.silicon, 200)); + //new Recipe(units, Blocks.commandCenter, new ItemStack(Items.lead, 100), new ItemStack(Items.densealloy, 100), new ItemStack(Items.silicon, 200)); //LIQUIDS - new Recipe(liquid, LiquidBlocks.conduit, new ItemStack(Items.lead, 1)); - new Recipe(liquid, LiquidBlocks.pulseConduit, new ItemStack(Items.titanium, 1), new ItemStack(Items.lead, 1)); - new Recipe(liquid, LiquidBlocks.phaseConduit, new ItemStack(Items.phasefabric, 10), new ItemStack(Items.silicon, 15), new ItemStack(Items.lead, 20), new ItemStack(Items.titanium, 20)); + new Recipe(liquid, Blocks.conduit, new ItemStack(Items.lead, 1)); + new Recipe(liquid, Blocks.pulseConduit, new ItemStack(Items.titanium, 1), new ItemStack(Items.lead, 1)); + new Recipe(liquid, Blocks.phaseConduit, new ItemStack(Items.phasefabric, 10), new ItemStack(Items.silicon, 15), new ItemStack(Items.lead, 20), new ItemStack(Items.titanium, 20)); - new Recipe(liquid, LiquidBlocks.liquidRouter, new ItemStack(Items.titanium, 4), new ItemStack(Items.lead, 4)); - new Recipe(liquid, LiquidBlocks.liquidtank, new ItemStack(Items.titanium, 50), new ItemStack(Items.lead, 50)); - new Recipe(liquid, LiquidBlocks.liquidJunction, new ItemStack(Items.titanium, 4), new ItemStack(Items.lead, 4)); - new Recipe(liquid, LiquidBlocks.bridgeConduit, new ItemStack(Items.titanium, 8), new ItemStack(Items.lead, 8)); + new Recipe(liquid, Blocks.liquidRouter, new ItemStack(Items.titanium, 4), new ItemStack(Items.lead, 4)); + new Recipe(liquid, Blocks.liquidtank, new ItemStack(Items.titanium, 50), new ItemStack(Items.lead, 50)); + new Recipe(liquid, Blocks.liquidJunction, new ItemStack(Items.titanium, 4), new ItemStack(Items.lead, 4)); + new Recipe(liquid, Blocks.bridgeConduit, new ItemStack(Items.titanium, 8), new ItemStack(Items.lead, 8)); - new Recipe(liquid, LiquidBlocks.mechanicalPump, new ItemStack(Items.copper, 30), new ItemStack(Items.lead, 20)); - new Recipe(liquid, LiquidBlocks.rotaryPump, new ItemStack(Items.copper, 140), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 40), new ItemStack(Items.titanium, 70)); - new Recipe(liquid, LiquidBlocks.thermalPump, new ItemStack(Items.copper, 160), new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 60), new ItemStack(Items.titanium, 80), new ItemStack(Items.thorium, 70)); - } - - @Override - public ContentType type(){ - return ContentType.recipe; + new Recipe(liquid, Blocks.mechanicalPump, new ItemStack(Items.copper, 30), new ItemStack(Items.lead, 20)); + new Recipe(liquid, Blocks.rotaryPump, new ItemStack(Items.copper, 140), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 40), new ItemStack(Items.titanium, 70)); + new Recipe(liquid, Blocks.thermalPump, new ItemStack(Items.copper, 160), new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 60), new ItemStack(Items.titanium, 80), new ItemStack(Items.thorium, 70)); } } diff --git a/core/src/io/anuke/mindustry/content/StatusEffects.java b/core/src/io/anuke/mindustry/content/StatusEffects.java index 9162d9be3a..bc4f0c420a 100644 --- a/core/src/io/anuke/mindustry/content/StatusEffects.java +++ b/core/src/io/anuke/mindustry/content/StatusEffects.java @@ -3,11 +3,9 @@ package io.anuke.mindustry.content; import io.anuke.arc.entities.Effects; import io.anuke.arc.math.Mathf; import io.anuke.arc.util.Time; -import io.anuke.mindustry.content.fx.EnvironmentFx; import io.anuke.mindustry.entities.StatusController.StatusEntry; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.StatusEffect; public class StatusEffects implements ContentList{ @@ -27,7 +25,7 @@ public class StatusEffects implements ContentList{ public StatusEntry getTransition(Unit unit, StatusEffect to, float time, float newTime, StatusEntry result){ if(to == tarred){ unit.damage(1f); - Effects.effect(EnvironmentFx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); + Effects.effect(Fx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); return result.set(this, Math.min(time + newTime, baseDuration + tarred.baseDuration)); } @@ -39,7 +37,7 @@ public class StatusEffects implements ContentList{ unit.damagePeriodic(0.04f); if(Mathf.chance(Time.delta() * 0.2f)){ - Effects.effect(EnvironmentFx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); + Effects.effect(Fx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); } } }; @@ -55,7 +53,7 @@ public class StatusEffects implements ContentList{ public void update(Unit unit, float time){ if(Mathf.chance(Time.delta() * 0.15f)){ - Effects.effect(EnvironmentFx.freezing, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); + Effects.effect(Fx.freezing, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); } } }; @@ -80,7 +78,7 @@ public class StatusEffects implements ContentList{ @Override public void update(Unit unit, float time){ if(Mathf.chance(Time.delta() * 0.15f)){ - Effects.effect(EnvironmentFx.wet, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); + Effects.effect(Fx.wet, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); } } }; @@ -106,7 +104,7 @@ public class StatusEffects implements ContentList{ unit.damagePeriodic(0.3f); if(Mathf.chance(Time.delta() * 0.2f)){ - Effects.effect(EnvironmentFx.melting, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); + Effects.effect(Fx.melting, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); } } }; @@ -119,7 +117,7 @@ public class StatusEffects implements ContentList{ @Override public void update(Unit unit, float time){ if(Mathf.chance(Time.delta() * 0.15f)){ - Effects.effect(EnvironmentFx.oily, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); + Effects.effect(Fx.oily, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); } } @@ -146,7 +144,7 @@ public class StatusEffects implements ContentList{ unit.health += 0.01f * Time.delta(); if(Mathf.chance(Time.delta() * 0.25f)){ - Effects.effect(EnvironmentFx.overdriven, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f), 0f, unit); + Effects.effect(Fx.overdriven, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f), 0f, unit); } } }; @@ -169,9 +167,4 @@ public class StatusEffects implements ContentList{ freezing.setOpposites(burning, melting); burning.setOpposites(wet, freezing); } - - @Override - public ContentType type(){ - return ContentType.status; - } } diff --git a/core/src/io/anuke/mindustry/content/UnitTypes.java b/core/src/io/anuke/mindustry/content/UnitTypes.java index 9fcee1977e..0bbbb20e4a 100644 --- a/core/src/io/anuke/mindustry/content/UnitTypes.java +++ b/core/src/io/anuke/mindustry/content/UnitTypes.java @@ -4,7 +4,6 @@ import io.anuke.arc.collection.ObjectSet; import io.anuke.mindustry.entities.units.UnitType; import io.anuke.mindustry.entities.units.types.*; import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.type.ContentType; public class UnitTypes implements ContentList{ public static UnitType @@ -106,9 +105,4 @@ public class UnitTypes implements ContentList{ toMine = ObjectSet.with(Items.lead, Items.copper, Items.titanium); }}; } - - @Override - public ContentType type(){ - return ContentType.unit; - } } diff --git a/core/src/io/anuke/mindustry/content/Weapons.java b/core/src/io/anuke/mindustry/content/Weapons.java index 480c8988bf..1d4d3b5153 100644 --- a/core/src/io/anuke/mindustry/content/Weapons.java +++ b/core/src/io/anuke/mindustry/content/Weapons.java @@ -1,14 +1,11 @@ package io.anuke.mindustry.content; -import io.anuke.mindustry.content.fx.Fx; -import io.anuke.mindustry.content.fx.ShootFx; import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.Weapon; public class Weapons implements ContentList{ public static Weapon blaster, blasterSmall, glaiveBlaster, droneBlaster, healBlaster, healBlasterDrone, chainBlaster, shockgun, - sapper, swarmer, bomber, bomberTrident, flakgun, flamethrower, missiles, artillery, laserBurster, healBlasterDrone2; + swarmer, bomber, bomberTrident, flakgun, flamethrower, missiles, artillery, laserBurster, healBlasterDrone2; @Override public void load(){ @@ -17,24 +14,24 @@ public class Weapons implements ContentList{ length = 1.5f; reload = 14f; roundrobin = true; - ejectEffect = ShootFx.shellEjectSmall; - ammo = AmmoTypes.bulletMech; + ejectEffect = Fx.shellEjectSmall; + ammo = Bullets.standardMechSmall; }}; blasterSmall = new Weapon("blaster"){{ length = 1.5f; reload = 15f; roundrobin = true; - ejectEffect = ShootFx.shellEjectSmall; - ammo = AmmoTypes.bulletCopper; + ejectEffect = Fx.shellEjectSmall; + ammo = Bullets.standardCopper; }}; glaiveBlaster = new Weapon("bomber"){{ length = 1.5f; reload = 10f; roundrobin = true; - ejectEffect = ShootFx.shellEjectSmall; - ammo = AmmoTypes.bulletGlaive; + ejectEffect = Fx.shellEjectSmall; + ammo = Bullets.standardGlaive; }}; droneBlaster = new Weapon("blaster"){{ @@ -42,8 +39,8 @@ public class Weapons implements ContentList{ reload = 25f; width = 1f; roundrobin = true; - ejectEffect = ShootFx.shellEjectSmall; - ammo = AmmoTypes.bulletCopper; + ejectEffect = Fx.shellEjectSmall; + ammo = Bullets.standardCopper; }}; healBlaster = new Weapon("heal-blaster"){{ @@ -52,7 +49,7 @@ public class Weapons implements ContentList{ roundrobin = false; ejectEffect = Fx.none; recoil = 2f; - ammo = AmmoTypes.healBlaster; + ammo = Bullets.healBullet; }}; missiles = new Weapon("missiles"){{ @@ -64,7 +61,7 @@ public class Weapons implements ContentList{ ejectEffect = Fx.none; velocityRnd = 0.2f; spacing = 1f; - ammo = AmmoTypes.weaponMissile; + ammo = Bullets.missileJavelin; }}; swarmer = new Weapon("swarmer"){{ @@ -77,15 +74,15 @@ public class Weapons implements ContentList{ roundrobin = true; ejectEffect = Fx.none; shake = 3f; - ammo = AmmoTypes.weaponMissileSwarm; + ammo = Bullets.missileSwarm; }}; chainBlaster = new Weapon("chain-blaster"){{ length = 1.5f; reload = 28f; roundrobin = true; - ejectEffect = ShootFx.shellEjectSmall; - ammo = AmmoTypes.bulletCopper; + ejectEffect = Fx.shellEjectSmall; + ammo = Bullets.standardCopper; }}; shockgun = new Weapon("shockgun"){{ @@ -96,7 +93,7 @@ public class Weapons implements ContentList{ inaccuracy = 0f; velocityRnd = 0.2f; ejectEffect = Fx.none; - ammo = AmmoTypes.shock; + ammo = Bullets.lightning; }}; flakgun = new Weapon("flakgun"){{ @@ -107,8 +104,8 @@ public class Weapons implements ContentList{ inaccuracy = 3f; recoil = 3f; velocityRnd = 0.1f; - ejectEffect = ShootFx.shellEjectMedium; - ammo = AmmoTypes.shellCarbide; + ejectEffect = Fx.shellEjectMedium; + ammo = Bullets.artilleryDense; }}; flamethrower = new Weapon("flamethrower"){{ @@ -117,7 +114,7 @@ public class Weapons implements ContentList{ roundrobin = true; recoil = 1f; ejectEffect = Fx.none; - ammo = AmmoTypes.flamerThermite; + ammo = Bullets.basicFlame; }}; artillery = new Weapon("artillery"){{ @@ -126,16 +123,8 @@ public class Weapons implements ContentList{ roundrobin = true; recoil = 5f; shake = 2f; - ejectEffect = ShootFx.shellEjectMedium; - ammo = AmmoTypes.unitArtillery; - }}; - - sapper = new Weapon("sapper"){{ - length = 1.5f; - reload = 12f; - roundrobin = true; - ejectEffect = ShootFx.shellEjectSmall; - ammo = AmmoTypes.bulletDense; + ejectEffect = Fx.shellEjectMedium; + ammo = Bullets.artilleryUnit; }}; bomber = new Weapon("bomber"){{ @@ -146,7 +135,7 @@ public class Weapons implements ContentList{ ejectEffect = Fx.none; velocityRnd = 1f; inaccuracy = 40f; - ammo = AmmoTypes.bombExplosive; + ammo = Bullets.bombExplosive; }}; bomberTrident = new Weapon("bomber"){{ @@ -158,7 +147,7 @@ public class Weapons implements ContentList{ ejectEffect = Fx.none; velocityRnd = 1f; inaccuracy = 40f; - ammo = AmmoTypes.bombExplosive; + ammo = Bullets.bombExplosive; }}; laserBurster = new Weapon("bomber"){{ @@ -167,7 +156,7 @@ public class Weapons implements ContentList{ width = 0f; roundrobin = true; ejectEffect = Fx.none; - ammo = AmmoTypes.lancerLaser; + ammo = Bullets.lancerLaser; }}; healBlasterDrone = new Weapon("heal-blaster"){{ @@ -177,7 +166,7 @@ public class Weapons implements ContentList{ roundrobin = true; ejectEffect = Fx.none; recoil = 2f; - ammo = AmmoTypes.healBlaster; + ammo = Bullets.healBullet; }}; healBlasterDrone2 = new Weapon("heal-blaster"){{ @@ -187,12 +176,7 @@ public class Weapons implements ContentList{ roundrobin = true; ejectEffect = Fx.none; recoil = 2f; - ammo = AmmoTypes.healBlaster; + ammo = Bullets.healBullet; }}; } - - @Override - public ContentType type(){ - return ContentType.weapon; - } } diff --git a/core/src/io/anuke/mindustry/content/blocks/BlockList.java b/core/src/io/anuke/mindustry/content/blocks/BlockList.java deleted file mode 100644 index 85cf617fd9..0000000000 --- a/core/src/io/anuke/mindustry/content/blocks/BlockList.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.anuke.mindustry.content.blocks; - -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.type.ContentType; - -public abstract class BlockList implements ContentList{ - - @Override - public ContentType type(){ - return ContentType.item; - } -} diff --git a/core/src/io/anuke/mindustry/content/blocks/Blocks.java b/core/src/io/anuke/mindustry/content/blocks/Blocks.java deleted file mode 100644 index 8ce81e4667..0000000000 --- a/core/src/io/anuke/mindustry/content/blocks/Blocks.java +++ /dev/null @@ -1,161 +0,0 @@ -package io.anuke.mindustry.content.blocks; - -import io.anuke.arc.graphics.Color; -import io.anuke.mindustry.content.Items; -import io.anuke.mindustry.content.Liquids; -import io.anuke.mindustry.content.StatusEffects; -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.graphics.CacheLayer; -import io.anuke.mindustry.type.ItemStack; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.*; -import io.anuke.arc.util.Time; -import io.anuke.arc.graphics.g2d.Draw; -import io.anuke.arc.graphics.g2d.Lines; -import io.anuke.arc.math.Mathf; - -public class Blocks extends BlockList implements ContentList{ - public static Block air, blockpart, spawn, space, metalfloor, deepwater, water, lava, tar, stone, - blackstone, dirt, sand, ice, snow, grass, shrub, rock, icerock, blackrock; - - - @Override - public void load(){ - air = new Floor("air"){ - { - blend = false; - alwaysReplace = true; - } - - public void draw(Tile tile){} - public void load(){} - public void init(){} - }; - - blockpart = new BlockPart(); - - spawn = new Block("spawn"){ - - public void drawShadow(Tile tile){} - - public void draw(Tile tile){ - Draw.color(Color.SCARLET); - Lines.circle(tile.worldx(), tile.worldy(), 4f +Mathf.absin(Time.time(), 6f, 6f)); - Draw.color(); - } - }; - - //Registers build blocks from size 1-6 - //no reference is needed here since they can be looked up by name later - for(int i = 1; i <= 6; i++){ - new BuildBlock("build" + i); - } - - space = new Floor("space"){{ - placeableOn = false; - variants = 0; - cacheLayer = CacheLayer.space; - solid = true; - blend = false; - minimapColor = Color.valueOf("000001"); - }}; - - metalfloor = new Floor("metalfloor"){{ - variants = 6; - }}; - - deepwater = new Floor("deepwater"){{ - liquidColor = Color.valueOf("546bb3"); - speedMultiplier = 0.2f; - variants = 0; - liquidDrop = Liquids.water; - isLiquid = true; - status = StatusEffects.wet; - statusIntensity = 1f; - drownTime = 140f; - cacheLayer = CacheLayer.water; - minimapColor = Color.valueOf("465a96"); - }}; - - water = new Floor("water"){{ - liquidColor = Color.valueOf("546bb3"); - speedMultiplier = 0.5f; - variants = 0; - status = StatusEffects.wet; - statusIntensity = 0.9f; - liquidDrop = Liquids.water; - isLiquid = true; - cacheLayer = CacheLayer.water; - minimapColor = Color.valueOf("506eb4"); - }}; - - tar = new Floor("tar"){{ - drownTime = 150f; - liquidColor = Color.valueOf("292929"); - status = StatusEffects.tarred; - statusIntensity = 1f; - speedMultiplier = 0.19f; - variants = 0; - liquidDrop = Liquids.oil; - isLiquid = true; - cacheLayer = CacheLayer.oil; - minimapColor = Color.valueOf("292929"); - }}; - - stone = new Floor("stone"){{ - hasOres = true; - blends = block -> block != this && !(block instanceof OreBlock); - minimapColor = Color.valueOf("323232"); - playerUnmineable = true; - }}; - - blackstone = new Floor("blackstone"){{ - minimapColor = Color.valueOf("252525"); - playerUnmineable = true; - hasOres = true; - }}; - - dirt = new Floor("dirt"){{ - minimapColor = Color.valueOf("6e501e"); - }}; - - sand = new Floor("sand"){{ - drops = new ItemStack(Items.sand, 1); - minimapColor = Color.valueOf("988a67"); - hasOres = true; - playerUnmineable = true; - }}; - - ice = new Floor("ice"){{ - dragMultiplier = 0.2f; - speedMultiplier = 0.4f; - minimapColor = Color.valueOf("b8eef8"); - hasOres = true; - }}; - - snow = new Floor("snow"){{ - minimapColor = Color.valueOf("c2d1d2"); - hasOres = true; - }}; - - grass = new Floor("grass"){{ - hasOres = true; - minimapColor = Color.valueOf("549d5b"); - }}; - - shrub = new Rock("shrub"); - - rock = new Rock("rock"){{ - variants = 2; - }}; - - icerock = new Rock("icerock"){{ - variants = 2; - }}; - - blackrock = new Rock("blackrock"){{ - variants = 1; - }}; - } -} diff --git a/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java b/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java deleted file mode 100644 index feec001313..0000000000 --- a/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java +++ /dev/null @@ -1,168 +0,0 @@ -package io.anuke.mindustry.content.blocks; - -import io.anuke.arc.graphics.Color; -import io.anuke.mindustry.content.Items; -import io.anuke.mindustry.content.Liquids; -import io.anuke.mindustry.content.fx.BlockFx; -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.type.ItemStack; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.production.*; - -public class CraftingBlocks extends BlockList implements ContentList{ - public static Block siliconSmelter, plastaniumCompressor, phaseWeaver, surgeSmelter, - pyratiteMixer, blastMixer, - cryofluidmixer, melter, separator, biomatterCompressor, pulverizer, incinerator; - - @Override - public void load(){ - - siliconSmelter = new PowerSmelter("silicon-smelter"){{ - health = 90; - craftEffect = BlockFx.smeltsmoke; - result = Items.silicon; - craftTime = 40f; - size = 2; - hasLiquids = false; - flameColor = Color.valueOf("ffef99"); - - consumes.items(new ItemStack(Items.sand, 2)); - consumes.power(0.05f); - }}; - - plastaniumCompressor = new PlastaniumCompressor("plastanium-compressor"){{ - hasItems = true; - liquidCapacity = 60f; - craftTime = 60f; - output = Items.plastanium; - size = 2; - health = 320; - hasPower = hasLiquids = true; - craftEffect = BlockFx.formsmoke; - updateEffect = BlockFx.plasticburn; - - consumes.liquid(Liquids.oil, 0.25f); - consumes.power(0.3f); - consumes.item(Items.titanium, 2); - }}; - - phaseWeaver = new PhaseWeaver("phase-weaver"){{ - craftEffect = BlockFx.smeltsmoke; - result = Items.phasefabric; - craftTime = 120f; - size = 2; - - consumes.items(new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10)); - consumes.power(0.5f); - }}; - - surgeSmelter = new PowerSmelter("surge-smelter"){{ - craftEffect = BlockFx.smeltsmoke; - result = Items.surgealloy; - craftTime = 75f; - size = 3; - - useFlux = true; - fluxNeeded = 3; - - consumes.power(0.4f); - 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"){{ - outputLiquid = Liquids.cryofluid; - liquidPerItem = 50f; - size = 2; - hasPower = true; - - consumes.power(0.1f); - consumes.item(Items.titanium); - consumes.liquid(Liquids.water, 0.3f); - }}; - - blastMixer = new GenericCrafter("blast-mixer"){{ - hasItems = true; - hasPower = true; - hasLiquids = true; - output = Items.blastCompound; - size = 2; - - consumes.liquid(Liquids.oil, 0.05f); - consumes.item(Items.pyratite, 1); - consumes.power(0.04f); - }}; - - pyratiteMixer = new PowerSmelter("pyratite-mixer"){{ - flameColor = Color.CLEAR; - hasItems = true; - hasPower = true; - result = Items.pyratite; - - size = 2; - - consumes.power(0.02f); - consumes.items(new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 1), new ItemStack(Items.sand, 1)); - }}; - - melter = new PowerCrafter("melter"){{ - health = 200; - outputLiquid = Liquids.slag; - outputLiquidAmount = 1f; - craftTime = 10f; - size = 2; - hasLiquids = hasPower = true; - - consumes.power(0.1f); - consumes.item(Items.scrap, 1); - }}; - - separator = new Separator("separator"){{ - results = new ItemStack[]{ - new ItemStack(Items.copper, 5), - new ItemStack(Items.lead, 3), - new ItemStack(Items.titanium, 2), - new ItemStack(Items.thorium, 1) - }; - - hasPower = true; - filterTime = 15f; - health = 50 * 4; - spinnerLength = 1.5f; - spinnerRadius = 3.5f; - spinnerThickness = 1.5f; - spinnerSpeed = 3f; - size = 2; - - consumes.power(0.1f); - consumes.liquid(Liquids.slag, 0.2f); - }}; - - biomatterCompressor = new Compressor("biomattercompressor"){{ - liquidCapacity = 60f; - craftTime = 20f; - outputLiquid = Liquids.oil; - outputLiquidAmount = 2.5f; - size = 2; - health = 320; - hasLiquids = true; - - consumes.item(Items.biomatter, 1); - consumes.power(0.06f); - }}; - - pulverizer = new Pulverizer("pulverizer"){{ - output = Items.sand; - craftEffect = BlockFx.pulverize; - craftTime = 40f; - updateEffect = BlockFx.pulverizeSmall; - hasItems = hasPower = true; - - consumes.item(Items.scrap, 1); - consumes.power(0.05f); - }}; - - incinerator = new Incinerator("incinerator"){{ - health = 90; - }}; - } -} diff --git a/core/src/io/anuke/mindustry/content/blocks/DebugBlocks.java b/core/src/io/anuke/mindustry/content/blocks/DebugBlocks.java deleted file mode 100644 index b3906fb184..0000000000 --- a/core/src/io/anuke/mindustry/content/blocks/DebugBlocks.java +++ /dev/null @@ -1,180 +0,0 @@ -package io.anuke.mindustry.content.blocks; - -import io.anuke.arc.collection.Array; -import io.anuke.annotations.Annotations.Loc; -import io.anuke.annotations.Annotations.Remote; -import io.anuke.mindustry.content.Liquids; -import io.anuke.mindustry.entities.Player; -import io.anuke.mindustry.entities.TileEntity; -import io.anuke.mindustry.gen.Call; -import io.anuke.mindustry.game.ContentList; -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.PowerBlock; -import io.anuke.mindustry.world.blocks.distribution.Sorter; -import io.anuke.mindustry.world.blocks.power.PowerNode; -import io.anuke.mindustry.world.meta.BlockStat; -import io.anuke.arc.graphics.g2d.Draw; -import io.anuke.arc.scene.ui.ButtonGroup; -import io.anuke.arc.scene.ui.ImageButton; -import io.anuke.arc.scene.ui.layout.Table; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; -import static io.anuke.mindustry.Vars.*; - -public class DebugBlocks extends BlockList implements ContentList{ - public static Block powerVoid, powerInfinite, itemSource, liquidSource, itemVoid; - - @Remote(targets = Loc.both, called = Loc.both, forward = true) - public static void setLiquidSourceLiquid(Player player, Tile tile, Liquid liquid){ - LiquidSourceEntity entity = tile.entity(); - entity.source = liquid; - } - - @Override - public void load(){ - powerVoid = new PowerBlock("powervoid"){ - { - consumes.power(Float.MAX_VALUE); - } - - @Override - public void init(){ - super.init(); - stats.remove(BlockStat.powerUse); - } - }; - - powerInfinite = new PowerNode("powerinfinite"){ - { - maxNodes = 100; - outputsPower = true; - consumesPower = false; - } - - @Override - public float getPowerProduction(Tile tile){ - return 10000f; - } - }; - - itemSource = new Sorter("itemsource"){ - { - hasItems = true; - } - - @Override - public boolean outputsItems(){ - return true; - } - - @Override - public void update(Tile tile){ - SorterEntity entity = tile.entity(); - if(entity.sortItem == null) return; - - entity.items.set(entity.sortItem, 1); - tryDump(tile, entity.sortItem); - entity.items.set(entity.sortItem, 0); - } - - @Override - public boolean acceptItem(Item item, Tile tile, Tile source){ - return false; - } - }; - - liquidSource = new Block("liquidsource"){ - { - update = true; - solid = true; - hasLiquids = true; - liquidCapacity = 100f; - configurable = true; - outputsLiquid = true; - } - - @Override - public void update(Tile tile){ - LiquidSourceEntity entity = tile.entity(); - - tile.entity.liquids.add(entity.source, liquidCapacity); - tryDumpLiquid(tile, entity.source); - } - - @Override - public void draw(Tile tile){ - super.draw(tile); - - LiquidSourceEntity entity = tile.entity(); - - Draw.color(entity.source.color); - Draw.rect("blank", tile.worldx(), tile.worldy(), 4f, 4f); - Draw.color(); - } - - @Override - public void buildTable(Tile tile, Table table){ - LiquidSourceEntity entity = tile.entity(); - - Array items = content.liquids(); - - ButtonGroup group = new ButtonGroup<>(); - Table cont = new Table(); - - for(int i = 0; i < items.size; i++){ - if(!control.unlocks.isUnlocked(items.get(i))) continue; - - final int f = i; - ImageButton button = cont.addImageButton("liquid-icon-" + items.get(i).name, "clear-toggle", 24, - () -> Call.setLiquidSourceLiquid(null, tile, items.get(f))).size(38).group(group).get(); - button.setChecked(entity.source.id == f); - - if(i % 4 == 3){ - cont.row(); - } - } - - table.add(cont); - } - - @Override - public TileEntity newEntity(){ - return new LiquidSourceEntity(); - } - }; - - itemVoid = new Block("itemvoid"){ - { - update = solid = true; - } - - @Override - public void handleItem(Item item, Tile tile, Tile source){ - } - - @Override - public boolean acceptItem(Item item, Tile tile, Tile source){ - return true; - } - }; - } - - class LiquidSourceEntity extends TileEntity{ - public Liquid source = Liquids.water; - - @Override - public void writeConfig(DataOutput stream) throws IOException{ - stream.writeByte(source.id); - } - - @Override - public void readConfig(DataInput stream) throws IOException{ - source = content.liquid(stream.readByte()); - } - } -} diff --git a/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java b/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java deleted file mode 100644 index 9f67d7fe7f..0000000000 --- a/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java +++ /dev/null @@ -1,98 +0,0 @@ -package io.anuke.mindustry.content.blocks; - -import io.anuke.mindustry.content.Items; -import io.anuke.mindustry.content.fx.BlockFx; -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.defense.*; - -public class DefenseBlocks extends BlockList implements ContentList{ - public static Block copperWall, copperWallLarge, denseAlloyWall, denseAlloyWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge, - phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mendProjector, overdriveProjector, forceProjector, shockMine; - - @Override - public void load(){ - int wallHealthMultiplier = 3; - - copperWall = new Wall("copper-wall"){{ - health = 80 * wallHealthMultiplier; - }}; - - copperWallLarge = new Wall("copper-wall-large"){{ - health = 80 * 4 * wallHealthMultiplier; - size = 2; - }}; - - denseAlloyWall = new Wall("dense-alloy-wall"){{ - health = 110 * wallHealthMultiplier; - }}; - - denseAlloyWallLarge = new Wall("dense-alloy-wall-large"){{ - health = 110 * wallHealthMultiplier * 4; - size = 2; - }}; - - thoriumWall = new Wall("thorium-wall"){{ - health = 200 * wallHealthMultiplier; - }}; - - thoriumWallLarge = new Wall("thorium-wall-large"){{ - health = 200 * wallHealthMultiplier * 4; - size = 2; - }}; - - phaseWall = new DeflectorWall("phase-wall"){{ - health = 150 * wallHealthMultiplier; - }}; - - phaseWallLarge = new DeflectorWall("phase-wall-large"){{ - health = 150 * 4 * wallHealthMultiplier; - size = 2; - }}; - - surgeWall = new SurgeWall("surge-wall"){{ - health = 230 * wallHealthMultiplier; - }}; - - surgeWallLarge = new SurgeWall("surge-wall-large"){{ - health = 230 * 4 * wallHealthMultiplier; - size = 2; - }}; - - door = new Door("door"){{ - health = 100 * wallHealthMultiplier; - }}; - - doorLarge = new Door("door-large"){{ - openfx = BlockFx.dooropenlarge; - closefx = BlockFx.doorcloselarge; - health = 100 * 4 * wallHealthMultiplier; - size = 2; - }}; - - mendProjector = new MendProjector("mend-projector"){{ - consumes.power(0.2f, 1.0f); - size = 2; - consumes.item(Items.phasefabric).optional(true); - }}; - - overdriveProjector = new OverdriveProjector("overdrive-projector"){{ - consumes.power(0.35f, 1.0f); - size = 2; - consumes.item(Items.phasefabric).optional(true); - }}; - - forceProjector = new ForceProjector("force-projector"){{ - size = 3; - consumes.item(Items.phasefabric).optional(true); - }}; - - shockMine = new ShockMine("shock-mine"){{ - health = 40; - damage = 11; - tileDamage = 7f; - length = 10; - tendrils = 5; - }}; - } -} diff --git a/core/src/io/anuke/mindustry/content/blocks/DistributionBlocks.java b/core/src/io/anuke/mindustry/content/blocks/DistributionBlocks.java deleted file mode 100644 index 0266642557..0000000000 --- a/core/src/io/anuke/mindustry/content/blocks/DistributionBlocks.java +++ /dev/null @@ -1,57 +0,0 @@ -package io.anuke.mindustry.content.blocks; - -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.distribution.*; - -public class DistributionBlocks extends BlockList implements ContentList{ - public static Block conveyor, titaniumconveyor, distributor, junction, - itemBridge, phaseConveyor, sorter, router, overflowGate, massDriver; - - @Override - public void load(){ - - conveyor = new Conveyor("conveyor"){{ - health = 45; - speed = 0.03f; - }}; - - titaniumconveyor = new Conveyor("titanium-conveyor"){{ - health = 65; - speed = 0.07f; - }}; - - junction = new Junction("junction"){{ - speed = 26; - capacity = 32; - }}; - - itemBridge = new BufferedItemBridge("bridge-conveyor"){{ - range = 4; - speed = 60f; - bufferCapacity = 15; - }}; - - phaseConveyor = new ItemBridge("phase-conveyor"){{ - range = 12; - hasPower = true; - consumes.power(0.03f, 1.0f); - }}; - - sorter = new Sorter("sorter"); - - router = new Router("router"); - - distributor = new Router("distributor"){{ - size = 2; - }}; - - overflowGate = new OverflowGate("overflow-gate"); - - massDriver = new MassDriver("mass-driver"){{ - size = 3; - itemCapacity = 60; - range = 440f; - }}; - } -} diff --git a/core/src/io/anuke/mindustry/content/blocks/LiquidBlocks.java b/core/src/io/anuke/mindustry/content/blocks/LiquidBlocks.java deleted file mode 100644 index 164f72fa44..0000000000 --- a/core/src/io/anuke/mindustry/content/blocks/LiquidBlocks.java +++ /dev/null @@ -1,70 +0,0 @@ -package io.anuke.mindustry.content.blocks; - -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.distribution.*; -import io.anuke.mindustry.world.blocks.production.Pump; - -public class LiquidBlocks extends BlockList implements ContentList{ - public static Block mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, liquidRouter, liquidtank, liquidJunction, bridgeConduit, phaseConduit; - - @Override - public void load(){ - - mechanicalPump = new Pump("mechanical-pump"){{ - pumpAmount = 0.1f; - tier = 0; - }}; - - rotaryPump = new Pump("rotary-pump"){{ - pumpAmount = 0.2f; - consumes.power(0.015f); - liquidCapacity = 30f; - hasPower = true; - size = 2; - tier = 1; - }}; - - thermalPump = new Pump("thermal-pump"){{ - pumpAmount = 0.275f; - consumes.power(0.03f); - liquidCapacity = 40f; - hasPower = true; - size = 2; - tier = 2; - }}; - - conduit = new Conduit("conduit"){{ - health = 45; - }}; - - pulseConduit = new Conduit("pulse-conduit"){{ - liquidCapacity = 16f; - liquidFlowFactor = 4.9f; - health = 90; - }}; - - liquidRouter = new LiquidRouter("liquid-router"){{ - liquidCapacity = 20f; - }}; - - liquidtank = new LiquidTank("liquid-tank"){{ - size = 3; - liquidCapacity = 1500f; - health = 500; - }}; - - liquidJunction = new LiquidJunction("liquid-junction"); - - bridgeConduit = new LiquidExtendingBridge("bridge-conduit"){{ - range = 4; - hasPower = false; - }}; - - phaseConduit = new LiquidBridge("phase-conduit"){{ - range = 12; - hasPower = true; - consumes.power(0.03f, 1.0f); - }}; - } -} diff --git a/core/src/io/anuke/mindustry/content/blocks/OreBlocks.java b/core/src/io/anuke/mindustry/content/blocks/OreBlocks.java deleted file mode 100644 index 515542e9fd..0000000000 --- a/core/src/io/anuke/mindustry/content/blocks/OreBlocks.java +++ /dev/null @@ -1,36 +0,0 @@ -package io.anuke.mindustry.content.blocks; - -import io.anuke.arc.collection.ObjectMap; -import io.anuke.mindustry.type.Item; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.Floor; -import io.anuke.mindustry.world.blocks.OreBlock; - -import static io.anuke.mindustry.Vars.content; - -public class OreBlocks extends BlockList{ - private static final ObjectMap> oreBlockMap = new ObjectMap<>(); - - public static Block get(Block floor, Item item){ - if(!oreBlockMap.containsKey(item)) throw new IllegalArgumentException("Item '" + item + "' is not an ore!"); - if(!oreBlockMap.get(item).containsKey(floor)) - throw new IllegalArgumentException("Block '" + floor.name + "' does not support ores!"); - return oreBlockMap.get(item).get(floor); - } - - @Override - public void load(){ - - for(Item item : content.items()){ - if(!item.genOre) continue; - ObjectMap map = new ObjectMap<>(); - oreBlockMap.put(item, map); - - for(Block block : content.blocks()){ - if(block instanceof Floor && ((Floor) block).hasOres){ - map.put(block, new OreBlock(item, (Floor) block)); - } - } - } - } -} diff --git a/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java b/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java deleted file mode 100644 index 843541ca64..0000000000 --- a/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java +++ /dev/null @@ -1,82 +0,0 @@ -package io.anuke.mindustry.content.blocks; - -import io.anuke.mindustry.content.Liquids; -import io.anuke.mindustry.content.fx.BlockFx; -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.power.*; - -public class PowerBlocks extends BlockList implements ContentList{ - public static Block combustionGenerator, thermalGenerator, turbineGenerator, rtgGenerator, solarPanel, largeSolarPanel, - thoriumReactor, fusionReactor, battery, batteryLarge, powerNode, powerNodeLarge; - - @Override - public void load(){ - combustionGenerator = new BurnerGenerator("combustion-generator"){{ - powerProduction = 0.09f; - itemDuration = 40f; - }}; - - thermalGenerator = new LiquidHeatGenerator("thermal-generator"){{ - maxLiquidGenerate = 2f; - powerProduction = 2f; - generateEffect = BlockFx.redgeneratespark; - size = 2; - }}; - - turbineGenerator = new TurbineGenerator("turbine-generator"){{ - powerProduction = 0.28f; - itemDuration = 30f; - consumes.liquid(Liquids.water, 0.05f); - size = 2; - }}; - - rtgGenerator = new DecayGenerator("rtg-generator"){{ - size = 2; - powerProduction = 0.3f; - itemDuration = 220f; - }}; - - solarPanel = new SolarGenerator("solar-panel"){{ - powerProduction = 0.0045f; - }}; - - largeSolarPanel = new SolarGenerator("solar-panel-large"){{ - size = 3; - powerProduction = 0.055f; - }}; - - thoriumReactor = new NuclearReactor("thorium-reactor"){{ - size = 3; - health = 700; - powerProduction = 1.1f; - }}; - - fusionReactor = new FusionReactor("fusion-reactor"){{ - size = 4; - health = 600; - }}; - - battery = new Battery("battery"){{ - consumes.powerBuffered(320f, 1f); - }}; - - batteryLarge = new Battery("battery-large"){{ - size = 3; - consumes.powerBuffered(2000f, 1f); - }}; - - powerNode = new PowerNode("power-node"){{ - maxNodes = 4; - laserRange = 6; - }}; - - powerNodeLarge = new PowerNode("power-node-large"){{ - size = 2; - maxNodes = 6; - laserRange = 9.5f; - }}; - - } -} diff --git a/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java deleted file mode 100644 index 101db89ec7..0000000000 --- a/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java +++ /dev/null @@ -1,112 +0,0 @@ -package io.anuke.mindustry.content.blocks; - -import io.anuke.arc.graphics.Color; -import io.anuke.mindustry.content.Items; -import io.anuke.mindustry.content.Liquids; -import io.anuke.mindustry.content.fx.BlockFx; -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.production.Cultivator; -import io.anuke.mindustry.world.blocks.production.Drill; -import io.anuke.mindustry.world.blocks.production.Fracker; -import io.anuke.mindustry.world.blocks.production.SolidPump; - -public class ProductionBlocks extends BlockList implements ContentList{ - public static Block mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, plasmaDrill, waterExtractor, oilExtractor, cultivator; - - @Override - public void load(){ - mechanicalDrill = new Drill("mechanical-drill"){{ - tier = 2; - drillTime = 300; - size = 2; - drawMineItem = true; - }}; - - pneumaticDrill = new Drill("pneumatic-drill"){{ - tier = 3; - drillTime = 240; - size = 2; - drawMineItem = true; - }}; - - laserDrill = new Drill("laser-drill"){{ - drillTime = 140; - size = 2; - hasPower = true; - tier = 4; - updateEffect = BlockFx.pulverizeMedium; - drillEffect = BlockFx.mineBig; - - consumes.power(0.11f); - }}; - - blastDrill = new Drill("blast-drill"){{ - drillTime = 60; - size = 3; - drawRim = true; - hasPower = true; - tier = 5; - updateEffect = BlockFx.pulverizeRed; - updateEffectChance = 0.03f; - drillEffect = BlockFx.mineHuge; - rotateSpeed = 6f; - warmupSpeed = 0.01f; - - consumes.power(0.3f); - }}; - - plasmaDrill = new Drill("plasma-drill"){{ - heatColor = Color.valueOf("ff461b"); - drillTime = 50; - size = 4; - hasLiquids = true; - hasPower = true; - tier = 5; - rotateSpeed = 9f; - drawRim = true; - updateEffect = BlockFx.pulverizeRedder; - updateEffectChance = 0.04f; - drillEffect = BlockFx.mineHuge; - warmupSpeed = 0.005f; - - consumes.power(0.7f); - }}; - - waterExtractor = new SolidPump("water-extractor"){{ - result = Liquids.water; - pumpAmount = 0.065f; - size = 2; - liquidCapacity = 30f; - rotateSpeed = 1.4f; - - consumes.power(0.09f); - }}; - - oilExtractor = new Fracker("oil-extractor"){{ - result = Liquids.oil; - updateEffect = BlockFx.pulverize; - liquidCapacity = 50f; - updateEffectChance = 0.05f; - pumpAmount = 0.09f; - size = 3; - liquidCapacity = 30f; - - consumes.item(Items.sand); - consumes.power(0.3f); - consumes.liquid(Liquids.water, 0.15f); - }}; - - cultivator = new Cultivator("cultivator"){{ - result = Items.biomatter; - drillTime = 200; - size = 2; - hasLiquids = true; - hasPower = true; - - consumes.power(0.08f); - consumes.liquid(Liquids.water, 0.15f); - }}; - - } -} diff --git a/core/src/io/anuke/mindustry/content/blocks/StorageBlocks.java b/core/src/io/anuke/mindustry/content/blocks/StorageBlocks.java deleted file mode 100644 index 9972317a99..0000000000 --- a/core/src/io/anuke/mindustry/content/blocks/StorageBlocks.java +++ /dev/null @@ -1,33 +0,0 @@ -package io.anuke.mindustry.content.blocks; - -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.storage.CoreBlock; -import io.anuke.mindustry.world.blocks.storage.SortedUnloader; -import io.anuke.mindustry.world.blocks.storage.Vault; - -public class StorageBlocks extends BlockList implements ContentList{ - public static Block core, vault, container, unloader; - - @Override - public void load(){ - core = new CoreBlock("core"){{ - health = 1100; - itemCapacity = 3000; - }}; - - vault = new Vault("vault"){{ - size = 3; - itemCapacity = 1000; - }}; - - container = new Vault("container"){{ - size = 2; - itemCapacity = 300; - }}; - - unloader = new SortedUnloader("unloader"){{ - speed = 7f; - }}; - } -} diff --git a/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java b/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java deleted file mode 100644 index 053339535b..0000000000 --- a/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java +++ /dev/null @@ -1,262 +0,0 @@ -package io.anuke.mindustry.content.blocks; - -import io.anuke.arc.Core; -import io.anuke.arc.graphics.Color; -import io.anuke.arc.graphics.g2d.TextureRegion; -import io.anuke.mindustry.content.AmmoTypes; -import io.anuke.mindustry.content.fx.ShootFx; -import io.anuke.mindustry.type.AmmoType; -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.defense.turrets.*; -import io.anuke.arc.graphics.g2d.Draw; -import io.anuke.arc.math.Angles; -import io.anuke.arc.math.Mathf; - -public class TurretBlocks extends BlockList implements ContentList{ - public static Block duo, /*scatter,*/ - scorch, hail, wave, lancer, arc, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown; - - @Override - public void load(){ - duo = new DoubleTurret("duo"){{ - ammoTypes = new AmmoType[]{AmmoTypes.bulletCopper, AmmoTypes.bulletDense, AmmoTypes.bulletPyratite, AmmoTypes.bulletSilicon}; - reload = 25f; - restitution = 0.03f; - range = 90f; - shootCone = 15f; - ammoUseEffect = ShootFx.shellEjectSmall; - health = 80; - inaccuracy = 2f; - rotatespeed = 10f; - }}; - - hail = new ArtilleryTurret("hail"){{ - ammoTypes = new AmmoType[]{AmmoTypes.artilleryDense, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary}; - reload = 60f; - recoil = 2f; - range = 230f; - inaccuracy = 1f; - shootCone = 10f; - health = 120; - }}; - - scorch = new LiquidTurret("scorch"){ - protected TextureRegion shootRegion; - - @Override - public void load(){ - super.load(); - shootRegion = Core.atlas.find(name + "-shoot"); - } - - { - ammoTypes = new AmmoType[]{AmmoTypes.basicFlame}; - recoil = 0f; - reload = 4f; - shootCone = 50f; - ammoUseEffect = ShootFx.shellEjectSmall; - health = 160; - - drawer = (tile, entity) -> Draw.rect(entity.target != null ? shootRegion : region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90); - } - }; - - wave = new LiquidTurret("wave"){{ - ammoTypes = new AmmoType[]{AmmoTypes.water, AmmoTypes.lava, AmmoTypes.cryofluid, AmmoTypes.oil}; - size = 2; - recoil = 0f; - reload = 4f; - inaccuracy = 5f; - shootCone = 50f; - shootEffect = ShootFx.shootLiquid; - range = 90f; - health = 360; - - drawer = (tile, entity) -> { - Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90); - - Draw.color(entity.liquids.current().color); - Draw.alpha(entity.liquids.total() / liquidCapacity); - Draw.rect(name + "-liquid", tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90); - Draw.color(); - }; - }}; - - lancer = new ChargeTurret("lancer"){{ - range = 170f; - chargeTime = 50f; - chargeMaxDelay = 30f; - chargeEffects = 7; - shootType = AmmoTypes.lancerLaser; - recoil = 2f; - reload = 120f; - cooldown = 0.03f; - powerUsed = 1 / 3f; - consumes.powerBuffered(60f); - shootShake = 2f; - shootEffect = ShootFx.lancerLaserShoot; - smokeEffect = ShootFx.lancerLaserShootSmoke; - chargeEffect = ShootFx.lancerLaserCharge; - chargeBeginEffect = ShootFx.lancerLaserChargeBegin; - heatColor = Color.RED; - size = 2; - health = 320; - targetAir = false; - }}; - - arc = new PowerTurret("arc"){{ - shootType = AmmoTypes.arc; - reload = 20f; - shootShake = 0f; - shootCone = 40f; - rotatespeed = 8f; - powerUsed = 1f / 3f; - consumes.powerBuffered(30f); - range = 50f; - shootEffect = ShootFx.lightningShoot; - heatColor = Color.RED; - recoil = 1f; - size = 1; - }}; - - swarmer = new BurstTurret("swarmer"){{ - ammoTypes = new AmmoType[]{AmmoTypes.missileExplosive, AmmoTypes.missileIncindiary, AmmoTypes.missileSurge}; - reload = 50f; - shots = 4; - burstSpacing = 5; - inaccuracy = 10f; - range = 140f; - xRand = 6f; - size = 2; - health = 380; - }}; - - salvo = new BurstTurret("salvo"){ - TextureRegion[] panels = new TextureRegion[2]; - - @Override - public void load() { - super.load(); - panels[0] = Core.atlas.find(name + "-panel-left"); - panels[1] = Core.atlas.find(name + "-panel-right"); - } - - { - size = 2; - range = 120f; - ammoTypes = new AmmoType[]{AmmoTypes.bulletCopper, AmmoTypes.bulletDense, AmmoTypes.bulletPyratite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon}; - reload = 35f; - restitution = 0.03f; - ammoEjectBack = 3f; - cooldown = 0.03f; - recoil = 3f; - shootShake = 2f; - burstSpacing = 4; - shots = 3; - ammoUseEffect = ShootFx.shellEjectBig; - - drawer = (tile, entity) -> { - Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90); - float offsetx = (int) (abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 3f); - float offsety = -(int) (abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 2f); - - for(int i : Mathf.signs){ - float rot = entity.rotation + 90 * i; - Draw.rect(panels[i == -1 ? 0 : 1], - tile.drawx() + tr2.x + Angles.trnsx(rot, offsetx, offsety), - tile.drawy() + tr2.y + Angles.trnsy(rot, -offsetx, offsety), entity.rotation - 90); - } - }; - - health = 360; - } - - /** Converts a value range from 0-1 to a value range 0-1-0. */ - float abscurve(float f){ - return 1f - Math.abs(f - 0.5f) * 2f; - } - }; - - ripple = new ArtilleryTurret("ripple"){{ - ammoTypes = new AmmoType[]{AmmoTypes.artilleryDense, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary, AmmoTypes.artilleryExplosive, AmmoTypes.artilleryPlastic}; - size = 3; - shots = 4; - inaccuracy = 12f; - reload = 60f; - ammoEjectBack = 5f; - ammoUseEffect = ShootFx.shellEjectBig; - cooldown = 0.03f; - velocityInaccuracy = 0.2f; - restitution = 0.02f; - recoil = 6f; - shootShake = 2f; - range = 320f; - - health = 550; - }}; - - cyclone = new ItemTurret("cyclone"){{ - ammoTypes = new AmmoType[]{AmmoTypes.flakExplosive, AmmoTypes.flakPlastic, AmmoTypes.flakSurge}; - xRand = 4f; - reload = 8f; - range = 145f; - size = 3; - recoil = 3f; - rotatespeed = 10f; - inaccuracy = 13f; - shootCone = 30f; - - health = 145 * size * size; - }}; - - fuse = new ItemTurret("fuse"){{ - ammoTypes = new AmmoType[]{AmmoTypes.fuseShotgun}; - reload = 50f; - shootShake = 4f; - range = 80f; - recoil = 5f; - restitution = 0.1f; - size = 3; - - health = 155 * size * size; - }}; - - spectre = new DoubleTurret("spectre"){{ - ammoTypes = new AmmoType[]{AmmoTypes.bulletDenseBig, AmmoTypes.bulletPyratiteBig, AmmoTypes.bulletThoriumBig}; - reload = 6f; - coolantMultiplier = 0.5f; - maxCoolantUsed = 1.5f; - restitution = 0.1f; - ammoUseEffect = ShootFx.shellEjectBig; - range = 200f; - inaccuracy = 3f; - recoil = 3f; - xRand = 3f; - shotWidth = 4f; - shootShake = 2f; - shots = 2; - size = 4; - shootCone = 24f; - - health = 155 * size * size; - }}; - - meltdown = new LaserTurret("meltdown"){{ - shootType = AmmoTypes.meltdownLaser; - shootEffect = ShootFx.shootBigSmoke2; - shootCone = 40f; - recoil = 4f; - size = 4; - shootShake = 2f; - powerUsed = 0.5f; - consumes.powerBuffered(120f); - range = 160f; - reload = 200f; - firingMoveFract = 0.1f; - shootDuration = 220f; - - health = 165 * size * size; - }}; - } -} diff --git a/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java b/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java deleted file mode 100644 index 14ad6cbafa..0000000000 --- a/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java +++ /dev/null @@ -1,95 +0,0 @@ -package io.anuke.mindustry.content.blocks; - -import io.anuke.mindustry.content.Items; -import io.anuke.mindustry.content.UnitTypes; -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.type.ItemStack; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.units.*; - -public class UnitBlocks extends BlockList implements ContentList{ - public static Block - spiritFactory, phantomFactory, - wraithFactory, ghoulFactory, revenantFactory, - daggerFactory, titanFactory, fortressFactory, - reconstructor, repairPoint, commandCenter; - - @Override - public void load(){ - spiritFactory = new UnitFactory("spirit-factory"){{ - type = UnitTypes.spirit; - produceTime = 5700; - size = 2; - consumes.power(0.08f); - consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.lead, 30)); - }}; - - phantomFactory = new UnitFactory("phantom-factory"){{ - type = UnitTypes.phantom; - produceTime = 7300; - size = 2; - consumes.power(0.2f); - consumes.items(new ItemStack(Items.silicon, 70), new ItemStack(Items.lead, 80), new ItemStack(Items.titanium, 80)); - }}; - - wraithFactory = new UnitFactory("wraith-factory"){{ - type = UnitTypes.wraith; - produceTime = 1800; - size = 2; - consumes.power(0.1f); - consumes.items(new ItemStack(Items.silicon, 10), new ItemStack(Items.titanium, 10)); - }}; - - ghoulFactory = new UnitFactory("ghoul-factory"){{ - type = UnitTypes.ghoul; - produceTime = 3600; - size = 3; - consumes.power(0.2f); - consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.titanium, 30), new ItemStack(Items.plastanium, 20)); - }}; - - revenantFactory = new UnitFactory("revenant-factory"){{ - type = UnitTypes.revenant; - produceTime = 8000; - size = 4; - consumes.power(0.3f); - consumes.items(new ItemStack(Items.silicon, 80), new ItemStack(Items.titanium, 80), new ItemStack(Items.plastanium, 50)); - }}; - - daggerFactory = new UnitFactory("dagger-factory"){{ - type = UnitTypes.dagger; - produceTime = 1700; - size = 2; - consumes.power(0.05f); - consumes.items(new ItemStack(Items.silicon, 10)); - }}; - - titanFactory = new UnitFactory("titan-factory"){{ - type = UnitTypes.titan; - produceTime = 3400; - size = 3; - consumes.power(0.15f); - consumes.items(new ItemStack(Items.silicon, 20), new ItemStack(Items.thorium, 30)); - }}; - - fortressFactory = new UnitFactory("fortress-factory"){{ - type = UnitTypes.fortress; - produceTime = 5000; - size = 3; - consumes.power(0.2f); - consumes.items(new ItemStack(Items.silicon, 40), new ItemStack(Items.thorium, 50)); - }}; - - repairPoint = new RepairPoint("repair-point"){{ - repairSpeed = 0.1f; - }}; - - reconstructor = new Reconstructor("reconstructor"){{ - size = 2; - }}; - - commandCenter = new CommandCenter("command-center"){{ - size = 2; - }}; - } -} diff --git a/core/src/io/anuke/mindustry/content/blocks/UpgradeBlocks.java b/core/src/io/anuke/mindustry/content/blocks/UpgradeBlocks.java deleted file mode 100644 index 359033c45e..0000000000 --- a/core/src/io/anuke/mindustry/content/blocks/UpgradeBlocks.java +++ /dev/null @@ -1,61 +0,0 @@ -package io.anuke.mindustry.content.blocks; - -import io.anuke.mindustry.content.Mechs; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.units.MechPad; - -public class UpgradeBlocks extends BlockList{ - public static Block alphaPad, deltaPad, tauPad, omegaPad, dartPad, javelinPad, tridentPad, glaivePad; - - @Override - public void load(){ - - alphaPad = new MechPad("alpha-mech-pad"){{ - mech = Mechs.alpha; - size = 2; - consumes.powerBuffered(50f); - }}; - - deltaPad = new MechPad("delta-mech-pad"){{ - mech = Mechs.delta; - size = 2; - consumes.powerBuffered(70f); - }}; - - tauPad = new MechPad("tau-mech-pad"){{ - mech = Mechs.tau; - size = 2; - consumes.powerBuffered(100f); - }}; - - omegaPad = new MechPad("omega-mech-pad"){{ - mech = Mechs.omega; - size = 3; - consumes.powerBuffered(120f); - }}; - - dartPad = new MechPad("dart-ship-pad"){{ - mech = Mechs.dart; - size = 2; - consumes.powerBuffered(50f); - }}; - - javelinPad = new MechPad("javelin-ship-pad"){{ - mech = Mechs.javelin; - size = 2; - consumes.powerBuffered(80f); - }}; - - tridentPad = new MechPad("trident-ship-pad"){{ - mech = Mechs.trident; - size = 2; - consumes.powerBuffered(100f); - }}; - - glaivePad = new MechPad("glaive-ship-pad"){{ - mech = Mechs.glaive; - size = 3; - consumes.powerBuffered(120f); - }}; - } -} diff --git a/core/src/io/anuke/mindustry/content/bullets/ArtilleryBullets.java b/core/src/io/anuke/mindustry/content/bullets/ArtilleryBullets.java deleted file mode 100644 index 0bb8857f22..0000000000 --- a/core/src/io/anuke/mindustry/content/bullets/ArtilleryBullets.java +++ /dev/null @@ -1,123 +0,0 @@ -package io.anuke.mindustry.content.bullets; - -import io.anuke.mindustry.content.fx.BulletFx; -import io.anuke.mindustry.content.fx.Fx; -import io.anuke.mindustry.entities.bullet.ArtilleryBulletType; -import io.anuke.mindustry.entities.bullet.BasicBulletType; -import io.anuke.mindustry.entities.bullet.BulletType; -import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.game.ContentList; - -public class ArtilleryBullets extends BulletList implements ContentList{ - public static BulletType dense, plastic, plasticFrag, homing, incindiary, explosive, surge, unit; - - @Override - public void load(){ - - dense = new ArtilleryBulletType(3f, 0, "shell"){ - { - hiteffect = BulletFx.flakExplosion; - knockback = 0.8f; - lifetime = 50f; - bulletWidth = bulletHeight = 11f; - collidesTiles = false; - splashDamageRadius = 25f; - splashDamage = 33f; - } - }; - - plasticFrag = new BasicBulletType(2.5f, 6, "bullet"){ - { - bulletWidth = 10f; - bulletHeight = 12f; - bulletShrink = 1f; - lifetime = 15f; - backColor = Palette.plastaniumBack; - frontColor = Palette.plastaniumFront; - despawneffect = Fx.none; - } - }; - - plastic = new ArtilleryBulletType(3.3f, 0, "shell"){ - { - hiteffect = BulletFx.plasticExplosion; - knockback = 1f; - lifetime = 55f; - bulletWidth = bulletHeight = 13f; - collidesTiles = false; - splashDamageRadius = 35f; - splashDamage = 35f; - fragBullet = plasticFrag; - fragBullets = 9; - backColor = Palette.plastaniumBack; - frontColor = Palette.plastaniumFront; - } - }; - - homing = new ArtilleryBulletType(3f, 0, "shell"){ - { - hiteffect = BulletFx.flakExplosion; - knockback = 0.8f; - lifetime = 45f; - bulletWidth = bulletHeight = 11f; - collidesTiles = false; - splashDamageRadius = 25f; - splashDamage = 33f; - homingPower = 2f; - homingRange = 50f; - } - }; - - incindiary = new ArtilleryBulletType(3f, 0, "shell"){ - { - hiteffect = BulletFx.blastExplosion; - knockback = 0.8f; - lifetime = 60f; - bulletWidth = bulletHeight = 13f; - collidesTiles = false; - splashDamageRadius = 25f; - splashDamage = 30f; - incendAmount = 4; - incendSpread = 11f; - frontColor = Palette.lightishOrange; - backColor = Palette.lightOrange; - trailEffect = BulletFx.incendTrail; - } - }; - - explosive = new ArtilleryBulletType(2f, 0, "shell"){ - { - hiteffect = BulletFx.blastExplosion; - knockback = 0.8f; - lifetime = 70f; - bulletWidth = bulletHeight = 14f; - collidesTiles = false; - splashDamageRadius = 45f; - splashDamage = 50f; - backColor = Palette.missileYellowBack; - frontColor = Palette.missileYellow; - } - }; - - unit = new ArtilleryBulletType(2f, 0, "shell"){ - { - hiteffect = BulletFx.blastExplosion; - knockback = 0.8f; - lifetime = 90f; - bulletWidth = bulletHeight = 14f; - collides = true; - collidesTiles = true; - splashDamageRadius = 45f; - splashDamage = 50f; - backColor = Palette.bulletYellowBack; - frontColor = Palette.bulletYellow; - } - }; - - surge = new ArtilleryBulletType(3f, 0, "shell"){ - { - //TODO - } - }; - } -} diff --git a/core/src/io/anuke/mindustry/content/bullets/BulletList.java b/core/src/io/anuke/mindustry/content/bullets/BulletList.java deleted file mode 100644 index cfe4921b93..0000000000 --- a/core/src/io/anuke/mindustry/content/bullets/BulletList.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.anuke.mindustry.content.bullets; - -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.type.ContentType; - -public abstract class BulletList implements ContentList{ - - @Override - public ContentType type(){ - return ContentType.bullet; - } -} diff --git a/core/src/io/anuke/mindustry/content/bullets/FlakBullets.java b/core/src/io/anuke/mindustry/content/bullets/FlakBullets.java deleted file mode 100644 index c13a5b8409..0000000000 --- a/core/src/io/anuke/mindustry/content/bullets/FlakBullets.java +++ /dev/null @@ -1,51 +0,0 @@ -package io.anuke.mindustry.content.bullets; - -import io.anuke.mindustry.content.fx.BulletFx; -import io.anuke.mindustry.entities.bullet.Bullet; -import io.anuke.mindustry.entities.bullet.BulletType; -import io.anuke.mindustry.entities.bullet.FlakBulletType; -import io.anuke.mindustry.entities.effect.Lightning; -import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.game.ContentList; -import io.anuke.arc.math.Mathf; - -public class FlakBullets extends BulletList implements ContentList{ - public static BulletType plastic, explosive, surge; - - @Override - public void load(){ - - - plastic = new FlakBulletType(4f, 5){ - { - splashDamageRadius = 40f; - fragBullet = ArtilleryBullets.plasticFrag; - fragBullets = 4; - hiteffect = BulletFx.plasticExplosion; - frontColor = Palette.plastaniumFront; - backColor = Palette.plastaniumBack; - } - }; - - explosive = new FlakBulletType(4f, 5){ - { - //default bullet type, no changes - } - }; - - surge = new FlakBulletType(4f, 7){ - { - splashDamage = 33f; - } - - @Override - public void despawned(Bullet b) { - super.despawned(b); - - for (int i = 0; i < 2; i++) { - Lightning.create(b.getTeam(), Palette.surge, damage, b.x, b.y, Mathf.random(360f), 12); - } - } - }; - } -} diff --git a/core/src/io/anuke/mindustry/content/bullets/MissileBullets.java b/core/src/io/anuke/mindustry/content/bullets/MissileBullets.java deleted file mode 100644 index a61a98c401..0000000000 --- a/core/src/io/anuke/mindustry/content/bullets/MissileBullets.java +++ /dev/null @@ -1,124 +0,0 @@ -package io.anuke.mindustry.content.bullets; - -import io.anuke.arc.graphics.Color; -import io.anuke.mindustry.content.fx.BulletFx; -import io.anuke.mindustry.entities.bullet.Bullet; -import io.anuke.mindustry.entities.bullet.BulletType; -import io.anuke.mindustry.entities.bullet.MissileBulletType; -import io.anuke.mindustry.entities.effect.Lightning; -import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.game.ContentList; -import io.anuke.arc.util.Time; -import io.anuke.arc.math.Mathf; - -public class MissileBullets extends BulletList implements ContentList{ - public static BulletType explosive, incindiary, surge, javelin, swarm; - - @Override - public void load(){ - - explosive = new MissileBulletType(1.8f, 10, "missile"){ - { - bulletWidth = 8f; - bulletHeight = 8f; - bulletShrink = 0f; - drag = -0.01f; - splashDamageRadius = 30f; - splashDamage = 30f; - lifetime = 150f; - hiteffect = BulletFx.blastExplosion; - despawneffect = BulletFx.blastExplosion; - } - }; - - incindiary = new MissileBulletType(2f, 12, "missile"){ - { - frontColor = Palette.lightishOrange; - backColor = Palette.lightOrange; - bulletWidth = 7f; - bulletHeight = 8f; - bulletShrink = 0f; - drag = -0.01f; - homingPower = 7f; - splashDamageRadius = 10f; - splashDamage = 10f; - lifetime = 160f; - hiteffect = BulletFx.blastExplosion; - incendSpread = 10f; - incendAmount = 3; - } - }; - - surge = new MissileBulletType(3.5f, 15, "bullet"){ - { - bulletWidth = 8f; - bulletHeight = 8f; - bulletShrink = 0f; - drag = -0.01f; - splashDamageRadius = 30f; - splashDamage = 22f; - lifetime = 150f; - hiteffect = BulletFx.blastExplosion; - despawneffect = BulletFx.blastExplosion; - } - - @Override - public void hit(Bullet b) { - super.hit(b); - - for (int i = 0; i < 2; i++) { - Lightning.create(b.getTeam(), Palette.surge, damage, b.x, b.y, Mathf.random(360f), 14); - } - } - }; - - javelin = new MissileBulletType(5f, 10.5f, "missile"){ - { - bulletWidth = 8f; - bulletHeight = 8f; - bulletShrink = 0f; - drag = -0.003f; - keepVelocity = false; - splashDamageRadius = 20f; - splashDamage = 1f; - lifetime = 90f; - trailColor = Color.valueOf("b6c6fd"); - hiteffect = BulletFx.blastExplosion; - despawneffect = BulletFx.blastExplosion; - backColor = Palette.bulletYellowBack; - frontColor = Palette.bulletYellow; - } - - @Override - public void update(Bullet b){ - super.update(b); - b.getVelocity().rotate(Mathf.sin(Time.time() + b.id * 4422, 8f, 2f)); - } - }; - - swarm = new MissileBulletType(2.7f, 12, "missile"){ - { - bulletWidth = 8f; - bulletHeight = 8f; - bulletShrink = 0f; - drag = -0.003f; - homingRange = 60f; - keepVelocity = false; - splashDamageRadius = 25f; - splashDamage = 10f; - lifetime = 120f; - trailColor = Color.GRAY; - backColor = Palette.bulletYellowBack; - frontColor = Palette.bulletYellow; - hiteffect = BulletFx.blastExplosion; - despawneffect = BulletFx.blastExplosion; - } - - @Override - public void update(Bullet b){ - super.update(b); - b.getVelocity().rotate(Mathf.sin(Time.time() + b.id * 4422, 8f, 2f)); - } - }; - } -} diff --git a/core/src/io/anuke/mindustry/content/bullets/StandardBullets.java b/core/src/io/anuke/mindustry/content/bullets/StandardBullets.java deleted file mode 100644 index b67425b83e..0000000000 --- a/core/src/io/anuke/mindustry/content/bullets/StandardBullets.java +++ /dev/null @@ -1,108 +0,0 @@ -package io.anuke.mindustry.content.bullets; - -import io.anuke.arc.graphics.Color; -import io.anuke.mindustry.content.fx.BulletFx; -import io.anuke.mindustry.entities.bullet.BasicBulletType; -import io.anuke.mindustry.entities.bullet.BulletType; -import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.game.ContentList; - -public class StandardBullets extends BulletList implements ContentList{ - public static BulletType copper, dense, thorium, homing, tracer, mechSmall, glaive, denseBig, thoriumBig, tracerBig; - - @Override - public void load(){ - - copper = new BasicBulletType(2.5f, 7, "bullet"){ - { - bulletWidth = 7f; - bulletHeight = 9f; - } - }; - - dense = new BasicBulletType(3.5f, 18, "bullet"){ - { - bulletWidth = 9f; - bulletHeight = 12f; - armorPierce = 0.2f; - } - }; - - thorium = new BasicBulletType(4f, 29, "bullet"){ - { - bulletWidth = 10f; - bulletHeight = 13f; - armorPierce = 0.5f; - } - }; - - homing = new BasicBulletType(3f, 9, "bullet"){ - { - bulletWidth = 7f; - bulletHeight = 9f; - homingPower = 5f; - } - }; - - tracer = new BasicBulletType(3.2f, 11, "bullet"){ - { - bulletWidth = 10f; - bulletHeight = 12f; - frontColor = Palette.lightishOrange; - backColor = Palette.lightOrange; - incendSpread = 3f; - incendAmount = 1; - incendChance = 0.3f; - } - }; - - glaive = new BasicBulletType(4f, 7.5f, "bullet"){ - { - bulletWidth = 10f; - bulletHeight = 12f; - frontColor = Color.valueOf("feb380"); - backColor = Color.valueOf("ea8878"); - incendSpread = 3f; - incendAmount = 1; - incendChance = 0.3f; - } - }; - - mechSmall = new BasicBulletType(4f, 9, "bullet"){ - { - bulletWidth = 11f; - bulletHeight = 14f; - lifetime = 40f; - despawneffect = BulletFx.hitBulletSmall; - } - }; - - denseBig = new BasicBulletType(7f, 42, "bullet"){ - { - bulletWidth = 15f; - bulletHeight = 21f; - armorPierce = 0.2f; - } - }; - - thoriumBig = new BasicBulletType(8f, 65, "bullet"){ - { - bulletWidth = 16f; - bulletHeight = 23f; - armorPierce = 0.5f; - } - }; - - tracerBig = new BasicBulletType(7f, 38, "bullet"){ - { - bulletWidth = 16f; - bulletHeight = 21f; - frontColor = Palette.lightishOrange; - backColor = Palette.lightOrange; - incendSpread = 3f; - incendAmount = 2; - incendChance = 0.3f; - } - }; - } -} diff --git a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java b/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java deleted file mode 100644 index fb0c69b0e2..0000000000 --- a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java +++ /dev/null @@ -1,428 +0,0 @@ -package io.anuke.mindustry.content.bullets; - -import io.anuke.arc.entities.Effects; -import io.anuke.arc.graphics.Color; -import io.anuke.arc.graphics.g2d.CapStyle; -import io.anuke.arc.graphics.g2d.Draw; -import io.anuke.arc.graphics.g2d.Fill; -import io.anuke.arc.graphics.g2d.Lines; -import io.anuke.arc.math.Angles; -import io.anuke.arc.math.Mathf; -import io.anuke.arc.util.Time; -import io.anuke.mindustry.content.Liquids; -import io.anuke.mindustry.content.StatusEffects; -import io.anuke.mindustry.content.fx.BlockFx; -import io.anuke.mindustry.content.fx.BulletFx; -import io.anuke.mindustry.content.fx.EnvironmentFx; -import io.anuke.mindustry.content.fx.Fx; -import io.anuke.mindustry.entities.Damage; -import io.anuke.mindustry.entities.bullet.Bullet; -import io.anuke.mindustry.entities.bullet.BulletType; -import io.anuke.mindustry.entities.bullet.LiquidBulletType; -import io.anuke.mindustry.entities.effect.Fire; -import io.anuke.mindustry.entities.effect.Lightning; -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.graphics.Shapes; -import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.BuildBlock; -import io.anuke.mindustry.world.blocks.distribution.MassDriver.DriverBulletData; - -import static io.anuke.mindustry.Vars.content; -import static io.anuke.mindustry.Vars.world; - -public class TurretBullets extends BulletList implements ContentList{ - public static BulletType fireball, basicFlame, lancerLaser, burstLaser, meltdownLaser, - fuseShot, waterShot, cryoShot, lavaShot, oilShot, lightning, driverBolt, healBullet, arc, damageLightning; - - @Override - public void load(){ - - damageLightning = new BulletType(0.0001f, 0f){ - { - lifetime = Lightning.lifetime; - hiteffect = BulletFx.hitLancer; - despawneffect = Fx.none; - status = StatusEffects.shocked; - statusIntensity = 1f; - } - }; - - healBullet = new BulletType(5.2f, 13){ - float healPercent = 3f; - - { - hiteffect = BulletFx.hitLaser; - despawneffect = BulletFx.hitLaser; - collidesTeam = true; - } - - @Override - public boolean collides(Bullet b, Tile tile){ - return tile.getTeam() != b.getTeam() || tile.entity.healthf() < 1f; - } - - @Override - public void draw(Bullet b){ - Draw.color(Palette.heal); - Lines.stroke(2f); - Lines.lineAngleCenter(b.x, b.y, b.angle(), 7f); - Draw.color(Color.WHITE); - Lines.lineAngleCenter(b.x, b.y, b.angle(), 3f); - Draw.reset(); - } - - @Override - public void hitTile(Bullet b, Tile tile){ - super.hit(b); - tile = tile.target(); - - if(tile != null && tile.getTeam() == b.getTeam() && !(tile.block() instanceof BuildBlock)){ - Effects.effect(BlockFx.healBlockFull, Palette.heal, tile.drawx(), tile.drawy(), tile.block().size); - tile.entity.healBy(healPercent / 100f * tile.entity.maxHealth()); - } - } - }; - - fireball = new BulletType(1f, 4){ - { - pierce = true; - hitTiles = false; - collides = false; - collidesTiles = false; - drag = 0.03f; - hiteffect = despawneffect = Fx.none; - } - - @Override - public void init(Bullet b){ - b.getVelocity().setLength(0.6f + Mathf.random(2f)); - } - - @Override - public void draw(Bullet b){ - //TODO add color to the bullet depending on the color of the flame it came from - Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, b.fin()); - Fill.circle(b.x, b.y, 3f * b.fout()); - Draw.reset(); - } - - @Override - public void update(Bullet b){ - if(Mathf.chance(0.04 * Time.delta())){ - Tile tile = world.tileWorld(b.x, b.y); - if(tile != null){ - Fire.create(tile); - } - } - - if(Mathf.chance(0.1 * Time.delta())){ - Effects.effect(EnvironmentFx.fireballsmoke, b.x, b.y); - } - - if(Mathf.chance(0.1 * Time.delta())){ - Effects.effect(EnvironmentFx.ballfire, b.x, b.y); - } - } - }; - - basicFlame = new BulletType(2.3f, 5){ - { - hitsize = 7f; - lifetime = 35f; - pierce = true; - drag = 0.05f; - hiteffect = BulletFx.hitFlameSmall; - despawneffect = Fx.none; - status = StatusEffects.burning; - } - - @Override - public void draw(Bullet b){ - } - }; - - lancerLaser = new BulletType(0.001f, 60){ - Color[] colors = {Palette.lancerLaser.cpy().mul(1f, 1f, 1f, 0.4f), Palette.lancerLaser, Color.WHITE}; - float[] tscales = {1f, 0.7f, 0.5f, 0.2f}; - float[] lenscales = {1f, 1.1f, 1.13f, 1.14f}; - float length = 170f; - - { - hiteffect = BulletFx.hitLancer; - despawneffect = Fx.none; - hitsize = 4; - lifetime = 16f; - pierce = true; - } - - @Override - public void init(Bullet b){ - Damage.collideLine(b, b.getTeam(), hiteffect, b.x, b.y, b.angle(), length); - } - - @Override - public void draw(Bullet b){ - float f = Mathf.curve(b.fin(), 0f, 0.2f); - float baseLen = length * f; - - Lines.lineAngle(b.x, b.y, b.angle(), baseLen); - for(int s = 0; s < 3; s++){ - Draw.color(colors[s]); - for(int i = 0; i < tscales.length; i++){ - Lines.stroke(7f * b.fout() * (s == 0 ? 1.5f : s == 1 ? 1f : 0.3f) * tscales[i]); - Lines.lineAngle(b.x, b.y, b.angle(), baseLen * lenscales[i]); - } - } - Draw.reset(); - } - }; - - meltdownLaser = new BulletType(0.001f, 26){ - Color tmpColor = new Color(); - Color[] colors = {Color.valueOf("ec745855"), Color.valueOf("ec7458aa"), Color.valueOf("ff9c5a"), Color.WHITE}; - float[] tscales = {1f, 0.7f, 0.5f, 0.2f}; - float[] strokes = {2f, 1.5f, 1f, 0.3f}; - float[] lenscales = {1f, 1.12f, 1.15f, 1.17f}; - float length = 200f; - - { - hiteffect = BulletFx.hitMeltdown; - despawneffect = Fx.none; - hitsize = 4; - drawSize = 420f; - lifetime = 16f; - pierce = true; - } - - @Override - public void update(Bullet b){ - if(b.timer.get(1, 5f)){ - Damage.collideLine(b, b.getTeam(), hiteffect, b.x, b.y, b.angle(), length); - } - Effects.shake(1f, 1f, b.x, b.y); - } - - @Override - public void hit(Bullet b, float hitx, float hity){ - Effects.effect(hiteffect, colors[2], hitx, hity); - if(Mathf.chance(0.4)){ - Fire.create(world.tileWorld(hitx+Mathf.range(5f), hity+Mathf.range(5f))); - } - } - - @Override - public void draw(Bullet b){ - float baseLen = (length) * b.fout(); - - Lines.lineAngle(b.x, b.y, b.angle(), baseLen); - for(int s = 0; s < colors.length; s++){ - Draw.color(tmpColor.set(colors[s]).mul(1f + Mathf.absin(Time.time(), 1f, 0.1f))); - for(int i = 0; i < tscales.length; i++){ - vector.trns(b.angle() + 180f, (lenscales[i] - 1f) * 35f); - Lines.stroke((9f + Mathf.absin(Time.time(), 0.8f, 1.5f)) * b.fout() * strokes[s] * tscales[i]); - Lines.lineAngle(b.x + vector.x, b.y + vector.y, b.angle(), baseLen * lenscales[i], CapStyle.none); - } - } - Draw.reset(); - } - }; - - fuseShot = new BulletType(0.01f, 70){ - int rays = 3; - float raySpace = 2f; - float rayLength = 80f; - { - hiteffect = BulletFx.hitFuse; - lifetime = 13f; - despawneffect = Fx.none; - pierce = true; - } - - @Override - public void init(Bullet b) { - for (int i = 0; i < rays; i++) { - float offset = (i-rays/2)*raySpace; - vector.trns(b.angle(), 0.01f, offset); - Damage.collideLine(b, b.getTeam(), hiteffect, b.x, b.y, b.angle(), rayLength - Math.abs(i - (rays/2))*20f); - } - } - - @Override - public void draw(Bullet b) { - super.draw(b); - Draw.color(Color.WHITE, Palette.surge, b.fin()); - for(int i = 0; i < 7; i++){ - vector.trns(b.angle(), i * 8f); - float sl = Mathf.clamp(b.fout()-0.5f) * (80f - i *10); - Shapes.tri(b.x + vector.x, b.y + vector.y, 4f, sl, b.angle() + 90); - Shapes.tri(b.x + vector.x, b.y + vector.y, 4f, sl, b.angle() - 90); - } - Shapes.tri(b.x, b.y, 13f, (rayLength+50) * b.fout(), b.angle()); - Shapes.tri(b.x, b.y, 13f, 10f * b.fout(), b.angle() + 180f); - Draw.reset(); - } - - //TODO - }; - - waterShot = new LiquidBulletType(Liquids.water){ - { - status = StatusEffects.wet; - statusIntensity = 0.5f; - knockback = 0.65f; - } - }; - cryoShot = new LiquidBulletType(Liquids.cryofluid){ - { - status = StatusEffects.freezing; - statusIntensity = 0.5f; - } - }; - lavaShot = new LiquidBulletType(Liquids.lava){ - { - damage = 4; - speed = 1.9f; - drag = 0.03f; - status = StatusEffects.melting; - statusIntensity = 0.5f; - } - }; - oilShot = new LiquidBulletType(Liquids.oil){ - { - speed = 2f; - drag = 0.03f; - status = StatusEffects.tarred; - statusIntensity = 0.5f; - } - }; - - lightning = new BulletType(0.001f, 12f){ - { - lifetime = 1f; - despawneffect = Fx.none; - hiteffect = BulletFx.hitLancer; - keepVelocity = false; - } - - @Override - public void draw(Bullet b){ - } - - @Override - public void init(Bullet b){ - Lightning.create(b.getTeam(), Palette.lancerLaser, damage, b.x, b.y, b.angle(), 30); - } - }; - - arc = new BulletType(0.001f, 8){ - { - lifetime = 1; - despawneffect = Fx.none; - hiteffect = BulletFx.hitLancer; - } - - @Override - public void draw(Bullet b){ - } - - @Override - public void init(Bullet b){ - Lightning.create(b.getTeam(), Palette.lancerLaser, damage, b.x, b.y, b.angle(), 36); - } - }; - - driverBolt = new BulletType(5.3f, 50){ - { - collidesTiles = false; - lifetime = 200f; - despawneffect = BlockFx.smeltsmoke; - hiteffect = BulletFx.hitBulletBig; - drag = 0.005f; - } - - @Override - public void draw(Bullet b){ - float w = 11f, h = 13f; - - Draw.color(Palette.bulletYellowBack); - Draw.rect("shell-back", b.x, b.y, w, h, b.angle() + 90); - - Draw.color(Palette.bulletYellow); - Draw.rect("shell", b.x, b.y, w, h, b.angle() + 90); - - Draw.reset(); - } - - @Override - public void update(Bullet b){ - //data MUST be an instance of DriverBulletData - if(!(b.getData() instanceof DriverBulletData)){ - hit(b); - return; - } - - float hitDst = 7f; - - DriverBulletData data = (DriverBulletData) b.getData(); - - //if the target is dead, just keep flying until the bullet explodes - if(data.to.isDead()){ - return; - } - - float baseDst = data.from.dst(data.to); - float dst1 = b.dst(data.from); - float dst2 = b.dst(data.to); - - boolean intersect = false; - - //bullet has gone past the destination point: but did it intersect it? - if(dst1 > baseDst){ - float angleTo = b.angleTo(data.to); - float baseAngle = data.to.angleTo(data.from); - - //if angles are nearby, then yes, it did - if(Angles.near(angleTo, baseAngle, 2f)){ - intersect = true; - //snap bullet position back; this is used for low-FPS situations - b.set(data.to.x + Angles.trnsx(baseAngle, hitDst), data.to.y + Angles.trnsy(baseAngle, hitDst)); - } - } - - //if on course and it's in range of the target - if(Math.abs(dst1 + dst2 - baseDst) < 4f && dst2 <= hitDst){ - intersect = true; - } //else, bullet has gone off course, does not get recieved. - - if(intersect){ - data.to.handlePayload(b, data); - } - } - - @Override - public void despawned(Bullet b){ - super.despawned(b); - - if(!(b.getData() instanceof DriverBulletData)) return; - - DriverBulletData data = (DriverBulletData) b.getData(); - data.to.isRecieving = false; - - for(int i = 0; i < data.items.length; i++){ - int amountDropped = Mathf.random(0, data.items[i]); - if(amountDropped > 0){ - float angle = b.angle() + Mathf.range(100f); - Effects.effect(EnvironmentFx.dropItem, Color.WHITE, b.x, b.y, angle, content.item(i)); - } - } - } - - @Override - public void hit(Bullet b, float hitx, float hity){ - super.hit(b, hitx, hity); - despawned(b); - } - }; - } -} diff --git a/core/src/io/anuke/mindustry/content/bullets/WeaponBullets.java b/core/src/io/anuke/mindustry/content/bullets/WeaponBullets.java deleted file mode 100644 index 86adce6b55..0000000000 --- a/core/src/io/anuke/mindustry/content/bullets/WeaponBullets.java +++ /dev/null @@ -1,99 +0,0 @@ -package io.anuke.mindustry.content.bullets; - -import io.anuke.arc.graphics.Color; -import io.anuke.mindustry.content.Liquids; -import io.anuke.mindustry.content.fx.BlockFx; -import io.anuke.mindustry.content.fx.BulletFx; -import io.anuke.mindustry.entities.bullet.BasicBulletType; -import io.anuke.mindustry.entities.bullet.BombBulletType; -import io.anuke.mindustry.entities.bullet.Bullet; -import io.anuke.mindustry.entities.bullet.BulletType; -import io.anuke.mindustry.entities.effect.Fire; -import io.anuke.mindustry.entities.effect.Puddle; -import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.world.Tile; -import io.anuke.arc.math.Mathf; - -import static io.anuke.mindustry.Vars.world; - -public class WeaponBullets extends BulletList{ - public static BulletType tungstenShotgun, bombExplosive, bombIncendiary, bombOil, shellCarbide; - - @Override - public void load(){ - tungstenShotgun = new BasicBulletType(5f, 8, "bullet"){ - { - bulletWidth = 8f; - bulletHeight = 9f; - bulletShrink = 0.5f; - lifetime = 50f; - drag = 0.04f; - } - }; - - bombExplosive = new BombBulletType(10f, 20f, "shell"){ - { - bulletWidth = 9f; - bulletHeight = 13f; - hiteffect = BulletFx.flakExplosion; - } - }; - - bombIncendiary = new BombBulletType(7f, 10f, "shell"){ - { - bulletWidth = 8f; - bulletHeight = 12f; - hiteffect = BulletFx.flakExplosion; - backColor = Palette.lightOrange; - frontColor = Palette.lightishOrange; - } - - @Override - public void hit(Bullet b, float x, float y){ - super.hit(b, x, y); - - for(int i = 0; i < 3; i++){ - float cx = x + Mathf.range(10f); - float cy = y + Mathf.range(10f); - Tile tile = world.tileWorld(cx, cy); - if(tile != null){ - Fire.create(tile); - } - } - } - }; - - bombOil = new BombBulletType(2f, 3f, "shell"){ - { - bulletWidth = 8f; - bulletHeight = 12f; - hiteffect = BlockFx.pulverize; - backColor = new Color(0x4f4f4fff); - frontColor = Color.GRAY; - } - - @Override - public void hit(Bullet b, float x, float y){ - super.hit(b, x, y); - - for(int i = 0; i < 3; i++){ - Tile tile = world.tileWorld(x + Mathf.range(8f), y + Mathf.range(8f)); - Puddle.deposit(tile, Liquids.oil, 5f); - } - } - }; - - shellCarbide = new BasicBulletType(3.4f, 20, "bullet"){ - { - bulletWidth = 10f; - bulletHeight = 12f; - bulletShrink = 0.4f; - lifetime = 40f; - drag = 0.025f; - fragBullets = 5; - hiteffect = BulletFx.flakExplosion; - fragBullet = tungstenShotgun; - } - }; - } -} diff --git a/core/src/io/anuke/mindustry/content/fx/BlockFx.java b/core/src/io/anuke/mindustry/content/fx/BlockFx.java deleted file mode 100644 index 106582a241..0000000000 --- a/core/src/io/anuke/mindustry/content/fx/BlockFx.java +++ /dev/null @@ -1,330 +0,0 @@ -package io.anuke.mindustry.content.fx; - -import io.anuke.arc.graphics.Color; -import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect; -import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.game.ContentList; -import io.anuke.arc.entities.Effects.Effect; -import io.anuke.arc.graphics.g2d.Draw; -import io.anuke.arc.graphics.g2d.Fill; -import io.anuke.arc.graphics.g2d.Lines; -import io.anuke.arc.math.Angles; -import io.anuke.arc.math.Mathf; -import io.anuke.arc.util.Tmp; - -import static io.anuke.mindustry.Vars.tilesize; - -public class BlockFx extends FxList implements ContentList{ - public static Effect reactorsmoke, nuclearsmoke, nuclearcloud, redgeneratespark, generatespark, fuelburn, plasticburn, - pulverize, pulverizeRed, pulverizeRedder, pulverizeSmall, pulverizeMedium, producesmoke, smeltsmoke, formsmoke, blastsmoke, - lava, dooropen, doorclose, dooropenlarge, doorcloselarge, purify, purifyoil, purifystone, generate, mine, mineBig, mineHuge, - smelt, teleportActivate, teleport, teleportOut, ripple, bubble, commandSend, healBlock, healBlockFull, healWaveMend, overdriveWave, - overdriveBlockFull, shieldBreak; - - @Override - public void load(){ - - reactorsmoke = new Effect(17, e -> { - Angles.randLenVectors(e.id, 4, e.fin() * 8f, (x, y) -> { - float size = 1f + e.fout() * 5f; - Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin()); - Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); - }); - }); - nuclearsmoke = new Effect(40, e -> { - Angles.randLenVectors(e.id, 4, e.fin() * 13f, (x, y) -> { - float size = e.fslope() * 4f; - Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin()); - Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); - }); - }); - nuclearcloud = new Effect(90, 200f, e -> { - Angles.randLenVectors(e.id, 10, e.finpow() * 90f, (x, y) -> { - float size = e.fout() * 14f; - Draw.color(Color.LIME, Color.GRAY, e.fin()); - Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); - }); - }); - redgeneratespark = new Effect(18, e -> { - Angles.randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> { - float len = e.fout() * 4f; - Draw.color(Palette.redSpark, Color.GRAY, e.fin()); - //Draw.alpha(e.fout()); - Draw.rect("circle", e.x + x, e.y + y, len, len); - Draw.reset(); - }); - }); - generatespark = new Effect(18, e -> { - Angles.randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> { - float len = e.fout() * 4f; - Draw.color(Palette.orangeSpark, Color.GRAY, e.fin()); - Draw.rect("circle", e.x + x, e.y + y, len, len); - Draw.reset(); - }); - }); - fuelburn = new Effect(23, e -> { - Angles.randLenVectors(e.id, 5, e.fin() * 9f, (x, y) -> { - float len = e.fout() * 4f; - Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin()); - Draw.rect("circle", e.x + x, e.y + y, len, len); - Draw.reset(); - }); - }); - plasticburn = new Effect(40, e -> { - Angles.randLenVectors(e.id, 5, 3f + e.fin() * 5f, (x, y) -> { - Draw.color(Color.valueOf("e9ead3"), Color.GRAY, e.fin()); - Fill.circle(e.x + x, e.y + y, e.fout() * 1f); - Draw.reset(); - }); - }); - pulverize = new Effect(40, e -> { - Angles.randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { - Draw.color(Palette.stoneGray); - Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45); - Draw.reset(); - }); - }); - pulverizeRed = new Effect(40, e -> { - Angles.randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { - Draw.color(Palette.redDust, Palette.stoneGray, e.fin()); - Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45); - Draw.reset(); - }); - }); - pulverizeRedder = new Effect(40, e -> { - Angles.randLenVectors(e.id, 5, 3f + e.fin() * 9f, (x, y) -> { - Draw.color(Palette.redderDust, Palette.stoneGray, e.fin()); - Fill.square(e.x + x, e.y + y, e.fout() * 2.5f + 0.5f, 45); - Draw.reset(); - }); - }); - pulverizeSmall = new Effect(30, e -> { - Angles.randLenVectors(e.id, 3, e.fin() * 5f, (x, y) -> { - Draw.color(Palette.stoneGray); - Fill.square(e.x + x, e.y + y, e.fout() * 1f + 0.5f, 45); - Draw.reset(); - }); - }); - pulverizeMedium = new Effect(30, e -> { - Angles.randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { - Draw.color(Palette.stoneGray); - Fill.square(e.x + x, e.y + y, e.fout() * 1f + 0.5f, 45); - Draw.reset(); - }); - }); - producesmoke = new Effect(12, e -> { - Angles.randLenVectors(e.id, 8, 4f + e.fin() * 18f, (x, y) -> { - Draw.color(Color.WHITE, Palette.accent, e.fin()); - Fill.square(e.x + x, e.y + y, 1f + e.fout() * 3f, 45); - Draw.reset(); - }); - }); - smeltsmoke = new Effect(15, e -> { - Angles.randLenVectors(e.id, 6, 4f + e.fin() * 5f, (x, y) -> { - Draw.color(Color.WHITE, e.color, e.fin()); - Fill.square(e.x + x, e.y + y, 0.5f + e.fout() * 2f, 45); - Draw.reset(); - }); - }); - formsmoke = new Effect(40, e -> { - Angles.randLenVectors(e.id, 6, 5f + e.fin() * 8f, (x, y) -> { - Draw.color(Palette.plasticSmoke, Color.LIGHT_GRAY, e.fin()); - Fill.square(e.x + x, e.y + y, 0.2f + e.fout() * 2f, 45); - Draw.reset(); - }); - }); - blastsmoke = new Effect(26, e -> { - Angles.randLenVectors(e.id, 12, 1f + e.fin() * 23f, (x, y) -> { - float size = 2f + e.fout() * 6f; - Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.fin()); - Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); - }); - }); - lava = new Effect(18, e -> { - Angles.randLenVectors(e.id, 3, 1f + e.fin() * 10f, (x, y) -> { - float size = e.fslope() * 4f; - Draw.color(Color.ORANGE, Color.GRAY, e.fin()); - Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); - }); - }); - dooropen = new Effect(10, e -> { - Lines.stroke(e.fout() * 1.6f); - Lines.square(e.x, e.y, tilesize / 2f + e.fin() * 2f); - Draw.reset(); - }); - doorclose = new Effect(10, e -> { - Lines.stroke(e.fout() * 1.6f); - Lines.square(e.x, e.y, tilesize / 2f + e.fout() * 2f); - Draw.reset(); - }); - dooropenlarge = new Effect(10, e -> { - Lines.stroke(e.fout() * 1.6f); - Lines.square(e.x, e.y, tilesize + e.fin() * 2f); - Draw.reset(); - }); - doorcloselarge = new Effect(10, e -> { - Lines.stroke(e.fout() * 1.6f); - Lines.square(e.x, e.y, tilesize + e.fout() * 2f); - Draw.reset(); - }); - purify = new Effect(10, e -> { - Draw.color(Color.ROYAL, Color.GRAY, e.fin()); - Lines.stroke(2f); - Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6); - Draw.reset(); - }); - purifyoil = new Effect(10, e -> { - Draw.color(Color.BLACK, Color.GRAY, e.fin()); - Lines.stroke(2f); - Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6); - Draw.reset(); - }); - purifystone = new Effect(10, e -> { - Draw.color(Color.ORANGE, Color.GRAY, e.fin()); - Lines.stroke(2f); - Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6); - Draw.reset(); - }); - generate = new Effect(11, e -> { - Draw.color(Color.ORANGE, Color.YELLOW, e.fin()); - Lines.stroke(1f); - Lines.spikes(e.x, e.y, e.fin() * 5f, 2, 8); - Draw.reset(); - }); - mine = new Effect(20, e -> { - Angles.randLenVectors(e.id, 6, 3f + e.fin() * 6f, (x, y) -> { - Draw.color(e.color, Color.LIGHT_GRAY, e.fin()); - Fill.square(e.x + x, e.y + y, e.fout() * 2f, 45); - Draw.reset(); - }); - }); - mineBig = new Effect(30, e -> { - Angles.randLenVectors(e.id, 6, 4f + e.fin() * 8f, (x, y) -> { - Draw.color(e.color, Color.LIGHT_GRAY, e.fin()); - Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.2f, 45); - Draw.reset(); - }); - }); - mineHuge = new Effect(40, e -> { - Angles.randLenVectors(e.id, 8, 5f + e.fin() * 10f, (x, y) -> { - Draw.color(e.color, Color.LIGHT_GRAY, e.fin()); - Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45); - Draw.reset(); - }); - }); - smelt = new Effect(20, e -> { - Angles.randLenVectors(e.id, 6, 2f + e.fin() * 5f, (x, y) -> { - Draw.color(Color.WHITE, e.color, e.fin()); - Fill.square(e.x + x, e.y + y, 0.5f + e.fout() * 2f, 45); - Draw.reset(); - }); - }); - teleportActivate = new Effect(50, e -> { - Draw.color(e.color); - - e.scaled(8f, e2 -> { - Lines.stroke(e2.fout() * 4f); - Lines.circle(e2.x, e2.y, 4f + e2.fin() * 27f); - }); - - Lines.stroke(e.fout() * 2f); - - Angles.randLenVectors(e.id, 30, 4f + 40f * e.fin(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f); - }); - - Draw.reset(); - }); - teleport = new Effect(60, e -> { - Draw.color(e.color); - Lines.stroke(e.fin() * 2f); - Lines.circle(e.x, e.y, 7f + e.fout() * 8f); - - Angles.randLenVectors(e.id, 20, 6f + 20f * e.fout(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f); - }); - - Draw.reset(); - }); - teleportOut = new Effect(20, e -> { - Draw.color(e.color); - Lines.stroke(e.fout() * 2f); - Lines.circle(e.x, e.y, 7f + e.fin() * 8f); - - Angles.randLenVectors(e.id, 20, 4f + 20f * e.fin(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 4f + 1f); - }); - - Draw.reset(); - }); - ripple = new GroundEffect(false, 30, e -> { - Draw.color(Tmp.c1.set(e.color).shiftValue(0.1f)); - Lines.stroke(e.fout() + 0.4f); - Lines.circle(e.x, e.y, 2f + e.fin() * 4f); - Draw.reset(); - }); - - bubble = new Effect(20, e -> { - Draw.color(Tmp.c1.set(e.color).shiftValue(0.1f)); - Lines.stroke(e.fout() + 0.2f); - Angles.randLenVectors(e.id, 2, 8f, (x, y) -> { - Lines.circle(e.x + x, e.y + y, 1f + e.fin() * 3f); - }); - Draw.reset(); - }); - - commandSend = new Effect(28, e -> { - Draw.color(Palette.command); - Lines.stroke(e.fout() * 2f); - Lines.poly(e.x, e.y, 40, 4f + e.finpow() * 120f); - Draw.color(); - }); - - healWaveMend = new Effect(40, e -> { - Draw.color(e.color); - Lines.stroke(e.fout() * 2f); - Lines.poly(e.x, e.y, 30, e.finpow() * e.rotation); - Draw.color(); - }); - - overdriveWave = new Effect(50, e -> { - Draw.color(e.color); - Lines.stroke(e.fout() * 1f); - Lines.poly(e.x, e.y, 30, e.finpow() * e.rotation); - Draw.color(); - }); - - healBlock = new Effect(20, e -> { - Draw.color(Palette.heal); - Lines.stroke(2f * e.fout() + 0.5f); - Lines.square(e.x, e.y, 1f + (e.fin() * e.rotation * tilesize/2f-1f)); - Draw.color(); - }); - - healBlockFull = new Effect(20, e -> { - Draw.color(e.color); - Draw.alpha(e.fout()); - Fill.square(e.x, e.y, e.rotation * tilesize / 2f); - Draw.color(); - }); - - overdriveBlockFull = new Effect(60, e -> { - Draw.color(e.color); - Draw.alpha(e.fslope() * 0.4f); - Fill.square(e.x, e.y, e.rotation * tilesize); - Draw.color(); - }); - - shieldBreak = new Effect(40, e -> { - Draw.color(Palette.accent); - Lines.stroke(3f * e.fout()); - Lines.poly(e.x, e.y, 6, e.rotation + e.fin(), 90); - Draw.reset(); - }); - } -} diff --git a/core/src/io/anuke/mindustry/content/fx/BulletFx.java b/core/src/io/anuke/mindustry/content/fx/BulletFx.java deleted file mode 100644 index 3c6441b876..0000000000 --- a/core/src/io/anuke/mindustry/content/fx/BulletFx.java +++ /dev/null @@ -1,281 +0,0 @@ -package io.anuke.mindustry.content.fx; - -import io.anuke.arc.graphics.Color; -import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.game.ContentList; -import io.anuke.arc.entities.Effects.Effect; -import io.anuke.arc.graphics.g2d.Draw; -import io.anuke.arc.graphics.g2d.Fill; -import io.anuke.arc.graphics.g2d.Lines; -import io.anuke.arc.math.Angles; -import io.anuke.arc.math.Mathf; - -public class BulletFx extends FxList implements ContentList{ - public static Effect hitBulletSmall, hitFuse, hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, hitMeltdown, despawn, flakExplosion, blastExplosion, plasticExplosion, - artilleryTrail, incendTrail, missileTrail, absorb, flakExplosionBig, plasticExplosionFlak; - - @Override - public void load(){ - - hitBulletSmall = new Effect(14, e -> { - Draw.color(Color.WHITE, Palette.lightOrange, e.fin()); - - e.scaled(7f, s -> { - Lines.stroke(0.5f + s.fout()); - Lines.circle(e.x, e.y, s.fin()*5f); - }); - - - Lines.stroke(0.5f + e.fout()); - - Angles.randLenVectors(e.id, 5, e.fin() * 15f, (x, y) -> { - float ang = Mathf.angle(x, y); - Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f); - }); - - Draw.reset(); - }); - - hitFuse = new Effect(14, e -> { - Draw.color(Color.WHITE, Palette.surge, e.fin()); - - e.scaled(7f, s -> { - Lines.stroke(0.5f + s.fout()); - Lines.circle(e.x, e.y, s.fin()*7f); - }); - - - Lines.stroke(0.5f + e.fout()); - - Angles.randLenVectors(e.id, 6, e.fin() * 15f, (x, y) -> { - float ang = Mathf.angle(x, y); - Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f); - }); - - Draw.reset(); - }); - - hitBulletBig = new Effect(13, e -> { - Draw.color(Color.WHITE, Palette.lightOrange, e.fin()); - Lines.stroke(0.5f + e.fout() * 1.5f); - - Angles.randLenVectors(e.id, 8, e.finpow() * 30f, e.rotation, 50f, (x, y) -> { - float ang = Mathf.angle(x, y); - Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1.5f); - }); - - Draw.reset(); - }); - - hitFlameSmall = new Effect(14, e -> { - Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin()); - Lines.stroke(0.5f + e.fout()); - - Angles.randLenVectors(e.id, 5, e.fin() * 15f, e.rotation, 50f, (x, y) -> { - float ang = Mathf.angle(x, y); - Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f); - }); - - Draw.reset(); - }); - - hitLiquid = new Effect(16, e -> { - Draw.color(e.color); - - Angles.randLenVectors(e.id, 5, e.fin() * 15f, e.rotation + 180f, 60f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 2f); - }); - - Draw.reset(); - }); - - hitLancer = new Effect(12, e -> { - Draw.color(Color.WHITE); - Lines.stroke(e.fout() * 1.5f); - - Angles.randLenVectors(e.id, 8, e.finpow() * 17f, e.rotation, 360f, (x, y) -> { - float ang = Mathf.angle(x, y); - Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f); - }); - - Draw.reset(); - }); - - hitMeltdown = new Effect(12, e -> { - Draw.color(Palette.meltdownHit); - Lines.stroke(e.fout() * 2f); - - Angles.randLenVectors(e.id, 6, e.finpow() * 18f, e.rotation, 360f, (x, y) -> { - float ang = Mathf.angle(x, y); - Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f); - }); - - Draw.reset(); - }); - - hitLaser = new Effect(8, e -> { - Draw.color(Color.WHITE, Palette.heal, e.fin()); - Lines.stroke(0.5f + e.fout()); - Lines.circle(e.x, e.y, e.fin()*5f); - Draw.reset(); - }); - - despawn = new Effect(12, e -> { - Draw.color(Palette.lighterOrange, Color.GRAY, e.fin()); - Lines.stroke(e.fout()); - - Angles.randLenVectors(e.id, 7, e.fin() * 7f, e.rotation, 40f, (x, y) -> { - float ang = Mathf.angle(x, y); - Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 2 + 1f); - }); - - Draw.reset(); - }); - - flakExplosion = new Effect(20, e -> { - - Draw.color(Palette.bulletYellow); - e.scaled(6, i -> { - Lines.stroke(3f * i.fout()); - Lines.circle(e.x, e.y, 3f + i.fin() * 10f); - }); - - Draw.color(Color.GRAY); - - Angles.randLenVectors(e.id, 5, 2f + 23f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f); - }); - - Draw.color(Palette.lighterOrange); - Lines.stroke(1f * e.fout()); - - Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); - }); - - Draw.reset(); - }); - - plasticExplosion = new Effect(24, e -> { - - Draw.color(Palette.plastaniumFront); - e.scaled(7, i -> { - Lines.stroke(3f * i.fout()); - Lines.circle(e.x, e.y, 3f + i.fin() * 24f); - }); - - Draw.color(Color.GRAY); - - Angles.randLenVectors(e.id, 7, 2f + 28f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f); - }); - - Draw.color(Palette.plastaniumBack); - Lines.stroke(1f * e.fout()); - - Angles.randLenVectors(e.id + 1, 4, 1f + 25f * e.finpow(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); - }); - - Draw.reset(); - }); - - plasticExplosionFlak = new Effect(28, e -> { - - Draw.color(Palette.plastaniumFront); - e.scaled(7, i -> { - Lines.stroke(3f * i.fout()); - Lines.circle(e.x, e.y, 3f + i.fin() * 34f); - }); - - Draw.color(Color.GRAY); - - Angles.randLenVectors(e.id, 7, 2f + 30f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f); - }); - - Draw.color(Palette.plastaniumBack); - Lines.stroke(1f * e.fout()); - - Angles.randLenVectors(e.id + 1, 4, 1f + 30f * e.finpow(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); - }); - - Draw.reset(); - }); - - blastExplosion = new Effect(22, e -> { - - Draw.color(Palette.missileYellow); - e.scaled(6, i -> { - Lines.stroke(3f * i.fout()); - Lines.circle(e.x, e.y, 3f + i.fin() * 15f); - }); - - Draw.color(Color.GRAY); - - Angles.randLenVectors(e.id, 5, 2f + 23f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f); - }); - - Draw.color(Palette.missileYellowBack); - Lines.stroke(1f * e.fout()); - - Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); - }); - - Draw.reset(); - }); - - artilleryTrail = new Effect(50, e -> { - Draw.color(e.color); - Fill.circle(e.x, e.y, e.rotation * e.fout()); - Draw.reset(); - }); - - incendTrail = new Effect(50, e -> { - Draw.color(Palette.lightOrange); - Fill.circle(e.x, e.y, e.rotation * e.fout()); - Draw.reset(); - }); - - missileTrail = new Effect(50, e -> { - Draw.color(e.color); - Fill.circle(e.x, e.y, e.rotation * e.fout()); - Draw.reset(); - }); - - absorb = new Effect(12, e -> { - Draw.color(Palette.accent); - Lines.stroke(2f * e.fout()); - Lines.circle(e.x, e.y, 5f * e.fout()); - Draw.reset(); - }); - - flakExplosionBig = new Effect(30, e -> { - - Draw.color(Palette.bulletYellowBack); - e.scaled(6, i -> { - Lines.stroke(3f * i.fout()); - Lines.circle(e.x, e.y, 3f + i.fin() * 25f); - }); - - Draw.color(Color.GRAY); - - Angles.randLenVectors(e.id, 6, 2f + 23f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f); - }); - - Draw.color(Palette.bulletYellow); - Lines.stroke(1f * e.fout()); - - Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); - }); - - Draw.reset(); - }); - } - -} diff --git a/core/src/io/anuke/mindustry/content/fx/EnvironmentFx.java b/core/src/io/anuke/mindustry/content/fx/EnvironmentFx.java deleted file mode 100644 index 16b3c5e85a..0000000000 --- a/core/src/io/anuke/mindustry/content/fx/EnvironmentFx.java +++ /dev/null @@ -1,137 +0,0 @@ -package io.anuke.mindustry.content.fx; - -import io.anuke.arc.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.Angles; -import io.anuke.arc.math.Mathf; -import io.anuke.mindustry.content.Liquids; -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.type.Item; - -public class EnvironmentFx extends FxList implements ContentList{ - public static Effect burning, fire, smoke, steam, fireballsmoke, ballfire, freezing, melting, wet, oily, overdriven, dropItem; - - @Override - public void load(){ - - burning = new Effect(35f, e -> { - Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin()); - - Angles.randLenVectors(e.id, 3, 2f + e.fin() * 7f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.1f + e.fout() * 1.4f); - }); - - Draw.color(); - }); - - fire = new Effect(35f, e -> { - Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin()); - - Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f); - }); - - Draw.color(); - }); - - smoke = new Effect(35f, e -> { - Draw.color(Color.GRAY); - - Angles.randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f); - }); - - Draw.color(); - }); - - steam = new Effect(35f, e -> { - Draw.color(Color.LIGHT_GRAY); - - Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f); - }); - - Draw.color(); - }); - - fireballsmoke = new Effect(25f, e -> { - Draw.color(Color.GRAY); - - Angles.randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f); - }); - - Draw.color(); - }); - - ballfire = new Effect(25f, e -> { - Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin()); - - Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f); - }); - - Draw.color(); - }); - - freezing = new Effect(40f, e -> { - Draw.color(Liquids.cryofluid.color); - - Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 1.2f); - }); - - Draw.color(); - }); - - melting = new Effect(40f, e -> { - Draw.color(Liquids.lava.color, Color.WHITE, e.fout() / 5f + Mathf.randomSeedRange(e.id, 0.12f)); - - Angles.randLenVectors(e.id, 2, 1f + e.fin() * 3f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, .2f + e.fout() * 1.2f); - }); - - Draw.color(); - }); - - wet = new Effect(40f, e -> { - Draw.color(Liquids.water.color); - - Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 1f); - }); - - Draw.color(); - }); - - oily = new Effect(42f, e -> { - Draw.color(Liquids.oil.color); - - Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 1f); - }); - - Draw.color(); - }); - - overdriven = new Effect(20f, e -> { - Draw.color(Palette.accent); - - Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { - Fill.square(e.x + x, e.y + y, e.fout() * 2.3f+0.5f); - }); - - Draw.color(); - }); - - dropItem = new Effect(20f, e -> { - float length = 20f * e.finpow(); - float size = 7f * e.fout(); - - Draw.rect(((Item) e.data).region, e.x + Angles.trnsx(e.rotation, length), e.y + Angles.trnsy(e.rotation, length), size, size); - }); - } -} diff --git a/core/src/io/anuke/mindustry/content/fx/ExplosionFx.java b/core/src/io/anuke/mindustry/content/fx/ExplosionFx.java deleted file mode 100644 index 6d823b0e48..0000000000 --- a/core/src/io/anuke/mindustry/content/fx/ExplosionFx.java +++ /dev/null @@ -1,97 +0,0 @@ -package io.anuke.mindustry.content.fx; - -import io.anuke.arc.graphics.Color; -import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.game.ContentList; -import io.anuke.arc.entities.Effects.Effect; -import io.anuke.arc.graphics.g2d.Draw; -import io.anuke.arc.graphics.g2d.Fill; -import io.anuke.arc.graphics.g2d.Lines; -import io.anuke.arc.math.Angles; -import io.anuke.arc.math.Mathf; - -public class ExplosionFx extends FxList implements ContentList{ - public static Effect shockwave, bigShockwave, nuclearShockwave, explosion, blockExplosion, blockExplosionSmoke; - - @Override - public void load(){ - - shockwave = new Effect(10f, 80f, e -> { - Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin()); - Lines.stroke(e.fout() * 2f + 0.2f); - Lines.circle(e.x, e.y, e.fin() * 28f); - Draw.reset(); - }); - - bigShockwave = new Effect(10f, 80f, e -> { - Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin()); - Lines.stroke(e.fout() * 3f); - Lines.circle(e.x, e.y, e.fin() * 50f); - Draw.reset(); - }); - - nuclearShockwave = new Effect(10f, 200f, e -> { - Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin()); - Lines.stroke(e.fout() * 3f + 0.2f); - Lines.poly(e.x, e.y, 40, e.fin() * 140f); - Draw.reset(); - }); - - explosion = new Effect(30, e -> { - e.scaled(7, i -> { - Lines.stroke(3f * i.fout()); - Lines.circle(e.x, e.y, 3f + i.fin() * 10f); - }); - - Draw.color(Color.GRAY); - - Angles.randLenVectors(e.id, 6, 2f + 19f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f); - Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f); - }); - - Draw.color(Palette.lighterOrange, Palette.lightOrange, Color.GRAY, e.fin()); - Lines.stroke(1.5f * e.fout()); - - Angles.randLenVectors(e.id + 1, 8, 1f + 23f * e.finpow(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); - }); - - Draw.reset(); - }); - - blockExplosion = new Effect(30, e -> { - e.scaled(7, i -> { - Lines.stroke(3.1f * i.fout()); - Lines.circle(e.x, e.y, 3f + i.fin() * 14f); - }); - - Draw.color(Color.GRAY); - - Angles.randLenVectors(e.id, 6, 2f + 19f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f); - Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f); - }); - - Draw.color(Palette.lighterOrange, Palette.lightOrange, Color.GRAY, e.fin()); - Lines.stroke(1.7f * e.fout()); - - Angles.randLenVectors(e.id + 1, 9, 1f + 23f * e.finpow(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); - }); - - Draw.reset(); - }); - - blockExplosionSmoke = new Effect(30, e -> { - Draw.color(Color.GRAY); - - Angles.randLenVectors(e.id, 6, 4f + 30f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 3f); - Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f); - }); - - Draw.reset(); - }); - } -} diff --git a/core/src/io/anuke/mindustry/content/fx/Fx.java b/core/src/io/anuke/mindustry/content/fx/Fx.java deleted file mode 100644 index e544459e79..0000000000 --- a/core/src/io/anuke/mindustry/content/fx/Fx.java +++ /dev/null @@ -1,69 +0,0 @@ -package io.anuke.mindustry.content.fx; - -import io.anuke.arc.graphics.Color; -import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.game.ContentList; -import io.anuke.arc.entities.Effects.Effect; -import io.anuke.arc.graphics.g2d.Draw; -import io.anuke.arc.graphics.g2d.Fill; -import io.anuke.arc.graphics.g2d.Lines; -import io.anuke.arc.math.Angles; - -import static io.anuke.mindustry.Vars.tilesize; - -public class Fx extends FxList implements ContentList{ - public static Effect none, placeBlock, breakBlock, smoke, spawn, tapBlock, select; - - @Override - public void load(){ - - none = new Effect(0, 0f, e -> { - }); - - placeBlock = new Effect(16, e -> { - Draw.color(Palette.accent); - Lines.stroke(3f - e.fin() * 2f); - Lines.square(e.x, e.y, tilesize / 2f * e.rotation + e.fin() * 3f); - Draw.reset(); - }); - - tapBlock = new Effect(12, e -> { - Draw.color(Palette.accent); - Lines.stroke(3f - e.fin() * 2f); - Lines.circle(e.x, e.y, 4f + (tilesize / 1.5f * e.rotation) * e.fin()); - Draw.reset(); - }); - - breakBlock = new Effect(12, e -> { - Draw.color(Palette.remove); - Lines.stroke(3f - e.fin() * 2f); - Lines.square(e.x, e.y, tilesize / 2f * e.rotation + e.fin() * 3f); - - Angles.randLenVectors(e.id, 3 + (int) (e.rotation * 3), e.rotation * 2f + (tilesize * e.rotation) * e.finpow(), (x, y) -> { - Fill.square(e.x + x, e.y + y, 1f + e.fout() * (3f + e.rotation)); - }); - Draw.reset(); - }); - - select = new Effect(23, e -> { - Draw.color(Palette.accent); - Lines.stroke(e.fout() * 3f); - Lines.circle(e.x, e.y, 3f + e.fin() * 14f); - Draw.reset(); - }); - - smoke = new Effect(100, e -> { - Draw.color(Color.GRAY, Palette.darkishGray, e.fin()); - float size = 7f - e.fin() * 7f; - Draw.rect("circle", e.x, e.y, size, size); - Draw.reset(); - }); - - spawn = new Effect(23, e -> { - Lines.stroke(2f * e.fout()); - Draw.color(Palette.accent); - Lines.poly(e.x, e.y, 4, 3f + e.fin() * 8f); - Draw.reset(); - }); - } -} diff --git a/core/src/io/anuke/mindustry/content/fx/FxList.java b/core/src/io/anuke/mindustry/content/fx/FxList.java deleted file mode 100644 index 3809d32391..0000000000 --- a/core/src/io/anuke/mindustry/content/fx/FxList.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.anuke.mindustry.content.fx; - -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.type.ContentType; - -public abstract class FxList implements ContentList{ - - @Override - public ContentType type(){ - return ContentType.effect; - } -} diff --git a/core/src/io/anuke/mindustry/content/fx/ShootFx.java b/core/src/io/anuke/mindustry/content/fx/ShootFx.java deleted file mode 100644 index 39b96c6161..0000000000 --- a/core/src/io/anuke/mindustry/content/fx/ShootFx.java +++ /dev/null @@ -1,225 +0,0 @@ -package io.anuke.mindustry.content.fx; - -import io.anuke.arc.Core; -import io.anuke.arc.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.Lines; -import io.anuke.arc.math.Angles; -import io.anuke.arc.math.Mathf; -import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect; -import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.graphics.Shapes; - -public class ShootFx extends FxList implements ContentList{ - public static Effect shootSmall, shootHeal, shootSmallSmoke, shootBig, shootBig2, shootBigSmoke, shootBigSmoke2, shootSmallFlame, shootLiquid, shellEjectSmall, shellEjectMedium, shellEjectBig, lancerLaserShoot, lancerLaserShootSmoke, lancerLaserCharge, lancerLaserChargeBegin, lightningCharge, lightningShoot; - - @Override - public void load(){ - - shootSmall = new Effect(8, e -> { - Draw.color(Palette.lighterOrange, Palette.lightOrange, e.fin()); - float w = 1f + 5 * e.fout(); - Shapes.tri(e.x, e.y, w, 15f * e.fout(), e.rotation); - Shapes.tri(e.x, e.y, w, 3f * e.fout(), e.rotation + 180f); - Draw.reset(); - }); - - shootHeal = new Effect(8, e -> { - Draw.color(Palette.heal); - float w = 1f + 5 * e.fout(); - Shapes.tri(e.x, e.y, w, 17f * e.fout(), e.rotation); - Shapes.tri(e.x, e.y, w, 4f * e.fout(), e.rotation + 180f); - Draw.reset(); - }); - - shootSmallSmoke = new Effect(20f, e -> { - Draw.color(Palette.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin()); - - Angles.randLenVectors(e.id, 5, e.finpow() * 6f, e.rotation, 20f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 1.5f); - }); - - Draw.reset(); - }); - - shootBig = new Effect(9, e -> { - Draw.color(Palette.lighterOrange, Palette.lightOrange, e.fin()); - float w = 1.2f + 7 * e.fout(); - Shapes.tri(e.x, e.y, w, 25f * e.fout(), e.rotation); - Shapes.tri(e.x, e.y, w, 4f * e.fout(), e.rotation + 180f); - Draw.reset(); - }); - - shootBig2 = new Effect(10, e -> { - Draw.color(Palette.lightOrange, Color.GRAY, e.fin()); - float w = 1.2f + 8 * e.fout(); - Shapes.tri(e.x, e.y, w, 29f * e.fout(), e.rotation); - Shapes.tri(e.x, e.y, w, 5f * e.fout(), e.rotation + 180f); - Draw.reset(); - }); - - shootBigSmoke = new Effect(17f, e -> { - Draw.color(Palette.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin()); - - Angles.randLenVectors(e.id, 8, e.finpow() * 19f, e.rotation, 10f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 2f + 0.2f); - }); - - Draw.reset(); - }); - - shootBigSmoke2 = new Effect(18f, e -> { - Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin()); - - Angles.randLenVectors(e.id, 9, e.finpow() * 23f, e.rotation, 20f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 2.4f + 0.2f); - }); - - Draw.reset(); - }); - - shootSmallFlame = new Effect(30f, e -> { - Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, e.fin()); - - Angles.randLenVectors(e.id, 8, e.finpow() * 36f, e.rotation, 10f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.5f); - }); - - Draw.reset(); - }); - - shootLiquid = new Effect(40f, e -> { - Draw.color(e.color, Color.WHITE, e.fout() / 6f + Mathf.randomSeedRange(e.id, 0.1f)); - - Angles.randLenVectors(e.id, 6, e.finpow() * 60f, e.rotation, 11f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.5f + e.fout() * 2.5f); - }); - - Draw.reset(); - }); - - shellEjectSmall = new GroundEffect(30f, 400f, e -> { - Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin()); - float rot = Math.abs(e.rotation) + 90f; - - int i = Mathf.sign(e.rotation); - - float len = (2f + e.finpow() * 6f) * i; - float lr = rot + e.fin() * 30f * i; - Fill.rect(e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()), - e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()), - 1f, 2f, rot + e.fin() * 50f * i); - - Draw.color(); - }); - - shellEjectMedium = new GroundEffect(34f, 400f, e -> { - Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin()); - float rot = e.rotation + 90f; - for(int i : Mathf.signs){ - float len = (2f + e.finpow() * 10f) * i; - float lr = rot + e.fin() * 20f * i; - Draw.rect(Core.atlas.find("casing"), - e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()), - e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()), - 2f, 3f, rot); - } - - Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin()); - - for(int i : Mathf.signs){ - Angles.randLenVectors(e.id, 4, 1f + e.finpow() * 11f, e.rotation + 90f * i, 20f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 1.5f); - }); - } - - Draw.color(); - }); - - shellEjectBig = new GroundEffect(22f, 400f, e -> { - Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin()); - float rot = e.rotation + 90f; - for(int i : Mathf.signs){ - float len = (4f + e.finpow() * 8f) * i; - float lr = rot + Mathf.randomSeedRange(e.id + i + 6, 20f * e.fin()) * i; - Draw.rect(Core.atlas.find("casing"), - e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()), - e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()), - 2.5f, 4f, - rot + e.fin() * 30f * i + Mathf.randomSeedRange(e.id + i + 9, 40f * e.fin())); - } - - Draw.color(Color.LIGHT_GRAY); - - for(int i : Mathf.signs){ - Angles.randLenVectors(e.id, 4, -e.finpow() * 15f, e.rotation + 90f * i, 25f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 2f); - }); - } - - Draw.color(); - }); - - lancerLaserShoot = new Effect(21f, e -> { - Draw.color(Palette.lancerLaser); - - for(int i : Mathf.signs){ - Shapes.tri(e.x, e.y, 4f * e.fout(), 29f, e.rotation + 90f * i); - } - - Draw.reset(); - }); - - lancerLaserShootSmoke = new Effect(26f, e -> { - Draw.color(Palette.lancerLaser); - - Angles.randLenVectors(e.id, 7, 80f, e.rotation, 0f, (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fout() * 9f); - }); - - Draw.reset(); - }); - - lancerLaserCharge = new Effect(38f, e -> { - Draw.color(Palette.lancerLaser); - - Angles.randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 3f + 1f); - }); - - Draw.reset(); - }); - - lancerLaserChargeBegin = new Effect(71f, e -> { - Draw.color(Palette.lancerLaser); - Fill.circle(e.x, e.y, e.fin() * 3f); - - Draw.color(); - Fill.circle(e.x, e.y, e.fin() * 2f); - }); - - lightningCharge = new Effect(38f, e -> { - Draw.color(Palette.lancerLaser); - - Angles.randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> { - Shapes.tri(e.x + x, e.y + y, e.fslope() * 3f + 1, e.fslope() * 3f + 1, Mathf.angle(x, y)); - }); - - Draw.reset(); - }); - - lightningShoot = new Effect(12f, e -> { - Draw.color(Color.WHITE, Palette.lancerLaser, e.fin()); - Lines.stroke(e.fout() * 1.2f + 0.5f); - - Angles.randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 50f, (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 5f + 2f); - }); - - Draw.reset(); - }); - } -} diff --git a/core/src/io/anuke/mindustry/content/fx/UnitFx.java b/core/src/io/anuke/mindustry/content/fx/UnitFx.java deleted file mode 100644 index e58fba9d8b..0000000000 --- a/core/src/io/anuke/mindustry/content/fx/UnitFx.java +++ /dev/null @@ -1,78 +0,0 @@ -package io.anuke.mindustry.content.fx; - -import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect; -import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.game.ContentList; -import io.anuke.arc.entities.Effects.Effect; -import io.anuke.arc.graphics.g2d.Draw; -import io.anuke.arc.graphics.g2d.Fill; -import io.anuke.arc.graphics.g2d.Lines; -import io.anuke.arc.math.Angles; -import io.anuke.arc.math.Mathf; - -public class UnitFx extends FxList implements ContentList{ - public static Effect vtolHover, unitDrop, unitPickup, unitLand, pickup, healWave, heal, landShock; - - @Override - public void load(){ - - vtolHover = new Effect(40f, e -> { - float len = e.finpow() * 10f; - float ang = e.rotation + Mathf.randomSeedRange(e.id, 30f); - Draw.color(Palette.lightFlame, Palette.lightOrange, e.fin()); - Fill.circle(e.x + Angles.trnsx(ang, len), e.y + Angles.trnsy(ang, len), 2f * e.fout()); - Draw.reset(); - }); - - unitDrop = new GroundEffect(30, e -> { - Draw.color(Palette.lightishGray); - Angles.randLenVectors(e.id, 9, 3 + 20f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.4f); - }); - Draw.reset(); - }); - - unitLand = new GroundEffect(30, e -> { - Draw.color(Palette.lightishGray, e.color, e.rotation); - Angles.randLenVectors(e.id, 6, 17f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.3f); - }); - Draw.reset(); - }); - - unitPickup = new GroundEffect(18, e -> { - Draw.color(Palette.lightishGray); - Lines.stroke(e.fin() * 2f); - Lines.poly(e.x, e.y, 4, 13f * e.fout()); - Draw.reset(); - }); - - landShock = new GroundEffect(12, e -> { - Draw.color(Palette.lancerLaser); - Lines.stroke(e.fout() * 3f); - Lines.poly(e.x, e.y, 12, 20f * e.fout()); - Draw.reset(); - }); - - pickup = new Effect(18, e -> { - Draw.color(Palette.lightishGray); - Lines.stroke(e.fout() * 2f); - Lines.spikes(e.x, e.y, 1f + e.fin() * 6f, e.fout() * 4f, 6); - Draw.reset(); - }); - - healWave = new Effect(22, e -> { - Draw.color(Palette.heal); - Lines.stroke(e.fout() * 2f); - Lines.poly(e.x, e.y, 30, 4f + e.finpow() * 60f); - Draw.color(); - }); - - heal = new Effect(11, e -> { - Draw.color(Palette.heal); - Lines.stroke(e.fout() * 2f); - Lines.poly(e.x, e.y, 10, 2f + e.finpow() * 7f); - Draw.color(); - }); - } -} diff --git a/core/src/io/anuke/mindustry/core/ContentLoader.java b/core/src/io/anuke/mindustry/core/ContentLoader.java index dfd6091b00..7f9091e0e7 100644 --- a/core/src/io/anuke/mindustry/core/ContentLoader.java +++ b/core/src/io/anuke/mindustry/core/ContentLoader.java @@ -6,9 +6,6 @@ import io.anuke.arc.collection.ObjectSet; import io.anuke.arc.function.Consumer; import io.anuke.arc.util.Log; import io.anuke.mindustry.content.*; -import io.anuke.mindustry.content.blocks.*; -import io.anuke.mindustry.content.bullets.*; -import io.anuke.mindustry.content.fx.*; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.bullet.Bullet; import io.anuke.mindustry.entities.bullet.BulletType; @@ -42,13 +39,7 @@ public class ContentLoader{ private ObjectSet> initialization = new ObjectSet<>(); private ContentList[] content = { //effects - new BlockFx(), - new BulletFx(), - new EnvironmentFx(), - new ExplosionFx(), new Fx(), - new ShootFx(), - new UnitFx(), //items new Items(), @@ -60,16 +51,7 @@ public class ContentLoader{ new Liquids(), //bullets - new ArtilleryBullets(), - new FlakBullets(), - new MissileBullets(), - new StandardBullets(), - new TurretBullets(), - new WeaponBullets(), - - - //ammotypes - new AmmoTypes(), + new Bullets(), //weapons new Weapons(), @@ -82,18 +64,6 @@ public class ContentLoader{ //blocks new Blocks(), - new DefenseBlocks(), - new DistributionBlocks(), - new ProductionBlocks(), - new TurretBlocks(), - new DebugBlocks(), - new LiquidBlocks(), - new StorageBlocks(), - new UnitBlocks(), - new PowerBlocks(), - new CraftingBlocks(), - new UpgradeBlocks(), - new OreBlocks(), //not really a content class, but this makes initialization easier new ColorMapper(), @@ -279,7 +249,5 @@ public class ContentLoader{ TypeTrait.registerType(Lightning.class, Lightning::new); } - private class ImpendingDoomException extends RuntimeException{ - public ImpendingDoomException(String s){ super(s); } - } + private class ImpendingDoomException extends RuntimeException{ ImpendingDoomException(String s){ super(s); }} } diff --git a/core/src/io/anuke/mindustry/core/NetClient.java b/core/src/io/anuke/mindustry/core/NetClient.java index e3e70da110..71c8d9caef 100644 --- a/core/src/io/anuke/mindustry/core/NetClient.java +++ b/core/src/io/anuke/mindustry/core/NetClient.java @@ -347,7 +347,7 @@ public class NetClient implements ApplicationListener{ Call.onClientShapshot(lastSent++, Time.millis(), player.x, player.y, player.pointerX, player.pointerY, player.rotation, player.baseRotation, - player.getVelocity().x, player.getVelocity().y, + player.velocity().x, player.velocity().y, player.getMineTile(), player.isBoosting, player.isShooting, requests, Core.camera.position.x, Core.camera.position.y, diff --git a/core/src/io/anuke/mindustry/core/NetServer.java b/core/src/io/anuke/mindustry/core/NetServer.java index 4987df27c4..c942397815 100644 --- a/core/src/io/anuke/mindustry/core/NetServer.java +++ b/core/src/io/anuke/mindustry/core/NetServer.java @@ -22,7 +22,7 @@ import io.anuke.arc.util.Time; import io.anuke.arc.util.io.ByteBufferOutput; import io.anuke.arc.util.io.CountableByteArrayOutputStream; import io.anuke.mindustry.content.Mechs; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest; @@ -329,7 +329,7 @@ public class NetServer implements ApplicationListener{ //set interpolator target to *new* position so it moves toward it player.getInterpolator().read(player.x, player.y, newx, newy, sent, rotation, baseRotation); - player.getVelocity().set(xVelocity, yVelocity); //only for visual calculation purposes, doesn't actually update the player + player.velocity().set(xVelocity, yVelocity); //only for visual calculation purposes, doesn't actually update the player connection.lastRecievedClientSnapshot = snapshotID; connection.lastRecievedClientTime = Time.millis(); diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index cff7944281..05477315ef 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -21,7 +21,7 @@ import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.util.ScreenRecorder; import io.anuke.arc.util.Time; import io.anuke.arc.util.pooling.Pools; -import io.anuke.mindustry.content.fx.Fx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.TileEntity; diff --git a/core/src/io/anuke/mindustry/core/World.java b/core/src/io/anuke/mindustry/core/World.java index 490ac28612..9fadff2f44 100644 --- a/core/src/io/anuke/mindustry/core/World.java +++ b/core/src/io/anuke/mindustry/core/World.java @@ -15,7 +15,7 @@ import io.anuke.arc.util.Tmp; import io.anuke.mindustry.ai.BlockIndexer; import io.anuke.mindustry.ai.Pathfinder; import io.anuke.mindustry.ai.WaveSpawner; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.game.EventType.TileChangeEvent; import io.anuke.mindustry.game.EventType.WorldLoadEvent; diff --git a/core/src/io/anuke/mindustry/editor/EditorTool.java b/core/src/io/anuke/mindustry/editor/EditorTool.java index 3693f03266..981fa88057 100644 --- a/core/src/io/anuke/mindustry/editor/EditorTool.java +++ b/core/src/io/anuke/mindustry/editor/EditorTool.java @@ -4,7 +4,7 @@ import io.anuke.arc.collection.IntArray; import io.anuke.arc.function.IntPositionConsumer; import io.anuke.arc.util.Pack; import io.anuke.arc.util.Structs; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.maps.MapTileData; import io.anuke.mindustry.maps.MapTileData.DataPosition; import io.anuke.mindustry.maps.MapTileData.TileDataMarker; diff --git a/core/src/io/anuke/mindustry/editor/MapEditor.java b/core/src/io/anuke/mindustry/editor/MapEditor.java index 369f9f6682..e7fee69dbd 100644 --- a/core/src/io/anuke/mindustry/editor/MapEditor.java +++ b/core/src/io/anuke/mindustry/editor/MapEditor.java @@ -5,7 +5,7 @@ import io.anuke.arc.math.Mathf; import io.anuke.arc.util.Pack; import io.anuke.arc.util.Structs; import io.anuke.mindustry.Vars; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.editor.DrawOperation.TileOperation; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.maps.MapTileData; diff --git a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java index 8f3818e5f1..0d413c84cf 100644 --- a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java @@ -18,7 +18,7 @@ import io.anuke.arc.scene.ui.layout.Unit; import io.anuke.arc.scene.utils.UIUtils; import io.anuke.arc.util.*; import io.anuke.mindustry.Vars; -import io.anuke.mindustry.content.blocks.StorageBlocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.core.Platform; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.io.MapIO; @@ -521,7 +521,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ for(Block block : Vars.content.blocks()){ TextureRegion[] regions = block.getCompactIcon(); if((block.synthetic() && (Recipe.getByResult(block) == null || !control.unlocks.isUnlocked(Recipe.getByResult(block)))) - && block != StorageBlocks.core){ + && block != Blocks.core){ continue; } diff --git a/core/src/io/anuke/mindustry/entities/Damage.java b/core/src/io/anuke/mindustry/entities/Damage.java index 7df2455bc6..e8b51dbf35 100644 --- a/core/src/io/anuke/mindustry/entities/Damage.java +++ b/core/src/io/anuke/mindustry/entities/Damage.java @@ -10,8 +10,8 @@ import io.anuke.arc.math.geom.Geometry; import io.anuke.arc.math.geom.Rectangle; import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.util.Time; -import io.anuke.mindustry.content.bullets.TurretBullets; -import io.anuke.mindustry.content.fx.ExplosionFx; +import io.anuke.mindustry.content.Bullets; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.bullet.Bullet; import io.anuke.mindustry.entities.effect.Fire; import io.anuke.mindustry.entities.effect.Lightning; @@ -37,7 +37,7 @@ public class Damage{ } for(int i = 0; i < Mathf.clamp(flammability / 4, 0, 30); i++){ - Time.run(i / 2f, () -> Call.createBullet(TurretBullets.fireball, x, y, Mathf.random(360f))); + Time.run(i / 2f, () -> Call.createBullet(Bullets.fireball, x, y, Mathf.random(360f))); } int waves = Mathf.clamp((int) (explosiveness / 4), 0, 30); @@ -46,21 +46,21 @@ public class Damage{ int f = i; Time.run(i * 2f, () -> { Damage.damage(x, y, Mathf.clamp(radius + explosiveness, 0, 50f) * ((f + 1f) / waves), explosiveness / 2f); - Effects.effect(ExplosionFx.blockExplosionSmoke, x + Mathf.range(radius), y + Mathf.range(radius)); + Effects.effect(Fx.blockExplosionSmoke, x + Mathf.range(radius), y + Mathf.range(radius)); }); } if(explosiveness > 15f){ - Effects.effect(ExplosionFx.shockwave, x, y); + Effects.effect(Fx.shockwave, x, y); } if(explosiveness > 30f){ - Effects.effect(ExplosionFx.bigShockwave, x, y); + Effects.effect(Fx.bigShockwave, x, y); } float shake = Math.min(explosiveness / 4f + 3f, 9f); Effects.shake(shake, shake, x, y); - Effects.effect(ExplosionFx.blockExplosion, x, y); + Effects.effect(Fx.blockExplosion, x, y); } public static void createIncend(float x, float y, float range, int amount){ @@ -110,7 +110,7 @@ public class Damage{ rect.height += expand * 2; Consumer cons = e -> { - e.getHitbox(hitrect); + e.hitbox(hitrect); Rectangle other = hitrect; other.y -= expand; other.x -= expand; @@ -134,7 +134,7 @@ public class Damage{ Consumer cons = entity -> { if(!predicate.test(entity)) return; - entity.getHitbox(hitrect); + entity.hitbox(hitrect); if(!hitrect.overlaps(rect)){ return; } @@ -165,7 +165,7 @@ public class Damage{ entity.damage(amount); //TODO better velocity displacement float dst = tr.set(entity.x - x, entity.y - y).len(); - entity.getVelocity().add(tr.setLength((1f - dst / radius) * 2f)); + entity.velocity().add(tr.setLength((1f - dst / radius) * 2f)); }; rect.setSize(radius * 2).setCenter(x, y); diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index a6c073c61e..7ea5dd7797 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -20,7 +20,7 @@ import io.anuke.arc.util.Pack; import io.anuke.arc.util.Time; import io.anuke.arc.util.pooling.Pools; import io.anuke.mindustry.content.Mechs; -import io.anuke.mindustry.content.fx.UnitFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.effect.ScorchDecal; import io.anuke.mindustry.entities.traits.*; import io.anuke.mindustry.game.Team; @@ -100,17 +100,17 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra } @Override - public void getHitbox(Rectangle rectangle){ + public void hitbox(Rectangle rectangle){ rectangle.setSize(mech.hitsize).setCenter(x, y); } @Override - public void getHitboxTile(Rectangle rectangle){ + public void hitboxTile(Rectangle rectangle){ rectangle.setSize(mech.hitsize * 2f / 3f).setCenter(x, y); } @Override - public float getDrag(){ + public float drag(){ return mech.drag; } @@ -208,7 +208,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra } @Override - public float getMass(){ + public float mass(){ return mech.mass; } @@ -241,7 +241,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra } @Override - public float getMaxVelocity(){ + public float maxVelocity(){ return mech.maxSpeed; } @@ -502,7 +502,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra if(mech.shake > 1f){ Effects.shake(mech.shake, mech.shake, this); } - Effects.effect(UnitFx.unitLand, tile.floor().minimapColor, x, y, tile.floor().isLiquid ? 1f : 0.5f); + Effects.effect(Fx.unitLand, tile.floor().minimapColor, x, y, tile.floor().isLiquid ? 1f : 0.5f); } mech.onLand(this); achievedFlight = false; @@ -571,7 +571,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra }else if(getCarry() != null){ dropCarry(); }else{ - Unit unit = Units.getClosest(team, x, y, 8f, u -> !u.isFlying() && u.getMass() <= mech.carryWeight); + Unit unit = Units.getClosest(team, x, y, 8f, u -> !u.isFlying() && u.mass() <= mech.carryWeight); if(unit != null){ carry(unit); @@ -629,7 +629,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra protected void updateFlying(){ if(Units.invalidateTarget(target, this) && !(target instanceof TileEntity && ((TileEntity) target).damaged() && target.getTeam() == team && - mech.canHeal && dst(target) < getWeapon().getAmmo().getRange())){ + mech.canHeal && dst(target) < getWeapon().getAmmo().range())){ target = null; } @@ -675,7 +675,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra float expansion = 3f; - getHitbox(rect); + hitbox(rect); rect.x -= expansion; rect.y -= expansion; rect.width += expansion * 2f; @@ -709,11 +709,11 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra if(target == null){ isShooting = false; if(Core.settings.getBool("autotarget")){ - target = Units.getClosestTarget(team, x, y, getWeapon().getAmmo().getRange()); + target = Units.getClosestTarget(team, x, y, getWeapon().getAmmo().range()); if(mech.canHeal && target == null){ target = Geometry.findClosest(x, y, world.indexer.getDamaged(Team.blue)); - if(target != null && dst(target) > getWeapon().getAmmo().getRange()){ + if(target != null && dst(target) > getWeapon().getAmmo().range()){ target = null; }else if(target != null){ target = ((Tile) target).entity; @@ -725,14 +725,14 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra } } }else if(target.isValid() || (target instanceof TileEntity && ((TileEntity) target).damaged() && target.getTeam() == team && - mech.canHeal && dst(target) < getWeapon().getAmmo().getRange())){ + mech.canHeal && dst(target) < getWeapon().getAmmo().range())){ //rotate toward and shoot the target if(mech.turnCursor){ rotation = Mathf.slerpDelta(rotation, angleTo(target), 0.2f); } Vector2 intercept = - Predict.intercept(x, y, target.getX(), target.getY(), target.getVelocity().x - velocity.x, target.getVelocity().y - velocity.y, getWeapon().getAmmo().bullet.speed); + Predict.intercept(x, y, target.getX(), target.getY(), target.velocity().x - velocity.x, target.velocity().y - velocity.y, getWeapon().getAmmo().speed); pointerX = intercept.x; pointerY = intercept.y; diff --git a/core/src/io/anuke/mindustry/entities/TileEntity.java b/core/src/io/anuke/mindustry/entities/TileEntity.java index c3dc293f95..c77d797f8a 100644 --- a/core/src/io/anuke/mindustry/entities/TileEntity.java +++ b/core/src/io/anuke/mindustry/entities/TileEntity.java @@ -13,7 +13,7 @@ import io.anuke.arc.math.geom.Point2; import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.util.Interval; import io.anuke.arc.util.Time; -import io.anuke.mindustry.content.fx.Fx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.bullet.Bullet; import io.anuke.mindustry.entities.traits.TargetTrait; import io.anuke.mindustry.game.Team; @@ -257,7 +257,7 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{ } @Override - public Vector2 getVelocity(){ + public Vector2 velocity(){ return Vector2.ZERO; } diff --git a/core/src/io/anuke/mindustry/entities/Unit.java b/core/src/io/anuke/mindustry/entities/Unit.java index 1c3d4c6660..8a10379838 100644 --- a/core/src/io/anuke/mindustry/entities/Unit.java +++ b/core/src/io/anuke/mindustry/entities/Unit.java @@ -15,7 +15,7 @@ import io.anuke.arc.math.geom.Geometry; import io.anuke.arc.math.geom.Rectangle; import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.util.Time; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.entities.traits.*; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.game.Teams.TeamData; @@ -124,7 +124,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ } @Override - public Vector2 getVelocity(){ + public Vector2 velocity(){ return velocity; } @@ -190,7 +190,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ } public void avoidOthers(float scaling){ - getHitbox(queryRect); + hitbox(queryRect); queryRect.setSize(queryRect.getWidth() * scaling); Units.getNearby(queryRect, t -> { @@ -228,7 +228,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ if(isCarried()){ //carried units do not take into account velocity normally set(carrier.getX(), carrier.getY()); - velocity.set(carrier.getVelocity()); + velocity.set(carrier.velocity()); return; } @@ -236,7 +236,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ status.update(this); - velocity.limit(getMaxVelocity()).scl(1f + (status.getSpeedMultiplier()-1f) * Time.delta()); + velocity.limit(maxVelocity()).scl(1f + (status.getSpeedMultiplier()-1f) * Time.delta()); if(isFlying()){ x += velocity.x * Time.delta(); @@ -289,7 +289,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ if(Math.abs(py - y) <= 0.0001f) velocity.y = 0f; } - velocity.scl(Mathf.clamp(1f - getDrag() * (isFlying() ? 1f : floor.dragMultiplier) * Time.delta())); + velocity.scl(Mathf.clamp(1f - drag() * (isFlying() ? 1f : floor.dragMultiplier) * Time.delta())); } public void applyEffect(StatusEffect effect, float intensity){ @@ -355,7 +355,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ public abstract float getArmor(); - public abstract float getMass(); + public abstract float mass(); public abstract boolean isFlying(); diff --git a/core/src/io/anuke/mindustry/entities/Units.java b/core/src/io/anuke/mindustry/entities/Units.java index 95e16842da..a265a9bcd0 100644 --- a/core/src/io/anuke/mindustry/entities/Units.java +++ b/core/src/io/anuke/mindustry/entities/Units.java @@ -48,7 +48,7 @@ public class Units{ /**See {@link #invalidateTarget(TargetTrait, Team, float, float, float)}*/ public static boolean invalidateTarget(TargetTrait target, Unit targeter){ - return invalidateTarget(target, targeter.team, targeter.x, targeter.y, targeter.getWeapon().getAmmo().getRange()); + return invalidateTarget(target, targeter.team, targeter.x, targeter.y, targeter.getWeapon().getAmmo().range()); } /**Returns whether there are any entities on this tile.*/ @@ -67,7 +67,7 @@ public class Units{ Units.getNearby(rect, unit -> { if(boolResult) return; if(!unit.isFlying()){ - unit.getHitbox(hitrect); + unit.hitbox(hitrect); if(hitrect.overlaps(rect)){ boolResult = true; @@ -89,7 +89,7 @@ public class Units{ Units.getNearby(rect, unit -> { if(value[0] || !pred.test(unit) || unit.isDead()) return; if(!unit.isFlying()){ - unit.getHitbox(hitrect); + unit.hitbox(hitrect); if(hitrect.overlaps(rect)){ value[0] = true; diff --git a/core/src/io/anuke/mindustry/entities/bullet/ArtilleryBulletType.java b/core/src/io/anuke/mindustry/entities/bullet/ArtilleryBulletType.java index 6a317f0882..ee5237a2c8 100644 --- a/core/src/io/anuke/mindustry/entities/bullet/ArtilleryBulletType.java +++ b/core/src/io/anuke/mindustry/entities/bullet/ArtilleryBulletType.java @@ -1,13 +1,13 @@ package io.anuke.mindustry.entities.bullet; -import io.anuke.mindustry.content.fx.BulletFx; import io.anuke.arc.entities.Effects; import io.anuke.arc.entities.Effects.Effect; import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.mindustry.content.Fx; //TODO scale velocity depending on fslope() public class ArtilleryBulletType extends BasicBulletType{ - protected Effect trailEffect = BulletFx.artilleryTrail; + protected Effect trailEffect = Fx.artilleryTrail; public ArtilleryBulletType(float speed, float damage, String bulletSprite){ super(speed, damage, bulletSprite); @@ -34,9 +34,9 @@ public class ArtilleryBulletType extends BasicBulletType{ float height = bulletHeight * ((1f - bulletShrink) + bulletShrink * b.fout()); Draw.color(backColor); - Draw.rect(backRegion, b.x, b.y, bulletWidth * scale, height * scale, b.angle() - 90); + Draw.rect(backRegion, b.x, b.y, bulletWidth * scale, height * scale, b.rot() - 90); Draw.color(frontColor); - Draw.rect(frontRegion, b.x, b.y, bulletWidth * scale, height * scale, b.angle() - 90); + Draw.rect(frontRegion, b.x, b.y, bulletWidth * scale, height * scale, b.rot() - 90); Draw.color(); } } diff --git a/core/src/io/anuke/mindustry/entities/bullet/BasicBulletType.java b/core/src/io/anuke/mindustry/entities/bullet/BasicBulletType.java index 7f3ca88aeb..6152de43fa 100644 --- a/core/src/io/anuke/mindustry/entities/bullet/BasicBulletType.java +++ b/core/src/io/anuke/mindustry/entities/bullet/BasicBulletType.java @@ -10,12 +10,11 @@ import io.anuke.arc.math.Mathf; import io.anuke.arc.util.Time; import io.anuke.mindustry.entities.Damage; import io.anuke.mindustry.entities.Units; +import io.anuke.mindustry.entities.effect.Lightning; import io.anuke.mindustry.entities.traits.TargetTrait; import io.anuke.mindustry.graphics.Palette; -/** - * A BulletType for most ammo-based bullets shot from turrets and units. - */ +/**An extended BulletType for most ammo-based bullets shot from turrets and units.*/ public class BasicBulletType extends BulletType{ public Color backColor = Palette.bulletYellowBack, frontColor = Palette.bulletYellow; public float bulletWidth = 5f, bulletHeight = 7f; @@ -36,6 +35,9 @@ public class BasicBulletType extends BulletType{ public float homingPower = 0f; public float homingRange = 50f; + public int lightining; + public int lightningLength = 5; + public TextureRegion backRegion; public TextureRegion frontRegion; @@ -57,9 +59,9 @@ public class BasicBulletType extends BulletType{ float height = bulletHeight * ((1f - bulletShrink) + bulletShrink * b.fout()); Draw.color(backColor); - Draw.rect(backRegion, b.x, b.y, bulletWidth, height, b.angle() - 90); + Draw.rect(backRegion, b.x, b.y, bulletWidth, height, b.rot() - 90); Draw.color(frontColor); - Draw.rect(frontRegion, b.x, b.y, bulletWidth, height, b.angle() - 90); + Draw.rect(frontRegion, b.x, b.y, bulletWidth, height, b.rot() - 90); Draw.color(); } @@ -70,7 +72,7 @@ public class BasicBulletType extends BulletType{ if(homingPower > 0.0001f){ TargetTrait target = Units.getClosestTarget(b.getTeam(), b.x, b.y, homingRange); if(target != null){ - b.getVelocity().setAngle(Angles.moveToward(b.getVelocity().angle(), b.angleTo(target), homingPower * Time.delta())); + b.velocity().setAngle(Angles.moveToward(b.velocity().angle(), b.angleTo(target), homingPower * Time.delta())); } } } @@ -104,5 +106,9 @@ public class BasicBulletType extends BulletType{ if(fragBullet != null || splashDamageRadius > 0){ hit(b); } + + for (int i = 0; i < lightining; i++) { + Lightning.create(b.getTeam(), Palette.surge, damage, b.x, b.y, Mathf.random(360f), lightningLength); + } } } diff --git a/core/src/io/anuke/mindustry/entities/bullet/Bullet.java b/core/src/io/anuke/mindustry/entities/bullet/Bullet.java index b2d10aeac6..3bd1fe6ad7 100644 --- a/core/src/io/anuke/mindustry/entities/bullet/Bullet.java +++ b/core/src/io/anuke/mindustry/entities/bullet/Bullet.java @@ -3,14 +3,15 @@ package io.anuke.mindustry.entities.bullet; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; import io.anuke.arc.entities.EntityGroup; -import io.anuke.arc.entities.impl.BulletEntity; -import io.anuke.arc.entities.trait.Entity; -import io.anuke.arc.entities.trait.SolidTrait; -import io.anuke.arc.entities.trait.VelocityTrait; +import io.anuke.arc.entities.impl.SolidEntity; +import io.anuke.arc.entities.trait.*; import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Rectangle; import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.util.Interval; import io.anuke.arc.util.Time; +import io.anuke.arc.util.Tmp; +import io.anuke.arc.util.pooling.Pool.Poolable; import io.anuke.arc.util.pooling.Pools; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.effect.Lightning; @@ -26,14 +27,18 @@ import java.io.IOException; import static io.anuke.mindustry.Vars.*; -public class Bullet extends BulletEntity implements TeamTrait, SyncTrait, AbsorbTrait{ - private static Vector2 vector = new Vector2(); +public class Bullet extends SolidEntity implements DamageTrait, ScaleTrait, Poolable, DrawTrait, VelocityTrait, TimeTrait, TeamTrait, SyncTrait, AbsorbTrait{ public Interval timer = new Interval(3); + private float lifeScl; private Team team; private Object data; private boolean supressCollision, supressOnce, initialized; + protected BulletType type; + protected Entity owner; + protected float time; + /**Internal use only!*/ public Bullet(){ } @@ -62,7 +67,7 @@ public class Bullet extends BulletEntity implements TeamTrait, SyncT bullet.velocity.set(0, type.speed).setAngle(angle).scl(velocityScl); if(type.keepVelocity){ - bullet.velocity.add(owner instanceof VelocityTrait ? ((VelocityTrait) owner).getVelocity() : Vector2.ZERO); + bullet.velocity.add(owner instanceof VelocityTrait ? ((VelocityTrait) owner).velocity() : Vector2.ZERO); } bullet.team = team; @@ -83,6 +88,7 @@ public class Bullet extends BulletEntity implements TeamTrait, SyncT return create(type, parent.owner, parent.team, x, y, angle, velocityScl); } + /**Internal use only.*/ @Remote(called = Loc.server) public static void createBullet(BulletType type, float x, float y, float angle){ create(type, null, Team.none, x, y, angle); @@ -97,12 +103,6 @@ public class Bullet extends BulletEntity implements TeamTrait, SyncT supressOnce = true; } - @Override - public void absorb(){ - supressCollision = true; - remove(); - } - public BulletType getBulletType(){ return type; } @@ -124,22 +124,29 @@ public class Bullet extends BulletEntity implements TeamTrait, SyncT this.data = data; } + @Override + public void absorb(){ + supressCollision = true; + remove(); + } + @Override public float drawSize(){ return type.drawSize; } @Override - public float getDamage(){ + public float damage(){ + //todo hacky way to get damage, refactor if(owner instanceof Unit){ - return super.getDamage() * ((Unit) owner).getDamageMultipler(); + return type.damage * ((Unit) owner).getDamageMultipler(); } if(owner instanceof Lightning && data instanceof Float){ return (Float)data; } - return super.getDamage(); + return type.damage; } @Override @@ -172,35 +179,44 @@ public class Bullet extends BulletEntity implements TeamTrait, SyncT return team; } - @Override - public void draw(){ - type.draw(this); - } - @Override public float getShieldDamage(){ - return Math.max(getDamage(), type.splashDamage); + return Math.max(damage(), type.splashDamage); } @Override public boolean collides(SolidTrait other){ - return type.collides && super.collides(other) && !supressCollision && !(other instanceof Unit && ((Unit) other).isFlying() && !type.collidesAir); + return type.collides && (other != owner && !(other instanceof DamageTrait)) && !supressCollision && !(other instanceof Unit && ((Unit) other).isFlying() && !type.collidesAir); } @Override public void collision(SolidTrait other, float x, float y){ - super.collision(other, x, y); + if(!type.pierce) remove(); + type.hit(this, x, y); if(other instanceof Unit){ Unit unit = (Unit) other; - unit.getVelocity().add(vector.set(other.getX(), other.getY()).sub(x, y).setLength(type.knockback / unit.getMass())); + unit.velocity().add(Tmp.v3.set(other.getX(), other.getY()).sub(x, y).setLength(type.knockback / unit.mass())); unit.applyEffect(type.status, type.statusIntensity); } } @Override public void update(){ - super.update(); + type.update(this); + + x += velocity.x * Time.delta(); + y += velocity.y * Time.delta(); + + velocity.scl(Mathf.clamp(1f - type.drag * Time.delta())); + + time += Time.delta() * 1f/(lifeScl); + time = Mathf.clamp(time, 0, type.lifetime); + + if(time >= type.lifetime){ + if(!supressCollision) type.despawned(this); + remove(); + } if(type.hitTiles && collidesTiles() && !supressCollision && initialized){ world.raycastEach(world.toTile(lastPosition().x), world.toTile(lastPosition().y), world.toTile(x), world.toTile(y), (x, y) -> { @@ -234,20 +250,12 @@ public class Bullet extends BulletEntity implements TeamTrait, SyncT initialized = true; } - @Override - protected void updateLife(){ - time += Time.delta() * 1f/(lifeScl); - time = Mathf.clamp(time, 0, type.lifetime()); - - if(time >= type.lifetime){ - if(!supressCollision) type.despawned(this); - remove(); - } - } - @Override public void reset(){ - super.reset(); + type = null; + owner = null; + velocity.setZero(); + time = 0f; timer.clear(); lifeScl = 1f; team = null; @@ -257,6 +265,31 @@ public class Bullet extends BulletEntity implements TeamTrait, SyncT initialized = false; } + @Override + public void hitbox(Rectangle rectangle){ + rectangle.setSize(type.hitSize).setCenter(x, y); + } + + @Override + public void hitboxTile(Rectangle rectangle){ + rectangle.setSize(type.hitSize).setCenter(x, y); + } + + @Override + public float lifetime(){ + return type.lifetime; + } + + @Override + public void time(float time){ + this.time = time; + } + + @Override + public float time(){ + return time; + } + @Override public void removed(){ Pools.free(this); @@ -266,4 +299,44 @@ public class Bullet extends BulletEntity implements TeamTrait, SyncT public EntityGroup targetGroup(){ return bulletGroup; } + + @Override + public void added(){ + type.init(this); + } + + @Override + public void draw(){ + type.draw(this); + } + + @Override + public float fin(){ + return time / type.lifetime; + } + + @Override + public Vector2 velocity(){ + return velocity; + } + + public void velocity(float speed, float angle){ + velocity.set(0, speed).setAngle(angle); + } + + public void limit(float f){ + velocity.limit(f); + } + + /** Sets the bullet's rotation in degrees.*/ + public void rot(float angle){ + velocity.setAngle(angle); + } + + /** @return the bullet's rotation.*/ + public float rot(){ + float angle = Mathf.atan2(velocity.x, velocity.y) * Mathf.radiansToDegrees; + if(angle < 0) angle += 360; + return angle; + } } diff --git a/core/src/io/anuke/mindustry/entities/bullet/BulletType.java b/core/src/io/anuke/mindustry/entities/bullet/BulletType.java index 0c2cbc7c94..10002296bf 100644 --- a/core/src/io/anuke/mindustry/entities/bullet/BulletType.java +++ b/core/src/io/anuke/mindustry/entities/bullet/BulletType.java @@ -2,24 +2,35 @@ package io.anuke.mindustry.entities.bullet; import io.anuke.arc.entities.Effects; import io.anuke.arc.entities.Effects.Effect; -import io.anuke.arc.entities.impl.BaseBulletType; -import io.anuke.arc.math.geom.Vector2; import io.anuke.mindustry.content.StatusEffects; -import io.anuke.mindustry.content.fx.BulletFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.game.Content; import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.StatusEffect; import io.anuke.mindustry.world.Tile; -public abstract class BulletType extends Content implements BaseBulletType{ +public abstract class BulletType extends Content{ public float lifetime; public float speed; public float damage; - public float hitsize = 4; - public float drawSize = 20f; + public float hitSize = 4; + public float drawSize = 40f; public float drag = 0f; public boolean pierce; - public Effect hiteffect, despawneffect; + public Effect hitEffect, despawnEffect; + + /**Effect created when shooting.*/ + public Effect shootEffect = Fx.shootSmall; + /**Extra smoke effect created when shooting.*/ + public Effect smokeEffect = Fx.shootSmallSmoke; + /**Extra inaccuracy when firing.*/ + public float inaccuracy = 0f; + /**How many bullets get created per ammo item/liquid.*/ + public float ammoMultiplier = 1f; + /**Multiplied by turret reload speed to get final shoot speed.*/ + public float reloadMultiplier = 1f; + /**Recoil from shooter entities.*/ + public float recoil; public float splashDamage = 0f; /**Knockback in velocity.*/ @@ -45,14 +56,17 @@ public abstract class BulletType extends Content implements BaseBulletType baseDst){ + float angleTo = b.angleTo(data.to); + float baseAngle = data.to.angleTo(data.from); + + //if angles are nearby, then yes, it did + if(Angles.near(angleTo, baseAngle, 2f)){ + intersect = true; + //snap bullet position back; this is used for low-FPS situations + b.set(data.to.x + Angles.trnsx(baseAngle, hitDst), data.to.y + Angles.trnsy(baseAngle, hitDst)); + } + } + + //if on course and it's in range of the target + if(Math.abs(dst1 + dst2 - baseDst) < 4f && dst2 <= hitDst){ + intersect = true; + } //else, bullet has gone off course, does not get recieved. + + if(intersect){ + data.to.handlePayload(b, data); + } + } + + @Override + public void despawned(Bullet b){ + super.despawned(b); + + if(!(b.getData() instanceof DriverBulletData)) return; + + DriverBulletData data = (DriverBulletData) b.getData(); + data.to.isRecieving = false; + + for(int i = 0; i < data.items.length; i++){ + int amountDropped = Mathf.random(0, data.items[i]); + if(amountDropped > 0){ + float angle = b.rot() + Mathf.range(100f); + Effects.effect(Fx.dropItem, Color.WHITE, b.x, b.y, angle, content.item(i)); + } + } + } + + @Override + public void hit(Bullet b, float hitx, float hity){ + super.hit(b, hitx, hity); + despawned(b); + } +} diff --git a/core/src/io/anuke/mindustry/entities/bullet/MissileBulletType.java b/core/src/io/anuke/mindustry/entities/bullet/MissileBulletType.java index d27e2f222f..6200666f1f 100644 --- a/core/src/io/anuke/mindustry/entities/bullet/MissileBulletType.java +++ b/core/src/io/anuke/mindustry/entities/bullet/MissileBulletType.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.entities.bullet; import io.anuke.arc.graphics.Color; -import io.anuke.mindustry.content.fx.BulletFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.graphics.Palette; import io.anuke.arc.entities.Effects; import io.anuke.arc.util.Time; @@ -10,6 +10,9 @@ import io.anuke.arc.math.Mathf; public class MissileBulletType extends BasicBulletType{ protected Color trailColor = Palette.missileYellowBack; + protected float weaveScale = 0f; + protected float weaveMag = -1f; + public MissileBulletType(float speed, float damage, String bulletSprite){ super(speed, damage, bulletSprite); backColor = Palette.missileYellowBack; @@ -22,7 +25,11 @@ public class MissileBulletType extends BasicBulletType{ super.update(b); if(Mathf.chance(Time.delta() * 0.2)){ - Effects.effect(BulletFx.missileTrail, trailColor, b.x, b.y, 2f); + Effects.effect(Fx.missileTrail, trailColor, b.x, b.y, 2f); + } + + if(weaveMag > 0){ + b.velocity().rotate(Mathf.sin(Time.time() + b.id * 4422, weaveScale, weaveMag)); } } } diff --git a/core/src/io/anuke/mindustry/entities/effect/Fire.java b/core/src/io/anuke/mindustry/entities/effect/Fire.java index 36e2f03ac5..4ca534df54 100644 --- a/core/src/io/anuke/mindustry/entities/effect/Fire.java +++ b/core/src/io/anuke/mindustry/entities/effect/Fire.java @@ -13,9 +13,9 @@ import io.anuke.arc.util.Structs; import io.anuke.arc.util.Time; import io.anuke.arc.util.pooling.Pool.Poolable; import io.anuke.arc.util.pooling.Pools; +import io.anuke.mindustry.content.Bullets; import io.anuke.mindustry.content.StatusEffects; -import io.anuke.mindustry.content.bullets.TurretBullets; -import io.anuke.mindustry.content.fx.EnvironmentFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Damage; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.traits.SaveTrait; @@ -93,11 +93,11 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{ @Override public void update(){ if(Mathf.chance(0.1 * Time.delta())){ - Effects.effect(EnvironmentFx.fire, x + Mathf.range(4f), y + Mathf.range(4f)); + Effects.effect(Fx.fire, x + Mathf.range(4f), y + Mathf.range(4f)); } if(Mathf.chance(0.05 * Time.delta())){ - Effects.effect(EnvironmentFx.smoke, x + Mathf.range(4f), y + Mathf.range(4f)); + Effects.effect(Fx.fireSmoke, x + Mathf.range(4f), y + Mathf.range(4f)); } if(Net.client()){ @@ -136,7 +136,7 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{ create(other); if(Mathf.chance(fireballChance * Time.delta() * Mathf.clamp(flammability / 10f))){ - Call.createBullet(TurretBullets.fireball, x, y, Mathf.random(360f)); + Call.createBullet(Bullets.fireball, x, y, Mathf.random(360f)); } } diff --git a/core/src/io/anuke/mindustry/entities/effect/Lightning.java b/core/src/io/anuke/mindustry/entities/effect/Lightning.java index a26ce41eea..7ee5e771af 100644 --- a/core/src/io/anuke/mindustry/entities/effect/Lightning.java +++ b/core/src/io/anuke/mindustry/entities/effect/Lightning.java @@ -19,7 +19,7 @@ import io.anuke.arc.math.geom.Position; import io.anuke.arc.math.geom.Rectangle; import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.util.pooling.Pools; -import io.anuke.mindustry.content.bullets.TurretBullets; +import io.anuke.mindustry.content.Bullets; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.bullet.Bullet; @@ -72,7 +72,7 @@ public class Lightning extends TimedEntity implements DrawTrait, SyncTrait, Time hit.clear(); for (int i = 0; i < length/2; i++) { - Bullet.create(TurretBullets.damageLightning, l, team, x, y, 0f, 1f, 1f, dmg); + Bullet.create(Bullets.damageLightning, l, team, x, y, 0f, 1f, 1f, dmg); l.lines.add(new Vector2(x + Mathf.range(3f), y + Mathf.range(3f))); rect.setSize(hitRange).setCenter(x, y); diff --git a/core/src/io/anuke/mindustry/entities/effect/Puddle.java b/core/src/io/anuke/mindustry/entities/effect/Puddle.java index b97dbc2f38..8ca9022031 100644 --- a/core/src/io/anuke/mindustry/entities/effect/Puddle.java +++ b/core/src/io/anuke/mindustry/entities/effect/Puddle.java @@ -19,10 +19,9 @@ import io.anuke.arc.util.Time; import io.anuke.arc.util.pooling.Pool.Poolable; import io.anuke.arc.util.pooling.Pools; import io.anuke.mindustry.content.Liquids; -import io.anuke.mindustry.content.blocks.Blocks; -import io.anuke.mindustry.content.bullets.TurretBullets; -import io.anuke.mindustry.content.fx.BlockFx; -import io.anuke.mindustry.content.fx.EnvironmentFx; +import io.anuke.mindustry.content.Blocks; +import io.anuke.mindustry.content.Bullets; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.traits.SaveTrait; import io.anuke.mindustry.entities.traits.SyncTrait; @@ -85,7 +84,7 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai Puddle p = map.get(tile.pos()); if(generation == 0 && p != null && p.lastRipple <= Time.time() - 40f){ - Effects.effect(BlockFx.ripple, tile.floor().liquidDrop.color, + Effects.effect(Fx.ripple, tile.floor().liquidDrop.color, (tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f); p.lastRipple = Time.time(); } @@ -108,7 +107,7 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai p.accepting = Math.max(amount, p.accepting); if(generation == 0 && p.lastRipple <= Time.time() - 40f && p.amount >= maxLiquid / 2f){ - Effects.effect(BlockFx.ripple, p.liquid.color, (tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f); + Effects.effect(Fx.ripple, p.liquid.color, (tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f); p.lastRipple = Time.time(); } }else{ @@ -130,16 +129,16 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai (liquid.flammability > 0.3f && dest.temperature > 0.7f)){ //flammable liquid + hot liquid Fire.create(tile); if(Mathf.chance(0.006 * amount)){ - Call.createBullet(TurretBullets.fireball, x, y, Mathf.random(360f)); + Call.createBullet(Bullets.fireball, x, y, Mathf.random(360f)); } }else if(dest.temperature > 0.7f && liquid.temperature < 0.55f){ //cold liquid poured onto hot puddle if(Mathf.chance(0.5f * amount)){ - Effects.effect(EnvironmentFx.steam, x, y); + Effects.effect(Fx.steam, x, y); } return -0.1f * amount; }else if(liquid.temperature > 0.7f && dest.temperature < 0.55f){ //hot liquid poured onto cold puddle if(Mathf.chance(0.8f * amount)){ - Effects.effect(EnvironmentFx.steam, x, y); + Effects.effect(Fx.steam, x, y); } return -0.4f * amount; } @@ -156,12 +155,12 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai } @Override - public void getHitbox(Rectangle rectangle){ + public void hitbox(Rectangle rectangle){ rectangle.setCenter(x, y).setSize(tilesize); } @Override - public void getHitboxTile(Rectangle rectangle){ + public void hitboxTile(Rectangle rectangle){ rectangle.setCenter(x, y).setSize(0f); } @@ -203,13 +202,13 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai Units.getNearby(rect.setSize(Mathf.clamp(amount / (maxLiquid / 1.5f)) * 10f).setCenter(x, y), unit -> { if(unit.isFlying()) return; - unit.getHitbox(rect2); + unit.hitbox(rect2); if(!rect.overlaps(rect2)) return; unit.applyEffect(liquid.effect, 0.5f); - if(unit.getVelocity().len() > 0.1){ - Effects.effect(BlockFx.ripple, liquid.color, unit.x, unit.y); + if(unit.velocity().len() > 0.1){ + Effects.effect(Fx.ripple, liquid.color, unit.x, unit.y); } }); diff --git a/core/src/io/anuke/mindustry/entities/traits/AbsorbTrait.java b/core/src/io/anuke/mindustry/entities/traits/AbsorbTrait.java index 7c6520364c..dedffc5203 100644 --- a/core/src/io/anuke/mindustry/entities/traits/AbsorbTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/AbsorbTrait.java @@ -11,6 +11,6 @@ public interface AbsorbTrait extends Entity, TeamTrait, DamageTrait{ } default float getShieldDamage(){ - return getDamage(); + return damage(); } } diff --git a/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java b/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java index 9a3b6e174d..dc1f1ba96b 100644 --- a/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java @@ -15,8 +15,8 @@ import io.anuke.arc.math.Mathf; import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.util.Time; import io.anuke.mindustry.Vars; -import io.anuke.mindustry.content.blocks.Blocks; -import io.anuke.mindustry.content.fx.BlockFx; +import io.anuke.mindustry.content.Blocks; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Unit; @@ -285,7 +285,7 @@ public interface BuilderTrait extends Entity{ } if(Mathf.chance(0.06 * Time.delta())){ - Effects.effect(BlockFx.pulverizeSmall, + Effects.effect(Fx.pulverizeSmall, tile.worldx() + Mathf.range(tilesize / 2f), tile.worldy() + Mathf.range(tilesize / 2f), 0f, item.color); } diff --git a/core/src/io/anuke/mindustry/entities/traits/CarryTrait.java b/core/src/io/anuke/mindustry/entities/traits/CarryTrait.java index b63ce195cd..de7f571161 100644 --- a/core/src/io/anuke/mindustry/entities/traits/CarryTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/CarryTrait.java @@ -2,7 +2,7 @@ package io.anuke.mindustry.entities.traits; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; -import io.anuke.mindustry.content.fx.UnitFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.gen.Call; import io.anuke.arc.entities.Effects; @@ -26,7 +26,7 @@ public interface CarryTrait extends TeamTrait, SolidTrait, TargetTrait{ if(trait.getCarry() != null){ //already carrying something, drop it //drop current - Effects.effect(UnitFx.unitDrop, trait.getCarry()); + Effects.effect(Fx.unitDrop, trait.getCarry()); trait.getCarry().setCarrier(null); trait.setCarry(null); @@ -37,7 +37,7 @@ public interface CarryTrait extends TeamTrait, SolidTrait, TargetTrait{ trait.setCarry(unit); unit.setCarrier(trait); - Effects.effect(UnitFx.unitPickup, trait); + Effects.effect(Fx.unitPickup, trait); } } diff --git a/core/src/io/anuke/mindustry/entities/traits/TargetTrait.java b/core/src/io/anuke/mindustry/entities/traits/TargetTrait.java index 68eac61412..f59ed37091 100644 --- a/core/src/io/anuke/mindustry/entities/traits/TargetTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/TargetTrait.java @@ -18,14 +18,14 @@ public interface TargetTrait extends Position, VelocityTrait{ if(this instanceof SolidTrait){ return ((SolidTrait) this).getDeltaX(); } - return getVelocity().x; + return velocity().x; } default float getTargetVelocityY(){ if(this instanceof SolidTrait){ return ((SolidTrait) this).getDeltaY(); } - return getVelocity().y; + return velocity().y; } /** diff --git a/core/src/io/anuke/mindustry/entities/units/BaseUnit.java b/core/src/io/anuke/mindustry/entities/units/BaseUnit.java index 840aaf19de..07c4d2dd4f 100644 --- a/core/src/io/anuke/mindustry/entities/units/BaseUnit.java +++ b/core/src/io/anuke/mindustry/entities/units/BaseUnit.java @@ -14,7 +14,7 @@ import io.anuke.arc.math.geom.Rectangle; import io.anuke.arc.util.Interval; import io.anuke.arc.util.Time; import io.anuke.mindustry.Vars; -import io.anuke.mindustry.content.fx.ExplosionFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Damage; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Unit; @@ -77,7 +77,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{ unit.onSuperDeath(); ScorchDecal.create(unit.x, unit.y); - Effects.effect(ExplosionFx.explosion, unit); + Effects.effect(Fx.explosion, unit); Effects.shake(2f, 2f, unit); //must run afterwards so the unit's group is not null when sending the removal packet @@ -85,7 +85,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{ } @Override - public float getDrag(){ + public float drag(){ return type.drag; } @@ -184,7 +184,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{ } public void targetClosest(){ - target = Units.getClosestTarget(team, x, y, Math.max(getWeapon().getAmmo().getRange(), type.range), u -> type.targetAir || !u.isFlying()); + target = Units.getClosestTarget(team, x, y, Math.max(getWeapon().getAmmo().range(), type.range), u -> type.targetAir || !u.isFlying()); } public TileEntity getClosestEnemyCore(){ @@ -275,7 +275,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{ } @Override - public float getMass(){ + public float mass(){ return type.mass; } @@ -326,7 +326,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{ } @Override - public float getMaxVelocity(){ + public float maxVelocity(){ return type.maxVelocity; } @@ -357,12 +357,12 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{ } @Override - public void getHitbox(Rectangle rectangle){ + public void hitbox(Rectangle rectangle){ rectangle.setSize(type.hitsize).setCenter(x, y); } @Override - public void getHitboxTile(Rectangle rectangle){ + public void hitboxTile(Rectangle rectangle){ rectangle.setSize(type.hitsizeTile).setCenter(x, y); } diff --git a/core/src/io/anuke/mindustry/entities/units/FlyingUnit.java b/core/src/io/anuke/mindustry/entities/units/FlyingUnit.java index f2b00660d9..bc46c97b7b 100644 --- a/core/src/io/anuke/mindustry/entities/units/FlyingUnit.java +++ b/core/src/io/anuke/mindustry/entities/units/FlyingUnit.java @@ -8,10 +8,10 @@ import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.util.Time; import io.anuke.mindustry.entities.Predict; import io.anuke.mindustry.entities.Units; +import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.entities.traits.CarriableTrait; import io.anuke.mindustry.entities.traits.CarryTrait; import io.anuke.mindustry.net.Net; -import io.anuke.mindustry.type.AmmoType; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.meta.BlockFlag; @@ -74,11 +74,11 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{ }else{ attack(150f); - if((Angles.near(angleTo(target), rotation, 15f) || !getWeapon().getAmmo().bullet.keepVelocity) //bombers don't care about rotation - && dst(target) < Math.max(getWeapon().getAmmo().getRange(), type.range)){ - AmmoType ammo = getWeapon().getAmmo(); + if((Angles.near(angleTo(target), rotation, 15f) || !getWeapon().getAmmo().keepVelocity) //bombers don't care about rotation + && dst(target) < Math.max(getWeapon().getAmmo().range(), type.range)){ + BulletType ammo = getWeapon().getAmmo(); - Vector2 to = Predict.intercept(FlyingUnit.this, target, ammo.bullet.speed); + Vector2 to = Predict.intercept(FlyingUnit.this, target, ammo.speed); getWeapon().update(FlyingUnit.this, to.x, to.y); } diff --git a/core/src/io/anuke/mindustry/entities/units/GroundUnit.java b/core/src/io/anuke/mindustry/entities/units/GroundUnit.java index ba73b95f43..b330373b8d 100644 --- a/core/src/io/anuke/mindustry/entities/units/GroundUnit.java +++ b/core/src/io/anuke/mindustry/entities/units/GroundUnit.java @@ -10,8 +10,8 @@ import io.anuke.mindustry.Vars; import io.anuke.mindustry.entities.Predict; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Units; +import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.game.Team; -import io.anuke.mindustry.type.AmmoType; import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.Weapon; import io.anuke.mindustry.world.Tile; @@ -43,11 +43,11 @@ public abstract class GroundUnit extends BaseUnit{ TileEntity core = getClosestEnemyCore(); float dst = core == null ? 0 : dst(core); - if(core != null && dst < getWeapon().getAmmo().getRange() / 1.1f){ + if(core != null && dst < getWeapon().getAmmo().range() / 1.1f){ target = core; } - if(dst > getWeapon().getAmmo().getRange() * 0.5f){ + if(dst > getWeapon().getAmmo().range() * 0.5f){ moveToCore(); } } @@ -187,13 +187,13 @@ public abstract class GroundUnit extends BaseUnit{ } if(!Units.invalidateTarget(target, this)){ - if(dst(target) < getWeapon().getAmmo().getRange()){ + if(dst(target) < getWeapon().getAmmo().range()){ rotate(angleTo(target)); if(Angles.near(angleTo(target), rotation, 13f)){ - AmmoType ammo = getWeapon().getAmmo(); + BulletType ammo = getWeapon().getAmmo(); - Vector2 to = Predict.intercept(GroundUnit.this, target, ammo.bullet.speed); + Vector2 to = Predict.intercept(GroundUnit.this, target, ammo.speed); getWeapon().update(GroundUnit.this, to.x, to.y); } diff --git a/core/src/io/anuke/mindustry/entities/units/types/Drone.java b/core/src/io/anuke/mindustry/entities/units/types/Drone.java index 7d6ffb133a..ea0458ab54 100644 --- a/core/src/io/anuke/mindustry/entities/units/types/Drone.java +++ b/core/src/io/anuke/mindustry/entities/units/types/Drone.java @@ -6,7 +6,7 @@ import io.anuke.arc.entities.EntityGroup; import io.anuke.arc.math.Mathf; import io.anuke.arc.math.geom.Geometry; import io.anuke.arc.util.Structs; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Units; diff --git a/core/src/io/anuke/mindustry/game/ContentList.java b/core/src/io/anuke/mindustry/game/ContentList.java index 838777cb84..8fc59c8bf2 100644 --- a/core/src/io/anuke/mindustry/game/ContentList.java +++ b/core/src/io/anuke/mindustry/game/ContentList.java @@ -1,12 +1,7 @@ package io.anuke.mindustry.game; -import io.anuke.mindustry.type.ContentType; - /**Interface for a list of content to be loaded in {@link io.anuke.mindustry.core.ContentLoader}.*/ public interface ContentList{ /**This method should create all the content.*/ void load(); - - /**This method should return the type of content being loaded.*/ - ContentType type(); } diff --git a/core/src/io/anuke/mindustry/graphics/BlockRenderer.java b/core/src/io/anuke/mindustry/graphics/BlockRenderer.java index 680c007cfa..6a7e2a258b 100644 --- a/core/src/io/anuke/mindustry/graphics/BlockRenderer.java +++ b/core/src/io/anuke/mindustry/graphics/BlockRenderer.java @@ -8,7 +8,7 @@ import io.anuke.arc.graphics.Color; import io.anuke.arc.graphics.g2d.Draw; import io.anuke.arc.graphics.glutils.FrameBuffer; import io.anuke.arc.util.Tmp; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.game.EventType.TileChangeEvent; import io.anuke.mindustry.game.EventType.WorldLoadEvent; import io.anuke.mindustry.game.Team; diff --git a/core/src/io/anuke/mindustry/graphics/OverlayRenderer.java b/core/src/io/anuke/mindustry/graphics/OverlayRenderer.java index ed56e89b1c..84aebcb6eb 100644 --- a/core/src/io/anuke/mindustry/graphics/OverlayRenderer.java +++ b/core/src/io/anuke/mindustry/graphics/OverlayRenderer.java @@ -9,7 +9,7 @@ import io.anuke.arc.math.geom.Rectangle; import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.util.Time; import io.anuke.arc.util.Tmp; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.input.InputHandler; diff --git a/core/src/io/anuke/mindustry/input/DesktopInput.java b/core/src/io/anuke/mindustry/input/DesktopInput.java index 034a896272..84e23a5d00 100644 --- a/core/src/io/anuke/mindustry/input/DesktopInput.java +++ b/core/src/io/anuke/mindustry/input/DesktopInput.java @@ -7,7 +7,7 @@ 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.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.graphics.Palette; diff --git a/core/src/io/anuke/mindustry/input/InputHandler.java b/core/src/io/anuke/mindustry/input/InputHandler.java index 36b1fab2ef..d349b52ec7 100644 --- a/core/src/io/anuke/mindustry/input/InputHandler.java +++ b/core/src/io/anuke/mindustry/input/InputHandler.java @@ -11,8 +11,8 @@ import io.anuke.arc.math.Mathf; import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.scene.ui.layout.Table; import io.anuke.arc.util.Time; -import io.anuke.mindustry.content.blocks.Blocks; -import io.anuke.mindustry.content.fx.EnvironmentFx; +import io.anuke.mindustry.content.Blocks; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.effect.ItemTransfer; import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest; @@ -57,7 +57,7 @@ public abstract class InputHandler implements InputProcessor{ throw new ValidateException(player, "Player cannot drop an item."); } - Effects.effect(EnvironmentFx.dropItem, Color.WHITE, player.x, player.y, angle, player.inventory.getItem().item); + Effects.effect(Fx.dropItem, Color.WHITE, player.x, player.y, angle, player.inventory.getItem().item); player.inventory.clearItem(); } diff --git a/core/src/io/anuke/mindustry/input/MobileInput.java b/core/src/io/anuke/mindustry/input/MobileInput.java index 4ac8d2f761..0919175024 100644 --- a/core/src/io/anuke/mindustry/input/MobileInput.java +++ b/core/src/io/anuke/mindustry/input/MobileInput.java @@ -18,8 +18,8 @@ import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.scene.ui.layout.Table; import io.anuke.arc.util.Align; import io.anuke.arc.util.Time; -import io.anuke.mindustry.content.blocks.Blocks; -import io.anuke.mindustry.content.fx.Fx; +import io.anuke.mindustry.content.Blocks; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.TileEntity; @@ -559,7 +559,7 @@ public class MobileInput extends InputHandler implements GestureListener{ consumed = true; player.dropCarry(); //drop off unit }else{ - Unit unit = Units.getClosest(player.getTeam(), Core.input.mouseWorld(x, y).x, Core.input.mouseWorld(x, y).y, 4f, u -> !u.isFlying() && u.getMass() <= player.mech.carryWeight); + Unit unit = Units.getClosest(player.getTeam(), Core.input.mouseWorld(x, y).x, Core.input.mouseWorld(x, y).y, 4f, u -> !u.isFlying() && u.mass() <= player.mech.carryWeight); if(unit != null){ consumed = true; diff --git a/core/src/io/anuke/mindustry/io/MapIO.java b/core/src/io/anuke/mindustry/io/MapIO.java index 87e8c228ec..6a0ac1367f 100644 --- a/core/src/io/anuke/mindustry/io/MapIO.java +++ b/core/src/io/anuke/mindustry/io/MapIO.java @@ -8,8 +8,7 @@ import io.anuke.arc.graphics.Pixmap; import io.anuke.arc.graphics.Pixmap.Format; import io.anuke.arc.util.Pack; import io.anuke.arc.util.Structs; -import io.anuke.mindustry.content.blocks.Blocks; -import io.anuke.mindustry.content.blocks.StorageBlocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.maps.Map; import io.anuke.mindustry.maps.MapMeta; @@ -96,7 +95,7 @@ public class MapIO{ } } - data.write(x, y, DataPosition.wall, StorageBlocks.core.id); + data.write(x, y, DataPosition.wall, Blocks.core.id); data.write(x, y, DataPosition.rotationTeam, Pack.byteByte((byte)0, (byte)Team.blue.ordinal())); } } diff --git a/core/src/io/anuke/mindustry/io/SaveFileVersion.java b/core/src/io/anuke/mindustry/io/SaveFileVersion.java index 73ad0f5ddb..f7e048f446 100644 --- a/core/src/io/anuke/mindustry/io/SaveFileVersion.java +++ b/core/src/io/anuke/mindustry/io/SaveFileVersion.java @@ -5,8 +5,7 @@ import io.anuke.arc.entities.Entities; import io.anuke.arc.entities.EntityGroup; import io.anuke.arc.entities.trait.Entity; import io.anuke.arc.util.Pack; -import io.anuke.mindustry.content.blocks.Blocks; -import io.anuke.mindustry.content.blocks.StorageBlocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.entities.traits.SaveTrait; import io.anuke.mindustry.entities.traits.TypeTrait; import io.anuke.mindustry.game.Content; @@ -134,7 +133,7 @@ public abstract class SaveFileVersion{ tile.entity.readConfig(stream); tile.entity.read(stream); - if(tile.block() == StorageBlocks.core){ + if(tile.block() == Blocks.core){ state.teams.get(t).cores.add(tile); } }else if(wallid == 0){ diff --git a/core/src/io/anuke/mindustry/io/TypeIO.java b/core/src/io/anuke/mindustry/io/TypeIO.java index d2bcbb1270..5ae705a176 100644 --- a/core/src/io/anuke/mindustry/io/TypeIO.java +++ b/core/src/io/anuke/mindustry/io/TypeIO.java @@ -292,16 +292,6 @@ public class TypeIO{ return content.liquid(buffer.get()); } - @WriteClass(AmmoType.class) - public static void writeAmmo(ByteBuffer buffer, AmmoType type){ - buffer.put(type.id); - } - - @ReadClass(AmmoType.class) - public static AmmoType readAmmo(ByteBuffer buffer){ - return content.getByID(ContentType.weapon, buffer.get()); - } - @WriteClass(BulletType.class) public static void writeBulletType(ByteBuffer buffer, BulletType type){ buffer.put(type.id); diff --git a/core/src/io/anuke/mindustry/maps/MapTileData.java b/core/src/io/anuke/mindustry/maps/MapTileData.java index 25398e561b..2948522b95 100644 --- a/core/src/io/anuke/mindustry/maps/MapTileData.java +++ b/core/src/io/anuke/mindustry/maps/MapTileData.java @@ -4,7 +4,7 @@ import io.anuke.arc.collection.IntIntMap; import io.anuke.arc.util.Pack; import io.anuke.arc.util.Structs; import io.anuke.mindustry.Vars; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.world.Block; import java.nio.ByteBuffer; diff --git a/core/src/io/anuke/mindustry/maps/SectorPresets.java b/core/src/io/anuke/mindustry/maps/SectorPresets.java index c60115e2e2..c6fd850b7b 100644 --- a/core/src/io/anuke/mindustry/maps/SectorPresets.java +++ b/core/src/io/anuke/mindustry/maps/SectorPresets.java @@ -2,14 +2,7 @@ package io.anuke.mindustry.maps; import io.anuke.arc.collection.Array; import io.anuke.arc.collection.GridMap; -import io.anuke.mindustry.content.Items; -import io.anuke.mindustry.content.Liquids; -import io.anuke.mindustry.content.Mechs; -import io.anuke.mindustry.content.UnitTypes; -import io.anuke.mindustry.content.blocks.CraftingBlocks; -import io.anuke.mindustry.content.blocks.ProductionBlocks; -import io.anuke.mindustry.content.blocks.UnitBlocks; -import io.anuke.mindustry.content.blocks.UpgradeBlocks; +import io.anuke.mindustry.content.*; import io.anuke.mindustry.entities.units.UnitCommand; import io.anuke.mindustry.maps.missions.*; import io.anuke.mindustry.type.Item; @@ -30,9 +23,9 @@ public class SectorPresets{ //command center mission add(new SectorPreset(0, 1, Array.ofRecursive( - Missions.blockRecipe(UnitBlocks.daggerFactory), + Missions.blockRecipe(Blocks.daggerFactory), new UnitMission(UnitTypes.dagger), - Missions.blockRecipe(UnitBlocks.commandCenter), + Missions.blockRecipe(Blocks.commandCenter), new CommandMission(UnitCommand.retreat), new CommandMission(UnitCommand.attack), new BattleMission() @@ -42,7 +35,7 @@ public class SectorPresets{ //pad mission add(new SectorPreset(0, -2, Array.ofRecursive( - Missions.blockRecipe(mobile ? UpgradeBlocks.alphaPad : UpgradeBlocks.dartPad), + Missions.blockRecipe(mobile ? Blocks.alphaPad : Blocks.dartPad), new MechMission(mobile ? Mechs.alpha : Mechs.dart), new WaveMission(15) ), @@ -51,10 +44,10 @@ public class SectorPresets{ //oil mission add(new SectorPreset(-2, 0, Array.ofRecursive( - Missions.blockRecipe(ProductionBlocks.cultivator), - Missions.blockRecipe(ProductionBlocks.waterExtractor), + Missions.blockRecipe(Blocks.cultivator), + Missions.blockRecipe(Blocks.waterExtractor), new ContentMission(Items.biomatter), - Missions.blockRecipe(CraftingBlocks.biomatterCompressor), + Missions.blockRecipe(Blocks.biomatterCompressor), new ContentMission(Liquids.oil), new BattleMission() ), diff --git a/core/src/io/anuke/mindustry/maps/TutorialSector.java b/core/src/io/anuke/mindustry/maps/TutorialSector.java index 1886f8cafc..dc3d6347a3 100644 --- a/core/src/io/anuke/mindustry/maps/TutorialSector.java +++ b/core/src/io/anuke/mindustry/maps/TutorialSector.java @@ -1,10 +1,8 @@ package io.anuke.mindustry.maps; import io.anuke.arc.collection.Array; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.content.Items; -import io.anuke.mindustry.content.blocks.ProductionBlocks; -import io.anuke.mindustry.content.blocks.StorageBlocks; -import io.anuke.mindustry.content.blocks.UnitBlocks; import io.anuke.mindustry.maps.missions.BlockMission; import io.anuke.mindustry.maps.missions.ItemMission; import io.anuke.mindustry.maps.missions.Mission; @@ -91,13 +89,13 @@ public class TutorialSector{ //intentionally unlocalized new ItemMission(Items.copper, 50).setMessage("An updated tutorial will return next build.\nFor now, you'll have to deal with... this."), - new BlockMission(ProductionBlocks.mechanicalDrill), + new BlockMission(Blocks.mechanicalDrill), new ItemMission(Items.copper, 100), new ItemMission(Items.lead, 50), // new BlockMission(CraftingBlocks.smelter), - new ItemMission(Items.densealloy, 10), + new BlockMission(Blocks.smelter), new WaveMission(5) ); } @@ -108,9 +106,9 @@ public class TutorialSector{ private static void generateBase(){ int x = sectorSize - 50, y = sectorSize - 50; - world.setBlock(world.tile(x, y), StorageBlocks.core, waveTeam); - world.setBlock(world.tile(x - 1, y + 2), UnitBlocks.daggerFactory, waveTeam); - world.setBlock(world.tile(x - 1, y - 3), UnitBlocks.daggerFactory, waveTeam); + world.setBlock(world.tile(x, y), Blocks.core, waveTeam); + world.setBlock(world.tile(x - 1, y + 2), Blocks.daggerFactory, waveTeam); + world.setBlock(world.tile(x - 1, y - 3), Blocks.daggerFactory, waveTeam); //since placed() is not called here, add core manually state.teams.get(waveTeam).cores.add(world.tile(x, y)); diff --git a/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java b/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java index 0b122d1f36..bfd360bcf8 100644 --- a/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java +++ b/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java @@ -9,11 +9,10 @@ import io.anuke.arc.function.TriFunction; import io.anuke.arc.math.Mathf; import io.anuke.arc.math.geom.Geometry; import io.anuke.arc.math.geom.Point2; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Liquids; -import io.anuke.mindustry.content.blocks.*; import io.anuke.mindustry.game.Team; -import io.anuke.mindustry.type.AmmoType; import io.anuke.mindustry.type.Recipe; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Edges; @@ -55,7 +54,7 @@ public class FortressGenerator{ } void gen(){ - gen.setBlock(enemyX, enemyY, StorageBlocks.core, team); + gen.setBlock(enemyX, enemyY, Blocks.core, team); gen.random.nextBoolean(); float difficultyScl = Mathf.clamp(gen.sector.difficulty / 20f + gen.random.range(0.25f), 0f, 0.9999f); @@ -74,12 +73,14 @@ public class FortressGenerator{ float placeChance = difficultyScl*0.75f+0.25f; IntIntMap ammoPerType = new IntIntMap(); + //todo implement + /* for(Block turret : turrets){ if(!(turret instanceof ItemTurret)) continue; ItemTurret t = (ItemTurret)turret; int size = t.getAmmoTypes().length; ammoPerType.put(t.id, Mathf.clamp((int)(size* difficultyScl) + gen.random.range(1), 0, size - 1)); - } + }*/ TriFunction, Boolean> checker = (current, block, pred) -> { for(Point2 point : Edges.getEdges(block.size)){ @@ -108,25 +109,25 @@ public class FortressGenerator{ Array passes = Array.with( //initial seeding solar panels - placer.get(PowerBlocks.largeSolarPanel, 0.001f), + placer.get(Blocks.largeSolarPanel, 0.001f), //extra seeding - seeder.get(PowerBlocks.solarPanel, tile -> tile.block() == PowerBlocks.largeSolarPanel && gen.random.chance(0.3)), + seeder.get(Blocks.solarPanel, tile -> tile.block() == Blocks.largeSolarPanel && gen.random.chance(0.3)), //coal gens - seeder.get(PowerBlocks.combustionGenerator, tile -> tile.block() instanceof SolarGenerator && gen.random.chance(0.2)), + seeder.get(Blocks.combustionGenerator, tile -> tile.block() instanceof SolarGenerator && gen.random.chance(0.2)), //water extractors - seeder.get(ProductionBlocks.waterExtractor, tile -> tile.block() instanceof NuclearReactor && gen.random.chance(0.5)), + seeder.get(Blocks.waterExtractor, tile -> tile.block() instanceof NuclearReactor && gen.random.chance(0.5)), //mend projectors - seeder.get(DefenseBlocks.mendProjector, tile -> tile.block() instanceof PowerGenerator && gen.random.chance(0.04)), + seeder.get(Blocks.mendProjector, tile -> tile.block() instanceof PowerGenerator && gen.random.chance(0.04)), //power turrets seeder.get(powerTurret, tile -> tile.block() instanceof PowerGenerator && gen.random.chance(0.04)), //repair point - seeder.get(UnitBlocks.repairPoint, tile -> tile.block() instanceof PowerGenerator && gen.random.chance(0.1)), + seeder.get(Blocks.repairPoint, tile -> tile.block() instanceof PowerGenerator && gen.random.chance(0.1)), //turrets1 seeder.get(turret1, tile -> tile.block() instanceof PowerBlock && gen.random.chance(0.22 - turret1.size*0.02)), @@ -135,22 +136,22 @@ public class FortressGenerator{ seeder.get(turret2, tile -> tile.block() instanceof PowerBlock && gen.random.chance(0.12 - turret2.size*0.02)), //shields - seeder.get(DefenseBlocks.forceProjector, tile -> (tile.block() instanceof CoreBlock || tile.block() instanceof UnitFactory) && gen.random.chance(0.2 * dscl2)), + seeder.get(Blocks.forceProjector, tile -> (tile.block() instanceof CoreBlock || tile.block() instanceof UnitFactory) && gen.random.chance(0.2 * dscl2)), //unit pads (assorted) - seeder.get(UnitBlocks.daggerFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.3 * dscl2)), + seeder.get(Blocks.daggerFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.3 * dscl2)), //unit pads (assorted) - seeder.get(UnitBlocks.wraithFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.3 * dscl2)), + seeder.get(Blocks.wraithFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.3 * dscl2)), //unit pads (assorted) - seeder.get(UnitBlocks.titanFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.23 * dscl2)), + seeder.get(Blocks.titanFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.23 * dscl2)), //unit pads (assorted) - seeder.get(UnitBlocks.ghoulFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.23 * dscl2)), + seeder.get(Blocks.ghoulFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.23 * dscl2)), //vaults - seeder.get(StorageBlocks.vault, tile -> (tile.block() instanceof CoreBlock || tile.block() instanceof ForceProjector) && gen.random.chance(0.4)), + seeder.get(Blocks.vault, tile -> (tile.block() instanceof CoreBlock || tile.block() instanceof ForceProjector) && gen.random.chance(0.4)), //big turrets seeder.get(bigTurret, tile -> tile.block() instanceof StorageBlock && gen.random.chance(0.65)), @@ -172,7 +173,7 @@ public class FortressGenerator{ }, //mines - placer.get(DefenseBlocks.shockMine, 0.02f * difficultyScl), + placer.get(Blocks.shockMine, 0.02f * difficultyScl), //fill up turrets w/ ammo (x, y) -> { @@ -181,11 +182,12 @@ public class FortressGenerator{ if(block instanceof PowerTurret){ tile.entity.power.satisfaction = 1.0f; - }else if(block instanceof ItemTurret){ + //todo implement + /*}else if(block instanceof ItemTurret){ ItemTurret turret = (ItemTurret)block; AmmoType[] type = turret.getAmmoTypes(); int index = ammoPerType.get(block.id, 0); - block.handleStack(type[index].item, block.acceptStack(type[index].item, 1000, tile, null), tile, null); + block.handleStack(type[index].item, block.acceptStack(type[index].item, 1000, tile, null), tile, null);*/ }else if(block instanceof NuclearReactor){ tile.entity.items.add(Items.thorium, 30); }else if(block instanceof LiquidTurret){ diff --git a/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java b/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java index d397cd83c5..7b3e5b8796 100644 --- a/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java +++ b/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java @@ -11,9 +11,7 @@ import io.anuke.arc.util.Structs; import io.anuke.arc.util.noise.RidgedPerlin; import io.anuke.arc.util.noise.Simplex; import io.anuke.mindustry.content.Items; -import io.anuke.mindustry.content.blocks.Blocks; -import io.anuke.mindustry.content.blocks.OreBlocks; -import io.anuke.mindustry.content.blocks.StorageBlocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.maps.Map; import io.anuke.mindustry.maps.MapTileData; @@ -191,10 +189,10 @@ public class WorldGenerator{ } } - world.setBlock(tiles[spawns.get(0).x][spawns.get(0).y], StorageBlocks.core, Team.blue); + world.setBlock(tiles[spawns.get(0).x][spawns.get(0).y], Blocks.core, Team.blue); if(state.mode.isPvp){ - world.setBlock(tiles[spawns.get(1).x][spawns.get(1).y], StorageBlocks.core, Team.red); + world.setBlock(tiles[spawns.get(1).x][spawns.get(1).y], Blocks.core, Team.red); } world.endMapLoad(); @@ -237,7 +235,7 @@ public class WorldGenerator{ if(entry.noise.octaveNoise2D(1, 0.7, 1f / (4 + i * 2), x, y) / 4f + Math.abs(0.5f - entry.noise.octaveNoise2D(2, 0.7, 1f / (50 + i * 2), x, y)) > 0.48f && Math.abs(0.5f - entry.noise.octaveNoise2D(1, 1, 1f / (55 + i * 4), x, y)) > 0.22f){ - tile.setFloor((Floor) OreBlocks.get(tile.floor(), entry.item)); + tile.setFloor((Floor) OreBlock.get(tile.floor(), entry.item)); break; } } @@ -393,7 +391,7 @@ public class WorldGenerator{ Item entry = ores.get(i); if(Math.abs(0.5f - sim.octaveNoise2D(2, 0.7, 1f / (50 + i * 2), offsetX, offsetY)) > 0.23f && Math.abs(0.5f - sim2.octaveNoise2D(1, 1, 1f / (40 + i * 4), offsetX, offsetY)) > 0.32f){ - floor = OreBlocks.get(floor, entry); + floor = OreBlock.get(floor, entry); break; } } diff --git a/core/src/io/anuke/mindustry/maps/missions/MissionWithStartingCore.java b/core/src/io/anuke/mindustry/maps/missions/MissionWithStartingCore.java index 24a086d02a..a8d21a0633 100644 --- a/core/src/io/anuke/mindustry/maps/missions/MissionWithStartingCore.java +++ b/core/src/io/anuke/mindustry/maps/missions/MissionWithStartingCore.java @@ -2,7 +2,7 @@ package io.anuke.mindustry.maps.missions; import io.anuke.arc.math.geom.Point2; import io.anuke.arc.collection.Array; -import io.anuke.mindustry.content.blocks.StorageBlocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.maps.generation.Generation; import io.anuke.mindustry.world.Tile; @@ -39,7 +39,7 @@ public abstract class MissionWithStartingCore extends Mission{ } Tile startingCoreTile = gen.tiles[spawnPoints.first().x][spawnPoints.first().y]; - startingCoreTile.setBlock(StorageBlocks.core); + startingCoreTile.setBlock(Blocks.core); startingCoreTile.setTeam(team); state.teams.get(team).cores.add(startingCoreTile); diff --git a/core/src/io/anuke/mindustry/net/NetworkIO.java b/core/src/io/anuke/mindustry/net/NetworkIO.java index dc16abf908..659370dd32 100644 --- a/core/src/io/anuke/mindustry/net/NetworkIO.java +++ b/core/src/io/anuke/mindustry/net/NetworkIO.java @@ -6,7 +6,7 @@ import io.anuke.arc.collection.ObjectMap.Entry; import io.anuke.arc.entities.Entities; import io.anuke.arc.util.Pack; import io.anuke.arc.util.Time; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.game.GameMode; import io.anuke.mindustry.game.Team; diff --git a/core/src/io/anuke/mindustry/type/AmmoEntry.java b/core/src/io/anuke/mindustry/type/AmmoEntry.java deleted file mode 100644 index d92c7963e5..0000000000 --- a/core/src/io/anuke/mindustry/type/AmmoEntry.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.anuke.mindustry.type; - -/**Used to store ammo amounts in turrets.*/ -public class AmmoEntry{ - public AmmoType type; - public int amount; - - public AmmoEntry(AmmoType type, int amount){ - this.type = type; - this.amount = amount; - } -} diff --git a/core/src/io/anuke/mindustry/type/AmmoType.java b/core/src/io/anuke/mindustry/type/AmmoType.java deleted file mode 100644 index 24150b4b14..0000000000 --- a/core/src/io/anuke/mindustry/type/AmmoType.java +++ /dev/null @@ -1,75 +0,0 @@ -package io.anuke.mindustry.type; - -import io.anuke.mindustry.content.fx.Fx; -import io.anuke.mindustry.entities.bullet.BulletType; -import io.anuke.mindustry.game.Content; -import io.anuke.arc.entities.Effects.Effect; - -public class AmmoType extends Content { - /**The item used. Always null if liquid isn't.*/ - public final Item item; - /**The liquid used. Always null if item isn't.*/ - public final Liquid liquid; - /**The resulting bullet. Never null.*/ - public final BulletType bullet; - /** - * For item ammo, this is amount given per ammo item. - * For liquid ammo, this is amount used per shot. - */ - public final float quantityMultiplier; - /**Reload speed multiplier.*/ - public float reloadMultiplier = 1f; - /**Bullet recoil strength.*/ - public float recoil = 0f; - /**Additional inaccuracy in degrees.*/ - public float inaccuracy; - /**Effect created when shooting.*/ - public Effect shootEffect = Fx.none; - /**Extra smoke effect created when shooting.*/ - public Effect smokeEffect = Fx.none; - /**Range. Use a value < 0 to calculate from bullet.*/ - public float range = -1f; - - /** - * Creates an AmmoType with no liquid or item. Used for power-based ammo. - */ - public AmmoType(BulletType result){ - this.item = null; - this.liquid = null; - this.bullet = result; - this.quantityMultiplier = 1f; - this.reloadMultiplier = 1f; - } - - /** - * Creates an AmmoType with an item. - */ - public AmmoType(Item item, BulletType result, float multiplier){ - this.item = item; - this.liquid = null; - this.bullet = result; - this.quantityMultiplier = multiplier; - } - - /** - * Creates an AmmoType with a liquid. - */ - public AmmoType(Liquid liquid, BulletType result, float multiplier){ - this.item = null; - this.liquid = liquid; - this.bullet = result; - this.quantityMultiplier = multiplier; - } - - /** - * Returns maximum distance the bullet this ammo type has can travel. - */ - public float getRange(){ - return range < 0 ? bullet.speed * bullet.lifetime : range; - } - - @Override - public ContentType getContentType(){ - return ContentType.ammo; - } -} diff --git a/core/src/io/anuke/mindustry/type/ContentType.java b/core/src/io/anuke/mindustry/type/ContentType.java index 80ae68252a..139f37836a 100644 --- a/core/src/io/anuke/mindustry/type/ContentType.java +++ b/core/src/io/anuke/mindustry/type/ContentType.java @@ -11,7 +11,6 @@ public enum ContentType { weapon, status, unit, - ammo, weather, effect } diff --git a/core/src/io/anuke/mindustry/type/Weapon.java b/core/src/io/anuke/mindustry/type/Weapon.java index d15ef9a3ae..dda242a463 100644 --- a/core/src/io/anuke/mindustry/type/Weapon.java +++ b/core/src/io/anuke/mindustry/type/Weapon.java @@ -10,9 +10,10 @@ import io.anuke.arc.math.Angles; import io.anuke.arc.math.Mathf; import io.anuke.arc.math.geom.Vector2; import io.anuke.mindustry.Vars; -import io.anuke.mindustry.content.fx.Fx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.bullet.Bullet; +import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.entities.traits.ShooterTrait; import io.anuke.mindustry.game.Content; import io.anuke.mindustry.gen.Call; @@ -24,7 +25,7 @@ public class Weapon extends Content{ /**minimum cursor distance from player, fixes 'cross-eyed' shooting.*/ protected static float minPlayerDist = 20f; /**ammo type map. set with setAmmo()*/ - protected AmmoType ammo; + protected BulletType ammo; /**shell ejection effect*/ protected Effect ejectEffect = Fx.none; /**weapon reload in frames*/ @@ -47,7 +48,7 @@ public class Weapon extends Content{ protected float velocityRnd = 0f; /**whether to shoot the weapons in different arms one after another, rather than all at once*/ protected boolean roundrobin = false; - /**translator for vector calulations*/ + /**vector for vector calulations*/ protected Vector2 tr = new Vector2(); public TextureRegion equipRegion, region; @@ -81,11 +82,11 @@ public class Weapon extends Content{ Weapon weapon = shooter.getWeapon(); Angles.shotgun(weapon.shots, weapon.spacing, rotation, f -> weapon.bullet(shooter, x, y, f + Mathf.range(weapon.inaccuracy))); - AmmoType ammo = weapon.ammo; + BulletType ammo = weapon.ammo; weapon.tr.trns(rotation + 180f, ammo.recoil); - shooter.getVelocity().add(weapon.tr); + shooter.velocity().add(weapon.tr); weapon.tr.trns(rotation, 3f); @@ -109,7 +110,7 @@ public class Weapon extends Content{ return ContentType.weapon; } - public AmmoType getAmmo(){ + public BulletType getAmmo(){ return ammo; } @@ -165,7 +166,7 @@ public class Weapon extends Content{ if(owner == null) return; tr.trns(angle, 3f); - Bullet.create(ammo.bullet, + Bullet.create(ammo, owner, owner.getTeam(), x + tr.x, y + tr.y, angle, (1f - velocityRnd) + Mathf.random(velocityRnd)); } } diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlockConfigFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlockConfigFragment.java index 3a0c43a706..6617701231 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlockConfigFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlockConfigFragment.java @@ -8,7 +8,7 @@ import io.anuke.arc.scene.Group; import io.anuke.arc.scene.actions.Actions; import io.anuke.arc.scene.ui.layout.Table; import io.anuke.arc.util.Align; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.input.InputHandler; import io.anuke.mindustry.world.Block; diff --git a/core/src/io/anuke/mindustry/world/BaseBlock.java b/core/src/io/anuke/mindustry/world/BaseBlock.java index 835f764760..cc9d0a7223 100644 --- a/core/src/io/anuke/mindustry/world/BaseBlock.java +++ b/core/src/io/anuke/mindustry/world/BaseBlock.java @@ -6,7 +6,7 @@ import io.anuke.arc.math.Mathf; import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.util.Time; import io.anuke.mindustry.Vars; -import io.anuke.mindustry.content.fx.EnvironmentFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.effect.Puddle; @@ -157,13 +157,13 @@ public abstract class BaseBlock extends MappableContent{ tile.entity.damage(1 * Time.delta()); next.entity.damage(1 * Time.delta()); if(Mathf.chance(0.1 * Time.delta())){ - Effects.effect(EnvironmentFx.fire, (tile.worldx() + next.worldx()) / 2f, (tile.worldy() + next.worldy()) / 2f); + Effects.effect(Fx.fire, (tile.worldx() + next.worldx()) / 2f, (tile.worldy() + next.worldy()) / 2f); } }else if((liquid.temperature > 0.7f && other.temperature < 0.55f) || (other.temperature > 0.7f && liquid.temperature < 0.55f)){ tile.entity.liquids.remove(liquid, Math.min(tile.entity.liquids.get(liquid), 0.7f * Time.delta())); if(Mathf.chance(0.2f * Time.delta())){ - Effects.effect(EnvironmentFx.steam, (tile.worldx() + next.worldx()) / 2f, (tile.worldy() + next.worldy()) / 2f); + Effects.effect(Fx.steam, (tile.worldx() + next.worldx()) / 2f, (tile.worldy() + next.worldy()) / 2f); } } } diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 561eb9e90e..2070fff452 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -352,7 +352,7 @@ public class Block extends BaseBlock { } public void handleBulletHit(TileEntity entity, Bullet bullet){ - entity.damage(bullet.getDamage()); + entity.damage(bullet.damage()); } public void update(Tile tile){ diff --git a/core/src/io/anuke/mindustry/world/Build.java b/core/src/io/anuke/mindustry/world/Build.java index 4f16b48e00..008eb1bd8b 100644 --- a/core/src/io/anuke/mindustry/world/Build.java +++ b/core/src/io/anuke/mindustry/world/Build.java @@ -6,7 +6,7 @@ import io.anuke.arc.math.Mathf; import io.anuke.arc.math.geom.Geometry; import io.anuke.arc.math.geom.Point2; import io.anuke.arc.math.geom.Rectangle; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.game.EventType.BlockBuildBeginEvent; import io.anuke.mindustry.game.Team; diff --git a/core/src/io/anuke/mindustry/world/ColorMapper.java b/core/src/io/anuke/mindustry/world/ColorMapper.java index 2ed01898b6..c8cbb56f5b 100644 --- a/core/src/io/anuke/mindustry/world/ColorMapper.java +++ b/core/src/io/anuke/mindustry/world/ColorMapper.java @@ -5,7 +5,6 @@ import io.anuke.arc.collection.ObjectIntMap; import io.anuke.arc.graphics.Color; import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.game.Team; -import io.anuke.mindustry.type.ContentType; import static io.anuke.mindustry.Vars.content; @@ -49,9 +48,4 @@ public class ColorMapper implements ContentList{ colorMap.put(block, color); } } - - @Override - public ContentType type(){ - return ContentType.block; - } } diff --git a/core/src/io/anuke/mindustry/world/LegacyColorMapper.java b/core/src/io/anuke/mindustry/world/LegacyColorMapper.java index cafed297fe..794133e047 100644 --- a/core/src/io/anuke/mindustry/world/LegacyColorMapper.java +++ b/core/src/io/anuke/mindustry/world/LegacyColorMapper.java @@ -2,12 +2,11 @@ package io.anuke.mindustry.world; import io.anuke.arc.collection.IntMap; import io.anuke.arc.graphics.Color; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.content.Items; -import io.anuke.mindustry.content.blocks.Blocks; -import io.anuke.mindustry.content.blocks.OreBlocks; import io.anuke.mindustry.game.ContentList; -import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.world.blocks.Floor; +import io.anuke.mindustry.world.blocks.OreBlock; public class LegacyColorMapper implements ContentList{ private static IntMap blockMap = new IntMap<>(); @@ -39,15 +38,10 @@ public class LegacyColorMapper implements ContentList{ map("6e501e", Blocks.dirt, 0); map("ed5334", Blocks.lava, 0); map("292929", Blocks.tar, 0); - map("c3a490", OreBlocks.get(Blocks.stone, Items.copper), 0); - map("161616", OreBlocks.get(Blocks.stone, Items.coal), 0); - map("6277bc", OreBlocks.get(Blocks.stone, Items.titanium), 0); - map("83bc58", OreBlocks.get(Blocks.stone, Items.thorium), 0); - } - - @Override - public ContentType type(){ - return ContentType.block; + map("c3a490", OreBlock.get(Blocks.stone, Items.copper), 0); + map("161616", OreBlock.get(Blocks.stone, Items.coal), 0); + map("6277bc", OreBlock.get(Blocks.stone, Items.titanium), 0); + map("83bc58", OreBlock.get(Blocks.stone, Items.thorium), 0); } private void map(String color, Block block, int elevation){ diff --git a/core/src/io/anuke/mindustry/world/Tile.java b/core/src/io/anuke/mindustry/world/Tile.java index cbdda80858..21dc6041da 100644 --- a/core/src/io/anuke/mindustry/world/Tile.java +++ b/core/src/io/anuke/mindustry/world/Tile.java @@ -7,7 +7,7 @@ import io.anuke.arc.math.geom.Point2; import io.anuke.arc.math.geom.Position; import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.util.Pack; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.traits.TargetTrait; import io.anuke.mindustry.game.Team; @@ -425,7 +425,7 @@ public class Tile implements Position, TargetTrait{ } @Override - public Vector2 getVelocity(){ + public Vector2 velocity(){ return Vector2.ZERO; } diff --git a/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java b/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java index 4337d83955..441508c55c 100644 --- a/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java @@ -9,8 +9,7 @@ import io.anuke.arc.entities.Effects; import io.anuke.arc.graphics.g2d.Draw; import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.math.Mathf; -import io.anuke.mindustry.content.fx.ExplosionFx; -import io.anuke.mindustry.content.fx.Fx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Unit; @@ -103,7 +102,7 @@ public class BuildBlock extends Block{ @Override public void onDestroyed(Tile tile){ - Effects.effect(ExplosionFx.blockExplosionSmoke, tile); + Effects.effect(Fx.blockExplosionSmoke, tile); if(!tile.floor().solid && !tile.floor().isLiquid){ RubbleDecal.create(tile.drawx(), tile.drawy(), size); diff --git a/core/src/io/anuke/mindustry/world/blocks/Floor.java b/core/src/io/anuke/mindustry/world/blocks/Floor.java index abc3cd3a9b..aabc7e3020 100644 --- a/core/src/io/anuke/mindustry/world/blocks/Floor.java +++ b/core/src/io/anuke/mindustry/world/blocks/Floor.java @@ -11,7 +11,7 @@ import io.anuke.arc.math.Mathf; import io.anuke.arc.math.geom.Geometry; import io.anuke.arc.math.geom.Vector2; import io.anuke.mindustry.content.StatusEffects; -import io.anuke.mindustry.content.fx.BlockFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.type.StatusEffect; import io.anuke.mindustry.world.Block; @@ -33,9 +33,9 @@ public class Floor extends Block{ /** How many ticks it takes to drown on this. */ public float drownTime = 0f; /** Effect when walking on this floor. */ - public Effect walkEffect = BlockFx.ripple; + public Effect walkEffect = Fx.ripple; /** Effect displayed when drowning on this floor. */ - public Effect drownUpdateEffect = BlockFx.bubble; + public Effect drownUpdateEffect = Fx.bubble; /** Status effect applied when walking on. */ public StatusEffect status = StatusEffects.none; /** Intensity of applied status effect. */ diff --git a/core/src/io/anuke/mindustry/world/blocks/OreBlock.java b/core/src/io/anuke/mindustry/world/blocks/OreBlock.java index ec04c1ade7..873a2bbd74 100644 --- a/core/src/io/anuke/mindustry/world/blocks/OreBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/OreBlock.java @@ -1,13 +1,17 @@ package io.anuke.mindustry.world.blocks; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.graphics.g2d.Draw; import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.math.Mathf; 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.arc.graphics.g2d.Draw; -import io.anuke.arc.math.Mathf; public class OreBlock extends Floor{ + private static final ObjectMap> oreBlockMap = new ObjectMap<>(); + public Floor base; public OreBlock(Item ore, Floor base){ @@ -18,6 +22,8 @@ public class OreBlock extends Floor{ this.variants = 3; this.minimapColor = ore.color; this.edge = base.name; + + oreBlockMap.getOr(ore, ObjectMap::new).put(base, this); } @Override @@ -47,4 +53,9 @@ public class OreBlock extends Floor{ base.drawEdges(tile, true); } + public static Block get(Block floor, Item item){ + if(!oreBlockMap.containsKey(item)) throw new IllegalArgumentException("Item '" + item + "' is not an ore!"); + if(!oreBlockMap.get(item).containsKey(floor)) throw new IllegalArgumentException("Block '" + floor.name + "' does not support ores!"); + return oreBlockMap.get(item).get(floor); + } } diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/DeflectorWall.java b/core/src/io/anuke/mindustry/world/blocks/defense/DeflectorWall.java index 5a857f18e9..08392d7d32 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/DeflectorWall.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/DeflectorWall.java @@ -49,13 +49,13 @@ public class DeflectorWall extends Wall{ super.handleBulletHit(entity, bullet); //doesn't reflect powerful bullets - if(bullet.getDamage() > maxDamageDeflect) return; + if(bullet.damage() > maxDamageDeflect) return; float penX = Math.abs(entity.x - bullet.x), penY = Math.abs(entity.y - bullet.y); - bullet.getHitbox(rect2); + bullet.hitbox(rect2); - Vector2 position = Geometry.raycastRect(bullet.x, bullet.y, bullet.x + bullet.getVelocity().x, bullet.y + bullet.getVelocity().y, + Vector2 position = Geometry.raycastRect(bullet.x, bullet.y, bullet.x + bullet.velocity().x, bullet.y + bullet.velocity().y, rect.setCenter(entity.x, entity.y).setSize(size * tilesize + rect2.width + rect2.height)); if(position != null){ @@ -63,9 +63,9 @@ public class DeflectorWall extends Wall{ } if(penX > penY){ - bullet.getVelocity().x *= -1; + bullet.velocity().x *= -1; }else{ - bullet.getVelocity().y *= -1; + bullet.velocity().y *= -1; } bullet.updateVelocity(); diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/Door.java b/core/src/io/anuke/mindustry/world/blocks/defense/Door.java index 7b2303a99a..a85545453c 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/Door.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/Door.java @@ -8,7 +8,7 @@ import io.anuke.arc.entities.Effects.Effect; import io.anuke.arc.graphics.g2d.Draw; import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.math.geom.Rectangle; -import io.anuke.mindustry.content.fx.BlockFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Units; @@ -21,8 +21,8 @@ import java.io.IOException; public class Door extends Wall{ protected final Rectangle rect = new Rectangle(); - protected Effect openfx = BlockFx.dooropen; - protected Effect closefx = BlockFx.doorclose; + protected Effect openfx = Fx.dooropen; + protected Effect closefx = Fx.doorclose; protected TextureRegion openRegion; diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/ForceProjector.java b/core/src/io/anuke/mindustry/world/blocks/defense/ForceProjector.java index e0a3a2c3e1..5eaa7b6c42 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/ForceProjector.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/ForceProjector.java @@ -13,8 +13,7 @@ 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.BlockFx; -import io.anuke.mindustry.content.fx.BulletFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.traits.AbsorbTrait; import io.anuke.mindustry.graphics.Palette; @@ -93,7 +92,7 @@ public class ForceProjector extends Block { entity.radscl = Mathf.lerpDelta(entity.radscl, entity.broken ? 0f : 1f, 0.05f); if(Mathf.chance(Time.delta() * entity.buildup / breakage * 0.1f)){ - Effects.effect(BlockFx.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: @@ -136,7 +135,7 @@ public class ForceProjector extends Block { if(entity.buildup >= breakage && !entity.broken){ entity.broken = true; entity.buildup = breakage; - Effects.effect(BlockFx.shieldBreak, tile.drawx(), tile.drawy(), radius); + Effects.effect(Fx.shieldBreak, tile.drawx(), tile.drawy(), radius); } if(entity.hit > 0f){ @@ -150,7 +149,7 @@ public class ForceProjector extends Block { AbsorbTrait trait = (AbsorbTrait)bullet; if(trait.canBeAbsorbed() && trait.getTeam() != tile.getTeam() && isInsideHexagon(trait.getX(), trait.getY(), realRadius * 2f, tile.drawx(), tile.drawy())){ trait.absorb(); - Effects.effect(BulletFx.absorb, trait); + Effects.effect(Fx.absorb, trait); float relativeDamagePowerDraw = trait.getShieldDamage() * powerDamage / consumePower.powerCapacity; entity.hit = 1f; diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/MendProjector.java b/core/src/io/anuke/mindustry/world/blocks/defense/MendProjector.java index a945cfdf68..5877a7b20d 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/MendProjector.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/MendProjector.java @@ -11,7 +11,7 @@ import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.math.Mathf; import io.anuke.arc.util.Time; import io.anuke.arc.util.Tmp; -import io.anuke.mindustry.content.fx.BlockFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; @@ -67,7 +67,7 @@ public class MendProjector extends Block{ if(entity.charge >= reload){ float realRange = range + entity.phaseHeat * phaseRangeBoost; - Effects.effect(BlockFx.healWaveMend, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), tile.drawx(), tile.drawy(), realRange); + Effects.effect(Fx.healWaveMend, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), tile.drawx(), tile.drawy(), realRange); entity.charge = 0f; int tileRange = (int)(realRange / tilesize); @@ -84,7 +84,7 @@ public class MendProjector extends Block{ if(other.getTeamID() == tile.getTeamID() && !healed.contains(other.pos()) && other.entity != null && other.entity.health < other.entity.maxHealth()){ other.entity.healBy(other.entity.maxHealth() * (healPercent + entity.phaseHeat*phaseBoost)/100f * entity.power.satisfaction); - Effects.effect(BlockFx.healBlockFull, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), other.drawx(), other.drawy(), other.block().size); + Effects.effect(Fx.healBlockFull, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), other.drawx(), other.drawy(), other.block().size); healed.add(other.pos()); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/OverdriveProjector.java b/core/src/io/anuke/mindustry/world/blocks/defense/OverdriveProjector.java index 100856eeca..6e2c303417 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/OverdriveProjector.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/OverdriveProjector.java @@ -11,7 +11,7 @@ import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.math.Mathf; import io.anuke.arc.util.Time; import io.anuke.arc.util.Tmp; -import io.anuke.mindustry.content.fx.BlockFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; @@ -69,7 +69,7 @@ public class OverdriveProjector extends Block{ float realRange = range + entity.phaseHeat * phaseRangeBoost; float realBoost = (speedBoost + entity.phaseHeat*speedBoostPhase) * entity.power.satisfaction; - Effects.effect(BlockFx.overdriveWave, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), tile.drawx(), tile.drawy(), realRange); + Effects.effect(Fx.overdriveWave, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), tile.drawx(), tile.drawy(), realRange); entity.charge = 0f; int tileRange = (int)(realRange / tilesize); @@ -87,7 +87,7 @@ public class OverdriveProjector extends Block{ if(other.getTeamID() == tile.getTeamID() && !healed.contains(other.pos()) && other.entity != null){ other.entity.timeScaleDuration = Math.max(other.entity.timeScaleDuration, reload + 1f); other.entity.timeScale = Math.max(other.entity.timeScale, realBoost); - Effects.effect(BlockFx.overdriveBlockFull, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), other.drawx(), other.drawy(), other.block().size); + Effects.effect(Fx.overdriveBlockFull, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), other.drawx(), other.drawy(), other.block().size); healed.add(other.pos()); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/SurgeWall.java b/core/src/io/anuke/mindustry/world/blocks/defense/SurgeWall.java index 307afd4425..5316227bfc 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/SurgeWall.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/SurgeWall.java @@ -19,7 +19,7 @@ public class SurgeWall extends Wall{ public void handleBulletHit(TileEntity entity, Bullet bullet){ super.handleBulletHit(entity, bullet); if(Mathf.chance(lightningChance)){ - Lightning.create(entity.getTeam(), Palette.surge, lightningDamage, bullet.x, bullet.y, bullet.angle() + 180f, lightningLength); + Lightning.create(entity.getTeam(), Palette.surge, lightningDamage, bullet.x, bullet.y, bullet.rot() + 180f, lightningLength); } } } diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ArtilleryTurret.java b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ArtilleryTurret.java index ba3002ea62..62b2770407 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ArtilleryTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ArtilleryTurret.java @@ -1,11 +1,11 @@ package io.anuke.mindustry.world.blocks.defense.turrets; +import io.anuke.arc.math.Mathf; import io.anuke.arc.math.geom.Vector2; import io.anuke.mindustry.entities.Predict; import io.anuke.mindustry.entities.bullet.Bullet; -import io.anuke.mindustry.type.AmmoType; +import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.world.Tile; -import io.anuke.arc.math.Mathf; import static io.anuke.mindustry.Vars.tilesize; @@ -21,23 +21,23 @@ public class ArtilleryTurret extends ItemTurret{ } @Override - protected void shoot(Tile tile, AmmoType ammo){ + protected void shoot(Tile tile, BulletType ammo){ TurretEntity entity = tile.entity(); entity.recoil = recoil; entity.heat = 1f; - AmmoType type = peekAmmo(tile); + BulletType type = peekAmmo(tile); tr.trns(entity.rotation, size * tilesize / 2); - Vector2 predict = Predict.intercept(tile, entity.target, type.bullet.speed); + Vector2 predict = Predict.intercept(tile, entity.target, type.speed); float dst = entity.dst(predict.x, predict.y); - float maxTraveled = type.bullet.lifetime * type.bullet.speed; + float maxTraveled = type.lifetime * type.speed; for(int i = 0; i < shots; i++){ - Bullet.create(ammo.bullet, tile.entity, tile.getTeam(), tile.drawx() + tr.x, tile.drawy() + tr.y, + Bullet.create(ammo, tile.entity, tile.getTeam(), tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation + Mathf.range(inaccuracy + type.inaccuracy), 1f + Mathf.range(velocityInaccuracy), (dst / maxTraveled)); } diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/BurstTurret.java b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/BurstTurret.java index fdbe9686b5..dac9df8e98 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/BurstTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/BurstTurret.java @@ -1,9 +1,9 @@ package io.anuke.mindustry.world.blocks.defense.turrets; -import io.anuke.mindustry.type.AmmoType; -import io.anuke.mindustry.world.Tile; -import io.anuke.arc.util.Time; import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Time; +import io.anuke.mindustry.entities.bullet.BulletType; +import io.anuke.mindustry.world.Tile; import static io.anuke.mindustry.Vars.tilesize; @@ -15,7 +15,7 @@ public class BurstTurret extends ItemTurret{ } @Override - protected void shoot(Tile tile, AmmoType ammo){ + protected void shoot(Tile tile, BulletType ammo){ TurretEntity entity = tile.entity(); entity.heat = 1f; @@ -28,7 +28,7 @@ public class BurstTurret extends ItemTurret{ entity.recoil = recoil; tr.trns(entity.rotation, size * tilesize / 2, Mathf.range(xRand)); - bullet(tile, ammo.bullet, entity.rotation + Mathf.range(inaccuracy)); + bullet(tile, ammo, entity.rotation + Mathf.range(inaccuracy)); effects(tile); useAmmo(tile); }); diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ChargeTurret.java b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ChargeTurret.java index 3c5f66a7e5..855dc67fb2 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ChargeTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ChargeTurret.java @@ -1,13 +1,13 @@ package io.anuke.mindustry.world.blocks.defense.turrets; -import io.anuke.mindustry.content.fx.Fx; -import io.anuke.mindustry.entities.TileEntity; -import io.anuke.mindustry.type.AmmoType; -import io.anuke.mindustry.world.Tile; import io.anuke.arc.entities.Effects; import io.anuke.arc.entities.Effects.Effect; -import io.anuke.arc.util.Time; import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Time; +import io.anuke.mindustry.content.Fx; +import io.anuke.mindustry.entities.TileEntity; +import io.anuke.mindustry.entities.bullet.BulletType; +import io.anuke.mindustry.world.Tile; import static io.anuke.mindustry.Vars.tilesize; @@ -24,7 +24,7 @@ public class ChargeTurret extends PowerTurret{ } @Override - public void shoot(Tile tile, AmmoType ammo){ + public void shoot(Tile tile, BulletType ammo){ LaserTurretEntity entity = tile.entity(); useAmmo(tile); @@ -47,7 +47,7 @@ public class ChargeTurret extends PowerTurret{ tr.trns(entity.rotation, size * tilesize / 2); entity.recoil = recoil; entity.heat = 1f; - bullet(tile, ammo.bullet, entity.rotation + Mathf.range(inaccuracy)); + bullet(tile, ammo, entity.rotation + Mathf.range(inaccuracy)); effects(tile); entity.shooting = false; }); diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/CooledTurret.java b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/CooledTurret.java index 09255365a2..65053c9284 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/CooledTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/CooledTurret.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.world.blocks.defense.turrets; -import io.anuke.mindustry.content.fx.BlockFx; +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; @@ -16,7 +16,7 @@ public class CooledTurret extends Turret{ protected float coolantMultiplier = 1f; /**Max coolant used per tick.*/ protected float maxCoolantUsed = 1f; - protected Effect coolEffect = BlockFx.fuelburn; + protected Effect coolEffect = Fx.fuelburn; public CooledTurret(String name){ super(name); diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/DoubleTurret.java b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/DoubleTurret.java index 1819857ad7..f8830aaefe 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/DoubleTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/DoubleTurret.java @@ -1,8 +1,8 @@ package io.anuke.mindustry.world.blocks.defense.turrets; -import io.anuke.mindustry.type.AmmoType; -import io.anuke.mindustry.world.Tile; import io.anuke.arc.math.Mathf; +import io.anuke.mindustry.entities.bullet.BulletType; +import io.anuke.mindustry.world.Tile; import static io.anuke.mindustry.Vars.tilesize; @@ -15,14 +15,14 @@ public class DoubleTurret extends ItemTurret{ } @Override - protected void shoot(Tile tile, AmmoType ammo){ + protected void shoot(Tile tile, BulletType ammo){ TurretEntity entity = tile.entity(); entity.shots++; int i = Mathf.signs[entity.shots % 2]; tr.trns(entity.rotation - 90, shotWidth * i, size * tilesize / 2); - bullet(tile, ammo.bullet, entity.rotation + Mathf.range(inaccuracy)); + bullet(tile, ammo, entity.rotation + Mathf.range(inaccuracy)); effects(tile); useAmmo(tile); diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ItemTurret.java b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ItemTurret.java index bef0283f4c..47fe135c5a 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ItemTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ItemTurret.java @@ -1,26 +1,30 @@ package io.anuke.mindustry.world.blocks.defense.turrets; import io.anuke.arc.collection.ObjectMap; +import io.anuke.mindustry.Vars; import io.anuke.mindustry.entities.Unit; -import io.anuke.mindustry.type.AmmoEntry; -import io.anuke.mindustry.type.AmmoType; +import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.meta.BlockStat; import io.anuke.mindustry.world.meta.values.ItemFilterValue; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + public class ItemTurret extends CooledTurret{ protected int maxAmmo = 50; - protected AmmoType[] ammoTypes; - protected ObjectMap ammoMap = new ObjectMap<>(); + protected ObjectMap ammo = new ObjectMap<>(); public ItemTurret(String name){ super(name); hasItems = true; } - public AmmoType[] getAmmoTypes(){ - return ammoTypes; + /**Initializes accepted ammo map. Format: [item1, bullet1, item2, bullet2...]*/ + protected void ammo(Object... objects){ + ammo = ObjectMap.of(objects); } @Override @@ -28,19 +32,18 @@ public class ItemTurret extends CooledTurret{ super.setStats(); stats.remove(BlockStat.itemCapacity); - - stats.add(BlockStat.inputItems, new ItemFilterValue(item -> ammoMap.containsKey(item))); + stats.add(BlockStat.inputItems, new ItemFilterValue(item -> ammo.containsKey(item))); } @Override public int acceptStack(Item item, int amount, Tile tile, Unit source){ TurretEntity entity = tile.entity(); - AmmoType type = ammoMap.get(item); + BulletType type = ammo.get(item); if(type == null) return 0; - return Math.min((int) ((maxAmmo - entity.totalAmmo) / ammoMap.get(item).quantityMultiplier), amount); + return Math.min((int) ((maxAmmo - entity.totalAmmo) / ammo.get(item).ammoMultiplier), amount); } @Override @@ -61,47 +64,67 @@ public class ItemTurret extends CooledTurret{ TurretEntity entity = tile.entity(); if(entity == null) return; - AmmoType type = ammoMap.get(item); - entity.totalAmmo += type.quantityMultiplier; + BulletType type = ammo.get(item); + entity.totalAmmo += type.ammoMultiplier; entity.items.add(item, 1); //find ammo entry by type for(int i = 0; i < entity.ammo.size; i++){ - AmmoEntry entry = entity.ammo.get(i); + ItemEntry entry = (ItemEntry)entity.ammo.get(i); //if found, put it to the right - if(entry.type == type){ - entry.amount += type.quantityMultiplier; + if(entry.item == item){ + entry.amount += type.ammoMultiplier; entity.ammo.swap(i, entity.ammo.size - 1); return; } } //must not be found - AmmoEntry entry = new AmmoEntry(type, (int) type.quantityMultiplier); - entity.ammo.add(entry); + entity.ammo.add(new ItemEntry(item, (int) type.ammoMultiplier)); } @Override public boolean acceptItem(Item item, Tile tile, Tile source){ TurretEntity entity = tile.entity(); - return ammoMap != null && ammoMap.get(item) != null && entity.totalAmmo + ammoMap.get(item).quantityMultiplier <= maxAmmo; + return ammo != null && ammo.get(item) != null && entity.totalAmmo + ammo.get(item).ammoMultiplier <= maxAmmo; } - @Override - public void init(){ - super.init(); + public class ItemTurretEntity extends TurretEntity{ + @Override + public void write(DataOutput stream) throws IOException{ + stream.writeByte(ammo.size); + for(AmmoEntry entry : ammo){ + ItemEntry i = (ItemEntry)entry; + stream.writeByte(i.item.id); + stream.writeShort(i.amount); + } + } - if(ammoTypes != null){ - for(AmmoType type : ammoTypes){ - if(type.item == null) continue; - if(ammoMap.containsKey(type.item)){ - throw new RuntimeException("Turret \"" + name + "\" has two conflicting ammo entries on item type " + type.item + "!"); - }else{ - ammoMap.put(type.item, type); - } + @Override + public void read(DataInput stream) throws IOException{ + byte amount = stream.readByte(); + for(int i = 0; i < amount; i++){ + Item item = Vars.content.item(stream.readByte()); + short a = stream.readShort(); + totalAmmo += a; + ammo.add(new ItemEntry(item, a)); } } } + + class ItemEntry extends AmmoEntry{ + protected Item item; + + ItemEntry(Item item, int amount){ + this.item = item; + this.amount = amount; + } + + @Override + public BulletType type(){ + return ammo.get(item); + } + } } diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/LaserTurret.java b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/LaserTurret.java index 938b9e3eb8..ce6414f4ea 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/LaserTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/LaserTurret.java @@ -1,16 +1,15 @@ package io.anuke.mindustry.world.blocks.defense.turrets; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Time; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.bullet.Bullet; import io.anuke.mindustry.entities.bullet.BulletType; -import io.anuke.mindustry.type.AmmoType; import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter; -import io.anuke.arc.entities.Effects; -import io.anuke.arc.util.Time; -import io.anuke.arc.math.Angles; -import io.anuke.arc.math.Mathf; import static io.anuke.mindustry.Vars.tilesize; @@ -33,8 +32,8 @@ public class LaserTurret extends PowerTurret{ LaserTurretEntity entity = tile.entity(); if(entity.bulletLife > 0 && entity.bullet != null){ - tr.trns(entity.rotation, size * tilesize / 2, 0f); - entity.bullet.setRotation(entity.rotation); + tr.trns(entity.rotation, size * tilesize / 2f, 0f); + entity.bullet.rot(entity.rotation); entity.bullet.set(tile.drawx() + tr.x, tile.drawy() + tr.y); entity.bullet.time(0f); entity.heat = 1f; @@ -55,7 +54,7 @@ public class LaserTurret extends PowerTurret{ } if(entity.reload >= reload && entity.cons.valid()){ - AmmoType type = peekAmmo(tile); + BulletType type = peekAmmo(tile); shoot(tile, type); diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/LiquidTurret.java b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/LiquidTurret.java index b96e0b9b0d..e368901395 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/LiquidTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/LiquidTurret.java @@ -1,32 +1,41 @@ package io.anuke.mindustry.world.blocks.defense.turrets; import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.entities.Effects; +import io.anuke.mindustry.Vars; +import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.entities.effect.Fire; -import io.anuke.mindustry.type.AmmoType; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.meta.BlockStat; import io.anuke.mindustry.world.meta.values.LiquidFilterValue; -import io.anuke.arc.entities.Effects; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; import static io.anuke.mindustry.Vars.tilesize; import static io.anuke.mindustry.Vars.world; public abstract class LiquidTurret extends Turret{ - protected AmmoType[] ammoTypes; - protected ObjectMap liquidAmmoMap = new ObjectMap<>(); + protected ObjectMap ammo = new ObjectMap<>(); public LiquidTurret(String name){ super(name); hasLiquids = true; } + /**Initializes accepted ammo map. Format: [liquid1, bullet1, liquid2, bullet2...]*/ + protected void ammo(Object... objects){ + ammo = ObjectMap.of(objects); + } + @Override public void setStats(){ super.setStats(); - stats.add(BlockStat.inputLiquid, new LiquidFilterValue(item -> liquidAmmoMap.containsKey(item))); + stats.add(BlockStat.inputLiquid, new LiquidFilterValue(item -> ammo.containsKey(item))); } @Override @@ -58,12 +67,12 @@ public abstract class LiquidTurret extends Turret{ @Override protected void effects(Tile tile){ - AmmoType type = peekAmmo(tile); + BulletType type = peekAmmo(tile); TurretEntity entity = tile.entity(); - Effects.effect(type.shootEffect, type.liquid.color, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation); - Effects.effect(type.smokeEffect, type.liquid.color, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation); + Effects.effect(type.shootEffect, entity.liquids.current().color, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation); + Effects.effect(type.smokeEffect, entity.liquids.current().color, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation); if(shootShake > 0){ Effects.shake(shootShake, shootShake, tile.entity); @@ -73,36 +82,23 @@ public abstract class LiquidTurret extends Turret{ } @Override - public AmmoType useAmmo(Tile tile){ + public BulletType useAmmo(Tile tile){ TurretEntity entity = tile.entity(); - if(tile.isEnemyCheat()) return liquidAmmoMap.get(entity.liquids.current()); - AmmoType type = liquidAmmoMap.get(entity.liquids.current()); - entity.liquids.remove(type.liquid, type.quantityMultiplier); + if(tile.isEnemyCheat()) return ammo.get(entity.liquids.current()); + BulletType type = ammo.get(entity.liquids.current()); + entity.liquids.remove(entity.liquids.current(), type.ammoMultiplier); return type; } @Override - public AmmoType peekAmmo(Tile tile){ - return liquidAmmoMap.get(tile.entity.liquids.current()); + public BulletType peekAmmo(Tile tile){ + return ammo.get(tile.entity.liquids.current()); } @Override public boolean hasAmmo(Tile tile){ TurretEntity entity = tile.entity(); - return liquidAmmoMap.get(entity.liquids.current()) != null && entity.liquids.total() >= liquidAmmoMap.get(entity.liquids.current()).quantityMultiplier; - } - - @Override - public void init(){ - super.init(); - - for(AmmoType type : ammoTypes){ - if(liquidAmmoMap.containsKey(type.liquid)){ - throw new RuntimeException("Turret \"" + name + "\" has two conflicting ammo entries on liquid type " + type.liquid + "!"); - }else{ - liquidAmmoMap.put(type.liquid, type); - } - } + return ammo.get(entity.liquids.current()) != null && entity.liquids.total() >= ammo.get(entity.liquids.current()).ammoMultiplier; } @Override @@ -112,8 +108,45 @@ public abstract class LiquidTurret extends Turret{ @Override public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){ - return super.acceptLiquid(tile, source, liquid, amount) && liquidAmmoMap.get(liquid) != null - && (tile.entity.liquids.current() == liquid || (liquidAmmoMap.containsKey(tile.entity.liquids.current()) && tile.entity.liquids.get(tile.entity.liquids.current()) <= liquidAmmoMap.get(tile.entity.liquids.current()).quantityMultiplier + 0.001f)); + return super.acceptLiquid(tile, source, liquid, amount) && ammo.get(liquid) != null + && (tile.entity.liquids.current() == liquid || (ammo.containsKey(tile.entity.liquids.current()) && tile.entity.liquids.get(tile.entity.liquids.current()) <= ammo.get(tile.entity.liquids.current()).ammoMultiplier + 0.001f)); + } + + public class LiquidTurretEntity extends TurretEntity{ + @Override + public void write(DataOutput stream) throws IOException{ + stream.writeByte(ammo.size); + for(AmmoEntry entry : ammo){ + LiquidEntry i = (LiquidEntry)entry; + stream.writeByte(i.liquid.id); + stream.writeShort(i.amount); + } + } + + @Override + public void read(DataInput stream) throws IOException{ + byte amount = stream.readByte(); + for(int i = 0; i < amount; i++){ + Liquid liquid = Vars.content.liquid(stream.readByte()); + short a = stream.readShort(); + totalAmmo += a; + ammo.add(new LiquidEntry(liquid, a)); + } + } + } + + class LiquidEntry extends AmmoEntry{ + protected Liquid liquid; + + LiquidEntry(Liquid liquid, int amount){ + this.liquid = liquid; + this.amount = amount; + } + + @Override + public BulletType type(){ + return ammo.get(liquid); + } } } diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/PowerTurret.java b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/PowerTurret.java index 3f8f6682fd..7b806c0150 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/PowerTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/PowerTurret.java @@ -1,14 +1,15 @@ package io.anuke.mindustry.world.blocks.defense.turrets; -import io.anuke.mindustry.type.AmmoType; +import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.meta.BlockStat; import io.anuke.mindustry.world.meta.StatUnit; public abstract class PowerTurret extends CooledTurret{ + //TODO recode this class, satisfaction must be 100%! /** The percentage of power which will be used per shot. */ protected float powerUsed = 0.5f; - protected AmmoType shootType; + protected BulletType shootType; public PowerTurret(String name){ super(name); @@ -29,7 +30,7 @@ public abstract class PowerTurret extends CooledTurret{ } @Override - public AmmoType useAmmo(Tile tile){ + public BulletType useAmmo(Tile tile){ if(tile.isEnemyCheat()) return shootType; // Make sure that power can not go negative in case of threading issues or similar tile.entity.power.satisfaction -= Math.min(powerUsed, tile.entity.power.satisfaction); @@ -37,7 +38,7 @@ public abstract class PowerTurret extends CooledTurret{ } @Override - public AmmoType peekAmmo(Tile tile){ + public BulletType peekAmmo(Tile tile){ return shootType; } } diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/Turret.java index 656f48e3aa..6a07a00846 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/Turret.java @@ -15,7 +15,7 @@ import io.anuke.arc.math.Angles; import io.anuke.arc.math.Mathf; import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.util.Time; -import io.anuke.mindustry.content.fx.Fx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Predict; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Units; @@ -24,9 +24,6 @@ import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.entities.traits.TargetTrait; import io.anuke.mindustry.graphics.Layer; import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.type.AmmoEntry; -import io.anuke.mindustry.type.AmmoType; -import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.meta.BlockFlag; @@ -34,11 +31,6 @@ import io.anuke.mindustry.world.meta.BlockGroup; 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; - -import static io.anuke.mindustry.Vars.content; import static io.anuke.mindustry.Vars.tilesize; public abstract class Turret extends Block{ @@ -197,8 +189,8 @@ public abstract class Turret extends Block{ if(validateTarget(tile)){ - AmmoType type = peekAmmo(tile); - float speed = type.bullet.speed; + BulletType type = peekAmmo(tile); + float speed = type.speed; if(speed < 0.1f) speed = 9999999f; Vector2 result = Predict.intercept(entity, entity.target, speed); @@ -246,7 +238,7 @@ public abstract class Turret extends Block{ } /**Consume ammo and return a type.*/ - public AmmoType useAmmo(Tile tile){ + public BulletType useAmmo(Tile tile){ if(tile.isEnemyCheat()) return peekAmmo(tile); TurretEntity entity = tile.entity(); @@ -255,15 +247,15 @@ public abstract class Turret extends Block{ if(entry.amount == 0) entity.ammo.pop(); entity.totalAmmo -= ammoPerShot; Time.run(reload / 2f, () -> ejectEffects(tile)); - return entry.type; + return entry.type(); } /** * Get the ammo type that will be returned if useAmmo is called. */ - public AmmoType peekAmmo(Tile tile){ + public BulletType peekAmmo(Tile tile){ TurretEntity entity = tile.entity(); - return entity.ammo.peek().type; + return entity.ammo.peek().type(); } /** @@ -278,7 +270,7 @@ public abstract class Turret extends Block{ TurretEntity entity = tile.entity(); if(entity.reload >= reload){ - AmmoType type = peekAmmo(tile); + BulletType type = peekAmmo(tile); shoot(tile, type); @@ -288,18 +280,16 @@ public abstract class Turret extends Block{ } } - protected void shoot(Tile tile, AmmoType ammo){ + protected void shoot(Tile tile, BulletType type){ TurretEntity entity = tile.entity(); entity.recoil = recoil; entity.heat = 1f; - AmmoType type = peekAmmo(tile); - tr.trns(entity.rotation, size * tilesize / 2f, Mathf.range(xRand)); for(int i = 0; i < shots; i++){ - bullet(tile, ammo.bullet, entity.rotation + Mathf.range(inaccuracy + type.inaccuracy) + (i-shots/2) * spread); + bullet(tile, type, entity.rotation + Mathf.range(inaccuracy + type.inaccuracy) + (i-shots/2) * spread); } effects(tile); @@ -343,6 +333,12 @@ public abstract class Turret extends Block{ return new TurretEntity(); } + public static abstract class AmmoEntry{ + public int amount; + + public abstract BulletType type(); + } + public static class TurretEntity extends TileEntity{ public Array ammo = new Array<>(); public int totalAmmo; @@ -352,25 +348,5 @@ public abstract class Turret extends Block{ public float heat; public int shots; public TargetTrait target; - - @Override - public void write(DataOutput stream) throws IOException{ - stream.writeByte(ammo.size); - for(AmmoEntry entry : ammo){ - stream.writeByte(entry.type.id); - stream.writeShort(entry.amount); - } - } - - @Override - public void read(DataInput stream) throws IOException{ - byte amount = stream.readByte(); - for(int i = 0; i < amount; i++){ - AmmoType type = content.getByID(ContentType.ammo, stream.readByte()); - short ta = stream.readShort(); - ammo.add(new AmmoEntry(type, ta)); - totalAmmo += ta; - } - } } } diff --git a/core/src/io/anuke/mindustry/world/blocks/distribution/Conveyor.java b/core/src/io/anuke/mindustry/world/blocks/distribution/Conveyor.java index 15aab629bd..5b710db20c 100644 --- a/core/src/io/anuke/mindustry/world/blocks/distribution/Conveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/distribution/Conveyor.java @@ -177,7 +177,7 @@ public class Conveyor extends Block{ } if(entity.convey.size * itemSpace < 0.9f){ - unit.getVelocity().add((tx * speed + centerx) * entity.delta(), (ty * speed + centery) * entity.delta()); + unit.velocity().add((tx * speed + centerx) * entity.delta(), (ty * speed + centery) * entity.delta()); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/distribution/MassDriver.java b/core/src/io/anuke/mindustry/world/blocks/distribution/MassDriver.java index 13a15f3cad..c822a4b362 100644 --- a/core/src/io/anuke/mindustry/world/blocks/distribution/MassDriver.java +++ b/core/src/io/anuke/mindustry/world/blocks/distribution/MassDriver.java @@ -15,10 +15,8 @@ import io.anuke.arc.math.Mathf; import io.anuke.arc.util.Time; import io.anuke.arc.util.pooling.Pool.Poolable; import io.anuke.arc.util.pooling.Pools; -import io.anuke.mindustry.content.bullets.TurretBullets; -import io.anuke.mindustry.content.fx.BlockFx; -import io.anuke.mindustry.content.fx.EnvironmentFx; -import io.anuke.mindustry.content.fx.ShootFx; +import io.anuke.mindustry.content.Bullets; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.bullet.Bullet; @@ -45,9 +43,9 @@ public class MassDriver extends Block{ protected int minDistribute = 10; protected float knockback = 4f; protected float reloadTime = 100f; - protected Effect shootEffect = ShootFx.shootBig2; - protected Effect smokeEffect = ShootFx.shootBigSmoke2; - protected Effect recieveEffect = BlockFx.mineBig; + protected Effect shootEffect = Fx.shootBig2; + protected Effect smokeEffect = Fx.shootBigSmoke2; + protected Effect recieveEffect = Fx.mineBig; protected float shake = 3f; protected final static float powerPercentageUsed = 1.0f; protected TextureRegion turretRegion; @@ -98,7 +96,7 @@ public class MassDriver extends Block{ float angle = tile.angleTo(target); other.isRecieving = true; - Bullet.create(TurretBullets.driverBolt, entity, entity.getTeam(), + Bullet.create(Bullets.driverBolt, entity, entity.getTeam(), tile.drawx() + Angles.trnsx(angle, driver.translation), tile.drawy() + Angles.trnsy(angle, driver.translation), angle, 1f, 1f, data); @@ -308,7 +306,7 @@ public class MassDriver extends Block{ int amountDropped = Mathf.random(0, data.items[i]); if(amountDropped > 0){ float angle = Mathf.range(180f); - Effects.effect(EnvironmentFx.dropItem, Color.WHITE, bullet.x, bullet.y, angle, content.item(i)); + Effects.effect(Fx.dropItem, Color.WHITE, bullet.x, bullet.y, angle, content.item(i)); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/power/ItemLiquidGenerator.java b/core/src/io/anuke/mindustry/world/blocks/power/ItemLiquidGenerator.java index d2d5106863..44fdd5caf9 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/ItemLiquidGenerator.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/ItemLiquidGenerator.java @@ -7,7 +7,7 @@ import io.anuke.arc.graphics.g2d.Draw; 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.BlockFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Liquid; @@ -32,8 +32,8 @@ public class ItemLiquidGenerator extends PowerGenerator{ /** Maximum liquid used per frame. */ protected float maxLiquidGenerate = 0.4f; - protected Effects.Effect generateEffect = BlockFx.generatespark; - protected Effects.Effect explodeEffect = BlockFx.generatespark; + protected Effects.Effect generateEffect = Fx.generatespark; + protected Effects.Effect explodeEffect = Fx.generatespark; protected Color heatColor = Color.valueOf("ff9b59"); protected TextureRegion topRegion; diff --git a/core/src/io/anuke/mindustry/world/blocks/power/NuclearReactor.java b/core/src/io/anuke/mindustry/world/blocks/power/NuclearReactor.java index 5f7345ddf7..91e7fadf75 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/NuclearReactor.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/NuclearReactor.java @@ -9,8 +9,7 @@ import io.anuke.arc.math.Mathf; import io.anuke.arc.util.Time; import io.anuke.arc.math.geom.Vector2; import io.anuke.mindustry.content.Items; -import io.anuke.mindustry.content.fx.BlockFx; -import io.anuke.mindustry.content.fx.ExplosionFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Damage; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.type.Liquid; @@ -106,7 +105,7 @@ public class NuclearReactor extends PowerGenerator{ if(entity.heat > smokeThreshold){ float smoke = 1.0f + (entity.heat - smokeThreshold) / (1f - smokeThreshold); //ranges from 1.0 to 2.0 if(Mathf.chance(smoke / 20.0 * entity.delta())){ - Effects.effect(BlockFx.reactorsmoke, tile.worldx() + Mathf.range(size * tilesize / 2f), + Effects.effect(Fx.reactorsmoke, tile.worldx() + Mathf.range(size * tilesize / 2f), tile.worldy() + Mathf.random(size * tilesize / 2f)); } } @@ -131,9 +130,9 @@ public class NuclearReactor extends PowerGenerator{ if(fuel < 5 && entity.heat < 0.5f) return; Effects.shake(6f, 16f, tile.worldx(), tile.worldy()); - Effects.effect(ExplosionFx.nuclearShockwave, tile.worldx(), tile.worldy()); + Effects.effect(Fx.nuclearShockwave, tile.worldx(), tile.worldy()); for(int i = 0; i < 6; i++){ - Time.run(Mathf.random(40), () -> Effects.effect(BlockFx.nuclearcloud, tile.worldx(), tile.worldy())); + Time.run(Mathf.random(40), () -> Effects.effect(Fx.nuclearcloud, tile.worldx(), tile.worldy())); } Damage.damage(tile.worldx(), tile.worldy(), explosionRadius * tilesize, explosionDamage * 4); @@ -142,14 +141,14 @@ public class NuclearReactor extends PowerGenerator{ for(int i = 0; i < 20; i++){ Time.run(Mathf.random(50), () -> { tr.rnd(Mathf.random(40f)); - Effects.effect(ExplosionFx.explosion, tr.x + tile.worldx(), tr.y + tile.worldy()); + Effects.effect(Fx.explosion, tr.x + tile.worldx(), tr.y + tile.worldy()); }); } for(int i = 0; i < 70; i++){ Time.run(Mathf.random(80), () -> { tr.rnd(Mathf.random(120f)); - Effects.effect(BlockFx.nuclearsmoke, tr.x + tile.worldx(), tr.y + tile.worldy()); + Effects.effect(Fx.nuclearsmoke, tr.x + tile.worldx(), tr.y + tile.worldy()); }); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/production/Cultivator.java b/core/src/io/anuke/mindustry/world/blocks/production/Cultivator.java index ed692caf57..323586d846 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/Cultivator.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/Cultivator.java @@ -9,8 +9,8 @@ import io.anuke.arc.math.Mathf; import io.anuke.arc.math.RandomXS128; import io.anuke.arc.util.Time; import io.anuke.mindustry.content.Items; -import io.anuke.mindustry.content.blocks.Blocks; -import io.anuke.mindustry.content.fx.Fx; +import io.anuke.mindustry.content.Blocks; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.world.Tile; diff --git a/core/src/io/anuke/mindustry/world/blocks/production/Drill.java b/core/src/io/anuke/mindustry/world/blocks/production/Drill.java index ba9b8dea28..1b5c76547d 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/Drill.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/Drill.java @@ -12,7 +12,7 @@ import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.math.Mathf; import io.anuke.arc.util.Time; import io.anuke.mindustry.content.Liquids; -import io.anuke.mindustry.content.fx.BlockFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.graphics.Layer; import io.anuke.mindustry.type.Item; @@ -48,11 +48,11 @@ public class Drill extends Block{ /**Whether to draw the item this drill is mining.*/ protected boolean drawMineItem = false; /**Effect played when an item is produced. This is colored.*/ - protected Effect drillEffect = BlockFx.mine; + protected Effect drillEffect = Fx.mine; /**Speed the drill bit rotates at.*/ protected float rotateSpeed = 2f; /**Effect randomly played while drilling.*/ - protected Effect updateEffect = BlockFx.pulverizeSmall; + protected Effect updateEffect = Fx.pulverizeSmall; /**Chance the update effect will appear.*/ protected float updateEffectChance = 0.02f; diff --git a/core/src/io/anuke/mindustry/world/blocks/production/GenericCrafter.java b/core/src/io/anuke/mindustry/world/blocks/production/GenericCrafter.java index 4c1eef5ef7..21bcebe89c 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/GenericCrafter.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/GenericCrafter.java @@ -2,8 +2,7 @@ package io.anuke.mindustry.world.blocks.production; import io.anuke.arc.Core; import io.anuke.arc.graphics.g2d.TextureRegion; -import io.anuke.mindustry.content.fx.BlockFx; -import io.anuke.mindustry.content.fx.Fx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.world.Block; @@ -26,7 +25,7 @@ public class GenericCrafter extends Block{ protected Item output; protected float craftTime = 80; - protected Effect craftEffect = BlockFx.purify; + protected Effect craftEffect = Fx.purify; protected Effect updateEffect = Fx.none; protected float updateEffectChance = 0.04f; diff --git a/core/src/io/anuke/mindustry/world/blocks/production/Incinerator.java b/core/src/io/anuke/mindustry/world/blocks/production/Incinerator.java index d8fea6e766..28574e24d0 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/Incinerator.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/Incinerator.java @@ -7,7 +7,7 @@ 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.BlockFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Liquid; @@ -15,7 +15,7 @@ import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; public class Incinerator extends Block{ - protected Effect effect = BlockFx.fuelburn; + protected Effect effect = Fx.fuelburn; protected Color flameColor = Color.valueOf("ffad9d"); public Incinerator(String name){ diff --git a/core/src/io/anuke/mindustry/world/blocks/production/PowerSmelter.java b/core/src/io/anuke/mindustry/world/blocks/production/PowerSmelter.java index a26a41d1a4..bf2db8d3c4 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/PowerSmelter.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/PowerSmelter.java @@ -10,7 +10,7 @@ import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.math.Mathf; import io.anuke.arc.util.Time; import io.anuke.mindustry.content.Items; -import io.anuke.mindustry.content.fx.BlockFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.ItemStack; @@ -42,8 +42,8 @@ public class PowerSmelter extends PowerBlock{ 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 = BlockFx.smelt, - burnEffect = BlockFx.fuelburn; + protected Effect craftEffect = Fx.smelt, + burnEffect = Fx.fuelburn; protected Color flameColor = Color.valueOf("ffc999"); protected TextureRegion topRegion; diff --git a/core/src/io/anuke/mindustry/world/blocks/production/Smelter.java b/core/src/io/anuke/mindustry/world/blocks/production/Smelter.java index d8ac64705f..68be2ba020 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/Smelter.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/Smelter.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.world.blocks.production; import io.anuke.arc.graphics.Color; -import io.anuke.mindustry.content.fx.BlockFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.ItemStack; @@ -32,7 +32,7 @@ public class Smelter extends Block{ protected float craftTime = 20f; protected float burnDuration = 50f; - protected Effect craftEffect = BlockFx.smelt, burnEffect = BlockFx.fuelburn; + protected Effect craftEffect = Fx.smelt, burnEffect = Fx.fuelburn; protected Color flameColor = Color.valueOf("ffb879"); public Smelter(String name){ diff --git a/core/src/io/anuke/mindustry/world/blocks/production/SolidPump.java b/core/src/io/anuke/mindustry/world/blocks/production/SolidPump.java index 729fc05a90..434a5011e3 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/SolidPump.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/SolidPump.java @@ -3,7 +3,7 @@ package io.anuke.mindustry.world.blocks.production; import io.anuke.arc.Core; import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.mindustry.content.Liquids; -import io.anuke.mindustry.content.fx.Fx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.world.Tile; diff --git a/core/src/io/anuke/mindustry/world/blocks/sandbox/ItemSource.java b/core/src/io/anuke/mindustry/world/blocks/sandbox/ItemSource.java new file mode 100644 index 0000000000..dfb1aee3a7 --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/sandbox/ItemSource.java @@ -0,0 +1,34 @@ +package io.anuke.mindustry.world.blocks.sandbox; + +import io.anuke.mindustry.type.Item; +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.world.blocks.distribution.Sorter.SorterEntity; + +public class ItemSource extends Block{ + + public ItemSource(String name){ + super(name); + hasItems = true; + } + + @Override + public boolean outputsItems(){ + return true; + } + + @Override + public void update(Tile tile){ + SorterEntity entity = tile.entity(); + if(entity.sortItem == null) return; + + entity.items.set(entity.sortItem, 1); + tryDump(tile, entity.sortItem); + entity.items.set(entity.sortItem, 0); + } + + @Override + public boolean acceptItem(Item item, Tile tile, Tile source){ + return false; + } +} diff --git a/core/src/io/anuke/mindustry/world/blocks/sandbox/ItemVoid.java b/core/src/io/anuke/mindustry/world/blocks/sandbox/ItemVoid.java new file mode 100644 index 0000000000..aa4d55371b --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/sandbox/ItemVoid.java @@ -0,0 +1,21 @@ +package io.anuke.mindustry.world.blocks.sandbox; + +import io.anuke.mindustry.type.Item; +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.Tile; + +public class ItemVoid extends Block{ + + public ItemVoid(String name){ + super(name); + update = solid = true; + } + + @Override + public void handleItem(Item item, Tile tile, Tile source){} + + @Override + public boolean acceptItem(Item item, Tile tile, Tile source){ + return true; + } +} diff --git a/core/src/io/anuke/mindustry/world/blocks/sandbox/LiquidSource.java b/core/src/io/anuke/mindustry/world/blocks/sandbox/LiquidSource.java new file mode 100644 index 0000000000..dba3df94e6 --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/sandbox/LiquidSource.java @@ -0,0 +1,105 @@ +package io.anuke.mindustry.world.blocks.sandbox; + +import io.anuke.annotations.Annotations.Loc; +import io.anuke.annotations.Annotations.Remote; +import io.anuke.arc.collection.Array; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.scene.ui.ButtonGroup; +import io.anuke.arc.scene.ui.ImageButton; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.mindustry.content.Liquids; +import io.anuke.mindustry.entities.Player; +import io.anuke.mindustry.entities.TileEntity; +import io.anuke.mindustry.type.Liquid; +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.gen.Call; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +import static io.anuke.mindustry.Vars.content; +import static io.anuke.mindustry.Vars.control; + +public class LiquidSource extends Block{ + + public LiquidSource(String name){ + super(name); + update = true; + solid = true; + hasLiquids = true; + liquidCapacity = 100f; + configurable = true; + outputsLiquid = true; + } + + @Override + public void update(Tile tile){ + LiquidSourceEntity entity = tile.entity(); + + tile.entity.liquids.add(entity.source, liquidCapacity); + tryDumpLiquid(tile, entity.source); + } + + @Override + public void draw(Tile tile){ + super.draw(tile); + + LiquidSourceEntity entity = tile.entity(); + + Draw.color(entity.source.color); + Draw.rect("blank", tile.worldx(), tile.worldy(), 4f, 4f); + Draw.color(); + } + + @Override + public void buildTable(Tile tile, Table table){ + LiquidSourceEntity entity = tile.entity(); + + Array items = content.liquids(); + + ButtonGroup group = new ButtonGroup<>(); + Table cont = new Table(); + + for(int i = 0; i < items.size; i++){ + if(!control.unlocks.isUnlocked(items.get(i))) continue; + + final int f = i; + ImageButton button = cont.addImageButton("liquid-icon-" + items.get(i).name, "clear-toggle", 24, + () -> Call.setLiquidSourceLiquid(null, tile, items.get(f))).size(38).group(group).get(); + button.setChecked(entity.source.id == f); + + if(i % 4 == 3){ + cont.row(); + } + } + + table.add(cont); + } + + @Override + public TileEntity newEntity(){ + return new LiquidSourceEntity(); + } + + @Remote(targets = Loc.both, called = Loc.both, forward = true) + public static void setLiquidSourceLiquid(Player player, Tile tile, Liquid liquid){ + LiquidSourceEntity entity = tile.entity(); + entity.source = liquid; + } + + class LiquidSourceEntity extends TileEntity{ + public Liquid source = Liquids.water; + + @Override + public void writeConfig(DataOutput stream) throws IOException{ + stream.writeByte(source.id); + } + + @Override + public void readConfig(DataInput stream) throws IOException{ + source = content.liquid(stream.readByte()); + } + } +} diff --git a/core/src/io/anuke/mindustry/world/blocks/sandbox/PowerSource.java b/core/src/io/anuke/mindustry/world/blocks/sandbox/PowerSource.java new file mode 100644 index 0000000000..9c95ccd689 --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/sandbox/PowerSource.java @@ -0,0 +1,20 @@ +package io.anuke.mindustry.world.blocks.sandbox; + +import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.world.blocks.power.PowerNode; + +public class PowerSource extends PowerNode{ + + public PowerSource(String name){ + super(name); + maxNodes = 100; + outputsPower = true; + consumesPower = false; + } + + @Override + public float getPowerProduction(Tile tile){ + return 10000f; + } + +} diff --git a/core/src/io/anuke/mindustry/world/blocks/sandbox/PowerVoid.java b/core/src/io/anuke/mindustry/world/blocks/sandbox/PowerVoid.java new file mode 100644 index 0000000000..549183c0be --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/sandbox/PowerVoid.java @@ -0,0 +1,18 @@ +package io.anuke.mindustry.world.blocks.sandbox; + +import io.anuke.mindustry.world.blocks.PowerBlock; +import io.anuke.mindustry.world.meta.BlockStat; + +public class PowerVoid extends PowerBlock{ + + public PowerVoid(String name){ + super(name); + consumes.power(Float.MAX_VALUE); + } + + @Override + public void init(){ + super.init(); + stats.remove(BlockStat.powerUse); + } +} diff --git a/core/src/io/anuke/mindustry/world/blocks/storage/CoreBlock.java b/core/src/io/anuke/mindustry/world/blocks/storage/CoreBlock.java index c31c44d030..21354421c5 100644 --- a/core/src/io/anuke/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/storage/CoreBlock.java @@ -12,7 +12,7 @@ import io.anuke.arc.math.Mathf; import io.anuke.arc.util.Time; import io.anuke.mindustry.Vars; import io.anuke.mindustry.content.UnitTypes; -import io.anuke.mindustry.content.fx.Fx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Unit; diff --git a/core/src/io/anuke/mindustry/world/blocks/units/CommandCenter.java b/core/src/io/anuke/mindustry/world/blocks/units/CommandCenter.java index 57de75effc..0be196abda 100644 --- a/core/src/io/anuke/mindustry/world/blocks/units/CommandCenter.java +++ b/core/src/io/anuke/mindustry/world/blocks/units/CommandCenter.java @@ -13,7 +13,7 @@ import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.scene.ui.ButtonGroup; import io.anuke.arc.scene.ui.ImageButton; import io.anuke.arc.scene.ui.layout.Table; -import io.anuke.mindustry.content.fx.BlockFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.units.BaseUnit; @@ -35,7 +35,7 @@ public class CommandCenter extends Block{ protected TextureRegion[] commandRegions = new TextureRegion[UnitCommand.values().length]; protected Color topColor = Palette.command; protected Color bottomColor = Color.valueOf("5e5e5e"); - protected Effect effect = BlockFx.commandSend; + protected Effect effect = Fx.commandSend; public CommandCenter(String name){ super(name); diff --git a/core/src/io/anuke/mindustry/world/blocks/units/MechPad.java b/core/src/io/anuke/mindustry/world/blocks/units/MechPad.java index 822b8d96bc..38257657d4 100644 --- a/core/src/io/anuke/mindustry/world/blocks/units/MechPad.java +++ b/core/src/io/anuke/mindustry/world/blocks/units/MechPad.java @@ -12,7 +12,7 @@ import io.anuke.arc.math.geom.Geometry; import io.anuke.arc.util.Time; import io.anuke.mindustry.Vars; import io.anuke.mindustry.content.Mechs; -import io.anuke.mindustry.content.fx.Fx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Unit; @@ -24,7 +24,6 @@ import io.anuke.mindustry.graphics.Shaders; import io.anuke.mindustry.type.Mech; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.meta.BlockStat; import java.io.DataInput; import java.io.DataOutput; diff --git a/core/src/io/anuke/mindustry/world/blocks/units/Reconstructor.java b/core/src/io/anuke/mindustry/world/blocks/units/Reconstructor.java index 75d69c255b..de7753e644 100644 --- a/core/src/io/anuke/mindustry/world/blocks/units/Reconstructor.java +++ b/core/src/io/anuke/mindustry/world/blocks/units/Reconstructor.java @@ -11,7 +11,7 @@ import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.math.Mathf; import io.anuke.arc.util.Time; import io.anuke.mindustry.Vars; -import io.anuke.mindustry.content.fx.Fx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Unit; diff --git a/core/src/io/anuke/mindustry/world/blocks/units/UnitFactory.java b/core/src/io/anuke/mindustry/world/blocks/units/UnitFactory.java index 8eaaaeee70..969c606c1c 100644 --- a/core/src/io/anuke/mindustry/world/blocks/units/UnitFactory.java +++ b/core/src/io/anuke/mindustry/world/blocks/units/UnitFactory.java @@ -10,7 +10,7 @@ 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.content.fx.BlockFx; +import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.units.BaseUnit; import io.anuke.mindustry.entities.units.UnitType; @@ -63,14 +63,14 @@ public class UnitFactory extends Block{ entity.buildTime = 0f; Effects.shake(2f, 3f, entity); - Effects.effect(BlockFx.producesmoke, tile.drawx(), tile.drawy()); + Effects.effect(Fx.producesmoke, tile.drawx(), tile.drawy()); if(!Net.client()){ BaseUnit unit = factory.type.create(tile.getTeam()); unit.setSpawner(tile); unit.set(tile.drawx() + Mathf.range(4), tile.drawy() + Mathf.range(4)); unit.add(); - unit.getVelocity().y = factory.launchVelocity; + unit.velocity().y = factory.launchVelocity; } } diff --git a/tests/src/test/java/ApplicationTests.java b/tests/src/test/java/ApplicationTests.java index c13c7c7f25..268925d3bc 100644 --- a/tests/src/test/java/ApplicationTests.java +++ b/tests/src/test/java/ApplicationTests.java @@ -5,9 +5,9 @@ import io.anuke.arc.math.geom.Point2; import io.anuke.arc.util.Log; import io.anuke.arc.util.Time; import io.anuke.mindustry.Vars; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.UnitTypes; -import io.anuke.mindustry.content.blocks.*; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.core.Logic; import io.anuke.mindustry.core.NetServer; @@ -142,12 +142,12 @@ public class ApplicationTests{ createMap(); int bx = 4; int by = 4; - world.setBlock(world.tile(bx, by), StorageBlocks.core, Team.blue); + world.setBlock(world.tile(bx, by), Blocks.core, Team.blue); assertEquals(world.tile(bx, by).getTeam(), Team.blue); for(int x = bx-1; x <= bx + 1; x++){ for(int y = by-1; y <= by + 1; y++){ if(x == bx && by == y){ - assertEquals(world.tile(x, y).block(), StorageBlocks.core); + assertEquals(world.tile(x, y).block(), Blocks.core); }else{ assertTrue(world.tile(x, y).block() == Blocks.blockpart && world.tile(x, y).getLinked() == world.tile(bx, by)); } @@ -204,9 +204,9 @@ public class ApplicationTests{ @Test void inventoryDeposit(){ - depositTest(CraftingBlocks.smelter, Items.copper); - depositTest(StorageBlocks.vault, Items.copper); - depositTest(PowerBlocks.thoriumReactor, Items.thorium); + depositTest(Blocks.smelter, Items.copper); + depositTest(Blocks.vault, Items.copper); + depositTest(Blocks.thoriumReactor, Items.thorium); } @Test @@ -231,14 +231,14 @@ public class ApplicationTests{ d1.set(10f, 20f); d2.set(10f, 20f); - d1.addBuildRequest(new BuildRequest(0, 0, 0, Recipe.getByResult(DefenseBlocks.copperWallLarge))); - d2.addBuildRequest(new BuildRequest(1, 1, 0, Recipe.getByResult(DefenseBlocks.copperWallLarge))); + d1.addBuildRequest(new BuildRequest(0, 0, 0, Recipe.getByResult(Blocks.copperWallLarge))); + d2.addBuildRequest(new BuildRequest(1, 1, 0, Recipe.getByResult(Blocks.copperWallLarge))); Time.setDeltaProvider(() -> 9999999f); d1.updateBuilding(d1); d2.updateBuilding(d2); - assertEquals(DefenseBlocks.copperWallLarge, world.tile(0, 0).block()); + assertEquals(Blocks.copperWallLarge, world.tile(0, 0).block()); assertEquals(Blocks.air, world.tile(2, 2).block()); assertEquals(Blocks.blockpart, world.tile(1, 1).block()); } @@ -253,7 +253,7 @@ public class ApplicationTests{ d1.set(10f, 20f); d2.set(10f, 20f); - d1.addBuildRequest(new BuildRequest(0, 0, 0, Recipe.getByResult(DefenseBlocks.copperWallLarge))); + d1.addBuildRequest(new BuildRequest(0, 0, 0, Recipe.getByResult(Blocks.copperWallLarge))); d2.addBuildRequest(new BuildRequest(1, 1)); Time.setDeltaProvider(() -> 3f); @@ -277,7 +277,7 @@ public class ApplicationTests{ createMap(); Tile core = world.tile(5, 5); - world.setBlock(core, StorageBlocks.core, Team.blue); + world.setBlock(core, Blocks.core, Team.blue); for(Item item : content.items()){ core.entity.items.set(item, 3000); } diff --git a/tests/src/test/java/power/PowerTestFixture.java b/tests/src/test/java/power/PowerTestFixture.java index 3c4e6e9327..38db7cc8a6 100644 --- a/tests/src/test/java/power/PowerTestFixture.java +++ b/tests/src/test/java/power/PowerTestFixture.java @@ -3,7 +3,7 @@ package power; import io.anuke.arc.math.Mathf; import io.anuke.arc.util.Time; import io.anuke.mindustry.Vars; -import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.core.ContentLoader; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile;