Skip to content

Commit

Permalink
tanks that dont shoot properly and i dont know why
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Apr 15, 2023
1 parent 83630d6 commit e810480
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 10 deletions.
9 changes: 8 additions & 1 deletion assets/bundles/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ block.sw-nickel-forge.name = Nickel Forge
block.sw-nickel-forge.description = A crafter able to create Nickel where it is less abundant.
block.sw-batch-press.name = Batch Press
block.sw-batch-press.description = An advanced form of a multi press, consumes materials slowly for a big batch of graphite.
block.sw-batch-press.details = Behold! The amazing batch furn- i mean press!
block.sw-batch-press.details = Behold! The amazing batch furn- I mean press!

block.sw-stirling-generator.name = Stirling Generator
block.sw-stirling-generator.description = An efficient steam generator that doesn't boil water directly.
Expand Down Expand Up @@ -74,6 +74,13 @@ unit.sw-retreat.description = A unit with short range artillery, is invisible to
unit.sw-evade.name = Evade
unit.sw-evade.description = A moderately sized submarine that has a torpedo launcher and short range fuse-like mounts.

unit.sw-sentry.name = Sentry
unit.sw-sentry.description = A small Tank with a fuse like shot and an energy ball afterwards.
unit.sw-tower.name = Tower
unit.sw-tower.description = A tank with a laser-shotgun mix in a weapon.
unit.sw-castle.name = Castle
unit.sw-castle.description = An armoured tank with an electrified laser beam.

unit.sw-bakler.name = Bakler
unit.sw-bakler.description = A small Silicon crucible inside a unit.

