Пример #1
0
    public void Awake()
    {
        PROJ_LMT = 3;
        chLv = 2.0f;
        chMx = 4.0f;
        stunTimer = new STimer ();
        thwTmr = new STimer (throwTime);
        grbTmr = new STimer (grabTime);
        attackBox=new AttkBox(KIR_NUMANIMS);
        hitbox = new HitBox();

        LoadPlayer ();
        stats.id.fighter = KIROCH;

        chargeT=0;
        if (projectile == null)
            projectile = new plProjectile[PROJ_LMT];
        for (int i=0; i<PROJ_LMT; i++)
            projectile [i]=new plProjectile();
        for(int i=0;i<PROJ_LMT;i++){
            projectile[i].SetAtkData(12.0f, 1.6f, 2.0f);
            projectile[i].Scale(5.0f);
            projectile[i].ps = fireBall[i];
        }
        sbSpd=0;
        scSpd=0;
    }
Пример #2
0
 void LoadPlayer()
 {
     attackBox = new AttkBox ();
     hitbox = new HitBox();
     fHelper = new FighterHelper ();
     LoadMoveScript (MOVE_FILE);
 }
Пример #3
0
    public virtual void LoadPlayer()
    {
        FindPNum ();
        attackBox = new AttkBox ();
        attackBox.grabRange = stats.grabRange;
        hitbox = new HitBox();
        fHelper = new FighterHelper ();
        hitbox.AllocateFirstIndices(1);//for a 1 dimensional array of vertices
        hitbox.AllocateSecondIndices(0, 4);
        hitbox.SetVertex(-stats.size.x/2, 0, 0, 3);
        hitbox.SetVertex(stats.size.x/2, 0, 0, 2);
        hitbox.SetVertex(stats.size.x/2, stats.size.y, 0, 1);
        hitbox.SetVertex(-stats.size.x/2, stats.size.y, 0, 0);
        fHelper.grabBox = new HitBox ();
        fHelper.grabBox.AllocateFirstIndices (1);
        fHelper.grabBox.AllocateSecondIndices (0, 4);
        fHelper.grabBox.SetVertex (-stats.size.x / 2, stats.size.y + stats.edgegrab.hgt, 0, 0);
        fHelper.grabBox.SetVertex (-stats.size.x / 2, stats.size.y, 0, 3);
        fHelper.grabBox.SetVertex (-stats.size.x / 2 - stats.edgegrab.wid, stats.size.y, 0, 2);
        fHelper.grabBox.SetVertex (-stats.size.x / 2 - stats.edgegrab.wid, stats.size.y + stats.edgegrab.hgt, 0, 16);
        fHelper.grabBox.isActive = false;
        fHelper.sScale=1;

        //pPtcl.LoadParticles(eng, stats.id.num, "Yara");

        //LoadMoveScript(MOVESCRIPT);
    }
Пример #4
0
    public virtual void LoadPlayer()
    {
        attackBox = new AttkBox(MOVENUM);
        hitbox = new HitBox();

        stats.LoadStats(STATS_FILE);
        attackBox.LoadFromScript(SCRIPT_FILE, 1, stats.size.y);
        LoadMoveScript(MOVESCRIPT);

        stats.id.num = plNum;//todo not hard code

        attackBox.grabRange = stats.grabRange;
        hitbox = new HitBox();
        fHelper = new NinjaHelper ();
        SetPlayer();
        transform.Rotate(0, 90.0f, 0);
        fHelper.Animate("Idle", true, 0);
        FindPNum();
        hitbox.AllocateFirstIndices(1);//for a 1 dimensional array of vertices
        hitbox.AllocateSecondIndices(0, 4);
        hitbox.SetVertex(-stats.size.x/2, 0, 0, 3);
        hitbox.SetVertex(stats.size.x/2, 0, 0, 2);
        hitbox.SetVertex(stats.size.x/2, stats.size.y, 0, 1);
        hitbox.SetVertex(-stats.size.x/2, stats.size.y, 0, 0);

        //pPtcl.LoadParticles(eng, stats.id.num, "Yara");

        //LoadMoveScript(MOVESCRIPT);
    }
