Skip to content

✨[Artifact 1432] 廻蛇の玉を作成 - #2034

Open
k22992068-crypto wants to merge 44 commits into
masterfrom
dev/mizame_1432
Open

k22992068-crypto wants to merge 44 commits into
masterfrom
dev/mizame_1432

Conversation

@k22992068-crypto

Copy link
Copy Markdown
Contributor

No description provided.

execute if entity @e[type=#lib:living_without_player,tag=!13S.HitEnemy,tag=!Uninterferable,distance=..8] run function asset:object/1158.ouroboros_ball/hit_entity/reflect
execute unless entity @e[type=#lib:living_without_player,tag=!13S.HitEnemy,tag=!Uninterferable,distance=..8] run function asset:object/call.m {method:"kill"}
#反射回数が0になったら玉を消す
execute if data storage asset:context this{ReflectionLimit:0} run function asset:object/call.m {method:"kill"}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 5回目の反射先へ到達する前に玉が消えます。ReflectionLimitは5で開始し、reflectで減算した直後にここで0を判定しているため、初撃+反射後4撃で終了します。Loreの「5回まで近くの敵に向かって跳ね返る」に合わせるなら、残り1から0にした反射では玉を残し、その反射先への命中後に消す必要があります。


#直前にヒットしている敵ならリセットしてreturn
execute store result score $HitEnemyID Temporary run data get storage asset:context this.HitEnemyID
execute if score @e[tag=13S.HitEnemy,distance=..5,sort=nearest,limit=1] MobUUID = $HitEnemyID Temporary run return run function asset:object/1158.ouroboros_ball/hit_entity/reset

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 同じ敵の別の追加当たり判定を、別の敵として扱ってしまいそうです。HitEnemyIDに保存しているのは接触したentityのMobUUIDで、反射先から除外する13S.HitEnemyもそのentityだけなので、黒龍などのExtendedCollision間で反射し、同じ本体へ連続でダメージを与えられます。対象にForwardTargetMobUUIDがあればそれを参照するといいかも? 命中済み判定と反射先の選択を、転送先の本体が同じかどうかで揃えるとよさそうです。

@Lapis-LJA Lapis-LJA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

さっきコメントした通り

@tatuharu tatuharu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このレビューはハルがAI自動レビューの動作テストのためにOpus5.5 Extra Highを使用してレビューを行なったものです。鵜呑みにせず、指摘を採用するかはお任せします。

指摘が 2 件あります。詳細は行コメントに書いています。

  • 〔不具合〕追加当たり判定を持つ敵に当たると、同じ敵の別の当たり判定へ反射し、ダメージも反射も起きずに素通りする
  • 〔軽微〕6回目の命中で玉が消えるときも、8m以内に敵がいれば反射の効果音が鳴る

#反射回数を1減らす
execute store result storage asset:context this.ReflectionLimit int 0.9999999999 run data get storage asset:context this.ReflectionLimit 1
#向きを変える
tp @s ^ ^ ^ facing entity @e[type=#lib:living_without_player,tag=!13S.HitEnemy,tag=!Uninterferable,distance=..8,sort=random,limit=1] eyes

@tatuharu tatuharu Oct 26, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

黒龍のように追加当たり判定(ExtendedCollision)を複数持つ敵に当たると、反射先に同じ敵の別の追加当たり判定が選ばれることがあります。玉がそこへ当たっても、hit_entity/.mcfunction の16行目で ForwardTargetMobUUID が this.HitEnemyID と一致して return するため、ダメージも反射も起きません。玉は別の敵かブロックに当たるか、射程が尽きるまで直進します。Lapis-LJA さんが指摘した点のうち、命中済みの判定は本体単位になりましたが、反射先の選択はまだ本体単位になっていません。

反射先の候補から外しているのは、この行と hit_entity/.mcfunction の39・40行目のどちらも、同じファイルの11行目で 13S.HitEnemy を付けた entity だけです。黒龍は asset:mob/0410.heiloang/init/locator で locator の slime すべてに Enemy と ExtendedCollision を付け、Uninterferable を付けるのは無敵の間(tick/util/start_invulnerable_locator)だけです。そのため、8m以内にある別の locator は反射先の候補に入ります。

MobUUID(ExtendedCollision なら ForwardTargetMobUUID)が this.HitEnemyID と一致する entity も候補から外せば、別の敵へ向かうようになります。タグで外す場合は、43行目でタグを外す範囲も8mにそろえる必要があります。

検証用サーバー(Minecraft 1.20.4、このPRの head ec044cb)で確かめました。同じ本体へ転送する追加当たり判定を3つ並べてそのうち1つに玉を当てると、7回とも反射先に残りの2つのどちらかが選ばれ、玉はそこを通り抜けて直進しました。通り抜けるあいだ本体の体力も ReflectionLimit も変わらず、反射の効果音(block.glass.break)も届きませんでした。trace を取った1回では、そのあいだに呼ばれた hit_entity 7回がすべて16行目の return で終わっていました。8m以内に別の敵(ハスク)も置いた6回では、最初の反射先は同じ敵の追加当たり判定が2回、ハスクが4回でした。残りの2つを別の本体へ転送させた対照(3回)では、そこへ当たるたびにダメージと反射が起きました。黒龍そのものは召喚せず、本体には黒龍の本体と同じタグを付けた slime を、追加当たり判定には asset:mob/0410.heiloang/init/locator を実行した slime を使い、右クリックは ClickCarrotEvent を1にして代えています。修正案は試していません。

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

未解消です。111e2a068で、命中した敵と同じ本体の判定にも13S.HitEnemyを付けるようになり、同じ本体の別の追加当たり判定へ反射することはなくなりました。ただ、タグを付けるのは8m以内なのに、hit_entity/.mcfunctionの48行目でタグを外すのは5m以内のままです。命中点から5〜8mにある判定にはタグが残り、その判定はあとから撃った玉の反射先にも選ばれなくなります。

検証用サーバー(Minecraft 1.20.4、Asset 111e2a0、TheSkyBlessing bfb8eb9de)で、前回と同じ配置(同じ本体へ転送する追加当たり判定A・B・C)でAに当てました。玉はAにダメージを与えたあと、B・Cへは向かわずに消えましたが、Aの命中点から約5.3mのB・Cには13S.HitEnemyが残りました。そのままB・Cの転送先を別の本体に変えて撃つと、3回ともAに当たったあとに玉が消え、B・Cの本体にはダメージが入りませんでした。ec044cbでは、この条件で毎回B・Cへ反射してダメージが入っています。残ったタグを消してから撃つと、AとCの間で反射してダメージが入りました。

前回のコメントのとおり、48行目でタグを外す範囲も8mにそろえると、タグは残らなくなるはずです。こちらでは試していません。

Comment on lines +39 to +40
execute if entity @e[type=#lib:living_without_player,tag=!13S.HitEnemy,tag=!Uninterferable,distance=..8] run function asset:object/1158.ouroboros_ball/hit_entity/reflect
execute unless entity @e[type=#lib:living_without_player,tag=!13S.HitEnemy,tag=!Uninterferable,distance=..8] run function asset:object/call.m {method:"kill"}

@tatuharu tatuharu Oct 26, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

反射を5回終えたあとの命中では36行目で玉を消しますが、関数はそのまま続き、39・40行目も実行されます。8m以内に別の敵がいると reflect が呼ばれ、玉が消えるのに反射の効果音(block.glass.break)が鳴ります。敵がいなければ、40行目で kill をもう一度呼びます。

36行目を return にすると、43行目のタグの解除まで飛ばしてしまいます。39・40行目に反射回数の条件を足すのが安全です。

検証用サーバー(Minecraft 1.20.4、このPRの head ec044cb)で確かめました。2体のハスクの間で玉を5回反射させると、6回目の命中の tick に、もう1体が8m以内に残っているときは3回とも block.glass.break が観測用のクライアントに届きました。5回目の反射のあとでもう1体を8mより遠くへ移したときは、3回とも届きませんでした。debug function で取った trace では、前者は36行目の kill のあとに reflect が呼ばれ、後者は36行目と40行目で kill が2回呼ばれていました。右クリックは ClickCarrotEvent を1にして代え、trace を取った回(それぞれ1回)だけ玉の tick を Object.DisableTicking で止め、本体が毎 tick 呼ぶ asset_manager:object/triggers/tick を debug function から呼んでいます。suggestion は試していません。

Suggested change
execute if entity @e[type=#lib:living_without_player,tag=!13S.HitEnemy,tag=!Uninterferable,distance=..8] run function asset:object/1158.ouroboros_ball/hit_entity/reflect
execute unless entity @e[type=#lib:living_without_player,tag=!13S.HitEnemy,tag=!Uninterferable,distance=..8] run function asset:object/call.m {method:"kill"}
execute unless data storage asset:context this{ReflectionLimit:0} if entity @e[type=#lib:living_without_player,tag=!13S.HitEnemy,tag=!Uninterferable,distance=..8] run function asset:object/1158.ouroboros_ball/hit_entity/reflect
execute unless data storage asset:context this{ReflectionLimit:0} unless entity @e[type=#lib:living_without_player,tag=!13S.HitEnemy,tag=!Uninterferable,distance=..8] run function asset:object/call.m {method:"kill"}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正を確認しました。111e2a068で44・45行目に反射回数の条件が付き、41行目で玉を消したあとは、reflectも2回目のkillも呼ばれなくなりました。

検証用サーバー(Minecraft 1.20.4、Asset 111e2a0、TheSkyBlessing bfb8eb9de)で、前回と同じ手順で2体のハスクの間で玉を5回反射させました。6回目の命中のtickに、もう1体が8m以内に残っているときも、3回ともblock.glass.breakは観測用のクライアントに届きませんでした。traceでも、41行目のkillのあとにreflectと2回目のkillは呼ばれていません。もう1体を8mより遠くへ移した場合も、killは41行目の1回だけでした。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants