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

[Mob371] 天雷の魔導書の作成 #223

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
70e2f55
本体の作成完了
Lapis-LJA Jul 22, 2024
02c4324
魔法の実装終わり
Lapis-LJA Jul 22, 2024
55fc4be
デバフを実装
Lapis-LJA Jul 22, 2024
78e1586
ハード以上での処理などを追加
Lapis-LJA Jul 22, 2024
5d6d3cc
旋回位置を少し下に
Lapis-LJA Jul 22, 2024
167ae0b
ハード以上での速度を落とした
Lapis-LJA Jul 22, 2024
ff91779
難易度関係なくヒット時に魔法が消えるように
Lapis-LJA Jul 22, 2024
855392b
いろいろ調整
Lapis-LJA Jul 22, 2024
15fb486
上昇する際に天井を貫通しないように
Lapis-LJA Jul 22, 2024
2ce7ad6
スキル間隔を延長
Lapis-LJA Jul 22, 2024
408243f
演出を調整
Lapis-LJA Jul 24, 2024
a92234e
移動を調整
Lapis-LJA Jul 26, 2024
a8fc0ea
Merge branch 'master' into dev/lapis_mob373
Lapis-LJA Sep 21, 2024
3518441
ルートテーブルを修正
Lapis-LJA Sep 21, 2024
1fc54c8
Merge branch 'master' into dev/lapis_mob373
Lapis-LJA Oct 13, 2024
7496843
魔導書のIDを変更
Lapis-LJA Oct 13, 2024
fc7bd28
オブジェクトを作成
Lapis-LJA Oct 13, 2024
2ec7052
Mobとしての魔法を削除
Lapis-LJA Oct 13, 2024
cc87da5
旋回処理を修正
Lapis-LJA Oct 13, 2024
787e2f0
攻撃処理の書く位置を修正
Lapis-LJA Oct 13, 2024
dfaebfc
デバッグ用コマンドを削除
Lapis-LJA Oct 13, 2024
8d6da89
挙動を調整
Lapis-LJA Oct 13, 2024
35cbbb3
諸々を修正
Lapis-LJA Oct 16, 2024
e612cf4
採番を破壊
Lapis-LJA Oct 16, 2024
13984be
ミスを修正
Lapis-LJA Oct 16, 2024
f931472
死亡演出を調整
Lapis-LJA Oct 16, 2024
b7bd682
雷雲へ変化後の消滅条件を調整
Lapis-LJA Oct 16, 2024
0b4ba91
Merge branch 'master' into dev/lapis_mob373
Lapis-LJA Oct 19, 2024
9499467
MobAssetV3に対応
Lapis-LJA Oct 19, 2024
4a89dc5
ミスを修正
Lapis-LJA Oct 19, 2024
11fe2be
消し忘れを削除
Lapis-LJA Oct 19, 2024
ed14785
スリップダメージの補正を本が行うように
Lapis-LJA Oct 22, 2024
8fd3b6a
バグは残っているが...完成
Lapis-LJA Oct 27, 2024
3f326d6
バグなかったわ
Lapis-LJA Oct 27, 2024
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
@@ -0,0 +1,7 @@
#> asset:effect/0616.lightning_curse/_/register
#
#
#
# @within tag/function asset:effect/register

execute if data storage asset:context {id:616} run function asset:effect/0616.lightning_curse/register
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/0616.lightning_curse/_/tick
#
# Effectが発動している間毎tick実行されるfunction
#
# @within tag/function asset:effect/tick

execute if data storage asset:context {id:616} run function asset:effect/0616.lightning_curse/tick/
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#> asset:effect/0616.lightning_curse/register
#
# Effectのデータを指定
#
# @within function asset:effect/0616.lightning_curse/_/register

