2using System.Collections.Generic;
37 public void Init(Vector3 _axis)
55 public void SetAction(Func<bool> _action =
null,
bool _canTurbo =
true,
bool _willEndTurn =
true,
bool _waitForTurn =
true,
bool _canRepeat =
false)
78 act = ((plan.list.Count == 1) ?
plan.
list[0].act :
null);
91 if (
axis != Vector2.zero)
93 return EInput.axis ==
axis;
134 input = ActInput.LeftMouse
139 input = ActInput.RightMouse
149 input = ActInput.AllAction
180 return EInput.axis != Vector2.zero;
267 ActionMode.DefaultMode =
this;
289 base.OnRenderTile(point, result, dir);
332 position = Camera.main.WorldToScreenPoint(position);
334 position += EClass.ui.hud.transRightPos * Mathf.Min(0f,
EClass.
screen.
Zoom - 1f);
335 EClass.ui.hud.transRight.position = position;
343 CursorSystem.leftIcon =
null;
345 if (flag && !
EClass.
ui.isPointerOverUI)
348 CursorSystem.leftIconAngle = (int)(
gearAngle / 45f) * 45;
374 EClass.
ui.hud.transRight.SetActive(enable:
true);
380 if (
EClass.
ui.hud.textLeft.gameObject.activeSelf)
384 if (
EClass.
ui.hud.textRight.gameObject.activeSelf)
388 if (
EClass.
ui.hud.textMiddle.gameObject.activeSelf)
392 if (
EClass.
ui.hud.textWheel.gameObject.activeSelf)
394 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;
415 textWheel =
"textWheel_changeHeight".lang();
435 EClass.player.renderThing =
null;
442 EClass.player.hotItemToRestore =
null;
468 EClass.player.flags.debugEnabled =
true;
473 EClass.player.willAutoSave =
false;
477 RecipeUpdater.dirty =
false;
495 EClass.player.waitingInput =
false;
505 Msg.
Say(
"abort_allyDying");
510 Msg.
Say(
"abort_itemLoss");
520 EClass.player.invlunerable =
false;
536 EClass.player.invlunerable =
false;
544 EClass.player.waitingInput =
true;
554 if (!instance || instance.
ratio > 0.85f)
566 EClass.player.returnInfo.askDest =
false;
569 if (list ==
null || list.Count == 0)
571 EClass.player.returnInfo =
null;
589 EClass.player.returnInfo.turns = 1;
597 b.button1.mainText.rectTransform.sizeDelta =
new Vector2(350f, 20f);
603 EClass.player.returnInfo =
null;
607 .SetTitles(
"wReturn");
612 EClass.player.haltMove =
false;
625 EClass.player.showShippingResult =
false;
657 pressedAction.action =
null;
663 pressedAction.action =
null;
677 EClass.player.nextMove = Vector2.zero;
682 pressedAction.button =
null;
683 pressedAction.axis = Vector2.zero;
684 pressedAction.count = 0;
685 pressedAction.timerRepeat = 0f;
688 EClass.player.willEndTurn =
false;
711 CursorSystem.ignoreCount = 5;
720 CursorSystem.ignoreCount = 5;
736 EInput.middleMouse.pressedTimer = 100f;
748 EInput.middleMouse.pressedTimer = 100f;
816 if (Input.GetKey(KeyCode.LeftControl))
818 if (Input.GetKeyDown(KeyCode.F))
820 EClass.
ui.widgets.Toggle(
"Search")?.SoundActivate();
827 EClass.
ui.widgets.Toggle(
"Search")?.SoundActivate();
922 if (traitNewZone !=
null && traitNewZone.
CanAutoEnter())
979 ACT.Throw.target = thing;
998 EClass.pc.ranged = thing;
1001 EClass.player.renderThing = thing;
1062 EClass.screen.focusPos =
null;
1064 SE.Play(
zoomOut2 ?
"zoomOut" :
"zoomIn");
1065 EClass.
ui.widgets.OnChangeActionMode();
1103 else if (Input.GetKeyDown(KeyCode.LeftShift))
1109 SetTurbo((!Input.GetKey(KeyCode.LeftShift)) ? (-1) : 0);
1112 EClass.player.nextMove.x = 0f;
1113 EClass.player.nextMove.y = 0f;
1119 point.x += (int)vector.
x;
1120 point.
z += (
int)vector.y;
1143 EClass.player.nextMove.x = vector.x;
1144 EClass.player.nextMove.y = vector.y;
1180 SE.Play(
"noAction");
1204 pressedAction.repeat =
zoomOut;
1205 pressedAction.ignoreCount =
true;
1234 EClass.player.nextMove = Vector2.zero;
1246 EClass.player.nextMove = Vector2.zero;
1270 if (Mathf.Abs(vector2Int.x) > 1 || Mathf.Abs(vector2Int.y) > 1)
1272 int num = Mathf.Max(Mathf.Abs(vector2Int.x), Mathf.Abs(vector2Int.y));
1273 vector2Int.x /= num;
1274 vector2Int.y /= num;
1276 EClass.player.nextMove = vector2Int;
1281 EClass.player.nextMove =
vArrow;
1330 EClass.player.nextMove =
vArrow;
1362 Action<int, int, int, int> action = delegate(
int x,
int y,
int i,
int a)
1369 if (num < 45f || num >= 360f)
1371 action(-1, -1, 0, 0);
1375 action(-1, 0, 1, 35);
1377 else if (num < 135f)
1379 action(-1, 1, 2, 90);
1381 else if (num < 180f)
1383 action(0, 1, 3, 145);
1385 else if (num < 225f)
1387 action(1, 1, 4, 180);
1389 else if (num < 270f)
1391 action(1, 0, 5, 215);
1393 else if (num < 315f)
1395 action(1, -1, 6, 270);
1399 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
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)
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)
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 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