Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 108
# 神器のベースアイテム
data modify storage asset:artifact Item set value "minecraft:carrot_on_a_stick"
data modify storage asset:artifact Item set value "minecraft:ender_eye"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '[{"text":"バキューム・ホッパー","color":"yellow"}]'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['[{"text":"吸引力の変わらないただ一つの掃除機。"}]','[{"text":"めんどくさがり屋のあなたへ!"}]']
data modify storage asset:artifact Lore set value ['{"text":"前方のアイテム及び敵を吸い込む","color":"white"}','{"text":"吸引力の変わらないただ一つの掃除機。","color":"gray"}','{"text":"めんどくさがり屋のあなたへ!","color":"gray"}']
# 消費アイテム ({Item: TextComponent, Count: int, Extra?: TextComponent}) (オプション)
# data modify storage asset:artifact ConsumeItem.Item set value
# data modify storage asset:artifact ConsumeItem.Count set value
# 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 "auto"
data modify storage asset:artifact Slot set value "mainhand"
# 神器のトリガー (string) Wikiを参照
data modify storage asset:artifact Trigger set value "onClick"
# 神器の発動条件 (TextComponentString) (オプション)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# @within tag/function asset:artifact/**

# storage asset:context idのauto/feet/legs/chest/head/mainhand/offhandに装備している神器のIDが入っているので比較し、~/2.check_condition.mcfunctionを実行する
execute if data storage asset:context id{auto:108} run function asset:artifact/0108.vacuum_hopper/trigger/2.check_condition
execute if data storage asset:context id{mainhand:108} run function asset:artifact/0108.vacuum_hopper/trigger/2.check_condition
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# @within function asset:artifact/0108.vacuum_hopper/trigger/1.trigger

# 神器の基本的な条件の確認を行うfunction、成功している場合CanUsedタグが付く auto/feet/legs/chest/head/mainhand/offhandを記載してね
function asset:artifact/common/check_condition/auto
function asset:artifact/common/check_condition/mainhand
# 他にアイテム等確認する場合はここに書く

# CanUsedタグをチェックして3.main.mcfunctionを実行する
execute if entity @s[tag=CanUsed] run function asset:artifact/0108.vacuum_hopper/trigger/3.main
execute if entity @s[tag=CanUsed] run function asset:artifact/0108.vacuum_hopper/trigger/3.main
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,31 @@
#
# @within function asset:artifact/0108.vacuum_hopper/trigger/2.check_condition

# 基本的な使用時の処理(MP消費や使用回数の処理など)を行う auto/feet/legs/chest/head/mainhand/offhandを記載してね
function asset:artifact/common/use/mainhand

# ここから先は神器側の効果の処理を書く

#> Private
# @private
#declare tag Vacuum
#declare score_holder $Items
#declare score_holder $Interval

# 基本的な使用時の処理(MP消費や使用回数の処理など)を行う auto/feet/legs/chest/head/mainhand/offhandを記載してね
function asset:artifact/common/use/auto
# 音
execute store result score $Interval Temporary run data get storage global Time
scoreboard players operation $Interval Temporary %= $3 Const
execute if score $Interval Temporary matches 0 anchored eyes positioned ^ ^1 ^1 run playsound minecraft:entity.breeze.idle_air player @a ~ ~ ~ 0.7 0.5
scoreboard players reset $Interval Temporary

# ここから先は神器側の効果の処理を書く
playsound entity.enderman.teleport player @s ~ ~ ~ 1 2
particle portal ~ ~ ~ 0.5 1 0.5 0 300 force @a
execute positioned ^ ^ ^10 run tag @e[type=item,tag=!Uninterferable,distance=..10] add Vacuum
execute positioned ^ ^ ^15 run tag @e[type=item,tag=!Uninterferable,distance=..10] add Vacuum
execute positioned ^ ^ ^20 run tag @e[type=item,tag=!Uninterferable,distance=..10] add Vacuum
execute positioned ^ ^ ^25 run tag @e[type=item,tag=!Uninterferable,distance=..10] add Vacuum
execute positioned ^ ^ ^30 run tag @e[type=item,tag=!Uninterferable,distance=..10] add Vacuum
execute positioned ^ ^ ^35 run tag @e[type=item,tag=!Uninterferable,distance=..10] add Vacuum
execute positioned ^ ^ ^40 run tag @e[type=item,tag=!Uninterferable,distance=..10] add Vacuum
execute at @e[tag=Vacuum] run particle portal ~ ~ ~ 0.2 0.2 0.2 0 30 force @a
tp @e[tag=Vacuum] @s
execute store result score $Items Temporary if entity @e[type=item,tag=Vacuum]
tellraw @s [{"text": "ダイソソ >> "},{"text": "[ "},{"score": {"name": "$Items","objective": "Temporary"},"color": "gold"},{"text": " ]のアイテムを回収しました"}]
execute as @e[type=item,distance=..1] run data modify entity @s PickupDelay set value 0s
scoreboard players reset $Items Temporary
tag @e[type=item,tag=Vacuum] remove Vacuum
# パーティクル
execute anchored eyes positioned ^ ^-0.4 ^ run function asset:artifact/0108.vacuum_hopper/trigger/particle

