Parcourir la source

新增总局数和总胜场进度

LTCatt il y a 6 ans
Parent
commit
b68d4cebfd

+ 33 - 0
data/ltw/advancements/story/total1.json

@@ -0,0 +1,33 @@
+{
+    "parent": "ltw:story/root",
+    "display": {
+      "icon": {
+        "item": "minecraft:pufferfish"
+      },
+      "title": {
+        "text": "初窥门径      "
+      },
+      "description": [
+        {"text": "进行 5 场游戏\n", "color":"gray"},
+        {"text": "奖励: ","color":"green"},
+        {"text": "1 绿宝石","color":"white"}
+      ],
+      "frame": "task",
+      "show_toast": true,
+      "announce_to_chat": true,
+      "hidden": false
+    },
+    "rewards": {
+      "function": "ltw:advancement/bonus_1"
+    },
+    "criteria": {
+      "get_score":{
+          "trigger": "minecraft:impossible"
+      }
+    },
+    "requirements": [
+      [
+          "get_score"
+      ]
+    ]
+  }

+ 33 - 0
data/ltw/advancements/story/total2.json

@@ -0,0 +1,33 @@
+{
+    "parent": "ltw:story/total1",
+    "display": {
+      "icon": {
+        "item": "minecraft:pufferfish"
+      },
+      "title": {
+        "text": "驾轻就熟      "
+      },
+      "description": [
+        {"text": "进行 20 场游戏\n", "color":"gray"},
+        {"text": "奖励: ","color":"green"},
+        {"text": "2 绿宝石","color":"white"}
+      ],
+      "frame": "task",
+      "show_toast": true,
+      "announce_to_chat": true,
+      "hidden": false
+    },
+    "rewards": {
+      "function": "ltw:advancement/bonus_2"
+    },
+    "criteria": {
+      "get_score":{
+          "trigger": "minecraft:impossible"
+      }
+    },
+    "requirements": [
+      [
+          "get_score"
+      ]
+    ]
+  }

+ 33 - 0
data/ltw/advancements/story/total3.json

@@ -0,0 +1,33 @@
+{
+    "parent": "ltw:story/total2",
+    "display": {
+      "icon": {
+        "item": "minecraft:sweet_berries"
+      },
+      "title": {
+        "text": "声名远扬      "
+      },
+      "description": [
+        {"text": "进行 50 场游戏\n", "color":"gray"},
+        {"text": "奖励: ","color":"green"},
+        {"text": "3 绿宝石","color":"white"}
+      ],
+      "frame": "challenge",
+      "show_toast": true,
+      "announce_to_chat": true,
+      "hidden": false
+    },
+    "rewards": {
+      "function": "ltw:advancement/bonus_3"
+    },
+    "criteria": {
+      "get_score":{
+          "trigger": "minecraft:impossible"
+      }
+    },
+    "requirements": [
+      [
+          "get_score"
+      ]
+    ]
+  }

+ 33 - 0
data/ltw/advancements/story/win1.json

@@ -0,0 +1,33 @@
+{
+    "parent": "ltw:story/root",
+    "display": {
+      "icon": {
+        "item": "minecraft:apple"
+      },
+      "title": {
+        "text": "初尝胜果      "
+      },
+      "description": [
+        {"text": "获得 1 场游戏的胜利\n", "color":"gray"},
+        {"text": "奖励: ","color":"green"},
+        {"text": "1 绿宝石","color":"white"}
+      ],
+      "frame": "task",
+      "show_toast": true,
+      "announce_to_chat": true,
+      "hidden": false
+    },
+    "rewards": {
+      "function": "ltw:advancement/bonus_1"
+    },
+    "criteria": {
+      "get_score":{
+          "trigger": "minecraft:impossible"
+      }
+    },
+    "requirements": [
+      [
+          "get_score"
+      ]
+    ]
+  }

+ 33 - 0
data/ltw/advancements/story/win2.json

