Skip to content

Commit

Permalink
弾幕を消す処理をキレイに
Browse files Browse the repository at this point in the history
  • Loading branch information
EllaCoat committed Aug 25, 2024
1 parent df8da55 commit 04a4098
Show file tree
Hide file tree
Showing 33 changed files with 341 additions and 43 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
scoreboard players operation $B1.Temp B1.UUID = @s MobUUID

# 元となるMobを召喚する
summon item_display ~ ~ ~ {Tags:["B1.Temp","B1.Bullet"],billboard:"center",teleport_duration:1,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[0.5f,0.5f,0.5f]},item:{id:"leather_horse_armor",Count:1b,tag:{display:{color:65514},CustomModelData:20370}}}
summon item_display ~ ~ ~ {Tags:["B1.Temp","B1.Bullet","AllowProcessingCommonTag","AutoKillWhenDiePassenger"],billboard:"center",teleport_duration:1,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[0.5f,0.5f,0.5f]},item:{id:"leather_horse_armor",Count:1b,tag:{display:{color:65514},CustomModelData:20370}},Passengers:[{id:"area_effect_cloud",Particle:"block air",Radius:0f,Duration:2}]}

# 初期化処理
tp @e[type=item_display,tag=B1.Temp,distance=..0.01] ^ ^ ^ ~ ~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
function lib:damage/reset
tag @a[tag=B1.Landing,distance=..3] remove B1.Landing

# Age弄り
execute on passengers run data modify entity @s Age set value 0

# キル
execute if score @s B1.Tick matches 61 run kill @s
execute at @s unless block ^ ^ ^ #lib:no_collision run kill @s
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# 演出
particle explosion_emitter ~ ~1 ~ 0 0 0 0 1 force @a[distance=..32]
particle witch ~ ~1 ~ 2 2 2 1 100 force @a[distance=..32]
particle dust 0 0.75 100000000 2 ~ ~1 ~ 2 2 2 0 100 force @a[distance=..32]
playsound entity.generic.explode hostile @a[distance=..32] ~ ~ ~ 2 1 0
playsound entity.generic.explode hostile @a[distance=..32] ~ ~ ~ 2 1.01 0

Expand All @@ -19,6 +19,8 @@
data modify storage lib: Argument.Damage set value 45.0f
# 第一属性
data modify storage lib: Argument.AttackType set value "Magic"
# 第二属性
data modify storage lib: Argument.ElementType set value "Water"
# デスログ
data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sの爆発によって%2$sは消し飛ばされた","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
# 補正functionを実行
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# 干渉可能か否か (boolean)
data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
data modify storage asset:mob Name set value '{"text":"爆発の魔導書","color":"#FF8800"}'
data modify storage asset:mob Name set value '{"text":"爆発の魔導書","color":"#00FFBB"}'
# Mobの説明文 (TextComponentString[]) (オプション)
# data modify storage asset:mob Lore set value
# 武器
Expand All @@ -29,7 +29,7 @@
# data modify storage asset:mob WeaponDropChances set value
# 防具
# 頭 (Compound(Item)) (オプション)
data modify storage asset:mob Armor.Head set value {id:"leather_horse_armor",Count:1b,tag:{CustomModelData:20138,display:{color:16746496}}}
data modify storage asset:mob Armor.Head set value {id:"leather_horse_armor",Count:1b,tag:{CustomModelData:20138,display:{color:65467}}}
# 胴 (Compound(Item)) (オプション)
# data modify storage asset:mob Armor.Chest set value
# 脚 (Compound(Item)) (オプション)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:mob/0401.darkness_spellbook/_/death
#
# Mobの死亡時に実行されるfunction
#
# @within tag/function asset:mob/death

execute if data storage asset:context {id:401} run function asset:mob/0401.darkness_spellbook/death/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:mob/0401.darkness_spellbook/_/init
#
# Mobの召喚時に実行されるfunction
#
# @within tag/function asset:mob/initialize

execute if data storage asset:context {id:401} run function asset:mob/0401.darkness_spellbook/init/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:mob/0401.darkness_spellbook/_/register
#
#
#
# @within tag/function asset:mob/register

execute if data storage asset:context {id:401} run function asset:mob/0401.darkness_spellbook/register
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:mob/0401.darkness_spellbook/_/summon
#
#
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:401} run function asset:mob/0401.darkness_spellbook/summon/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:mob/0401.darkness_spellbook/_/tick
#
# Mobが生きている間毎tick実行されるfunction
#
# @within tag/function asset:mob/tick

execute if data storage asset:context {id:401} run function asset:mob/0401.darkness_spellbook/tick/
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#> asset:mob/0401.darkness_spellbook/_index.d
# @private

