private void UpdateShip() { this.UpdateInputShip(); WMActor controlledActor = this.ControlledActor; if (!controlledActor.isControllable) { Input.ResetInputAxes(); } this.UpdateSmoothedMovementDirectionShip(); controlledActor.moveDirection = controlledActor.transform.TransformDirection(Vector3.forward); controlledActor.moveDirection.Normalize(); controlledActor.moveSpeed = controlledActor.walkSpeed * controlledActor.moveZ; Vector3 position = controlledActor.transform.position; position.y += controlledActor.MoveY * controlledActor.VerticalSpeed * Time.deltaTime; Single num = Mathf.Abs(0.164794922f); if (position.y > num) { position.y = num; } if (controlledActor.moveZ > 0f) { controlledActor.State = WMActorStateDebug.Running; } else if (controlledActor.moveZ < 0f) { controlledActor.State = WMActorStateDebug.Running; } else { controlledActor.State = WMActorStateDebug.Idle; } }
public static void geoDetachInWorld(Obj obj) { WMActor wmActor = ((Actor)obj).wmActor; wmActor.transform.parent = wmActor.World.TranslatingObjectsGroup; Actor actor = (Actor)obj; actor.objParent = (Obj)null; }
public static void SetControlledDebugActor(Int32 statusIndex, Int32 controlNo) { WMActor.ControlledDebugDebugActor = WMActor.GetControlledDebugActor(statusIndex, controlNo); WMBeeChocobo component = WMActor.ControlledDebugDebugActor.GetComponent <WMBeeChocobo>(); if (component) { component.SetType(statusIndex); } }
public static Boolean IsWorldTrigger() { WMActor controlChar = ff9.GetControlChar(); if (controlChar != (UnityEngine.Object)null) { ff9.s_moveCHRStatus s_moveCHRStatus = ff9.w_moveCHRStatus[(Int32)controlChar.originalActor.index]; return(ff9.m_GetIDEvent(s_moveCHRStatus.id) != 0 && ff9.w_frameEventEnable); } return(false); }
public void SetAnimationSpeeds(Single speed) { for (ObjList objList = this.World.ActorList; objList != null; objList = objList.next) { if (objList.obj.cid == 4) { WMActor wmActor = ((Actor)objList.obj).wmActor; wmActor.SetAnimationSpeed(speed); } } }
public override void HonoAwake() { global::Debug.Log("WMScriptDirector.HonoAwake(): This should be called first of all things in WorldMap, than other WM* signletons."); if (!FF9StateSystem.World.IsBeeScene) { EMinigame.InitializeAllTreasureAchievement(); EMinigame.InitializeAllSandyBeachAchievement(); } ff9.w_moveDummyCharacter = new GameObject("moveDummy").AddComponent <WMActor>(); ff9.w_moveDummyCharacter.transform.parent = Singleton <WMWorld> .Instance.WorldMapRoot; ff9.w_moveDummyCharacter.originalActor = new Actor(); PersistenSingleton <HonoInputManager> .Instance.IgnoreCheckingDirectionSources = true; Transform transform = GameObject.Find("Bee").transform; UnityEngine.Object.Destroy(transform.gameObject); Application.targetFrameRate = 20; Singleton <WMWorld> .Instance.Initialize(); this.World = Singleton <WMWorld> .Instance; this.World.ClipDistance = 300000; this.World.Settings.WrapWorld = true; this.World.OnInitialize(); if (FF9StateSystem.World.IsBeeScene) { Singleton <WMAnimationBank> .Instance.Initialize(); WMActor.Initialize(); Singleton <WMBeeMovementAnimation> .Instance.Initialize(); } PersistenSingleton <FF9StateSystem> .Instance.mode = 3; this.FF9 = FF9StateSystem.Common.FF9; this.FF9Sys = PersistenSingleton <FF9StateSystem> .Instance; this.FF9World = FF9StateSystem.World.FF9World; this.FF9WorldMap = FF9StateSystem.World.FF9World.map; this.FF9WorldMap.nextMode = 3; ff9.ff9InitStateWorldMap((Int32)this.FF9.wldMapNo); base.StartCoroutine(PersistenSingleton <FF9TextTool> .Instance.UpdateFieldText(68)); if (!FF9StateSystem.World.IsBeeScene) { PersistenSingleton <EventEngine> .Instance.ServiceEvents(); } ff9.w_frameSystemConstructor(); if (!FF9StateSystem.World.IsBeeScene) { ff9.w_frameMapConstructor(); } if (FF9StateSystem.World.IsBeeScene) { this.BeeMovementAnimation = Singleton <WMBeeMovementAnimation> .Instance; } this.RenderTextureBank = Singleton <WMRenderTextureBank> .Instance; RenderSettings.fog = true; }
public void UpdateHuman() { WMActor controlledActor = this.ControlledActor; if (!controlledActor.isControllable) { Input.ResetInputAxes(); } this.UpdateSmoothedMovementDirectionHuman(); Vector3 vector = controlledActor.moveDirection * controlledActor.moveSpeed; vector *= Time.deltaTime; if (FF9StateSystem.World.IsBeeScene && controlledActor.Animation) { if (controlledActor.State == WMActorStateDebug.Idle) { if (!controlledActor.Animation.IsPlaying(controlledActor.GetAnimationClipName(WMActorStateDebug.Idle))) { controlledActor.Animation.Play(controlledActor.GetAnimationClipName(WMActorStateDebug.Idle)); } } else if (controlledActor.State == WMActorStateDebug.Running) { controlledActor.Animation[controlledActor.GetAnimationClipName(WMActorStateDebug.Running)].speed = controlledActor.AnimationSpeed; if (!controlledActor.Animation.IsPlaying(controlledActor.GetAnimationClipName(WMActorStateDebug.Running))) { controlledActor.Animation.Play(controlledActor.GetAnimationClipName(WMActorStateDebug.Running)); } } else if (controlledActor.State == WMActorStateDebug.Sprint) { controlledActor.Animation[controlledActor.GetAnimationClipName(WMActorStateDebug.Running)].speed = 1f; if (!controlledActor.Animation.IsPlaying(controlledActor.GetAnimationClipName(WMActorStateDebug.Running))) { controlledActor.Animation.Play(controlledActor.GetAnimationClipName(WMActorStateDebug.Running)); } } } if (!this.IsGrounded()) { Vector3 vector2 = vector; vector2.y = 0f; if (vector2.sqrMagnitude > 0.001f) { } } if (this.IsGrounded()) { controlledActor.lastGroundedTime = Time.time; } }
private static WMActor GetStartupControlledActor() { if (FF9StateSystem.World.IsBeeScene) { return(WMActor.GetControlledDebugActor(1, 0)); } PosObj controlChar = PersistenSingleton <EventEngine> .Instance.GetControlChar(); if (controlChar != null) { return(((Actor)controlChar).wmActor); } return((WMActor)null); }
private void UpdateInputPlane() { WMActor controlledActor = this.ControlledActor; if (Input.GetKey(KeyCode.N) || Input.GetKey(KeyCode.JoystickButton0)) { controlledActor.moveZ = 1f; } else if (Input.GetKey(KeyCode.M) || Input.GetKey(KeyCode.JoystickButton1)) { controlledActor.moveZ = -1f; } else { controlledActor.moveZ = 0f; } }
private void DrawSetPositionMenu() { if (GUILayout.Button("Go to Cleyra", new GUILayoutOption[0])) { ff9.w_moveActorPtr.SetPosition(233768.5f, 1101.8f, -201550.9f); ff9.w_movementChrInitSlice(); this.showSetPositionMenu = false; } if (GUILayout.Button("Go to Dhali", new GUILayoutOption[0])) { ff9.w_moveActorPtr.SetPosition(283801.3f, 7295.1f, -207228.9f); ff9.w_movementChrInitSlice(); this.showSetPositionMenu = false; } if (GUILayout.Button("Go to Lindblum", new GUILayoutOption[0])) { ff9.w_moveActorPtr.SetPosition(232612.8f, 6736.6f, -277148f); ff9.w_movementChrInitSlice(); this.showSetPositionMenu = false; } if (GUILayout.Button("Go to Alexandria", new GUILayoutOption[0])) { WMScriptDirector.Instance.SetChocoboAsMainCharacter(); WMActor controlledDebugDebugActor = WMActor.ControlledDebugDebugActor; Singleton <WMWorld> .Instance.SetAbsolutePositionOf(controlledDebugDebugActor.transform, new Vector3(1270.8f, 26.8f, -691.6f), 0f); ff9.w_movementChrInitSlice(); this.showSetPositionMenu = false; } if (GUILayout.Button("Go to Water Shrine", new GUILayoutOption[0])) { WMScriptDirector.Instance.SetChocoboAsMainCharacter(); ff9.w_moveActorPtr.SetPosition(53354.1f, -259.4f, -157476.9f); ff9.w_movementChrInitSlice(); this.showSetPositionMenu = false; } if (GUILayout.Button("Go to Fire Shrine", new GUILayoutOption[0])) { WMScriptDirector.Instance.SetChocoboAsMainCharacter(); ff9.w_moveActorPtr.SetPosition(131381f, 2583.2f, -27989.6f); ff9.w_movementChrInitSlice(); this.showSetPositionMenu = false; } }
private void UpdateSmoothedMovementDirectionShip() { WMActor controlledActor = this.ControlledActor; Vector2 axis = PersistenSingleton <HonoInputManager> .Instance.GetAxis(); Single y = axis.y; Single x = axis.x; controlledActor.bodyRotateSpeedZ = controlledActor.RollSpeed; controlledActor.bodyMaxRotationZ = controlledActor.RollMaxAngle; if (x > 0f) { Quaternion rotation = controlledActor.transform.rotation; Vector3 angle = rotation.eulerAngles; angle.y += controlledActor.RotateSpeed * Time.deltaTime; rotation.eulerAngles = angle; controlledActor.transform.rotation = rotation; } else if (x < 0f) { Quaternion rotation = controlledActor.transform.rotation; Vector3 angle = rotation.eulerAngles; angle.y -= controlledActor.RotateSpeed * Time.deltaTime; rotation.eulerAngles = angle; controlledActor.transform.rotation = rotation; } else if (controlledActor.bodyRotationZ < 0f) { controlledActor.bodyRotationZ += controlledActor.bodyRotateSpeedZ * Time.deltaTime; if (controlledActor.bodyRotationZ > 0f) { controlledActor.bodyRotationZ = 0f; } } else if (controlledActor.bodyRotationZ > 0f) { controlledActor.bodyRotationZ += -controlledActor.bodyRotateSpeedZ * Time.deltaTime; if (controlledActor.bodyRotationZ < 0f) { controlledActor.bodyRotationZ = 0f; } } }
private void UpdatePlane() { this.UpdateInputPlane(); WMActor controlledActor = this.ControlledActor; if (!controlledActor.isControllable) { Input.ResetInputAxes(); } controlledActor.moveDirection = controlledActor.transform.TransformDirection(Vector3.forward); controlledActor.moveDirection.Normalize(); if (controlledActor.moveZ > 0f) { controlledActor.State = WMActorStateDebug.Running; } else if (controlledActor.moveZ < 0f) { controlledActor.State = WMActorStateDebug.Running; } else { controlledActor.State = WMActorStateDebug.Idle; } if (FF9StateSystem.World.IsBeeScene) { if (controlledActor.State == WMActorStateDebug.Idle) { if (!controlledActor.Animation.IsPlaying(controlledActor.GetAnimationClipName(WMActorStateDebug.Idle))) { controlledActor.Animation.Play(controlledActor.GetAnimationClipName(WMActorStateDebug.Idle)); } } else if (controlledActor.State == WMActorStateDebug.Running && !controlledActor.Animation.IsPlaying(controlledActor.GetAnimationClipName(WMActorStateDebug.Running))) { controlledActor.Animation.Play(controlledActor.GetAnimationClipName(WMActorStateDebug.Running)); } } }
private void Intialize() { this.Actor = base.GetComponent <WMActor>(); this.renderers = base.GetComponentsInChildren <Renderer>(); }
public static void CollisionRequest(PosObj po) { Boolean flag = false; EventEngine instance = PersistenSingleton <EventEngine> .Instance; Int32 nil = instance.nil; Single nilFloat = instance.nilFloat; Obj obj; if (EventCollision.CheckNPCInput(po)) { if (instance.gMode != 3) { return; } obj = EventCollision.Collision(instance, po, 2, ref nilFloat); } else { obj = EventCollision.Collision(instance, po, 4, ref nilFloat); if (obj != null) { EventCollision.sSysAngle = EventCollision.CollisionAngle(po, obj); if (EventCollision.sSysAngle > -1024 && EventCollision.sSysAngle < 1024) { if (EventCollision.IsNPCTalkable(obj)) { flag = EIcon.PollCollisionIcon(obj); } if (!flag) { obj = EventCollision.Collision(instance, po, 2, ref nilFloat); } } else { obj = EventCollision.Collision(instance, po, 2, ref nilFloat); } } else { obj = EventCollision.Collision(instance, po, 2, ref nilFloat); if (instance.gMode == 3 && obj != null) { WMActor wmActor = ((Actor)po).wmActor; if (wmActor.ControlNo == 0) { flag = EIcon.PollCollisionIcon(obj); } } } } if (obj != null && EventCollision.CheckNPCPush((PosObj)obj)) { instance.Request(obj, 1, 2, false); } if (EventCollision.CheckQuadInput(po)) { return; } obj = instance.TreadQuad(po, 2); if (obj != null) { Boolean flag2 = EventCollision.CheckQuadPush(po, obj) && instance.Request(obj, 1, 2, false); if (flag2) { if (instance.GetIP((Int32)obj.sid, 8, obj.ebData) != instance.nil) { EIcon.PollFIcon(2); } else { Int16 fldMapNo = FF9StateSystem.Common.FF9.fldMapNo; if (fldMapNo == 2108) { if (EventCollision.CheckQuadTalk(po, obj)) { EIcon.PollFIcon(1); } } } } } obj = instance.TreadQuad(po, 4); if (obj != null && EventCollision.CheckQuadTalk(po, obj) && EventCollision.IsQuadTalkable(po, obj)) { EIcon.PollCollisionIcon(obj); } if (instance.gMode == 3 && obj == null) { if (EventCollision.IsChocoboWalkingOrFlyingInForestArea()) { EIcon.PollFIcon(1); } else if (!flag && EMinigame.CheckBeachMinigame()) { EIcon.PollFIcon(3); } } }
public static Obj Collision(EventEngine eventEngine, PosObj po, Int32 mode, ref Single distance) { Obj result = (Obj)null; Single num = Single.MaxValue; Boolean flag = (mode & 4) > 0; Int32 num2 = (Int32)(4 * (Byte)((!flag) ? po.collRad : po.talkRad)); Vector3 a = Vector3.zero; if (eventEngine.gMode != 1) { if (eventEngine.gMode == 3) { WMActor wmActor = ((Actor)po).wmActor; a = wmActor.RealPosition; } for (ObjList objList = eventEngine.GetActiveObjList(); objList != null; objList = objList.next) { Obj obj = objList.obj; if (obj.sid != 5 || eventEngine.gMode == 3) { } Byte b = (Byte)((obj.uid != eventEngine.GetControlUID()) ? 4 : 2); Boolean flag2 = (po.flags & b) > 0; Single num3 = (Single)((!flag && !flag2) ? 0 : 1); Byte b2 = (Byte)((!flag) ? ((Byte)((po.uid != eventEngine.GetControlUID()) ? 4 : 2)) : 8); Single num4 = (Single)(obj.flags & b2); if (obj != po) { Boolean flag3 = num3 <= 0f; Boolean flag4 = num4 <= 0f; if (flag3 || flag4) { flag3 = ((mode & 6) <= 0); flag4 = (eventEngine.GetIP((Int32)obj.sid, (Int32)((!flag) ? 2 : 3), obj.ebData) != eventEngine.nil); if ((flag3 || flag4) && obj.cid == 4) { Actor actor = (Actor)obj; Single num5 = 0f; Int32 num6 = (Int32)(4 * (Byte)((!flag) ? actor.collRad : actor.talkRad)); PosObj posObj = (PosObj)obj; if (posObj.ovalRatio > 0) { num6 = EventCollision.CalculateRadiusFromOvalRatio(po, posObj, num6); } num6 += num2; if ((mode & 6) != 0) { num6 += (Int32)(actor.speed + 60); } if (eventEngine.gMode == 3) { Single num7 = Vector3.Distance(a, actor.wmActor.RealPosition); Single num8 = num7 * 256f; num5 = num8; } if ((Single)num6 > num5 && num > num5) { result = actor; num = num5; } } } } } if (distance > 0f) { distance = num; } return(result); } FieldMapActorController component = po.go.GetComponent <FieldMapActorController>(); if (component == (UnityEngine.Object)null) { return((Obj)null); } return(component.walkMesh.Collision(component, mode, out distance)); }
private bool MoveToward_mixed(float x, float y, float z, int flags, PosObj flagsPosObj) { Actor actor = (Actor)this.gCur; if (FF9StateSystem.Common.FF9.fldMapNo == 1823 && actor.sid == 13 && (int)x == -365 && (int)z == -373) { x = -389f; z = -600f; } if (FF9StateSystem.Common.FF9.fldMapNo == 1550 && actor.sid == 15 && (int)x == -1109 && (int)z == -1014) { x = -1155f; z = -1070f; } GameObject go = this.gCur.go; float num = (float)actor.speed; float num2 = 0f; PosObj posObj = (PosObj)null; FieldMapActorController fieldMapActorController = (FieldMapActorController)null; WMActor wmactor = (WMActor)null; float num3 = 0f; float num4 = 0f; float num5 = 0f; Vector3 vector = Vector3.zero; if (this.gMode == 1) { fieldMapActorController = actor.fieldMapActorController; if (fieldMapActorController == (UnityEngine.Object)null) { num3 = actor.pos[0]; num4 = actor.pos[1]; num5 = actor.pos[2]; } else { num3 = fieldMapActorController.curPos.x; num4 = fieldMapActorController.curPos.y; num5 = fieldMapActorController.curPos.z; } vector = actor.rotAngle; } else if (this.gMode == 3) { wmactor = actor.wmActor; num3 = actor.pos[0]; num4 = actor.pos[1]; num5 = actor.pos[2]; } float deltaX = x - num3; float num6 = y - num4; float deltaZ = z - num5; float num7; if (((int)actor.actf & EventEngine.actLockDir) != 0) { num7 = ((this.gMode != 1) ? wmactor.rot1 : vector.y); num7 = EventEngineUtils.ClampAngle(num7); } else { num7 = this.eBin.angleAsm(deltaX, deltaZ); if ((flags & 1) == 0 || flagsPosObj != null) { float num8 = (this.gMode != 1) ? wmactor.rot1 : vector.y; num8 = EventEngineUtils.ClampAngle(num8); float num9 = num7 - num8; if (num9 < -180f) { num9 += 360f; } if (num9 > 180f || EventEngineUtils.nearlyEqual(num9, 180f)) { num9 -= 360f; } if ((FF9StateSystem.Common.FF9.fldMapNo != 307 || this.gCur.sid != 11) && (FF9StateSystem.Common.FF9.fldMapNo != 610 || this.gCur.sid != 3) && EventEngineUtils.nearlyEqual(num9, 0f)) { Actor actor2 = actor; actor2.actf = (ushort)(actor2.actf | (ushort)EventEngine.actLockDir); } int num10 = (int)actor.omega << 3; float num11 = EventEngineUtils.ConvertFixedPointAngleToDegreeWithOutShiftRight((short)num10); if (num9 > 0f) { if (num9 > num11) { num7 = num8 + num11; } } else if (num9 < -num11) { num7 = num8 - num11; } num7 = EventEngineUtils.ClampAngle(num7); if (this.gMode == 1) { vector.y = num7; actor.rotAngle[1] = num7; } else if (this.gMode == 3) { wmactor.rot1 = num7; } } } float num13; if ((flags & 2) != 0 && flagsPosObj == null) { num6 = y - num4; float num12 = this.distance(deltaX, 0f, deltaZ); num13 = this.eBin.angleAsm(-num6, -num12); num13 = EventEngineUtils.ClampAngle(num13); float num8 = actor.rot0; num8 = EventEngineUtils.ClampAngle(num8); float num9 = num13 - num8; if (num9 < -180f) { num9 += 360f; } else if (num9 > 180f || EventEngineUtils.nearlyEqual(num9, 180f)) { num9 -= 360f; } int num10 = (int)actor.omega << 3; float num14 = EventEngineUtils.ConvertFixedPointAngleToDegreeWithOutShiftRight((short)num10); if (num9 > 0f) { if (num9 > num14) { num13 = num8 + num14; } } else if (num9 < -num14) { num13 = num8 - num14; } num13 = EventEngineUtils.ClampAngle(num13); actor.rot0 = num13; } else { num13 = 0f; num6 = 0f; } Vector3 vector2; EventEngine.GetMoveVector(out vector2, num13, num7, (float)actor.speed); if (fieldMapActorController != (UnityEngine.Object)null && fieldMapActorController.name == fieldMapActorController.fieldMap.debugObjName) { Vector3 a = new Vector3(num3, num4, num5); Vector3 vector3 = vector2; Vector3 b = vector3.normalized * 100f * vector3.magnitude; Vector3 b2 = new Vector3(0f, 100f, 0f); Vector3 vector4 = new Vector3(x, y, z); global::Debug.DrawLine(a + b2, a + b + b2, Color.magenta, 2f, true); global::Debug.DrawLine(a + b2, a + Vector3.up * 50f + b2, Color.blue, 2f, true); } Vector3 vector5 = new Vector3(num3, num4, num5) + vector2; if (this.gMode == 1) { fieldMapActorController = actor.fieldMapActorController; if (fieldMapActorController == (UnityEngine.Object)null) { actor.pos[0] = vector5.x; actor.pos[1] = vector5.y; actor.pos[2] = vector5.z; } else { fieldMapActorController.curPos += vector2; fieldMapActorController.SyncPosToTransform(); } } else if (this.gMode == 3) { wmactor.SetPosition(vector5.x, vector5.y, vector5.z); } if (this.gMode == 1 && fieldMapActorController != (UnityEngine.Object)null) { if (fieldMapActorController.originalActor.uid == 2 && FF9StateSystem.Common.FF9.fldMapNo == 1605 && this.eBin.getVarManually(220) == 6622) { fieldMapActorController.originalActor.collRad = 10; } if (fieldMapActorController.originalActor.uid == 18 && FF9StateSystem.Common.FF9.fldMapNo == 575 && this.eBin.getVarManually(220) == 3165) { fieldMapActorController.originalActor.collRad = 34; } posObj = fieldMapActorController.walkMesh.Collision(fieldMapActorController, 0, out num2); if (posObj != null && (num2 < 0f || EventEngineUtils.nearlyEqual(num2, 0f))) { fieldMapActorController.curPos -= vector2; } } else if (this.gMode == 3) { posObj = (PosObj)this.Collision(this, actor, 0, ref num2); if (posObj != null && (num2 < 0f || EventEngineUtils.nearlyEqual(num2, 0f))) { wmactor.SetPosition(num3, num4, num5); } actor.pos[0] = vector5[0]; actor.pos[1] = vector5[1]; actor.pos[2] = vector5[2]; } if (actor.loopCount != 0 && actor.loopCount != 255) { Actor actor3 = actor; actor3.loopCount = (byte)(actor3.loopCount - 1); } bool flag = actor.loopCount != 0; if (flagsPosObj != null) { bool flag2 = posObj != flagsPosObj; bool flag3 = num2 > 0f; flag = (flag2 || flag3); } num2 = this.dist64(deltaX, num6, deltaZ); bool flag4 = num2 > actor.lastdist; if (FF9StateSystem.Common.FF9.fldMapNo == 456 && this.eBin.getVarManually(EBin.SC_COUNTER_SVR) == 2800) { if (actor.sid == 2) { flag4 = (!EventEngineUtils.nearlyEqual(num2, actor.lastdist) && num2 > actor.lastdist); } } else if (FF9StateSystem.Common.FF9.fldMapNo == 455 && this.eBin.getVarManually(EBin.SC_COUNTER_SVR) == 2800) { if (actor.sid == 1) { flag4 = (!EventEngineUtils.nearlyEqual(num2, actor.lastdist) && num2 > actor.lastdist); } } else if (FF9StateSystem.Common.FF9.fldMapNo == 1055 && actor.sid == 11) { flag4 = (!EventEngineUtils.nearlyEqual(num2, actor.lastdist) && num2 > actor.lastdist); } if (num2 < num * num || (((int)actor.actf & EventEngine.actMove) != 0 && flag4)) { if (num2 < num * num && FF9StateSystem.Common.FF9.fldMapNo != 2204 && (FF9StateSystem.Common.FF9.fldMapNo != 2209 || PersistenSingleton <EventEngine> .Instance.eBin.getVarManually(220) != 9850) && this.gMode == 1 && fieldMapActorController != (UnityEngine.Object)null) { fieldMapActorController.curPos.x = x; fieldMapActorController.curPos.z = z; fieldMapActorController.SyncPosToTransform(); } flag = false; } bool flag5 = false; if (FF9StateSystem.Common.FF9.fldMapNo == 901) { if (actor.sid == 1) { flag5 = true; } } else if (FF9StateSystem.Common.FF9.fldMapNo == 1808) { if (actor.sid == 4 || actor.sid == 5) { flag5 = true; } } else if (FF9StateSystem.Common.FF9.fldMapNo == 1810) { if (actor.sid == 5) { flag5 = true; } } else if (FF9StateSystem.Common.FF9.fldMapNo == 456 && this.eBin.getVarManually(EBin.SC_COUNTER_SVR) == 2800) { if (actor.sid == 2) { flag5 = true; } } else if (FF9StateSystem.Common.FF9.fldMapNo == 455 && this.eBin.getVarManually(EBin.SC_COUNTER_SVR) == 2800) { if (actor.sid == 1) { flag5 = true; } } else if (FF9StateSystem.Common.FF9.fldMapNo == 1055 && actor.sid == 11) { flag5 = true; } if (flag5 && flag4 && posObj != null && posObj.uid == this.GetControlUID()) { flag = true; } if (actor.lastdist < (float)EventEngine.kInitialDist && num2 < actor.lastdist) { Actor actor4 = actor; actor4.actf = (ushort)(actor4.actf | (ushort)EventEngine.actMove); } if (FF9StateSystem.Common.FF9.fldMapNo == 571 && actor.sid == 4 && EventEngineUtils.nearlyEqual(x, 887f) && EventEngineUtils.nearlyEqual(z, 1419f) && num2 > actor.lastdist) { fieldMapActorController.curPos.x = 887f; fieldMapActorController.curPos.z = 1419f; fieldMapActorController.SyncPosToTransform(); return(true); } actor.lastdist = num2; if (FF9StateSystem.Common.FF9.fldMapNo == 2954 && actor.sid == 11 && EventEngineUtils.nearlyEqual(num2, 32420f)) { return(false); } if (!flag) { this.clrdist(actor); } if (actor.uid == this._context.controlUID) { this.gAnimCount++; } return(flag); }
public Int32 ProcessEvents() { if ((Int32)FF9StateSystem.Common.FF9.fldMapNo == 303 || (Int32)FF9StateSystem.Common.FF9.fldMapNo == 304) { if (FF9StateSystem.Settings.IsNoEncounter) { PersistenSingleton <EventEngine> .Instance.eBin.setVarManually(53189, 0); PersistenSingleton <EventEngine> .Instance.eBin.setVarManually(52933, 0); PersistenSingleton <EventEngine> .Instance.eBin.setVarManually(52677, 0); } } else if ((Int32)FF9StateSystem.Common.FF9.fldMapNo == 301) { if (FF9StateSystem.Settings.IsNoEncounter) { PersistenSingleton <EventEngine> .Instance.eBin.setVarManually(61381, 0); PersistenSingleton <EventEngine> .Instance.eBin.setVarManually(61125, 0); } } else if ((Int32)FF9StateSystem.Common.FF9.fldMapNo == 302) { if (FF9StateSystem.Settings.IsNoEncounter) { PersistenSingleton <EventEngine> .Instance.eBin.setVarManually(53189, 0); PersistenSingleton <EventEngine> .Instance.eBin.setVarManually(52933, 0); } } else if ((Int32)FF9StateSystem.Common.FF9.fldMapNo == 2921 && FF9StateSystem.Settings.IsNoEncounter) { PersistenSingleton <EventEngine> .Instance.eBin.setVarManually(10461, 10); } Boolean flag = false; Boolean isBattle = this.gMode == 2; this._moveKey = false; for (ObjList objList = this._context.activeObj; objList != null; objList = objList.next) { Obj obj = objList.obj; if ((Int32)obj.cid == 4) { Actor actor = (Actor)obj; FieldMapActorController mapActorController = actor.fieldMapActorController; if ((Int32)obj.uid == (Int32)this._context.controlUID && (Int32)obj.state == (Int32)EventEngine.stateRunning) { if ((Int32)this._context.usercontrol != 0) { if (this.gMode == 1) { //if (!((UnityEngine.Object)mapActorController != (UnityEngine.Object)null)) // ; this._moveKey = FieldMapActorController.ccSMoveKey; } else if (this.gMode == 3) { Single distance = 0.0f; this._moveKey = ff9.w_frameEncountEnable; this.CollisionRequest((PosObj)obj); PosObj posObj = (PosObj)this.Collision(this, actor, 0, ref distance); if (posObj != null && distance <= 0f) { WMActor wmActor = actor.wmActor; WMActor wmActor2 = ((Actor)posObj).wmActor; Vector2 from = new Vector2(wmActor.pos0 - wmActor.lastx, wmActor.pos2 - wmActor.lastz); Vector2 to = new Vector2(wmActor2.pos0 - wmActor.pos0, wmActor2.pos2 - wmActor.pos2); float num2 = Vector2.Angle(from, to); if (num2 >= 0f && num2 <= 90f) { wmActor.transform.position = new Vector3(wmActor.lastx, wmActor.lasty, wmActor.lastz); } } } if (this._moveKey) { this.ResetIdleTimer(0); } } else if ((UnityEngine.Object)mapActorController != (UnityEngine.Object)null) { mapActorController.CopyLastPos(); } } else if ((UnityEngine.Object)mapActorController != (UnityEngine.Object)null) { mapActorController.CopyLastPos(); } if ((Int32)obj.state == (Int32)EventEngine.stateRunning) { if (!isBattle) { this.ProcessAnime((Actor)obj); } //if ((Int32)this._context.usercontrol == 0) // ; } } } if (isBattle) { this.SetupBattleState(); } this._posUsed = false; Int32 num1 = this.eBin.ProcessCode(this._context.activeObj); EventHUD.CheckUIMiniGameForMobile(); if (num1 == 6) { num1 = 0; } else { this.gStopObj = (ObjList)null; } this._aimObj = (PosObj)null; this._eyeObj = (PosObj)null; for (ObjList objList = this._context.activeObj; objList != null; objList = objList.next) { this.SetRenderer(objList.obj, isBattle); } //if (this.gMode != 1) // ; if (isBattle) { for (ObjList objList = this._context.activeObj; objList != null; objList = objList.next) { Obj p = objList.obj; if ((Int32)p.btlchk == 2 && this.Request(p, 3, 5, false)) { p.btlchk = (Byte)1; } } } else { for (ObjList objList = this._context.activeObj; objList != null; objList = objList.next) { Obj obj = objList.obj; Single deltaX = 0.0f; Single deltaY = 0.0f; Single deltaZ = 0.0f; if ((Int32)obj.cid == 4) { Actor actor = (Actor)obj; if (this.gMode == 1) { if ((UnityEngine.Object)obj.go != (UnityEngine.Object)null) { FieldMapActorController component = obj.go.GetComponent <FieldMapActorController>(); if ((UnityEngine.Object)component != (UnityEngine.Object)null) { Int32 num2 = 0; if ((Int32)actor.cid != 4 || (Int32)actor.model == (Int32)UInt16.MaxValue) { num2 = 0; } //else if (component.walkMesh == null) // ; if (((Int32)obj.uid != (Int32)this._context.controlUID || this.sLockTimer >= 0L) && (num2 & 1) != 0) { Single distance = 0.0f; PosObj posObj = this.fieldmap.walkMesh.Collision(actor.fieldMapActorController, 0, out distance); if (posObj != null) { actor.fieldMapActorController.ResetPos(); if (((Int32)posObj.flags & 16) != 0) { this.sLockTimer = 0L; } if ((Int32)obj.uid == (Int32)this._context.controlUID) { this._collTimer = 2; } } } } } if ((Int32)obj.uid == (Int32)this._context.controlUID) { EIcon.ProcessHereIcon((PosObj)actor); if (this.GetUserControl()) { this.CollisionRequest((PosObj)actor); } } } else if (this.gMode == 3) { if (((Int32)actor.actf & EventEngine.actEye) != 0) { Vector3 eyePtr = ff9.w_cameraGetEyePtr(); eyePtr.x = actor.pos[0]; eyePtr.y = actor.pos[1]; eyePtr.z = actor.pos[2]; ff9.w_cameraSetEyePtr(eyePtr); this._eyeObj = (PosObj)actor; } else if (((Int32)actor.actf & EventEngine.actAim) != 0) { Vector3 aimPtr = ff9.w_cameraGetAimPtr(); aimPtr.x = actor.pos[0]; aimPtr.y = actor.pos[1]; aimPtr.z = actor.pos[2]; ff9.w_cameraSetAimPtr(aimPtr); this._aimObj = (PosObj)actor; } } if ((UnityEngine.Object)obj.go != (UnityEngine.Object)null) { if (this.gMode == 3) { WMActor wmActor = ((Actor)obj).wmActor; if ((UnityEngine.Object)wmActor != (UnityEngine.Object)null) { deltaX = (Single)(256.0 * ((Double)wmActor.pos0 - (Double)wmActor.lastx)); deltaY = (Single)(256.0 * ((Double)wmActor.pos1 - (Double)wmActor.lasty)); deltaZ = (Single)(256.0 * ((Double)wmActor.pos2 - (Double)wmActor.lastz)); flag = !EventEngineUtils.nearlyEqual(wmActor.pos0, wmActor.lastx) || !EventEngineUtils.nearlyEqual(wmActor.pos2, wmActor.lastz); //if ((Int32)obj.sid != 5 && (Int32)obj.sid == 11) // ; } } else if (this.gMode == 1) { FieldMapActorController component = obj.go.GetComponent <FieldMapActorController>(); deltaX = component.curPos.x - component.lastPos.x; deltaY = component.curPos.y - component.lastPos.y; deltaZ = component.curPos.z - component.lastPos.z; flag = !EventEngineUtils.nearlyEqual(component.curPos.x, component.lastPos.x) || !EventEngineUtils.nearlyEqual(component.curPos.z, component.lastPos.z); } if ((Int32)actor.follow != (Int32)Byte.MaxValue && (UnityEngine.Object)Singleton <DialogManager> .Instance.GetDialogByWindowID((Int32)actor.follow) == (UnityEngine.Object)null) { actor.follow = Byte.MaxValue; if (EventEngine.sLastTalker == actor) { EventEngine.sTalkTimer = 30; } } if (this.gMode == 1) { this.ProcessTurn(actor); if ((Int32)actor.model != (Int32)UInt16.MaxValue) { this.ProcessNeck(actor); } } if (this.gMode == 3) { this.ProcessTurn(actor); } if (flag) { Int32 num2 = (Int32)actor.animFlag & (EventEngine.afExec | EventEngine.afLower | EventEngine.afFreeze); if (num2 == 0 || num2 == (EventEngine.afExec | EventEngine.afLower)) { actor.animFlag &= (Byte) ~(EventEngine.afExec | EventEngine.afLower); this.SetAnim(actor, (Int32)actor.speed < (Int32)actor.speedth ? (Int32)actor.walk : (Int32)actor.run); } } else if (((Int32)actor.animFlag & (EventEngine.afExec | EventEngine.afFreeze)) == 0 && (this._collTimer == 0 || (Int32)obj.uid != (Int32)this._context.controlUID)) { this.SetAnim(actor, (Int32)actor.idle); } if (flag && (Int32)obj.uid == (Int32)this._context.controlUID && this._moveKey) { Single distance = this.distance(deltaX, deltaY, deltaZ); if (this.gMode == 3) { WMActor wmActor = ((Actor)obj).wmActor; } this._encountTimer += distance; if (!FF9StateSystem.Settings.IsNoEncounter && this.ProcessEncount(actor)) { this._encountReserved = true; } } } } } } if (this._collTimer > 0) { --this._collTimer; } if (EventEngine.sTalkTimer > 0 && --EventEngine.sTalkTimer != 0) { this.ClearLookTalker(); } if (this._encountReserved && !this._posUsed) { this._encountReserved = false; num1 = 3; } if ((num1 == 3 || num1 == 7) && this.gMode == 1) { this.BackupPosObjData(); } if (num1 == 7) { this.sEventContext1.copy(this.sEventContext0); } EMinigame.AllTreasureAchievement(); EMinigame.AllSandyBeachAchievement(); EMinigame.DigUpKupoAchievement(); //this.printActorsInObjList(this.E.activeObj); return(num1); }
public void LateUpdateFunction() { Actor actor = this.originalActor; if (actor.objParent != null) { WMActor wmActor = actor.wmActor; Actor actor2 = (Actor)actor.objParent; WMActor wmActor2 = actor2.wmActor; if (actor.sid == 12 && WMUIData.ControlNo == 6 && WMUIData.StatusNo == 7) { if (actor.anim == 4724) { global::Debug.Log("4724 ### actor.animFrame = " + actor.animFrame); if (actor.animFrame == 0) { wmActor.pos = wmActor2.pos + new Vector3(0f, 0.60619f, 0f); } else if (actor.animFrame == 1) { wmActor.pos = wmActor2.pos + new Vector3(0f, 0.50669f, 0f); } else if (actor.animFrame == 2) { wmActor.pos = wmActor2.pos + new Vector3(0f, 0.36019f, 0f); } else if (actor.animFrame == 3) { wmActor.pos = wmActor2.pos + new Vector3(0f, 0.23369f, 0f); } else if (actor.animFrame == 4) { wmActor.pos = wmActor2.pos + new Vector3(0f, 0.23619f, 0f); } else if (actor.animFrame == 5) { wmActor.pos = wmActor2.pos + new Vector3(0f, 0.25469f, 0f); } else if (actor.animFrame == 6) { wmActor.pos = wmActor2.pos + new Vector3(0f, 0.24219f, 0f); } else if (actor.animFrame == 7) { wmActor.pos = wmActor2.pos + new Vector3(0f, 0.41669f, 0f); } else if (actor.animFrame == 8) { wmActor.pos = wmActor2.pos + new Vector3(0f, 0.62719f, 0f); } else if (actor.animFrame == 9) { wmActor.pos = wmActor2.pos + new Vector3(0f, 0.45369f, 0f); } else if (actor.animFrame == 10) { wmActor.pos = wmActor2.pos + new Vector3(0f, 0.41125f, 0f); } } else { wmActor.pos = wmActor2.pos + new Vector3(0f, -0.35f, 0f); } wmActor.rot = wmActor2.rot; this.previousActorAnim = (Int32)actor.anim; this.previousAnimFrame = (Int32)actor.animFrame; } else { wmActor.pos = wmActor2.pos; wmActor.rot = wmActor2.rot; } } }
public static WMActor GetControlledDebugActor(Int32 status, Int32 controlNo) { WMWorld instance = Singleton <WMWorld> .Instance; for (ObjList objList = instance.ActorList; objList != null; objList = objList.next) { if (objList.obj.cid == 4) { WMActor wmActor = ((Actor)objList.obj).wmActor; if (FF9StateSystem.World.IsBeeScene) { if (wmActor.name == "Zidane" && status == 1 && controlNo == 0) { global::Debug.Log("Zidane is active!"); return(wmActor); } if (wmActor.name == "Dagger" && status == 2 && controlNo == 0) { global::Debug.Log("Dagger is active!"); return(wmActor); } if (wmActor.name == "Chocobo" && status == 3 && controlNo == 1) { global::Debug.Log("Chocobo is active!"); return(wmActor); } if (wmActor.name == "Chocobo" && status == 4 && controlNo == 2) { global::Debug.Log("Chocobo (Assase) is active!"); return(wmActor); } if (wmActor.name == "Chocobo" && status == 5 && controlNo == 3) { global::Debug.Log("Chocobo (Yama) is active!"); return(wmActor); } if (wmActor.name == "Chocobo" && status == 6 && controlNo == 4) { global::Debug.Log("Chocobo (Umi) is active!"); return(wmActor); } if (wmActor.name == "Chocobo" && status == 7 && controlNo == 5) { global::Debug.Log("Chocobo (Sora walk) is active!"); return(wmActor); } if (wmActor.name == "Chocobo" && status == 7 && controlNo == 6) { global::Debug.Log("Chocobo (Sora fly) is active!"); return(wmActor); } if (wmActor.name == "Bluenalusisu" && status == 8 && controlNo == 7) { global::Debug.Log("Chocobo (Sora fly) is active!"); return(wmActor); } if (wmActor.name == "Hirudagarude" && status == 9 && controlNo == 8) { global::Debug.Log("Hirudagarude is active!"); return(wmActor); } if (wmActor.name == "Invincible" && status == 10 && controlNo == 9) { global::Debug.Log("Invincible is active!"); return(wmActor); } } else if (status == (Int32)wmActor.originalActor.index && controlNo == wmActor.ControlNo) { global::Debug.Log(wmActor.name + " is active!"); return(wmActor); } } } global::Debug.LogWarning("Not found the actor!"); return((WMActor)null); }
public void HonoUpdate20FPS() { if ((this.FF9.attr & 256u) == 0u) { if (ff9.w_frameCounter >= 5) { UIManager.World.SetPerspectiveToggle(ff9.w_cameraSysDataCamera.upperCounter == 4096); UIManager.World.SetRotationLockToggle(!ff9.w_cameraSysData.cameraNotrot); } if (this.FF9WorldMap.nextMode != 2) { switch (ff9.w_frameMainRoutine()) { case 3: this.FF9WorldMap.nextMode = 2; ff9.ff9worldInternalBattleEncountStart(); PersistenSingleton <HonoInputManager> .Instance.IgnoreCheckingDirectionSources = false; break; case 4: this.FF9WorldMap.nextMode = 1; PersistenSingleton <HonoInputManager> .Instance.IgnoreCheckingDirectionSources = false; this.FF9Sys.attr |= 4096u; break; } } this.RenderTextureBank.OnUpdate20FPS(); if ((this.FF9World.attr & 512u) == 0u) { SceneDirector.ServiceFade(); } if ((this.FF9World.attr & 1024u) == 0u) { ff9.ff9worldInternalBattleEncountService(); } if (HonoBehaviorSystem.Instance.IsFastForwardModeActive()) { this.fastForwardFrameCounter20FPS++; if (this.fastForwardFrameCounter20FPS == HonoBehaviorSystem.Instance.GetFastForwardFactor()) { this.UpdateTexture_Render(); this.fastForwardFrameCounter20FPS = 0; } } else { this.UpdateTexture_Render(); } } if ((this.FF9Sys.attr & 12289u) != 0u || (this.FF9Sys.attr & 4097u) != 0u) { ff9.ff9ShutdownStateWorldMap(); ff9.ff9ShutdownStateWorldSystem(); if (this.FF9Sys.mode == 1) { AllSoundDispatchPlayer allSoundDispatchPlayer = SoundLib.GetAllSoundDispatchPlayer(); allSoundDispatchPlayer.FF9SOUND_SNDEFFECTRES_STOPCURRENT(); allSoundDispatchPlayer.FF9SOUND_SNDEFFECT_STOP_ALL(null); allSoundDispatchPlayer.FF9SOUND_STREAM_STOP(); SceneDirector.Replace("FieldMap", SceneTransition.FadeOutToBlack_FadeIn, true); } else if (this.FF9Sys.mode == 2) { EventEngine eventEngine = PersistenSingleton <EventEngine> .Instance; Obj objUID = eventEngine.GetObjUID(250); PosObj posObj = (PosObj)objUID; EventInput.IsProcessingInput = false; SoundLib.StopAllSounds(); SFX_Rush.SetCenterPosition(1); SceneDirector.Replace("BattleMap", SceneTransition.SwirlInBlack, true); } else if (this.FF9Sys.mode == 3) { SoundLib.StopAllSounds(); SceneDirector.Replace("WorldMap", SceneTransition.FadeOutToBlack_FadeIn, true); } } if (!FF9StateSystem.World.IsBeeScene) { for (ObjList objList = ff9.GetActiveObjList(); objList != null; objList = objList.next) { Obj obj = objList.obj; if (PersistenSingleton <EventEngine> .Instance.isPosObj(obj)) { WMActor wmActor = ((Actor)obj).wmActor; if (obj.cid == 4 && wmActor != (UnityEngine.Object)null) { wmActor.UpdateAnimationViaScript(); } } } } for (ObjList objList2 = this.World.ActorList; objList2 != null; objList2 = objList2.next) { if (objList2.obj.cid == 4) { WMActor wmActor2 = ((Actor)objList2.obj).wmActor; wmActor2.LateUpdateFunction(); } } }
private bool MoveToward_mixed(float x, float y, float z, int flags, PosObj flagsPosObj) { Actor actor = (Actor)this.gCur; if ((int)FF9StateSystem.Common.FF9.fldMapNo == 1823 && (int)actor.sid == 13 && ((int)x == -365 && (int)z == -373)) { x = -389f; z = -600f; } if ((int)FF9StateSystem.Common.FF9.fldMapNo == 1550 && (int)actor.sid == 15 && ((int)x == -1109 && (int)z == -1014)) { x = -1155f; z = -1070f; } float num1 = (float)actor.speed; float distance = 0.0f; PosObj posObj = (PosObj)null; FieldMapActorController fieldMapActorController = (FieldMapActorController)null; WMActor wmActor = (WMActor)null; float x1 = 0.0f; float y1 = 0.0f; float z1 = 0.0f; Vector3 vector3_1 = Vector3.zero; if (this.gMode == 1) { fieldMapActorController = actor.fieldMapActorController; if ((UnityEngine.Object)fieldMapActorController == (UnityEngine.Object)null) { x1 = actor.pos[0]; y1 = actor.pos[1]; z1 = actor.pos[2]; } else { x1 = fieldMapActorController.curPos.x; y1 = fieldMapActorController.curPos.y; z1 = fieldMapActorController.curPos.z; } vector3_1 = actor.rotAngle; } else if (this.gMode == 3) { wmActor = actor.wmActor; x1 = actor.pos[0]; y1 = actor.pos[1]; z1 = actor.pos[2]; } float deltaX = x - x1; float num2 = y - y1; float deltaZ = z - z1; float num3; if (((int)actor.actf & EventEngine.actLockDir) != 0) { num3 = EventEngineUtils.ClampAngle(this.gMode != 1 ? wmActor.rot1 : vector3_1.y); } else { num3 = this.eBin.angleAsm(deltaX, deltaZ); if ((flags & 1) == 0 || flagsPosObj != null) { float num4 = EventEngineUtils.ClampAngle(this.gMode != 1 ? wmActor.rot1 : vector3_1.y); float a = num3 - num4; if ((double)a < -180.0) { a += 360f; } if ((double)a > 180.0 || EventEngineUtils.nearlyEqual(a, 180f)) { a -= 360f; } if (((int)FF9StateSystem.Common.FF9.fldMapNo != 307 || (int)this.gCur.sid != 11) && ((int)FF9StateSystem.Common.FF9.fldMapNo != 610 || (int)this.gCur.sid != 3) && EventEngineUtils.nearlyEqual(a, 0.0f)) { actor.actf |= (ushort)EventEngine.actLockDir; } float withOutShiftRight = EventEngineUtils.ConvertFixedPointAngleToDegreeWithOutShiftRight((short)((int)actor.omega << 3)); if ((double)a > 0.0) { if ((double)a > (double)withOutShiftRight) { num3 = num4 + withOutShiftRight; } } else if ((double)a < -(double)withOutShiftRight) { num3 = num4 - withOutShiftRight; } num3 = EventEngineUtils.ClampAngle(num3); if (this.gMode == 1) { vector3_1.y = num3; actor.rotAngle[1] = num3; } else if (this.gMode == 3) { wmActor.rot1 = num3; } } } float deltaY; float rotx; if ((flags & 2) != 0 && flagsPosObj == null) { deltaY = y - y1; float num4 = this.distance(deltaX, 0.0f, deltaZ); float angle = EventEngineUtils.ClampAngle(this.eBin.angleAsm(-deltaY, -num4)); float num5 = EventEngineUtils.ClampAngle(actor.rot0); float a = angle - num5; if ((double)a < -180.0) { a += 360f; } else if ((double)a > 180.0 || EventEngineUtils.nearlyEqual(a, 180f)) { a -= 360f; } float withOutShiftRight = EventEngineUtils.ConvertFixedPointAngleToDegreeWithOutShiftRight((short)((int)actor.omega << 3)); if ((double)a > 0.0) { if ((double)a > (double)withOutShiftRight) { angle = num5 + withOutShiftRight; } } else if ((double)a < -(double)withOutShiftRight) { angle = num5 - withOutShiftRight; } rotx = EventEngineUtils.ClampAngle(angle); actor.rot0 = rotx; } else { rotx = 0.0f; deltaY = 0.0f; } Vector3 oVector; GetMoveVector(out oVector, rotx, num3, (float)actor.speed); if ((UnityEngine.Object)fieldMapActorController != (UnityEngine.Object)null && fieldMapActorController.name == fieldMapActorController.fieldMap.debugObjName) { Vector3 vector3_2 = new Vector3(x1, y1, z1); Vector3 vector3_3 = oVector; Vector3 vector3_4 = vector3_3.normalized * 100f * vector3_3.magnitude; Vector3 vector3_5 = new Vector3(0.0f, 100f, 0.0f); Vector3 vector3_6 = new Vector3(x, y, z); Debug.DrawLine(vector3_2 + vector3_5, vector3_2 + vector3_4 + vector3_5, Color.magenta, 2f, true); Debug.DrawLine(vector3_2 + vector3_5, vector3_2 + Vector3.up * 50f + vector3_5, Color.blue, 2f, true); } Vector3 vector3_7 = new Vector3(x1, y1, z1) + oVector; if (this.gMode == 1) { fieldMapActorController = actor.fieldMapActorController; if ((UnityEngine.Object)fieldMapActorController == (UnityEngine.Object)null) { actor.pos[0] = vector3_7.x; actor.pos[1] = vector3_7.y; actor.pos[2] = vector3_7.z; } else { fieldMapActorController.curPos = fieldMapActorController.curPos + oVector; fieldMapActorController.SyncPosToTransform(); } } else if (this.gMode == 3) { wmActor.SetPosition(vector3_7.x, vector3_7.y, vector3_7.z); } if (this.gMode == 1 && (UnityEngine.Object)fieldMapActorController != (UnityEngine.Object)null) { if ((int)fieldMapActorController.originalActor.uid == 2 && (int)FF9StateSystem.Common.FF9.fldMapNo == 1605 && this.eBin.getVarManually(220) == 6622) { fieldMapActorController.originalActor.collRad = (byte)10; } if ((int)fieldMapActorController.originalActor.uid == 18 && (int)FF9StateSystem.Common.FF9.fldMapNo == 575 && this.eBin.getVarManually(220) == 3165) { fieldMapActorController.originalActor.collRad = (byte)34; } posObj = fieldMapActorController.walkMesh.Collision(fieldMapActorController, 0, out distance); if (posObj != null && ((double)distance < 0.0 || EventEngineUtils.nearlyEqual(distance, 0.0f))) { fieldMapActorController.curPos = fieldMapActorController.curPos - oVector; } } else if (this.gMode == 3) { posObj = (PosObj)this.Collision(this, (PosObj)actor, 0, ref distance); if (posObj != null && ((double)distance < 0.0 || EventEngineUtils.nearlyEqual(distance, 0.0f))) { wmActor.SetPosition(x1, y1, z1); } actor.pos[0] = vector3_7[0]; actor.pos[1] = vector3_7[1]; actor.pos[2] = vector3_7[2]; } if ((int)actor.loopCount != 0 && (int)actor.loopCount != (int)byte.MaxValue) { --actor.loopCount; } bool flag1 = (int)actor.loopCount != 0; if (flagsPosObj != null) { flag1 = posObj != flagsPosObj || (double)distance > 0.0; } float a1 = this.dist64(deltaX, deltaY, deltaZ); if ((double)a1 < (double)num1 * (double)num1 || ((int)actor.actf & EventEngine.actMove) != 0 && (double)a1 > (double)actor.lastdist) { if ((double)a1 < (double)num1 * (double)num1 && (int)FF9StateSystem.Common.FF9.fldMapNo != 2204 && ((int)FF9StateSystem.Common.FF9.fldMapNo != 2209 || PersistenSingleton <EventEngine> .Instance.eBin.getVarManually(220) != 9850) && (this.gMode == 1 && (UnityEngine.Object)fieldMapActorController != (UnityEngine.Object)null)) { fieldMapActorController.curPos.x = x; fieldMapActorController.curPos.z = z; fieldMapActorController.SyncPosToTransform(); } flag1 = false; } bool flag2 = false; if ((int)FF9StateSystem.Common.FF9.fldMapNo == 901) { if ((int)actor.sid == 1) { flag2 = true; } } else if ((int)FF9StateSystem.Common.FF9.fldMapNo == 1808) { if ((int)actor.sid == 4 || (int)actor.sid == 5) { flag2 = true; } } else if ((int)FF9StateSystem.Common.FF9.fldMapNo == 1810 && (int)actor.sid == 5) { flag2 = true; } if (flag2 && (double)a1 > (double)actor.lastdist && (posObj != null && (int)posObj.uid == (int)this.GetControlUID())) { flag1 = true; } if ((double)actor.lastdist < (double)EventEngine.kInitialDist && (double)a1 < (double)actor.lastdist) { actor.actf |= (ushort)EventEngine.actMove; } if ((int)FF9StateSystem.Common.FF9.fldMapNo == 571 && (int)actor.sid == 4 && (EventEngineUtils.nearlyEqual(x, 887f) && EventEngineUtils.nearlyEqual(z, 1419f)) && (double)a1 > (double)actor.lastdist) { fieldMapActorController.curPos.x = 887f; fieldMapActorController.curPos.z = 1419f; fieldMapActorController.SyncPosToTransform(); return(true); } actor.lastdist = a1; if ((int)FF9StateSystem.Common.FF9.fldMapNo == 2954 && (int)actor.sid == 11 && EventEngineUtils.nearlyEqual(a1, 32420f)) { return(false); } if (!flag1) { this.clrdist(actor); } if ((int)actor.uid == (int)this._context.controlUID) { ++this.gAnimCount; } return(flag1); }
private void UpdateSmoothedMovementDirectionHuman() { WMActor controlledDebugDebugActor = WMActor.ControlledDebugDebugActor; if (!this.cameraTransform) { this.cameraTransform = GameObject.Find("WorldCamera").transform; } Boolean flag = this.IsGrounded(); Vector3 a = this.cameraTransform.TransformDirection(Vector3.forward); a.y = 0f; a = a.normalized; Vector3 a2 = new Vector3(a.z, 0f, -a.x); Vector2 axis = PersistenSingleton <HonoInputManager> .Instance.GetAxis(); Single num = axis.x; Single y = axis.y; if (y < -0.2f) { controlledDebugDebugActor.MovingBack = true; } else { controlledDebugDebugActor.MovingBack = false; } Boolean isMoving = controlledDebugDebugActor.isMoving; controlledDebugDebugActor.isMoving = (Mathf.Abs(num) > 0.1f || Mathf.Abs(y) > 0.1f); if (Mathf.Abs(num) < 0.7f) { num = 0f; } Vector3 vector = num * a2 + y * a; if (flag) { controlledDebugDebugActor.LockCameraTimer += Time.deltaTime; if (controlledDebugDebugActor.isMoving != isMoving) { controlledDebugDebugActor.LockCameraTimer = 0f; } if (vector != Vector3.zero) { if (controlledDebugDebugActor.moveSpeed < controlledDebugDebugActor.walkSpeed * 0.9f && flag) { controlledDebugDebugActor.moveDirection = vector.normalized; } else { controlledDebugDebugActor.moveDirection = Vector3.RotateTowards(controlledDebugDebugActor.moveDirection, vector, controlledDebugDebugActor.rotateSpeed * 0.0174532924f * Time.deltaTime, 1000f); controlledDebugDebugActor.moveDirection = controlledDebugDebugActor.moveDirection.normalized; } } Single t = controlledDebugDebugActor.SpeedSmoothing * Time.deltaTime; Single num2 = Mathf.Min(vector.magnitude, 1f); Boolean flag2 = true; controlledDebugDebugActor.State = WMActorStateDebug.Idle; if (num != 0f || y != 0f) { flag2 = false; } Boolean flag3 = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift); if (!flag2) { if (flag3) { num2 *= controlledDebugDebugActor.runSpeed; controlledDebugDebugActor.State = WMActorStateDebug.Sprint; } else { num2 *= controlledDebugDebugActor.walkSpeed; controlledDebugDebugActor.State = WMActorStateDebug.Running; } } controlledDebugDebugActor.moveSpeed = Mathf.Lerp(controlledDebugDebugActor.moveSpeed, num2, t); if (controlledDebugDebugActor.moveSpeed < controlledDebugDebugActor.walkSpeed * 0.3f) { } } }
public static void Initialize() { ObjList objList = Singleton <WMWorld> .Instance.ActorList; for (objList = Singleton <WMWorld> .Instance.ActorList; objList != null; objList = objList.next) { Obj obj = objList.obj; obj.cid = 4; obj.state = 1; obj.flags = 1; WMActor wmActor = ((Actor)obj).wmActor; WMAnimationBank instance = Singleton <WMAnimationBank> .Instance; String name = wmActor.name; switch (name) { case "Zidane": obj.index = 1; wmActor.SetPosition(309934f, 1628f, -196612f); wmActor.SetScale(67, 67, 67); wmActor.Animation.AddClip(instance.ZidaneIdleClip, instance.ZidaneIdleClip.name); wmActor.Animation.AddClip(instance.ZidaneRunClip, instance.ZidaneRunClip.name); break; case "Dagger": obj.index = 2; wmActor.SetPosition(271994f, 1802f, -245750f); wmActor.SetScale(67, 67, 67); wmActor.Animation.AddClip(instance.DaggerIdleClip, instance.DaggerIdleClip.name); wmActor.Animation.AddClip(instance.DaggerRunClip, instance.DaggerRunClip.name); break; case "Chocobo": obj.index = 3; wmActor.SetPosition(269958f, 1072f, -246044f); wmActor.SetScale(67, 67, 67); wmActor.Animation.AddClip(instance.ChocoboFlyClip, instance.ChocoboFlyClip.name); wmActor.Animation.AddClip(instance.ChocoboIdleClip, instance.ChocoboIdleClip.name); wmActor.Animation.AddClip(instance.ChocoboRunClip, instance.ChocoboRunClip.name); break; case "Bluenalusisu": obj.index = 8; wmActor.SetPosition(280576f, 327f, -261120f); wmActor.SetScale(106, 106, 106); wmActor.Animation.AddClip(instance.BluenalusisuIdleClip, instance.BluenalusisuIdleClip.name); wmActor.Animation.AddClip(instance.BluenalusisuTakeOffClip, instance.BluenalusisuTakeOffClip.name); break; case "Hirudagarude": obj.index = 9; wmActor.SetPosition((Single)ff9.UnityUnit(775.1f), (Single)ff9.UnityUnit(39.9f), (Single)ff9.UnityUnit(-317.3f)); wmActor.SetScale(110, 95, 110); wmActor.Animation.AddClip(instance.HirudagarudeIdleClip, instance.HirudagarudeIdleClip.name); wmActor.Animation.AddClip(instance.HirudagarudeTakeOffClip, instance.HirudagarudeTakeOffClip.name); break; case "Invincible": obj.index = 10; wmActor.SetPosition(272866f, 8550f, -244552f); wmActor.SetScale(64, 64, 64); wmActor.Animation.AddClip(instance.InvincibleIdleClip, instance.InvincibleIdleClip.name); wmActor.Animation.AddClip(instance.InvincibleTakeOffClip, instance.InvincibleTakeOffClip.name); break; } wmActor.Intialize(); } }