# 円柱判定
data modify storage lib: Argument.BoundingCone.Angle set value 40d
data modify storage lib: Argument.BoundingCone.Selector set value "@e[type=#asset:0108.vacuum_hopper/vacuumable,tag=!Uninterferable,tag=!Immovable,distance=..16]"
function lib:bounding_cone/

# 吸い込む
execute as @e[type=#asset:0108.vacuum_hopper/vacuumable,tag=BoundingCone,distance=..16] at @s run function asset:artifact/0108.vacuum_hopper/trigger/vacuum/

# リセット
tag @e[type=#asset:0108.vacuum_hopper/vacuumable,tag=BoundingCone,distance=..16] remove BoundingCone
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#> asset:artifact/0108.vacuum_hopper/trigger/particle
#
#
#
# @within function asset:artifact/0108.vacuum_hopper/trigger/3.main

#> Private
# @private
#declare tag SpreadMarker

# 拡散して前方から出す
summon marker ~ ~ ~ {Tags:["SpreadMarker"]}
data modify storage lib: Argument.Distance set value 2.0
data modify storage lib: Argument.Spread set value 2.8
execute as @e[type=marker,tag=SpreadMarker,distance=..5,limit=1] run function lib:forward_spreader/circle
execute facing entity @e[type=marker,tag=SpreadMarker,distance=..5,sort=nearest,limit=1] feet positioned ^ ^ ^30 run particle cloud ~ ~ ~ ^ ^ ^-100000000 0.00000002 0 force @a[distance=..40]
kill @e[type=marker,tag=SpreadMarker,distance=..5]
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#> asset:artifact/0108.vacuum_hopper/trigger/vacuum/
#
#
#
# @within function asset:artifact/0108.vacuum_hopper/trigger/3.main

#> Private
# @private
#declare score_holder $Move
#declare score_holder $Temp
#declare score_holder $KBResist

# 移動距離(100倍)
# Mobノックバック耐性はデフォルトで0.75くらいなので目安の4倍くらいで
scoreboard players set $Move Temporary 100

# 100
scoreboard players set $Temp Temporary 100

# 自身のノックバック耐性で吸い込み距離を変更
execute store result score $KBResist Temporary run attribute @s generic.knockback_resistance get 100
scoreboard players operation $Temp Temporary -= $KBResist Temporary
execute store result storage asset:temp Args.Move double 0.0001 run scoreboard players operation $Move Temporary *= $Temp Temporary
execute unless data storage asset:temp Args{Move:0.0d} run function asset:artifact/0108.vacuum_hopper/trigger/vacuum/tp.m with storage asset:temp Args

# リセット
scoreboard players reset $Move Temporary
scoreboard players reset $Temp Temporary
scoreboard players reset $KBResist Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/0108.vacuum_hopper/trigger/vacuum/tp.m
#
#
#
# @within function asset:artifact/0108.vacuum_hopper/trigger/vacuum/

# 吸い込む
$execute anchored eyes facing entity @p[gamemode=!spectator,distance=..64] eyes if block ^ ^ ^1 #lib:no_collision/ anchored feet positioned ^ ^ ^ if block ^ ^0.1 ^1 #lib:no_collision/ rotated ~ ~-3 run tp @s ^ ^0.03 ^$(Move)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"#lib:living_without_player",
"item"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
"asset:artifact/0092.golden_armor_set/trigger/1.trigger",
"asset:artifact/0093.diamond_armor_set/trigger/1.trigger",
"asset:artifact/0094.netherite_armor_set/trigger/1.trigger",
"asset:artifact/0108.vacuum_hopper/trigger/1.trigger",
"asset:artifact/0152.call_cat/trigger/1.trigger",
"asset:artifact/0158.mp_extractor/trigger/1.trigger",
"asset:artifact/0162.rations/trigger/1.trigger",
Expand Down
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/artifact/using_item.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"asset:artifact/0108.vacuum_hopper/trigger/1.trigger",
"asset:artifact/1220.sacred_hardener/trigger/1.trigger",
"asset:artifact/1269.apocalypse/using_item/1.trigger",
"asset:artifact/1228.fatalerror/trigger/1.trigger",
Expand Down
Loading