|
1 | 1 | package org.valkyrienskies.clockwork.content.ponders |
2 | 2 |
|
| 3 | +import com.simibubi.create.AllItems |
| 4 | +import com.simibubi.create.foundation.ponder.CreateSceneBuilder |
| 5 | +import net.createmod.catnip.math.Pointing |
| 6 | +import net.createmod.ponder.api.scene.SceneBuilder |
| 7 | +import net.createmod.ponder.api.scene.SceneBuildingUtil |
| 8 | +import net.createmod.ponder.foundation.PonderSceneBuilder |
| 9 | +import net.createmod.ponder.foundation.element.InputWindowElement |
| 10 | +import net.minecraft.core.Direction |
| 11 | +import org.valkyrienskies.clockwork.ClockworkItems |
| 12 | + |
3 | 13 | object KelvinPonders { |
| 14 | + fun duct(sceneBuilder: SceneBuilder, util: SceneBuildingUtil) { |
| 15 | + val scene = CreateSceneBuilder(sceneBuilder) |
| 16 | + scene.title("duct", "Managing Gas Networks") |
| 17 | + scene.configureBasePlate(0, 0, 5) |
| 18 | + scene.showBasePlate() |
| 19 | + scene.idle(10) |
| 20 | + |
| 21 | + // Select the ducts in the schematic (Assuming a 3-long line of ducts in the center, from z=2 to z=4) |
| 22 | + val duct1 = util.grid().at(2, 1, 2) |
| 23 | + val duct2 = util.grid().at(2, 1, 3) |
| 24 | + val duct3 = util.grid().at(2, 1, 4) |
| 25 | + val ductGroup = util.select().fromTo(2, 1, 2, 2, 1, 4) |
| 26 | + |
| 27 | + // Drop the ducts into the scene |
| 28 | + scene.world().showSection(ductGroup, Direction.DOWN) |
| 29 | + scene.idle(20) |
| 30 | + |
| 31 | + // Intro text |
| 32 | + scene.overlay().showText(60) |
| 33 | + .text("Ducts form the core of Clockwork's gas networks.") |
| 34 | + .attachKeyFrame() |
| 35 | + .pointAt(util.vector().topOf(duct2)) |
| 36 | + .placeNearTarget() |
| 37 | + scene.idle(70) |
| 38 | + |
| 39 | + scene.overlay().showText(80) |
| 40 | + .text("Gas flows automatically between connected ducts, moving from high to low pressure.") |
| 41 | + .pointAt(util.vector().topOf(duct2)) |
| 42 | + .placeNearTarget() |
| 43 | + scene.idle(90) |
| 44 | + |
| 45 | + // Wrench mechanics |
| 46 | + scene.overlay().showControls( |
| 47 | + util.vector().topOf(duct2), Pointing.DOWN, 60 |
| 48 | + ).rightClick().withItem(AllItems.WRENCH.asStack()) |
| 49 | + |
| 50 | + scene.idle(10) |
| 51 | + |
| 52 | + scene.overlay().showText(70) |
| 53 | + .text("Using a Wrench on a connection toggles it on or off.") |
| 54 | + .attachKeyFrame() |
| 55 | + .pointAt(util.vector().centerOf(duct2)) |
| 56 | + .placeNearTarget() |
| 57 | + scene.idle(80) |
| 58 | + |
| 59 | + // Screwdriver configuration |
| 60 | + scene.overlay().showControls( |
| 61 | + util.vector().topOf(duct2), Pointing.DOWN, 60 |
| 62 | + ).rightClick().withItem(ClockworkItems.SCREWDRIVER.asStack()) |
| 63 | + |
| 64 | + scene.idle(10) |
| 65 | + |
| 66 | + scene.overlay().showControls( |
| 67 | + util.vector().topOf(duct2), Pointing.DOWN, 60 |
| 68 | + ).rightClick().whileSneaking().withItem(ClockworkItems.SCREWDRIVER.asStack()) |
| 69 | + |
| 70 | + scene.overlay().showOutlineWithText(util.select().position(duct2), 80) |
| 71 | + .text("Sneak right-clicking with a Screwdriver cycles edge types: Pipe, One-Way, Filtered, and Smart.") |
| 72 | + .attachKeyFrame() |
| 73 | + .pointAt(util.vector().centerOf(duct2)) |
| 74 | + .placeNearTarget() |
| 75 | + scene.idle(90) |
| 76 | + |
| 77 | + // Sneak-screwdriving |
| 78 | + |
| 79 | + |
| 80 | + scene.idle(10) |
| 81 | + |
| 82 | + scene.overlay().showControls( |
| 83 | + util.vector().topOf(duct2), Pointing.DOWN, 60 |
| 84 | + ).rightClick().withItem(ClockworkItems.SCREWDRIVER.asStack()) |
| 85 | + scene.overlay().showText(80) |
| 86 | + .text("Right clicking an edge with a screwdriver allows you to edit it (For Filtered and Smart edges).") |
| 87 | + .pointAt(util.vector().centerOf(duct2)) |
| 88 | + .placeNearTarget() |
| 89 | + scene.idle(90) |
| 90 | + |
| 91 | + // Leaks |
| 92 | + scene.overlay().showText(70) |
| 93 | + .text("If a duct is caught in an explosion, it will become a leak and gas will violently escape!") |
| 94 | + .attachKeyFrame() |
| 95 | + .pointAt(util.vector().topOf(duct3)) |
| 96 | + .placeNearTarget() |
| 97 | + scene.idle(80) |
| 98 | + |
| 99 | + scene.overlay().showControls( |
| 100 | + util.vector().topOf(duct3), Pointing.DOWN, 60 |
| 101 | + ).rightClick().withItem(AllItems.WRENCH.asStack()) |
| 102 | + |
| 103 | + scene.idle(10) |
| 104 | + |
| 105 | + scene.overlay().showText(70) |
| 106 | + .text("Right-Clicking a leak with a Wrench will seal it back up.") |
| 107 | + .pointAt(util.vector().topOf(duct3)) |
| 108 | + .placeNearTarget() |
| 109 | + scene.idle(80) |
| 110 | + } |
4 | 111 | } |
0 commit comments