forked from SteamWar/SteamWar
Every entry gets a Touch setting next to its design, offering the 16 touches the rewards carried, each unlocked by its reward. The reward designs that the builder can now make are removed; only the underwater rain cloud and the medium, hard and advanced egg hunt designs stay. Reward requirements move to Unlocks, shared by touches, wing images and cosy smoke. The trail duration moves to the particle row to make room in the design row.
90 lines
5.8 KiB
Java
90 lines
5.8 KiB
Java
/*
|
|
* This file is a part of the SteamWar software.
|
|
*
|
|
* Copyright (C) 2026 SteamWar.de-Serverteam
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Affero General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
package de.steamwar.lobby.particle.design;
|
|
|
|
import de.steamwar.lobby.particle.Gradient;
|
|
import de.steamwar.lobby.particle.ParticleRequirement;
|
|
import de.steamwar.lobby.particle.WingDesign;
|
|
import de.steamwar.lobby.particle.elements.*;
|
|
import de.steamwar.lobby.particle.elements.custom.HearthBeat;
|
|
import de.steamwar.lobby.particle.elements.custom.NonMoving;
|
|
import de.steamwar.lobby.particle.elements.custom.PulseShimmer;
|
|
import de.steamwar.lobby.particle.elements.touch.*;
|
|
import lombok.experimental.UtilityClass;
|
|
import org.bukkit.Material;
|
|
import org.bukkit.Particle;
|
|
|
|
import java.time.Month;
|
|
import java.util.List;
|
|
|
|
// The touches of the entries' touch setting, each unlocked by the event or egg hunt reward that used to carry it
|
|
@UtilityClass
|
|
public class Touches {
|
|
|
|
public final Touch NONE = new Touch("none", Material.GRAY_DYE, 0, () -> ParticleRequirement.NO_REQUIRMENT, () -> null);
|
|
|
|
private final List<Touch> ALL = List.of(
|
|
NONE,
|
|
// Bursts on jumping, landing or sneaking
|
|
new Touch("jump_cloud", Material.SNOWBALL, 1, Unlocks.AIRSHIP_PLACEMENT,
|
|
() -> new EventBurst(EventBurst.Trigger.JUMP, new SimpleParticle(Particle.CLOUD, 0.3F, 0.05F, 0.3F, 0.02, 12))),
|
|
new Touch("jump_wings", Material.DRAGON_BREATH, 2, Unlocks.WARGEAR_SEASON_2022,
|
|
() -> new Delayed(new Wing(new SimpleParticle(Particle.DRAGON_BREATH, 0, 0, 0, 0, 1), 0.15, WingDesign.COMPLEX, false, 100, Wing.Motion.JUMP_BEAT), 2)),
|
|
new Touch("landing_splash", Material.PRISMARINE_SHARD, 1, Unlocks.UNDERWATER_PLACEMENT,
|
|
() -> new EventBurst(EventBurst.Trigger.LAND, 1, new Ring(new SimpleParticle(Particle.SPLASH, 0, 0, 0, 0, 3), 1, 16))),
|
|
new Touch("crash_landing", Material.FEATHER, 1, Unlocks.ABSTURZ_PLACEMENT,
|
|
() -> new EventBurst(EventBurst.Trigger.LAND, 3, new Group(new SimpleParticle(Particle.EXPLOSION, 0, 0, 0, 0, 1),
|
|
new Ring(new SimpleParticle(Particle.CRIT, 0, 0.1F, 0, 0.1, 2), 1.2, 16)))),
|
|
new Touch("lava_landing", Material.LAVA_BUCKET, 1, Unlocks.ANY_EVENT,
|
|
() -> new EventBurst(EventBurst.Trigger.LAND, 1, new Group(new SimpleParticle(Particle.LAVA, 0.2F, 0, 0.2F, 0, 4),
|
|
new SimpleParticle(Particle.SMOKE, 0.2F, 0.1F, 0.2F, 0.02, 6)))),
|
|
new Touch("obsidian_landing", Material.CRYING_OBSIDIAN, 1, Unlocks.EGG_HUNT_EXTREME,
|
|
() -> new EventBurst(EventBurst.Trigger.LAND, 1, new Group(new Ring(new SimpleParticle(Particle.WITCH, 0, 0.05F, 0, 0, 2), 1, 16),
|
|
new SimpleParticle(Particle.LANDING_OBSIDIAN_TEAR, 0.4F, 0, 0.4F, 0, 6)))),
|
|
new Touch("glyph_burst", Material.BOOK, 1, Unlocks.WARGEAR_SEASON,
|
|
() -> new EventBurst(EventBurst.Trigger.SNEAK, new Glyphs(Glyphs.Path.OUT_OF_PLAYER, 16, 1.5))),
|
|
// Footprints
|
|
new Touch("wet_footprints", Material.PRISMARINE_CRYSTALS, 4, Unlocks.ADVENT_WAR_SHIP_PLACEMENT,
|
|
() -> new Footprints(new SimpleParticle(Particle.FISHING, 0.05F, 0, 0.05F, 0, 1), 40)),
|
|
new Touch("cloud_footprints", Material.SNOW_BLOCK, 4, Unlocks.AIRSHIP,
|
|
() -> new Footprints(new SimpleParticle(Particle.CLOUD, 0.05F, 0, 0.05F, 0, 1), 40)),
|
|
new Touch("blossom_footprints", Material.SPORE_BLOSSOM, 4, Unlocks.EGG_HUNT_EASY,
|
|
() -> new Footprints(new SimpleParticle(Particle.SPORE_BLOSSOM_AIR, 0.05F, 0, 0.05F, 0, 1), 40)),
|
|
// Lines to nearby players with the same touch
|
|
new Touch("water_link", Material.WATER_BUCKET, 5, Unlocks.ANY_EVENT,
|
|
() -> new TeamLink("water_link", new SimpleParticle(Particle.DRIPPING_WATER, 0, 0, 0, 0, 1))),
|
|
new Touch("bubble_link", Material.PRISMARINE_BRICKS, 5, Unlocks.UNDERWATER,
|
|
() -> new TeamLink("bubble_link", new SimpleParticle(Particle.BUBBLE_POP, 0, 0, 0, 0, 1))),
|
|
// While standing still
|
|
new Touch("glyph_pull", Material.ENCHANTING_TABLE, 3, Unlocks.WARGEAR_SEASON_PLACEMENT,
|
|
() -> new NonMoving(new Glyphs(Glyphs.Path.INTO_PLAYER, 3, 1.5))),
|
|
new Touch("still_shimmer", Material.PRISMARINE_SLAB, 3, Unlocks.MINI_WARGEAR_LIGA,
|
|
() -> new NonMoving(new PulseShimmer(new SimpleParticle(Particle.UNDERWATER, 0, 0, 0, 0, 1), 80, 2))),
|
|
new Touch("heartbeat", Material.POPPY, 1, Unlocks.EGG_HUNT_HALF,
|
|
() -> new NonMoving(new HearthBeat(new DustParticle(Particle.DUST, 0, 0, 0, 0, 1, new Gradient(java.awt.Color.RED)), 80))),
|
|
// Seasonal
|
|
new Touch("december_snow", Material.POWDER_SNOW_BUCKET, 2, Unlocks.ADVENT_WAR_SHIP,
|
|
() -> new Seasonal(Month.DECEMBER, new LocationMutator(new SimpleParticle(Particle.SNOWFLAKE, 1.2F, 0.3F, 1.2F, 0.01, 2), 0, 2.4, 0)))
|
|
);
|
|
|
|
public List<ChoiceParameter.Choice<Touch>> choices() {
|
|
return ALL.stream().map(touch -> new ChoiceParameter.Choice<>(touch.id(), touch, false, touch.requirement())).toList();
|
|
}
|
|
}
|