14 return EClass.scene.mouseTarget;
24 return EClass.core.config.input.autorun;
30 public bool ShouldHideTile
34 return EClass.ui.layers.Count > 0 || (EClass.pc.renderer.IsMoving && !EInput.rightMouse.pressing) ||
EClass.pc.ai.Current is
AI_Goto ||
this.cursorMove ||
EClass.ui.isPointerOverUI || EInput.axis != Vector2.zero;
40 public override float gameSpeed
44 if (!this.ShouldPauseGame)
46 return ActionMode.GameSpeeds[
EClass.game.gameSpeedIndex] * ((AM_Adv.turbo != 0f) ? AM_Adv.turbo : 1f);
54 public override bool FixFocus
58 return !this.zoomOut && (EClass.core.config.test.alwaysFixCamera || EInput.leftMouse.pressing || !EInput.rightMouse.pressing || AM_Adv.actCount <= 0 || (EClass.pc.ai != Chara._NoGoalRepeat && (!(EClass.pc.ai is
TaskDesignation) || !(EClass.pc.ai as
TaskDesignation).isRepeated)));
64 public override bool ShouldPauseGame
68 return EClass.core.config.game.autopause &&
EClass.pc.HasNoGoal;
74 public override bool AllowWheelZoom
84 public override float TargetZoom
90 return 0.01f * (float)
EClass.game.config.defaultZoom;
92 return 0.01f * (float)
EClass.game.config.zoomedZoom;
97 public override bool HighlightWall(
Point p)
99 return EClass.pc.held !=
null &&
TaskMine.CanMine(p,
EClass.pc.held);
103 public unsafe
override void OnActivate()
109 ActionMode.DefaultMode =
this;
110 this.pressedAction.Init(
null);
112 EClass.screen.tileMap.RefreshHeight();
114 EClass.pc.renderer.SetFirst(
true, *
EClass.pc.pos.PositionCenter());
116 EClass.screen.RefreshPosition();
120 public override void OnDeactivate()
126 public unsafe
override void OnRenderTile(
Point point, HitResult result,
int dir)
128 if (this.ShouldHideTile)
132 EClass.player.currentHotItem.OnRenderTile(point, result, dir);
133 base.OnRenderTile(point, result, dir);
134 if (
EClass.core.config.game.highlightEnemy)
136 using (List<Chara>.Enumerator enumerator = point.ListCharas().GetEnumerator())
138 while (enumerator.MoveNext())
140 if (enumerator.Current.IsHostile(
EClass.pc))
142 using (List<Chara>.Enumerator enumerator2 =
EClass._map.charas.GetEnumerator())
144 while (enumerator2.MoveNext())
146 Chara chara = enumerator2.Current;
147 if (chara.isSynced && chara.IsHostile(
EClass.pc) && !chara.IsMultisize)
149 Vector3 vector = *chara.pos.Position();
150 EClass.screen.guide.passGuideFloor.Add(vector.x, vector.y, vector.z - 0.01f, 23f, 0.3f);
162 public override int GetDefaultTile(
Point p)
172 public override void OnBeforeUpdate()
174 if (
EClass.pc.renderer.IsMoving)
176 this.isMoving =
true;
179 this.isMoving =
false;
183 public unsafe
override void OnAfterUpdate()
185 Vector3 vector = this.mouseTarget.pos.IsValid ? (*this.mouseTarget.pos.PositionAuto()) : (*
EClass.pc.pos.PositionAuto());
186 vector = Camera.main.WorldToScreenPoint(vector);
188 vector += EClass.ui.hud.transRightPos * Mathf.Min(0f,
EClass.screen.Zoom - 1f);
189 EClass.ui.hud.transRight.position = vector;
190 EClass.player.MarkMapHighlights();
194 public override void OnUpdateCursor()
197 CursorInfo info = (EClass.ui.layers.Count == 0 && !
EClass.ui.isPointerOverUI) ? CursorSystem.Instance.arrows[
this.arrowIndex] :
null;
198 CursorSystem.leftIcon =
null;
199 bool flag = (EClass.pc.ai.IsRunning || AM_Adv.turbo != 0f || this.pressedAction.action !=
null) && !
EClass.pc.HasNoGoal && !(
EClass.pc.ai is
GoalManualMove);
200 if (flag && !
EClass.ui.isPointerOverUI)
202 CursorSystem.leftIcon = CursorSystem.IconGear;
203 CursorSystem.leftIconAngle = (float)((
int)(this.gearAngle / 45f) * 45);
205 if (!this.cursorMove && (this.mouseTarget.hasTargetChanged || !
this.mouseTarget.pos.Equals(
this.planLeft.pos) ||
this.planLeft.performed ||
this.planRight.performed))
207 this.updatePlans =
true;
209 if (!this.ShouldHideTile)
211 if (this.planLeft.HasAct)
213 info = this.planLeft.CursorIcon;
215 else if (this.planRight.HasAct)
217 info = this.planRight.CursorIcon;
220 this.gearAngle += Core.gameDelta * 200f;
221 CursorSystem.SetCursor(info, 0);
222 if ((this.updatePlans && !flag) ||
EClass.pc.IsDisabled)
226 if (CursorSystem.ignoreCount < 0)
228 this.UpdateLangWheel();
229 EClass.ui.hud.transRight.SetActive(
true);
230 bool flag2 = !this.ShouldHideTile && !this.pressedAction.hideRightInfo && !
EClass.ui.contextMenu.isActive;
231 EClass.ui.hud.textLeft.SetActive(flag2 && this.planLeft.ShowAct);
232 EClass.ui.hud.textRight.SetActive(flag2 && this.planRight.ShowAct);
233 EClass.ui.hud.textMiddle.SetActive(flag2 && this.textMiddle !=
null);
234 EClass.ui.hud.textWheel.SetActive(flag2 && this.textWheel !=
null);
235 if (
EClass.ui.hud.textLeft.gameObject.activeSelf)
237 EClass.ui.hud.textLeft.rectTransform.anchoredPosition = EClass.ui.hud.leftTextPos * Mathf.Max(1f,
EClass.screen.Zoom) /
EClass.core.uiScale;
239 if (
EClass.ui.hud.textRight.gameObject.activeSelf)
241 EClass.ui.hud.textRight.rectTransform.anchoredPosition = EClass.ui.hud.rightTextPos * Mathf.Max(1f,
EClass.screen.Zoom) /
EClass.core.uiScale;
243 if (
EClass.ui.hud.textMiddle.gameObject.activeSelf)
245 EClass.ui.hud.textMiddle.rectTransform.anchoredPosition = EClass.ui.hud.wheelTextPos * Mathf.Max(1f,
EClass.screen.Zoom) /
EClass.core.uiScale;
247 if (
EClass.ui.hud.textWheel.gameObject.activeSelf)
249 EClass.ui.hud.textWheel.rectTransform.anchoredPosition = (EClass.ui.hud.textMiddle.gameObject.activeSelf ? EClass.ui.hud.wheelTextPos2 :
EClass.ui.hud.wheelTextPos) * Mathf.Max(1f,
EClass.screen.Zoom) /
EClass.core.uiScale;
251 EClass.ui.hud.imageRight.SetActive(flag2 && this.planRight.HasAct);
256 public void UpdatePlans()
258 this.planLeft.Update(this.mouseTarget);
259 this.planRight.Update(this.mouseTarget);
260 this.updatePlans =
false;
264 public void UpdateLangWheel()
266 this.textWheel =
null;
267 this.textMiddle =
null;
268 if (this.planRight.HasAct)
272 this.textWheel =
"textWheel_changeHeight".lang();
283 this.planAll.Update(this.mouseTarget);
284 if (!this.planAll.HasAct)
286 this.textMiddle =
"textMiddle_rotate".lang(EInput.keys.mouseMiddle.key.ToString() ??
"",
null,
null,
null,
null);
290 EClass.ui.hud.textWheel.SetText(this.textWheel.IsEmpty(
""));
291 EClass.ui.hud.textMiddle.SetText(this.textMiddle.IsEmpty(
""));
296 public void ClearPlans()
298 this.planLeft.Clear();
299 this.planRight.Clear();
300 this.updatePlans =
true;
304 public void OnBecomeNoGoal()
306 EClass.player.renderThing =
null;
307 if (
EClass.player.hotItemToRestore !=
null)
309 if (
EClass.player.currentHotItem !=
EClass.player.hotItemToRestore)
311 EClass.player.SetCurrentHotItem(
null);
313 EClass.player.hotItemToRestore =
null;
315 if (!
EClass.core.config.game.alwaysUpdateRecipe)
319 if (
EClass.rnd(30) == 0 &&
EClass.pc.HasElement(1559, 1))
325 EClass.player.EndTurn(
true);
328 if ((
int)(Time.timeSinceLevelLoad / 60f / 60f) >
Player.realHour)
330 EClass.player.OnAdvanceRealHour();
336 public override void _OnUpdateInput()
338 if (
EClass.player.willAutoSave)
340 EClass.game.Save(
true,
null,
false);
341 EClass.player.willAutoSave =
false;
345 RecipeUpdater.dirty =
false;
348 if (!EInput.rightMouse.pressing)
354 if (!EInput.rightMouse.pressing || !EInput.leftMouse.pressing)
356 this.rightMouseTimer = 2.5f;
361 this.rightMouseTimer -= Core.delta;
363 EClass.player.waitingInput =
false;
366 if (
EClass.pc.IsCriticallyWounded(
false) || (
EClass.game.config.autoCombat.abortOnHalfHP && ((
EClass.pc.Evalue(1421) > 0) ? (
EClass.pc.hp +
EClass.pc.mana.value) :
EClass.pc.hp) <
EClass.player.autoCombatStartHP / 2))
368 Msg.Say(
"abort_lowHP");
371 else if (
EClass.game.config.autoCombat.abortOnAllyDying &&
EClass.pc.party.IsCriticallyWounded(
false) &&
EClass.player.TryAbortAutoCombat())
373 Msg.Say(
"abort_allyDying");
379 if (
EClass.pc.WillConsumeTurn())
381 EClass.player.EndTurn(
true);
382 EClass.player.invlunerable =
false;
387 EClass.player.lastTurn =
EClass.pc.turn;
388 EClass.player.invlunerable =
false;
389 this.OnBecomeNoGoal();
395 EClass.player.waitingInput =
true;
399 if (EInput.IsAnyKeyDown(
true) || (playingTool.GetRootCard() !=
EClass.pc && (!playingTool.ExistsOnMap || playingTool.Dist(
EClass.pc) > 1)))
405 if (!instance || instance.ratio > 0.85f)
415 if (
EClass.player.returnInfo !=
null &&
EClass.player.returnInfo.askDest)
417 EClass.player.returnInfo.askDest =
false;
419 List<Zone> list =
EClass.game.spatials.ListReturnLocations();
420 if (list ==
null || list.Count == 0)
422 EClass.player.returnInfo =
null;
423 Msg.Say(
"returnAbort");
431 uidDest = a.FindDeepestZone().uid;
435 turns =
EClass.rnd(10) + 10,
438 if (
EClass.debug.instaReturn)
440 EClass.player.returnInfo.turns = 1;
441 EClass.player.EndTurn(
true);
445 string lang = (a is
Zone_Dungeon) ? a.TextDeepestLv :
"surface".lang();
446 b.SetSubText(lang, 200, FontColor.Default, TextAnchor.MiddleRight);
448 b.button1.mainText.rectTransform.sizeDelta =
new Vector2(350f, 20f);
449 },
true).SetSize(500f, -1f).SetOnKill(delegate
453 EClass.player.returnInfo =
null;
454 Msg.Say(
"returnAbort");
456 }).SetTitles(
"wReturn",
null);
461 if (
EClass.player.haltMove)
463 EClass.player.haltMove =
false;
464 this.TryCancelInteraction(
false);
468 if (this.keepWalking && (EInput.leftMouse.down || EInput.rightMouse.down))
470 this.keepWalking =
false;
474 if (
EClass.player.showShippingResult && !
EClass.ui.IsActive)
476 EClass.player.showShippingResult =
false;
479 if (this.pressedAction.IsPressing() ||
this.keepWalking)
481 this.pressedAction.timer += Core.delta;
482 if (this.pressedAction.action !=
null)
484 if (this.pressedAction.canTurbo && ((
this.autorun &&
this.pressedAction.timer > 0.45f) || Input.GetKey(KeyCode.LeftShift)))
488 if (!this.pressedAction.waitForTurn ||
this.CanAct())
490 if (this.pressedAction.count == 1 && !
this.pressedAction.ignoreCount)
492 this.pressedAction.timerRepeat += Core.delta;
493 if (this.pressedAction.timerRepeat < 0.3f)
498 this.pressedAction.count++;
499 if (this.pressedAction.action())
501 if (this.pressedAction.willEndTurn)
503 EClass.player.EndTurn(
false);
504 if (!this.pressedAction.repeat)
506 this.pressedAction.action =
null;
511 else if (!this.pressedAction.repeat)
513 this.pressedAction.action =
null;
518 else if ((this.autorun && this.pressedAction.timer > 0.5f) || Input.GetKey(KeyCode.LeftShift))
524 if (this.pressedAction.button !=
null || EInput.hasShiftChanged)
526 this.updatePlans =
true;
528 this.cursorMove =
false;
529 EClass.player.nextMove = Vector2.zero;
534 this.pressedAction.button =
null;
535 this.pressedAction.axis = Vector2.zero;
536 this.pressedAction.count = 0;
537 this.pressedAction.timerRepeat = 0f;
538 if (
EClass.player.willEndTurn)
540 EClass.player.willEndTurn =
false;
541 EClass.player.EndTurn(
true);
544 if (EInput.axis != Vector2.zero)
549 this.timerStartRunning = 0f;
550 this.startedRun =
false;
555 this.movedByKey =
false;
557 if (EInput.leftMouse.down)
559 if (this.TryCancelInteraction(
true))
563 CursorSystem.ignoreCount = 5;
564 this.SetPressedAction(EInput.leftMouse);
566 if (EInput.rightMouse.down)
568 if (this.TryCancelInteraction(
true))
572 CursorSystem.ignoreCount = 5;
573 this.SetPressedAction(EInput.rightMouse);
575 if (EInput.middleMouse.pressing || EInput.isShiftDown)
579 if (EInput.wheel != 0)
586 if (EInput.middleMouse.pressedTimer > EInput.middleMouse.clickDuration)
588 EInput.middleMouse.pressedTimer = 100f;
591 else if (
EClass.scene.mouseTarget.CanCycle())
593 if (EInput.wheel != 0)
595 EClass.scene.mouseTarget.CycleTarget(EInput.wheel);
598 if (EInput.middleMouse.pressedTimer > EInput.middleMouse.clickDuration)
600 EInput.middleMouse.pressedTimer = 100f;
604 if ((EInput.middleMouse.down || EInput.middleMouse.clicked || EInput.middleMouse.pressedLong) && !
EClass.ui.contextMenu.isActive)
606 this.planAll.Update(this.mouseTarget);
607 bool flag = EClass.pc.held !=
null && HotItemHeld.taskBuild !=
null && (
HotItemHeld.taskBuild.CanPerform() || !this.planAll.HasAct);
608 if (EInput.middleMouse.clicked)
617 base.DoFunc(input.middleClick);
620 else if (EInput.middleMouse.pressedLong)
622 base.DoFunc(input.middlePressLong);
625 if (EInput.mouse3.clicked || (input.mouse3Click ==
CoreConfig.GameFunc.Fire && EInput.mouse3.pressing))
627 base.DoFunc(input.mouse3Click);
629 else if (EInput.mouse3.pressedLong)
631 base.DoFunc(input.mouse3PressLong);
633 if (EInput.mouse4.clicked || (input.mouse4Click ==
CoreConfig.GameFunc.Fire && EInput.mouse4.pressing))
641 base.DoFunc(input.mouse4Click);
644 else if (EInput.mouse4.pressedLong)
646 base.DoFunc(input.mouse4PressLong);
648 if (EInput.wheel != 0)
652 if (EInput.wheel != 0)
666 if (
EClass.pc.HasNoGoal &&
EClass.player.currentHotItem.LookAtMouse)
668 EClass.pc.LookAt(this.planLeft.pos);
670 if (Input.GetKey(KeyCode.LeftControl))
672 if (Input.GetKeyDown(KeyCode.F))
679 widget.SoundActivate();
683 EAction action = EInput.action;
684 if (action != EAction.Wait)
686 if (action != EAction.Fire)
693 EClass.ui.ToggleFeedback();
697 case EAction.QuickSave:
698 if (
EClass.debug.enable ||
EClass.game.Difficulty.allowManualSave)
705 EClass.game.Save(
false,
null,
false);
709 case EAction.QuickLoad:
710 if (
EClass.debug.enable ||
EClass.game.Difficulty.allowManualSave)
712 EClass.core.WaitForEndOfFrame(delegate
721 case EAction.AutoCombat:
722 if (
EClass.scene.mouseTarget.isValid &&
EClass.player.CanAcceptInput())
724 List<Chara> list2 =
EClass.scene.mouseTarget.pos.ListCharas();
725 list2.Sort((
Chara a,
Chara b) => a.hostility - b.hostility);
726 foreach (
Chara chara
in list2)
728 if (chara.hostility < Hostility.Friend)
734 Msg.Say(
"noTargetFound");
738 case EAction.EmptyHand:
751 if (!
EClass.player.HasValidRangedTarget() || EInput.isShiftDown)
753 EClass.player.TargetRanged();
754 if (
EClass.player.HasValidRangedTarget())
758 if (EInput.keyFire.IsRepeating)
760 EInput.keyFire.Consume();
764 else if (
EClass.pc.HasNoGoal)
768 if (thing ==
null || !thing.CanAutoFire(
EClass.pc,
EClass.player.target, reloading))
770 foreach (UIList.ButtonPair buttonPair in
WidgetCurrentTool.Instance.list.buttons)
773 if (thing2 !=
null && thing2.CanAutoFire(
EClass.pc,
EClass.player.target, reloading))
780 if (thing ==
null || !thing.CanAutoFire(
EClass.pc,
EClass.player.target, reloading))
782 thing =
EClass.pc.things.Find((
Thing _t) => _t.isEquipped && _t.CanAutoFire(
EClass.pc,
EClass.player.target, reloading),
true);
784 if (thing !=
null && thing.CanAutoFire(
EClass.pc,
EClass.player.target, reloading))
786 if (thing.HasTag(CTAG.throwWeapon))
791 ACT.Throw.target = thing;
793 EClass.player.EndTurn(
false);
801 if (traitAbility !=
null)
803 if (traitAbility.act.CanPerform(
EClass.pc,
EClass.player.target,
EClass.player.target.pos) &&
EClass.pc.UseAbility(traitAbility.act.source.alias,
EClass.player.target,
EClass.player.target.pos,
false))
805 EClass.player.EndTurn(
false);
811 EClass.pc.ranged = thing;
814 EClass.player.renderThing = thing;
816 EClass.player.EndTurn(
false);
827 if (
EClass.debug.boradcast)
829 EClass.debug.BroadcastNext();
834 if (
EClass.pc.ai.CanManualCancel())
842 if (
EClass._zone.IsRegion)
844 EClass.player.EnterLocalZone(
false);
848 if (traitNewZone !=
null && traitNewZone.CanAutoEnter())
850 traitNewZone.MoveZone(
false);
854 EClass.player.EndTurn(
true);
863 public void ShowAllAction()
865 this.planAll.Update(this.mouseTarget);
866 if (this.planAll.HasAct)
868 this.planAll.ShowContextMenu();
871 if (
EClass._zone.IsRegion)
876 if (
EClass.debug.godBuild)
878 Thing lastThing = this.planAll.pos.LastThing;
879 if (lastThing !=
null &&
EClass.pc.pos.Distance(
this.planAll.pos) > 1 && lastThing.W == lastThing.H)
881 lastThing.Rotate(
false);
890 public void SetTurbo(
int mtp = -1)
896 AM_Adv.turbo =
EClass.setting.defaultTurbo;
902 AM_Adv.turbo = (float)mtp;
907 public void EndTurbo()
913 public void ToggleZoom()
915 EClass.screen.focusPos =
null;
916 this.zoomOut2 = !this.zoomOut2;
917 SE.Play(this.zoomOut2 ?
"zoomOut" :
"zoomIn");
918 EClass.ui.widgets.OnChangeActionMode();
923 public bool TryCancelInteraction(
bool sound =
true)
927 if (
EClass.pc.ai.CanManualCancel())
935 EInput.Consume(
true, 1);
944 return EClass.pc.HasNoGoal;
948 public void AxisMove()
950 Vector2 vector = (EClass.core.config.input.altKeyAxis && !
EClass._zone.IsRegion) ? Util.ConvertAxis(EInput.axis) : EInput.axis;
951 if (!this.startedRun)
953 if ((this.autorun && this.timerStartRunning >= 0.7f) || Input.GetKey(KeyCode.LeftShift))
956 this.startedRun =
true;
959 else if (Input.GetKeyDown(KeyCode.LeftShift))
961 this.SetTurbo((
AM_Adv.turbo == 0f) ? -1 : 0);
963 if (
EClass.core.config.test.alwaysRun)
965 this.SetTurbo(Input.GetKey(KeyCode.LeftShift) ? 0 : -1);
967 this.timerStartRunning += Core.delta;
968 EClass.player.nextMove.x = 0f;
969 EClass.player.nextMove.y = 0f;
971 point.x += (int)vector.x;
972 point.z += (int)vector.y;
973 if (
EClass.pc.HasNoGoal && !point.IsValid &&
EClass.player.CanExitBorder(point))
975 EClass.player.ExitBorder(
null);
978 this.axisTarget.Update(point);
979 this.pressedAction.Init(Vector3.zero);
980 this.planKeyboard.Update(this.axisTarget);
981 if (!this.planKeyboard.HasAct)
983 EClass.player.nextMove.x = vector.x;
984 EClass.player.nextMove.y = vector.y;
987 this.SetManualMove();
989 this.movedByKey =
true;
994 EInput.forbidAxis = EInput.axis;
998 this.pressedAction.axis = EInput.axis;
999 this.pressedAction.SetAction(this.planKeyboard.GetAction(),
true,
this.planKeyboard.WillEndTurn,
true);
1003 public void SetManualMove()
1005 if (
EClass.player.TooHeavyToMove())
1009 this.SetTurbo(EInput.isShiftDown ? -1 : 0);
1011 this.cursorMove =
true;
1015 public void SetPressedAction(ButtonState button)
1017 if (this.updatePlans)
1021 bool flag = button == EInput.leftMouse;
1022 this.pressedAction.Init(button);
1023 if (this.isMouseOnMap)
1027 if (this.planLeft.HasAct)
1029 this.pressedAction.SetPlan(this.planLeft);
1035 if (this.planRight.HasAct)
1037 this.pressedAction.SetPlan(this.planRight);
1040 SE.Play(
"noAction");
1046 Point pos = (!this.isMouseOnMap) ?
null : base.hit.Copy();
1049 if (
EClass.pc.pos.Equals(pos))
1053 if (
EClass.pc.pos.Distance(pos) == 1 && pos.cell.blocked)
1058 this.planLeft.Update(this.mouseTarget);
1059 if (this.planLeft.HasAct)
1063 this.clickPos = Input.mousePosition;
1064 this.pressedAction.SetAction(() => this.PressedActionMove(pos),
false,
false,
false);
1065 this.pressedAction.repeat = this.zoomOut;
1066 this.pressedAction.ignoreCount =
true;
1071 public bool PressedActionMove(
Point pos)
1073 if (
EClass.player.TooHeavyToMove())
1079 if (EInput.leftMouse.clicked)
1081 if (
EClass.pc.pos.Equals(pos) || !pos.IsValid)
1083 EClass.player.nextMove = Vector2.zero;
1088 if (!
EClass.pc.IsEnemyOnPath(pos,
true))
1090 EClass.pc.SetAIImmediate(
new AI_Goto(pos, 0,
false,
false));
1095 EClass.player.nextMove = Vector2.zero;
1100 if (EInput.rightMouse.down &&
EClass.core.config.input.autowalk)
1102 this.keepWalking =
true;
1107 if (Vector2.Distance(
this.posOrigin,
this.posArrow) >
EClass.core.config.game.runDistance)
1111 else if (
AM_Adv.turbo != 0f && !Input.GetKey(KeyCode.LeftShift) && !
EClass.core.config.input.keepRunning && !
this.zoomOut && Vector2.Distance(
this.posOrigin,
this.posArrow) < 1.2f)
1116 if (pos !=
null && !this.cursorMove)
1118 Vector2Int v =
new Vector2Int(pos.x -
EClass.pc.pos.x, pos.z -
EClass.pc.pos.z);
1119 if (Mathf.Abs(v.x) > 1 || Mathf.Abs(v.y) > 1)
1121 int num = Mathf.Max(Mathf.Abs(v.x), Mathf.Abs(v.y));
1125 EClass.player.nextMove = v;
1130 EClass.player.nextMove = this.vArrow;
1131 Point.shared.Set(
EClass.pc.pos.x + (
int)
this.vArrow.x,
EClass.pc.pos.z + (
int)
this.vArrow.y);
1141 if (
Point.shared.IsInBounds)
1149 this.SetTurbo(EInput.isShiftDown ? -1 : 0);
1152 this.cursorMove =
true;
1157 this.cursorMove =
true;
1163 EClass.player.ExitBorder(
null);
1174 public unsafe
virtual void RefreshArrow()
1176 bool flag = this.zoomOut || EInput.rightMouse.pressedLong;
1177 if (flag && this.mouseTarget.pos.Equals(
EClass.pc.pos))
1179 this.vArrow = Vector2.zero;
1180 EClass.player.nextMove = this.vArrow;
1183 this.posOrigin = (flag ? (*
EClass.pc.pos.PositionCenter()) : CursorSystem.posOrigin);
1184 this.posArrow = CursorSystem.position;
1186 if (this.cursorMove ||
EClass.pc.pos.Distance(base.hit) > 1)
1188 num = Util.GetAngle(this.posArrow.x -
this.posOrigin.x,
this.posArrow.y -
this.posOrigin.y) + 90f + 22.5f;
1192 num = Util.GetAngle((
float)(
EClass.pc.pos.x - base.hit.x), (
float)(
EClass.pc.pos.z - base.hit.z)) - 22.5f;
1202 if (this.clickPos != Vector3.zero)
1204 if (Vector3.Distance(Input.mousePosition,
this.clickPos) <
EClass.core.config.game.angleMargin)
1208 this.clickPos = Vector3.zero;
1210 this.vArrow = Vector2.zero;
1212 Action<int, int, int, int> action = delegate(
int x,
int y,
int i,
int a)
1214 this.vArrow.x = (float)x;
1215 this.vArrow.y = (float)y;
1216 this.arrowIndex = i;
1219 if (num < 45f || num >= 360f)
1221 action(-1, -1, 0, 0);
1226 action(-1, 0, 1, 35);
1231 action(-1, 1, 2, 90);
1236 action(0, 1, 3, 145);
1241 action(1, 1, 4, 180);
1246 action(1, 0, 5, 215);
1251 action(1, -1, 6, 270);
1254 action(0, -1, 7, 325);
1258 public static float turbo;
1261 public static int actCount;
1264 public bool zoomOut;
1267 public bool zoomOut2;
1270 public bool movedByKey;
1273 protected int arrowIndex;
1276 protected float timerStartRunning;
1279 protected bool cursorMove;
1282 protected bool keepWalking;
1285 protected Vector3 posOrigin;
1288 protected Vector3 posArrow;
1291 protected Vector2 vArrow;
1305 input = ActInput.LeftMouse
1311 input = ActInput.RightMouse
1317 input = ActInput.Key
1323 input = ActInput.AllAction
1327 public string textWheel;
1330 public string textMiddle;
1333 private float gearAngle;
1336 protected bool updatePlans;
1339 protected bool isMoving;
1342 private Vector3 lastCamPos;
1345 public float rightMouseTimer;
1348 private bool startedRun;
1351 protected Vector3 clickPos;
1357 public void Init(Vector3 _axis)
1367 public void Init(ButtonState _button =
null)
1369 this.button = _button;
1373 this.axis = Vector2.zero;
1377 public void SetAction(Func<bool> _action =
null,
bool _canTurbo =
true,
bool _willEndTurn =
true,
bool _waitForTurn =
true)
1380 this.action = _action;
1381 this.canTurbo = _canTurbo;
1382 this.willEndTurn = _willEndTurn;
1383 this.waitForTurn = _waitForTurn;
1384 this.hideRightInfo =
false;
1385 this.repeat =
false;
1386 this.ignoreCount =
false;
1391 public void SetPlan(
ActPlan _plan)
1394 this.action = this.plan.GetAction();
1395 this.canTurbo =
true;
1396 this.willEndTurn = this.plan.WillEndTurn;
1397 this.waitForTurn =
true;
1398 this.hideRightInfo = this.plan.HideRightInfo;
1399 this.repeat = this.plan.canRepeat;
1400 this.ignoreCount =
false;
1401 this.act = ((this.plan.list.Count == 1) ? this.plan.list[0].act :
null);
1405 public bool IsPressing()
1407 if (this.button !=
null)
1409 return this.button.down || this.button.pressing || this.button.clicked;
1411 return this.axis != Vector2.zero && EInput.axis == this.axis;
1415 public ButtonState button;
1418 public bool canTurbo;
1421 public bool willEndTurn;
1424 public bool waitForTurn;
1427 public bool hideRightInfo;
1433 public bool ignoreCount;
1436 public Func<bool> action;
1448 public float timerRepeat;
1451 public Vector2 axis;