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(); } }
void LoadPlayer() { attackBox = new AttkBox (); hitbox = new HitBox(); fHelper = new FighterHelper (); LoadMoveScript (MOVE_FILE); }
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); }
public void RunTimers(float timeLapsed, FighterHelper fh, Stats st) { if (cInd >= 0) { if (iTmr [cInd].RunTimer (timeLapsed)) { ExecAction(fh, st, cInd); if (cInd < len-1) cInd++; else cInd = -1; }else{ if(act[cInd]==SLIDE){ ExecAction(fh, st, cInd); } else if (act[cInd] == AIRHOVER) { fh.airborne = true; ExecAction(fh, st, cInd); } } } }
// 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; }