# ExtendsSafe (boolean) (default = false)
# data modify storage asset:effect ExtendsSafe set value true
# ID (int)
data modify storage asset:effect ID set value 616
# 名前 (TextComponentString)
data modify storage asset:effect Name set value '{"text":"天雷の呪い","color":"yellow"}'
# 説明文 (TextComponentString[])
data modify storage asset:effect Description set value ['{"text":"継続的に魔法雷属性ダメージを受ける","color":"white"}']
# 効果時間 (int) (default = API || error)
# data modify storage asset:effect Duration set value
# スタック (int) (default = API || 1)
# data modify storage asset:effect Stack set value
# 効果時間の操作方法 (default = API || "replace")
# data modify storage asset:effect DurationOperation set value
# スタックの操作方法 (default = API || "replace")
# data modify storage asset:effect StackOperation set value
# 最大効果時間 (int) (default = 2147483647)
# data modify storage asset:effect MaxDuration set value
# 最大スタック (int) (default = 2147483647)
# data modify storage asset:effect MaxStack set value
# 悪い効果か否か (boolean)
data modify storage asset:effect IsBadEffect set value true
# 死亡時のエフェクトの処理 (default = "remove")
# data modify storage asset:effect ProcessOnDied set value
# 消すのに必要なレベル (int) (default = 1)
data modify storage asset:effect RequireClearLv set value 2

# フィールド
# data modify storage asset:effect Field set value {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#> asset:effect/0616.lightning_curse/tick/
#
# Effectのtick処理
#
# @within function asset:effect/0616.lightning_curse/_/tick

#> Private
# @private
#declare score_holder $Interval

# 演出
execute if predicate lib:random_pass_per/60 run particle dust 1 1 0 1 ~ ~1.2 ~ 0.4 0.2 0.4 0 1 normal @a

# スコアへDurationを代入する
execute store result score $Interval Temporary run data get storage asset:context Duration

# 20tick間隔で演出
scoreboard players operation $Interval Temporary %= $20 Const
execute if score $Interval Temporary matches 0 positioned ~ ~1.2 ~ run function asset:effect/0616.lightning_curse/tick/damage
scoreboard players reset $Interval Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#> asset:effect/0616.lightning_curse/tick/damage
#
# スリップダメージ
#
# @within function asset:effect/0616.lightning_curse/tick/

#> Private
# @private
#declare score_holder $Damage

# 演出
particle electric_spark ~ ~ ~ 0 0 0 0.5 20 normal @a
playsound entity.firework_rocket.twinkle player @a ~ ~ ~ 0.4 1.2 0

# 2(N+1)ダメージ
execute store result score $Damage Temporary run data get storage asset:context Stack
scoreboard players add $Damage Temporary 1

# 魔法雷属性ダメージ
# modifier_manualを用いて付与したMobが補正を行う
execute store result storage api: Argument.Damage int 2 run scoreboard players get $Damage Temporary
data modify storage api: Argument.AttackType set value "Magic"
data modify storage api: Argument.ElementType set value "Thunder"
data modify storage api: Argument.MobUUID set from storage asset:context this.MobUUID
function api:damage/modifier_manual
function api:damage/
function api:damage/reset

# リセット
scoreboard players reset $Damage Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#> asset:mob/0371.lightning_spellbook/_index.d
# @private

#> tag
# @within function asset:mob/0371.lightning_spellbook/**
#declare tag 2D.LeftRotate
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#> asset:mob/0371.lightning_spellbook/death/
#
# Mobの死亡時の処理
#
# @within function asset:mob/alias/371/death

# 演出
particle wax_off ~ ~1.68 ~ 0 0 0 20 35 normal @a
playsound minecraft:entity.zombie.break_wooden_door hostile @a ~ ~ ~ 0.6 0.7
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#> asset:mob/0371.lightning_spellbook/init/
#
# Mob召喚時のInit処理
#
# @within function asset:mob/alias/371/init

# スコア初期化
scoreboard players set @s General.Mob.Tick -80

# 左回りタイプか右回りタイプか決定
execute if predicate lib:random_pass_per/50 run tag @s add 2D.LeftRotate
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#> asset:mob/0371.lightning_spellbook/register
#
# Mobのデータを指定
#
# @within function asset:mob/alias/371/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 371
# 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":"yellow"}'
# 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:9543936}}}
# 胴 (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 2000
# 攻撃力 (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
# 魔法倍率 (float) (オプション)
data modify storage asset:mob Resist.Magic set value 0.8
# 火倍率 (float) (オプション)
# data modify storage asset:mob Resist.Fire set value
# 水倍率 (float) (オプション)
# data modify storage asset:mob Resist.Water set value
# 雷倍率 (float) (オプション)
data modify storage asset:mob Resist.Thunder set value 0.5

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

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

