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

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

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

+ 2 - 2
data/item/functions/shop/refresh_gold.mcfunction

@@ -8,7 +8,7 @@ clear @s gold_nugget
 # 获取金块数,存于 temp
 scoreboard players operation @s temp = @s gold
 scoreboard players operation @s temp /= #const_81 mem
-# 给予金锭
+# 给予金块
 execute if score @s temp matches 1.. at @s run function item:shop/summon_block
 # 获取金锭数,存于 temp
 scoreboard players operation @s temp = @s gold
@@ -20,4 +20,4 @@ execute if score @s temp matches 1.. at @s run function item:shop/summon_gold
 scoreboard players operation @s temp = @s gold
 scoreboard players operation @s temp %= #const_9 mem
 # 给予金粒
-execute if score @s temp matches 1.. at @s run function item:shop/summon_nugget
+execute if score @s temp matches 1.. at @s run function item:shop/summon_nugget

+ 3 - 3
data/item/functions/shop/special_dice.mcfunction

@@ -1,5 +1,5 @@
 # 跟老板玩骰子
-function lib:roll_dice/d20
+function ltw:state/0/roll_dice/d20
 scoreboard players operation @s temp = $random mem
-execute as @e[type=piglin,tag=shop_piglin_11,tag=lobby_entity] run function lib:roll_dice/d20
-function lib:roll_dice/show_result
+execute as @e[type=piglin,tag=shop_piglin_11,tag=lobby_entity] run function ltw:state/0/roll_dice/d20
+function ltw:state/0/roll_dice/show_result

+ 0 - 3
data/lib/functions/roll_dice/draw.mcfunction

@@ -1,3 +0,0 @@
-scoreboard players add @s gold 9
-function item:shop/refresh_gold
-tag @a remove self

+ 0 - 2
data/lib/functions/roll_dice/lose.mcfunction

@@ -1,2 +0,0 @@
-# 无事发生
-tag @a remove self

+ 0 - 3
data/lib/functions/roll_dice/win.mcfunction

@@ -1,3 +0,0 @@
-scoreboard players add @s gold 18
-function item:shop/refresh_gold
-tag @a remove self

+ 0 - 0
data/lib/functions/roll_dice/d20.mcfunction → data/ltw/functions/state/0/roll_dice/d20.mcfunction


+ 3 - 0
data/ltw/functions/state/0/roll_dice/draw.mcfunction

@@ -0,0 +1,3 @@
+scoreboard players add @s gold 9
+tag @a remove self
+scoreboard players set @s temp 0

+ 3 - 0
data/ltw/functions/state/0/roll_dice/lose.mcfunction

@@ -0,0 +1,3 @@
+# 无事发生
+scoreboard players set @s temp 0
+tag @a remove self

+ 7 - 7
data/lib/functions/roll_dice/show_result.mcfunction → data/ltw/functions/state/0/roll_dice/show_result.mcfunction

@@ -3,27 +3,27 @@ execute if score $random mem matches 20 if score @s temp matches 1 run tellraw @
 execute if score $random mem matches 20 if score @s temp matches 2..19 run tellraw @s ["",{"text":">> ","color":"dark_purple","bold":true},"老板丢出了 ",{"text":"大成功","color":"dark_purple","bold":true}," ,你失去了所有金粒,被丢出了赌博房!"]
 execute if score $random mem matches 2..19 if score @s temp matches 1 run tellraw @s ["",{"text":">> ","color":"dark_purple","bold":true},"你丢出了 ",{"text":"大失败","color":"dark_purple","bold":true}," ,你失去了所有金粒,被丢出了赌博房!"]
 
