Skip to content
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

[Object2078] ダークサモナーの魔法を作成 #372

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
execute positioned ~ ~1.68 ~ unless block ^ ^ ^0.2 #lib:no_collision at @s run tp @s ~ ~ ~ ~45 ~-45

# スコア
scoreboard players add @s 7D.Tick 1
scoreboard players add @s General.Mob.Tick 1

# 消える
execute if entity @s[scores={7D.Tick=200..}] run function asset:mob/0265.dark_familiar/tick/kill
execute if entity @s[scores={General.Mob.Tick=200..}] run function asset:mob/0265.dark_familiar/tick/kill

# 一定間隔で攻撃 召喚してすぐは攻撃しないようにしている
scoreboard players operation $Interval Temporary = @s 7D.Tick
scoreboard players operation $Interval Temporary = @s General.Mob.Tick
scoreboard players operation $Interval Temporary %= $40 Const
execute if score $Interval Temporary matches 0 run function asset:mob/0265.dark_familiar/tick/shoot
execute if score $Interval Temporary matches 0 anchored eyes positioned ^ ^ ^ summon marker run function asset:mob/0265.dark_familiar/tick/shoot
scoreboard players reset $Interval Temporary
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,42 @@
#
# @within function asset:mob/0265.dark_familiar/tick/

# 召喚
data modify storage api: Argument.ID set value 266
execute anchored eyes positioned ^ ^ ^ run function api:mob/summon
#> Private
# @private
#declare tag SpreadMarker

# サウンド
playsound minecraft:entity.shulker_bullet.hurt hostile @a ~ ~ ~ 1.5 2
playsound minecraft:block.amethyst_cluster.break hostile @a ~ ~ ~ 1.5 1.5
playsound minecraft:entity.vex.ambient hostile @a ~ ~ ~ 1.5 2

# プレイヤーの方を見る
tp @s ~ ~ ~ facing entity @p feet

# 拡散させるEntityを召喚する
summon marker ~ ~ ~ {Tags:["SpreadMarker"]}

# ステータス設定
data modify storage lib: Argument.Distance set value 5
data modify storage lib: Argument.Spread set value 1

# 拡散
execute facing entity @p[gamemode=!spectator,distance=..30] eyes as @e[type=marker,tag=SpreadMarker,limit=1] run function lib:forward_spreader/circle
execute facing entity @e[type=marker,tag=SpreadMarker,limit=1] eyes run tp @s ~ ~ ~ ~ ~

# マーカーをkill
kill @e[type=marker,tag=SpreadMarker]

# 速度設定
# ハード以上なら確率で低速になる
data modify storage api: Argument.FieldOverride.Speed set value 2
execute if predicate api:global_vars/difficulty/min/hard if predicate lib:random_pass_per/50 run data modify storage api: Argument.FieldOverride.Speed set value 1

# 召喚
data modify storage api: Argument.ID set value 2078
data modify storage api: Argument.FieldOverride.Rotation set from entity @s Rotation
execute store result storage api: Argument.FieldOverride.MobUUID int 1 run scoreboard players get @e[type=husk,tag=this,distance=..3,limit=1] MobUUID
function api:object/summon

# 消滅
kill @s

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions Asset/data/asset/functions/mob/alias/266/init.mcfunction

This file was deleted.

4 changes: 0 additions & 4 deletions Asset/data/asset/functions/mob/alias/266/register.mcfunction

This file was deleted.

4 changes: 0 additions & 4 deletions Asset/data/asset/functions/mob/alias/266/summon.mcfunction

This file was deleted.

4 changes: 0 additions & 4 deletions Asset/data/asset/functions/mob/alias/266/tick.mcfunction

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#> asset:object/2078.dark_bullet/hit_entity/
#
# 継承先などから実行される処理
#
# @within asset:object/alias/2078/hit_entity

# ダメージ
data modify storage api: Argument.Damage set value 20.0f
data modify storage api: Argument.AttackType set value "Magic"
data modify storage api: Argument.ElementType set value "None"
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

# 消滅
kill @s
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#> asset:object/2078.dark_bullet/init/
#
# Objectのinit時の処理
#
# @within asset:object/alias/2078/init

# スピード関連の設定
# Speedはフィールドで設定する
# data modify storage asset:context this.Speed set value 0
data modify storage asset:context this.Range set value 128
data modify storage asset:context this.MovePerStep set value 0.4

# 継承
function asset:object/super.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/2078.dark_bullet/recursive/
#
# 継承先などから実行される処理
#
# @within asset:object/alias/2078/recursive

# パーティクル
particle minecraft:witch ~ ~ ~ 0 0 0 0 1 normal @a
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#> asset:object/2078.dark_bullet/register
#
# Objectのデータを指定
#
# @within function asset:object/alias/2078/register

# 継承(オプション)
data modify storage asset:object Extends append value 1
function asset:object/extends
# 他のモブに継承されることを許可するか (boolean) (オプション)
# data modify storage asset:object ExtendsSafe set value
# 継承されることを前提とした、抽象的なオブジェクトであるかどうか(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 2078
# フィールド(オプション)
# data modify storage asset:object Field.myValue set value
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:object/2078.dark_bullet/summon/.m
#
# マクロを使って召喚する
#
# @input args:
# Rotation : double @ 2
# @within function asset:object/2078.dark_bullet/summon/

# 元となるEntityを召喚する
$summon item_display ~ ~ ~ {Tags:["ObjectInit"],Rotation:$(Rotation),teleport_duration:1,item:{id:"minecraft:stick",Count:1b,tag:{CustomModelData:20216}},billboard:center,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[0.5f,0.5f,0.5f]}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/2078.dark_bullet/summon/
#
# Object召喚処理の呼び出し時に実行されるfunction
#
# @within asset:object/alias/2078/summon

# 元となるEntityを召喚する
function asset:object/2078.dark_bullet/summon/.m with storage asset:context this
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:object/2078.dark_bullet/summon/debug
#
# 動作チェック用の召喚処理 使い終わったら消してもいいかも
#
# @user
# @private

# 召喚
data modify storage api: Argument.ID set value 2078
function api:object/summon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/alias/2078/hit_entity
#
# メソッド処理のエイリアス
#
# @within asset_manager:object/tick/tick.m

# 元のメソッド処理を呼び出す
function asset:object/2078.dark_bullet/hit_entity/
8 changes: 8 additions & 0 deletions Asset/data/asset/functions/object/alias/2078/init.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/alias/2078/init
#
# Init処理のエイリアス
#
# @within asset_manager:object/init/init.m

# 元のInit処理を呼び出す
function asset:object/2078.dark_bullet/init/
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/alias/2078/recursive
#
# メソッド処理のエイリアス
#
# @within asset_manager:object/tick/tick.m

# 元のメソッド処理を呼び出す
function asset:object/2078.dark_bullet/recursive/
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/alias/2078/register
#
# Objectのデータ指定処理のエイリアス
#
# @within asset_manager:object/summon/register.m

# 元の登録処理を呼び出す
function asset:object/2078.dark_bullet/register
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/alias/2078/summon
#
# Object召喚処理のエイリアス
#
# @within asset_manager:object/summon/summon.m

# 元の召喚処理を呼び出す
function asset:object/2078.dark_bullet/summon/
Loading
Loading