LTCatt 6 лет назад
Родитель
Сommit
c8da14ddee

+ 9 - 0
data/item/functions/shop/refresh_green.mcfunction

@@ -0,0 +1,9 @@
+# 刷新单个玩家背包中的绿宝石
+
+execute unless entity @s[scores={green=0..}] run scoreboard players set @s green 0
+clear @s emerald
+
+# 获取绿宝石数,存于 temp
+scoreboard players operation @s temp = @s emerald
+# 给予金粒
+execute if score @s temp matches 1.. at @s run function item:shop/summon_emerald

+ 10 - 0
data/item/functions/shop/summon_emerald.mcfunction

@@ -0,0 +1,10 @@
+# 给予绿宝石
+summon item ~ ~ ~ {Item:{id:"emerald",Count:1b},Tags:["score_item"],PickupDelay:0}
+execute if score @s temp matches 1..64 store result entity @e[type=item,tag=score_item,limit=1] Item.Count byte 1 run scoreboard players get @s temp
+execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b 
+data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID
+tag @e[type=item,tag=score_item] remove score_item
+scoreboard players remove @s temp 64
+execute if score @s temp matches 1.. run function item:shop/summon_emerald
+
+

+ 7 - 2
data/ltw/advancements/combat/phantom_1.json → data/ltw/advancements/combat/phantom1.json

