Skip to content

Commit

Permalink
add more augments
Browse files Browse the repository at this point in the history
  • Loading branch information
TheThanathor committed Oct 6, 2024
1 parent 598b3fc commit 17dc973
Show file tree
Hide file tree
Showing 52 changed files with 1,227 additions and 255 deletions.
1 change: 0 additions & 1 deletion gm4/modeldata_registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,6 @@
"gm4_animi_shamir:shamir/animi": 124
},
"leather_chestplate": {
"gm4_augmented_armor:gui/advancement/augmented_armor_identify": 1,
"gm4_weighted_armour:shamir/helious": 103,
"gm4_metallurgy:shamir/defuse": 106,
"gm4_iacio_shamir:shamir/iacio": 122,
Expand Down
10 changes: 0 additions & 10 deletions gm4_augmented_armor/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,3 @@ meta:
- Thanathor
Icon Design:
- Hozz
model_data:
- template: advancement
broadcast:
- item: leather_chestplate
reference: gui/advancement/augmented_armor_identify
translation_linter_ignores:
- enchantment.level.14
- enchantment.level.15
- enchantment.level.16
- enchantment.level.17
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
{
"display": {
"icon": {
"id": "minecraft:leather_chestplate",
"components": {
"minecraft:custom_model_data": "gui/advancement/augmented_armor_identify"
}
"id": "minecraft:iron_chestplate"
},
"title": {
"translate": "advancement.gm4.augmented_armor.identify.title",
"fallback": "Hidden Power"
},
"description": {
"translate": "advancement.gm4.augmented_armor.identify.description",
"fallback": "Obtain a Modified piece of armor from a mob",
"fallback": "Obtain an Augmented piece of armor from a monster",
"color": "gray"
},
"frame": "task"
},
"parent": "gm4:root",
"parent": "gm4:survival_refightalized_armor_damage",
"criteria": {
"full_set": {
"trigger": "minecraft:inventory_changed",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"nbt": "{Tags:[\"gm4_aa_immune_fatigue\"]}"
"nbt": "{Tags:[\"gm4_aa_effect_immunity.mining_fatigue\"]}"
}
}
],
Expand All @@ -25,7 +25,7 @@
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"nbt": "{Tags:[\"gm4_aa_immune_wither\"]}"
"nbt": "{Tags:[\"gm4_aa_effect_immunity.wither\"]}"
}
}
],
Expand All @@ -42,7 +42,7 @@
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"nbt": "{Tags:[\"gm4_aa_immune_poison\"]}"
"nbt": "{Tags:[\"gm4_aa_effect_immunity.poison\"]}"
}
}
],
Expand All @@ -59,7 +59,7 @@
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"nbt": "{Tags:[\"gm4_aa_immune_hunger\"]}"
"nbt": "{Tags:[\"gm4_aa_effect_immunity.hunger\"]}"
}
}
],
Expand All @@ -76,7 +76,7 @@
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"nbt": "{Tags:[\"gm4_aa_immune_blind\"]}"
"nbt": "{Tags:[\"gm4_aa_effect_immunity.blind\"]}"
}
}
],
Expand All @@ -93,7 +93,7 @@
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"nbt": "{Tags:[\"gm4_aa_immune_nausea\"]}"
"nbt": "{Tags:[\"gm4_aa_effect_immunity.nausea\"]}"
}
}
],
Expand All @@ -110,7 +110,7 @@
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"nbt": "{Tags:[\"gm4_aa_immune_weakness\"]}"
"nbt": "{Tags:[\"gm4_aa_effect_immunity.weakness\"]}"
}
}
],
Expand All @@ -127,7 +127,7 @@
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"nbt": "{Tags:[\"gm4_aa_immune_levitation\"]}"
"nbt": "{Tags:[\"gm4_aa_effect_immunity.levitation\"]}"
}
}
],
Expand All @@ -144,7 +144,7 @@
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"nbt": "{Tags:[\"gm4_aa_immune_slow_falling\"]}"
"nbt": "{Tags:[\"gm4_aa_effect_immunity.slow_falling\"]}"
}
}
],
Expand All @@ -161,7 +161,7 @@
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"nbt": "{Tags:[\"gm4_aa_immune_slowness\"]}"
"nbt": "{Tags:[\"gm4_aa_effect_immunity.slowness\"]}"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ execute if score $augment gm4_aa_data matches 7 if score @s gm4_aa_stat.damage_d
execute if score $augment gm4_aa_data matches 14 run function gm4_augmented_armor:armor/augment/type/berserkers/check
execute if score $augment gm4_aa_data matches 15 run function gm4_augmented_armor:armor/augment/type/gutsy/check
execute if score $augment gm4_aa_data matches 17 run function gm4_augmented_armor:armor/augment/type/canine/check
execute if score $augment gm4_aa_data matches 24 run function gm4_augmented_armor:armor/augment/type/raging/check
execute if score $augment gm4_aa_data matches 25 run function gm4_augmented_armor:armor/augment/type/sustaining/check
execute if score $augment gm4_aa_data matches 26 if score @s gm4_aa_stat.kills matches 1.. run function gm4_augmented_armor:armor/augment/type/vampiric/activate
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ execute unless score @s gm4_aa_in_combat matches 1.. if score $active gm4_aa_dat
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]

