LTCatt hace 6 años
padre
commit
82ff58fcad

+ 17 - 4
data/item/functions/bonus_item/add_score.mcfunction

@@ -2,9 +2,9 @@
 execute store result score #bonus_add_score mem run data get block 0 0 0 RecordItem.tag.bonus_add_score
 
 # 正常的加分
-execute unless score #bonus_add_score mem matches 100 run scoreboard players operation @s total_score += #bonus_add_score mem
-execute unless score #bonus_add_score mem matches 100 run scoreboard players operation @s total_score_disp += #bonus_add_score mem
-execute unless score #bonus_add_score mem matches 100 run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 获得了 ",{"score": {"name":"#bonus_add_score","objective": "mem"},"color":"aqua"},{"text": " 分","color":"aqua"},", 当前共有 ",{"score": {"name": "@s","objective": "total_score"}}, " 分"]
+execute if score #bonus_add_score mem matches ..10 run scoreboard players operation @s total_score += #bonus_add_score mem
+execute if score #bonus_add_score mem matches ..10 run scoreboard players operation @s total_score_disp += #bonus_add_score mem
+execute if score #bonus_add_score mem matches ..10 run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 获得了 ",{"score": {"name":"#bonus_add_score","objective": "mem"},"color":"aqua"},{"text": " 分","color":"aqua"},", 当前共有 ",{"score": {"name": "@s","objective": "total_score"}}, " 分"]
 
 # 100:硬币
 scoreboard players set $random_max mem 1
@@ -15,4 +15,17 @@ execute if score #bonus_add_score mem matches 100 if score $random mem matches 1
 execute if score #bonus_add_score mem matches 100 if score $random mem matches 1 run tellraw @a ["",{"text": ">> ","color":"green","bold": true},{"selector": "@s","color":"green"}," 的硬币投出了正面, 得分加倍, 当前共有 ",{"score": {"name": "@s","objective": "total_score"},"color":"green"},{"text": " 分", "color":"green"}]
 execute if score #bonus_add_score mem matches 100 if score $random mem matches 0 run scoreboard players operation @s total_score /= $c_2 mem
 execute if score #bonus_add_score mem matches 100 if score $random mem matches 0 run scoreboard players operation @s total_score_disp /= $c_2 mem
-execute if score #bonus_add_score mem matches 100 if score $random mem matches 0 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@s","color":"red"}," 的硬币投出了反面, 得分减半, 当前共有 ",{"score": {"name": "@s","objective": "total_score"},"color":"red"},{"text": " 分", "color":"red"}]
+execute if score #bonus_add_score mem matches 100 if score $random mem matches 0 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@s","color":"red"}," 的硬币投出了反面, 得分减半, 当前共有 ",{"score": {"name": "@s","objective": "total_score"},"color":"red"},{"text": " 分", "color":"red"}]
+
+# 200:偷分
+execute if score #bonus_add_score mem matches 200 run scoreboard players add @s total_score 1
+execute if score #bonus_add_score mem matches 200 run scoreboard players add @s total_score_disp 1
+scoreboard players set #score_max mem -2147483648
+execute as @a run function ltw:main/get_max_score
+tag @a remove highest
+execute as @a if score @s total_score = #score_max mem run tag @s add highest
+execute if score #bonus_add_score mem matches 200 run scoreboard players remove @a[tag=highest,limit=1] total_score 1
+execute if score #bonus_add_score mem matches 200 run scoreboard players remove @a[tag=highest,limit=1] total_score_disp 1
+execute if score #bonus_add_score mem matches 200 if entity @s[tag=!highest] run tellraw @a ["",{"text": ">> ","color":"green","bold": true},{"selector": "@s","color":"aqua"}," 偷取到了 ",{"text": "1 分","color":"green"},", 当前共有 ",{"score": {"name": "@s","objective": "total_score"}}, " 分"]
+execute if score #bonus_add_score mem matches 200 if entity @s[tag=!highest] run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@s","color":"aqua"}," 被偷取了 ",{"text": "1 分","color":"red"},", 当前共有 ",{"score": {"name": "@s","objective": "total_score"}}, " 分"]
+execute if score #bonus_add_score mem matches 200 if entity @s[tag=highest] run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 试图偷取自己的分数……"]

