Skip to content

Commit

Permalink
env revamp part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Twcash committed Jul 14, 2024
1 parent 966ae37 commit 4836155
Show file tree
Hide file tree
Showing 27 changed files with 183 additions and 55 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sprites/effects/parzil-needle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
135 changes: 96 additions & 39 deletions src/aquarion/blocks/AquaEnv.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import aquarion.AquaItems;
import aquarion.AquaLiquids;
import aquarion.world.blocks.environment.PineTree;
import arc.graphics.Color;
import mindustry.content.Blocks;
import mindustry.content.Fx;
import mindustry.entities.effect.ParticleEffect;
import mindustry.graphics.CacheLayer;
import mindustry.type.Liquid;
Expand All @@ -15,6 +17,7 @@

import static mindustry.content.Blocks.*;
import static mindustry.content.Items.lead;
import static mindustry.world.meta.BuildVisibility.sandboxOnly;


public class AquaEnv {
Expand All @@ -23,49 +26,15 @@ public class AquaEnv {
public static Block algalBoulder, feldsparBoulder, gabbroBoulder, kelp, rockweed, urchin;

// Floors
public static Block algal_carpet, brine_liquid, coral_floor, feldspar_vent, feldspar, ferric_extrusions, gabbro_extrusions, gabbro_vent, gabbro, geothermal_vent, kelp_floor, laterite, phylite_floor, slate, shaleVent;
public static Block algal_carpet, brine_liquid, coral_floor, feldspar_vent, feldspar, ferric_extrusions, gabbro_extrusions, gabbro_vent, gabbro, geothermal_vent, kelp_floor, roughFeldspar, phylite_floor, slate, shaleVent, andesite, andesiteRubble, andesiteVent;

// Ore blocks
public static Block leadNodules, oreBauxite, oreGallium, oreLithium, oreManganese;

// Walls
public static Block algalBloom, algalWall, bloom, coralWall, feldsparWall, gabbroWall;
public static Block algalBloom, parzilPine, algalWall, bloom, coralWall, feldsparWall, gabbroWall, andesiteExtrusions;

public static void loadContent() {
// Boulders

algalBoulder = new Prop("algal-boulder"){{
variants = 2;
}};

feldsparBoulder = new Prop("feldspar-boulder"){{
variants = 1;
}};

gabbroBoulder = new Prop("gabbro-boulder."){{
variants = 1;
}};

kelp = new SeaBush("kelp");

rockweed = new SeaBush("rockweed") {{
lobesMin = 3;
lobesMax = 5;
timeRange = 160;
}};

urchin = new SeaBush("urchin") {{
lobesMin = 3;
lobesMax = 7;
timeRange = 70;
magMax = 30;
sclMax = 55;
sclMin = 10;
magMin = 10;

}};
// Floors


//TODO fix the blend group
algal_carpet = new Floor("algal-carpet", 5) {{
Expand Down Expand Up @@ -114,10 +83,36 @@ public static void loadContent() {
interp = interp.pow3Out;
}};
}};
andesiteRubble = new Floor("andesite-rubble-", 4) {{
}};
andesite = new Floor("andesite-", 4) {{
}};

ferric_extrusions = new Floor("ferric-extrusions", 2) {{

}};
andesiteVent = new SteamVent("andesite-vent-") {{
attributes.set(Attribute.steam, 1f);
variants = 2;
parent = blendGroup = AquaEnv.andesiteRubble;
effectSpacing = 15f;
effect = new ParticleEffect(){{
particles = 5;
lifetime = 340;
length = 125;
cone = 20;
baseRotation = 50;
sizeFrom = 0f;
sizeTo = 12f;
//particles have to be darker due to andesite bleding in with the particles
colorFrom = Color.valueOf("121214120");
colorTo = Color.valueOf("12121410");
sizeInterp = interp.pow3Out;
interp = interp.pow3Out;
}};
}};



gabbro_extrusions = new Floor("gabbro-extrusions", 2) {{

Expand All @@ -132,6 +127,7 @@ public static void loadContent() {
attributes.set(Attribute.steam, 1f);
parent = blendGroup = Blocks.shale;
effectSpacing = 15f;
variants = 3;
effect = new ParticleEffect(){{
particles = 3;
lifetime = 340;
Expand All @@ -151,6 +147,7 @@ public static void loadContent() {
attributes.set(Attribute.steam, 1f);
parent = blendGroup = AquaEnv.gabbro;
effectSpacing = 15f;
variants = 3;
effect = new ParticleEffect(){{
particles = 3;
lifetime = 340;
Expand All @@ -170,6 +167,7 @@ public static void loadContent() {
attributes.set(Attribute.steam, 1f);
parent = blendGroup = Blocks.basalt;
effectSpacing = 15f;
variants = 2;
effect = new ParticleEffect(){{
particles = 3;
lifetime = 340;
Expand All @@ -189,9 +187,7 @@ public static void loadContent() {
walkSound = mindustry.gen.Sounds.mud;
}};

laterite = new Floor("laterite", 4) {{
decoration = rockweed;

roughFeldspar = new Floor("rough-feldspar", 4) {{
}};

phylite_floor = new Floor("phylite-floor", 2) {{
Expand All @@ -200,6 +196,12 @@ public static void loadContent() {
slate = new Floor("slate", 3) {{

}};
andesiteExtrusions = new TallBlock("andesite-extrusions"){{
variants = 2;
clipSize = 128f;
shadowAlpha = 0.5f;
shadowOffset = -2.5f;
}};

// Ore blocks
leadNodules = new OreBlock("lead-nodules", lead);
Expand All @@ -210,6 +212,7 @@ public static void loadContent() {

// Walls & blocks


algalBloom = new StaticWall("algal-bloom") {{
variants = 1;
}};
Expand All @@ -227,13 +230,67 @@ public static void loadContent() {
variants = 3;
}};

parzilPine = new PineTree("parzil-pine"){{
shadowAlpha = 0.6f;
buildVisibility = sandboxOnly;
variants = 2;
rotationRand = 30;
underBullets = true;
size = 3;
effect = Fx.impactReactorExplosion;
health = 2500;
buildCost = 3600;
clipSize = 120;
}};

bloom = new TreeBlock("bloom");

algalWall = new TreeBlock("algal-wall") {{
variants = 2;
shadowOffset = -1;
}};
//boulders
daciteBoulder = new Prop("dacite-boulder"){{
variants = 2;
dacite.asFloor().decoration = andesite.asFloor().decoration = andesiteRubble.asFloor().decoration = this;
}};
algalBoulder = new Prop("algal-boulder"){{
variants = 2;
algal_carpet.asFloor().decoration = kelp_floor.asFloor().decoration;
}};

feldsparBoulder = new Prop("feldspar-boulder"){{
variants = 1;
feldspar.asFloor().decoration = andesite.asFloor().decoration = andesiteRubble.asFloor().decoration = this;
}};

gabbroBoulder = new Prop("gabbro-boulder."){{
variants = 1;
gabbro.asFloor().decoration = gabbro_extrusions.asFloor().decoration;
}};
//plants and stuff
kelp = new SeaBush("kelp"){{
algal_carpet.asFloor().decoration = kelp_floor.asFloor().decoration;
}};

rockweed = new SeaBush("rockweed") {{
feldspar.asFloor().decoration = roughFeldspar.asFloor().decoration;
lobesMin = 3;
lobesMax = 5;
timeRange = 160;
}};

urchin = new SeaBush("urchin") {{
lobesMin = 3;
gabbro.asFloor().decoration = gabbro_extrusions.asFloor().decoration;
lobesMax = 7;
timeRange = 70;
magMax = 30;
sclMax = 55;
sclMin = 10;
magMin = 10;

}};

}
}
16 changes: 0 additions & 16 deletions src/aquarion/world/blocks/distribution/PayloadTramData.java

This file was deleted.

87 changes: 87 additions & 0 deletions src/aquarion/world/blocks/environment/PineTree.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package aquarion.world.blocks.environment;
import arc.Core;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.util.*;
import mindustry.content.Fx;
import mindustry.entities.Effect;
import mindustry.gen.Building;
import mindustry.graphics.*;
import mindustry.world.*;
import mindustry.world.blocks.environment.Floor;

public class PineTree extends Block {
public float shadowOffset = -4f;
public float layer = Layer.power + 10;
public Effect effect = Fx.ventSteam;
public float effectSpacing = 15f;
public float shadowLayer = Layer.power - 1;
public float updateEffectChance = 0.5f;
public float rotationRand = 30;
public float shadowAlpha = 0.5f; // Default value for shadowAlpha
public TextureRegion baseShadow, baseRegion, topShadow, topRegion;

public class PineTreeBuild extends Building {
@Override
public void updateTile() {

if (Mathf.chanceDelta(updateEffectChance)) {
if ((Time.delta) >= effectSpacing) {
effect.at(tile.x * 1 + Mathf.range(size * 4f), tile.y * 1 + Mathf.range(size * 4f));
}
}
}
}

public PineTree(String name) {
super(name);
solid = true;
clipSize = 90;
update = true;
customShadow = true;
}

@Override
public void load() {
super.load();
baseShadow = Core.atlas.find(name + "-shadow");
baseRegion = Core.atlas.find(name);
}

@Override
public void init(){
super.init();
hasShadow = true;
}

@Override
public void drawBase(Tile tile){

float
x = tile.worldx(), y = tile.worldy(),
rot = Mathf.randomSeed(tile.pos(), 0, 4) * 90 + Mathf.sin(Time.time + x, 50f, 0.5f) + Mathf.sin(Time.time - y, 65f, 0.9f) + Mathf.sin(Time.time + y - x, 85f, 0.9f),
w = region.width * region.scl(), h = region.height * region.scl(),
scl = 30f, mag = 0.2f;
float rot2 = Mathf.randomSeedRange(tile.pos() + 1, rotationRand);
TextureRegion shad = variants == 0 ? customShadowRegion : variantShadowRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantShadowRegions.length - 1))];

if(shad.found()){
Draw.alpha(shadowAlpha);
Draw.z(Layer.power - 1);
Draw.rect(shad, tile.worldx() + shadowOffset, tile.worldy() + shadowOffset, rot + rot2);
}

TextureRegion reg = variants == 0 ? region : variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))];

Draw.z(Layer.power + 10);
Draw.alpha(1);
Draw.rectv(reg, x, y, w, h, rot + + rot2, vec -> vec.add(
Mathf.sin(vec.y*3 + Time.time, scl, mag) + Mathf.sin(vec.x*3 - Time.time, 70, 0.8f),
Mathf.cos(vec.x*3 + Time.time + 8, scl + 6f, mag * 1.1f) + Mathf.sin(vec.y*3 - Time.time, 50, 0.2f)
));
}

@Override
public void drawShadow(Tile tile){}

}

0 comments on commit 4836155

Please sign in to comment.