-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6600dc4
commit 7f01851
Showing
28 changed files
with
804 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...ed_armor/data/gm4_augmented_armor/function/armor/augment/type/blastshot/damage.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
$damage @s $(damage) arrow by @p[tag=gm4_aa_augment_damager] |
24 changes: 24 additions & 0 deletions
24
...d_armor/data/gm4_augmented_armor/function/armor/augment/type/blastshot/explode.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
# calculate and store damage of explosion | ||
execute store result score $level gm4_aa_data run data get entity @s data.gm4_augmented_armor.blastshot_level | ||
execute store result score $damage gm4_aa_data run data get entity @s data.gm4_augmented_armor.blastshot_damage | ||
scoreboard players operation $damage gm4_aa_data *= $level gm4_aa_data | ||
scoreboard players operation $damage gm4_aa_data /= #100 gm4_aa_data | ||
execute store result storage gm4_augmented_armor:temp blastshot.damage float 0.1 run scoreboard players get $damage gm4_aa_data | ||
|
||
# check if arrow just hit an entity or killed it | ||
execute if score $landed gm4_aa_data matches 2 if entity @e[distance=..12,nbt={HurtTime:10s}] run scoreboard players set $landed gm4_aa_data 1 | ||
|
||
# tag the owner of the arrow to deal the damage from them | ||
scoreboard players operation $id gm4_aa_data = @s gm4_aa_id | ||
execute as @a if score @s gm4_aa_id = $id gm4_aa_data run tag @s add gm4_aa_augment_damager | ||
|
||
# double radius if kill | ||
execute unless score $landed gm4_aa_data matches 2 if entity @p[tag=gm4_aa_augment_damager] run function gm4_augmented_armor:armor/augment/type/blastshot/explode_normal | ||
execute if score $landed gm4_aa_data matches 2 if entity @p[tag=gm4_aa_augment_damager] run function gm4_augmented_armor:armor/augment/type/blastshot/explode_big | ||
|
||
# cleanup | ||
tag @a remove gm4_aa_augment_damager | ||
data remove storage gm4_augmented_armor:temp blastshot | ||
execute on vehicle run kill @s | ||
kill @s |
8 changes: 8 additions & 0 deletions
8
...mor/data/gm4_augmented_armor/function/armor/augment/type/blastshot/explode_big.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
execute as @e[predicate=gm4_augmented_armor:technical/pvp_able,distance=..9,tag=!gm4_aa_augment_damager] run function gm4_augmented_armor:armor/augment/type/blastshot/damage with storage gm4_augmented_armor:temp blastshot | ||
|
||
# effects | ||
playsound entity.generic.explode player @a[distance=..64] ~ ~ ~ 0.85 1.15 0.25 | ||
playsound entity.generic.explode player @a[distance=..64] ~ ~ ~ 1 1.025 0.5 | ||
particle explosion ~ ~ ~ 0.2 0.2 0.2 0.5 2 force @a[distance=..64] | ||
particle explosion ~ ~ ~ 0.75 0.75 0.75 0.5 6 force @a[distance=..64] |
7 changes: 7 additions & 0 deletions
7
.../data/gm4_augmented_armor/function/armor/augment/type/blastshot/explode_normal.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
execute as @e[predicate=gm4_augmented_armor:technical/pvp_able,distance=..4.5,tag=!gm4_aa_augment_damager] run function gm4_augmented_armor:armor/augment/type/blastshot/damage with storage gm4_augmented_armor:temp blastshot | ||
|
||
# effects | ||
playsound entity.generic.explode player @a[distance=..64] ~ ~ ~ 0.85 1.15 0.25 | ||
particle explosion ~ ~ ~ 0.2 0.2 0.2 0.5 2 force @a[distance=..64] | ||
particle explosion ~ ~ ~ 0.5 0.5 0.5 0.5 2 force @a[distance=..64] |
34 changes: 34 additions & 0 deletions
34
...rmor/data/gm4_augmented_armor/function/armor/augment/type/blastshot/find_arrow.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
# store armor for checking | ||
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 | ||
item replace block 29999998 1 7134 container.2 from entity @s armor.legs | ||
item replace block 29999998 1 7134 container.3 from entity @s armor.feet | ||
data modify storage gm4_augmented_armor:temp Items set from block 29999998 1 7134 Items | ||
data remove block 29999998 1 7134 Items | ||
|
||
# get total blastshot level | ||
scoreboard players set $blastshot_level gm4_aa_data 0 | ||
|
||
scoreboard players set $add_blastshot_level gm4_aa_data 0 | ||
execute if data storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:blastshot}} store result score $add_blastshot_level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] | ||
scoreboard players operation $blastshot_level gm4_aa_data += $add_blastshot_level gm4_aa_data | ||
|
||
scoreboard players set $add_blastshot_level gm4_aa_data 0 | ||
execute if data storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:blastshot}} store result score $add_blastshot_level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] | ||
scoreboard players operation $blastshot_level gm4_aa_data += $add_blastshot_level gm4_aa_data | ||
|
||
scoreboard players set $add_blastshot_level gm4_aa_data 0 | ||
execute if data storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:blastshot}} store result score $add_blastshot_level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] | ||
scoreboard players operation $blastshot_level gm4_aa_data += $add_blastshot_level gm4_aa_data | ||
|
||
scoreboard players set $add_blastshot_level gm4_aa_data 0 | ||
execute if data storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:blastshot}} store result score $add_blastshot_level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] | ||
scoreboard players operation $blastshot_level gm4_aa_data += $add_blastshot_level gm4_aa_data | ||
|
||
# spawn arrows | ||
scoreboard players operation $id gm4_aa_data = @s gm4_aa_id | ||
execute as @n[type=#gm4_survival_refightalized:arrow,tag=gm4_sr_current_arrow] at @s run function gm4_augmented_armor:armor/augment/type/blastshot/prime | ||
|
||
# cleanup | ||
data remove storage gm4_augmented_armor:temp Items |
12 changes: 12 additions & 0 deletions
12
...mor/data/gm4_augmented_armor/function/armor/augment/type/blastshot/init_marker.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
# make marker ride arrow | ||
ride @s mount @n[type=#gm4_augmented_armor:arrow,tag=gm4_aa_target,distance=..0.1] | ||
tag @s add gm4_aa_process_marker.tick | ||
tag @s add gm4_aa_process_marker.blastshot | ||
|
||
# store blast damage, arrow motion and level in marker in case arrow hits an entity | ||
execute store result entity @s data.gm4_augmented_armor.blastshot_damage int 1 on vehicle run data get entity @s damage 500 | ||
execute store result entity @s data.gm4_augmented_armor.blastshot_level int 1 run scoreboard players get $blastshot_level gm4_aa_data | ||
|
||
# set id to track owner | ||
scoreboard players operation @s gm4_aa_id = $id gm4_aa_data |
7 changes: 7 additions & 0 deletions
7
...ted_armor/data/gm4_augmented_armor/function/armor/augment/type/blastshot/prime.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
# add a marker to track the arrow | ||
tag @s add gm4_aa_target | ||
execute summon marker run function gm4_augmented_armor:armor/augment/type/blastshot/init_marker | ||
tag @s remove gm4_aa_target | ||
|
||
tag @s add gm4_aa_blastshot_arrow |
10 changes: 10 additions & 0 deletions
10
.../data/gm4_augmented_armor/function/armor/augment/type/blastshot/process_marker.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
# check if arrow is still in flight | ||
scoreboard players set $landed gm4_aa_data 2 | ||
execute store result score $landed gm4_aa_data on vehicle run data get entity @s inGround | ||
|
||
# explode if arrow has landed or hot something | ||
execute if score $landed gm4_aa_data matches 1.. run return run function gm4_augmented_armor:armor/augment/type/blastshot/explode | ||
|
||
# update damage in case its changing mid-flight (from other modifiers) | ||
execute store result entity @s data.gm4_augmented_armor.blastshot_damage int 1 on vehicle run data get entity @s damage 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ata/gm4_augmented_armor/function/armor/augment/type/gleaming/prime/init_marker.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...ented_armor/data/gm4_augmented_armor/function/armor/augment/type/hawkeye/apply.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
# check the bonus damage that is allowed to added in total (x100) | ||
scoreboard players set @s gm4_aa_augment.hawkeye.max_damage 20 | ||
scoreboard players operation @s gm4_aa_augment.hawkeye.max_damage *= $hawkeye_level gm4_aa_data | ||
# add original damage (x100) to get final max damage this arrow can do | ||
scoreboard players operation $original_damage gm4_aa_data = $arrow_damage gm4_sr_data | ||
scoreboard players operation $original_damage gm4_aa_data *= #100 gm4_aa_data | ||
scoreboard players operation @s gm4_aa_augment.hawkeye.max_damage += $original_damage gm4_aa_data | ||
# store on arrow for later | ||
scoreboard players operation @s gm4_aa_augment.hawkeye.count = $hawkeye_count gm4_aa_data | ||
|
||
# add tags and start a clock | ||
tag @s add gm4_aa_hawkeye_arrow | ||
tag @s add gm4_aa_hawkeye_arrow.process | ||
execute unless score $keep_tick.hawkeye gm4_aa_keep_tick matches 1 run schedule function gm4_augmented_armor:clocks/temp/hawkeye 1t |
39 changes: 39 additions & 0 deletions
39
..._armor/data/gm4_augmented_armor/function/armor/augment/type/hawkeye/find_arrow.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
# store armor for checking | ||
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 | ||
item replace block 29999998 1 7134 container.2 from entity @s armor.legs | ||
item replace block 29999998 1 7134 container.3 from entity @s armor.feet | ||
data modify storage gm4_augmented_armor:temp Items set from block 29999998 1 7134 Items | ||
data remove block 29999998 1 7134 Items | ||
|
||
# check amount of archer pieces | ||
# original target is set to -1 as the first arrow does not need to be counted | ||
scoreboard players set $hawkeye_level gm4_aa_data 0 | ||
scoreboard players set $hawkeye_count gm4_aa_data 0 | ||
|
||
scoreboard players set $add_hawkeye_level gm4_aa_data 0 | ||
execute if data storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:hawkeye}} store result score $add_hawkeye_level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] | ||
scoreboard players operation $hawkeye_level gm4_aa_data += $add_hawkeye_level gm4_aa_data | ||
execute if score $add_hawkeye_level gm4_aa_data matches 1.. run scoreboard players add $hawkeye_count gm4_aa_data 20 | ||
|
||
scoreboard players set $add_hawkeye_level gm4_aa_data 0 | ||
execute if data storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:hawkeye}} store result score $add_hawkeye_level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] | ||
scoreboard players operation $hawkeye_level gm4_aa_data += $add_hawkeye_level gm4_aa_data | ||
execute if score $add_hawkeye_level gm4_aa_data matches 1.. run scoreboard players add $hawkeye_count gm4_aa_data 20 | ||
|
||
scoreboard players set $add_hawkeye_level gm4_aa_data 0 | ||
execute if data storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:hawkeye}} store result score $add_hawkeye_level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] | ||
scoreboard players operation $hawkeye_level gm4_aa_data += $add_hawkeye_level gm4_aa_data | ||
execute if score $add_hawkeye_level gm4_aa_data matches 1.. run scoreboard players add $hawkeye_count gm4_aa_data 20 | ||
|
||
scoreboard players set $add_hawkeye_level gm4_aa_data 0 | ||
execute if data storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:hawkeye}} store result score $add_hawkeye_level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] | ||
scoreboard players operation $hawkeye_level gm4_aa_data += $add_hawkeye_level gm4_aa_data | ||
execute if score $add_hawkeye_level gm4_aa_data matches 1.. run scoreboard players add $hawkeye_count gm4_aa_data 20 | ||
|
||
# prep arrow | ||
execute as @n[type=#gm4_survival_refightalized:arrow,tag=gm4_sr_current_arrow] at @s run function gm4_augmented_armor:armor/augment/type/hawkeye/apply | ||
|
||
# cleanup | ||
data remove storage gm4_augmented_armor:temp Items |
14 changes: 14 additions & 0 deletions
14
...mor/data/gm4_augmented_armor/function/armor/augment/type/hawkeye/process_arrow.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
# in ground no longer process this arrow | ||
execute store result score $in_ground gm4_aa_data run data get entity @s inGround | ||
execute if score $in_ground gm4_aa_data matches 1 run return run tag @s remove gm4_aa_hawkeye_arrow.process | ||
|
||
# add damage to arrow | ||
execute store result score $damage gm4_aa_data run data get entity @s damage 1000 | ||
execute store result entity @s damage float 0.001 run scoreboard players operation $damage gm4_aa_data += @s gm4_aa_augment.hawkeye.count | ||
|
||
# if damage reached max stop processing this arrow | ||
execute if score $damage gm4_aa_data >= @s gm4_aa_augment.hawkeye.max_damage run return run tag @s remove gm4_aa_hawkeye_arrow.process | ||
|
||
# keep clock on | ||
scoreboard players set $keep_tick.hawkeye gm4_aa_keep_tick 1 |
22 changes: 22 additions & 0 deletions
22
gm4_augmented_armor/data/gm4_augmented_armor/function/armor/modify_arrow_speed.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
# alter motion with reduction | ||
execute store result score $mot_x gm4_aa_data run data get entity @s Motion[0] 1000 | ||
execute store result score $mot_y gm4_aa_data run data get entity @s Motion[1] 1000 | ||
execute store result score $mot_z gm4_aa_data run data get entity @s Motion[2] 1000 | ||
|
||
scoreboard players operation $mot_x_change gm4_aa_data = $mot_x gm4_aa_data | ||
scoreboard players operation $mot_y_change gm4_aa_data = $mot_y gm4_aa_data | ||
scoreboard players operation $mot_z_change gm4_aa_data = $mot_z gm4_aa_data | ||
scoreboard players operation $mot_x_change gm4_aa_data *= $motion_reduction gm4_aa_data | ||
scoreboard players operation $mot_y_change gm4_aa_data *= $motion_reduction gm4_aa_data | ||
scoreboard players operation $mot_z_change gm4_aa_data *= $motion_reduction gm4_aa_data | ||
scoreboard players operation $mot_x_change gm4_aa_data /= #100 gm4_aa_data | ||
scoreboard players operation $mot_y_change gm4_aa_data /= #100 gm4_aa_data | ||
scoreboard players operation $mot_z_change gm4_aa_data /= #100 gm4_aa_data | ||
scoreboard players operation $mot_x gm4_aa_data += $mot_x_change gm4_aa_data | ||
scoreboard players operation $mot_y gm4_aa_data += $mot_y_change gm4_aa_data | ||
scoreboard players operation $mot_z gm4_aa_data += $mot_z_change gm4_aa_data | ||
|
||
execute store result entity @s Motion[0] double 0.001 run scoreboard players get $mot_x gm4_aa_data | ||
execute store result entity @s Motion[1] double 0.001 run scoreboard players get $mot_y gm4_aa_data | ||
execute store result entity @s Motion[2] double 0.001 run scoreboard players get $mot_z gm4_aa_data |
Oops, something went wrong.