Repository navigation
✨ [Artifact1674] バウンシーランチャーの作成 #2188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
k22992068-crypto
wants to merge
10
commits into
master
Choose a base branch
from
dev/mizame_artifact1674
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4d6e5ad
✨ [Artifact1674] バウンシーランチャーの作成
k22992068-crypto e1be0c6
スピードの上昇とdの付け忘れを修正
k22992068-crypto 1710fd2
余計な空白を削除
k22992068-crypto fdd4331
タグリセット時の対象を狭め、メゾット呼び出しをお行儀よく変更
k22992068-crypto f96835a
スコアホルダーの名前をより良いものに変更
k22992068-crypto d68f4c5
反射処理のマーカーのセレクタ指定に距離制限をついか
k22992068-crypto 79bcc56
不要な処理を削除
k22992068-crypto 39bde94
ExtendedCollisionの敵に複数当たらないように修正+反射回数が説明通りになるよう修正
k22992068-crypto de8d78e
カラーシャードからきちんと出るように変更
k22992068-crypto 1ee2e17
tag=Enemyの付け忘れと反射の挙動を修正
k22992068-crypto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
Asset/data/asset/functions/artifact/1674.bouncy_launcher/give/1.trigger.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #> asset:artifact/1674.bouncy_launcher/give/1.trigger | ||
| # | ||
| # 神器の取得処理の呼び出し時に実行されるfunction | ||
| # | ||
| # @within tag/function asset:artifact/give | ||
|
|
||
| execute if data storage asset:context {id:1674} run function asset:artifact/1674.bouncy_launcher/give/2.give |
68 changes: 68 additions & 0 deletions
68
Asset/data/asset/functions/artifact/1674.bouncy_launcher/give/2.give.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| #> asset:artifact/1674.bouncy_launcher/give/2.give | ||
| # | ||
| # 神器の作成部 ここでID等を定義する | ||
| # | ||
| # @user | ||
| # @within function asset:artifact/1674.bouncy_launcher/give/1.trigger | ||
|
|
||
| # 神器の説明や消費MPなどをここで設定する。 | ||
| # 最後にasset:artifact/common/giveを実行することで入手可能。 | ||
|
|
||
| # 神器のID (int) スプレッドシートの値を入れる | ||
| data modify storage asset:artifact ID set value 1674 | ||
| # 神器のベースアイテム | ||
| data modify storage asset:artifact Item set value "minecraft:carrot_on_a_stick" | ||
| # 神器の名前 (TextComponentString) | ||
| data modify storage asset:artifact Name set value '{"text":"バウンシーランチャー","color":"#FFA7D8"}' | ||
| # 神器の説明文 (TextComponentString[]) | ||
| data modify storage asset:artifact Lore set value ['{"text":"壁や床、敵で跳ね返る魔法のボールを発射する"}','{"text":"敵にあたった時35回まで近くの敵に向かって跳ね返る"}','{"text":"「スーパーボールって何なの?」","color":"gray"}','{"text":"「魔法のように跳ねるスーパーなボールさ」","color":"gray"}'] | ||
| # 消費アイテム ({Item: TextComponent, Count: int, Extra?: TextComponent}) (オプション) | ||
| # data modify storage asset:artifact ConsumeItem.Item set value '{"translate":"item.minecraft.stick"}' | ||
| # data modify storage asset:artifact ConsumeItem.Count set value 1 | ||
| # data modify storage asset:artifact ConsumeItem.Extra set value | ||
| # 使用回数 (int) (オプション) | ||
| # data modify storage asset:artifact RemainingCount set value | ||
| # 神器を発動できるスロット (string) Wikiを参照 | ||
| data modify storage asset:artifact Slot set value "mainhand" | ||
| # 神器のトリガー (string) Wikiを参照 | ||
| data modify storage asset:artifact Trigger set value "onClick" | ||
| # 神器の発動条件 (TextComponentString) (オプション) | ||
| # data modify storage asset:artifact Condition set value | ||
| # 攻撃に関する情報 -Damage量 (literal[]/literal) Wikiを参照 (オプション) | ||
| data modify storage asset:artifact AttackInfo.Damage set value [5] | ||
| # 攻撃に関する情報 -攻撃タイプ (string[]) Wikiを参照 (オプション) | ||
| data modify storage asset:artifact AttackInfo.AttackType set value [Magic] | ||
| # 攻撃に関する情報 -攻撃属性 (string[]) Wikiを参照 (オプション) | ||
| data modify storage asset:artifact AttackInfo.ElementType set value [None] | ||
| # 攻撃に関する情報 -防御無視 (boolean) Wikiを参照 (オプション) | ||
| # data modify storage asset:artifact AttackInfo.BypassResist set value | ||
| # 攻撃に関する情報 -範囲攻撃 (string) Wikiを参照 (オプション) | ||
| data modify storage asset:artifact AttackInfo.IsRangeAttack set value "never" | ||
| # 攻撃に関する情報 -攻撃範囲 (literal) Wikiを参照 (オプション) | ||
| data modify storage asset:artifact AttackInfo.AttackRange set value 30 | ||
| # MP消費量 (int) | ||
| # data modify storage asset:artifact MPCost set value | ||
| # MP必要量 (int) (オプション) | ||
| # data modify storage asset:artifact MPRequire set value | ||
| # MP回復量 (int) | ||
| data modify storage asset:artifact MPHealWhenHit set value 1 | ||
| # 神器のクールダウン (int) (オプション) | ||
| # data modify storage asset:artifact LocalCooldown set value | ||
| # 種別クールダウン ({Type: string, Duration: int}) (オプション) | ||
| data modify storage asset:artifact TypeCooldown.Type set value "longRange" | ||
| data modify storage asset:artifact TypeCooldown.Duration set value 60 | ||
| # グローバルクールダウン (int) (オプション) | ||
| # data modify storage asset:artifact SpecialCooldown set value | ||
| # クールダウンによる使用不可のメッセージを非表示にするか否か (boolean) (オプション) | ||
| # data modify storage asset:artifact DisableCooldownMessage set value | ||
| # MP不足による使用不可のメッセージを非表示にするか否か (boolean) (オプション) | ||
| # data modify storage asset:artifact DisableMPMessage set value | ||
| # 破壊時の音を鳴らさないかどうか (boolean) (オプション) | ||
| # data modify storage asset:artifact DisableBreakSound set value | ||
| # 扱える神 (string[]) Wikiを参照 | ||
| data modify storage asset:artifact CanUsedGod set value "ALL" | ||
| # カスタムNBT (NBTCompound) 追加で指定したいNBT (オプション) | ||
| # data modify storage asset:artifact CustomNBT set value {} | ||
|
|
||
| # 神器の入手用function | ||
| function asset:artifact/common/give |
8 changes: 8 additions & 0 deletions
8
Asset/data/asset/functions/artifact/1674.bouncy_launcher/register.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #> asset:artifact/1674.bouncy_launcher/register | ||
| # | ||
| # 神器プールへの登録処理 | ||
| # | ||
| # @within tag/function asset:artifact/register | ||
|
|
||
| data modify storage asset:artifact RarityRegistry[2] append value [1674] | ||
| data modify storage asset:artifact RarityRegistryWithColor.Red[2] append value [1674] |
8 changes: 8 additions & 0 deletions
8
Asset/data/asset/functions/artifact/1674.bouncy_launcher/trigger/1.trigger.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #> asset:artifact/1674.bouncy_launcher/trigger/1.trigger | ||
| # | ||
| # 指定したイベントタイミングで実行されるfunction | ||
| # | ||
| # @within tag/function asset:artifact/** | ||
|
|
||
| # storage asset:idのmainhandに装備している神器のIDが入っているので比較し、~/2.check_condition.mcfunctionを実行する | ||
| execute if data storage asset:context id{mainhand:1674} run function asset:artifact/1674.bouncy_launcher/trigger/2.check_condition |
12 changes: 12 additions & 0 deletions
12
...t/data/asset/functions/artifact/1674.bouncy_launcher/trigger/2.check_condition.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #> asset:artifact/1674.bouncy_launcher/trigger/2.check_condition | ||
| # | ||
| # 神器の発動条件をチェックします | ||
| # | ||
| # @within function asset:artifact/1674.bouncy_launcher/trigger/1.trigger | ||
|
|
||
| # 神器の基本的な条件の確認を行うfunction、成功している場合CanUsedタグが付く | ||
| function asset:artifact/common/check_condition/mainhand | ||
| # 他にアイテム等確認する場合はここに書く | ||
|
|
||
| # CanUsedタグをチェックして3.main.mcfunctionを実行する | ||
| execute if entity @s[tag=CanUsed] run function asset:artifact/1674.bouncy_launcher/trigger/3.main |
24 changes: 24 additions & 0 deletions
24
Asset/data/asset/functions/artifact/1674.bouncy_launcher/trigger/3.main.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #> asset:artifact/1674.bouncy_launcher/trigger/3.main | ||
| # | ||
| # 神器のメイン処理部 | ||
| # | ||
| # @within function asset:artifact/1674.bouncy_launcher/trigger/2.check_condition | ||
|
|
||
| # 基本的な使用時の処理(MP消費や使用回数の処理など)を行う | ||
| function asset:artifact/common/use/mainhand | ||
|
|
||
| # ここから先は神器側の効果の処理を書く | ||
|
|
||
| # 召喚 | ||
| data modify storage api: Argument.ID set value 1204 | ||
| execute store result storage api: Argument.FieldOverride.UserID int 1 run scoreboard players get @s UserID | ||
| data modify storage api: Argument.FieldOverride.Damage set value 5d | ||
| data modify storage api: Argument.FieldOverride.AdditionalMPHeal set from storage api: PersistentArgument.AdditionalMPHeal | ||
| #反射回数上限 | ||
| data modify storage api: Argument.FieldOverride.ReflectionLimit set value 35 | ||
| #射程(Range*0.4m) | ||
| data modify storage api: Argument.FieldOverride.Range set value 75 | ||
| execute anchored eyes positioned ^ ^ ^ run function api:object/summon | ||
|
|
||
| #vfx | ||
| execute anchored eyes positioned ^ ^ ^0.5 run playsound tsb_sounds:launcher_shot player @s ~ ~ ~ 1 0.8 |
11 changes: 11 additions & 0 deletions
11
Asset/data/asset/functions/object/1204.bouncy_ball/_index.d.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #> asset:object/1204.bouncy_ball/_index.d | ||
| # @private | ||
|
|
||
| #> score_holder | ||
| # @within function asset:object/1204.bouncy_ball/** | ||
| #declare score_holder $HitEnemyID | ||
|
|
||
| #> tag | ||
| # @within function asset:object/1204.bouncy_ball/** | ||
| #declare tag 1AI.Owner | ||
| #declare tag 1AI.HitEnemy |
9 changes: 9 additions & 0 deletions
9
Asset/data/asset/functions/object/1204.bouncy_ball/detect_hit_block/.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #> asset:object/1204.bouncy_ball/detect_hit_block/ | ||
| # | ||
| # 継承先などから実行される処理 | ||
| # | ||
| # @within asset:object/alias/1204/detect_hit_block | ||
|
|
||
| # 判定 | ||
| execute unless block ^ ^ ^0.4 #lib:no_collision/ run data modify storage asset:context IsHitBlock set value true | ||
| execute unless block ^ ^ ^0.8 #lib:no_collision/ run data modify storage asset:context IsHitBlock set value true |
7 changes: 7 additions & 0 deletions
7
Asset/data/asset/functions/object/1204.bouncy_ball/detect_hit_entity/.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #> asset:object/1204.bouncy_ball/detect_hit_entity/ | ||
| # | ||
| # 継承先などから実行される処理 | ||
| # | ||
| # @within asset:object/alias/1204/detect_hit_entity | ||
|
|
||
| execute positioned ~-0.5 ~-0.5 ~-0.5 if entity @e[type=#lib:living_without_player,tag=Enemy,tag=!Uninterferable,dx=0] run data modify storage asset:context IsHitEntity set value true |
14 changes: 14 additions & 0 deletions
14
Asset/data/asset/functions/object/1204.bouncy_ball/hit_block/.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #> asset:object/1204.bouncy_ball/hit_block/ | ||
| # | ||
| # 継承先などから実行される処理 | ||
| # | ||
| # @within asset:object/alias/1204/hit_block | ||
|
|
||
| # 反射距離を何ブロック先が埋まってるかで調整する | ||
| execute unless block ^ ^ ^0.8 #lib:no_collision/ run scoreboard players set $Speed Lib 8 | ||
| execute unless block ^ ^ ^0.4 #lib:no_collision/ run scoreboard players set $Speed Lib 4 | ||
| function lib:reflection_bullet/ | ||
| #vfx | ||
| playsound minecraft:block.slime_block.fall player @a ~ ~ ~ 1.0 1 0.0 | ||
| #当たった敵の情報をリセット | ||
| data modify storage asset:context this.HitEnemyID set value -1 |
47 changes: 47 additions & 0 deletions
47
Asset/data/asset/functions/object/1204.bouncy_ball/hit_entity/.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| #> asset:object/1204.bouncy_ball/hit_entity/ | ||
| # | ||
| # 継承先などから実行される処理 | ||
| # | ||
| # @within asset:object/alias/1204/hit_entity | ||
|
|
||
| #> private | ||
| # @private | ||
| #declare score_holder $OwnerID | ||
|
|
||
| #Hitした敵にTagを付与 | ||
| execute positioned ~-0.5 ~-0.5 ~-0.5 as @e[type=#lib:living_without_player,tag=Enemy,tag=!Uninterferable,dx=0,sort=nearest,limit=1] run tag @s add 1AI.HitEnemy | ||
|
|
||
| #直前にヒットしている敵ならリセットしてreturn | ||
| execute store result score $HitEnemyID Temporary run data get storage asset:context this.HitEnemyID | ||
| execute if score @e[tag=1AI.HitEnemy,tag=!ExtendedCollision,distance=..5,sort=nearest,limit=1] MobUUID = $HitEnemyID Temporary run return run function asset:object/1204.bouncy_ball/hit_entity/reset | ||
| execute if score @e[tag=1AI.HitEnemy,tag=ExtendedCollision,distance=..5,sort=nearest,limit=1] ForwardTargetMobUUID = $HitEnemyID Temporary run return run function asset:object/1204.bouncy_ball/hit_entity/reset | ||
| #vfx | ||
| playsound minecraft:block.slime_block.fall player @a ~ ~ ~ 1.0 1 0.0 | ||
| particle block pink_wool ~ ~ ~ 0 0 0 1 20 | ||
|
|
||
| # オーナーの特定 | ||
| execute store result score $OwnerID Temporary run data get storage asset:context this.UserID | ||
| execute as @a if score @s UserID = $OwnerID Temporary run tag @s add 1AI.Owner | ||
|
|
||
| #ダメージ処理 | ||
| execute as @e[tag=1AI.HitEnemy,distance=..5,sort=nearest,limit=1] run function asset:object/1204.bouncy_ball/hit_entity/damage | ||
|
|
||
| # 同じMobの本体・当たり判定も反射先の候補から外す | ||
| execute store result score $HitEnemyID Temporary run data get storage asset:context this.HitEnemyID | ||
| execute as @e[type=#lib:living_without_player,tag=Enemy,tag=!ExtendedCollision,tag=!1AI.HitEnemy,distance=..12] if score @s MobUUID = $HitEnemyID Temporary run tag @s add 1AI.HitEnemy | ||
| execute as @e[type=#lib:living_without_player,tag=Enemy,tag=ExtendedCollision,tag=!1AI.HitEnemy,distance=..12] if score @s ForwardTargetMobUUID = $HitEnemyID Temporary run tag @s add 1AI.HitEnemy | ||
|
|
||
| # リセット | ||
| scoreboard players reset $OwnerID Temporary | ||
| scoreboard players reset $HitEnemyID Temporary | ||
| tag @a remove 1AI.Owner | ||
|
Comment on lines
+34
to
+37
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. これ、resetって関数あるんだしそれ呼び出せばいいんじゃない?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. resetは前のtick で当たってた時にreturnする処理で使っているのですが、そこにもろもろのreset処理を統合すると不要な処理が増えませんか? |
||
|
|
||
| #反射回数が0になったら玉を消す | ||
| execute if data storage asset:context this{ReflectionLimit:0} run function asset:object/call.m {method:"kill"} | ||
|
|
||
| #12m以内に敵がいるなら、向きを変える。そうでない時はランダムな向きに向く | ||
| execute if entity @e[type=#lib:living_without_player,tag=Enemy,tag=!1AI.HitEnemy,tag=!Uninterferable,distance=..12] run function asset:object/1204.bouncy_ball/hit_entity/reflect | ||
| execute unless entity @e[type=#lib:living_without_player,tag=Enemy,tag=!1AI.HitEnemy,tag=!Uninterferable,distance=..12] run function asset:object/1204.bouncy_ball/hit_entity/random_direction | ||
|
|
||
| #ヒットタグもリセット | ||
| tag @e[type=#lib:living_without_player,tag=1AI.HitEnemy,distance=..64] remove 1AI.HitEnemy | ||
30 changes: 30 additions & 0 deletions
30
Asset/data/asset/functions/object/1204.bouncy_ball/hit_entity/damage.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #> asset:object/1204.bouncy_ball/hit_entity/damage | ||
| # | ||
| # | ||
| # | ||
| # @within function asset:object/1204.bouncy_ball/hit_entity/ | ||
|
|
||
| #> private | ||
| # @private | ||
| #declare score_holder $Range | ||
|
|
||
| #ヒットした敵のIDを取得 | ||
| execute if entity @s[tag=!ExtendedCollision] store result storage asset:context this.HitEnemyID int 1 run scoreboard players get @s MobUUID | ||
| execute if entity @s[tag=ExtendedCollision] store result storage asset:context this.HitEnemyID int 1 run scoreboard players get @s ForwardTargetMobUUID | ||
|
|
||
| # ダメージ | ||
| 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 "None" | ||
| execute if data storage asset:context this.AdditionalMPHeal run data modify storage api: Argument.AdditionalMPHeal set from storage asset:context this.AdditionalMPHeal | ||
| execute if entity @a[tag=1AI.Owner] as @a[tag=1AI.Owner] run function api:damage/modifier | ||
| function api:damage/ | ||
| function api:damage/reset | ||
|
|
||
| # 射程を5だけ延長 | ||
| execute store result score $Range Temporary run data get storage asset:context this.RemainingRange 1 | ||
| scoreboard players operation $Range Temporary += $5 Const | ||
| execute store result storage asset:context this.RemainingRange int 1 run scoreboard players get $Range Temporary | ||
|
|
||
| # リセット | ||
| scoreboard players reset $Range Temporary |
19 changes: 19 additions & 0 deletions
19
Asset/data/asset/functions/object/1204.bouncy_ball/hit_entity/random_direction.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #> asset:object/1204.bouncy_ball/hit_entity/random_direction | ||
| # | ||
| # | ||
| # | ||
| # @within function asset:object/1204.bouncy_ball/hit_entity/ | ||
|
|
||
| #> SpreadLib | ||
| # @private | ||
| #declare tag SpreadMarker | ||
|
|
||
| # 拡散させるEntityを召喚する | ||
| summon marker ~ ~ ~ {Tags:["SpreadMarker"]} | ||
| # 拡散 | ||
| data modify storage lib: Argument.Bounds set value [[1d,1d],[0.4d,0.4d],[1d,1d]] | ||
| execute as @e[type=marker,tag=SpreadMarker,distance=..3,limit=1] at @s run function lib:spread_entity/ | ||
| # 拡散させたEntityの位置に向く | ||
| tp @s ^ ^ ^ facing entity @e[type=marker,tag=SpreadMarker,distance=..3,limit=1] feet | ||
| # リセット | ||
| kill @e[type=marker,tag=SpreadMarker,distance=..3] |
10 changes: 10 additions & 0 deletions
10
Asset/data/asset/functions/object/1204.bouncy_ball/hit_entity/reflect.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #> asset:object/1204.bouncy_ball/hit_entity/reflect | ||
| # | ||
| # | ||
| # | ||
| # @within function asset:object/1204.bouncy_ball/hit_entity/ | ||
|
|
||
| #反射回数を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=Enemy,tag=!1AI.HitEnemy,tag=!Uninterferable,distance=..12,sort=random,limit=1] eyes |
9 changes: 9 additions & 0 deletions
9
Asset/data/asset/functions/object/1204.bouncy_ball/hit_entity/reset.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #> asset:object/1204.bouncy_ball/hit_entity/reset | ||
| # | ||
| # | ||
| # | ||
| # @within function asset:object/1204.bouncy_ball/hit_entity/ | ||
|
|
||
| # リセット | ||
| scoreboard players reset $HitEnemyID Temporary | ||
| tag @e[type=#lib:living_without_player,distance=..5] remove 1AI.HitEnemy |
11 changes: 11 additions & 0 deletions
11
Asset/data/asset/functions/object/1204.bouncy_ball/kill/.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #> asset:object/1204.bouncy_ball/kill/ | ||
| # | ||
| # 継承先などから実行される処理 | ||
| # | ||
| # @within asset:object/alias/1204/kill | ||
|
|
||
| # 演出 | ||
| playsound tsb_sounds:rifle_shot neutral @a ~ ~ ~ 1 1.8 | ||
|
|
||
| # 消滅 | ||
| kill @s |
8 changes: 8 additions & 0 deletions
8
Asset/data/asset/functions/object/1204.bouncy_ball/recursive/.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #> asset:object/1204.bouncy_ball/recursive/ | ||
| # | ||
| # 継承先などから実行される処理 | ||
| # | ||
| # @within asset:object/alias/1204/recursive | ||
|
|
||
| # 演出 | ||
| particle dust 0.804 0.31 1 1 |
28 changes: 28 additions & 0 deletions
28
Asset/data/asset/functions/object/1204.bouncy_ball/register.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #> asset:object/1204.bouncy_ball/register | ||
| # | ||
| # Objectのデータを指定 | ||
| # | ||
| # @within function asset:object/alias/1204/register | ||
|
|
||
| # 継承(オプション) | ||
| data modify storage asset:object Extends append value 1 | ||
| 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 1204 | ||
| # フィールド(オプション) | ||
| # data modify storage asset:object Field.myValue set value | ||
| data modify storage asset:object Field.Speed set value 2 | ||
| data modify storage asset:object Field.Range set value 60 | ||
| data modify storage asset:object Field.MovePerStep set value 0.4 | ||
| data modify storage asset:object Field.Damage set value 1 | ||
| data modify storage asset:object Field.AdditionalMPHeal set value 1 | ||
| data modify storage asset:object Field.UserID set value -1 | ||
| data modify storage asset:object Field.ReflectionLimit set value 1 | ||
| data modify storage asset:object Field.HitEnemyID set value -1 |
11 changes: 11 additions & 0 deletions
11
Asset/data/asset/functions/object/1204.bouncy_ball/summon/.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #> asset:object/1204.bouncy_ball/summon/ | ||
| # | ||
| # Object召喚処理の呼び出し時に実行されるfunction | ||
| # | ||
| # @within asset:object/alias/1204/summon | ||
|
|
||
| # 召喚 | ||
| execute as 0-0-0-0-0 in minecraft:overworld positioned as @s run tp @s ~ ~ ~ ~ ~ | ||
| data modify storage asset:temp Args.Rotation set from entity 0-0-0-0-0 Rotation | ||
| function asset:object/1204.bouncy_ball/summon/m with storage asset:temp Args | ||
| data remove storage asset:temp Args |
8 changes: 8 additions & 0 deletions
8
Asset/data/asset/functions/object/1204.bouncy_ball/summon/m.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #> asset:object/1204.bouncy_ball/summon/m | ||
| # | ||
| # | ||
| # | ||
| # @within function asset:object/1204.bouncy_ball/summon/ | ||
|
|
||
| # 元となるEntityを召喚する | ||
| $summon item_display ~ ~ ~ {Rotation:$(Rotation),Tags:["ObjectInit"],teleport_duration:1,billboard:"center",item:{id:"minecraft:potion",Count:1b,tag:{CustomModelData:20234,CustomPotionColor:16754647}}} |
8 changes: 8 additions & 0 deletions
8
Asset/data/asset/functions/object/alias/1204/detect_hit_block.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #> asset:object/alias/1204/detect_hit_block | ||
| # | ||
| # メソッド処理のエイリアス | ||
| # | ||
| # @within asset_manager:object/call_method/run_method.m | ||
|
|
||
| # 元のメソッド処理を呼び出す | ||
| function asset:object/1204.bouncy_ball/detect_hit_block/ |
8 changes: 8 additions & 0 deletions
8
Asset/data/asset/functions/object/alias/1204/detect_hit_entity.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #> asset:object/alias/1204/detect_hit_entity | ||
| # | ||
| # メソッド処理のエイリアス | ||
| # | ||
| # @within asset_manager:object/call_method/run_method.m | ||
|
|
||
| # 元のメソッド処理を呼び出す | ||
| function asset:object/1204.bouncy_ball/detect_hit_entity/ |
8 changes: 8 additions & 0 deletions
8
Asset/data/asset/functions/object/alias/1204/hit_block.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #> asset:object/alias/1204/hit_block | ||
| # | ||
| # メソッド処理のエイリアス | ||
| # | ||
| # @within asset_manager:object/call_method/run_method.m | ||
|
|
||
| # 元のメソッド処理を呼び出す | ||
| function asset:object/1204.bouncy_ball/hit_block/ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.HitEnemyIDはdamage.mcfunction:12-13でしか更新されず、壁での反射やランダムな方向転換では元に戻りません。そのため、この判定は直前の tick に限らず、最後にダメージを与えた敵に次に当たったときは常に成立します。近くに敵が1体しかいない場面では、壁で跳ね返って同じ敵に戻ってきても、2回目以降はダメージを与えずに通り抜けます。Mizame さんは Lapis-LJA さんのコメントへの返信で、この処理を「前のtick で当たってた時にreturnする処理」と説明しています。意図が直前の tick の重なりを除くことであれば、今の実装はそれより広い範囲を除いています。同じ敵への連続ヒットをボールが消えるまで防ぐ仕様であれば、このままで問題ありません。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正を確認しました。1ee2e175aで、ブロックで跳ね返るたびに
HitEnemyIDを-1に戻すようになったので、壁で跳ね返ったボールは直前に当たった敵にもまた当たります。検証用サーバー(Minecraft 1.20.4、Asset 1ee2e17、TheSkyBlessing bfb8eb9de)で、ハスクに当たった直後の状態(
HitEnemyIDがそのハスクのMobUUID)のボールを召喚し、ハスクと反対側の壁へ向けて飛ばすと、壁で跳ね返ったあとにハスクに当たりました。壁がなく、同じ状態でハスクへ直接飛ばした場合は、これまでどおり素通りしました。なお、近くにほかの敵がいないときのランダムな方向転換では反射回数が減らないため、3×3×3の石の箱に閉じ込めたハスクに撃つと、1発で18回当たり、反射回数は35のままでした。意図どおりであれば、このままで問題ありません。