Skip to content

Instantly share code, notes, and snippets.

@Bruce0203
Last active Sep 26, 2021
Embed
What would you like to do?
//
// ,--. ,--.
// ,---. ,--. ,--.,--,--.,--,--,--. ,---. | | ,---. ,---. ,---. ,-| | ,---.
//| .-. : \ `' /' ,-. || || .-. || || .-. : | .--'| .-. |' .-. || .-. :
//\ --. / /. \\ '-' || | | || '-' '| |\ --. \ `--.' '-' '\ `-' |\ --.
// `----''--' '--'`--`--'`--`--`--'| |-' `--' `----' `---' `---' `---' `----'
// `--'
//remove join and leave message
on join { set data(joinMessage, null) }
on left { set data(leftMessage, null) }
//remove death screen
on player damage {
if (health <= data(damageFinal)) { //when player damaged, player health will be going to death
set health get size health
clear potion
set food 20
create location("spawnpoint", "world", 0, 0, 0)
teleport "spawnpoint"
title (0, 20, 0, "&cBoom! You dead!", "")
return false //cancel the event
}
//heal command
on command {
split (data(command), " ", args) //divide command string as blank
if (get list(args, 0) == "/heal") {
set health 20
return false //cancel the event
}
}
on game join {
do init
}
on game left {
cancel data(TASK)
title(0,1,0,"","")
}
on init {
cancel data(TASK)
cancel data(TASK_2)
refs(data(lev), "list tiles")
set all data(SLOW, 80)
set all data(FAST, 20)
set all data(PERFECT, 10)
set all data(PI, 3.1415926)
set all data(POINT_AMOUNT, 10)
set all data(POINT_INC, (2 * all data(PI)) / all data(POINT_AMOUNT))
set all data(POINT_RADIUS, 0.25)
set all data(CENTER_AMOUNT, 20)
set data(CENTER_INC, (2 * all data(PI)) / all data(CENTER_AMOUNT))
set all data(CENTER_RADIUS, 1)
clone all location(data(lev), POINT)
clone location(POINT, CENTER)
set data(WAIT, true)
set data(AMOUNT, all data(CENTER_AMOUNT))
set data(DIRECTION, -1)
set data(j,((data(AMOUNT)*4.4))*(data(DIRECTION)*"-1"))
set data(FLIP, 1)
set data(TILE, 0)
set data(AUTO_PLAY, true)
clone loc(POINT, start)
add loc(start, 0, -2, 5)
set posYaw loc(start, 180)
set posPitch loc(start, 0)
teleport(start)
set gamemode SEPECTATOR
title(0,100,0,"&l준비","")
delay(data(AMOUNT)*1) title(0,100,0,"&l3","")
delay(data(AMOUNT)*2) title(0,100,0,"&l2","")
delay(data(AMOUNT)*3) title(0,100,0,"&l1","")
set data(TASK_2, delay(data(AMOUNT)*4) title(0,20,0,"&l시작!","") set data(WAIT, false))
set data(TASK, ( repeat(0, 1) {do "auto play"}{do "summon"}{do "tick"}))
}
on auto play {
//actionbar(var(j))
if(false==do "check tile left" || data(WAIT)==true) return
do "check tile type"
if(data(dir)+int(data(AMOUNT)/2)==data(AMOUNT)-(data(j)%data(AMOUNT))) {
print(data(j))
title(0,20,0,("&l" int((data(TILE)/size all list(tiles))*100) + "% 완료!"),"")
set data(WAIT, true)
particle(POINT, EXPLOSION_LARGE, 1, true)
cancel data(TASK)
cancel data(TASK_2)
delay(20)do init
}
if(data(AUTO_PLAY)!=true) return
do "tile select"
}
on tick {
//actionbar data(TILE)
set data(j, data(j) + data(DIRECTION))
clone loc(player, current)
add loc(current, 0, 1.9, 0)
if(posX loc(current) < posX loc(POINT))
set data(vx, posX loc(POINT) - posX loc(current))
else set data(vx, (posX loc(current) - posX loc(POINT))*"-1")
if(posY loc(current) < posY loc(POINT))
set data(vy, posY loc(POINT) - posY loc(current))
else set data(vy, (posY loc(current) - posY loc(POINT))*"-1")
add velocity(data(vx) * 0.0075, data(vy) * 0.0025, 0)
if (get posX velocity>=0.3) set posX velocity(0.3)
if (get posY velocity>=0.3) set posY velocity(0.3)
if (get posZ velocity>=0.3) set posZ velocity(0.3)
}
on POINT { set var(r,1) set var(g,0) set var(b,0) }
on CENTER { set var(r,0.5) set var(g,1) set var(b,1) }
on set center {
set data(angle, ((data(AMOUNT)-(data(j)*(data(DIRECTION)))) * data(CENTER_INC)))
set data(x, posX location(POINT) + (all data(CENTER_RADIUS) * cos data(angle) ))
set data(y, posY location(POINT) + (all data(CENTER_RADIUS) * sin data(angle) ))
clone location(POINT, CENTER)
set posX location(CENTER, data(x))
set posY location(CENTER, data(y))
set data(center, CENTER)
}
on summon {
set data(center, POINT)
if (data(FLIP)==1) {do POINT} else {do CENTER}
do final summon
do "set center"
if (data(FLIP)!=1) {do POINT} else {do CENTER}
do final summon
}
on final summon {
for(set data(i,0) | data(i) < all data (POINT_AMOUNT) | set data(i,data(i)+1))
{
set data(angle, data(i) * all data(POINT_INC))
set data(x, posX location(data(center)) + (all data(POINT_RADIUS) * cos data(angle) ))
set data(y, posY location(data(center)) + (all data(POINT_RADIUS) * sin data(angle) ))
clone location(data(center), pos)
set posX location(pos, data(x))
set posY location(pos, data(y))
do "particle"
set data(x, posX location(data(center)) + ((all data(POINT_RADIUS)/2) * cos data(angle) ))
set data(y, posY location(data(center)) + ((all data(POINT_RADIUS)/2) * sin data(angle) ))
clone location(data(center), pos)
set posX location(pos, data(x))
set posY location(pos, data(y))
do "particle"
}
}
on particle {color particle(pos, REDSTONE, 0, var(r), var(g), var(b), true)}
on check {
if(data(AUTO_PLAY)==true) {
if(data(dir) == data(tempA))
return true
else
return false
}
if(data(dir) - all data(PERFECT) < data(tempA) && data(tempA) < data(dir) + all data(PERFECT))
return true
else
return false
}
on check tile left{if (data(TILE)+1 < size all list(tiles)){return true}else{return false}}
on check tile type {
set data(dir, get all list(tiles, data(TILE)))
if(data(dir)>=3000){
{set data(dir,data(dir)-3000)}
if(data(dumpTile)!=data(TILE)){
{set data(j,int(((data(j)%data(AMOUNT))/data(AMOUNT))*all data(SLOW)) )}
{set data(AMOUNT, all data(SLOW))}
set data(CENTER_INC, (2 * all data(PI)) / data(AMOUNT))
}
}
if(data(dir)>=2000){
{set data(dir,data(dir)-2000)}
if(data(dumpTile)!=data(TILE)){
{set data(j,int(((data(j)%data(AMOUNT))/data(AMOUNT))*all data(FAST)))}
{set data(AMOUNT, all data(FAST))}
set data(CENTER_INC, (2 * all data(PI)) / data(AMOUNT))
}
}
if(data(dir)>=1000){
{set data(dir,data(dir)-1000)}
if(data(dumpTile)!=data(TILE)){
{set data(DIRECTION, data(DIRECTION) * "-1")}
}
}
set data(dumpTile, data(TILE))
set data(dir, (int((data(dir) / 360)*data(AMOUNT)))* data(DIRECTION))
}
on tile select {
if(data(WAIT)==true) return
set data(tileLeft, do "check tile left")
do "check tile type"
set data(tempA, ((data(j) % data(AMOUNT))))
if (do check!=true) return
if (data(tileLeft)==true) set data(TILE,int(data(TILE)+1))
if (do "check tile left"==false) {do "done"}
set data(j,data(dir) )
do "set center"
set data(j, data(j) + (int (data(AMOUNT) / 2) * data(DIRECTION)))
if (data(FLIP)==1) {set data(FLIP,-1)} else {set data(FLIP,1)}
clone location(CENTER, POINT)
}
on swap hand { do tile select }
on interact {if(data(interactHand) == HAND) do tile select}
on done {
title(0,100,0,"축하합니다!","")
delay(100)left
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment