Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@
# @private
#declare score_holder $Difficulty

# 難易度値を取得する
# 難易度値に比例した攻撃回数を設定
# (難易度値 * 2 + 2)回攻撃する
function api:global_vars/get_difficulty
execute store result score $Difficulty Temporary run data get storage api: Return.Difficulty

# KillTickを設定 (116 + 難易度値 * 16)
# ((KillTick - 100) / 8) 回だけ攻撃する
scoreboard players operation $Difficulty Temporary *= $16 Const
execute store result storage api: Argument.FieldOverride.KillTick int 1 run scoreboard players add $Difficulty Temporary 116
execute store result score $Difficulty Temporary run data get storage api: Return.Difficulty 2
execute store result storage api: Argument.FieldOverride.AttackCount int 1 run scoreboard players add $Difficulty Temporary 2

# 魔法を召喚
data modify storage api: Argument.ID set value 2049
data modify storage api: Argument.FieldOverride.Damage set from storage asset:context this.Damage
execute store result storage api: Argument.FieldOverride.MobUUID int 1 run scoreboard players get @e[type=zombie,tag=this,distance=..3,limit=1] MobUUID
execute store result storage api: Argument.FieldOverride.MobUUID int 1 run scoreboard players get @s MobUUID
function api:object/summon

# リセット
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
# @within function asset:object/2049.lightning_magic/**
#declare tag 2049.OnGround
#declare tag 2049.Interval
#declare tag 2049.RunOnce
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# @within asset:object/alias/2049/detect_hit_block

# 地面に着く前
execute if entity @s[tag=!2049.OnGround] unless block ~ ~-0.5 ~ #lib:no_collision run data modify storage asset:context IsHitBlock set value true
execute if entity @s[tag=!2049.OnGround] unless block ~ ~-0.5 ~ #lib:no_collision/without_fluid run data modify storage asset:context IsHitBlock set value true

# 地面に着いた後
# 雷雲が阻まれない限り消滅しない
execute if entity @s[tag=2049.OnGround] positioned ~ ~3 ~ unless block ^ ^ ^0.15 #lib:no_collision run data modify storage asset:context IsHitBlock set value true
execute if entity @s[tag=2049.OnGround] positioned ~ ~3 ~ unless block ^ ^ ^0.15 #lib:no_collision/without_fluid run data modify storage asset:context IsHitBlock set value true
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# @within asset:object/alias/2049/detect_hit_entity

# 地面に着いた後、かつIntervalTagのある時のみ判定
execute if entity @s[tag=2049.OnGround,tag=2049.Interval] if entity @p[distance=..1.2] run data modify storage asset:context IsHitEntity set value true
execute if entity @s[tag=2049.OnGround,tag=2049.Interval] if entity @p[tag=!PlayerShouldInvulnerable,distance=..3.2] run data modify storage asset:context IsHitEntity set value true
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
# @within asset:object/alias/2049/hit_block

# 地面に着く前
execute if entity @s[tag=!2049.OnGround] run function asset:object/2049.lightning_magic/hit_block/in_air
execute if entity @s[tag=!2049.OnGround] run return run function asset:object/2049.lightning_magic/hit_block/in_air

# 地面に着いた後
execute if entity @s[tag=2049.OnGround,tag=!2049.RunOnce] run function asset:object/call.m {method:kill}

# Tag削除
tag @s[tag=2049.RunOnce] remove 2049.RunOnce
execute if entity @s[tag=2049.OnGround] run function asset:object/call.m {method:kill}
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@
# @within function asset:object/2049.lightning_magic/hit_block/

# プレイヤーの方を向く
tp @s ~ ~ ~ facing entity @p feet

# Tickの値を変更
scoreboard players set @s General.Object.Tick 100
tp @s ~ ~ ~ facing entity @p[tag=!PlayerShouldInvulnerable,distance=..100] feet

# Tagを付与
tag @s add 2049.OnGround

# PassengersのScaleを変更
execute on passengers if entity @s[type=text_display] run data modify entity @s transformation.scale set value [1.8f,1.8f,1.8f]
execute on passengers if entity @s[type=item_display] run data modify entity @s transformation.scale set value [1.8f,1.8f,1.8f]