#> tag
# @within function asset:mob/0401.darkness_spellbook/**
#declare tag B5.Temp
#declare tag B5.Bullet
#declare tag B5.Landing
#declare tag B5.Marker

#> score
# @within function asset:mob/0401.darkness_spellbook/**
#declare score_holder $B5.Temp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#> asset:mob/0401.darkness_spellbook/ai/bullet/0.summon
#
# 弾幕 召喚
#
# @within function asset:mob/0401.darkness_spellbook/tick/

# UUIDスコア移し
scoreboard players operation $B5.Temp B5.UUID = @s MobUUID

# 元となるMobを召喚する
summon item_display ~ ~ ~ {Tags:["B5.Temp","B5.Bullet","AllowProcessingCommonTag","AutoKillWhenDiePassenger"],billboard:"center",teleport_duration:1,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[0f,0f,0f]},item:{id:"leather_horse_armor",Count:1b,tag:{display:{color:848},CustomModelData:20370}},Passengers:[{id:"area_effect_cloud",Particle:"block air",Radius:0f,Duration:2}]}

# 初期化処理
execute positioned ~ ~1.5 ~ facing entity @p[tag=!PlayerShouldInvulnerable,distance=..100] eyes run tp @e[type=item_display,tag=B5.Temp,distance=..2] ^ ^ ^ ~ ~
execute as @e[type=item_display,tag=B5.Temp,distance=..2] at @s run function asset:mob/0401.darkness_spellbook/ai/bullet/1.init

# リセット
scoreboard players reset $B5.Temp B5.UUID

# 時間リセット
execute store result score @s B5.Tick run random value 0..40
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset:mob/0401.darkness_spellbook/ai/bullet/1.init
#
# 初期化処理
#
# @within function asset:mob/0401.darkness_spellbook/ai/bullet/0.summon

# スコア初期化
scoreboard players set @s B5.Tick 0

# UUIDスコア紐づけ
scoreboard players operation @s B5.UUID = $B5.Temp B5.UUID

# 発射音
playsound block.sculk_sensor.clicking hostile @a ~ ~ ~ 0.8 0 0
playsound ogg:block.amethyst.step6 hostile @a[distance=..32] ~ ~ ~ 1 2 0
playsound block.respawn_anchor.deplete hostile @a[distance=..32] ~ ~ ~ 1 2 0

# リセット
tag @s remove B5.Temp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#> asset:mob/0401.darkness_spellbook/ai/bullet/2.tick
#
# 弾幕 Tick処理
#
# @within function asset:mob/0401.darkness_spellbook/tick/

# スコア上昇
scoreboard players add @s B5.Tick 1

# TP
tp @s ^ ^ ^0.3 ~ ~

# パーティクル
particle fishing ~ ~ ~ 0.2 0.2 0.2 0.05 1 force @a[distance=..32]
particle minecraft:dust 0.07 0.10 0.55 1 ~ ~ ~ 0.2 0.2 0.2 0 1 force @a[distance=..32]

# 暗闇を与える
execute at @s positioned ~-0.5 ~-0.5 ~-0.5 as @a[tag=!PlayerShouldInvulnerable,dx=0] run tag @s add B5.Landing
execute as @a[tag=B5.Landing,distance=..3] run function asset:mob/0401.darkness_spellbook/ai/bullet/3.cast

# タグ付け
execute if entity @a[tag=B5.Landing,distance=..3] run tag @s add B5.Landing

# リセット
tag @a[tag=B5.Landing,distance=..3] remove B5.Landing

# Age弄り
execute on passengers run data modify entity @s Age set value 0

# 表示
execute if score @s B5.Tick matches 3 run data modify entity @s transformation.scale set value [0.5f,0.5f,0.5f]

# キル
execute if score @s B5.Tick matches 121 run kill @s
execute at @s unless block ^ ^ ^ #lib:no_collision run kill @s
execute if entity @s[tag=B5.Landing] run kill @s
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:mob/0401.darkness_spellbook/ai/bullet/3.cast
#
# 着弾処理
#
# @within function asset:mob/0401.darkness_spellbook/ai/bullet/2.tick


# 暗闇エフェクト付与
data modify storage api: Argument set value {ID:124,Duration:100}
function api:entity/mob/effect/give
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#> asset:mob/0401.darkness_spellbook/death/
#
# Mobの死亡時の処理
#
# @within function asset:mob/0401.darkness_spellbook/_/death

# 死ぬ音
playsound minecraft:entity.zombie.break_wooden_door hostile @a ~ ~ ~ 0.6 0.7