# get effects to become immune to
execute if score $level gm4_aa_data matches 1 run tag @s add gm4_aa_immune_levitation
execute if score $level gm4_aa_data matches 2 run tag @s add gm4_aa_immune_slow_falling
execute if score $level gm4_aa_data matches 3 run tag @s add gm4_aa_immune_slowness
execute if score $level gm4_aa_data matches 1 run tag @s add gm4_aa_effect_immunity.levitation
execute if score $level gm4_aa_data matches 2 run tag @s add gm4_aa_effect_immunity.slow_falling
execute if score $level gm4_aa_data matches 3 run tag @s add gm4_aa_effect_immunity.slowness

# remove effects if they were present
execute if score $level gm4_aa_data matches 1 run effect clear @s levitation
execute if score $level gm4_aa_data matches 2 run effect clear @s slow_falling
execute if score $level gm4_aa_data matches 3 run effect clear @s slowness

# tag for effect removal
tag @s add gm4_aa_immune_active
tag @s add gm4_aa_effect_immunity.active
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
tag @s add gm4_aa_archery_arrow

execute store success score $apply.blastshot gm4_aa_data if entity @s[tag=gm4_aa_blastshot_arrow]
execute store success score $apply.hawkeye gm4_aa_data if entity @s[tag=gm4_aa_hawkeye_arrow]

