Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 6 additions & 14 deletions Asset/data/asset/functions/mob/0420.astro_blaze/attack/.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,13 @@
execute unless data storage asset:context Attack{IsVanilla:true} run return fail

# 演出
execute as @p[tag=Victim] at @s run particle dust 0.975 0.25 0.2 1 ~ ~ ~ 0.5 1 0.5 0 30
execute at @p[tag=Victim] run particle dust 0.975 0.25 0.2 1 ~ ~ ~ 0.5 1 0.5 0 30

# ダメージ
# 引数の設定
# 与えるダメージ
data modify storage api: Argument.Damage set value 40.0f
# 第一属性
data modify storage api: Argument.AttackType set value "Magic"
# 第二属性
data modify storage api: Argument.ElementType set value "Fire"
# デスログ
data modify storage api: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sによって丸焦げにされてしまった","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
# 補正functionを実行
data modify storage api: Argument.Damage set from storage asset:context this.Damage.Vanilla
data modify storage api: Argument.AttackType set value "Magic"
data modify storage api: Argument.ElementType set value "Fire"
data modify storage api: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sによって丸焦げにされてしまった","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
function api:damage/modifier
# ダメージを与える
execute as @p[tag=Victim] at @s run function api:damage/
# リセット
execute as @p[tag=Victim] run function api:damage/
function api:damage/reset
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,6 @@
# 雷倍率 (float) (オプション)
data modify storage asset:mob Resist.Thunder set value 0.6
# フィールド
# data modify storage asset:mob Field.myValue set value
data modify storage asset:mob Field.Damage.Vanilla set value 40f
data modify storage asset:mob Field.Damage.Object set value 18f
data modify storage asset:mob Field.Bullet set value 0
20 changes: 7 additions & 13 deletions Asset/data/asset/functions/mob/0420.astro_blaze/tick/.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,16 @@
# 移動
execute if score @s General.Mob.Tick matches 40 run function asset:mob/0420.astro_blaze/tick/jump

# 射線上にプレイヤーが存在しない場合、スコアを戻す
execute if score @s General.Mob.Tick matches 100 unless function asset:mob/0420.astro_blaze/tick/check_through/ run scoreboard players set @s General.Mob.Tick 0

# 発射合図
execute if score @s General.Mob.Tick matches 100 run function asset:mob/0420.astro_blaze/tick/pre_bullet
execute if score @s General.Mob.Tick matches 120 run function asset:mob/0420.astro_blaze/tick/pre_bullet
execute if score @s General.Mob.Tick matches 140 run function asset:mob/0420.astro_blaze/tick/pre_bullet

# 発射
execute if score @s General.Mob.Tick matches 162 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 164 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 166 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 168 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 170 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 172 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 174 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 176 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 178 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 180 run function asset:mob/0420.astro_blaze/tick/fire
# 弾数をセット
execute if score @s General.Mob.Tick matches 140 run function asset:mob/0420.astro_blaze/tick/set_bullet

# 一定以上ならスコアをリセットする
execute if score @s General.Mob.Tick matches 200 run scoreboard players set @s General.Mob.Tick 0
# 弾数が0でなければ発射
execute if score @s General.Mob.Tick matches 162.. unless data storage asset:context this{Bullet:0} run function asset:mob/0420.astro_blaze/tick/shoot/
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#> asset:mob/0420.astro_blaze/tick/check_through/
#
#
#
# @within function asset:mob/0420.astro_blaze/tick/

# 初期化
data modify storage asset:context this.Success set value false

# 近くのプレイヤーに射線が通っているか?
execute as @a[tag=!PlayerShouldInvulnerable,distance=..20,sort=nearest] facing entity @s eyes run function asset:mob/0420.astro_blaze/tick/check_through/recursive

# 一度も成功してないなら失敗
execute unless data storage asset:context this{Success:true} run return 0

# 成功
return 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#> asset:mob/0420.astro_blaze/tick/check_through/recursive
#
# 再帰で自身の位置に辿り着けるか?
#
# @within function
# asset:mob/0420.astro_blaze/tick/check_through/
# asset:mob/0420.astro_blaze/tick/check_through/recursive

# 既に成功してるならreturn
execute if data storage asset:context this{Success:true} run return fail

# 自身に接触したら成功判定を返す
execute positioned ~-0.5 ~-0.5 ~-0.5 if entity @s[dx=0] run function asset:mob/0420.astro_blaze/tick/check_through/success

# 再帰
execute positioned ^ ^ ^0.5 if block ~ ~ ~ #lib:no_collision/ run function asset:mob/0420.astro_blaze/tick/check_through/recursive
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#> asset:mob/0420.astro_blaze/tick/check_through/success
#
# 成功
#
# @within function asset:mob/0420.astro_blaze/tick/check_through/recursive

# 成功判定
data modify storage asset:context this.Success set value true

# 自身のUserIDをFieldへ入れておく
execute store result storage asset:context this.TargetID int 1 run scoreboard players get @s UserID

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#> asset:mob/0420.astro_blaze/tick/set_bullet
#
# 弾数を設定する
#
# @within function asset:mob/0420.astro_blaze/tick/

#> Private
# @private
#declare score_holder $Difficulty

