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;
418 textWheel =
"textWheel_changeHeight".lang();
441 EClass.player.renderThing =
null;
448 EClass.player.hotItemToRestore =
null;
474 EClass.player.flags.debugEnabled =
true;
479 EClass.player.willAutoSave =
false;
483 RecipeUpdater.dirty =
false;
501 EClass.player.waitingInput =
false;
511 Msg.
Say(
"abort_allyDying");
516 Msg.
Say(
"abort_itemLoss");
526 EClass.player.invlunerable =
false;
542 EClass.player.invlunerable =
false;
550 EClass.player.waitingInput =
true;
561 if (!instance || instance.
ratio > 0.85f)
573 EClass.player.returnInfo.askDest =
false;
576 if (list ==
null || list.Count == 0)
578 EClass.player.returnInfo =
null;
596 EClass.player.returnInfo.turns = 1;
604 b.button1.mainText.rectTransform.sizeDelta =
new Vector2(350f, 20f);
610 EClass.player.returnInfo =
null;
614 .SetTitles(
"wReturn");
619 EClass.player.haltMove =
false;
632 EClass.player.showShippingResult =
false;
664 pressedAction.action =
null;
670 pressedAction.action =
null;
684 EClass.player.nextMove = Vector2.zero;
689 pressedAction.button =
null;
690 pressedAction.axis = Vector2.zero;
691 pressedAction.count = 0;
692 pressedAction.timerRepeat = 0f;
695 EClass.player.willEndTurn =
false;
718 CursorSystem.ignoreCount = 5;
727 CursorSystem.ignoreCount = 5;
743 EInput.middleMouse.pressedTimer = 100f;
755 EInput.middleMouse.pressedTimer = 100f;
823 if (Input.GetKey(KeyCode.LeftControl))
825 if (Input.GetKeyDown(KeyCode.F))
827 EClass.
ui.widgets.Toggle(
"Search")?.SoundActivate();
839 if (!cancel && !text.IsEmpty())
841 string[] array = text.SplitByNewline();
842 foreach (
string obj
in array)
846 if ((text2[0] ==
'@' || text2[0] ==
'ï¼ ') && text2.Length > 1 &&
int.TryParse(text2[1].ToString().Normalize(NormalizationForm.FormKC), out var result))
848 text2 = text2.Substring(2);
851 if (text2.StartsWith(
'@'))
853 text2 = text2.Substring(1);
856 string text3 = text2;
858 if (!text2.StartsWith(
'*') && !text2.StartsWith(
'(') && !text2.StartsWith(
'('))
860 text2 = text2.Bracket();
862 Msg.
Say(text2.RemoveAllTags(), chara);
869 EClass.
ui.widgets.Toggle(
"Search")?.SoundActivate();
964 if (traitNewZone !=
null && traitNewZone.
CanAutoEnter())
1021 ACT.Throw.target = thing;
1040 EClass.pc.ranged = thing;
1043 EClass.player.renderThing = thing;
1113 EClass.screen.focusPos =
null;
1115 SE.Play(
zoomOut2 ?
"zoomOut" :
"zoomIn");
1116 EClass.
ui.widgets.OnChangeActionMode();
1154 else if (Input.GetKeyDown(KeyCode.LeftShift))
1160 SetTurbo((!Input.GetKey(KeyCode.LeftShift)) ? (-1) : 0);
1163 EClass.player.nextMove.x = 0f;
1164 EClass.player.nextMove.y = 0f;
1170 point.x += (int)vector.
x;
1171 point.
z += (
int)vector.y;
1194 EClass.player.nextMove.x = vector.x;
1195 EClass.player.nextMove.y = vector.y;
1231 SE.Play(
"noAction");
1255 pressedAction.repeat =
zoomOut;
1256 pressedAction.ignoreCount =
true;
1285 EClass.player.nextMove = Vector2.zero;
1297 EClass.player.nextMove = Vector2.zero;
1321 if (Mathf.Abs(vector2Int.x) > 1 || Mathf.Abs(vector2Int.y) > 1)
1323 int num = Mathf.Max(Mathf.Abs(vector2Int.x), Mathf.Abs(vector2Int.y));
1324 vector2Int.x /= num;
1325 vector2Int.y /= num;
1327 EClass.player.nextMove = vector2Int;
1332 EClass.player.nextMove =
vArrow;
1381 EClass.player.nextMove =
vArrow;
1413 Action<int, int, int, int> action = delegate(
int x,
int y,
int i,
int a)
1420 if (num < 45f || num >= 360f)
1422 action(-1, -1, 0, 0);
1426 action(-1, 0, 1, 35);
1428 else if (num < 135f)
1430 action(-1, 1, 2, 90);
1432 else if (num < 180f)
1434 action(0, 1, 3, 145);
1436 else if (num < 225f)
1438 action(1, 1, 4, 180);
1440 else if (num < 270f)
1442 action(1, 0, 5, 215);
1444 else if (num < 315f)
1446 action(1, -1, 6, 270);
1450 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)
BaseCondition GetCondition(string idCon)
bool IsCriticallyWounded(bool includeRide=false)
bool HasCondition(string alias)
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)
ConBaseTransmuteMimic mimicry
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