Skip to content

Commit

Permalink
引数の設定箇所を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenCMD committed Nov 1, 2021
1 parent a5d1dcd commit 61093c7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 deletions data/score_damage/functions/api/attack.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
#declare team Null

# 引数チェック
execute unless data storage score_damage: Damage run tellraw @a [{"text":"ERROR >>","color":"red"},{"text":"引数が足りません","color":"white"},{"text":"\nMissing Damage at score_damage:api/attack","color":"white"}]
execute unless data storage score_damage: EPF run data modify storage score_damage: EPF set value -1
execute unless data storage score_damage: DamageType run data modify storage score_damage: DamageType set value "None"
execute unless data storage score_damage: DisableParticle run data modify storage score_damage: DisableParticle set value 0b
execute unless data storage score_damage: BypassArmor run data modify storage score_damage: BypassArmor set value 0b
execute unless data storage score_damage: BypassResistance run data modify storage score_damage: BypassResistance set value 0b
execute unless data storage score_damage: Argument.Damage run tellraw @a [{"text":"ERROR >>","color":"red"},{"text":"引数が足りません","color":"white"},{"text":"\nMissing Damage at score_damage:api/attack","color":"white"}]
execute unless data storage score_damage: Argument.EPF run data modify storage score_damage: Argument.EPF set value -1
execute unless data storage score_damage: Argument.DamageType run data modify storage score_damage: Argument.DamageType set value "None"
execute unless data storage score_damage: Argument.DisableParticle run data modify storage score_damage: Argument.DisableParticle set value 0b
execute unless data storage score_damage: Argument.BypassArmor run data modify storage score_damage: Argument.BypassArmor set value 0b
execute unless data storage score_damage: Argument.BypassResistance run data modify storage score_damage: Argument.BypassResistance set value 0b
# Healthを持つEntityであれば実行
execute if data storage score_damage: Damage if entity @s[team=!Null] run function score_damage:core/attack
execute if data storage score_damage: Argument.Damage if entity @s[team=!Null] run function score_damage:core/attack
2 changes: 1 addition & 1 deletion data/score_damage/functions/core/attack.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#declare score_holder $Resistance

