@name Phone
@inputs S:wirelink 
@outputs 
@persist State Pos:number 
@trigger 
runOnTick(1)

if (first()) {
    State = 0
    
    Pos = 1400
    
    S:egpClear()
    
    S:egpRoundedBox(1,vec2(Pos,1062),vec2(256,386))
    S:egpColor(1,vec(66,66,66))
    
    S:egpRoundedBox(2,vec2(Pos,1062),vec2(250,380))
    
    S:egpBox(3,vec2(Pos,1082),vec2(230,274))
    S:egpColor(3,vec(0,0,0))
    
    S:egpRoundedBox(4,vec2(Pos,900),vec2(30,4))
    S:egpColor(4,vec(100,100,100))
    
    S:egpRoundedBox(5,vec2(Pos,885),vec2(22,4))
    S:egpColor(5,vec(0,0,0))
    
    S:egpCircle(6,vec2(Pos - 40,900),vec2(5,5))
    S:egpColor(6,vec(0,0,0))
    
    S:egpCircle(7,vec2(Pos,1100),vec2(18,18))
    S:egpColor(7,vec(66,66,66))
    
    S:egpCircle(8,vec2(Pos,1100),vec2(17,17))
    
    S:egpCircle(9,vec2(Pos,1100),vec2(8,8))
    S:egpColor(9,vec(100,100,100))
    
    S:egpCircle(10,vec2(Pos,1100),vec2(6,6))
    
    S:egpText(11,"1. Make a song play.",vec2(Pos,912))
    S:egpAlign(11,1,1)
    
    S:egpText(12,"2. Put down phone.",vec2(Pos,932))
    S:egpAlign(12,1,1)
    
    S:egpText(13,"3. Heal yourself.",vec2(Pos,952))
    S:egpAlign(13,1,1)
    
    S:egpText(14,"4. God yourself.",vec2(Pos,972))
    S:egpAlign(14,1,1)
    
    S:egpText(15,"5. Ungod yourself.",vec2(Pos,992))
    S:egpAlign(15,1,1)
}

if (changed(owner():keyWalk()) & owner():keyWalk()) {
    State = 1
    
    S:egpPos(1,vec2(Pos,702))
    
    S:egpPos(2,vec2(Pos,702))
    
    S:egpPos(3,vec2(Pos,702))
    
    S:egpPos(4,vec2(Pos,539))
    
    S:egpPos(5,vec2(Pos,524))
    
    S:egpPos(6,vec2(Pos - 40,539))
    
    S:egpPos(7,vec2(Pos,864))
    
    S:egpPos(8,vec2(Pos,864))
    
    S:egpPos(9,vec2(Pos,864))
    
    S:egpPos(10,vec2(Pos,864))
    
    S:egpPos(11,vec2(Pos,632))
    
    S:egpPos(12,vec2(Pos,652))
    
    S:egpPos(13,vec2(Pos,672))
    
    S:egpPos(14,vec2(Pos,692))
    
    S:egpPos(15,vec2(Pos,712))
    
} elseif (changed(owner():keyPressed("1")) & owner():keyPressed("1") & State == 1) {
    soundPlay(0,10,"music/hl2_song15.mp3")
}

if (changed(owner():keyPressed("3")) & owner():keyPressed("3") & State == 1) {
    concmd("ulx hp " + owner():name() + " 100")
}

if (changed(owner():keyPressed("4")) & owner():keyPressed("4") & State == 1) {
    concmd("ulx god " + owner():name() + " ")
}

if (changed(owner():keyPressed("5")) & owner():keyPressed("5") & State == 1) {
    concmd("ulx ungod " + owner():name() + " ")
}

if (changed(owner():keyPressed("2")) & owner():keyPressed("2") & State == 1) {
    State = 0
    
    S:egpPos(1,vec2(Pos,1062))
    
    S:egpPos(2,vec2(Pos,1062))
    
    S:egpPos(3,vec2(Pos,1082))
    
    S:egpPos(4,vec2(Pos,900))
    
    S:egpPos(5,vec2(Pos,885))
    
    S:egpPos(6,vec2(Pos - 40,900))
    
    S:egpPos(7,vec2(Pos,1132))
    
    S:egpPos(8,vec2(Pos,1132))
    
    S:egpPos(9,vec2(Pos,1132))
    
    S:egpPos(10,vec2(Pos,1132))
    
    S:egpPos(11,vec2(Pos,932))
    
    S:egpPos(12,vec2(Pos,952))
    
    S:egpPos(13,vec2(Pos,972))
    
    S:egpPos(14,vec2(Pos,992))
    
    S:egpPos(15,vec2(Pos,1102))
}
