public ObjectAction(MirAction action, MirDirection direction, Point location, params object[] extra) { Action = action; Direction = direction; Location = location; Extra = extra; }
public void QueueAction(MirAction Action, Point L) { ActionList.Enqueue(new QueuedAction { Action = Action, Location = L }); }
public void QueueAction(MirAction Action, MirDirection D) { ActionList.Enqueue(new QueuedAction { Action = Action, Direction = D }); }
public virtual void Awake() { CurrentAction = MirAction.Standing; NameLabel = Instantiate(NameLabelObject, NameLocation.position, Quaternion.identity, gameObject.transform).GetComponent <TMP_Text>(); NameColour = Color.white; if (GameManager.gameStage == GameStage.Game) { minimapDot = Instantiate(GameScene.MiniMapDot, Vector3.zero, Quaternion.identity, GameScene.MiniMapView.transform); } }
public override void OnDrawEffect(PlayerObject player, MirAction action) { if (action != MirAction.JumpDown) { return; } MirDirection Direction = player.Direction; int FrameIndex = player.FrameIndex; Point DrawLocation = player.DrawLocation; int frame = 48 + ((int)Direction * 16) + FrameIndex * 10 / 8; Libraries.Magic4.DrawBlend(frame, DrawLocation, Color.White, true, 0.7F); }
public override void OnDrawEffect(PlayerObject player, MirAction action) { if (action != MirAction.Attack1) { return; } MirDirection Direction = player.Direction; int SpellLevel = player.SpellLevel; int FrameIndex = player.FrameIndex * 9 / 6; Point DrawLocation = player.DrawLocation; Libraries.Magic4.DrawBlend(292 + (int)Direction * 16 + FrameIndex, DrawLocation, Color.White, true, 0.7F); }
void SetAction() { if (ActionFeed.Count == 0) { CurrentAction = MirAction.Standing; if (this == GameManager.User.Player) { GameManager.User.WalkStep = 0; } } else { if (Time.time < GameManager.NextAction) { return; } QueuedAction action = ActionFeed[0]; ActionFeed.RemoveAt(0); CurrentAction = action.Action; Direction = action.Direction; switch (CurrentAction) { case MirAction.Walking: case MirAction.Running: int steps = 1; if (CurrentAction == MirAction.Running) { steps = 2; } Vector3 targetpos = GameManager.CurrentScene.Cells[(int)action.Location.x, (int)action.Location.y].position; Model.transform.rotation = ClientFunctions.GetRotation(Direction); TargetPosition = targetpos; if (this != GameManager.User.Player) { Vector2 back = ClientFunctions.Back(action.Location, Direction, steps); gameObject.transform.position = GameManager.CurrentScene.Cells[(int)back.x, (int)back.y].position; } StartPosition = gameObject.transform.position; TargetDistance = Vector3.Distance(transform.position, targetpos); IsMoving = true; break; } CurrentLocation = action.Location; if (this == GameManager.User.Player) { switch (CurrentAction) { case MirAction.Walking: Network.Enqueue(new C.Walk { Direction = action.Direction }); GameManager.NextAction = Time.time + 2.5f; GameManager.InputDelay = Time.time + 0.5f; break; case MirAction.Running: Network.Enqueue(new C.Run { Direction = action.Direction }); GameManager.NextAction = Time.time + 2.5f; GameManager.InputDelay = Time.time + 0.5f; break; } } } GetComponentInChildren <Animator>().SetInteger("CurrentAction", (int)CurrentAction); }
void Start() { CurrentAction = MirAction.Standing; }
public virtual void OnDrawEffect(PlayerObject player, MirAction action) { }
public void DieEnd() { CurrentAction = MirAction.Dead; }
public virtual void Start() { CurrentAction = MirAction.Standing; NameLabel = Instantiate(NameLabelObject, NameLocation.position, Quaternion.identity, gameObject.transform).GetComponent <TMP_Text>(); SetNameLabel(); }
public virtual void DoAction(MirAction Action) { if (Frames == null) { return; } CurrentAction = Action; Frame = 0; CanDoAction = false; FreezeFrame = true; switch (Action) { case MirAction.Turn: PlayAppearSound(); CurrentAction = MirAction.Standing; CurrentFrame = Frames.Stand; CanDoAction = true; break; case MirAction.Standing: CurrentFrame = Frames.Stand; CanDoAction = true; break; case MirAction.Harvest: CurrentFrame = Frames.Harvest ?? Frames.Stand; break; case MirAction.Walking: CurrentFrame = Frames.Walk; //if (this == User) Main.NextMoveTime = Main.Timer.ElapsedMilliseconds + 500; break; case MirAction.Stance: CurrentFrame = Frames.Stance ?? Frames.Stand; break; case MirAction.Attack1: CurrentFrame = Frames.Attack1; if (this == User) { Main.AttackTime = Main.Timer.ElapsedMilliseconds + User.AttackSpeed; } break; case MirAction.Attack2: CurrentFrame = Frames.Attack2; if (this == User) { Main.AttackTime = Main.Timer.ElapsedMilliseconds + User.AttackSpeed; } break; case MirAction.Attack3: CurrentFrame = Frames.Attack3; if (this == User) { Main.AttackTime = Main.Timer.ElapsedMilliseconds + User.AttackSpeed; } break; case MirAction.Struck: CurrentFrame = Frames.Struck; break; case MirAction.Die: CurrentFrame = Frames.Die; Dead = true; break; case MirAction.Dead: CurrentFrame = Frames.Dead; break; case MirAction.Skeleton: CurrentFrame = Frames.Skeleton ?? Frames.Dead; break; case MirAction.Running: CurrentFrame = Frames.Run ?? Frames.Walk; //if (this == User) Main.NextMoveTime = Main.Timer.ElapsedMilliseconds + 500; break; } NextMotion = Main.Timer.ElapsedMilliseconds + CurrentFrame.Interval; ImageIndex = CurrentFrame.Start + (CurrentFrame.OffSet * (byte)Direction) + Frame + BaseIndex; LocationProcess(); }
public override void DoAction(MirAction Action) { }