public int calculateFAF(int FAF) { ForgeACMDScript tempScript = new ForgeACMDScript(this.script); int gameFrame = -1; while (tempScript.currentFrame < FAF) { gameFrame++; tempScript.processToFrame(gameFrame); } return(tempScript.currentGameFrame); }
// Get the total number of in-game frames this move goes for, including // modified frame speed public int calculateTotalFrames(int totalAnimFrames) { ForgeACMDScript tempScript = new ForgeACMDScript(this.script); // Calculate frames int gameFrame = -1; while (tempScript.animationFrame < totalAnimFrames) { gameFrame++; tempScript.processToFrame(gameFrame); } return(gameFrame); }
public void RenderHurtboxes(float Frame, int scriptId, ForgeACMDScript ACMDScript, VBN VBN) { if (Hurtboxes.Count > 0) { GL.Enable(EnableCap.DepthTest); GL.Enable(EnableCap.Blend); if (ACMDScript != null) { if (ACMDScript.BodyIntangible) { return; } } if (scriptId != -1) { if (Frame + 1 >= MovesData[scriptId].IntangibilityStart && Frame + 1 < MovesData[scriptId].IntangibilityEnd) { return; } } foreach (var pair in Hurtboxes) { var h = pair.Value; if (!h.Visible) { continue; } var va = new Vector3(h.X, h.Y, h.Z); Bone b = ForgeACMDScript.getBone(h.Bone, VBN); if (b == null) { continue; } if (ACMDScript != null) { if (ACMDScript.IntangibleBones.Contains(h.Bone)) { continue; } } //va = Vector3.Transform(va, b.transform); GL.Color4(Color.FromArgb(Runtime.hurtboxAlpha, Runtime.hurtboxColor)); if (Runtime.renderHurtboxesZone) { switch (h.Zone) { case Hurtbox.LW_ZONE: GL.Color4(Color.FromArgb(Runtime.hurtboxAlpha, Runtime.hurtboxColorLow)); break; case Hurtbox.N_ZONE: GL.Color4(Color.FromArgb(Runtime.hurtboxAlpha, Runtime.hurtboxColorMed)); break; case Hurtbox.HI_ZONE: GL.Color4(Color.FromArgb(Runtime.hurtboxAlpha, Runtime.hurtboxColorHi)); break; } } if (ACMDScript != null) { if (ACMDScript.SuperArmor) { GL.Color4(Color.FromArgb(Runtime.hurtboxAlpha, 0x73, 0x0a, 0x43)); } if (ACMDScript.BodyInvincible) { GL.Color4(Color.FromArgb(Runtime.hurtboxAlpha, Color.White)); } if (ACMDScript.InvincibleBones.Contains(h.Bone)) { GL.Color4(Color.FromArgb(Runtime.hurtboxAlpha, Color.White)); } } var va2 = new Vector3(h.X2, h.Y2, h.Z2); //if (h.Bone != -1)va2 = Vector3.Transform(va2, b.transform); if (h.isSphere) { Rendering.ShapeDrawing.drawSphereTransformedVisible(va, h.Size, 30, b.transform); } else { Rendering.ShapeDrawing.drawReducedCylinderTransformed(va, va2, h.Size, b.transform); } if (Runtime.SelectedHurtboxID == h.ID) { GL.Color4(Color.FromArgb(Runtime.hurtboxAlpha, Runtime.hurtboxColorSelected)); if (h.isSphere) { Rendering.ShapeDrawing.drawWireframeSphereTransformedVisible(va, h.Size, 20, b.transform); } else { Rendering.ShapeDrawing.drawWireframeCylinderTransformed(va, va2, h.Size, b.transform); } } } GL.Disable(EnableCap.Blend); GL.Disable(EnableCap.DepthTest); } }
public void HandleACMD(string animname) { //if (ACMDEditor.manualCrc) // return; var crc = Crc32.Compute(animname.Replace(".omo", "").ToLower()); scriptId = -1; if (MovesetManager == null) { ACMDScript = null; return; } // Try and set up the editor try { if (ACMDEditor.crc != crc) { ACMDEditor.SetAnimation(crc); } } catch { } //Putting scriptId here to get intangibility of the animation, previous method only did it for animations that had game scripts if (MovesetManager.ScriptsHashList.Contains(crc)) { scriptId = MovesetManager.ScriptsHashList.IndexOf(crc); } // Game script specific processing stuff below here if (!MovesetManager.Game.Scripts.ContainsKey(crc)) { //Some characters don't have AttackS[3-4]S and use attacks[3-4] crc32 hash on scripts making forge unable to access the script, thus not visualizing these hitboxes //If the character doesn't have angled ftilt/fsmash if (animname == "AttackS4S.omo" || animname == "AttackS3S.omo") { HandleACMD(animname.Replace("S.omo", ".omo")); return; } //Ryu ftilts else if (animname == "AttackS3Ss.omo") { HandleACMD(animname.Replace("Ss.omo", "s.omo")); return; } else if (animname == "AttackS3Sw.omo") { HandleACMD(animname.Replace("Sw.omo", "w.omo")); return; } //Rapid Jab Finisher else if (animname == "AttackEnd.omo") { HandleACMD("Attack100End.omo"); return; } else if (animname.Contains("ZeldaPhantomMainPhantom")) { HandleACMD(animname.Replace("ZeldaPhantomMainPhantom", "")); return; } else if (animname == "SpecialHi1.omo") { HandleACMD("SpecialHi.omo"); return; } else if (animname == "SpecialAirHi1.omo") { HandleACMD("SpecialAirHi.omo"); return; } else { ACMDScript = null; HitboxList.refresh(); VariableViewer.refresh(); return; } } //Console.WriteLine("Handling " + animname); ACMDScript acmdScript = (ACMDScript)MovesetManager.Game.Scripts[crc]; // Only update the script if it changed if (acmdScript != null) { // If script wasn't set, or it was set and it changed, load the new script if (ACMDScript == null || (ACMDScript != null && ACMDScript.script != acmdScript)) { ACMDScript = new ForgeACMDScript(acmdScript); } } else { ACMDScript = null; } }