@@ -0,0 +1,33 @@
+{
+    "parent": "ltw:story/win1",
+    "display": {
+      "icon": {
+        "item": "minecraft:golden_apple"
+      },
+      "title": {
+        "text": "常胜将军      "
+      },
+      "description": [
+        {"text": "获得 5 场游戏的胜利\n", "color":"gray"},
+        {"text": "奖励: ","color":"green"},
+        {"text": "2 绿宝石","color":"white"}
+      ],
+      "frame": "task",
+      "show_toast": true,
+      "announce_to_chat": true,
+      "hidden": false
+    },
+    "rewards": {
+      "function": "ltw:advancement/bonus_2"
+    },
+    "criteria": {
+      "get_score":{
+          "trigger": "minecraft:impossible"
+      }
+    },
+    "requirements": [
+      [
+          "get_score"
+      ]
+    ]
+  }

+ 33 - 0
data/ltw/advancements/story/win3.json

@@ -0,0 +1,33 @@
+{
+    "parent": "ltw:story/win2",
+    "display": {
+      "icon": {
+        "item": "minecraft:enchanted_golden_apple"
+      },
+      "title": {
+        "text": "胜者为王      "
+      },
+      "description": [
+        {"text": "获得 20 场游戏的胜利\n", "color":"gray"},
+        {"text": "奖励: ","color":"green"},
+        {"text": "3 绿宝石","color":"white"}
+      ],
+      "frame": "challenge",
+      "show_toast": true,
+      "announce_to_chat": true,
+      "hidden": false
+    },
+    "rewards": {
+      "function": "ltw:advancement/bonus_3"
+    },
+    "criteria": {
+      "get_score":{
+          "trigger": "minecraft:impossible"
+      }
+    },
+    "requirements": [
+      [
+          "get_score"
+      ]
+    ]
+  }

+ 3 - 3
data/ltw/functions/init.mcfunction

@@ -57,13 +57,11 @@ scoreboard objectives remove game_id
 scoreboard objectives add game_id dummy "游戏编号"
 scoreboard players set $ game_id 0
 
-# 货币存储
+# 商店系统记分板
 scoreboard objectives add gold dummy "金粒"
 scoreboard objectives add gold_total dummy "总金粒"
 scoreboard objectives add green dummy "绿宝石"
 scoreboard objectives add green_total dummy "总绿宝石"
-
-# 商店系统记分板
 scoreboard objectives add buy_trigger trigger "触发器_购买物品"
 scoreboard objectives add shop_arrow dummy "箭升级"
 scoreboard objectives add shop_potion dummy "药水升级"
@@ -79,6 +77,8 @@ scoreboard objectives add shop_bgm dummy "BGM"
 scoreboard objectives add shop_pig dummy "猪叫"
 scoreboard objectives add shop_easter_egg dummy "臭彩蛋"
 scoreboard objectives add shop_dice dummy "骰子"
+scoreboard objectives add stat_total dummy "总场次"
+scoreboard objectives add stat_win dummy "总胜场"
 
 # 常量与变量初始化
 scoreboard players set #mini_total mem 5

+ 10 - 0
data/ltw/functions/main/game_end.mcfunction

@@ -66,6 +66,16 @@ execute as @a run scoreboard players operation @s gold += @s temp
 execute as @a run scoreboard players operation @s gold_total += @s temp
 tellraw @a[tag=!watcher] [" ",{"text": "名次奖励: ","color":"gold"},{"score":{"name": "*","objective": "temp"}}," 金粒"]
 
+# 给予进度
+scoreboard players add @a[tag=!watcher] stat_total 1
+advancement grant @a[scores={stat_total=5..}] only ltw:story/total1
+advancement grant @a[scores={stat_total=20..}] only ltw:story/total2
+advancement grant @a[scores={stat_total=50..}] only ltw:story/total3
+scoreboard players add @a[tag=total_rank1] stat_win 1
+advancement grant @a[scores={stat_win=1..}] only ltw:story/win1
+advancement grant @a[scores={stat_win=5..}] only ltw:story/win2
+advancement grant @a[scores={stat_win=20..}] only ltw:story/win3
+
 # 奖励结束
 tellraw @a[tag=!watcher] ""