Skip to content

Commit

Permalink
🐛 [Artifact 953] メテオレインのターゲッティングの修正 および 対象がいない場合隕石が降らない問題の修正 (#1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lapis-LJA authored Mar 6, 2025
1 parent bc9e112 commit efe476e
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@

# メテオレインのエミッターを召喚
data modify storage api: Argument.ID set value 1079
data modify storage api: Argument.FieldOverride.Damage set value 580
execute store result storage api: Argument.FieldOverride.UserID int 1 run scoreboard players get @s UserID
function api:object/summon
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
# @within function asset:object/alias/1079/register

# 継承(オプション)
# data modify storage asset:object Extends append value
# data modify storage asset:object Extends append value
# function asset:object/extends
# 他のObjectに継承されることを許可するか (boolean) (オプション)
# data modify storage asset:object ExtendsSafe set value
# 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
# data modify storage asset:object IsTicking set value

# ID (int)
data modify storage asset:object ID set value 1079
# フィールド(オプション)
# data modify storage asset:object Field.myValue set value
data modify storage asset:object Field.Damage set value 1
data modify storage asset:object Field.UserID set value -1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#> インターバル
#@private
# declare score_holder $Interval
# declare score_holder $Interval

# Tick加算
scoreboard players add @s General.Object.Tick 1
Expand All @@ -15,14 +15,13 @@
particle lava ~ ~ ~ 10 10 10 0 1
particle large_smoke ~ ~ ~ 10 10 10 0 1

# ダメージ、数Tickおきに実行
# 実行時間を移す
scoreboard players operation $Interval Temporary = @s General.Object.Tick
# 10tickおきに実行
scoreboard players operation $Interval Temporary %= $10 Const
# ダメージ実行
execute if score $Interval Temporary matches 0 positioned ~ ~40 ~ run function asset:object/1079.meteor_rain_emitter/tick/summon_meteor
execute if score $Interval Temporary matches 0 positioned ~ ~40 ~ run function asset:object/1079.meteor_rain_emitter/tick/summon_meteor
execute if score $Interval Temporary matches 0 positioned ~ ~40 ~ run function asset:object/1079.meteor_rain_emitter/tick/summon_meteor
# 10tick毎にメテオを召喚する
scoreboard players operation $Interval Temporary = @s General.Object.Tick
scoreboard players operation $Interval Temporary %= $10 Const
execute if score $Interval Temporary matches 0 run function asset:object/1079.meteor_rain_emitter/tick/summon_meteor
execute if score $Interval Temporary matches 0 run function asset:object/1079.meteor_rain_emitter/tick/summon_meteor
execute if score $Interval Temporary matches 0 run function asset:object/1079.meteor_rain_emitter/tick/summon_meteor
scoreboard players reset $Interval Temporary

# 消滅処理
kill @s[scores={General.Object.Tick=200..}]
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,40 @@
# @within function asset:object/1079.meteor_rain_emitter/tick/

#> このファイル内で使われるタグ
#@private
#declare tag SpreadMarker
#declare tag SpreadFacingMarker
#declare tag MeteorTarget
# @private
#declare tag SpreadMarker
#declare tag SpreadFacingMarker
#declare tag MeteorTarget

# 拡散させる
summon marker ~ ~ ~ {Tags:["SpreadMarker"]}
data modify storage lib: Argument.Bounds set value [[32d,32d],[0.0d,0.0d],[32d,32d]]
execute as @e[type=marker,tag=SpreadMarker,distance=..128,limit=1] at @s run function lib:spread_entity/

# 付近のランダムな敵一体を対象とし、そいつの周辺に拡散
tag @e[type=#lib:living,tag=Enemy,tag=!Uninterferable,distance=..64,sort=random,limit=1] add MeteorTarget
execute store result storage api: Argument.FieldOverride.TargetID int 1 run scoreboard players get @e[type=#lib:living,tag=MeteorTarget,distance=..64,limit=1] MobUUID
execute at @e[type=#lib:living,tag=MeteorTarget,distance=..64,limit=1] run summon marker ~ ~ ~ {Tags:["SpreadFacingMarker"]}
data modify storage lib: Argument.Bounds set value [[8d,8d],[0.0d,0.0d],[8d,8d]]
execute as @e[type=marker,tag=SpreadFacingMarker,distance=..128,limit=1] at @s run function lib:spread_entity/
# 付近のランダムな敵一体を対象として狙う
execute positioned ~-40 ~-8 ~-40 run tag @e[type=#lib:living,tag=Enemy,tag=!Uninterferable,dx=79,dy=24,dz=79,sort=random,limit=1] add MeteorTarget
execute if entity @e[type=#lib:living,tag=MeteorTarget,distance=..50,limit=1] store result storage api: Argument.FieldOverride.TargetID int 1 run scoreboard players get @e[type=#lib:living,tag=MeteorTarget,distance=..50,limit=1] MobUUID

# メテオを召喚
# メテオのブレ用の拡散

# ターゲットがいる場合
execute at @e[type=#lib:living,tag=MeteorTarget,distance=..50,limit=1] run summon marker ~ ~ ~ {Tags:["SpreadFacingMarker"]}
data modify storage lib: Argument.Bounds set value [[8d,8d],[0.0d,0.0d],[8d,8d]]

# ターゲットがいない場合
execute unless entity @e[type=#lib:living,tag=MeteorTarget,distance=..50,limit=1] run summon marker ~ ~ ~ {Tags:["SpreadFacingMarker"]}
execute unless entity @e[type=#lib:living,tag=MeteorTarget,distance=..50,limit=1] run data modify storage lib: Argument.Bounds set value [[16d,16d],[0.0d,0.0d],[16d,16d]]

# 拡散
execute as @e[type=marker,tag=SpreadFacingMarker,distance=..128,limit=1] at @s run function lib:spread_entity/

# 40m上からターゲットに向けてメテオを召喚
data modify storage api: Argument.ID set value 1080
data modify storage api: Argument.FieldOverride.Damage set from storage asset:context this.Damage
data modify storage api: Argument.FieldOverride.UserID set from storage asset:context this.UserID
execute at @e[type=marker,tag=SpreadMarker,distance=..128,limit=1] facing entity @e[type=marker,tag=SpreadFacingMarker,distance=..128,limit=1] feet run function api:object/summon
execute at @e[type=marker,tag=SpreadMarker,distance=..128,limit=1] positioned ~ ~40 ~ facing entity @e[type=marker,tag=SpreadFacingMarker,distance=..128,limit=1] feet run function api:object/summon

# リセット
kill @e[type=marker,tag=SpreadMarker,distance=..128,limit=1]
kill @e[type=marker,tag=SpreadFacingMarker,distance=..128,limit=1]
tag @e[type=#lib:living,tag=MeteorTarget,distance=..64,limit=1] remove MeteorTarget
tag @e[type=#lib:living,tag=MeteorTarget,distance=..70,limit=1] remove MeteorTarget
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
#
# @within asset:object/alias/1080/detect_hit_block

# マクロ!
function asset:object/1080.meteor_rain/detect_hit_block/check_target.m with storage asset:context this
# TargetIDの有無で判定を変える
execute if data storage asset:context this.TargetID run function asset:object/1080.meteor_rain/detect_hit_block/check/with_target.m with storage asset:context this
execute unless data storage asset:context this.TargetID run function asset:object/1080.meteor_rain/detect_hit_block/check/without_target.m with storage asset:context this
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:object/1080.meteor_rain/detect_hit_block/check/with_target.m
#
# @input args:
# MobUUID : int
# MovePerStep : float
# @within function asset:object/1080.meteor_rain/detect_hit_block/

# 判定
$execute positioned ~-50 ~-1 ~-50 unless entity @e[type=#lib:living,scores={MobUUID=$(TargetID)},dx=99,dy=-50,dz=99] at @s unless block ^ ^ ^$(MovePerStep) #lib:no_collision run data modify storage asset:context IsHitBlock set value true
#execute positioned ~-50 ~ ~-50 unless entity @e[type=#lib:living,scores={MobUUID=16708},dx=99,dy=-50,dz=99] at @s unless block ~ ~ ~ #lib:no_collision run data modify storage asset:context IsHitBlock set value true
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/1080.meteor_rain/detect_hit_block/check/without_target.m
#
# @input args:
# MovePerStep : float
# @within function asset:object/1080.meteor_rain/detect_hit_block/

# 判定
$execute unless block ^ ^ ^$(MovePerStep) #lib:no_collision run data modify storage asset:context IsHitBlock set value true

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
particle flame ~ ~ ~ 1.5 1.5 1.5 0 20

# ダメージ
data modify storage api: Argument.Damage set value 580.0f
data modify storage api: Argument.Damage set from storage asset:context this.Damage
data modify storage api: Argument.AttackType set value "Magic"
data modify storage api: Argument.ElementType set value "Fire"
# 実行時に受け取っているUserIDの持ち主として補正を実行
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
# フィールド(オプション)
data modify storage asset:object Field.Speed set value 2
data modify storage asset:object Field.Range set value 128
data modify storage asset:object Field.Damage set value 1
# data modify storage asset:object Field.TargetID set value -1
data modify storage asset:object Field.UserID set value -1

0 comments on commit efe476e

Please sign in to comment.