data modify storage gm4_augmented_armor:temp archery_arrow set from entity @s {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ tag @s add gm4_sr_arrow_checked

# apply buffs if needed
execute if score $apply.blastshot gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/type/blastshot/prime
execute if score $apply.hawkeye gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/type/hawkeye/apply
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@ scoreboard players add @s gm4_aa_augment.dashing.pieces_equipped 1

# give effect
execute if score @s gm4_aa_augment.dashing.timer matches 1..4 run effect give @s speed 2 0
execute if score @s gm4_aa_augment.dashing.timer matches 1..4 run effect give @s[tag=!gm4_aa_immune_hunger] hunger 2 0 true
execute if score @s gm4_aa_augment.dashing.timer matches 1..4 run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 0 true

execute if score @s gm4_aa_augment.dashing.timer matches 5..9 run effect give @s speed 2 1
execute if score @s gm4_aa_augment.dashing.timer matches 5..9 run effect give @s[tag=!gm4_aa_immune_hunger] hunger 2 1 true
execute if score @s gm4_aa_augment.dashing.timer matches 5..9 run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 1 true

execute if score @s gm4_aa_augment.dashing.timer matches 10..14 run effect give @s speed 2 2
execute if score @s gm4_aa_augment.dashing.timer matches 10..14 run effect give @s[tag=!gm4_aa_immune_hunger] hunger 2 2 true
execute if score @s gm4_aa_augment.dashing.timer matches 10..14 run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 2 true

execute if score @s gm4_aa_augment.dashing.timer matches 15..19 run effect give @s speed 2 3
execute if score @s gm4_aa_augment.dashing.timer matches 15..19 run effect give @s[tag=!gm4_aa_immune_hunger] hunger 2 3 true
execute if score @s gm4_aa_augment.dashing.timer matches 15..19 run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 3 true

execute if score @s gm4_aa_augment.dashing.timer matches 20.. run effect give @s speed 2 4
execute if score @s gm4_aa_augment.dashing.timer matches 20.. run effect give @s[tag=!gm4_aa_immune_hunger] hunger 2 4 true
execute if score @s gm4_aa_augment.dashing.timer matches 20.. run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 4 true

execute if score @s[scores={gm4_aa_augment.dashing.pieces_equipped=2..}] gm4_aa_augment.dashing.timer matches 25.. run effect give @s speed 2 5
execute if score @s[scores={gm4_aa_augment.dashing.pieces_equipped=2..}] gm4_aa_augment.dashing.timer matches 25.. run effect give @s[tag=!gm4_aa_immune_hunger] hunger 2 5 true
execute if score @s[scores={gm4_aa_augment.dashing.pieces_equipped=2..}] gm4_aa_augment.dashing.timer matches 25.. run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 5 true

execute if score @s[scores={gm4_aa_augment.dashing.pieces_equipped=3..}] gm4_aa_augment.dashing.timer matches 30.. run effect give @s speed 2 6
execute if score @s[scores={gm4_aa_augment.dashing.pieces_equipped=3..}] gm4_aa_augment.dashing.timer matches 30.. run effect give @s[tag=!gm4_aa_immune_hunger] hunger 2 6 true
execute if score @s[scores={gm4_aa_augment.dashing.pieces_equipped=3..}] gm4_aa_augment.dashing.timer matches 30.. run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 6 true

execute if score @s[scores={gm4_aa_augment.dashing.pieces_equipped=4..}] gm4_aa_augment.dashing.timer matches 35.. run effect give @s speed 2 7
execute if score @s[scores={gm4_aa_augment.dashing.pieces_equipped=4..}] gm4_aa_augment.dashing.timer matches 35.. run effect give @s[tag=!gm4_aa_immune_hunger] hunger 2 7 true
execute if score @s[scores={gm4_aa_augment.dashing.pieces_equipped=4..}] gm4_aa_augment.dashing.timer matches 35.. run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 7 true

# keep effect for a bit after you stop sprinting, refresh this timer when you sprint or swim
scoreboard players reset @s[scores={gm4_aa_stat.sprint_one_cm=1..}] gm4_aa_augment.dashing.timeout
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# check if armor should activate
# @s = player being checked
# at unspecified
# run from armor/augment/clocked

function gm4_survival_refightalized:player/health/calculate_hp

execute store result score $stored_bonus gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.stored_bonus

scoreboard players set $bonus gm4_aa_data 99
scoreboard players operation $bonus gm4_aa_data -= @s gm4_sr_health.percentage
scoreboard players operation $bonus gm4_aa_data /= #25 gm4_sr_data

execute unless score $bonus gm4_aa_data = $stored_bonus gm4_aa_data run function gm4_augmented_armor:armor/augment/type/raging/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# activate the augments on the armor piece
# @s = player wearing the armor
# at unspecified
# run from functions in armor/augment/type/acrobatic/check

scoreboard players set $change gm4_aa_data 1

execute store result storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.stored_bonus int 1 run scoreboard players get $bonus gm4_aa_data

scoreboard players set $damage_bonus gm4_aa_data 0

scoreboard players set $damage_bonus_add gm4_aa_data 0
execute if score $bonus gm4_aa_data matches 1.. store result score $damage_bonus_add gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0]
scoreboard players operation $damage_bonus gm4_aa_data += $damage_bonus_add gm4_aa_data

