Skip to content

Commit

Permalink
理外属性の追加と魔法属性のリネーム (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
NePonpon authored Jan 2, 2025
1 parent ed318c4 commit 49ca19c
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 34 deletions.
3 changes: 2 additions & 1 deletion data/entity/function/spawn/apply_status/act.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

### 攻撃力を計算
execute if data storage tusb_mob: "遅延ステータス"."ステータス"."物理攻撃力" run function entity:spawn/apply_status/status/attack
execute if data storage tusb_mob: "遅延ステータス"."ステータス"."魔法攻撃力" run function entity:spawn/apply_status/status/special_attack
execute if data storage tusb_mob: "遅延ステータス"."ステータス"."魔法攻撃力" run function entity:spawn/apply_status/status/magic_attack
execute if data storage tusb_mob: "遅延ステータス"."ステータス"."理外攻撃力" run function entity:spawn/apply_status/status/unreasonable_attack

### モブに他のステータスを計算して反映する
execute if entity @s[tag=Mob] run function entity:spawn/apply_status/mob
Expand Down
3 changes: 2 additions & 1 deletion data/entity/function/spawn/apply_status/mob.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ data modify entity @s DeathTime set value 19s
function entity:spawn/apply_status/status/hp
function entity:spawn/apply_status/status/mp
function entity:spawn/apply_status/status/defense
function entity:spawn/apply_status/status/special_defense
function entity:spawn/apply_status/status/magic_defense
function entity:spawn/apply_status/status/unreasonable_defence

scoreboard players operation @s HP = @s HPMax
scoreboard players operation @s MP = @s MPMax
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ scoreboard players set _ _ 100
execute store result score _ Calc run data get storage tusb_mob: "遅延ステータス"."ステータス"."魔法攻撃力" 0.5
scoreboard players operation _ Calc *= @s Level
scoreboard players operation _ Calc /= _ _
execute store result score @s SpecialAttack run scoreboard players add _ Calc 2
execute store result score @s MagicAttack run scoreboard players add _ Calc 2
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ scoreboard players set _ _ 100
execute store result score _ Calc run data get storage tusb_mob: "遅延ステータス"."ステータス"."魔法防御力" 1
scoreboard players operation _ Calc *= @s Level
scoreboard players operation _ Calc /= _ _
execute store result score @s SpecialDefense run scoreboard players add _ Calc 5
execute store result score @s MagicDefence run scoreboard players add _ Calc 5
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> entity:spawn/apply_status/status/unreasonable_attack
scoreboard players set _ _ 100
### 理外攻撃力を計算する
execute store result score _ Calc run data get storage tusb_mob: "遅延ステータス"."ステータス"."理外攻撃力" 0.5
scoreboard players operation _ Calc *= @s Level
scoreboard players operation _ Calc /= _ _
execute store result score @s UnreasonableAttack run scoreboard players add _ Calc 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> entity:spawn/apply_status/status/unreasonable_defence
scoreboard players set _ _ 100
### 理外防御力を計算する
execute store result score _ Calc run data get storage tusb_mob: "遅延ステータス"."ステータス"."理外防御力" 1
scoreboard players operation _ Calc *= @s Level
scoreboard players operation _ Calc /= _ _
execute store result score @s UnreasonableDefence run scoreboard players add _ Calc 5
6 changes: 4 additions & 2 deletions data/main/function/load_once.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ scoreboard objectives add MP dummy {"text":"MP"}
scoreboard objectives add MPMax dummy {"text":"MP最大値"}
scoreboard objectives add Attack dummy {"text":"物理攻撃力"}
scoreboard objectives add Defense dummy {"text":"物理防御力"}
scoreboard objectives add SpecialAttack dummy {"text":"魔法攻撃力"}
scoreboard objectives add SpecialDefense dummy {"text":"魔法防御力"}
scoreboard objectives add MagicAttack dummy {"text":"魔法攻撃力"}
scoreboard objectives add MagicDefence dummy {"text":"魔法防御力"}
scoreboard objectives add UnreasonableAttack dummy {"text":"理外攻撃力"}
scoreboard objectives add UnreasonableDefence dummy {"text":"理外防御力"}
scoreboard objectives add BaseTotal dummy {"text":"合計基礎ポイント"}
scoreboard objectives add GrowTotal dummy {"text":"合計成長ポイント"}
scoreboard objectives add Damage dummy {"text":"ダメージ"}
Expand Down
2 changes: 1 addition & 1 deletion data/skill/functions/act/common/libra/success.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
### 補足成功

tag @s add LibraCaster
execute as @e[tag=Mob,distance=..0.01,sort=nearest,limit=1] run tellraw @a[tag=LibraCaster] [{"translate":"ライブラ:【 %1$s 】","with":[{"selector":"@s"}]},{"text":"\n"},{"translate":"基礎能力 | %1$s %2$s %3$s %4$s %5$s %6$s","hoverEvent":{"action":"show_text","contents":{"translate":"モブのLvによって変動する値。"}},"with":[[{"text":""},{"text":"h","font":"icon","color":"red","hoverEvent":{"action":"show_text","contents":{"translate":"体力"}}},{"text":" : "},{"score":{"objective":"HP","name":"@s"}},{"text":"/"},{"score":{"objective":"HPMax","name":"@s"}}],[{"text":""},{"text":"M","font":"icon","color":"aqua","hoverEvent":{"action":"show_text","contents":{"translate":"MP"}}},{"text":" : "},{"score":{"objective":"MP","name":"@s"}},{"text":"/"},{"score":{"objective":"MPMax","name":"@s"}}],[{"text":""},{"text":"p","font":"icon","color":"#b3414f","hoverEvent":{"action":"show_text","contents":{"text":"","extra":[{"translate":"物理攻撃力"},"\n",{"translate":"殴りや投擲物の攻撃力"}]}}},{"text":" : "},{"score":{"objective":"Attack","name":"@s"}}],[{"text":""},{"text":"F","font":"icon","color":"#41b3a5","hoverEvent":{"action":"show_text","contents":{"text":"","extra":[{"translate":"物理防御力"},"\n",{"translate":"殴りや投擲物に対する防御力"}]}}},{"text":" : "},{"score":{"objective":"Defense","name":"@s"}}],[{"text":""},{"text":"A","font":"icon","color":"#66b341","hoverEvent":{"action":"show_text","contents":{"text":"","extra":[{"translate":"魔法攻撃力"},"\n",{"translate":"スキルの攻撃力"}]}}},{"text":" : "},{"score":{"objective":"SpecialAttack","name":"@s"}}],[{"text":""},{"text":"D","font":"icon","color":"#8e41b3","hoverEvent":{"action":"show_text","contents":{"text":"","extra":[{"translate":"魔法防御力"},"\n",{"translate":"属性攻撃に対する防御力"}]}}},{"text":" : "},{"score":{"objective":"SpecialDefense","name":"@s"}}]]}]
execute as @e[tag=Mob,distance=..0.01,sort=nearest,limit=1] run tellraw @a[tag=LibraCaster] [{"translate":"ライブラ:【 %1$s 】","with":[{"selector":"@s"}]},{"text":"\n"},{"translate":"基礎能力 | %1$s %2$s %3$s %4$s %5$s %6$s","hoverEvent":{"action":"show_text","contents":{"translate":"モブのLvによって変動する値。"}},"with":[[{"text":""},{"text":"h","font":"icon","color":"red","hoverEvent":{"action":"show_text","contents":{"translate":"体力"}}},{"text":" : "},{"score":{"objective":"HP","name":"@s"}},{"text":"/"},{"score":{"objective":"HPMax","name":"@s"}}],[{"text":""},{"text":"M","font":"icon","color":"aqua","hoverEvent":{"action":"show_text","contents":{"translate":"MP"}}},{"text":" : "},{"score":{"objective":"MP","name":"@s"}},{"text":"/"},{"score":{"objective":"MPMax","name":"@s"}}],[{"text":""},{"text":"p","font":"icon","color":"#b3414f","hoverEvent":{"action":"show_text","contents":{"text":"","extra":[{"translate":"物理攻撃力"},"\n",{"translate":"殴りや投擲物の攻撃力"}]}}},{"text":" : "},{"score":{"objective":"Attack","name":"@s"}}],[{"text":""},{"text":"F","font":"icon","color":"#41b3a5","hoverEvent":{"action":"show_text","contents":{"text":"","extra":[{"translate":"物理防御力"},"\n",{"translate":"殴りや投擲物に対する防御力"}]}}},{"text":" : "},{"score":{"objective":"Defense","name":"@s"}}],[{"text":""},{"text":"A","font":"icon","color":"#66b341","hoverEvent":{"action":"show_text","contents":{"text":"","extra":[{"translate":"魔法攻撃力"},"\n",{"translate":"スキルの攻撃力"}]}}},{"text":" : "},{"score":{"objective":"MagicAttack","name":"@s"}}],[{"text":""},{"text":"D","font":"icon","color":"#8e41b3","hoverEvent":{"action":"show_text","contents":{"text":"","extra":[{"translate":"魔法防御力"},"\n",{"translate":"属性攻撃に対する防御力"}]}}},{"text":" : "},{"score":{"objective":"MagicDefence","name":"@s"}}]]}]
tag @s remove LibraCaster

function makeup:skill/act/common/libra/success
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ scoreboard players set _ _ 2
scoreboard players operation @s _ /= _ _

# 倍率合計
scoreboard players operation _ SpecialAttack = @s _
scoreboard players operation _ SpecialAttack += _ Calc
scoreboard players operation _ MagicAttack = @s _
scoreboard players operation _ MagicAttack += _ Calc

#ダメージあれば成功
execute if score _ SpecialAttack matches ..0 run function makeup:skill/act/white_mage/sacred_pillar/failure
execute if score _ SpecialAttack matches ..0 run data modify storage skill: Success set value 0b
execute if score _ SpecialAttack matches 1.. run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:[Skill,SacredPillar,NativeTask],Duration:1}
execute if score _ SpecialAttack matches 1.. as @e[tag=SacredPillar,tag=!Initialized,limit=1,distance=..0.01] run function skill:act/white_mage/sacred_pillar/success
execute if score _ SpecialAttack matches 1.. run function skill:act/white_mage/sacred_pillar/player_damage
execute if score _ MagicAttack matches ..0 run function makeup:skill/act/white_mage/sacred_pillar/failure
execute if score _ MagicAttack matches ..0 run data modify storage skill: Success set value 0b
execute if score _ MagicAttack matches 1.. run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:[Skill,SacredPillar,NativeTask],Duration:1}
execute if score _ MagicAttack matches 1.. as @e[tag=SacredPillar,tag=!Initialized,limit=1,distance=..0.01] run function skill:act/white_mage/sacred_pillar/success
execute if score _ MagicAttack matches 1.. run function skill:act/white_mage/sacred_pillar/player_damage
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ execute if score _ Level matches 3 run data modify storage skill: Damage set fro
function skill:damage/add/skill/magic

