From a7fb11e0eff4dc62d560916833617fe194161bed Mon Sep 17 00:00:00 2001 From: Thanathor Date: Mon, 30 Sep 2024 18:43:14 +0200 Subject: [PATCH] add more augments --- .../armor/augment/damage_dealt.mcfunction | 2 + .../augment/type/canine/wolf_spawn.mcfunction | 3 + .../type/charging/damage_dealt.mcfunction | 27 +++ .../type/charging/full_charge.mcfunction | 8 + .../type/charging/remove_charge.mcfunction | 17 ++ .../type/giantsbane/activate.mcfunction | 8 + .../augment/type/giantsbane/damage.mcfunction | 19 ++ .../type/giantsbane/damage_dealt.mcfunction | 21 ++ .../player_target/damage.mcfunction | 5 + .../player_target/eval_damage.mcfunction | 2 + .../type/sparking/add_static.mcfunction | 4 + .../type/sparking/damage_dealt.mcfunction | 2 +- .../augment/type/sparking/strike.mcfunction | 2 +- .../armor/trigger/damage_dealt.mcfunction | 7 + .../function/clocks/temp/sparking.mcfunction | 4 - .../function/init.mcfunction | 4 + .../function/tick.mcfunction | 3 + .../training_dummy/damage_dealt.mcfunction | 16 ++ .../training_dummy/dps_remove.mcfunction | 5 + .../training_dummy/process.mcfunction | 35 +++ .../function/training_dummy/spawn.mcfunction | 8 + .../training_dummy/update/dps.mcfunction | 18 ++ .../update/recent_hit.mcfunction | 9 + .../update/total_damage.mcfunction | 9 + .../augment/acrobatic/components.json | 8 +- .../augment/charging/components.json | 208 ++++++++++++++++++ .../augment/charging/levels.json | 50 +++++ .../augment/giantsbane/components.json | 169 ++++++++++++++ .../augment/giantsbane/levels.json | 50 +++++ .../augment/vigorous/components.json | 14 +- ...effect_immune.json => augment_immune.json} | 1 - .../tags/entity_type/augment_resist.json | 7 + .../elite/gargantuan/player_hit.mcfunction | 2 +- .../process/elite/glacial/explode.mcfunction | 2 +- 34 files changed, 729 insertions(+), 20 deletions(-) create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/charging/damage_dealt.mcfunction create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/charging/full_charge.mcfunction create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/charging/remove_charge.mcfunction create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/activate.mcfunction create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/damage.mcfunction create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/damage_dealt.mcfunction create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/player_target/damage.mcfunction create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/player_target/eval_damage.mcfunction create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/damage_dealt.mcfunction create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/dps_remove.mcfunction create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/process.mcfunction create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/spawn.mcfunction create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/dps.mcfunction create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/recent_hit.mcfunction create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/total_damage.mcfunction create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/charging/components.json create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/charging/levels.json create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/giantsbane/components.json create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/giantsbane/levels.json rename gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/{effect_immune.json => augment_immune.json} (72%) create mode 100644 gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/augment_resist.json diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/damage_dealt.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/damage_dealt.mcfunction index 141135ff4c..92c2958b31 100644 --- a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/damage_dealt.mcfunction +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/damage_dealt.mcfunction @@ -9,3 +9,5 @@ execute store result score $augment gm4_aa_data run data get storage gm4_augment # run based on augment id execute if score $augment gm4_aa_data matches 8 run function gm4_augmented_armor:armor/augment/type/sparking/damage_dealt +execute if score $augment gm4_aa_data matches 22 run function gm4_augmented_armor:armor/augment/type/charging/damage_dealt +execute if score $augment gm4_aa_data matches 23 run function gm4_augmented_armor:armor/augment/type/giantsbane/damage_dealt diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_spawn.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_spawn.mcfunction index 7b9fbd5665..e88aede37e 100644 --- a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_spawn.mcfunction +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_spawn.mcfunction @@ -18,3 +18,6 @@ execute summon wolf run function gm4_augmented_armor:armor/augment/type/canine/w # playsound with cooldown execute unless score @s gm4_aa_augment.canine.timer matches 1.. run playsound minecraft:entity.wolf.whine neutral @s ~ ~ ~ 0.6 0.8 scoreboard players set @s gm4_aa_augment.canine.timer 1 + +# cleanup +data remove storage gm4_augmented_armor:temp uuid diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/charging/damage_dealt.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/charging/damage_dealt.mcfunction new file mode 100644 index 0000000000..7b0bed10e0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/charging/damage_dealt.mcfunction @@ -0,0 +1,27 @@ +# grant ramping move speed and hunger to sprinting player +# @s = player wearing husk armour above 50% health and sprinting +# at unspecified +# run from armor/augment/damage_dealt + +scoreboard players set $change gm4_aa_data 1 + +# if player was above 4 attack speed add full charge unless it was already here +execute if score $attribute.attack_speed gm4_aa_data matches 41.. unless score $active gm4_aa_data matches 1 run return run function gm4_augmented_armor:armor/augment/type/charging/full_charge + +# remove charge if this piece was charged and charge was used +execute if score $active gm4_aa_data matches 1 run return run function gm4_augmented_armor:armor/augment/type/charging/remove_charge + +# otherwise increase the level +execute store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] 10 + +execute if score $slot gm4_aa_data matches 0 store result score $curr_bonus gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount 1000 +execute if score $slot gm4_aa_data matches 1 store result score $curr_bonus gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount 1000 +execute if score $slot gm4_aa_data matches 2 store result score $curr_bonus gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount 1000 +execute if score $slot gm4_aa_data matches 3 store result score $curr_bonus gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount 1000 + +scoreboard players operation $curr_bonus gm4_aa_data += $level gm4_aa_data + +execute if score $slot gm4_aa_data matches 0 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount float 0.001 run scoreboard players get $curr_bonus gm4_aa_data +execute if score $slot gm4_aa_data matches 1 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount float 0.001 run scoreboard players get $curr_bonus gm4_aa_data +execute if score $slot gm4_aa_data matches 2 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount float 0.001 run scoreboard players get $curr_bonus gm4_aa_data +execute if score $slot gm4_aa_data matches 3 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount float 0.001 run scoreboard players get $curr_bonus gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/charging/full_charge.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/charging/full_charge.mcfunction new file mode 100644 index 0000000000..bf94df3283 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/charging/full_charge.mcfunction @@ -0,0 +1,8 @@ + +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.active set value 1 + +# activate attribute +execute if score $slot gm4_aa_data matches 0 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic_2"}].amount set value 1 +execute if score $slot gm4_aa_data matches 1 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic_2"}].amount set value 1 +execute if score $slot gm4_aa_data matches 2 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic_2"}].amount set value 1 +execute if score $slot gm4_aa_data matches 3 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic_2"}].amount set value 1 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/charging/remove_charge.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/charging/remove_charge.mcfunction new file mode 100644 index 0000000000..78da42ce55 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/charging/remove_charge.mcfunction @@ -0,0 +1,17 @@ + +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.active set value 0 + +# disable attributes +execute if score $slot gm4_aa_data matches 0 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount set value 0 +execute if score $slot gm4_aa_data matches 1 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount set value 0 +execute if score $slot gm4_aa_data matches 2 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount set value 0 +execute if score $slot gm4_aa_data matches 3 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount set value 0 + +execute if score $slot gm4_aa_data matches 0 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic_2"}].amount set value 0 +execute if score $slot gm4_aa_data matches 1 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic_2"}].amount set value 0 +execute if score $slot gm4_aa_data matches 2 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic_2"}].amount set value 0 +execute if score $slot gm4_aa_data matches 3 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic_2"}].amount set value 0 + +# sound and particles +execute at @n[distance=..12,nbt={HurtTime:10s}] run particle electric_spark ~ ~1.2 ~ 0.3 0.3 0.3 1 4 +playsound minecraft:entity.lightning_bolt.thunder player @a ~ ~ ~ 0.5 2 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/activate.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/activate.mcfunction new file mode 100644 index 0000000000..d58cc3cbb4 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/activate.mcfunction @@ -0,0 +1,8 @@ + +execute store result score $damage_dealt gm4_aa_data run attribute @s generic.attack_damage get 100 + +tag @s add gm4_aa_augment_damager +execute as @n[type=!#gm4_augmented_armor:augment_immune,distance=..12,tag=!gm4_aa_augment_damager,tag=!smithed.strict,nbt={HurtTime:10s}] run function gm4_augmented_armor:armor/augment/type/giantsbane/damage +tag @s remove gm4_aa_augment_damager + +scoreboard players reset $augment.giantsbane_damage gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/damage.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/damage.mcfunction new file mode 100644 index 0000000000..2c7b185f12 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/damage.mcfunction @@ -0,0 +1,19 @@ + +execute store result score $giantsbane_damage gm4_aa_data run attribute @s generic.max_health get 100 +scoreboard players operation $giantsbane_damage gm4_aa_data *= $augment.giantsbane_damage gm4_aa_data +scoreboard players operation $giantsbane_damage gm4_aa_data /= #100 gm4_aa_data + +# sound and particles +execute at @s run particle block{block_state:"chest"} ~ ~1 ~ 0.3 0.3 0.3 0.5 12 +playsound minecraft:entity.zombie.attack_wooden_door player @a ~ ~ ~ 1 0 + +# use custom system for player +execute if entity @s[type=player] run function gm4_augmented_armor:armor/augment/type/giantsbane/player_target/damage + +# calcualte new health for non-player +execute store result score $health gm4_aa_data run data get entity @s Health 100 +scoreboard players operation $health gm4_aa_data -= $giantsbane_damage gm4_aa_data +# if health is reduced to 0 kill this entity +execute unless score $health gm4_aa_data matches 1.. run damage @s 9999 mob_attack by @p[tag=gm4_aa_augment_damager] +# otherwise reduce health to new total +execute store result entity @s[type=!player] Health float 0.01 run scoreboard players get $health gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/damage_dealt.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/damage_dealt.mcfunction new file mode 100644 index 0000000000..2559b3e34a --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/damage_dealt.mcfunction @@ -0,0 +1,21 @@ +# grant ramping move speed and hunger to sprinting player +# @s = player wearing husk armour above 50% health and sprinting +# at unspecified +# run from armor/augment/damage_dealt + +# check the UUID of target entity +data modify storage gm4_augmented_armor:temp giantsbane.target_UUID set from entity @n[type=!#gm4_augmented_armor:augment_immune,distance=..12,tag=!gm4_aa_augment_damager,tag=!smithed.strict,nbt={HurtTime:10s}] UUID +data modify storage gm4_augmented_armor:temp giantsbane.armor_UUID set from storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.last_target +execute store result score $new_target gm4_aa_data run data modify storage gm4_augmented_armor:temp giantsbane.armor_UUID set from storage gm4_augmented_armor:temp giantsbane.target_UUID +execute if score $new_target gm4_aa_data matches 0 run return 0 + +# set new UUID +scoreboard players set $change gm4_aa_data 1 +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.last_target set from storage gm4_augmented_armor:temp giantsbane.target_UUID + +# store level in $augment.giantsbane_damage to use later +execute store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] +scoreboard players operation $augment.giantsbane_damage gm4_aa_data += $level gm4_aa_data + +# cleanup +data remove storage gm4_augmented_armor:temp giantsbane diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/player_target/damage.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/player_target/damage.mcfunction new file mode 100644 index 0000000000..4f6dd923d6 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/player_target/damage.mcfunction @@ -0,0 +1,5 @@ + +scoreboard players operation $giantsbane_damage gm4_aa_data += $damage_dealt gm4_aa_data +execute store result storage gm4_augmented_armor:temp giantsbane.damage float 0.01 run scoreboard players get $giantsbane_damage gm4_aa_data +function gm4_augmented_armor:armor/augment/type/giantsbane/player_target/eval_damage with storage gm4_augmented_armor:temp giantsbane +data remove storage gm4_augmented_armor:temp giantsbane diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/player_target/eval_damage.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/player_target/eval_damage.mcfunction new file mode 100644 index 0000000000..7683ebf14e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/giantsbane/player_target/eval_damage.mcfunction @@ -0,0 +1,2 @@ + +$damage @s $(damage) player_attack by @p[tag=gm4_aa_augment_damager] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/add_static.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/add_static.mcfunction index 9787e56c47..a69d81fef8 100644 --- a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/add_static.mcfunction +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/add_static.mcfunction @@ -1,5 +1,9 @@ +# if the augment clock was not running first clear any old stacks +execute if score $keep_tick.sparking gm4_aa_keep_tick matches 0 as @e[scores={gm4_aa_augment.sparking.static_stacks=1..}] run function gm4_augmented_armor:armor/augment/type/sparking/remove_static + scoreboard players operation @s gm4_aa_augment.sparking.static_stacks += $level gm4_aa_data scoreboard players set @s gm4_aa_augment.sparking.timer 160 execute unless score $keep_tick.sparking gm4_aa_keep_tick matches 1 run schedule function gm4_augmented_armor:clocks/temp/sparking 1t +scoreboard players set $keep_tick.sparking gm4_aa_keep_tick 1 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/damage_dealt.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/damage_dealt.mcfunction index d8885b0bf8..cd8628d686 100644 --- a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/damage_dealt.mcfunction +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/damage_dealt.mcfunction @@ -7,4 +7,4 @@ execute store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] # apply stacks -execute anchored eyes positioned ^ ^ ^3 as @e[type=!#gm4_augmented_armor:effect_immune,distance=..12,tag=!gm4_aa_self,tag=!smithed.strict,nbt={HurtTime:10s}] run function gm4_augmented_armor:armor/augment/type/sparking/add_static +execute anchored eyes positioned ^ ^ ^3 as @e[type=!#gm4_augmented_armor:augment_immune,distance=..12,tag=!gm4_aa_self,tag=!smithed.strict,nbt={HurtTime:10s}] run function gm4_augmented_armor:armor/augment/type/sparking/add_static diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/strike.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/strike.mcfunction index 120fb6f847..f103e1123e 100644 --- a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/strike.mcfunction +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/strike.mcfunction @@ -5,7 +5,7 @@ execute unless entity @s[type=player] run damage @s 42 lightning_bolt at ~ ~ ~ execute if entity @s[type=player] run damage @s 16 lightning_bolt at ~ ~ ~ -execute as @e[distance=0.01..2.5,type=!player,type=!#gm4_augmented_armor:effect_immune,tag=!smithed.strict] run damage @s 21 lightning_bolt at ~ ~ ~ +execute as @e[distance=0.01..2.5,type=!player,type=!#gm4_augmented_armor:augment_resist,tag=!smithed.strict] run damage @s 21 lightning_bolt at ~ ~ ~ summon lightning_bolt scoreboard players set @s gm4_aa_augment.sparking.timer 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/damage_dealt.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/damage_dealt.mcfunction index ed60ef9ce5..47d7f1dd4a 100644 --- a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/damage_dealt.mcfunction +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/damage_dealt.mcfunction @@ -4,6 +4,10 @@ advancement revoke @s only gm4_augmented_armor:damage_dealt # run from player/in_pvp +# | Prep for augments +# store attack speed +execute store result score $attribute.attack_speed gm4_aa_data run attribute @s generic.attack_speed get 10 + # store armor items to storage item replace block 29999998 1 7134 container.0 from entity @s armor.head item replace block 29999998 1 7134 container.1 from entity @s armor.chest @@ -20,5 +24,8 @@ execute if data storage gm4_augmented_armor:temp Items[{Slot:2b}].components."mi execute if data storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor.augment.triggers{damage_dealt:1} run function gm4_augmented_armor:armor/slot/feet scoreboard players set $trigger.damage_dealt gm4_aa_data 0 +# Giantsbane +execute if score $augment.giantsbane_damage gm4_aa_data matches 1.. run function gm4_augmented_armor:armor/augment/type/giantsbane/activate + # cleanup data remove storage gm4_augmented_armor:temp Items diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/sparking.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/sparking.mcfunction index 503a441c1f..59a95f87d3 100644 --- a/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/sparking.mcfunction +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/sparking.mcfunction @@ -2,12 +2,8 @@ # @s = unspecified # at unspecified # schedule from armor/augment/type/spark/activate -# schedule from weapon/augment/lightning/add_score # schedule from here -# if the clock just started we remove any static stacks -execute if score $keep_tick.sparking gm4_aa_keep_tick matches 0 as @e[scores={gm4_aa_augment.sparking.static_stacks=1..}] run function gm4_augmented_armor:armor/augment/type/sparking/remove_static - scoreboard players set $keep_tick.sparking gm4_aa_keep_tick 0 execute as @e[scores={gm4_aa_augment.sparking.static_stacks=1..}] at @s run function gm4_augmented_armor:armor/augment/type/sparking/tick execute if score $keep_tick.sparking gm4_aa_keep_tick matches 1 run schedule function gm4_augmented_armor:clocks/temp/sparking 1t diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/init.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/init.mcfunction index d272e6f3e2..d3ac005d20 100644 --- a/gm4_augmented_armor/data/gm4_augmented_armor/function/init.mcfunction +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/init.mcfunction @@ -50,6 +50,10 @@ scoreboard objectives add gm4_aa_augment.berserkers.timer dummy scoreboard objectives add gm4_aa_augment.hawkeye.max_damage dummy scoreboard objectives add gm4_aa_augment.hawkeye.count dummy +scoreboard objectives add gm4_aa_training_dummy.dps dummy +scoreboard objectives add gm4_aa_training_dummy.total_damage dummy +scoreboard objectives add gm4_aa_training_dummy.timer dummy + # constants scoreboard players set #-1 gm4_aa_data -1 scoreboard players set #0 gm4_aa_data 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/tick.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/tick.mcfunction index 1a0157979c..49d9c222ea 100644 --- a/gm4_augmented_armor/data/gm4_augmented_armor/function/tick.mcfunction +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/tick.mcfunction @@ -4,3 +4,6 @@ schedule function gm4_augmented_armor:tick 1t execute as @e[type=item,tag=!gm4_aa_item_checked] run function gm4_augmented_armor:check_item execute as @e[type=marker,tag=gm4_aa_process_marker.tick] run function gm4_augmented_armor:clocks/process_markers_tick + +# training dummy +execute as @e[type=zombie,tag=gm4_aa_training_dummy] run function gm4_augmented_armor:training_dummy/process diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/damage_dealt.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/damage_dealt.mcfunction new file mode 100644 index 0000000000..9a4927b245 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/damage_dealt.mcfunction @@ -0,0 +1,16 @@ + +# add new entry to dps_array +data modify storage gm4_augmented_armor:temp dps.new set value {gametime:0,damage:0} +execute store result storage gm4_augmented_armor:temp dps.new.gametime int 1 run scoreboard players get $gametime gm4_aa_data +execute store result storage gm4_augmented_armor:temp dps.new.damage int 1 run scoreboard players get $damage_dealt gm4_aa_data +data modify storage gm4_augmented_armor:temp dps.array append from storage gm4_augmented_armor:temp dps.new + +# update recent hit +execute on passengers if entity @s[tag=gm4_aa_training_dummy.recent_hit] run function gm4_augmented_armor:training_dummy/update/recent_hit + +# update total damage (resets after 10 seconds of not taking damage) +execute unless score @s gm4_aa_training_dummy.timer matches 1.. run scoreboard players set @s gm4_aa_training_dummy.total_damage 0 +scoreboard players set @s gm4_aa_training_dummy.timer 100 +scoreboard players operation @s gm4_aa_training_dummy.total_damage += $damage_dealt gm4_aa_data +scoreboard players operation $total_damage gm4_aa_data = @s gm4_aa_training_dummy.total_damage +execute on passengers if entity @s[tag=gm4_aa_training_dummy.total_damage] run function gm4_augmented_armor:training_dummy/update/total_damage diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/dps_remove.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/dps_remove.mcfunction new file mode 100644 index 0000000000..b3b946c0c6 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/dps_remove.mcfunction @@ -0,0 +1,5 @@ + +# remove old damage +execute store result score $reduce_dps gm4_aa_data run data get storage gm4_augmented_armor:temp dps.array[0].damage +scoreboard players operation @s gm4_aa_training_dummy.dps -= $reduce_dps gm4_aa_data +data remove storage gm4_augmented_armor:temp dps.array[0] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/process.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/process.mcfunction new file mode 100644 index 0000000000..a17f5d8b02 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/process.mcfunction @@ -0,0 +1,35 @@ + +# total damage timer +scoreboard players remove @s[scores={gm4_aa_training_dummy.timer=1..}] gm4_aa_training_dummy.timer 1 + +# check if the dummy lost health +execute store result score $health gm4_aa_data run data get entity @s Health 10 +execute if score $health gm4_aa_data matches 10000.. unless score @s gm4_aa_training_dummy.dps matches 1.. run return 0 + +# calculate the damage dealt (x10) +scoreboard players set $damage_dealt gm4_aa_data 10000 +scoreboard players operation $damage_dealt gm4_aa_data -= $health gm4_aa_data + +# grab the array of recent damages +data modify storage gm4_augmented_armor:temp dps.array set from entity @s ArmorItems[0].components."minecraft:custom_data".gm4_augmented_armor.dps_array +# check if the oldest entry is more than 10 seconds old, if so remove it and reduce total damage by it +execute store result score $keep_entry gm4_aa_data run data get storage gm4_augmented_armor:temp dps.array[0].gametime +scoreboard players add $keep_entry gm4_aa_data 100 +execute store result score $gametime gm4_aa_data run time query gametime +scoreboard players operation $keep_entry gm4_aa_data -= $gametime gm4_aa_data +execute unless score $keep_entry gm4_aa_data matches 1.. run function gm4_augmented_armor:training_dummy/dps_remove + +# update the damage displays if needed +execute if score $damage_dealt gm4_aa_data matches 1.. run function gm4_augmented_armor:training_dummy/damage_dealt + +# update dps display +scoreboard players operation @s gm4_aa_training_dummy.dps += $damage_dealt gm4_aa_data +scoreboard players operation $dps gm4_aa_data = @s gm4_aa_training_dummy.dps +execute on passengers if entity @s[tag=gm4_aa_training_dummy.dps] run function gm4_augmented_armor:training_dummy/update/dps + +# store the array of recent damages +data modify entity @s ArmorItems[0].components."minecraft:custom_data".gm4_augmented_armor.dps_array set from storage gm4_augmented_armor:temp dps.array + +# cleanup +data remove storage gm4_augmented_armor:temp dps +data modify entity @s Health set value 1000 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/spawn.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/spawn.mcfunction new file mode 100644 index 0000000000..4a25ac2e05 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/spawn.mcfunction @@ -0,0 +1,8 @@ + +summon zombie ~ ~ ~ {Silent:1b,DeathLootTable:"empty",attributes:[{id:"minecraft:generic.max_health",base:1000}],PersistenceRequired:1b,NoAI:1b,Health:1000f,Tags:["gm4_aa_training_dummy"],ArmorItems:[{id:"minecraft:stone_button",count:1,components:{"minecraft:custom_data":{gm4_augmented_armor:{dps_array:[]}}}},{},{},{}],Passengers:[\ +\ +{id:"minecraft:text_display",billboard:"vertical",Tags:["gm4_aa_training_dummy","gm4_aa_training_dummy.recent_hit"],text:'[{"translate":"entity.gm4.augmented_armor.training_dummy.recent_hit","fallback":"Last Hit: ","color":"gray"},{"text":"0.0","color":"white"}]'},\ +\ +{id:"minecraft:text_display",billboard:"vertical",Tags:["gm4_aa_training_dummy","gm4_aa_training_dummy.dps"],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.3f,0f],scale:[1f,1f,1f]},text:'[{"translate":"entity.gm4.augmented_armor.training_dummy.dps","fallback":"Damage / Second: ","color":"gray"},{"text":"0.0","color":"white"}]'},\ +\ +{id:"minecraft:text_display",billboard:"vertical",Tags:["gm4_aa_training_dummy","gm4_aa_training_dummy.total_damage"],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.6f,0f],scale:[1f,1f,1f]},text:'[{"translate":"entity.gm4.augmented_armor.training_dummy.total_damage","fallback":"Total Damage: ","color":"gray"},{"text":"0.0","color":"white"}]'}]} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/dps.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/dps.mcfunction new file mode 100644 index 0000000000..3f927d01b0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/dps.mcfunction @@ -0,0 +1,18 @@ + +# calculate the actual damage per second +execute store result score $oldest_hit_time gm4_aa_data run data get storage gm4_augmented_armor:temp dps.array[0].gametime +scoreboard players operation $dps_duration gm4_aa_data = $gametime gm4_aa_data +scoreboard players operation $dps_duration gm4_aa_data -= $oldest_hit_time gm4_aa_data +scoreboard players operation $dps_duration gm4_aa_data /= #2 gm4_aa_data +scoreboard players operation $dps_duration gm4_aa_data > #10 gm4_aa_data +scoreboard players operation $dps gm4_aa_data *= #10 gm4_aa_data +scoreboard players operation $dps gm4_aa_data /= $dps_duration gm4_aa_data + +# convert to scores with decimals +scoreboard players operation $dps.1 gm4_aa_data = $dps gm4_aa_data +scoreboard players operation $dps.1 gm4_aa_data %= #10 gm4_aa_data +scoreboard players operation $dps.10 gm4_aa_data = $dps gm4_aa_data +scoreboard players operation $dps.10 gm4_aa_data /= #10 gm4_aa_data + +# update display +data modify entity @s text set value '[{"translate":"entity.gm4.augmented_armor.training_dummy.dps","fallback":"Damage / Second: ","color":"gray"},{"score":{"name":"$dps.10","objective":"gm4_aa_data"},"color":"white"},{"text":".","color":"white"},{"score":{"name":"$dps.1","objective":"gm4_aa_data"},"color":"white"}]' diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/recent_hit.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/recent_hit.mcfunction new file mode 100644 index 0000000000..8b10d6d2c8 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/recent_hit.mcfunction @@ -0,0 +1,9 @@ + +# convert to scores with decimals +scoreboard players operation $recent_hit.1 gm4_aa_data = $damage_dealt gm4_aa_data +scoreboard players operation $recent_hit.1 gm4_aa_data %= #10 gm4_aa_data +scoreboard players operation $recent_hit.10 gm4_aa_data = $damage_dealt gm4_aa_data +scoreboard players operation $recent_hit.10 gm4_aa_data /= #10 gm4_aa_data + +# update display +data modify entity @s text set value '[{"translate":"entity.gm4.augmented_armor.training_dummy.recent_hit","fallback":"Last Hit: ","color":"gray"},{"score":{"name":"$recent_hit.10","objective":"gm4_aa_data"},"color":"white"},{"text":".","color":"white"},{"score":{"name":"$recent_hit.1","objective":"gm4_aa_data"},"color":"white"}]' diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/total_damage.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/total_damage.mcfunction new file mode 100644 index 0000000000..d81f318238 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/total_damage.mcfunction @@ -0,0 +1,9 @@ + +# convert to scores with decimals +scoreboard players operation $total_damage.1 gm4_aa_data = $total_damage gm4_aa_data +scoreboard players operation $total_damage.1 gm4_aa_data %= #10 gm4_aa_data +scoreboard players operation $total_damage.10 gm4_aa_data = $total_damage gm4_aa_data +scoreboard players operation $total_damage.10 gm4_aa_data /= #10 gm4_aa_data + +# update display +data modify entity @s text set value '[{"translate":"entity.gm4.augmented_armor.training_dummy.total_damage","fallback":"Total Damage: ","color":"gray"},{"score":{"name":"$total_damage.10","objective":"gm4_aa_data"},"color":"white"},{"text":".","color":"white"},{"score":{"name":"$total_damage.1","objective":"gm4_aa_data"},"color":"white"}]' diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/acrobatic/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/acrobatic/components.json index ca7d1235a0..94a7cda07f 100644 --- a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/acrobatic/components.json +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/acrobatic/components.json @@ -61,7 +61,7 @@ "lore": [ [ { - "translate": "attribute.gm4.augmented_armor.lore.immunity", + "translate": "item.gm4.augmented_armor.lore.immunity", "fallback": "%s Immunity", "with": [ { @@ -95,7 +95,7 @@ "lore": [ [ { - "translate": "attribute.gm4.augmented_armor.lore.immunity", + "translate": "item.gm4.augmented_armor.lore.immunity", "fallback": "%s Immunity", "with": [ { @@ -129,7 +129,7 @@ "lore": [ [ { - "translate": "attribute.gm4.augmented_armor.lore.immunity", + "translate": "item.gm4.augmented_armor.lore.immunity", "fallback": "%s Immunity", "with": [ { @@ -163,7 +163,7 @@ "lore": [ [ { - "translate": "attribute.gm4.augmented_armor.lore.acrobatic", + "translate": "item.gm4.augmented_armor.lore.acrobatic", "fallback": "%s out of combat", "with": [ { diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/charging/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/charging/components.json new file mode 100644 index 0000000000..7f51287e37 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/charging/components.json @@ -0,0 +1,208 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:generic.attack_speed", + "id": "gm4_augmented_armor:dynamic", + "amount": 0, + "operation": "add_multiplied_base", + "slot": "chest" + }, + { + "attribute": "minecraft:generic.attack_damage", + "id": "gm4_augmented_armor:dynamic_2", + "amount": 0, + "operation": "add_multiplied_base", + "slot": "chest" + }, + { + "attribute": "minecraft:generic.attack_damage", + "id": "gm4_augmented_armor:permanent", + "amount": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_2" + }, + "score": "gm4_aa_data", + "scale": 0.01 + }, + "operation": "add_multiplied_total", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{augment:{name:charging,id:22,triggers:{clocked:0,damage_dealt:1,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.charging", + "fallback": "Charging" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.equals.2", + "with": [ + { + "score": { + "name": "$level_2", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.name.generic.attack_damage" + } + ], + "color": "red", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.charging", + "fallback": "Gain %s on attack,", + "with": [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.name.generic.attack_speed" + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.charging_2", + "fallback": "if %s exceeds 4 instead gain", + "with": [ + { + "translate": "attribute.name.generic.attack_speed" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.charging_3", + "fallback": "%s on the next attack losing all charge", + "with": [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + "100", + { + "translate": "attribute.name.generic.attack_damage" + } + ] + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.charging", + "fallback": "Charging" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/charging/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/charging/levels.json new file mode 100644 index 0000000000..ccc052b1b9 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/charging/levels.json @@ -0,0 +1,50 @@ +{ + "pools": [ + { + "rolls": { + "min": 1, + "max": 3 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "minecraft:set_count", + "count": 5 + } + ] + } + ] + }, + { + "rolls": { + "min": 2, + "max": 4 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 2" + }, + { + "function": "set_custom_data", + "tag": "{gm4_augmented_armor:{multiplier:-5}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/giantsbane/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/giantsbane/components.json new file mode 100644 index 0000000000..ba651e99aa --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/giantsbane/components.json @@ -0,0 +1,169 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:generic.attack_damage", + "id": "gm4_augmented_armor:permanent", + "amount": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_2" + }, + "score": "gm4_aa_data", + "scale": 0.01 + }, + "operation": "add_multiplied_total", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{augment:{name:giantsbane,id:23,triggers:{clocked:0,damage_dealt:1,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.giantsbane", + "fallback": "Giant's Bane" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.equals.2", + "with": [ + { + "score": { + "name": "$level_2", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.name.generic.attack_damage" + } + ], + "color": "red", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.giantsbane", + "fallback": "Attacks deal an extra %s damage", + "with": [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + } + }, + { + "translate": "item.gm4.augmented_armor.lore.giantsbane_3", + "fallback": "target's %s", + "with": [ + { + "translate": "attribute.name.generic.max_health" + } + ] + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.giantbane_2", + "fallback": "Cannot trigger twice on the same entity", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.giantsbane", + "fallback": "Giant's Bane" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/giantsbane/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/giantsbane/levels.json new file mode 100644 index 0000000000..d8679dd540 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/giantsbane/levels.json @@ -0,0 +1,50 @@ +{ + "pools": [ + { + "rolls": { + "min": 1, + "max": 3 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "minecraft:set_count", + "count": 5 + } + ] + } + ] + }, + { + "rolls": { + "min": 5, + "max": 10 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 2" + }, + { + "function": "set_custom_data", + "tag": "{gm4_augmented_armor:{multiplier:-5}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vigorous/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vigorous/components.json index 8b85785cf3..b2e3366bc8 100644 --- a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vigorous/components.json +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vigorous/components.json @@ -48,7 +48,7 @@ "lore": [ [ { - "translate": "attribute.gm4.augmented_armor.lore.immunity", + "translate": "item.gm4.augmented_armor.lore.immunity", "fallback": "%s Immunity", "with": [ { @@ -99,7 +99,7 @@ "lore": [ [ { - "translate": "attribute.gm4.augmented_armor.lore.immunity", + "translate": "item.gm4.augmented_armor.lore.immunity", "fallback": "%s Immunity", "with": [ { @@ -150,7 +150,7 @@ "lore": [ [ { - "translate": "attribute.gm4.augmented_armor.lore.immunity", + "translate": "item.gm4.augmented_armor.lore.immunity", "fallback": "%s Immunity", "with": [ { @@ -201,7 +201,7 @@ "lore": [ [ { - "translate": "attribute.gm4.augmented_armor.lore.immunity", + "translate": "item.gm4.augmented_armor.lore.immunity", "fallback": "%s Immunity", "with": [ { @@ -252,7 +252,7 @@ "lore": [ [ { - "translate": "attribute.gm4.augmented_armor.lore.immunity", + "translate": "item.gm4.augmented_armor.lore.immunity", "fallback": "%s Immunity", "with": [ { @@ -303,7 +303,7 @@ "lore": [ [ { - "translate": "attribute.gm4.augmented_armor.lore.immunity", + "translate": "item.gm4.augmented_armor.lore.immunity", "fallback": "%s Immunity", "with": [ { @@ -354,7 +354,7 @@ "lore": [ [ { - "translate": "attribute.gm4.augmented_armor.lore.immunity", + "translate": "item.gm4.augmented_armor.lore.immunity", "fallback": "%s Immunity", "with": [ { diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/effect_immune.json b/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/augment_immune.json similarity index 72% rename from gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/effect_immune.json rename to gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/augment_immune.json index 888db0cc6e..17af103df0 100644 --- a/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/effect_immune.json +++ b/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/augment_immune.json @@ -1,7 +1,6 @@ { "values": [ "#gm4:non_living", - "#gm4:neutral_passive", "minecraft:armor_stand" ] } diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/augment_resist.json b/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/augment_resist.json new file mode 100644 index 0000000000..07c8f3634e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/augment_resist.json @@ -0,0 +1,7 @@ +{ + "values": [ + "#gm4_augmented_armor:augment_immune", + "#gm4:neutral_passive", + "#gm4:passive" + ] +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/player_hit.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/player_hit.mcfunction index f3411d6274..30e42b805a 100644 --- a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/player_hit.mcfunction +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/player_hit.mcfunction @@ -1,4 +1,4 @@ -# damage player from garfantuan ground slam +# damage player from gargantuan ground slam # @s = player that got hit # at @s # run from mob/process/elite/gargantuan/activate diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/explode.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/explode.mcfunction index 9f136f0e1d..9aff6f8845 100644 --- a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/explode.mcfunction +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/explode.mcfunction @@ -4,7 +4,7 @@ # run from mob/process/elite/glacial/process_explosion scoreboard players set $freeze_seconds gm4_mu_data 3 -execute as @e[distance=..4.81,tag=!smithed.entity,tag=!smithed.strict] run function gm4_monsters_unbound:effect/freeze/apply +execute as @e[distance=..4.81,type=!#gm4:non_living,tag=!smithed.entity,tag=!smithed.strict] run function gm4_monsters_unbound:effect/freeze/apply execute as @a[gamemode=!spectator,distance=..12] facing entity @s eyes positioned ^ ^ ^4.5 positioned ~-.05 ~-.05 ~-.05 if entity @s[dx=0,dy=0,dz=0] positioned ~-0.9 ~-0.9 ~-0.9 if entity @s[dx=0,dy=0,dz=0] run function gm4_monsters_unbound:effect/freeze/apply playsound block.glass.break hostile @a[distance=..4.81] ~ ~ ~ 1 0.8