# MovePerStepを変更
data modify storage asset:context this.MovePerStep set value 0.15

# 一度しか実行しない用Tagを付与
# これが付与されるとhit_block/on_groundが実行されない
tag @s add 2049.RunOnce
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
#
# @within asset:object/alias/2049/hit_entity

# 円柱Libを用いて判定する
data modify storage lib: Argument.BoundingCylinder.Radius set value 1.2d
data modify storage lib: Argument.BoundingCylinder.Height set value 3.25d
data modify storage lib: Argument.BoundingCylinder.Selector set value "@a[tag=!PlayerShouldInvulnerable,distance=..5]"
execute positioned ~ ~-0.25 ~ run function lib:bounding_cylinder/

# MobのAttackトリガー起動用Metadata
data modify storage api: Argument.Metadata set value "371.Debuff"

Expand All @@ -13,8 +19,11 @@
data modify storage api: Argument.ElementType set value "Thunder"
data modify storage api: Argument.MobUUID set from storage asset:context this.MobUUID
function api:damage/modifier_manual
execute as @a[tag=!PlayerShouldInvulnerable,distance=..1.2] run function api:damage/
execute as @a[tag=BoundingCylinder,distance=..5] run function api:damage/
function api:damage/reset

# 消滅
function asset:object/call.m {method:kill}
# ヒットしたなら消滅
execute if entity @a[tag=BoundingCylinder,distance=..5,limit=1] run function asset:object/call.m {method:"kill"}

# リセット
tag @a[tag=BoundingCylinder,distance=..5] remove BoundingCylinder

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#> asset:object/2049.lightning_magic/kill/
#
# 継承先などから実行される処理
#
# @within asset:object/alias/2049/kill

# 演出
particle flash ~ ~1.2 ~ 0 0 0 0 1

# 消滅
execute on passengers run kill @s
kill @s

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@
# ID (int)
data modify storage asset:object ID set value 2049
# フィールド(オプション)

# 飛翔体抽象関連
data modify storage asset:object Field.Speed set value 1
data modify storage asset:object Field.Range set value 250
data modify storage asset:object Field.MovePerStep set value 0.3
# text_displayのフレーム用
data modify storage asset:object Field.Frame set value 5
data modify storage asset:object Field.FrameInterval set value 2
# 何tickで消滅するか?
data modify storage asset:object Field.InAirLimitTick set value 80
# 何回攻撃したら消滅するか?
data modify storage asset:object Field.AttackCount set value 4
# 攻撃のインターバル
data modify storage asset:object Field.AttackInterval set value 0
# ダメージ
data modify storage asset:object Field.Damage set value 1f
data modify storage asset:object Field.KillTick set value 120
data modify storage asset:object Field.MobUUID set value -1
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# @within asset:object/alias/2049/summon

# 元となるEntityを召喚する
summon marker ~ ~ ~ {Rotation:[0.0f,90.0f],Tags:["ObjectInit"]}
summon interaction ~ ~ ~ {Tags:["ObjectInit","Uninterferable"],width:0f,height:0f,Rotation:[0f,90f],Passengers:[{id:"text_display",Tags:["AutoKillWhenDieVehicle","ProcessCommonTag"],teleport_duration:1,billboard:"vertical",alignment:"center",brightness:{sky:15,block:15},text:'{"text":"0","font":"object/2049/0"}',background:16711680,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0f,0f,0f],translation:[0f,1.35f,0f]}},{id:"item_display",Rotation:[90f,0f],Tags:["AutoKillWhenDieVehicle","ProcessCommonTag"],teleport_duration:1,billboard:"vertical",item:{id:"stick",Count:1b,tag:{CustomModelData:20586}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0f,0f,0f],translation:[0f,3.2f,0f]}}]}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
#
# @within asset:object/alias/2049/tick

# Tick加算
scoreboard players add @s General.Object.Tick 1

# 空中にいるときの処理
execute if entity @s[scores={General.Object.Tick=..79}] run function asset:object/2049.lightning_magic/tick/in_air
execute if entity @s[tag=!2049.OnGround] run function asset:object/2049.lightning_magic/tick/in_air