#ダメージ補正
scoreboard players operation _ Calc = _ SpecialAttack
scoreboard players operation _ Calc = _ MagicAttack
execute if data storage main: difficult{world:"debug"} run tellraw @a ["[Debug]セイクリッドピラー倍率(x100) : ",{"score":{"name":"_","objective":"Calc"}}]
function skill:damage/modify
function skill:damage/save
Expand Down
4 changes: 2 additions & 2 deletions data/skill/functions/enemy/change_status/.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ execute if data storage mob_data: Call.HP run function skill:enemy/change_status
execute if data storage mob_data: Call.MP run function skill:enemy/change_status/mp
execute if data storage mob_data: Call.Attack run function skill:enemy/change_status/attack
execute if data storage mob_data: Call.Defense run function skill:enemy/change_status/defense
execute if data storage mob_data: Call.SpecialAttack run function skill:enemy/change_status/special_attack
execute if data storage mob_data: Call.SpecialDefense run function skill:enemy/change_status/special_defense
execute if data storage mob_data: Call.MagicAttack run function skill:enemy/change_status/magic_attack
execute if data storage mob_data: Call.MagicDefence run function skill:enemy/change_status/magic_defense

#データを元に戻す
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4]."ステータス" set from storage tusb_mob: "遅延ステータス"."ステータス"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#Set, Add
execute store result score @s Calc run data get storage mob_data: Call.SpecialAttack.Add
execute store result score @s _ run data get storage mob_data: Call.SpecialAttack.Range
execute store result score @s Calc run data get storage mob_data: Call.MagicAttack.Add
execute store result score @s _ run data get storage mob_data: Call.MagicAttack.Range
execute unless score @s _ matches 0 run function skill:enemy/change_move/range
execute store result score _ Calc run data get storage tusb_mob: "遅延ステータス"."ステータス"."魔法攻撃力"
execute if data storage mob_data: Call.SpecialAttack.Set store result score _ Calc run data get storage mob_data: Call.SpecialAttack.Set
execute if data storage mob_data: Call.MagicAttack.Set store result score _ Calc run data get storage mob_data: Call.MagicAttack.Set
scoreboard players operation _ Calc += @s Calc
#Limit
execute if data storage mob_data: Call.SpecialAttack.Limit store result score @s _ run data get storage mob_data: Call.SpecialAttack.Limit
execute if score @s Calc matches 1.. if data storage mob_data: Call.SpecialAttack.Limit run scoreboard players operation _ Calc < @s _
execute if score @s Calc matches ..-1 if data storage mob_data: Call.SpecialAttack.Limit run scoreboard players operation _ Calc > @s _
execute if data storage mob_data: Call.MagicAttack.Limit store result score @s _ run data get storage mob_data: Call.MagicAttack.Limit
execute if score @s Calc matches 1.. if data storage mob_data: Call.MagicAttack.Limit run scoreboard players operation _ Calc < @s _
execute if score @s Calc matches ..-1 if data storage mob_data: Call.MagicAttack.Limit run scoreboard players operation _ Calc > @s _