scoreboard players set $damage_bonus_add gm4_aa_data 0
execute if score $bonus gm4_aa_data matches 2.. store result score $damage_bonus_add gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1]
scoreboard players operation $damage_bonus gm4_aa_data += $damage_bonus_add gm4_aa_data

scoreboard players set $damage_bonus_add gm4_aa_data 0
execute if score $bonus gm4_aa_data matches 3.. store result score $damage_bonus_add gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[2]
scoreboard players operation $damage_bonus gm4_aa_data += $damage_bonus_add gm4_aa_data

# modify attribute
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.1 run scoreboard players get $damage_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.1 run scoreboard players get $damage_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.1 run scoreboard players get $damage_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.1 run scoreboard players get $damage_bonus gm4_aa_data
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# check if armor should activate
# @s = player being checked
# at unspecified
# run from armor/augment/clocked

function gm4_survival_refightalized:player/health/calculate_hp

execute store result score $stored_missing_hp gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.stored_missing_hp

scoreboard players operation $missing_health gm4_aa_data = @s gm4_sr_health.max
scoreboard players operation $missing_health gm4_aa_data -= @s gm4_sr_health.current

execute unless score $missing_health gm4_aa_data = $stored_missing_hp gm4_aa_data run function gm4_augmented_armor:armor/augment/type/sustaining/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

$data modify storage gm4_lore:temp Input set value ['{"color":"dark_gray","fallback":"Currently %s","italic":false,"translate":"item.gm4.augmented_armor.lore.sustaining_2","with":[{"color":"blue","italic":false,"translate":"attribute.modifier.equals.1","with":["$(regen_speed)",{"fallback":"Regeneration Speed","translate":"attribute.gm4.augmented_armor.regen_speed"}]}]}']
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# activate the augments on the armor piece
# @s = player wearing the armor
# at unspecified
# run from functions in armor/augment/type/acrobatic/check

scoreboard players set $change gm4_aa_data 1

execute store result storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.stored_missing_hp int 1 run scoreboard players get $missing_health gm4_aa_data

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 $level gm4_aa_data *= $missing_health gm4_aa_data

# modify attribute
execute store result storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed int 1 run scoreboard players get $level gm4_aa_data

# use lib_lore to remove the old current bonus text
data modify storage gm4_lore:temp Source set from storage gm4_augmented_armor:temp components."minecraft:lore"
data modify storage gm4_lore:temp Target set value '{"color":"gray","fallback":"%s Augment:","italic":false,"translate":"item.gm4.augmented_armor.lore.augment","with":[{"fallback":"Sustaining","translate":"item.gm4.augmented_armor.augment.sustaining"}]}'
scoreboard players set $start gm4_lore 2
function #gm4_lore:remove

# use lib_lore to update the current bonus text
data modify storage gm4_lore:temp Target set value '{"color":"gray","fallback":"%s Augment:","italic":false,"translate":"item.gm4.augmented_armor.lore.augment","with":[{"fallback":"Sustaining","translate":"item.gm4.augmented_armor.augment.sustaining"}]}'
function gm4_augmented_armor:armor/augment/type/sustaining/eval_lore with storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.custom_attribute
scoreboard players set $start gm4_lore 2
function #gm4_lore:insert

# update
data modify storage gm4_augmented_armor:temp components."minecraft:lore" set from storage gm4_lore:temp Source

# set this score so player combat regeneration is recalculated
scoreboard players set $update.combat_regeneration gm4_aa_data 1
Loading

0 comments on commit 17dc973

Please sign in to comment.