+ 12 - 1
data/item/loot_tables/gameparty/last/green.json

@@ -2,7 +2,7 @@
 
 {
     "type": "minecraft:item",
-    "weight": 26,
+    "weight": 2,
     "name": "minecraft:nether_star",
     "functions": [
         {
@@ -14,6 +14,17 @@
             "tag": "{\"item_name\":\"{\\\"text\\\":\\\"得分 +2\\\",\\\"color\\\":\\\"green\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_add_score\":2}"
         }
     ]
+},
+{
+    "type": "minecraft:item",
+    "weight": 1,
+    "name": "minecraft:gold_ingot",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"从最高分玩家处偷取 1 分\\\",\\\"color\\\":\\\"green\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_add_score\":200}"
+        }
+    ]
 }
 
 ]}]}

+ 2 - 2
data/item/loot_tables/gameparty/normal/blue.json

@@ -2,7 +2,7 @@
 
 {
     "type": "minecraft:item",
-    "weight": 9,
+    "weight": 8,
     "name": "minecraft:nether_star",
     "functions": [
         {
@@ -17,7 +17,7 @@
 },
 {
     "type": "minecraft:item",
-    "weight": 3,
+    "weight": 4,
     "name": "minecraft:snowball",
     "functions": [
         {

+ 12 - 1
data/item/loot_tables/gameparty/normal/green.json

@@ -2,7 +2,7 @@
 
 {
     "type": "minecraft:item",
-    "weight": 26,
+    "weight": 17,
     "name": "minecraft:nether_star",
     "functions": [
         {
@@ -15,6 +15,17 @@
         }
     ]
 },
+{
+    "type": "minecraft:item",
+    "weight": 9,
+    "name": "minecraft:gold_ingot",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"从最高分玩家处偷取 1 分\\\",\\\"color\\\":\\\"green\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_add_score\":200}"
+        }
+    ]
+},
 {
     "type": "minecraft:item",
     "weight": 4,

+ 1 - 1
data/item/loot_tables/gameparty/normal/purple.json

@@ -2,7 +2,7 @@
 
 {
     "type": "minecraft:item",
-    "weight": 18,
+    "weight": 12,
     "name": "minecraft:nether_star",
     "functions": [
         {

+ 2 - 2
data/item/loot_tables/gameparty/normal/white.json

@@ -2,7 +2,7 @@
 
 {
     "type": "minecraft:item",
-    "weight": 12,
+    "weight": 10,
     "name": "minecraft:nether_star",
     "functions": [
         {
@@ -13,7 +13,7 @@
 },
 {
     "type": "minecraft:item",
-    "weight": 3,
+    "weight": 5,
     "name": "minecraft:paper",
     "functions": [
         {

+ 1 - 0
data/item/tags/items/bonus.json

@@ -1,5 +1,6 @@
 {
     "values": [
+        "minecraft:gold_ingot",
         "minecraft:paper",
         "minecraft:target",
         "minecraft:snowball",

+ 0 - 1
data/ltw/functions/main/player_leave.mcfunction

@@ -10,7 +10,6 @@ execute if score $state mem matches 1.. if score $game_type mem matches 1 if sco
 execute if score $state mem matches 5 if score $mini_type mem matches 3 run function mini:hotpm/player_leave
 
 # FIXME : [010/HIM] 奖励选择房和跑酷图还有结构方块的线
-# FIXME : 喝完药的玻璃瓶没有 clear
 # FIXME : <! 紧急> 跑酷中途掉线导致名次判断错误
 # FIXME : <! 紧急> [010] 弩和箭可能给不到人
 # FIXME : [010/HIM] 关闭原版进度,它会给玩家经验值什么的很烦