execute store result storage tusb_mob: "遅延ステータス"."ステータス"."魔法攻撃力" int 1 run scoreboard players get _ Calc
function entity:spawn/apply_status/status/special_attack
function entity:spawn/apply_status/status/magic_attack
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#Set, Add
execute store result score @s Calc run data get storage mob_data: Call.SpecialDefense.Add
execute store result score @s _ run data get storage mob_data: Call.SpecialDefense.Range
execute store result score @s Calc run data get storage mob_data: Call.MagicDefence.Add
execute store result score @s _ run data get storage mob_data: Call.MagicDefence.Range
execute unless score @s _ matches 0 run function skill:enemy/change_move/range
execute store result score _ Calc run data get storage tusb_mob: "遅延ステータス"."ステータス"."魔法防御力"
execute if data storage mob_data: Call.SpecialDefense.Set store result score _ Calc run data get storage mob_data: Call.SpecialDefense.Set
execute if data storage mob_data: Call.MagicDefence.Set store result score _ Calc run data get storage mob_data: Call.MagicDefence.Set
scoreboard players operation _ Calc += @s Calc
#Limit
execute if data storage mob_data: Call.SpecialDefense.Limit store result score @s _ run data get storage mob_data: Call.SpecialDefense.Limit
execute if score @s Calc matches 1.. if data storage mob_data: Call.SpecialDefense.Limit run scoreboard players operation _ Calc < @s _
execute if score @s Calc matches ..-1 if data storage mob_data: Call.SpecialDefense.Limit run scoreboard players operation _ Calc > @s _
execute if data storage mob_data: Call.MagicDefence.Limit store result score @s _ run data get storage mob_data: Call.MagicDefence.Limit
execute if score @s Calc matches 1.. if data storage mob_data: Call.MagicDefence.Limit run scoreboard players operation _ Calc < @s _
execute if score @s Calc matches ..-1 if data storage mob_data: Call.MagicDefence.Limit run scoreboard players operation _ Calc > @s _

