Skip to content

Commit

Permalink
add afterburner
Browse files Browse the repository at this point in the history
  • Loading branch information
uran247 committed Jul 9, 2023
1 parent 1839997 commit d7773fc
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 2 deletions.
1 change: 1 addition & 0 deletions data/plane/functions/_index.d.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#declare tag need-change-weapon #武器変更を実行するフラグが立っていることを示す
#declare tag need-use-weapon #武器使用フラグが立っていることを示す
#declare tag use-wep #WEP使用フラグが立っていることを示す
#declare tag reloading-wep #WEPリロードフラグが立っていることを示す

#> weapon
# @within function plane:weapon/**
Expand Down
2 changes: 1 addition & 1 deletion data/plane/functions/controll/flying.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ execute if entity @s[scores={vp.key-storoke=4..6}] as @e[tag=controll-target,tag
#throttle20の時Wを3tick押下でWEP、WEP時Sを3tick押下でWEP解除、WEP解除後にSを押しっぱなしにしてもスロットルを下げないようにロック
execute if entity @s[scores={vp.key-storoke=1..2}] as @e[tag=controll-target,scores={vp.throttle=20},distance=..1,limit=1] run scoreboard players add @s vp.use-wep 1
execute if entity @s[scores={vp.key-storoke=8}] as @e[tag=controll-target,scores={vp.throttle=20},distance=..1,limit=1] run scoreboard players add @s vp.use-wep 1
execute as @e[tag=controll-target,tag=has-wep,scores={vp.use-wep=3..},distance=..1,limit=1] run tag @s add use-wep
execute as @e[tag=controll-target,tag=has-wep,tag=!reloading-wep,scores={vp.use-wep=3..},distance=..1,limit=1] run tag @s add use-wep

execute if entity @s[scores={vp.key-storoke=4..6}] as @e[tag=controll-target,tag=use-wep,scores={vp.throttle=20},distance=..1,limit=1] run tag @s add throttle-change-lock
execute if entity @s[scores={vp.key-storoke=4..6}] as @e[tag=controll-target,tag=use-wep,scores={vp.throttle=20},distance=..1,limit=1] run tag @s remove use-wep
Expand Down
2 changes: 1 addition & 1 deletion data/plane/functions/controll/rolling.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ execute if entity @s[scores={vp.key-storoke=4..6}] as @e[tag=controll-target,tag
#throttle20の時Wを3tick押下でWEP、WEP時Sを3tick押下でWEP解除、WEP解除後にSを押しっぱなしにしてもスロットルを下げないようにロック
execute if entity @s[scores={vp.key-storoke=1..2}] as @e[tag=controll-target,scores={vp.throttle=20},distance=..1,limit=1] run scoreboard players add @s vp.use-wep 1
execute if entity @s[scores={vp.key-storoke=8}] as @e[tag=controll-target,scores={vp.throttle=20},distance=..1,limit=1] run scoreboard players add @s vp.use-wep 1
execute as @e[tag=controll-target,tag=has-wep,scores={vp.use-wep=3..},distance=..1,limit=1] run tag @s add use-wep
execute as @e[tag=controll-target,tag=has-wep,tag=!reloading-wep,scores={vp.use-wep=3..},distance=..1,limit=1] run tag @s add use-wep

execute if entity @s[scores={vp.key-storoke=4..6}] as @e[tag=controll-target,tag=use-wep,scores={vp.throttle=20},distance=..1,limit=1] run tag @s add throttle-change-lock
execute if entity @s[scores={vp.key-storoke=4..6}] as @e[tag=controll-target,tag=use-wep,scores={vp.throttle=20},distance=..1,limit=1] run tag @s remove use-wep
Expand Down
33 changes: 33 additions & 0 deletions data/plane/functions/move/plane-afterburner.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#> plane:move/plane-afterburner
#
# @input
# execute @e[tag=plane-root]
#
# @within function plane:move/plane-move

#> prv
# @private
#declare score_holder #wep-time
#declare score_holder #wep-reload

#WEPリロード減算
execute if entity @s[tag=reloading-wep] store result score #wep-reload vp.reg1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].plane-data.flight-model.engine.wep-reload int 1 run data get storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].plane-data.flight-model.engine.wep-reload 0.9999999999999999
execute if entity @s[tag=reloading-wep] if score #wep-reload vp.reg1 matches ..0 run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].plane-data.flight-model.engine.wep-time set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].plane-data.flight-model.engine.max-wep-time

execute if entity @s[tag=reloading-wep] if score #wep-reload vp.reg1 matches ..0 run say reload-end

execute if entity @s[tag=reloading-wep] if score #wep-reload vp.reg1 matches ..0 run tag @s remove reloading-wep



#wep時間減算
execute if entity @s[tag=use-wep,tag=!reloading-wep] store result score #wep-time vp.reg1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].plane-data.flight-model.engine.wep-time int 1 run data get storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].plane-data.flight-model.engine.wep-time 0.9999999999999999
execute if entity @s[tag=use-wep,tag=!reloading-wep] if score #wep-time vp.reg1 matches ..0 run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].plane-data.flight-model.engine.wep-reload set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].plane-data.flight-model.engine.max-wep-reload

execute if entity @s[tag=use-wep,tag=!reloading-wep] if score #wep-time vp.reg1 matches ..0 run say reloading

execute if entity @s[tag=use-wep,tag=!reloading-wep] if score #wep-time vp.reg1 matches ..0 run tag @s add reloading-wep
execute if entity @s[tag=use-wep,tag=reloading-wep] if score #wep-time vp.reg1 matches ..0 run tag @s remove use-wep



4 changes: 4 additions & 0 deletions data/plane/functions/move/plane-move.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ tag @s add plane-move-executer
#scoreboard players operation #plane-id vp.reg1 = @s plane-id
#execute as @e[distance=..20,tag=plane] if score @s plane-id = #plane-id vp.reg1 run tag @s add target-parts

#afterburner処理
function plane:move/plane-afterburner

#飛行・滑走実行
execute if entity @s[tag=!flying] run function plane:move/plane-move/rolling
execute if entity @s[tag=flying] run function plane:move/plane-move/flying
Expand All @@ -22,6 +25,7 @@ execute if entity @s[tag=flying] run function plane:move/plane-move/flying
execute if entity @s[tag=!flying] run function plane:move/plane-move/turn-rolling
execute if entity @s[tag=flying] run function plane:move/plane-move/turn-flying


#title @a times 0 80 20
#title @a subtitle [{"text":"加速力:","color":"yellow","bold":false},{"score" : {"name":"#base-accelerate", "objective":"vp.reg1"}},{"text":" 旋回速度","color":"yellow","bold":false},{"score" : {"name":"#max-yaw", "objective":"vp.reg1"}}]
#title @a title {"text":" "}
Expand Down

0 comments on commit d7773fc

Please sign in to comment.