Example #1
0
    public void ExecAction(FighterHelper fh, Stats stats, int ind)
    {
        if (act[ind] == BURST) {
            stats.walk.gndSpeed=val[ind]*fh.IntFacingRight();
        }
        if (act[ind] == AIRBURST) {
            stats.motion.vel.x =valSp[ind].x*fh.IntFacingRight();
            stats.motion.vel.y =valSp[ind].y;
            fh.airborne=true;
        }
        if (act[ind] == BRAKE) {
            stats.walk.gndSpeed=stats.walk.gndSpeed*val[ind];

        }
        if (act[ind] == AIRBRAKE) {
            stats.motion.vel.x = (1.0f-valSp[ind].x)*stats.motion.vel.x;
            stats.motion.vel.y =(1.0f-valSp[ind].y)*stats.motion.vel.y;

        }
        if (act[ind] == AIRHOVER) {
            if ((valSp[ind].x == valSpEnd[ind].x) && (valSp[ind].y == valSpEnd[ind].y)) {
                stats.motion.vel.x = valSp[ind].x * fh.IntFacingRight();
                stats.motion.vel.y = valSp[ind].y + stats.grav;
            }else{
                float a = iTmr[cInd].tmr/ iTmr[cInd].GetLen();
                float b = 1.0f - a;
                stats.motion.vel.x = a*valSp[ind].x + b*valSpEnd[ind].x * fh.IntFacingRight();
                stats.motion.vel.y = a*valSp[ind].y + b*valSpEnd[ind].y + stats.grav;
            }
        }
        if (act[ind] == SLIDE) {
            stats.walk.gndSpeed=val[ind]*fh.IntFacingRight();

        }
    }