@name Anime a shit
@persist I N Str:string [E T]:entity A:angle V:vector Anims:table Quotes:array Md
@model models/props_junk/TrashBin01a.mdl
if(first())
{
    runOnTick(1)
    
    E = entity()
    E:setColor(0,0,0,0)
    E:propFreeze(0)
    E:setMass(200)
    
    Anims[1,string]="ACT_HL2MP_IDLE"
    Anims[2,string]="ACT_HL2MP_RUN"
    
    holoCreate(1,E:toWorld(vec(0,0,-35)))
    holoScale(1,vec(0.6))
    holoModel(1,"models/captainbigbutt/vocaloid/miku.mdl")
    holoBodygroup(1,3,1)
    holoParent(1,E)
    
    lightCreate(1,E:toWorld(vec(0,0,75)))
    lightColor(1,vec(0,0,255))
    lightParent(1,E)
    lightBrightness(1,25)
    
    Quotes = array(
	"LOL You're so Kawaii!! [Translator's Note: Kawaii Means Cute]","No one these days uses the term tsundere correctly","I'm not tasty at all.","I heard Nina likes it doggy style.","I claim this land in the name of Junior!","Miku sponsors the Reform for Underappreciated Glasses-kun Movement!","All I see in front of me are basic, skinny bitches.","...Don't laugh.","I'll just warn you now. I don't know how to use a computer.","being a masochist is totally okay!","vanishment! this! warudo!","de-de-des! dekomori des!","yeah, incest for the win!","welcome to the ouran high school host club!","my jumbo jet flies cheerfully!","just because i'm considered a pedo doesn't mean i'm a pervert!!!","what's wrong with pedophilia?","onii-chan~","am i kawaii yet?","uguuuu~~~","i bet you kiss girls, f****t","ur dum lol","if i wear a skirt, it means i'm a girl","desudesudesu","sonna koto ura no mata urabanashi desho","boku no pico is the best anime of all time","naruto is the worst gateway anime of all time","it's okay to like little girls because it's a fatherly instinct, right?","i guess you're gonna miss the panty raid","DAISUKI","the value of panties stem from the fact that they're hidden","mame kue! mame!","my wawifu > your waifu","like if tumblr brought you here XDDD","sent ;^)","(>*-*)>","#there#is#literally#nothing#wrong#with#being#jewish#","type quote here","My favorite series is Series[randint(1,Series:count()),string]!!!","if you can't see this, download sprops")
    Str = Quotes[randint(1,Quotes:count()),string]
    
    function number string:makeHoloString()
    {
        #I = Str:length()
        
        while(perf() & holoCanCreate() & I < This:length())
        {
            I++
            local N = I+1
            holoCreate(N,holoEntity(1):toWorld(vec(0,(I*15)-(This:length()*7.5)-7.5,75)),vec(1),entity():toWorld(ang(0,-90,0)))
            holoModel(N,"models/sprops/misc/alphanum/alphanum_"+This[I]:replace(".","prd"):replace("[","lbracket"):replace("]","rbracket"):replace("(","lpar"):replace(")","rpar"):replace("^","crt"):replace(":","colon"):replace(";","scolon"):replace(">","greaterthan"):replace("*","ast"):replace("?","qmark"):replace(",","com"):replace(" ","underscore"):replace("-","min"):replace("~","tilde"):replace("!","xmark"):replace("'","apost"):replace("#","star_2")+".mdl")
            if(This[I]==" ")
            {
                holoAlpha(N,0)
            }
            holoMaterial(N,"models/debug/debugwhite")
            holoParent(N,E)
            holoDisableShading(N,1)
        }
    }
    
    function entity:goto(Vector:vector)
    {
        This:applyForce(((Vector-This:pos())*10-This:vel())*This:mass())   
    }
    
    function entity:turnTo(Tarang:angle)
    {
        local V = This:toLocal(rotationVector(quat(Tarang)/quat(This))+This:pos())
        This:applyTorque((100*V - 30*This:angVelVector())*This:inertia()/3)
    }
    
    T = owner()
}

if(I==Str:length())
{
    rangerFilter(players())
    local JR = rangerOffset(100,E:pos()-vec(0,0,10),E:forward():setZ(0))
    J = changed(JR:hit())&JR:hit()
    if(J)
    {
        applyForce((E:forward()*200+E:up()*300)*E:mass())
    }
    
    local RD = rangerOffset(38,E:pos(),vec(0,0,-1))
    if(RD:hit()&!J)
    {
        E:goto(RD:pos()+vec(0,0,36)+V)
    }
    applyAngForce((angnorm(A:setPitch(0)-E:angles())*2-E:angVel()*0.6)*E:mass())
    
    if(changed(Md))
    {
        holoAnim(1,Anims[Md,string])
        holoSetPose(1,"move_scale",Md-1)
        holoSetPose(1,"move_x",Md-1)
        soundPlay("md",0.59,"vo/npc/male01/excuseme0"+randint(1,2)+".wav")
    }
    
    if(clk("new"))
    {
        stoptimer("new")
        Md = 0
    }
    
    #search, stand, walk
    switch(Md)
    {
        case 0,
        if(findCanQuery())
        {
            T = players()[randint(1,numPlayers()),entity]
            print("Selecting "+T:name())
                        
            Md = 1
            
            timer("new",random(15000,120000))
        }
        break
        
        case 1,
            V = vec()
            A = angnorm((T:shootPos()-E:pos()):toAngle())
            
            if(T:shootPos():distance(E:pos())>150)
            {
                Md = 2
            }
        break
        
        case 2,
            V = E:forward()*20
            A = angnorm((T:shootPos()-E:pos()):toAngle())
            
            if(T:shootPos():distance(E:pos())<150)
            {
                Md = 1
            }
        break
    }
}else
{
    Str:makeHoloString()
}

N+=15
holoSetPose(1,"head_pitch",-55+cos(N)*5)
