Skip to content

Commit

Permalink
fix(ability): Vengeful Spectre targets tamed and trusting entities (h…
Browse files Browse the repository at this point in the history
  • Loading branch information
Franco227 committed Jul 3, 2024
1 parent 84ca3b2 commit f8b0b68
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
execute if score @s soul_charge matches 1.. if entity @e[distance=1.5..16,type=!#roguecraft:reaper_excluded,sort=nearest,limit=1] run function roguecraft:ability/classes/reaper_2
execute if score @s soul_charge matches 1.. if entity @e[distance=1.5..16,type=!#roguecraft:reaper_excluded,tag=!VengefulSpectreImmune,sort=nearest,limit=1] run function roguecraft:ability/classes/reaper_2

execute unless score @s soul_charge matches 1.. as @s run tellraw @s[scores={toggle_ability_feedback=0}] {"translate":"roguecraft.chat_messages.ability_no_soul_charge","italic":true,"color":"red"}
execute unless score @s soul_charge matches 1.. as @s run playsound minecraft:block.note_block.didgeridoo master @s ~ ~ ~ 1 0.5

execute if score @s soul_charge matches 1.. unless entity @e[distance=..16,type=!#roguecraft:reaper_excluded,sort=nearest,limit=1] as @s run tellraw @s[scores={toggle_ability_feedback=0}] {"translate":"roguecraft.chat_messages.ability_no_entity_nearby","italic":true,"color":"red"}
execute if score @s soul_charge matches 1.. unless entity @e[distance=..16,type=!#roguecraft:reaper_excluded,sort=nearest,limit=1] as @s run playsound minecraft:block.note_block.didgeridoo master @s ~ ~ ~ 1 0.5
execute if score @s soul_charge matches 1.. unless entity @e[distance=..16,type=!#roguecraft:reaper_excluded,tag=!VengefulSpectreImmune,sort=nearest,limit=1] as @s run tellraw @s[scores={toggle_ability_feedback=0}] {"translate":"roguecraft.chat_messages.ability_no_entity_nearby","italic":true,"color":"red"}
execute if score @s soul_charge matches 1.. unless entity @e[distance=..16,type=!#roguecraft:reaper_excluded,tag=!VengefulSpectreImmune,sort=nearest,limit=1] as @s run playsound minecraft:block.note_block.didgeridoo master @s ~ ~ ~ 1 0.5

execute if score @s soul_charge matches 1.. if entity @e[distance=..16,type=!#roguecraft:reaper_excluded,sort=nearest,limit=1] run scoreboard players set @s soul_charge 0
execute if score @s soul_charge matches 1.. if entity @e[distance=..16,type=!#roguecraft:reaper_excluded,tag=!VengefulSpectreImmune,sort=nearest,limit=1] run scoreboard players set @s soul_charge 0

execute as @e[tag=id,type=marker] run function roguecraft:set_mana_bar with entity @s data
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
summon minecraft:marker ~ ~ ~ {Tags:["spectre","current_main"]}
data modify entity @e[distance=..1,tag=current_main,tag=spectre,limit=1] data.owner set from entity @s UUID
data modify entity @e[distance=..1,tag=current_main,tag=spectre,limit=1] data.target set from entity @e[distance=..16,type=!#roguecraft:reaper_excluded,sort=nearest,limit=1] UUID
data modify entity @e[distance=..1,tag=current_main,tag=spectre,limit=1] data.target set from entity @e[distance=..16,type=!#roguecraft:reaper_excluded,tag=!VengefulSpectreImmune,sort=nearest,limit=1] UUID
scoreboard players operation @e[distance=..1,tag=current_main,tag=spectre,limit=1] soul_charge = @s soul_charge
scoreboard players operation @e[distance=..1,tag=current_main,tag=spectre,limit=1] soul_charge *= 3 int
scoreboard players set @e[distance=..1,tag=current_main,tag=spectre,limit=1] damage 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ playsound minecraft:block.beacon.deactivate master @a ~ ~ ~ 0.25 0.8
particle soul_fire_flame ~ ~1 ~ 0.1 0.1 0.1 0.25 25 force
scoreboard players remove @s soul_charge 1
execute store result entity @s data.soul_charge int 0.33 run scoreboard players get @s soul_charge
$execute unless entity @e[nbt=!{UUID:$(target)},distance=..16,type=!#roguecraft:reaper_excluded,sort=nearest,limit=1] run function roguecraft:ability/classes/vengeful_spectre/kill
$data modify entity @s data.target set from entity @e[nbt=!{UUID:$(target)},distance=..16,type=!#roguecraft:reaper_excluded,sort=nearest,limit=1] UUID
$execute unless entity @e[nbt=!{UUID:$(target)},distance=..16,type=!#roguecraft:reaper_excluded,tag=!VengefulSpectreImmune,sort=nearest,limit=1] run function roguecraft:ability/classes/vengeful_spectre/kill
$data modify entity @s data.target set from entity @e[nbt=!{UUID:$(target)},distance=..16,type=!#roguecraft:reaper_excluded,tag=!VengefulSpectreImmune,sort=nearest,limit=1] UUID
$damage @e[tag=current_main,sort=nearest,limit=1] $(damage) generic by @a[nbt={UUID:$(owner)},limit=1]

execute if score @s soul_charge matches ..0 run function roguecraft:ability/classes/vengeful_spectre/kill with entity @s data
1 change: 1 addition & 0 deletions Data_Pack/data/roguecraft/functions/tick/main.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ execute if data storage roguecraft:master {run_active:1} if entity @a[tag=garden
execute if data storage roguecraft:master {run_active:1} run function roguecraft:tick/true_run
execute if entity @a[gamemode=!adventure] run function roguecraft:tick/run
execute if entity @a[tag=victory] run function roguecraft:tick/final
execute at @a[gamemode=!adventure] run function roguecraft:tick/tag_tamed_entities

#custom recipes
execute as @a[nbt={Inventory:[{id:"minecraft:raw_copper_block"}]}] run recipe give @s roguecraft:copper_block_from_blasting_raw_copper_block
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
execute as @e[type=#roguecraft:tameable,distance=..16,tag=!VengefulSpectreImmune] if data entity @s Owner run tag @s add VengefulSpectreImmune
execute as @e[type=minecraft:fox,distance=..16,tag=!VengefulSpectreImmune,nbt=!{Trusted:[]}] run tag @s add VengefulSpectreImmune
execute as @e[type=minecraft:ocelot,distance=..16,tag=!VengefulSpectreImmune,nbt={Trusting:1b}] run tag @s add VengefulSpectreImmune
14 changes: 14 additions & 0 deletions Data_Pack/data/roguecraft/tags/entity_types/tameable.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"values": [
"cat",
"donkey",
"horse",
"llama",
"mule",
"parrot",
"skeleton_horse",
"trader_llama",
"wolf",
"zombie_horse"
]
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ You can join the MonoCode's Discord server [here](https://discord.gg/d5FxfTYUqQ)
- [Compass not pointing to nether entry after killing the Wildfire when overworld chunks are unloaded](https://discord.com/channels/1114531442052059168/1257161216866910289).
- Gamemode auto-switching to adventure in the hub while in dev mode (by Pengu).
- [Unbreakable Flint and Steel gets cleared when used on a Creeper](https://discord.com/channels/1114531442052059168/1252575711663755375)
- [Vengeful Spectre targets tamed and trusting entities](https://discord.com/channels/1114531442052059168/1255982574493241435)
## Additions
- French Translation
- Recipes for smelting/blasting Raw Copper Block, Raw Iron Block and Raw Gold Block.
Expand Down

0 comments on commit f8b0b68

Please sign in to comment.