################
# > Flag British: The british flag floating above your head.
# > How to use: Spawn it. It will be above your head.
################

@name DA BRUTISH FLAG :D
@persist I A Target:entity Scale

interval(10)

if (first()|duped()) {
    Scale = 11.6
    # Background
    holoCreate(1)
    holoScale(1,vec(4,0.2,2)*Scale)
    holoPos(1,entity():pos()+vec(0,0,12*Scale))
    holoColor(1,vec(0,36,125))
    # White Stripes
    holoCreate(2)
    holoScale(2,vec(4.3,0.3,0.3)*Scale)
    holoPos(2,entity():pos()+vec(0,0,12*Scale))
    holoAng(2,ang(22.5,0,0))
    holoCreate(3)
    holoScale(3,vec(4.3,0.3,0.3)*Scale)
    holoPos(3,entity():pos()+vec(0,0,12*Scale))
    holoAng(3,ang(-22.5,0,0))
    holoCreate(4)
    holoScale(4,vec(3.95,0.3,0.4)*Scale)
    holoPos(4,entity():pos()+vec(0,0,12*Scale))
    holoCreate(5)
    holoScale(5,vec(0.4,0.3,1.9)*Scale)
    holoPos(5,entity():pos()+vec(0,0,12*Scale))
    # Red stripes
    holoCreate(6)
    holoScale(6,vec(4.3,0.4,0.1)*Scale)
    holoPos(6,entity():pos()+vec(0,0,12*Scale))
    holoAng(6,ang(22.5,0,0))
    holoColor(6,vec(207,20,43))
    holoCreate(7)
    holoScale(7,vec(4.3,0.4,0.1)*Scale)
    holoPos(7,entity():pos()+vec(0,0,12*Scale))
    holoAng(7,ang(-22.5,0,0))
    holoColor(7,vec(207,20,43))
    holoCreate(8)
    holoScale(8,vec(3.95,0.4,0.25)*Scale)
    holoPos(8,entity():pos()+vec(0,0,12*Scale))
    holoColor(8,vec(207,20,43))
    holoCreate(9)
    holoScale(9,vec(0.25,0.4,1.9)*Scale)
    holoPos(9,entity():pos()+vec(0,0,12*Scale))
    holoColor(9,vec(207,20,43))
    for (I=2,9) {
        holoParent(I,holoEntity(1))
    }
    Target=owner()
}

A+=1
Z=sin(A)*(5+Scale)

holoAng(1,ang(0,A,0))
holoPos(1,Target:pos()+vec(0,0,(83+Z)+Scale*12))

#holoPos(1,Target:pos()+vec(0,0,(83+Z)+Scale*12))