# 難易度比例で弾数を設定する
# 4+2N
function api:global_vars/get_difficulty
execute store result score $Difficulty Temporary run data get storage api: Return.Difficulty 2
execute store result storage asset:context this.Bullet int 1 run scoreboard players add $Difficulty Temporary 4
scoreboard players reset $Difficulty Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#> asset:mob/0420.astro_blaze/tick/shoot/
#
#
#
# @within function asset:mob/0420.astro_blaze/tick/

#> Private
# @private
#declare score_holder $Interval

# 発射
scoreboard players operation $Interval Temporary = @s General.Mob.Tick
scoreboard players operation $Interval Temporary %= $2 Const
execute if score $Interval Temporary matches 0 run function asset:mob/0420.astro_blaze/tick/shoot/spread.m with storage asset:context this
scoreboard players reset $Interval Temporary

# 弾数が0ならスコア初期化
execute if data storage asset:context this{Bullet:0} run scoreboard players set @s General.Mob.Tick 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#> asset:mob/0420.astro_blaze/tick/shoot/spread.m
#
#
#
# @within function asset:mob/0420.astro_blaze/tick/shoot/

#> Tags
# @private
#declare tag BO.Marker

# まず、ターゲットがいなくなった場合、弾を0にしてreturnする
$execute unless entity @p[tag=!PlayerShouldInvulnerable,scores={UserID=$(TargetID)},distance=..35] run return run data modify storage asset:context this.Bullet set value 0

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

# Markerを召喚
execute positioned ~ ~1 ~ run summon marker ~ ~ ~ {Tags:["BO.Marker"]}

# 前方拡散設定
data modify storage lib: Argument.Distance set value 8.0
data modify storage lib: Argument.Spread set value 1.5

# ターゲット方向に対して前方拡散を実行する
$execute as @e[type=marker,tag=BO.Marker,distance=..3] at @s facing entity @p[scores={UserID=$(TargetID)},distance=..35] eyes rotated ~ ~2.5 run function lib:forward_spreader/circle

# 発射
execute positioned ~ ~1 ~ facing entity @e[type=marker,tag=BO.Marker,distance=..15,limit=1] feet run function asset:mob/0420.astro_blaze/tick/shoot/summon

# マーカーを戻してあげる
kill @e[type=marker,tag=BO.Marker,distance=..15,limit=1]
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#> asset:mob/0420.astro_blaze/tick/summon
#> asset:mob/0420.astro_blaze/tick/shoot/summon
#
# 弾幕召喚
#
# @within function asset:mob/0420.astro_blaze/tick/fire
#
# @within function asset:mob/0420.astro_blaze/tick/shoot/spread.m

# オーバーライドを設定
data modify storage api: Argument.FieldOverride.Damage set from storage asset:context this.Damage.Object
execute store result storage api: Argument.FieldOverride.MobUUID int 1 run scoreboard players get @s MobUUID

# 召喚
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,14 @@
#
# @within asset:object/alias/2171/hit_entity

# 引数の設定
# 与えるダメージ
data modify storage api: Argument.Damage set value 18.0f
# 第一属性
data modify storage api: Argument.AttackType set value "Physical"
# 第二属性
data modify storage api: Argument.ElementType set value "Fire"
# デスログ
data modify storage api: Argument.DeathMessage append value '[{"translate": "%1$sの身体は%2$sの弾幕に貫かれてしまった","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
# 補正functionを実行
data modify storage api: Argument.MobUUID set from storage asset:context this.MobUUID
function api:damage/modifier_manual
# ダメージを与える
execute positioned ~-0.5 ~-0.5 ~-0.5 as @p[tag=!PlayerShouldInvulnerable,dx=0] run function api:damage/
# リセット
# ダメージ
data modify storage api: Argument.Damage set from storage asset:context this.Damage
data modify storage api: Argument.AttackType set value "Physical"
data modify storage api: Argument.ElementType set value "Fire"
data modify storage api: Argument.DeathMessage append value '[{"translate": "%1$sの身体は%2$sの弾幕に貫かれてしまった","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
data modify storage api: Argument.MobUUID set from storage asset:context this.MobUUID
function api:damage/modifier_manual
execute positioned ~-0.5 ~-0.5 ~-0.5 as @p[tag=!PlayerShouldInvulnerable,dx=0] run function api:damage/
function api:damage/reset

# 消失
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@
data modify storage asset:object Extends append value 1
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 2171
# フィールド(オプション)
data modify storage asset:object Field set value {Speed:2,Range:64,MovePerStep:0.3}
data modify storage asset:object Field.Speed set value 2
data modify storage asset:object Field.Range set value 64
data modify storage asset:object Field.MovePerStep set value 0.3
data modify storage asset:object Field.Damage set value 1
data modify storage asset:object Field.MobUUID set value -1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# @within asset:object/alias/2171/tick

# パーティクル
particle flame ~ ~ ~ 0.2 0.2 0.2 0.05 1 force @a[distance=..32]
execute if predicate lib:random_pass_per/15 run particle flame ~ ~ ~ 0.05 0.05 0.05 0.025 1 force @a[distance=..32]
particle minecraft:dust 1 0.560 0.150 1 ~ ~ ~ 0.2 0.2 0.2 0 1 force @a[distance=..32]

# 継承元の処理
Expand Down