Skip to content

Commit

Permalink
running animations + no reload and shooting while running
Browse files Browse the repository at this point in the history
  • Loading branch information
Flubberschnub committed Dec 5, 2020
1 parent 05852a5 commit b35b9f0
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 18 deletions.
6 changes: 3 additions & 3 deletions data/guns/functions/graviton/reload.mcfunction
@@ -1,7 +1,7 @@
##reload gun
scoreboard players reset @s[scores={magazine=1..}] reloadtimer
scoreboard players reset @s[scores={magazine=1..},tag=!reloading] reloadtimer
replaceitem entity @s weapon.offhand air
function guns:graviton/resetads
#replaceitem entity @s weapon.mainhand carrot_on_a_stick{display:{Name:'{"text":"Sunshot","color":"gold","bold":true,"italic":false}',Lore:['{"text":"\\"Can\'t outrun the sunrise.\\"","color":"gray"}','{"text":"-Liu Feng","color":"gray"}']},HideFlags:63,Unbreakable:1b,CustomModelData:2,gun:1,sunshot:1} 1
tag @s[scores={magazine=..29}] add reloading
execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,graviton:1}}}] if score @s magazine matches ..29 run function guns:graviton/loading
tag @s[scores={magazine=..29},predicate=!aestd1:flags/is_sprinting] add reloading
execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,graviton:1}}},predicate=!aestd1:flags/is_sprinting] if score @s magazine matches ..29 run function guns:graviton/loading
4 changes: 4 additions & 0 deletions data/guns/functions/graviton/sprinting.mcfunction
@@ -0,0 +1,4 @@
##sunshot sprinting animation
replaceitem entity @s weapon.mainhand carrot_on_a_stick{display:{Name:'{"text":"Graviton Lance","color":"dark_purple","bold":true,"italic":false}',Lore:['{"text":"Think of space-time as a tapestry on a loom.","color":"gray"}','{"text":"This weapon is the needle.","color":"gray"}']},HideFlags:63,Unbreakable:1b,CustomModelData:99,gun:1,graviton:1,ads:0} 1

function guns:general/setmag
31 changes: 23 additions & 8 deletions data/guns/functions/main.mcfunction
Expand Up @@ -24,6 +24,18 @@ execute as @a[scores={ads=1..},tag=!reloading,nbt={SelectedItem:{id:"minecraft:c
scoreboard players reset @a ads
scoreboard players reset @a scope

##sprinting
execute as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{gun:1,CustomModelData:56,sunshot:1}}},predicate=!aestd1:flags/is_sprinting] run function guns:sunshot/resetads
execute as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{gun:1,CustomModelData:99,graviton:1}}},predicate=!aestd1:flags/is_sprinting] run function guns:graviton/resetads
execute as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{gun:1,CustomModelData:174,recluse:1}}},predicate=!aestd1:flags/is_sprinting] run function guns:recluse/resetads
##sunshot
execute as @a[predicate=aestd1:flags/is_sprinting,predicate=!aestd1:flags/is_sneaking,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{gun:1,sunshot:1}}}] run function guns:sunshot/sprinting
execute as @a[predicate=aestd1:flags/is_sprinting,predicate=!aestd1:flags/is_sneaking,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{gun:1,sunshot:2}}}] run function guns:sunshot/sprinting
##gravlance
execute as @a[predicate=aestd1:flags/is_sprinting,predicate=!aestd1:flags/is_sneaking,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{gun:1,graviton:1}}}] run function guns:graviton/sprinting
##recluse
execute as @a[predicate=aestd1:flags/is_sprinting,predicate=!aestd1:flags/is_sneaking,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{gun:1,recluse:1}}}] run function guns:recluse/sprinting

##perks
function guns:general/perks/tick

