Skip to content

Commit 549e213

Browse files
committed
DPSタイマー追加
1 parent 58baf90 commit 549e213

9 files changed

Lines changed: 36 additions & 5 deletions

File tree

Asset/data/asset/functions/mob/0456.gargo_ex_machina/_index.d.mcfunction

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#declare tag CO.CenterPosition 中心点
1111
#declare tag CO.IsLatter 後半戦
1212
#declare tag CO.IsRematch 再戦
13+
#declare tag CO.IsInvulnerable 無敵
1314
# - スキル
1415
#declare tag CO.Skill.Activate 起動
1516
#declare tag CO.Skill.Activate.Short 起動・演出短縮版

Asset/data/asset/functions/mob/0456.gargo_ex_machina/death/.mcfunction

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,25 @@
4141
# 石像移動
4242
function asset:mob/0456.gargo_ex_machina/death/clone_statue
4343

44+
# ---
45+
tellraw @a[distance=..80] [{"text":"-------------------------------------------------"}]
46+
4447
# クリアタイム表示
4548
execute store result score $Sec Temporary store result score $Min Temporary run scoreboard players operation @s CO.BattleTimer /= $20 Const
4649
scoreboard players operation $Min Temporary /= $60 Const
4750
scoreboard players operation $Sec Temporary %= $60 Const
48-
tellraw @a[distance=..80] [{"text":"-------------------------------------------------"}]
4951
execute if score $Sec Temporary matches 10.. run tellraw @a[distance=..80] [{"text":"【 クリアタイム:"},{"score":{"name":"$Min","objective":"Temporary"}},{"text": ":"},{"score":{"name":"$Sec","objective":"Temporary"}},{"text": " !! 】"}]
5052
execute if score $Sec Temporary matches ..9 run tellraw @a[distance=..80] [{"text":"【 クリアタイム:"},{"score":{"name":"$Min","objective":"Temporary"}},{"text": ":0"},{"score":{"name":"$Sec","objective":"Temporary"}},{"text": " !! 】"}]
51-
tellraw @a[distance=..80] [{"text":"-------------------------------------------------"}]
5253
scoreboard players reset $Min Temporary
5354
scoreboard players reset $Sec Temporary
5455

56+
# DPS表示
57+
scoreboard players operation @s CO.ActualHealth /= @s CO.DpsTimer
58+
scoreboard players operation @s CO.ActualHealth *= $20 Const
59+
tellraw @a[distance=..80] [{"text":"【 DPS:"},{"score":{"name":"@s","objective":"CO.ActualHealth"}},{"text": " !! 】"}]
60+
61+
# ---
62+
tellraw @a[distance=..80] [{"text":"-------------------------------------------------"}]
63+
5564
# 再戦フラグ用marker設置
5665
execute unless entity @e[type=marker,tag=CO.IsRematch,distance=..30] run summon marker ~ ~ ~ {Tags:["CO.IsRematch"]}

Asset/data/asset/functions/mob/0456.gargo_ex_machina/init/.mcfunction

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@
3232
# ダミー用ひつじ召喚
3333
execute unless entity @s[tag=CO.IsRematch] run data modify storage api: Argument.ID set value 2264
3434
execute unless entity @s[tag=CO.IsRematch] run function api:object/summon
35-
# summon sheep ~ ~ ~ {Tags:["CO.ScapeSheep","Uninterferable"],NoAI:1b,Invulnerable:1b}
36-
# playsound entity.sheep.hurt hostile @a ~ ~ ~ 2 0.7
3735

3836
# 登場モーション再生
3937
tag @s add CO.Skill.Activate
4038
# 再戦フラグ有効の場合、短縮版登場モーションを再生する
4139
execute if entity @s[tag=CO.IsRematch] run tag @s add CO.Skill.Activate.Short
4240

41+
# DPSタイマー計算開始
42+
function asset:mob/0456.gargo_ex_machina/init/set_dps_timer
43+
4344
# デバッグ
4445
# tag @s add CO.IsLatter
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#> asset:mob/0456.gargo_ex_machina/init/set_dps_timer
2+
#
3+
# Mobのinit時の処理
4+
#
5+
# @within asset:mob/0456.gargo_ex_machina/init/
6+
7+
# 実HP計算
8+
function api:mob/get_max_health
9+
execute store result score @s CO.ActualHealth run data get storage api: Return.MaxHealth 1
10+
data remove storage api: Return
11+
scoreboard players set @s CO.DpsTimer 0

Asset/data/asset/functions/mob/0456.gargo_ex_machina/load.mcfunction

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
scoreboard objectives add CO.PreTimer dummy
1616
scoreboard objectives add CO.JumpCount dummy
1717
scoreboard objectives add CO.BattleTimer dummy
18+
scoreboard objectives add CO.DpsTimer dummy
1819
scoreboard objectives add CO.HealthOffset dummy
20+
scoreboard objectives add CO.ActualHealth dummy
1921
#> Object管理用
2022
# @within function asset:mob/0456.gargo_ex_machina/**
2123
# @within function asset:object/2260.gem_attack_drone/**

Asset/data/asset/functions/mob/0456.gargo_ex_machina/register.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# 名前 (TextComponentString) (オプション)
2020
data modify storage asset:mob Name set value '{"text":"絡繰仕掛の石像"}'
2121
# Mobの説明文 (TextComponentString[]) (オプション)
22-
data modify storage asset:mob Lore set value ['{"text":" > Exception in thread \\"main\\"": java.lang.NullPointerException","color":"red"}','{"text":" at item.artifact.getLore(atf/0001.book_of_all-seeing)","color":"red"}','{"text":" Caused by: java.util.NoSuchElementException: Missing \'Lore\'","color":"red"}']
22+
data modify storage asset:mob Lore set value ['{"text":" > Exception in thread \\"main\\": java.lang.NullPointerException","color":"red"}','{"text":" at item.artifact.getLore(atf/0001.book_of_all-seeing)","color":"red"}','{"text":" Caused by: java.util.NoSuchElementException: Missing \'Lore\'","color":"red"}']
2323
# 体力 (double) (オプション)
2424
# 前後半戦で回復するので実態の半分の値を入れる
2525
data modify storage asset:mob Health set value 237000

Asset/data/asset/functions/mob/0456.gargo_ex_machina/tick/.mcfunction

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313

1414
# 戦闘タイマー増加
1515
execute if entity @s[tag=!CO.Skill.Activate,tag=!CO.Skill.ChangeHead] run scoreboard players add @s CO.BattleTimer 1
16+
execute if entity @s[tag=!CO.IsInvulnerable] run scoreboard players add @s CO.DpsTimer 1

Asset/data/asset/functions/mob/0456.gargo_ex_machina/tick/util/end_invulnerable.mcfunction

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313

1414
# 全Locator無敵化解除
1515
execute as @e[type=item_display,tag=CO.ModelRoot] run function animated_java:gargo_ex_machina/as_own_locator_entities {command:'function asset:mob/0456.gargo_ex_machina/tick/util/end_invulnerable_locator'}
16+
17+
# 無敵化フラグ
18+
tag @s remove CO.IsInvulnerable

Asset/data/asset/functions/mob/0456.gargo_ex_machina/tick/util/start_invulnerable.mcfunction

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313

1414
# 全Locatorを無敵化
1515
execute as @e[type=item_display,tag=CO.ModelRoot] run function animated_java:gargo_ex_machina/as_own_locator_entities {command:'function asset:mob/0456.gargo_ex_machina/tick/util/start_invulnerable_locator'}
16+
17+
# 無敵化フラグ
18+
tag @s add CO.IsInvulnerable

0 commit comments

Comments
 (0)