-execute if score $random mem matches 20 if score @s temp matches 1..19 run function lib:roll_dice/super_lose
-execute if score $random mem matches 2..19 if score @s temp matches 1 run function lib:roll_dice/super_lose
+execute if score $random mem matches 20 if score @s temp matches 1..19 run function ltw:state/0/roll_dice/super_lose
+execute if score $random mem matches 2..19 if score @s temp matches 1 run function ltw:state/0/roll_dice/super_lose
 
 # 玩家大成功,老板非大成功/老板大失败,玩家非大失败:玩家获得3金块
 execute if score $random mem matches 1 if score @s temp matches 20 run tellraw @s ["",{"text":">> ","color":"gold","bold":true},"你丢出了 ",{"text":"大成功","color":"gold","bold":true}," ,老板丢出了 ",{"text":"大失败","color":"gold","bold":true}," ,你是超级欧皇,你获得了 ",{"text":"3金块","color":"gold","bold":true} ," !"]
 execute if score $random mem matches 2..19 if score @s temp matches 20 run tellraw @s ["",{"text":">> ","color":"gold","bold":true},"你丢出了 ",{"text":"大成功","color":"gold","bold":true}," ,你获得了 ",{"text":"3金块","color":"gold","bold":true} ," !"]
 execute if score $random mem matches 1 if score @s temp matches 2..19 run tellraw @s ["",{"text":">> ","color":"gold","bold":true},"老板丢出了 ",{"text":"大失败","color":"gold","bold":true}," ,你获得了 ",{"text":"3金块","color":"gold","bold":true} ," !"]
 
-execute if score $random mem matches 1 if score @s temp matches 2..20 run function lib:roll_dice/super_win
-execute if score $random mem matches 2..19 if score @s temp matches 20 run function lib:roll_dice/super_win
+execute if score $random mem matches 1 if score @s temp matches 2..20 run function ltw:state/0/roll_dice/super_win
+execute if score $random mem matches 2..19 if score @s temp matches 20 run function ltw:state/0/roll_dice/super_win
 
 # 老板比玩家大:无事发生
 execute if score $random mem matches 2..19 if score @s temp matches 2..19 if score $random mem > @s temp run tellraw @s ["",{"text":">> ","color":"dark_red","bold":true},"老板的点数比你大,你输了,你失去了 ",{"text":"1金锭","color":"dark_red","bold":true} ," !"]
-execute if score $random mem matches 2..19 if score @s temp matches 2..19 if score $random mem > @s temp run function lib:roll_dice/lose
+execute if score $random mem matches 2..19 if score @s temp matches 2..19 if score $random mem > @s temp run function ltw:state/0/roll_dice/lose
 
 # 玩家比老板大:获得18金粒
 execute if score $random mem matches 2..19 if score @s temp matches 2..19 if score $random mem < @s temp run tellraw @s ["",{"text":">> ","color":"dark_green","bold":true},"你的点数比老板大,你赢了,你获得了",{"text":"1金锭","color":"dark_green","bold":true} ," !"]
-execute if score $random mem matches 2..19 if score @s temp matches 2..19 if score $random mem < @s temp run function lib:roll_dice/win
+execute if score $random mem matches 2..19 if score @s temp matches 2..19 if score $random mem < @s temp run function ltw:state/0/roll_dice/win
 
 # 老板和玩家一样大:玩家获得9金粒
 execute if score $random mem matches 20 if score @s temp matches 20 run tellraw @s ["",{"text":">> ","color":"green","bold":true},"你和老板一样欧,你们平局了,你拿回了 ",{"text":"1金锭","color":"green","bold":true} ," !"]
 execute if score $random mem matches 2..19 if score @s temp matches 2..19 if score $random mem = @s temp run tellraw @s ["",{"text":">> ","color":"green","bold":true},"你的点数和老板一样大,你们平局了,你拿回了 ",{"text":"1金锭","color":"green","bold":true} ," !"]
 execute if score $random mem matches 1 if score @s temp matches 1 run tellraw @s ["",{"text":">> ","color":"green","bold":true},"你和老板一样非,你们平局了,你拿回了 ",{"text":"1金锭","color":"green","bold":true} ," !"]
-execute if score $random mem = @s temp run function lib:roll_dice/draw
+execute if score $random mem = @s temp run function ltw:state/0/roll_dice/draw

+ 1 - 1
data/lib/functions/roll_dice/super_lose.mcfunction → data/ltw/functions/state/0/roll_dice/super_lose.mcfunction

@@ -1,5 +1,5 @@
 scoreboard players set @s gold 0
-function item:shop/refresh_gold
+scoreboard players set @s temp 0
 tag @a remove self
 tag @s add self
 tellraw @a[tag=!self] ["",{"text":">> ","color":"red","bold":true},{"selector": "@s","color":"red"}," 非到了一个境界,倾家荡产,被老板丢出了赌博房!"]