# 地面にいるときの処理
execute if entity @s[scores={General.Object.Tick=100..}] at @s rotated ~ 0 run function asset:object/2049.lightning_magic/tick/on_ground
execute if entity @s[tag= 2049.OnGround] at @s rotated ~ 0 run function asset:object/2049.lightning_magic/tick/on_ground

# 継承
execute at @s run function asset:object/super.tick
Expand All @@ -20,7 +17,6 @@
tag @s[tag=2049.Interval] remove 2049.Interval

# 消滅
# 80..99 着陸前で4秒以上経過で消滅
# 100.. 汎用Tick > KillTickなら消滅
execute if entity @s[scores={General.Object.Tick=80..99}] run kill @s
execute if score @s General.Object.Tick >= @s 2049.KillTick run kill @s
# InAirLimitTick == 0 || AttackCount == 0
execute if data storage asset:context this{InAirLimitTick:0} run function asset:object/call.m {method:"kill"}
execute if data storage asset:context this{AttackCount:0} run function asset:object/call.m {method:"kill"}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
#
# @within function asset:object/2049.lightning_magic/tick/

# 空中に存在可能なTickのデクリメント
execute store result storage asset:context this.InAirLimitTick int 0.9999999999 run data get storage asset:context this.InAirLimitTick

# 演出
particle dust 1 1 0 1.3 ~ ~ ~ 0.05 0.05 0.05 0 1 normal @a
particle dust 0.95 0.85 0.3 0.9 ~ ~ ~ 0.05 0.05 0.05 0 1 normal @a
particle electric_spark ~ ~ ~ 0.05 0.05 0.05 0 2 normal @a
playsound entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.1 2 0
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@
#declare score_holder $Interval

# 一定間隔で実行
scoreboard players operation $Interval Temporary = @s General.Object.Tick
scoreboard players operation $Interval Temporary %= $8 Const
execute if score $Interval Temporary matches 0 at @s rotated ~ 0 run tag @s add 2049.Interval
scoreboard players reset $Interval Temporary
execute store result storage asset:context this.AttackInterval int 0.9999999999 run data get storage asset:context this.AttackInterval
execute if data storage asset:context this{AttackInterval:0} run function asset:object/2049.lightning_magic/tick/thunder
execute if data storage asset:context this{AttackInterval:0} run data modify storage asset:context this.AttackInterval set value 8

# IntervalTagがある時のみ実行
execute if entity @s[tag=2049.Interval] run function asset:object/2049.lightning_magic/tick/thunder
# 一定間隔でtext_displayのフレームを反映
execute store result storage asset:context this.FrameInterval int 0.9999999999 run data get storage asset:context this.FrameInterval
execute if data storage asset:context this{FrameInterval:0} on passengers if entity @s[type=text_display] run function asset:object/2049.lightning_magic/tick/text_frame
execute if data storage asset:context this{FrameInterval:0} run data modify storage asset:context this.FrameInterval set value 2

# プレイヤーの方向へ誘導する
execute if predicate api:global_vars/difficulty/max/2_hard facing entity @p feet positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-400 facing entity @s eyes positioned as @s run tp @s ~ ~ ~ ~ ~
execute if predicate api:global_vars/difficulty/min/3_blessless facing entity @p feet positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-200 facing entity @s eyes positioned as @s run tp @s ~ ~ ~ ~ ~
execute facing entity @p[gamemode=!spectator,distance=..100] feet positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-300 facing entity @s eyes positioned as @s run tp @s ~ ~ ~ ~ ~

# 現在座標がno_collison && 真下がブロック && 自身が下を向いている なら角度を0に固定する
execute if block ~ ~ ~ #lib:no_collision/without_fluid unless block ~ ~-0.15 ~ #lib:no_collision/without_fluid at @s if entity @s[x_rotation=0..90] run tp @s ~ ~ ~ ~ 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#> asset:object/2049.lightning_magic/tick/text_frame
#
#
#
# @within function asset:object/2049.lightning_magic/tick/on_ground

# デクリメント
execute store result storage asset:context this.Frame int 0.9999999999 run data get storage asset:context this.Frame