# モブを召喚
data modify storage api: Argument.ID set value 371
function api:mob/summon
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#> asset:mob/0371.lightning_spellbook/tick/
#
# Mobのtick時の処理
#
# @within function asset:mob/alias/371/tick

#> Private
# @private
#declare tag OnTop

# パーティクル
particle enchant ~ ~1.68 ~ 0.25 0.25 0.25 0 2 force @a[distance=..40]

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

# 攻撃
execute if entity @s[scores={General.Mob.Tick=0..}] at @s run function asset:mob/0371.lightning_spellbook/tick/ready

# ここより下は移動処理

# 接地で上を向く
execute unless block ~ ~-0.1 ~ #lib:no_collision at @s run tp @s ~ ~ ~ ~ ~-35
execute unless block ~ ~1 ~ #lib:no_collision at @s run tp @s ~ ~ ~ ~ ~80

# 下にプレイヤーがいるか判定
execute positioned ~-1.5 ~ ~-1.5 if entity @p[dx=2,dy=-2.5,dz=2] at @s run tag @s add OnTop

# プレイヤーが下にいなければ移動
execute if entity @s[tag=!OnTop] at @s facing entity @p eyes positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-800 facing entity @s eyes positioned as @s run tp @s ^ ^ ^0.2 ~ ~

# プレイヤーが下にいれば旋回する
execute if entity @s[tag=OnTop] at @s if entity @s[tag=2D.LeftRotate] run tp @s ^ ^ ^0.2 ~-12 0
execute if entity @s[tag=OnTop] at @s if entity @s[tag=!2D.LeftRotate] run tp @s ^ ^ ^0.2 ~12 0

# デバッグ用
#say @s[tag=OnTop]

# 判定Tagを削除
tag @s[tag=OnTop] remove OnTop

# プレイヤーが近くにいたら上に移動
execute at @s if entity @p[distance=..4] if block ~ ~2.2 ~ #lib:no_collision run tp @s ~ ~0.2 ~

# 不定期に急加速
execute if predicate lib:random_pass_per/1 at @s run tp @s ^ ^ ^0.5

# カベにぶつかった際の処理
execute unless block ^ ^ ^0.5 #lib:no_collision at @s run tp @s ~ ~ ~ ~45 ~-45
execute at @s unless block ^ ^ ^0.2 #lib:no_collision at @s run tp @s ~ ~ ~ ~45 ~-45
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#> asset:mob/0371.lightning_spellbook/tick/ready
#
# 予備動作
#
# @within function asset:mob/0371.lightning_spellbook/tick/

# 周囲にプレイヤーがいなければリセット
execute if entity @s[scores={General.Mob.Tick=0}] unless entity @p[distance=..20] run function asset:mob/0371.lightning_spellbook/tick/reset

# 予備動作
execute if entity @s[scores={General.Mob.Tick=1..3}] facing entity @p eyes anchored eyes positioned ^ ^ ^0.2 run function asset:mob/0371.lightning_spellbook/tick/vfx/1
execute if entity @s[scores={General.Mob.Tick=4..6}] facing entity @p eyes anchored eyes positioned ^ ^ ^0.2 run function asset:mob/0371.lightning_spellbook/tick/vfx/2
execute if entity @s[scores={General.Mob.Tick=7..8}] facing entity @p eyes anchored eyes positioned ^ ^ ^0.2 run function asset:mob/0371.lightning_spellbook/tick/vfx/3
execute if entity @s[scores={General.Mob.Tick=1..8}] run playsound entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.1 1.7 0

# 魔法を召喚
execute if entity @s[scores={General.Mob.Tick=10..}] facing entity @p eyes anchored eyes positioned ^ ^ ^0.2 run function asset:mob/0371.lightning_spellbook/tick/summon
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#> asset:mob/0371.lightning_spellbook/tick/reset
#
# リセット処理
#
# @within function
# asset:mob/0371.lightning_spellbook/tick/ready
# asset:mob/0371.lightning_spellbook/tick/summon

#> Private
# @private
#declare score_holder $Random

# 次に攻撃するタイミングをランダムにする
execute store result score $Random Temporary run function lib:random/
scoreboard players operation $Random Temporary %= $31 Const
scoreboard players operation @s General.Mob.Tick = $Random Temporary
scoreboard players remove @s General.Mob.Tick 120