+ 1 - 1
data/lib/functions/roll_dice/super_win.mcfunction → data/ltw/functions/state/0/roll_dice/super_win.mcfunction

@@ -1,5 +1,5 @@
 scoreboard players add @s gold 243
-function item:shop/refresh_gold
+scoreboard players set @s temp 0
 tag @a remove self
 tag @s add self
 tellraw @a[tag=!self] ["",{"text":">> ","color":"gold","bold":true},{"selector": "@s","color":"gold"}," 欧到了一个境界,从老板那赢得了3金块!"]

+ 3 - 0
data/ltw/functions/state/0/roll_dice/win.mcfunction

@@ -0,0 +1,3 @@
+scoreboard players add @s gold 18
+scoreboard players set @s temp 0
+tag @a remove self

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

@@ -11,7 +11,7 @@ execute unless entity @e[type=piglin,tag=shop_piglin_9,tag=lobby_entity] run sum
 execute unless entity @e[type=piglin,tag=shop_piglin_10,tag=lobby_entity] run summon piglin 0 8 -55 {Tags:["lobby_entity","shop_piglin_10"],PersistenceRequired:1b,IsImmuneToZombification:1b,CannotHunt:1b,HandItems:[{id:"bow",Count:1b},{}],HandDropChances:[0.0f,0.0f]}
 execute unless entity @e[type=piglin,tag=shop_piglin_11,tag=lobby_entity] run kill @e[type=minecart,tag=lobby_entity]
 execute unless entity @e[type=minecart,tag=lobby_entity] run kill @e[type=piglin,tag=lobby_entity,tag=shop_piglin_11]
-execute unless entity @e[type=piglin,tag=shop_piglin_11,tag=lobby_entity] run summon minecart 4 47 -77 {Tags:["lobby_entity"],Passengers:[{id:"minecraft:piglin",Tags:["lobby_entity","shop_piglin_11"],CustomName:'{"text":"老板"}',ArmorItems:[{},{},{},{id:"player_head",Count:1b,tag:{SkullOwner:"HerobrineXia"}}],ArmorDropChances:[0.0f,0.0f,0.0f,0.0f],PersistenceRequired:1b,IsImmuneToZombification:1b,CannotHunt:1b,HandItems:[{id:"gold_block",Count:1b},{}],HandDropChances:[0.0f,0.0f]}]}
+# execute unless entity @e[type=piglin,tag=shop_piglin_11,tag=lobby_entity] run summon minecart 4 47 -77 {Rotation:[0.0f,0.0f],Tags:["lobby_entity"],Passengers:[{id:"minecraft:piglin",Rotation:[90.0f,0.0f],Tags:["lobby_entity","shop_piglin_11"],CustomName:'{"text":"老板"}',ArmorItems:[{},{},{},{id:"player_head",Count:1b,tag:{SkullOwner:"HerobrineXia"}}],ArmorDropChances:[0.0f,0.0f,0.0f,0.0f],PersistenceRequired:1b,IsImmuneToZombification:1b,CannotHunt:1b,HandItems:[{id:"gold_block",Count:1b},{}],HandDropChances:[0.0f,0.0f]}]}
 # execute unless entity @e[type=piglin,tag=shop_piglin_4,tag=lobby_entity] run summon piglin 9 10 -36 {Tags:["lobby_entity","shop_piglin_4"],PersistenceRequired:1b,IsImmuneToZombification:1b,CannotHunt:1b,HandItems:[{id:"orange_dye",Count:1b},{}],HandDropChances:[0.0f,0.0f]}
 # execute unless entity @e[type=piglin,tag=shop_piglin_4,tag=lobby_entity] run summon piglin 9 10 -36 {Tags:["lobby_entity","shop_piglin_4"],PersistenceRequired:1b,IsImmuneToZombification:1b,CannotHunt:1b,HandItems:[{id:"orange_dye",Count:1b},{}],HandDropChances:[0.0f,0.0f]}
 # execute unless entity @e[type=piglin,tag=shop_piglin_4,tag=lobby_entity] run summon piglin 9 10 -36 {Tags:["lobby_entity","shop_piglin_4"],PersistenceRequired:1b,IsImmuneToZombification:1b,CannotHunt:1b,HandItems:[{id:"orange_dye",Count:1b},{}],HandDropChances:[0.0f,0.0f]}