# フレーム反映
execute if data storage asset:context this{Frame:4} run data modify entity @s text set value '{"text":"1","font":"object/2049/0"}'
execute if data storage asset:context this{Frame:3} run data modify entity @s text set value '{"text":"2","font":"object/2049/0"}'
execute if data storage asset:context this{Frame:2} run data modify entity @s text set value '{"text":"3","font":"object/2049/0"}'
execute if data storage asset:context this{Frame:1} run data modify entity @s text set value '{"text":"4","font":"object/2049/0"}'
execute if data storage asset:context this{Frame:0} run data modify entity @s text set value '{"text":"0","font":"object/2049/0"}'

# リセット
execute if data storage asset:context this{Frame:0} run data modify storage asset:context this.Frame set value 5
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
#
# @within function asset:object/2049.lightning_magic/tick/on_ground

# 攻撃回数のデクリメント
execute store result storage asset:context this.AttackCount int 0.9999999999 run data get storage asset:context this.AttackCount

# 各メソッドで使用するIntervalTag
tag @s add 2049.Interval

# 演出
function asset:object/2049.lightning_magic/tick/vfx/thunder
execute positioned ~ ~0.2 ~ run function asset:object/2049.lightning_magic/tick/vfx/circle
particle dust 0.6 0.6 0.8 1.2 ~ ~3 ~ 0.6 0.05 0.6 0 50 normal @a
particle dust 0.95 0.85 0.3 0.9 ~ ~1.4 ~ 0.05 1 0.05 0 20 normal @a
playsound entity.lightning_bolt.thunder hostile @a ~ ~ ~ 0.3 2 0

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#> asset:object/2257.thundercloud/_index.d
# @private

#> tag
# @within function asset:object/2257.thundercloud/**
#declare
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#> asset:object/2257.thundercloud/register
#
# Objectのデータを指定
#
# @within function asset:object/alias/2257/register

# 継承(オプション)
# data modify storage asset:object Extends append value
# function asset:object/extends
# 他のObjectに継承されることを許可するか (boolean) (オプション)
# data modify storage asset:object ExtendsSafe set value
# 継承されることを前提とした、抽象的なObjectであるかどうか(boolean)
data modify storage asset:object IsAbstract set value false
# Tickするかどうか(boolean) (オプション)
# data modify storage asset:object IsTicking set value

# ID (int)
data modify storage asset:object ID set value 2257
# フィールド(オプション)
# data modify storage asset:object Field.myValue set value
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/2257.thundercloud/summon/
#
# Object召喚処理の呼び出し時に実行されるfunction
#
# @within asset:object/alias/2257/summon

# 元となるEntityを召喚する
summon text_display ~ ~ ~ {Tags:["ObjectInit"],billboard:"vertical",alignment:"center",brightness:{sky:15,block:15},text:'{"text":"0","font":"object/2257/0"}',background:16711680,Passengers:[{id:"item_display",Tags:["AutoKillWhenDieVehicle","ProcessCommonTag"],billboard:"vertical",item:{id:"stick",Count:1b,tag:{CustomModelData:20586}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1f,1f,1f],translation:[0f,1.2f,0f]}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#> asset:object/2257.thundercloud/tick/
#
# Objectのtick時の処理
#
# @within asset:object/alias/2257/tick

# Tick加算
scoreboard players add @s General.Object.Tick 1

# 描画
execute if score @s General.Object.Tick matches 3 run data modify entity @s text set value '{"text":"1","font":"object/2257/0"}'
execute if score @s General.Object.Tick matches 6 run data modify entity @s text set value '{"text":"2","font":"object/2257/0"}'
execute if score @s General.Object.Tick matches 9 run data modify entity @s text set value '{"text":"3","font":"object/2257/0"}'
execute if score @s General.Object.Tick matches 12 run data modify entity @s text set value '{"text":"4","font":"object/2257/0"}'

# 消滅処理
kill @s[scores={General.Object.Tick=12..}]
8 changes: 0 additions & 8 deletions Asset/data/asset/functions/object/alias/2049/init.mcfunction

This file was deleted.

Loading