# 引数データをコピー
execute store result score $Damage ScoreDamageCore run data get storage score_damage: Damage 100
execute store result score $Damage ScoreDamageCore run data get storage score_damage: Argument.Damage 100
# 計算に必要な値を取得
function score_damage:core/get_status
# 与えるダメージの計算
Expand Down
8 changes: 4 additions & 4 deletions data/score_damage/functions/core/get_default_epf/.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
execute store result score $Temp ScoreDamageCore run data get storage score_damage: Protection[3][{id:"minecraft:protection"}].lvl
scoreboard players operation $EPF ScoreDamageCore += $Temp ScoreDamageCore
# 各種エンチャントの加算
execute if data storage score_damage: {DamageType:"Fire"} run function score_damage:core/get_default_epf/enchant/fire
execute if data storage score_damage: {DamageType:"Blast"} run function score_damage:core/get_default_epf/enchant/blast
execute if data storage score_damage: {DamageType:"Projectile"} run function score_damage:core/get_default_epf/enchant/projectile
execute if data storage score_damage: {DamageType:"Fall"} run function score_damage:core/get_default_epf/enchant/fall
execute if data storage score_damage: Argument{DamageType:"Fire"} run function score_damage:core/get_default_epf/enchant/fire
execute if data storage score_damage: Argument{DamageType:"Blast"} run function score_damage:core/get_default_epf/enchant/blast
execute if data storage score_damage: Argument{DamageType:"Projectile"} run function score_damage:core/get_default_epf/enchant/projectile
execute if data storage score_damage: Argument{DamageType:"Fall"} run function score_damage:core/get_default_epf/enchant/fall
# リセット
scoreboard players reset $Temp ScoreDamageCore
data remove storage score_damage: Protection
16 changes: 8 additions & 8 deletions data/score_damage/functions/core/get_status.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
# HP
execute store result score $Health ScoreDamageCore run data get entity @s Health 10000
# 防御力
execute if data storage score_damage: {BypassArmor:0b} store result score $DefensePoints ScoreDamageCore run attribute @s generic.armor get 100
execute if data storage score_damage: {BypassArmor:1b} run scoreboard players set $DefensePoints ScoreDamageCore 0
execute if data storage score_damage: Argument{BypassArmor:0b} store result score $DefensePoints ScoreDamageCore run attribute @s generic.armor get 100
execute if data storage score_damage: Argument{BypassArmor:1b} run scoreboard players set $DefensePoints ScoreDamageCore 0
# 防具強度
execute if data storage score_damage: {BypassArmor:0b} store result score $Toughness ScoreDamageCore run attribute @s generic.armor_toughness get 100
execute if data storage score_damage: {BypassArmor:1b} run scoreboard players set $Toughness ScoreDamageCore 0
execute if data storage score_damage: Argument{BypassArmor:0b} store result score $Toughness ScoreDamageCore run attribute @s generic.armor_toughness get 100
execute if data storage score_damage: Argument{BypassArmor:1b} run scoreboard players set $Toughness ScoreDamageCore 0
# EPFが未設定または-1以下の時Protectionを参照
execute store result score $EPF ScoreDamageCore run data get storage score_damage: EPF
execute store result score $EPF ScoreDamageCore run data get storage score_damage: Argument.EPF
execute unless score $EPF ScoreDamageCore matches 0.. run function score_damage:core/get_default_epf/
# 耐性エフェクト
execute if data storage score_damage: {BypassResistance:0b} store result score $Resistance ScoreDamageCore run data get entity @s ActiveEffects[{Id:11b}].Amplifier
execute if data storage score_damage: {BypassResistance:0b} if data entity @s ActiveEffects[{Id:11b}] run scoreboard players add $Resistance ScoreDamageCore 1
execute if data storage score_damage: {BypassResistance:1b} run scoreboard players set $Resistance ScoreDamageCore 0
execute if data storage score_damage: Argument{BypassResistance:0b} store result score $Resistance ScoreDamageCore run data get entity @s ActiveEffects[{Id:11b}].Amplifier
execute if data storage score_damage: Argument{BypassResistance:0b} if data entity @s ActiveEffects[{Id:11b}] run scoreboard players add $Resistance ScoreDamageCore 1
execute if data storage score_damage: Argument{BypassResistance:1b} run scoreboard players set $Resistance ScoreDamageCore 0
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
execute if score $SubtractedHealth ScoreDamageCore matches 1.. if score $Resistance ScoreDamageCore matches 5.. if entity @s[type=!#score_damage:undead] run effect give @s instant_damage 1 0 true
execute if score $SubtractedHealth ScoreDamageCore matches 1.. if score $Resistance ScoreDamageCore matches ..4 if entity @s[type=!player,type=!#score_damage:undead] run effect give @s instant_damage 1 31 true
execute if score $SubtractedHealth ScoreDamageCore matches 1.. if score $Resistance ScoreDamageCore matches ..4 if entity @s[type=player] run summon area_effect_cloud ~ ~ ~ {Duration:14,Age:4,Effects:[{Id:11b,Amplifier:127b,Duration:1,ShowParticles:0b},{Id:7b,Amplifier:0b,Duration:1,ShowParticles:0b}]}
execute if data storage score_damage: {DisableParticle:0b} at @s run function score_damage:core/damage_indicator
execute if data storage score_damage: Argument{DisableParticle:0b} at @s run function score_damage:core/damage_indicator
# リセット
scoreboard players reset $SubtractedHealth ScoreDamageCore
scoreboard players reset $HasDependency ScoreDamageCore

0 comments on commit 61093c7

Please sign in to comment.