# キル処理
execute as @e[type=marker,tag=B5.Marker,distance=..5] on vehicle if entity @s[nbt={Health:0f}] on passengers run function asset:mob/0401.darkness_spellbook/death/kill
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#> asset:mob/0401.darkness_spellbook/death/kill
#
# キル処理
#
# @within function asset:mob/0401.darkness_spellbook/death/

# 弾幕キル
execute on vehicle run scoreboard players operation $B5.Temp B5.UUID = @s MobUUID
execute as @e[type=marker,tag=B5.Marker,distance=..100] if score @s B5.UUID = $B5.Temp B5.UUID run kill @s

# キル
kill @s

# リセット
scoreboard players reset $B5.Temp B5.UUID
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#> asset:mob/0401.darkness_spellbook/init/
#
# Mob召喚時のInit処理
#
# @within function asset:mob/0401.darkness_spellbook/_/init

# スコア設定
scoreboard players set @s B5.Tick 0

# 見た目召喚
summon marker ~ ~ ~ {Tags:["B5.Marker","B5.Temp","AllowProcessingCommonTag","AutoKillWhenDieVehicle"]}

# 乗せる
ride @e[type=marker,tag=B5.Marker,tag=B5.Temp,distance=..0.01,limit=1] mount @s

# タグ外し
execute on passengers run tag @s remove B5.Temp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:mob/0401.darkness_spellbook/load
#
# MOBに利用するスコアボード等の初期化処理
#
# @within tag/function asset:mob/load

#> 定義類はここに
# @within function asset:mob/0401.darkness_spellbook/**
scoreboard objectives add B5.Tick dummy
scoreboard objectives add B5.UUID dummy
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#> asset:mob/0401.darkness_spellbook/register
#
# Mobのデータを指定
#
# @within function asset:mob/0401.darkness_spellbook/_/register

# 継承 (int) (オプション)
# data modify storage asset:mob Extends append value
# function asset:mob/extends

# 他のモブに継承されることを許可するか (boolean) (オプション)
# data modify storage asset:mob ExtendsSafe set value true
# ID (int)
data modify storage asset:mob ID set value 401
# Type (string) Wikiを参照
data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
data modify storage asset:mob Name set value '{"text":"爆発の魔導書","color":"#000350"}'
# Mobの説明文 (TextComponentString[]) (オプション)
# data modify storage asset:mob Lore set value
# 武器
# メインハンド (Compound(Item)) (オプション)
# data modify storage asset:mob Weapon.Mainhand set value
# オフハンド (Compound(Item)) (オプション)
# data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
# data modify storage asset:mob WeaponDropChances set value
# 防具
# 頭 (Compound(Item)) (オプション)
data modify storage asset:mob Armor.Head set value {id:"leather_horse_armor",Count:1b,tag:{CustomModelData:20138,display:{color:848}}}
# 胴 (Compound(Item)) (オプション)
# data modify storage asset:mob Armor.Chest set value
# 脚 (Compound(Item)) (オプション)
# data modify storage asset:mob Armor.Legs set value
# 足 (Compound(Item)) (オプション)
# data modify storage asset:mob Armor.Feet set value
# 防具ドロップ率 ([float, float]) (オプション)
# data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
data modify storage asset:mob Health set value 800
# 攻撃力 (double) (オプション)
# data modify storage asset:mob AttackDamage set value
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
data modify storage asset:mob Defense set value 0
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
# data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
# data modify storage asset:mob Speed set value
# 索敵範囲 (double) (オプション)
# data modify storage asset:mob FollowRange set value
# ノックバック耐性 (double) (オプション)
# data modify storage asset:mob KnockBackResist set value
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
# 物理倍率 (float) (オプション)
data modify storage asset:mob Resist.Physical set value 1
# 魔法倍率 (float) (オプション)
data modify storage asset:mob Resist.Magic set value 0
# 火倍率 (float) (オプション)
data modify storage asset:mob Resist.Fire set value 1
# 水倍率 (float) (オプション)
data modify storage asset:mob Resist.Water set value 1
# 雷倍率 (float) (オプション)
data modify storage asset:mob Resist.Thunder set value 1

# フィールド
# data modify storage asset:mob Field set value {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:mob/0401.darkness_spellbook/summon/
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within asset:mob/0401.darkness_spellbook/_/summon

# 元となるMobを召喚する
summon zombie ~ ~ ~ {NoAI:1b,Silent:1b,Tags:["MobInit","AlwaysInvisible"],DeathLootTable:"asset:mob/death/0401.darkness_spellbook"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:mob/0401.darkness_spellbook/summon/debug
#
# モブの動作チェック用の召喚処理 使い終わったら消してもいいかも
#
# @user
# @private

# モブを召喚
data modify storage api: Argument.ID set value 401
function api:mob/summon
Loading

0 comments on commit 04a4098

Please sign in to comment.