Просмотр исходного кода

Merge branch 'master' of https://github.com/LTCatt/LTW3

LTCatt 5 лет назад
Родитель
Сommit
c006cf19c8

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

@@ -0,0 +1,10 @@
+# 慈善家(在区域外999)
+# 触发器ID 999
+tellraw @s[scores={gold=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"看起来你已经身无分文,不要再远程购物啦!","color":"red"}]
+tellraw @s[scores={gold=1..}] ["",{"text":">> ","color":"green","bold":true},{"text":"一堆金粒凭空出现在了老板面前,老板一边喊着好东西好东西一边收下了金粒!","color":"green"}]
+execute as @s[scores={gold=1..}] at @s run function lib:sounds/levelup
+execute as @s[scores={gold=..0}] at @s run function lib:sounds/error
+scoreboard players set @s[scores={gold=1..8}] gold 0
+scoreboard players remove @s[scores={gold=9..}] gold 9
+execute as @s run function item:shop/refresh_gold
+scoreboard players set @s buy_trigger 0

+ 5 - 0
data/item/functions/shop/check.mcfunction

@@ -1,3 +1,8 @@
+execute if score @s buy_trigger matches 1..18 at @s unless entity @s[x=-3,z=-63,y=6,dx=25,dy=6,dz=30] run function item:shop/error
+execute if score @s buy_trigger matches 19..21 at @s unless entity @s[x=1,z=-63,y=20,dx=5,dy=4,dz=6] run function item:shop/error
+execute if score @s buy_trigger matches 100..108 at @s unless entity @s[x=-22,z=-75,y=18,dx=10,dy=4,dz=5] run function item:shop/error
+execute if score @s buy_trigger matches 999 at @s unless entity @s[x=-3,z=-49,y=27,dx=5,dy=4,dz=5] run function item:shop/charity
+
 execute if score @s buy_trigger matches 1 if score $state mem matches 0 run function item:shop/buy_apple1
 execute if score @s buy_trigger matches 2 if score $state mem matches 0 run function item:shop/buy_apple2
 execute if score @s buy_trigger matches 3 if score $state mem matches 0 run function item:shop/buy_armor1

+ 5 - 0
data/item/functions/shop/error.mcfunction

@@ -0,0 +1,5 @@
+# 不在购物区域
+# 触发器ID None
+scoreboard players set @s buy_trigger 0
+tellraw @s ["",{"text":">> ","color":"red","bold":true},{"text":"老板还没开通网上购物服务,请进入实体店购买!","color":"red"}]
+execute at @s run function lib:sounds/error

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

@@ -37,7 +37,6 @@ function lib:bossbar/show
 # FIXME: {钻石} 玩家会列入钻石的记分板(由于在 belowName 里显示)
 
 # HIM
-# FIXME: 让老板不能通过修改触发器进行交易
 
 
 # ——————————————

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

@@ -21,6 +21,8 @@ scoreboard players set $remove_resistance mem 0
 team modify playing friendlyFire false
 team modify playing collisionRule never
 gamerule fallDamage false
+gamerule doMobLoot false
+gamerule doTileDrops false
 
 # 修改队伍颜色
 team modify playing color green

+ 4 - 4
data/ltw/functions/state/7/next.mcfunction

@@ -3,16 +3,16 @@
 tag @a remove new_selector
 
 execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank1] add new_selector
-execute if entity @a[tag=mini_rank1] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到第一名 ",{"selector": "@a[tag=new_selector]","color":"gold"}," 选择奖励了!"]
+execute if entity @a[tag=mini_rank1,tag=new_selector] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到第一名 ",{"selector": "@a[tag=new_selector]","color":"gold"}," 选择奖励了!"]
 
 execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank2] add new_selector
-execute unless entity @a[tag=mini_rank1] if entity @a[tag=mini_rank2] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到第二名 ",{"selector": "@a[tag=new_selector]","color":"gold"}," 选择奖励了!"]
+execute if entity @a[tag=mini_rank2,tag=new_selector] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到第二名 ",{"selector": "@a[tag=new_selector]","color":"gold"}," 选择奖励了!"]
 
 execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank3] add new_selector
-execute unless entity @a[tag=mini_rank1] unless entity @a[tag=mini_rank2] if entity @a[tag=mini_rank3] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到第三名 ",{"selector": "@a[tag=new_selector]","color":"gold"}," 选择奖励了!"]
+execute if entity @a[tag=mini_rank3,tag=new_selector] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到第三名 ",{"selector": "@a[tag=new_selector]","color":"gold"}," 选择奖励了!"]
 
 execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank4] add new_selector
-execute unless entity @a[tag=mini_rank1] unless entity @a[tag=mini_rank2] unless entity @a[tag=mini_rank3] if entity @a[tag=mini_rank4] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},{"text":"轮到其他人选择奖励了!","color":"gold"}]
+execute if entity @a[tag=mini_rank4,tag=new_selector] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},{"text":"轮到其他人选择奖励了!","color":"gold"}]
 
 execute unless entity @a[tag=new_selector] if entity @a[tag=selecting] run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@a[tag=selecting]","color":"red"}," 未选择奖励……"]
 

+ 1 - 2
data/ltw/functions/state/7/pickup.mcfunction

@@ -1,5 +1,4 @@
 # 当玩家捡起物品时触发
-
-gamemode spectator
+gamemode spectator @s
 tag @s remove selecting
 execute unless entity @a[tag=selecting] run function ltw:state/7/next

+ 1 - 1
data/ltw/functions/state/7/tick20.mcfunction

@@ -1,6 +1,6 @@
 
 # 下一状态
-execute if score $countdown mem matches 1 run function ltw:state/7/next
+execute if score $countdown mem matches 0 run function ltw:state/7/next
 
 # 显示倒计时
 execute if entity @a[tag=selecting] run title @a times 3 14 2

+ 1 - 5
data/mini/functions/colormatch/game_end.mcfunction

@@ -1,6 +1,2 @@
 # 当前游戏结束时触发
-forceload remove 1001 4000 1075 4025
-
-# 清理锁定格子
-execute as @a[team=!debugging] run function item:disable_slot/disable_slot_7
-execute as @a[team=!debugging] run function item:disable_slot/disable_slot_8
+forceload remove 1001 4000 1075 4025

+ 3 - 0
data/mini/functions/main/game_end.mcfunction

@@ -34,5 +34,8 @@ execute if score $mini_type mem matches 3 run advancement grant @a[tag=mini_rank
 execute if score $mini_type mem matches 3 run advancement grant @a[tag=mini_rank1,scores={mini_heart=5..}] only ltw:vs/potato3
 execute if score $mini_type mem matches 4 if score $color_match_time mem matches ..13 run advancement grant @a[tag=mini_rank1] only ltw:parkour/colormatch2
 
+# 清理怪东西
+clear @a[team=!debugging] #mini:game_item{game_item:1b}
+
 # 进入状态 6
 function ltw:state/6/state_enter

+ 1 - 5
data/mini/functions/phantom/game_end.mcfunction

@@ -3,8 +3,4 @@ forceload remove 1000 6000 1064 6064
 gamerule doDaylightCycle false
 
 # 计算得分
-execute as @a[team=playing] run scoreboard players operation @s mini_score = @s kill_phantom
-
-# 清理锁定格子
-execute as @a[team=!debugging] run function item:disable_slot/disable_slot_7
-execute as @a[team=!debugging] run function item:disable_slot/disable_slot_8
+execute as @a[team=playing] run scoreboard players operation @s mini_score = @s kill_phantom