-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Data-drive River Race zone unlock flow, add countdown boss bar
- Loading branch information
Showing
13 changed files
with
143 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
.../java/com/lovetropics/minigames/common/content/river_race/behaviour/UnlockZoneAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.lovetropics.minigames.common.content.river_race.behaviour; | ||
|
||
import com.lovetropics.minigames.common.content.river_race.RiverRace; | ||
import com.lovetropics.minigames.common.content.river_race.event.RiverRaceEvents; | ||
import com.lovetropics.minigames.common.core.game.GameException; | ||
import com.lovetropics.minigames.common.core.game.IGamePhase; | ||
import com.lovetropics.minigames.common.core.game.behavior.GameBehaviorType; | ||
import com.lovetropics.minigames.common.core.game.behavior.IGameBehavior; | ||
import com.lovetropics.minigames.common.core.game.behavior.event.EventRegistrar; | ||
import com.lovetropics.minigames.common.core.game.behavior.event.GameActionEvents; | ||
import com.mojang.serialization.Codec; | ||
import com.mojang.serialization.MapCodec; | ||
import com.mojang.serialization.codecs.RecordCodecBuilder; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public record UnlockZoneAction( | ||
String zone | ||
) implements IGameBehavior { | ||
public static final MapCodec<UnlockZoneAction> CODEC = RecordCodecBuilder.mapCodec(i -> i.group( | ||
Codec.STRING.fieldOf("zone").forGetter(UnlockZoneAction::zone) | ||
).apply(i, UnlockZoneAction::new)); | ||
|
||
@Override | ||
public void register(IGamePhase game, EventRegistrar events) throws GameException { | ||
events.listen(GameActionEvents.APPLY, context -> { | ||
game.invoker(RiverRaceEvents.UNLOCK_ZONE).onUnlockZone(zone); | ||
return true; | ||
}); | ||
} | ||
|
||
@Override | ||
public Supplier<? extends GameBehaviorType<?>> behaviorType() { | ||
return RiverRace.UNLOCK_ZONE_ACTION; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.