From a4a544a001b48ef1f6e4849d2d210c841d730c39 Mon Sep 17 00:00:00 2001 From: YuTian <2953516620@qq.com> Date: Tue, 13 Aug 2024 11:23:43 +0800 Subject: [PATCH] 1.2 --- .../manager/RegistryManager.java | 2 ++ .../script/list/SetCountdownScript.java | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/main/java/com/io/yutian/thewardungeon/script/list/SetCountdownScript.java 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); + } + +}