Expand All @@ -38,20 +50,20 @@ execute as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{

##shooting
##sunshot
execute as @a[scores={shootgun=1..,magazine=1..},tag=!rpm,tag=!reloading,tag=!holding,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,sunshot:1}}}] at @s anchored eyes run function guns:sunshot/shoot
execute as @a[scores={shootgun=1..,magazine=1..},tag=!rpm,tag=!holding,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,sunshot:2}}}] at @s anchored eyes run function guns:sunshot/shoot
execute as @a[scores={shootgun=1..},tag=!rpm,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,sunshot:1}}}] unless entity @s[scores={magazine=1..}] at @s anchored eyes run function guns:sunshot/reload
execute as @a[scores={shootgun=1..},tag=!rpm,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,sunshot:2}}}] unless entity @s[scores={magazine=1..}] at @s anchored eyes run function guns:sunshot/reload
execute as @a[scores={shootgun=1..,magazine=1..},predicate=!aestd1:flags/is_sprinting,tag=!rpm,tag=!reloading,tag=!holding,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,sunshot:1}}}] at @s anchored eyes run function guns:sunshot/shoot
execute as @a[scores={shootgun=1..,magazine=1..},predicate=!aestd1:flags/is_sprinting,tag=!rpm,tag=!holding,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,sunshot:2}}}] at @s anchored eyes run function guns:sunshot/shoot
execute as @a[scores={shootgun=1..},predicate=!aestd1:flags/is_sprinting,tag=!rpm,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,sunshot:1}}}] unless entity @s[scores={magazine=1..}] at @s anchored eyes run function guns:sunshot/reload
execute as @a[scores={shootgun=1..},predicate=!aestd1:flags/is_sprinting,tag=!rpm,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,sunshot:2}}}] unless entity @s[scores={magazine=1..}] at @s anchored eyes run function guns:sunshot/reload
##graviton
execute as @a[scores={shootgun=1..,magazine=1..},tag=!rpm,tag=!holding,tag=!reloading,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,graviton:1}}}] at @s anchored eyes run function guns:graviton/shoot
execute as @a[scores={shootgun=1..},tag=!rpm,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,graviton:1}}}] unless entity @s[scores={magazine=1..}] at @s anchored eyes run function guns:graviton/reload
execute as @a[scores={shootgun=1..,magazine=1..},predicate=!aestd1:flags/is_sprinting,tag=!rpm,tag=!holding,tag=!reloading,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,graviton:1}}}] at @s anchored eyes run function guns:graviton/shoot
execute as @a[scores={shootgun=1..},predicate=!aestd1:flags/is_sprinting,tag=!rpm,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,graviton:1}}}] unless entity @s[scores={magazine=1..}] at @s anchored eyes run function guns:graviton/reload
##recluse
#execute at @a[scores={shootgun=1..,magazine=1..},tag=!reloading,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,recluse:1}}}] run playsound reclusehold master @a[distance=..30] ~ ~ ~ 5
tag @a[tag=shootingrecluse,tag=!rpm] remove shootingrecluse
execute as @a[scores={magazine=1..},tag=!rpm,tag=holding,tag=!reloading,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,recluse:1}}}] at @s anchored eyes run function guns:recluse/shoot
execute as @a[scores={magazine=1..},predicate=!aestd1:flags/is_sprinting,tag=!rpm,tag=holding,tag=!reloading,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,recluse:1}}}] at @s anchored eyes run function guns:recluse/shoot
tag @a[tag=!shootingrecluse] remove reclusesound
execute at @a[tag=!shootingrecluse] run stopsound @a[distance=..30,tag=!shootingrecluse] master reclusehold
execute as @a[scores={shootgun=1..},tag=!holding,tag=!rpm,tag=!reloading,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,recluse:1}}}] unless entity @s[scores={magazine=1..}] at @s anchored eyes run function guns:recluse/reload
execute as @a[scores={shootgun=1..},predicate=!aestd1:flags/is_sprinting,tag=!holding,tag=!rpm,tag=!reloading,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,recluse:1}}}] unless entity @s[scores={magazine=1..}] at @s anchored eyes run function guns:recluse/reload