execute store result storage tusb_mob: "遅延ステータス"."ステータス"."魔法防御力" int 1 run scoreboard players get _ Calc
function entity:spawn/apply_status/status/special_defense
function entity:spawn/apply_status/status/magic_defense
2 changes: 1 addition & 1 deletion data/skill/functions/enemy/damage/player.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ data remove storage score_damage: Argument
data modify storage score_damage: Argument set from storage mob_data: Call.Player
execute unless data storage score_damage: Argument.Effectiveness run data modify storage score_damage: Argument.Effectiveness set value 100
execute store result score _ _ run data get storage score_damage: Argument.Effectiveness
execute unless data storage score_damage: Argument.Damage store result storage score_damage: Argument.Damage double 0.01 run scoreboard players operation _ _ *= @s SpecialAttack
execute unless data storage score_damage: Argument.Damage store result storage score_damage: Argument.Damage double 0.01 run scoreboard players operation _ _ *= @s MagicAttack

#モブ名取得
data modify storage mob_data: MobName set from entity @s CustomName
Expand Down
4 changes: 2 additions & 2 deletions data/skill/functions/enemy/heal/.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ scoreboard players set @s _ 10000
scoreboard players set @s Calc 10000

###ステータス取得
scoreboard players operation _ Calc = @s SpecialAttack
scoreboard players operation _ Calc = @s MagicAttack
execute if data storage mob_data: Call.Multiplier store result score @s _ run data get storage mob_data: Call.Multiplier 10000
execute if data storage mob_data: Call.Range store result score # _ run data get storage mob_data: Call.Range 100

Expand All @@ -27,4 +27,4 @@ scoreboard players set 00000000-0000-0000-0000-000000000000 _ 0
execute as @e[tag=Enemy,distance=..32] if score @s HP < @s HPMax run function skill:enemy/heal/search

###演出
execute if score 00000000-0000-0000-0000-000000000000 _ matches 1 run function makeup:skill/enemy/heal/
execute if score 00000000-0000-0000-0000-000000000000 _ matches 1 run function makeup:skill/enemy/heal/

0 comments on commit 49ca19c

Please sign in to comment.