# リセット
scoreboard players reset $Random Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#> asset:mob/0371.lightning_spellbook/tick/summon
#
# 魔法を召喚する処理
#
# @within function asset:mob/0371.lightning_spellbook/tick/ready

#> Private
# @private
#declare score_holder $Difficulty

# ノーマル以上ならDebuffをtrueに
execute if predicate api:global_vars/difficulty/min/normal run data modify storage api: Argument.FieldOverride.Debuff set value true

# 難易度値を取得する
function api:global_vars/get_difficulty
execute store result score $Difficulty Temporary run data get storage api: Return.Difficulty

# KillTickを設定 (116 + 難易度値 * 16)
# ((KillTick - 100) / 8) 回だけ攻撃する
scoreboard players operation $Difficulty Temporary *= $16 Const
execute store result storage api: Argument.FieldOverride.KillTick int 1 run scoreboard players add $Difficulty Temporary 116

# 難易度値を再度取得
execute store result score $Difficulty Temporary run data get storage api: Return.Difficulty

# 50 * (難易度値 + 1)をDurationへ代入
execute store result storage api: Argument.FieldOverride.Duration int 50 run scoreboard players add $Difficulty Temporary 1

# (難易度値 - 1)をStackへ代入
execute store result storage api: Argument.FieldOverride.Stack int 1 run scoreboard players remove $Difficulty Temporary 2

# 魔法を召喚
data modify storage api: Argument.ID set value 2049
execute store result storage api: Argument.FieldOverride.MobUUID int 1 run scoreboard players get @e[type=zombie,tag=this,distance=..3,limit=1] MobUUID
function api:object/summon

# リセット
function asset:mob/0371.lightning_spellbook/tick/reset
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#> asset:mob/0371.lightning_spellbook/tick/vfx/1
#
#
#
# @within function asset:mob/0371.lightning_spellbook/tick/ready

# [ImportKey]: NobwRALgngDgpmAXGAxgSwE4oDYIDRgCuhaAJkmAGYCMAnAByUBM1TAtPQEZyVsAscUrQ4omAQzaUAzEyn0ArPIDspAGwAGdWAIA7MQFsEyQGGKAAmrawMMRgMBnJOBQB7QjohIm6gijju4GI5gAG5i2IRG4AAeSN5gULEAvokEtqRohA6I1AR2EDYeiHFw2NhoMHZG1JqpzvkQRnFodgCipeWVLQCOhGHYUADK1r7kiJRhlckAukA_3
# 円 1
particle electric_spark ^0 ^-1 ^ ~ ~ ~ 0 0
particle electric_spark ^0.30902 ^-0.95106 ^ ~ ~ ~ 0 0
particle electric_spark ^0.58779 ^-0.80902 ^ ~ ~ ~ 0 0
particle electric_spark ^0.80902 ^-0.58779 ^ ~ ~ ~ 0 0
particle electric_spark ^0.95106 ^-0.30902 ^ ~ ~ ~ 0 0
particle electric_spark ^1 ^0 ^ ~ ~ ~ 0 0
particle electric_spark ^0.95106 ^0.30902 ^ ~ ~ ~ 0 0
particle electric_spark ^0.80902 ^0.58779 ^ ~ ~ ~ 0 0
particle electric_spark ^0.58779 ^0.80902 ^ ~ ~ ~ 0 0
particle electric_spark ^0.30902 ^0.95106 ^ ~ ~ ~ 0 0
particle electric_spark ^0 ^1 ^ ~ ~ ~ 0 0
particle electric_spark ^-0.30902 ^0.95106 ^ ~ ~ ~ 0 0
particle electric_spark ^-0.58779 ^0.80902 ^ ~ ~ ~ 0 0
particle electric_spark ^-0.80902 ^0.58779 ^ ~ ~ ~ 0 0
particle electric_spark ^-0.95106 ^0.30902 ^ ~ ~ ~ 0 0
particle electric_spark ^-1 ^0 ^ ~ ~ ~ 0 0
particle electric_spark ^-0.95106 ^-0.30902 ^ ~ ~ ~ 0 0
particle electric_spark ^-0.80902 ^-0.58779 ^ ~ ~ ~ 0 0
particle electric_spark ^-0.58779 ^-0.80902 ^ ~ ~ ~ 0 0
particle electric_spark ^-0.30902 ^-0.95106 ^ ~ ~ ~ 0 0
Loading
Loading