diff --git a/src/main/java/com/io/yutian/thewardungeon/manager/RegistryManager.java b/src/main/java/com/io/yutian/thewardungeon/manager/RegistryManager.java index 4068507..e040866 100644 --- a/src/main/java/com/io/yutian/thewardungeon/manager/RegistryManager.java +++ b/src/main/java/com/io/yutian/thewardungeon/manager/RegistryManager.java @@ -34,6 +34,8 @@ public class RegistryManager { scriptRegistry.add("setrespawn", SetRespawnScript.class); scriptRegistry.add("sound", SoundScript.class); scriptRegistry.add("title", TitleScript.class); + scriptRegistry.add("settotalcountdown", SetTotalCountdownScript.class); + scriptRegistry.add("setcountdown", SetCountdownScript.class); } private static void registerObjective() { diff --git a/src/main/java/com/io/yutian/thewardungeon/script/list/SetCountdownScript.java b/src/main/java/com/io/yutian/thewardungeon/script/list/SetCountdownScript.java new file mode 100644 index 0000000..fca3c34 --- /dev/null +++ b/src/main/java/com/io/yutian/thewardungeon/script/list/SetCountdownScript.java @@ -0,0 +1,21 @@ +package com.io.yutian.thewardungeon.script.list; + +import com.io.yutian.thewardungeon.data.LineMetadata; +import com.io.yutian.thewardungeon.dungeon.DungeonInstance; +import com.io.yutian.thewardungeon.script.Script; + +public class SetCountdownScript extends Script { + + private int countdown; + + public SetCountdownScript(LineMetadata metadata) { + super(metadata); + countdown = metadata.getInt("countdown"); + } + + @Override + public void execute(DungeonInstance dungeonInstance) { + dungeonInstance.setCountdown(countdown); + } + +}