##recoil constantly runs on timer
execute as @a[scores={recoiltimer=1..}] run function guns:general/recoiloop
Expand All @@ -66,6 +78,9 @@ execute as @a[nbt={Inventory:[{id:"minecraft:carrot_on_a_stick",Slot:-106b,Count
##recluse
execute as @a[nbt={Inventory:[{id:"minecraft:carrot_on_a_stick",Slot:-106b,Count:1b,tag:{gun:1,recluse:1}}]}] unless entity @s[nbt={SelectedItem:{}}] run function guns:recluse/reload

##reloadtimer reset while sprinting
scoreboard players reset @a[predicate=aestd1:flags/is_sprinting] reloadtimer

##reload constantly runs on timer
execute as @a[scores={reloadtimer=1..}] run function guns:general/reloadloop

Expand Down
8 changes: 4 additions & 4 deletions data/guns/functions/recluse/reload.mcfunction
@@ -1,8 +1,8 @@
##reload gun
scoreboard players reset @s[scores={magazine=1..}] reloadtimer
scoreboard players reset @s[scores={magazine=1..},tag=!reloading] reloadtimer
replaceitem entity @s weapon.offhand air
function guns:recluse/resetads
#replaceitem entity @s weapon.mainhand carrot_on_a_stick{display:{Name:'{"text":"Sunshot","color":"gold","bold":true,"italic":false}',Lore:['{"text":"\\"Can\'t outrun the sunrise.\\"","color":"gray"}','{"text":"-Liu Feng","color":"gray"}']},HideFlags:63,Unbreakable:1b,CustomModelData:2,gun:1,sunshot:1} 1
tag @s[scores={magazine=..35}] add reloading
execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,recluse:1}}}] if score @s magazine matches ..35 unless score @s feedingFrenzy matches 1.. run function guns:recluse/loading
execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,recluse:1}}}] if score @s magazine matches ..35 if score @s feedingFrenzy matches 1.. run function guns:recluse/fastloading
tag @s[scores={magazine=..35},predicate=!aestd1:flags/is_sprinting] add reloading
execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,recluse:1}}},predicate=!aestd1:flags/is_sprinting] if score @s magazine matches ..35 unless score @s feedingFrenzy matches 1.. run function guns:recluse/loading
execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,recluse:1}}},predicate=!aestd1:flags/is_sprinting] if score @s magazine matches ..35 if score @s feedingFrenzy matches 1.. run function guns:recluse/fastloading
4 changes: 4 additions & 0 deletions data/guns/functions/recluse/sprinting.mcfunction
@@ -0,0 +1,4 @@
##sunshot sprinting animation
replaceitem entity @s weapon.mainhand carrot_on_a_stick{display:{Name:'{"text":"The Recluse","color":"dark_red","bold":true,"italic":false}',Lore:['{"text":"My bite will turn your","color":"gray"}','{"text":"sweet flesh to vile rot.","color":"gray"}']},HideFlags:63,Unbreakable:1b,CustomModelData:174,gun:1,recluse:1,ads:0} 1

function guns:general/setmag
6 changes: 3 additions & 3 deletions data/guns/functions/sunshot/reload.mcfunction
@@ -1,7 +1,7 @@
##reload gun
scoreboard players reset @s[scores={magazine=1..}] reloadtimer
scoreboard players reset @s[scores={magazine=1..},tag=!reloading] reloadtimer
replaceitem entity @s weapon.offhand air
function guns:sunshot/resetads
#replaceitem entity @s weapon.mainhand carrot_on_a_stick{display:{Name:'{"text":"Sunshot","color":"gold","bold":true,"italic":false}',Lore:['{"text":"\\"Can\'t outrun the sunrise.\\"","color":"gray"}','{"text":"-Liu Feng","color":"gray"}']},HideFlags:63,Unbreakable:1b,CustomModelData:2,gun:1,sunshot:1} 1
tag @s[scores={magazine=..11}] add reloading
execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,sunshot:1}}}] if score @s magazine matches ..11 run function guns:sunshot/loading
tag @s[scores={magazine=..11},predicate=!aestd1:flags/is_sprinting] add reloading
execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{gun:1,sunshot:1}}},predicate=!aestd1:flags/is_sprinting] if score @s magazine matches ..11 run function guns:sunshot/loading
4 changes: 4 additions & 0 deletions data/guns/functions/sunshot/sprinting.mcfunction
@@ -0,0 +1,4 @@
##sunshot sprinting animation
replaceitem entity @s weapon.mainhand minecraft:carrot_on_a_stick{display:{Name:'{"text":"Sunshot","color":"gold","bold":true,"italic":false}',Lore:['{"text":"a pew pew gun"}']},Unbreakable:1b,CustomModelData:56,gun:1,sunshot:1} 1

function guns:general/setmag

0 comments on commit b35b9f0

Please sign in to comment.