Expand Down
Binary file added assets/sprites/units/tank/castle-cell.png
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/units/tank/castle-full.png
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/units/tank/castle-treads.png
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/units/tank/castle.png
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/units/weapons/castle-gun.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion src/sw/content/SWTechTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static void load() {
// crafting
node(nickelForge, () -> {
node(rebuilder, () -> node(burner));
node(boiler, with(new Research(burner)), () -> node(thermalBoiler));
node(boiler, with(new Research(burner), new SectorComplete(SectorPresets.extractionOutpost)), () -> node(thermalBoiler));
nodeObj(batchPress, with(new Research(Blocks.multiPress)));
});

Expand Down Expand Up @@ -63,6 +63,11 @@ public static void load() {
});
node(crafterFactory, with(new Research(Blocks.siliconCrucible)), () -> node(bakler));
node(swarm, with(new Produce(compound), new Research(Blocks.airFactory)), () -> {
node(sentry, () -> {
node(tower, with(new Research(Blocks.additiveReconstructor)), () -> {
nodeObj(castle, with(new Research(Blocks.multiplicativeReconstructor)));
});
});
node(ambush, with(new Research(Blocks.additiveReconstructor)), () -> {
nodeObj(trap, with(new Research(Blocks.multiplicativeReconstructor)));
});
Expand Down
82 changes: 74 additions & 8 deletions src/sw/content/SWUnitTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public static void load() {
range = maxRange = 160f;
hitSize = 8f;
rotateSpeed = 4;
outlines = false;
outlines = faceTarget = false;
treadRects = new Rect[]{new Rect(11f - 32f, 8f - 32f, 14, 53)};
ammoType = new ItemAmmoType(Items.copper);
constructor = TankUnit::create;
Expand All @@ -261,7 +261,9 @@ public static void load() {
y = 0.25f;
reload = 120f;
recoil = 0f;
range = 160f;
rotate = true;
rotateSpeed = 7f;
mirror = false;
shootY = 4;
shootSound = Sounds.pulseBlast;
Expand All @@ -274,7 +276,8 @@ public static void load() {
new ShrapnelBulletType() {{
damage = 36;
length = 160f;
toColor = Pal.accent;
fromColor = Pal.accent;
toColor = Color.gray;
}},
new BasicBulletType(2f, 0, "circle-bullet") {{
lifetime = 80f;
Expand All @@ -283,7 +286,7 @@ public static void load() {
intervalBullets = 10;
intervalBullet = new LightningBulletType() {{
damage = 1;
lightningColor = this.hitColor = Pal.accent;
lightningColor = hitColor = Pal.accent;
lightningLength = 5;
lightningLengthRand = 3;
lightningType = new BulletType(1.0E-4f, 0.0f) {{
Expand All @@ -303,8 +306,7 @@ public static void load() {
range = maxRange = 160f;
hitSize = 10f;
rotateSpeed = 3;
outlineColor = Pal.darkerMetal;
outlines = false;
outlines = faceTarget = false;
treadRects = new Rect[]{new Rect(-25, -36, 13, 71)};
ammoType = new ItemAmmoType(Items.copper);
constructor = TankUnit::create;
Expand All @@ -313,10 +315,13 @@ public static void load() {
x = 0f;
y = 0.5f;
reload = 60f;
range = 160f;
mirror = false;
rotate = true;
rotateSpeed = 5f;
shootSound = Sounds.shootAltLong;
bullet = new MultiBulletType() {{
range = 160f;
shake = 3f;
shootEffect = Fx.shootBigColor;
smokeEffect = Fx.shootSmokeSquareSparse;
Expand All @@ -338,7 +343,59 @@ public static void load() {
new LaserBulletType(30) {{
length = 160;
width = 7.5f;
colors = new Color[]{Pal.accent, Color.white, Color.white};
colors = new Color[]{Pal.accent, Pal.accent, Color.white};
}}
);
}};
}});
}};
castle = new TankUnitType("castle") {{
health = 1400;
speed = 0.7f;
range = maxRange = 220f;
hitSize = 14f;
rotateSpeed = 2.5f;
outlines = false;
treadFrames = 20;
treadRects = new Rect[]{new Rect(-8f, -49, 16, 95), new Rect(-34, -40, 13, 88)};
ammoType = new ItemAmmoType(Items.copper);
constructor = TankUnit::create;

weapons.add(new Weapon("sw-castle-gun") {{
x = y = 0f;
reload = 120f;
range = 220f;
shake = 5f;
shootY = 8f;
mirror = false;
rotate = true;
rotateSpeed = 3f;
shootSound = Sounds.pulseBlast;
bullet = new MultiBulletType() {{
range = 220f;
shootEffect = smokeEffect = Fx.sparkShoot;
bullets.add(
new BulletType(10f, 0) {{
lifetime = 22f;
bulletInterval = 1;
intervalBullets = 10;
hitEffect = despawnEffect = Fx.none;
intervalBullet = new LightningBulletType() {{
damage = 5;
lightningColor = hitColor = Pal.accent;
lightningLength = 5;
lightningLengthRand = 3;
lightningType = new BulletType(1.0E-4f, 0.0f) {{
lifetime = Fx.lightning.lifetime;
despawnEffect = Fx.none;
hittable = false;
}};
}};
}},
new LaserBulletType(300) {{
length = 220f;
lifetime = 22f;
colors = new Color[]{Pal.accent, Pal.accent, Color.white};
}}
);
}};
Expand Down Expand Up @@ -368,8 +425,17 @@ public static void load() {
constructor = CrafterUnit::new;
}};

((UnitFactory) Blocks.groundFactory).plans.add(new UnitPlan(sentry, 60f * 40f, with(SWItems.compound, 16, Items.silicon, 7, Items.titanium, 7)));
((UnitFactory) Blocks.airFactory).plans.add(new UnitPlan(swarm, 60f * 10f, with(SWItems.compound, 12, Items.silicon, 7)));
((Reconstructor) Blocks.additiveReconstructor).upgrades.add(new UnitType[]{swarm, ambush}, new UnitType[]{recluse, retreat});
((Reconstructor) Blocks.multiplicativeReconstructor).upgrades.add(new UnitType[]{ambush, trap}, new UnitType[]{retreat, evade});
((Reconstructor) Blocks.additiveReconstructor).upgrades.addAll(
new UnitType[]{swarm, ambush},
new UnitType[]{recluse, retreat},
new UnitType[]{sentry, tower}
);
((Reconstructor) Blocks.multiplicativeReconstructor).upgrades.addAll(
new UnitType[]{ambush, trap},
new UnitType[]{retreat, evade},
new UnitType[]{tower, castle}
);
}
}

0 comments on commit e810480

Please sign in to comment.