Пример #5
0
    // Use this for initialization
    public void Awake()
    {
        PROJ_LMT = 0;
        stunTimer = new STimer ();
        thwTmr = new STimer (throwTime);
        grbTmr = new STimer (grabTime);
        scTmr = new STimer ();
        spa1 = new STimer ();
        spb1 = new STimer ();
        spc1 = new STimer ();
        spc2 = new STimer ();
        spc3 = new STimer ();
        spaTmr = new STimer (1.5f);
        hitbox = new HitBox();
        fHelper = new FighterHelper ();

        stats.id.fighter = SERENITY;
        attackBox=new AttkBox(SER_NUMANIMS);
        stats.tumble.loop=true;
        //psysword=plSerenSword(plNum);
        scSpd=0;

        //for(int i=0;i<PROJ_LMT;i++){
        //	projectile[i].SetAtkData(12.0f, 1.6f, 2.0f);
        //	projectile[i].Scale(5.0f);
        //}

        scSpd=0;

        GameObject goSword = Instantiate(Resources.Load("SerenSword")) as GameObject;
        DontDestroyOnLoad(goSword);

        psysword = goSword.GetComponent ("plSerenSword") as plSerenSword;
        psysword.fHelper.TR.Rotate (0, -90, 0);
        psysword.fHelper.FaceRight (true);
        LoadPlayer ();
        psysword.transform.position = new Vector3 (transform.position.x + 10, transform.position.y + 10, 0);
        psysword.stats.motion.pos = new SPoint (transform.position.x + 10, transform.position.y + 10);
        psysword.plNum=11;
    }
Пример #6
0
    /*void LoadMoveScript(string s){

        int endL, enPos;
        float dVal;
    std:string par, val, line;
        ifstream infile;//get the polygon count for the arrays
        infile.open(s);
        if (infile.is_open()){
            while ( infile.good() ){
                getline (infile,line);
                endL = line.length()-1;
                enPos = line.find_first_of("=");
                par = line.substr(0, enPos);
                val = line.substr(enPos+1, line.length());
                dVal = atof(val.c_str());
                if(par.compare("scSpeed") == 0)
                    scSpd=dVal;
            }
        }

    }*/
    bool LoadPlayer()
    {
        FindPNum ();

        attackBox = new AttkBox ();
        hitbox = new HitBox();

        hitbox.AllocateFirstIndices(1);//for a 1 dimensional array of vertices
        hitbox.AllocateSecondIndices(0, 4);
        hitbox.SetVertex(-stats.size.x/2, 0, 0, 3);
        hitbox.SetVertex(stats.size.x/2, 0, 0, 2);
        hitbox.SetVertex(stats.size.x/2, stats.size.y, 0, 1);
        hitbox.SetVertex(-stats.size.x/2, stats.size.y, 0, 0);
        fHelper.grabBox = new HitBox();
        fHelper.grabBox.AllocateFirstIndices(1);
        fHelper.grabBox.AllocateSecondIndices(0, 4);
        fHelper.grabBox.SetVertex(-stats.size.x/2, stats.size.y + stats.edgegrab.hgt, 0, 0);
        fHelper.grabBox.SetVertex(-stats.size.x/2, stats.size.y, 0, 3);
        fHelper.grabBox.SetVertex(-stats.size.x/2 - stats.edgegrab.wid, stats.size.y, 0, 2);
        fHelper.grabBox.SetVertex(-stats.size.x/2 - stats.edgegrab.wid, stats.size.y + stats.edgegrab.hgt, 0, 16);
        fHelper.grabBox.isActive = false;
        fHelper.sScale=1;
        //fHelper.Load(eng, MESH_FILE, GetPos());
        stats.LoadStats(STATS_FILE);

        attackBox.LoadFromScript(SCRIPT_FILE, fHelper.sScale, stats.size.y);

        stats.id.num = plNum;//todo not hard code
        SetPlayer ();
        transform.Rotate (0, 90.0f, 0);
        fHelper.Animate ("Idle", true, 0);
        LoadMoveScript (MOVE_FILE);

        //

        //psysword.Load( PSYSWORD_MESH_FILE, GetPos());//load sword model
        //psysword.LoadAnimHolder( PSYSWORD_ANIMHELP, GetPos());//load serenity's anims for reference
        psysword.attackBox.LoadFromScript(SCRIPT_FILE, fHelper.sScale, stats.size.y);
        SPoint bT = new SPoint(0, -psysword.stats.size.y);

        psysword.attackBox.TranslateAttack(bT, NB);
        psysword.attackBox.TranslateAttack(bT, SB);
        psysword.attackBox.TranslateAttack(bT, UB);
        psysword.attackBox.TranslateAttack(bT, DB);

        //LoadMoveScript(MOVESCRIPT);
        return true;
    }