@@ -2,19 +2,24 @@
     "parent": "ltw:combat/root",
     "display": {
       "icon": {
-        "item": "minecraft:iron_sword"
+        "item": "minecraft:stick"
       },
       "title": {
         "text": "狩猎学徒"
       },
       "description": [
-        {"text": "在月夜狩猎小游戏中击杀 8 只幻翼", "color":"gray"}
+        {"text": "在月夜狩猎小游戏中击杀 8 只幻翼", "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"

+ 5 - 5
data/ltw/advancements/combat/phantom_2.json → data/ltw/advancements/combat/phantom2.json

@@ -1,16 +1,16 @@
 {
-    "parent": "ltw:combat/phantom_1",
+    "parent": "ltw:combat/phantom1",
     "display": {
       "icon": {
-        "item": "minecraft:diamond_sword"
+        "item": "minecraft:arrow"
       },
       "title": {
-        "text": "狩猎老手"
+        "text": "狩猎大师"
       },
       "description": [
         {"text": "在月夜狩猎小游戏中击杀 16 只幻翼\n", "color":"gray"},
         {"text": "奖励: ","color":"green"},
-        {"text": "4 金粒","color":"white"}
+        {"text": "2 绿宝石","color":"white"}
       ],
       "frame": "task",
       "show_toast": true,
@@ -18,7 +18,7 @@
       "hidden": false
     },
     "rewards": {
-      "function": "ltw:advancement/bonus_1"
+      "function": "ltw:advancement/bonus_2"
     },
     "criteria": {
       "get_score":{

+ 5 - 5
data/ltw/advancements/combat/phantom_3.json → data/ltw/advancements/combat/phantom3.json

@@ -1,16 +1,16 @@
 {
-    "parent": "ltw:combat/phantom_2",
+    "parent": "ltw:combat/phantom2",
     "display": {
       "icon": {
-        "item": "minecraft:netherite_sword"
+        "item": "minecraft:spectral_arrow"
       },
       "title": {
-        "text": "狩猎大师"
+        "text": "狩猎之神"
       },
       "description": [
         {"text": "在月夜狩猎小游戏中击杀 24 只幻翼\n", "color":"gray"},
         {"text": "奖励: ","color":"green"},
-        {"text": "1 金锭","color":"white"}
+        {"text": "3 绿宝石","color":"white"}
       ],
       "frame": "challenge",
       "show_toast": true,
@@ -18,7 +18,7 @@
       "hidden": false
     },
     "rewards": {
-      "function": "ltw:advancement/bonus_2"
+      "function": "ltw:advancement/bonus_3"
     },
     "criteria": {
       "finish":{

+ 5 - 5
data/ltw/advancements/parkour/explore_2.json → data/ltw/advancements/parkour/explore1.json

@@ -1,16 +1,16 @@
 {
-    "parent": "ltw:parkour/explore_1",
+    "parent": "ltw:parkour/root",
     "display": {
       "icon": {
-        "item": "minecraft:diamond_boots"
+        "item": "minecraft:mossy_cobblestone"
       },
       "title": {
-        "text": "探索老手"
+        "text": "闲来无事"
       },
       "description": [
-        {"text": "完成等待大厅的跑酷\n", "color":"gray"},
+        {"text": "完成大厅中的旅途", "color":"gray"},
         {"text": "奖励: ","color":"green"},
-        {"text": "4 金粒","color":"white"}
+        {"text": "1 绿宝石","color":"white"}
       ],
       "frame": "task",
       "show_toast": true,

+ 7 - 7
data/ltw/advancements/parkour/explore_3.json → data/ltw/advancements/parkour/explore2.json

@@ -1,21 +1,21 @@
 {
-    "parent": "ltw:parkour/explore_2",
+    "parent": "ltw:parkour/explore1",
     "display": {
       "icon": {
-        "item": "minecraft:netherite_boots"
+        "item": "minecraft:crimson_hyphae"
       },
       "title": {
-        "text": "探索大师"
+        "text": "挑战自我"
       },
       "description": [
-        {"text": "完成等待大厅的超级隐藏跑酷\n", "color":"gray"},
+        {"text": "完成大厅中隐藏的跑酷\n", "color":"gray"},
         {"text": "奖励: ","color":"green"},
-        {"text": "1 金锭","color":"white"}
+        {"text": "2 绿宝石","color":"white"}
       ],
-      "frame": "challenge",
+      "frame": "task",
       "show_toast": true,
       "announce_to_chat": true,
-      "hidden": true
+      "hidden": false
     },
     "rewards": {
       "function": "ltw:advancement/bonus_2"

+ 33 - 0
data/ltw/advancements/parkour/explore3.json

@@ -0,0 +1,33 @@
+{
+    "parent": "ltw:parkour/explore2",
+    "display": {
+      "icon": {
+        "item": "minecraft:gilded_blackstone"
+      },
+      "title": {
+        "text": "空手而返"
+      },
+      "description": [
+        {"text": "到达神秘的老板面前\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": {
+      "finish":{
+          "trigger": "minecraft:impossible"
+      }
+    },
+    "requirements": [
+      [
+          "finish"
+      ]
+    ]
+  }

+ 0 - 28
data/ltw/advancements/parkour/explore_1.json

@@ -1,28 +0,0 @@
-{
-    "parent": "ltw:parkour/root",
-    "display": {
-      "icon": {
-        "item": "minecraft:iron_boots"
-      },
-      "title": {
-        "text": "探索学徒"
-      },
-      "description": [
-        {"text": "完成等待大厅的旅途", "color":"gray"}
-      ],
-      "frame": "task",
-      "show_toast": true,
-      "announce_to_chat": true,
-      "hidden": false
-    },
-    "criteria": {
-      "finish":{
-          "trigger": "minecraft:impossible"
-      }
-    },
-    "requirements": [
-      [
-          "finish"
-      ]
-    ]
-  }

+ 8 - 3
data/ltw/advancements/parkour/treasure_1.json → data/ltw/advancements/parkour/treasure1.json

@@ -2,19 +2,24 @@
     "parent": "ltw:parkour/root",
     "display": {
       "icon": {
-        "item": "minecraft:iron_ingot"
+        "item": "minecraft:oak_leaves"
       },
       "title": {
-        "text": "寻宝学徒"
+        "text": "宝藏学徒"
       },
       "description": [
-        {"text": "在遗迹寻宝小游戏中收集 4 处宝藏", "color":"gray"}
+        {"text": "在遗迹寻宝小游戏中收集 4 处宝藏", "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"

+ 5 - 5
data/ltw/advancements/parkour/treasure_2.json → data/ltw/advancements/parkour/treasure2.json

@@ -1,16 +1,16 @@
 {
-    "parent": "ltw:parkour/treasure_1",
+    "parent": "ltw:parkour/treasure1",
     "display": {
       "icon": {
-        "item": "minecraft:diamond"
+        "item": "minecraft:chest"
       },
       "title": {
-        "text": "寻宝老手"
+        "text": "宝藏大师"
       },
       "description": [
         {"text": "在遗迹寻宝小游戏中收集 7 处宝藏\n", "color":"gray"},
         {"text": "奖励: ","color":"green"},
-        {"text": "4 金粒","color":"white"}
+        {"text": "2 绿宝石","color":"white"}
       ],
       "frame": "task",
       "show_toast": true,
@@ -18,7 +18,7 @@
       "hidden": false
     },
     "rewards": {
-      "function": "ltw:advancement/bonus_1"
+      "function": "ltw:advancement/bonus_2"
     },
     "criteria": {
       "get_score":{

+ 5 - 5
data/ltw/advancements/parkour/treasure_3.json → data/ltw/advancements/parkour/treasure3.json

@@ -1,16 +1,16 @@
 {
-    "parent": "ltw:parkour/treasure_2",
+    "parent": "ltw:parkour/treasure2",
     "display": {
       "icon": {
-        "item": "minecraft:netherite_scrap"
+        "item": "minecraft:ender_chest"
       },
       "title": {
-        "text": "寻宝大师"
+        "text": "宝藏之神"
       },
       "description": [
         {"text": "在遗迹寻宝小游戏中收集全部宝藏\n", "color":"gray"},
         {"text": "奖励: ","color":"green"},
-        {"text": "1 金锭","color":"white"}
+        {"text": "3 绿宝石","color":"white"}
       ],
       "frame": "challenge",
       "show_toast": true,
@@ -18,7 +18,7 @@
       "hidden": false
     },
     "rewards": {
-      "function": "ltw:advancement/bonus_2"
+      "function": "ltw:advancement/bonus_3"
     },
     "criteria": {
       "get_score":{

+ 3 - 3
data/ltw/functions/advancement/bonus_1.mcfunction

@@ -1,3 +1,3 @@
-scoreboard players add @s gold 4
-scoreboard players add @s gold_total 4
-execute if score $state mem matches 0 run function item:shop/refresh_gold
+scoreboard players add @s green 1
+scoreboard players add @s green_total 1
+execute if score $state mem matches 0 run function item:shop/refresh_green

+ 3 - 3
data/ltw/functions/advancement/bonus_2.mcfunction

@@ -1,3 +1,3 @@
-scoreboard players add @s gold 9
-scoreboard players add @s gold_total 9
-execute if score $state mem matches 0 run function item:shop/refresh_gold
+scoreboard players add @s green 2
+scoreboard players add @s green_total 2
+execute if score $state mem matches 0 run function item:shop/refresh_green

+ 3 - 0
data/ltw/functions/advancement/bonus_3.mcfunction

@@ -0,0 +1,3 @@
+scoreboard players add @s green 3
+scoreboard players add @s green_total 3
+execute if score $state mem matches 0 run function item:shop/refresh_green

+ 6 - 4
data/ltw/functions/init.mcfunction

@@ -51,16 +51,18 @@ scoreboard objectives remove leave_game
 scoreboard objectives add leave_game minecraft.custom:leave_game "离开游戏"
 scoreboard objectives remove effect_floating
 scoreboard objectives add effect_floating dummy "悬浮计时"
-# scoreboard objectives remove effect_regen
-# scoreboard objectives add effect_regen dummy "恢复计时"
 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 gold dummy "金粒"
-scoreboard objectives add gold_total dummy "金粒总计"
 scoreboard objectives add shop_arrow dummy "箭升级"
 scoreboard objectives add shop_potion dummy "药水升级"
 scoreboard objectives add shop_apple dummy "苹果升级"

+ 1 - 0
data/ltw/functions/state/0/player_enter.mcfunction

@@ -29,6 +29,7 @@ tp @s[tag=!debug] -10 8 -42 68 -20
 # 刷新物品
 clear @s[tag=!debug]
 execute as @s[tag=!debug] run function item:shop/refresh_gold
+execute as @s[tag=!debug] run function item:shop/refresh_green
 
 # 默认进入待机状态
 function item:lobby_state/join_watch

+ 3 - 3
data/ltw/functions/state/0/state_enter.mcfunction

@@ -6,9 +6,9 @@ scoreboard players set $state mem 0
 execute as @a run function ltw:state/0/player_enter
 
 # HUD
-scoreboard objectives setdisplay belowName gold_total
-scoreboard objectives setdisplay sidebar gold_total
-scoreboard objectives setdisplay list gold_total
+scoreboard objectives setdisplay belowName green_total
+scoreboard objectives setdisplay sidebar green_total
+scoreboard objectives setdisplay list green_total
 scoreboard players set $bossbar_type mem 0
 function lib:bossbar/show
 

+ 3 - 2
data/ltw/functions/state/0/tick5.mcfunction

@@ -6,8 +6,9 @@
 execute as @a[tag=!lobby_ready,tag=!lobby_watch] run function item:lobby_state/join_watch
 
 # 给予进度
-execute as @a at @s if entity @s[x=-1,y=22,z=-29,dx=5,dy=3,dz=3] run advancement grant @s only ltw:parkour/explore_1
-execute as @a at @s if entity @s[x=6,y=48,z=-32,dx=4,dy=3,dz=9] run advancement grant @s only ltw:parkour/explore_2
+execute as @a at @s if entity @s[x=-1,y=22,z=-29,dx=5,dy=3,dz=3] run advancement grant @s only ltw:parkour/explore1
+execute as @a at @s if entity @s[x=6,y=48,z=-32,dx=4,dy=3,dz=9] run advancement grant @s only ltw:parkour/explore2
+execute as @a at @s if entity @s[x=0,y=28,z=-46,distance=..4] run advancement grant @s only ltw:parkour/explore3
 
 # 隐藏名片
 execute as @e[type=piglin,tag=shop_piglin_11,tag=lobby_entity] at @s if entity @a[distance=..5] run data modify entity @s CustomNameVisible set value true

+ 3 - 3
data/mini/functions/parkour/game/test_treasure.mcfunction

@@ -45,6 +45,6 @@ tellraw @a[tag=get_treasure,scores={treasure=..9}] ["",{"text":">> ","color":"gr
 execute as @a[tag=get_treasure,scores={treasure=10}] run function mini:parkour/player_finished
 execute as @a[tag=get_treasure] at @s run function lib:sounds/levelup
 
-execute as @a[tag=get_treasure] if score @s treasure matches 4 run advancement grant @s only ltw:parkour/treasure_1
-execute as @a[tag=get_treasure] if score @s treasure matches 7 run advancement grant @s only ltw:parkour/treasure_2
-execute as @a[tag=get_treasure] if score @s treasure matches 10 run advancement grant @s only ltw:parkour/treasure_3
+execute as @a[tag=get_treasure] if score @s treasure matches 4 run advancement grant @s only ltw:parkour/treasure1
+execute as @a[tag=get_treasure] if score @s treasure matches 7 run advancement grant @s only ltw:parkour/treasure2
+execute as @a[tag=get_treasure] if score @s treasure matches 10 run advancement grant @s only ltw:parkour/treasure3

+ 3 - 3
data/mini/functions/phantom/tick5.mcfunction

@@ -10,6 +10,6 @@ execute as @a[tag=!watcher,scores={temp=1..,kill_phantom2=0}] run tellraw @a [""
 execute as @a[tag=!watcher] run scoreboard players operation @s kill_phantom2 = @s kill_phantom
 
 # 给予进度
-execute as @a[tag=!watcher,scores={temp=1..,kill_phantom=8}] run advancement grant @s only ltw:combat/phantom_1
-execute as @a[tag=!watcher,scores={temp=1..,kill_phantom=16}] run advancement grant @s only ltw:combat/phantom_2
-execute as @a[tag=!watcher,scores={temp=1..,kill_phantom=24}] run advancement grant @s only ltw:combat/phantom_3
+execute as @a[tag=!watcher,scores={temp=1..,kill_phantom=8}] run advancement grant @s only ltw:combat/phantom1
+execute as @a[tag=!watcher,scores={temp=1..,kill_phantom=16}] run advancement grant @s only ltw:combat/phantom2
+execute as @a[tag=!watcher,scores={temp=1..,kill_phantom=24}] run advancement grant @s only ltw:combat/phantom3