2using System.Collections.Generic;
38 public void Init(Vector3 _axis)
56 public void SetAction(Func<bool> _action =
null,
bool _canTurbo =
true,
bool _willEndTurn =
true,
bool _waitForTurn =
true,
bool _canRepeat =
false)
79 act = ((plan.list.Count == 1) ?
plan.
list[0].act :
null);
92 if (
axis != Vector2.zero)
94 return EInput.axis ==
axis;
135 input = ActInput.LeftMouse
140 input = ActInput.RightMouse
150 input = ActInput.AllAction
181 return EInput.axis != Vector2.zero;
268 ActionMode.DefaultMode =
this;
290 base.OnRenderTile(point, result, dir);
333 position = Camera.main.WorldToScreenPoint(position);
335 position += EClass.ui.hud.transRightPos * Mathf.Min(0f,
EClass.
screen.
Zoom - 1f);
336 EClass.ui.hud.transRight.position = position;
344 CursorSystem.leftIcon =
null;
346 if (flag && !
EClass.
ui.isPointerOverUI)
349 CursorSystem.leftIconAngle = (int)(
gearAngle / 45f) * 45;
375 EClass.
ui.hud.transRight.SetActive(enable:
true);
381 if (
EClass.
ui.hud.textLeft.gameObject.activeSelf)
385 if (
EClass.
ui.hud.textRight.gameObject.activeSelf)
389 if (
EClass.
ui.hud.textMiddle.gameObject.activeSelf)
393 if (
EClass.
ui.hud.textWheel.gameObject.activeSelf)
395 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;
416 textWheel =
"textWheel_changeHeight".lang();
436 EClass.player.renderThing =
null;
443 EClass.player.hotItemToRestore =
null;
469 EClass.player.flags.debugEnabled =
true;
474 EClass.player.willAutoSave =
false;
478 RecipeUpdater.dirty =
false;
496 EClass.player.waitingInput =
false;
506 Msg.
Say(
"abort_allyDying");
511 Msg.
Say(
"abort_itemLoss");
521 EClass.player.invlunerable =
false;
537 EClass.player.invlunerable =
false;
545 EClass.player.waitingInput =
true;
556 if (!instance || instance.
ratio > 0.85f)
568 EClass.player.returnInfo.askDest =
false;
571 if (list ==
null || list.Count == 0)
573 EClass.player.returnInfo =
null;
591 EClass.player.returnInfo.turns = 1;
599 b.button1.mainText.rectTransform.sizeDelta =
new Vector2(350f, 20f);
605 EClass.player.returnInfo =
null;
609 .SetTitles(
"wReturn");
614 EClass.player.haltMove =
false;
627 EClass.player.showShippingResult =
false;
659 pressedAction.action =
null;
665 pressedAction.action =
null;
679 EClass.player.nextMove = Vector2.zero;
684 pressedAction.button =
null;
685 pressedAction.axis = Vector2.zero;
686 pressedAction.count = 0;
687 pressedAction.timerRepeat = 0f;
690 EClass.player.willEndTurn =
false;
713 CursorSystem.ignoreCount = 5;
722 CursorSystem.ignoreCount = 5;
738 EInput.middleMouse.pressedTimer = 100f;
750 EInput.middleMouse.pressedTimer = 100f;
818 if (Input.GetKey(KeyCode.LeftControl))
820 if (Input.GetKeyDown(KeyCode.F))
822 EClass.
ui.widgets.Toggle(
"Search")?.SoundActivate();
834 if (!cancel && !text.IsEmpty())
836 string[] array = text.SplitByNewline();
837 foreach (
string obj
in array)
841 if ((text2[0] ==
'@' || text2[0] ==
'ï¼ ') && text2.Length > 1 &&
int.TryParse(text2[1].ToString().Normalize(NormalizationForm.FormKC), out var result))
843 text2 = text2.Substring(2);
846 if (text2.StartsWith(
'@'))
848 text2 = text2.Substring(1);
851 string text3 = text2;
853 if (!text2.StartsWith(
'*') && !text2.StartsWith(
'(') && !text2.StartsWith(
'('))
855 text2 = text2.Bracket();
857 Msg.
Say(text2.RemoveAllTags(), chara);
864 EClass.
ui.widgets.Toggle(
"Search")?.SoundActivate();
959 if (traitNewZone !=
null && traitNewZone.
CanAutoEnter())
1016 ACT.Throw.target = thing;
1035 EClass.pc.ranged = thing;
1038 EClass.player.renderThing = thing;
1108 EClass.screen.focusPos =
null;
1110 SE.Play(
zoomOut2 ?
"zoomOut" :
"zoomIn");
1111 EClass.
ui.widgets.OnChangeActionMode();
1149 else if (Input.GetKeyDown(KeyCode.LeftShift))
1155 SetTurbo((!Input.GetKey(KeyCode.LeftShift)) ? (-1) : 0);
1158 EClass.player.nextMove.x = 0f;
1159 EClass.player.nextMove.y = 0f;
1165 point.x += (int)vector.
x;
1166 point.
z += (
int)vector.y;
1189 EClass.player.nextMove.x = vector.x;
1190 EClass.player.nextMove.y = vector.y;
1226 SE.Play(
"noAction");
1250 pressedAction.repeat =
zoomOut;
1251 pressedAction.ignoreCount =
true;
1280 EClass.player.nextMove = Vector2.zero;
1292 EClass.player.nextMove = Vector2.zero;
1316 if (Mathf.Abs(vector2Int.x) > 1 || Mathf.Abs(vector2Int.y) > 1)
1318 int num = Mathf.Max(Mathf.Abs(vector2Int.x), Mathf.Abs(vector2Int.y));
1319 vector2Int.x /= num;
1320 vector2Int.y /= num;
1322 EClass.player.nextMove = vector2Int;
1327 EClass.player.nextMove =
vArrow;
1376 EClass.player.nextMove =
vArrow;
1408 Action<int, int, int, int> action = delegate(
int x,
int y,
int i,
int a)
1415 if (num < 45f || num >= 360f)
1417 action(-1, -1, 0, 0);
1421 action(-1, 0, 1, 35);
1423 else if (num < 135f)
1425 action(-1, 1, 2, 90);
1427 else if (num < 180f)
1429 action(0, 1, 3, 145);
1431 else if (num < 225f)
1433 action(1, 1, 4, 180);
1435 else if (num < 270f)
1437 action(1, 0, 5, 215);
1439 else if (num < 315f)
1441 action(1, -1, 6, 270);
1445 action(0, -1, 7, 325);
virtual bool CanManualCancel()
static void CancelKeepPlaying()
void SetAction(Func< bool > _action=null, bool _canTurbo=true, bool _willEndTurn=true, bool _waitForTurn=true, bool _canRepeat=false)
void SetPlan(ActPlan _plan)
void Init(ButtonState _button=null)
override void OnActivate()
bool PressedActionMove(Point pos)
override void _OnUpdateInput()
override bool HighlightWall(Point p)
override void OnDeactivate()
override void OnBeforeUpdate()
override float TargetZoom
bool TryCancelInteraction(bool sound=true)
override int GetDefaultTile(Point p)
override void OnUpdateCursor()
override bool AllowWheelZoom
virtual void OnEnterChat(string text)
override void OnRenderTile(Point point, HitResult result, int dir)
override bool ShouldPauseGame
void SetPressedAction(ButtonState button)
override void OnAfterUpdate()
PressedAction pressedAction
void SetTurbo(int mtp=-1)
virtual void RefreshArrow()
void Update(PointTarget target)
override bool CanPerform()
static bool CanThrow(Chara c, Thing t, Card target, Point p=null)
static float[] GameSpeeds
void DoFunc(CoreConfig.GameFuncBuild func)
void WaitForEndOfFrame(Action action)
virtual void RefreshPosition()
virtual void SetFirst(bool first, Vector3 pos)
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
virtual void Rotate(bool reverse=false)
void PlayAnime(AnimeID id, bool force=false)
void SayRaw(string text, string ref1=null, string ref2=null)
bool HasElement(int ele, bool includeNagative=false)
void Say(string lang, string ref1=null, string ref2=null)
bool IsCriticallyWounded(bool includeRide=false)
bool HasCondition(string alias)
ConTransmuteMimic mimicry
void SetAIImmediate(AIAct g)
bool UseAbility(int idAct, Card tc=null, Point pos=null, bool pt=false)
static NoGoal _NoGoalRepeat
bool FindNearestNewEnemy()
override bool IsMultisize
bool IsEnemyOnPath(Point p, bool cancelAI=true)
override void LookAt(Card c)
List< CursorInfo > arrows
static CursorInfo IconGear
static void SetCursor(CursorInfo info=null, int _priority=0)
static CursorSystem Instance
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
static BaseGameScreen screen
static GameSetting setting
ConfigAutoCombat autoCombat
static void Load(string id, bool cloud)
static bool TryLoad(string id, bool cloud, Action onLoad)
bool Save(bool isAutoSave=false, bool silent=false)
static Point lastlastPoint
static bool CanChangeHeightByWheel()
static TaskBuild taskBuild
virtual void OnRenderTile(Point point, HitResult result, int dir)
UIButton SetSubText(string lang, int x, FontColor c=FontColor.Default, TextAnchor align=TextAnchor.MiddleLeft)
Layer SetOnKill(Action action)
void Add(Point point, float tile=0f, float color=0f)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
bool IsCriticallyWounded(bool includePc=false)
void RequestPathImmediate(PathProgress progress)
static PathManager Instance
bool CanExitBorder(Point p)
bool HasValidRangedTarget()
void EndTurn(bool consume=true)
void EnterLocalZone(bool encounter=false, Chara mob=null)
void ExitBorder(ActPlan p=null)
void SetCurrentHotItem(HotItem item)
ref Vector3 Position(int height)
Point Set(int _x, int _z)
ref Vector3 PositionAuto()
ref Vector3 PositionCenter()
bool Equals(int _x, int _z)
List< Chara > ListCharas()
Thing FindThing(Func< Thing, bool > func)
void Build(Point _p, Mode _mode=Mode.Passive)
List< Zone > ListReturnLocations()
string NameWithDangerLevel
static bool CanMine(Point pos, Card t)
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)
bool CanAutoFire(Chara c, Card tg, bool reloading=false)
bool MoveZone(bool confirmed=false)
virtual void OnRenderTile(Point point, HitResult result, int dir)
static void TryPlayReserve()
List< ButtonPair > buttons