Elin Decompiled Documentation EA 23.183 Nightly Patch 1
Loading...
Searching...
No Matches
ActPlan.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using UnityEngine;
5using UnityEngine.UI;
6
7public class ActPlan : EClass
8{
9 public class List : List<Item>
10 {
11 public void Add(Act a, string s = "")
12 {
13 Add(new Item
14 {
15 act = a
16 });
17 }
18 }
19
20 public class Item
21 {
22 public Act act;
23
24 public Card tc;
25
26 public Point pos;
27
28 public Chara cc => EClass.pc;
29
30 public bool HideHint
31 {
32 get
33 {
34 if (!EClass.pc.isBlind)
35 {
36 if (tc != null && tc.isChara)
37 {
38 return !EClass.pc.CanSee(tc);
39 }
40 return false;
41 }
42 return true;
43 }
44 }
45
46 public string GetText(bool showName)
47 {
48 return act.GetText() + ((showName && act.GetTextSmall(tc) != null) ? ("\n<size=28>" + act.GetTextSmall(tc) + "</size>") : "");
49 }
50
51 public string GetTextContext(bool showName)
52 {
53 return act.GetText() + ((showName && tc != null && !HideHint) ? ("<size=13> (" + tc.Name + ")</size>") : "");
54 }
55
56 public bool Perform(bool repeated = false)
57 {
58 if (AM_Adv.actCount == 0 && !Dialog.warned)
59 {
60 warning = true;
61 Chara _CC = Act.CC;
62 Card _TC = Act.TC;
63 Point _TP = new Point(Act.TP);
64 if (EClass._zone.IsCrime(EClass.pc, act) && act.ID != "actContainer")
65 {
66 Dialog.TryWarnCrime(delegate
67 {
68 Act.CC = _CC;
69 Act.TC = _TC;
70 Act.TP.Set(_TP);
71 if (Perform())
72 {
74 }
75 });
76 return false;
77 }
78 if (act is TaskHarvest && (act as TaskHarvest).mode == BaseTaskHarvest.HarvestType.Disassemble)
79 {
81 {
82 Act.CC = _CC;
83 Act.TC = _TC;
84 Act.TP.Set(_TP);
85 if (Perform())
86 {
88 }
89 });
90 return false;
91 }
92 }
93 warning = false;
94 int num = cc.pos.Distance(pos);
95 bool flag = num == 1 && cc.CanInteractTo(pos);
96 AIAct aIAct = act as AIAct;
97 if (act.IsAct)
98 {
99 Act.CC = EClass.pc;
100 if (act.PerformDistance != -1 && (num > act.PerformDistance || (num == 1 && !flag)))
101 {
103 {
104 pos = pos.Copy()
105 });
106 return false;
107 }
108 bool num2 = act.Perform(cc, tc, pos);
109 if (num2 && !EClass.pc.HasNoGoal)
110 {
112 }
113 if (num2)
114 {
115 return EClass.pc.HasNoGoal;
116 }
117 return false;
118 }
119 if (repeated)
120 {
121 if (cc.ai.GetType() == act.GetType() && cc.ai.IsRunning)
122 {
123 return false;
124 }
125 aIAct.Reset();
126 if (!act.CanPerform())
127 {
129 return false;
130 }
131 if (aIAct is Task task)
132 {
133 task.isDestroyed = false;
134 TaskPoint taskPoint = task as TaskPoint;
135 if (EClass.scene.mouseTarget.isValid && taskPoint != null)
136 {
137 taskPoint.isRepeated = true;
138 taskPoint.pos = EClass.scene.mouseTarget.pos.Copy();
139 }
140 }
141 }
142 cc.SetAIImmediate(aIAct);
143 ActionMode.Adv.SetTurbo(aIAct.UseTurbo ? (-1) : 0);
144 return false;
145 }
146 }
147
148 public static bool warning;
149
150 public Point pos = new Point();
151
153
154 public bool performed;
155
156 public bool altAction;
157
159
161
162 private bool showOrder;
163
164 public List list = new List();
165
166 public int dist;
167
168 public Thing tool;
169
171
172 public Act lastAct;
173
174 public bool IsSelf => dist == 0;
175
177
179 {
180 get
181 {
183 {
184 return dist == 1;
185 }
186 return false;
187 }
188 }
189
190 public bool canRepeat
191 {
192 get
193 {
194 if (list.Count == 1)
195 {
196 return list[0].act.CanPressRepeat;
197 }
198 return false;
199 }
200 }
201
202 public Chara cc => EClass.pc;
203
205 {
206 get
207 {
208 if (list.Count != 0)
209 {
210 if (list.Count <= 1)
211 {
212 return list[0].act.GetCursorIcon(list[0].tc);
213 }
214 return CursorSystem.Notice;
215 }
216 return null;
217 }
218 }
219
220 public bool WillEndTurn
221 {
222 get
223 {
224 if (list.Count > 0)
225 {
226 return list[0].act.WillEndTurn;
227 }
228 return false;
229 }
230 }
231
232 public bool HideRightInfo
233 {
234 get
235 {
236 if (list.Count > 0)
237 {
238 return list[0].act.HideRightInfo;
239 }
240 return false;
241 }
242 }
243
244 public bool HasAct => list.Count > 0;
245
246 public bool ShowAct
247 {
248 get
249 {
250 if (HasAct)
251 {
252 if (lastAct != list[0].act)
253 {
254 return list[0].act.ShowMouseHint(list[0].tc);
255 }
256 return false;
257 }
258 return false;
259 }
260 }
261
263 {
264 get
265 {
266 if (list.Count > 1)
267 {
268 return list[0].tc != list.LastItem().tc;
269 }
270 return false;
271 }
272 }
273
274 public string GetText(bool showName)
275 {
276 if (list.Count == 0)
277 {
278 return "";
279 }
280 if (list.Count == 1)
281 {
282 return list[0].GetText(showName);
283 }
284 return "+" + list.Count + ((HasMultipleTargets || list[0].tc == null) ? ("\n<size=28>(" + "multipleTargets".lang() + ")</size>") : ("\n<size=28>" + list[0].tc.Name + list[0].tc.GetExtraName() + "</size>"));
285 }
286
287 public Func<bool> GetAction()
288 {
289 if (list.Count == 0)
290 {
291 return () => false;
292 }
293 if (list.Count > 1)
294 {
295 return delegate
296 {
298 {
299 return false;
300 }
302 return false;
303 };
304 }
305 Item item = list[0];
306 return delegate
307 {
308 if (performed && !item.act.CanPressRepeat)
309 {
310 return false;
311 }
312 performed = true;
313 lastAct = item.act;
314 return item.Perform(performed);
315 };
316 }
317
318 public void Order(string id)
319 {
320 EClass.player.forceTalk = true;
321 EClass.pc.SayRaw(id.lang());
322 }
323
324 public void ShowContextMenu()
325 {
326 UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction();
327 int num = 1;
328 if (showOrder)
329 {
330 UIContextMenu uIContextMenu2 = uIContextMenu.AddChild("order_ally");
331 uIContextMenu2.AddButton("order_fight", delegate
332 {
333 Order("order_fight");
334 });
335 uIContextMenu2.AddButton("order_heal", delegate
336 {
337 Order("order_heal");
338 });
339 uIContextMenu2.AddButton("order_wait", delegate
340 {
341 Order("order_wait");
342 });
343 }
344 foreach (Item i in list)
345 {
346 string textContext = i.GetTextContext(HasMultipleTargets);
347 textContext = textContext.Replace("\n", " ").Replace(Environment.NewLine, " ");
348 uIContextMenu.AddButton(textContext, delegate
349 {
350 performed = true;
351 if (i.Perform())
352 {
354 }
355 });
356 num++;
357 if (num >= 21)
358 {
359 break;
360 }
361 }
362 uIContextMenu.Show();
363 EClass.ui.hud.HideMouseInfo();
364 }
365
366 public bool TrySetAct(string lang, Func<bool> onPerform, Card tc, CursorInfo cursor = null, int dist = 1, bool isHostileAct = false, bool localAct = true, bool canRepeat = false)
367 {
368 return TrySetAct(new DynamicAct(lang, onPerform)
369 {
370 id = lang,
371 dist = dist,
372 isHostileAct = isHostileAct,
373 localAct = localAct,
374 cursor = ((cursor == CursorSystem.Arrow) ? null : cursor),
375 canRepeat = () => canRepeat
376 }, tc);
377 }
378
379 public bool TrySetAct(string lang, Func<bool> onPerform, CursorInfo cursor = null, int dist = 1)
380 {
381 return TrySetAct(new DynamicAct(lang, onPerform)
382 {
383 id = lang,
384 dist = dist,
385 cursor = ((cursor == CursorSystem.Arrow) ? null : cursor)
386 });
387 }
388
389 public bool TrySetAct(Act _act, Card _tc = null)
390 {
391 if (!ignoreAddCondition && !_act.CanPerform(cc, _tc, pos))
392 {
393 return false;
394 }
395 Item item = new Item
396 {
397 act = _act,
398 tc = _tc,
399 pos = pos.Copy()
400 };
401 if (_tc != null && _tc.isChara)
402 {
403 int num = -1;
404 for (int i = 0; i < list.Count; i++)
405 {
406 if (list[i].tc == _tc)
407 {
408 num = i;
409 }
410 }
411 if (num != -1)
412 {
413 list.Insert(num + 1, item);
414 }
415 else
416 {
417 list.Add(item);
418 }
419 }
420 else
421 {
422 list.Add(item);
423 }
424 return true;
425 }
426
427 public void Clear()
428 {
429 list.Clear();
430 pos.IsValid = false;
431 }
432
433 public void Update(PointTarget target)
434 {
435 if (warning)
436 {
437 return;
438 }
439 _Update(target);
440 if (!HasAct)
441 {
442 return;
443 }
444 Color effectColor = ((list.Count == 1) ? list[0].act.GetActPlanColor() : EClass.Colors.colorAct);
445 if (input == ActInput.LeftMouse || input == ActInput.Key)
446 {
447 EClass.ui.hud.textLeft.SetText(GetText(showName: true));
448 Outline[] components = EClass.ui.hud.textLeft.GetComponents<Outline>();
449 for (int i = 0; i < components.Length; i++)
450 {
451 components[i].effectColor = effectColor;
452 }
453 }
454 else if (input == ActInput.RightMouse)
455 {
457 EClass.ui.hud.imageRight.rectTransform.localScale = new Vector3(2f, 2f, 1f);
458 EClass.ui.hud.textRight.SetText(GetText(showName: true));
459 Outline[] components = EClass.ui.hud.textRight.GetComponents<Outline>();
460 for (int i = 0; i < components.Length; i++)
461 {
462 components[i].effectColor = effectColor;
463 }
464 }
465 }
466
467 public void _Update(PointTarget target)
468 {
469 showOrder = false;
470 performed = false;
471 list.Clear();
472 listPick.Clear();
473 if (!pos.Equals(target.pos))
474 {
475 lastAct = null;
476 }
477 pos.Set(target.pos);
479 if (!pos.IsValid || EClass.pc.isDead)
480 {
481 return;
482 }
483 Point _pos = new Point(pos);
484 _ = target.pos.cell;
485 List<Card> items = _pos.ListCards();
486 bool isKey = input == ActInput.Key;
487 altAction = (EInput.isShiftDown && !EInput.isAltDown && !isKey) || input == ActInput.AllAction;
488 _canInteractNeighbor = dist == 0 || (dist == 1 && cc.CanInteractTo(_pos));
489 if (EClass.pc.isBlind && !_pos.Equals(EClass.pc.pos) && !isKey && input != 0)
490 {
491 return;
492 }
493 if (isKey || input == ActInput.LeftMouse || input == ActInput.AllAction)
494 {
495 if (EClass.ui.IsDragging)
496 {
497 return;
498 }
499 if (_pos.cell.outOfBounds)
500 {
501 if (EClass.player.CanExitBorder(_pos))
502 {
504 }
505 return;
506 }
507 if (!isKey && _pos.Equals(cc.pos) && EClass._zone.IsRegion)
508 {
509 TrySetAct("actNewZone", delegate
510 {
512 return false;
514 if (input == ActInput.AllAction)
515 {
516 TrySetAct("LayerTravel", delegate
517 {
518 EClass.ui.AddLayer<LayerTravel>();
519 return false;
520 }, null, CursorSystem.MoveZone, 1, isHostileAct: false, localAct: false);
521 }
522 }
523 items.ForeachReverse(delegate(Card _c)
524 {
525 Chara c2 = _c.Chara;
526 if (c2 != null && !c2.IsPC && EClass.pc.CanSee(c2))
527 {
528 int num = c2.Dist(EClass.pc);
529 if (num <= 1 || !EClass.pc.isBlind)
530 {
531 if (!EClass.pc.isBlind && !c2.IsHostile() && (input == ActInput.AllAction || !(c2.IsPCParty || c2.IsMinion || isKey)) && (input == ActInput.AllAction || !c2.IsNeutral() || c2.quest != null || EClass.game.quests.IsDeliverTarget(c2)) && c2.isSynced && num <= 2)
532 {
533 bool flag5 = !c2.HasCondition<ConSuspend>() && (!c2.isRestrained || !c2.IsPCFaction);
535 {
536 flag5 = false;
537 }
538 if (flag5 || altAction)
539 {
540 if (EClass.pc.HasElement(1216) && c2.HasCondition<ConSleep>())
541 {
543 {
544 target = c2,
545 succubus = true
546 }, c2);
547 }
548 TrySetAct(ACT.Chat, c2);
549 }
550 }
551 if (c2.host != EClass.pc)
552 {
553 TraitShackle traitShackle = c2.pos.FindThing<TraitShackle>();
555 {
556 if (traitShackle != null && traitShackle.AllowTraining)
557 {
559 {
560 target = c2
561 });
562 }
563 }
564 else if ((c2.IsHostile() || altAction || c2.isRestrained) && c2.IsAliveInCurrentZone)
565 {
566 TrySetAct(ACT.Melee, c2);
567 }
568 }
569 if (c2.IsPCPartyMinion && !c2.Chara.IsEscorted() && altAction)
570 {
571 TrySetAct("ActBanishSummon", delegate
572 {
573 Banish(c2);
574 return true;
575 }, c2, null, 99);
576 List<Chara> list2 = new List<Chara>();
577 foreach (Chara chara in EClass._map.charas)
578 {
579 if (chara.IsPCPartyMinion && !chara.IsEscorted())
580 {
581 list2.Add(chara);
582 }
583 }
584 if (list2.Count > 1)
585 {
586 TrySetAct("ActBanishSummonAll", delegate
587 {
588 foreach (Chara item in list2)
589 {
590 Banish(item);
591 }
592 return true;
593 }, c2, null, 99);
594 }
595 }
596 }
597 }
598 });
599 if (_pos.IsHidden)
600 {
601 return;
602 }
604 {
605 items.ForeachReverse(delegate(Card _c)
606 {
607 Chara c = _c.Chara;
608 if (c != null)
609 {
610 bool flag3 = EClass.pc.CanSee(c);
611 if (flag3)
612 {
613 if (input == ActInput.LeftMouse && c.IsPCFaction && !c.IsPC && pos.FindThing<TraitHitchingPost>() != null)
614 {
615 Chara ride = c;
616 List<string> list = EClass.core.pccs.sets["ride"].map["body"].map.Keys.ToList();
617 int index = list.IndexOf(ride.c_idRidePCC);
618 if (index == -1)
619 {
620 index = 0;
621 }
622 TrySetAct("ActChangeRideSkin", delegate
623 {
624 UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction();
625 uIContextMenu.AddSlider("rideSkin", (float a) => list[(int)a].Split('-')[0] ?? "", index, delegate(float a)
626 {
627 ride.c_idRidePCC = list[(int)a];
628 ride._CreateRenderer();
629 }, 0f, list.Count - 1, isInt: true, hideOther: false);
630 uIContextMenu.Show();
631 return false;
632 }, c);
633 }
634 if (!c.IsPC && ((c.IsPCFaction && !c.IsDisabled) || EClass.debug.enable) && input == ActInput.AllAction)
635 {
636 TrySetAct("actTrade", delegate
637 {
639 return false;
640 }, c);
641 }
642 if (c.host != null && EClass.pc.held != null && altAction)
643 {
644 bool flag4 = true;
646 {
647 flag4 = false;
648 }
649 if (!c.IsDisabled && flag4 && c.CanAcceptGift(EClass.pc, EClass.pc.held))
650 {
651 string lang = "actGive";
652 if (c.Evalue(1232) > 0 && EClass.pc.held.trait is TraitDrinkMilkMother)
653 {
654 lang = "actMilk";
655 }
656 TrySetAct(lang, delegate
657 {
658 if (!c.IsValidGiftWeight(EClass.pc.held, 1))
659 {
660 c.Talk("tooHeavy");
661 return true;
662 }
664 {
665 Dialog.YesNo("dialogGive".lang(EClass.pc.held.GetName(NameStyle.Full, 1)), func);
666 }
667 else
668 {
669 func();
670 }
671 return true;
672 }, c);
673 }
674 }
675 }
676 if (input == ActInput.AllAction && EClass.pc.held != null && EClass.pc.held.trait is TraitDrink)
677 {
678 TrySetAct(c.IsPC ? "actPour" : "ActThrow", delegate
679 {
680 ActThrow.Throw(EClass.pc, c.pos, c, EClass.pc.held.Split(1));
681 return true;
682 }, (c.host != null) ? c : EClass.pc.held);
683 }
684 if (!c.IsPC && c.host == null && ((!EClass.pc.isBlind && flag3) || input != ActInput.AllAction))
685 {
686 if (c.isRestrained && (input == ActInput.AllAction || (!c.IsRestrainedResident && !c.IsHostile())))
687 {
688 TrySetAct("ActUnrestrain", delegate
689 {
690 c.TryUnrestrain(force: true, EClass.pc);
691 return true;
692 }, c);
693 }
694 if (!EClass.pc.isBlind && flag3 && input == ActInput.AllAction)
695 {
696 TrySetAct(ACT.Kick, c);
697 if (c.IsMofuable)
698 {
699 TrySetAct("ActCuddle", delegate
700 {
701 EClass.pc.Cuddle(c);
702 return true;
703 }, c);
704 }
706 {
707 TrySetAct("inspect", delegate
708 {
709 c.Inspect();
710 return false;
711 }, c);
712 }
713 }
714 }
715 }
716 else if (_c.isThing)
717 {
718 if (!EClass.pc.isBlind)
719 {
720 Thing t = _c.Thing;
721 if (input == ActInput.AllAction)
722 {
723 if ((EClass.debug.enable || EClass.player.HasKeyItem("license_illumination")) && t.LightData != null)
724 {
725 if (t.c_lightColor != 0)
726 {
727 TrySetAct("actClearLight", delegate
728 {
729 t.c_lightColor = 0;
730 t.RecalculateFOV();
731 t.renderer.GetTC<TCExtra>()?.RefreshColor();
732 return false;
733 }, t);
734 }
735 TrySetAct("actSetLight", delegate
736 {
737 Color lightColor = t.LightColor;
738 EClass.ui.AddLayer<LayerColorPicker>().SetColor(lightColor, lightColor, delegate(PickerState state, Color _c)
739 {
740 if (state == PickerState.Cancel)
741 {
742 t.c_lightColor = 0;
743 }
744 else
745 {
746 t.c_lightColor = (byte)Mathf.Clamp(_c.r * 32f, 1f, 31f) * 1024 + (byte)Mathf.Clamp(_c.g * 32f, 1f, 31f) * 32 + (byte)Mathf.Clamp(_c.b * 32f, 1f, 31f);
747 }
748 t.RecalculateFOV();
750 });
751 return false;
752 }, t);
753 }
755 {
756 TrySetAct("(debug) Toggle Float", delegate
757 {
758 t.isFloating = !t.isFloating;
759 return false;
760 }, t);
761 }
763 {
764 if (t.trait.CanEat(EClass.pc))
765 {
766 TrySetAct(new AI_Eat
767 {
768 target = t
769 }, t);
770 }
771 if (t.trait.CanDrink(EClass.pc))
772 {
774 {
775 target = t
776 }, t);
777 }
778 if (t.trait.CanRead(EClass.pc))
779 {
781 {
782 target = t
783 }, t);
784 }
785 if (t.trait.IsBlendBase)
786 {
787 TrySetAct("invBlend", delegate
788 {
790 return true;
791 }, t);
792 }
793 if (t.trait.CanName)
794 {
795 TrySetAct("changeName", delegate
796 {
797 Dialog.InputName("dialogChangeName", t.c_refText.IsEmpty(""), delegate(bool cancel, string text)
798 {
799 if (!cancel)
800 {
801 t.c_refText = text;
802 }
803 });
804 return false;
805 }, t);
806 }
807 }
808 }
809 if (isKey)
810 {
811 _ = t.trait.CanBeAttacked;
812 }
813 else
814 {
815 if (t.placeState == PlaceState.roaming && (_pos.cell.blocked || t.ignoreAutoPick || altAction || input == ActInput.AllAction || _pos.Equals(EClass.pc.pos)) && EClass.pc.CanPick(t))
816 {
817 listPick.Add(t);
818 }
819 if (t.IsInstalled)
820 {
821 t.trait.TrySetToggleAct(this);
822 t.trait.TrySetAct(this);
823 }
824 }
825 }
826 }
827 void func()
828 {
830 }
831 });
832 if (listPick.Count > 0)
833 {
834 if (listPick.Count == 1)
835 {
836 Thing _t = listPick[0];
838 {
839 TrySetAct("actPickOne", delegate
840 {
841 EClass.pc.Pick(_t);
842 return true;
843 }, listPick[0], CursorSystem.Hand, 1, isHostileAct: false, localAct: false);
844 }
845 }
846 else
847 {
848 IList<Card> _cards = items.Copy();
849 TrySetAct("actPickAll", delegate
850 {
851 foreach (Card item2 in _cards)
852 {
853 if (item2.isThing && item2.placeState == PlaceState.roaming)
854 {
855 EClass.pc.Pick(item2.Thing);
856 }
857 }
858 return true;
859 }, null, CursorSystem.Hand, 1, isHostileAct: false, localAct: false);
860 }
861 }
862 if (input == ActInput.AllAction && pos.IsSky)
863 {
864 TrySetAct("actSkyJump", delegate
865 {
867 return false;
868 });
869 }
870 if (_pos.Equals(cc.pos))
871 {
872 if (cc.held != null && !cc.held.IsHotItem)
873 {
874 TrySetAct("actPick", delegate
875 {
876 _ = cc.held;
877 cc.PickHeld(msg: true);
878 ActionMode.AdvOrRegion.updatePlans = true;
879 return false;
880 }, cc.held, CursorSystem.Inventory, 1, isHostileAct: false, localAct: false);
881 }
882 else if (!HasAct && !cc.isRestrained)
883 {
885 }
886 if (EClass.debug.enable)
887 {
888 showOrder = true;
889 }
890 if (input == ActInput.AllAction && EClass.pc.held != null && !EClass.pc.held.trait.CanOnlyCarry)
891 {
892 TrySetAct("actDrop", delegate
893 {
895 return true;
896 });
897 }
898 if (cc.isRestrained)
899 {
900 TrySetAct("ActUnrestrain", delegate
901 {
902 cc.TryUnrestrain(force: true, EClass.pc);
903 return true;
904 }, cc);
905 }
906 }
907 }
908 if (list.Count == 0 && input == ActInput.AllAction && EClass.pc.held == null && pos.cell.IsSnowTile && !pos.IsBlocked && !pos.HasObj && !pos.HasThing)
909 {
911 {
912 pos = pos.Copy()
913 });
914 }
915 if (list.Count != 0 && input != ActInput.AllAction)
916 {
917 return;
918 }
919 items.ForeachReverse(delegate(Card _c)
920 {
921 if (_c.isThing && _c.trait.CanBeAttacked && !(_c.trait is TraitTrainingDummy))
922 {
923 TrySetAct(ACT.Melee, _c);
924 }
925 });
926 }
927 else
928 {
929 if (input != ActInput.RightMouse)
930 {
931 return;
932 }
933 if (pos.cell.outOfBounds || EClass.ui.IsDragging)
934 {
935 return;
936 }
938 if (!hotItem.IsGameAction)
939 {
940 TrySetAct(hotItem.Name, delegate
941 {
942 hotItem.OnClick(hotItem.button, hotItem.hotbar);
943 return false;
944 }, null, -1);
945 }
946 else
947 {
948 hotItem.TrySetAct(this);
949 }
950 bool flag = EClass.game.config.autoCombat.enable && EClass.scene.mouseTarget.TargetChara != null;
951 if (hotItem.Thing != null && hotItem.Thing.trait.DisableAutoCombat)
952 {
953 flag = false;
954 }
955 if (flag)
956 {
958 bool flag2 = true;
959 if (targetChara.hostility >= Hostility.Friend)
960 {
961 flag2 = false;
962 }
964 {
965 flag2 = false;
966 }
967 if (list.Count >= 2)
968 {
969 flag2 = false;
970 }
971 if (list.Count == 1)
972 {
973 if (targetChara.hostility >= Hostility.Neutral)
974 {
975 flag2 = false;
976 }
977 if (!list[0].act.ShowAuto)
978 {
979 flag2 = false;
980 }
981 if (EClass.player.currentHotItem is HotItemNoItem && targetChara.hostility <= Hostility.Enemy)
982 {
983 flag2 = true;
984 }
985 }
986 if (flag2)
987 {
988 list.Clear();
989 TrySetAct(new GoalAutoCombat(targetChara));
990 }
991 }
992 if (list.Count == 0 && !EClass.core.config.test.toolNoPick)
993 {
995 }
996 if ((bool)WidgetCurrentTool.Instance)
997 {
999 }
1000 }
1001 static void Banish(Chara m)
1002 {
1003 EClass.pc.Say("summon_vanish", m);
1004 m.pos.PlayEffect("vanish");
1005 m.pos.PlaySound("vanish");
1006 m.pos.PlayEffect("teleport");
1007 m.Destroy();
1008 }
1009 }
1010}
ActInput
Definition: ActInput.cs:2
Hostility
Definition: Hostility.cs:2
PickerState
Definition: PickerState.cs:2
PlaceState
Definition: PlaceState.cs:2
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
Definition: ACT.cs:6
static ActChat Chat
Definition: ACT.cs:9
static new ActWait Wait
Definition: ACT.cs:7
static ActKick Kick
Definition: ACT.cs:13
static ActMelee Melee
Definition: ACT.cs:15
Definition: AIAct.cs:6
virtual bool UseTurbo
Definition: AIAct.cs:88
virtual bool IsRunning
Definition: AIAct.cs:31
void Reset()
Definition: AIAct.cs:326
Definition: AI_Eat.cs:5
Definition: AM_Adv.cs:6
static int actCount
Definition: AM_Adv.cs:101
void SetTurbo(int mtp=-1)
Definition: AM_Adv.cs:1040
string GetText(bool showName)
Definition: ActPlan.cs:46
Card tc
Definition: ActPlan.cs:24
bool HideHint
Definition: ActPlan.cs:31
Point pos
Definition: ActPlan.cs:26
bool Perform(bool repeated=false)
Definition: ActPlan.cs:56
string GetTextContext(bool showName)
Definition: ActPlan.cs:51
Chara cc
Definition: ActPlan.cs:28
void Add(Act a, string s="")
Definition: ActPlan.cs:11
int dist
Definition: ActPlan.cs:166
bool _canInteractNeighbor
Definition: ActPlan.cs:160
bool HideRightInfo
Definition: ActPlan.cs:233
bool altAction
Definition: ActPlan.cs:156
bool showOrder
Definition: ActPlan.cs:162
bool ShowAct
Definition: ActPlan.cs:247
Thing tool
Definition: ActPlan.cs:168
Chara cc
Definition: ActPlan.cs:202
Act lastAct
Definition: ActPlan.cs:172
static bool warning
Definition: ActPlan.cs:148
bool HasMultipleTargets
Definition: ActPlan.cs:263
bool ignoreAddCondition
Definition: ActPlan.cs:158
bool IsNeighborBlocked
Definition: ActPlan.cs:179
CursorInfo CursorIcon
Definition: ActPlan.cs:205
ActInput input
Definition: ActPlan.cs:152
string GetText(bool showName)
Definition: ActPlan.cs:274
Point pos
Definition: ActPlan.cs:150
void Update(PointTarget target)
Definition: ActPlan.cs:433
Func< bool > GetAction()
Definition: ActPlan.cs:287
void Order(string id)
Definition: ActPlan.cs:318
bool IsSelfOrNeighbor
Definition: ActPlan.cs:176
bool IsSelf
Definition: ActPlan.cs:174
bool TrySetAct(Act _act, Card _tc=null)
Definition: ActPlan.cs:389
void ShowContextMenu()
Definition: ActPlan.cs:324
List< Thing > listPick
Definition: ActPlan.cs:170
List list
Definition: ActPlan.cs:164
bool WillEndTurn
Definition: ActPlan.cs:221
void _Update(PointTarget target)
Definition: ActPlan.cs:467
void Clear()
Definition: ActPlan.cs:427
bool TrySetAct(string lang, Func< bool > onPerform, Card tc, CursorInfo cursor=null, int dist=1, bool isHostileAct=false, bool localAct=true, bool canRepeat=false)
Definition: ActPlan.cs:366
bool TrySetAct(string lang, Func< bool > onPerform, CursorInfo cursor=null, int dist=1)
Definition: ActPlan.cs:379
bool performed
Definition: ActPlan.cs:154
bool canRepeat
Definition: ActPlan.cs:191
bool HasAct
Definition: ActPlan.cs:244
static bool SearchMedal(Chara c, Point p)
Definition: ActWait.cs:20
Definition: ACT.cs:62
virtual bool Perform()
Definition: ACT.cs:266
static Card TC
Definition: ACT.cs:79
virtual bool IsAct
Definition: ACT.cs:101
static Point TP
Definition: ACT.cs:81
virtual int PerformDistance
Definition: ACT.cs:137
static Chara CC
Definition: ACT.cs:77
virtual string ID
Definition: ACT.cs:99
virtual string GetTextSmall(Card c)
Definition: ACT.cs:232
virtual string GetText(string str="")
Definition: ACT.cs:215
virtual bool CanPerform()
Definition: ACT.cs:303
static AM_Adv Adv
Definition: ActionMode.cs:15
TC GetTC(string id)
Definition: Card.cs:11
bool IsPCFactionOrMinion
Definition: Card.cs:2234
virtual bool isThing
Definition: Card.cs:2043
virtual Chara Chara
Definition: Card.cs:2032
bool isNPCProperty
Definition: Card.cs:540
bool IsRestrainedResident
Definition: Card.cs:2220
bool isFloating
Definition: Card.cs:636
bool HasElement(int ele, int req=1)
Definition: Card.cs:5638
bool isRestrained
Definition: Card.cs:552
bool ignoreAutoPick
Definition: Card.cs:492
string c_refText
Definition: Card.cs:1603
string Name
Definition: Card.cs:2099
bool IsHotItem
Definition: Card.cs:117
PlaceState placeState
Definition: Card.cs:81
void RecalculateFOV()
Definition: Card.cs:6064
Point pos
Definition: Card.cs:57
int c_lightColor
Definition: Card.cs:1070
Trait trait
Definition: Card.cs:51
string c_idRidePCC
Definition: Card.cs:1627
void Destroy()
Definition: Card.cs:4850
bool IsInstalled
Definition: Card.cs:2343
virtual bool isChara
Definition: Card.cs:2045
virtual Thing Thing
Definition: Card.cs:2020
int Evalue(int ele)
Definition: Card.cs:2533
int Dist(Card c)
Definition: Card.cs:7315
LightData LightData
Definition: Card.cs:2392
void TryUnrestrain(bool force=false, Chara c=null)
Definition: Card.cs:6779
Color LightColor
Definition: Card.cs:1082
void Inspect()
Definition: Card.cs:7500
void SayRaw(string text, string ref1=null, string ref2=null)
Definition: Card.cs:6478
CardRenderer renderer
Definition: Card.cs:59
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6499
bool IsSnowTile
Definition: Cell.cs:782
bool IsTopWater
Definition: Cell.cs:700
bool outOfBounds
Definition: Cell.cs:414
Definition: Chara.cs:10
override bool IsAliveInCurrentZone
Definition: Chara.cs:559
Card held
Definition: Chara.cs:70
bool CanAcceptGift(Chara c, Card t)
Definition: Chara.cs:7804
AIAct ai
Definition: Chara.cs:200
void Cuddle(Chara c, bool headpat=false)
Definition: Chara.cs:5928
bool CanPick(Card c)
Definition: Chara.cs:4130
override bool IsPC
Definition: Chara.cs:610
Chara host
Definition: Chara.cs:33
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:7773
bool IsMofuable
Definition: Chara.cs:1081
override bool IsPCParty
Definition: Chara.cs:613
void PickHeld(bool msg=false)
Definition: Chara.cs:4384
bool HasCondition(string alias)
Definition: Chara.cs:8926
AIAct SetAI(AIAct g)
Definition: Chara.cs:8399
override bool IsDisabled
Definition: Chara.cs:583
override bool IsMinion
Definition: Chara.cs:625
override bool isSynced
Definition: Chara.cs:689
override CardRenderer _CreateRenderer()
Definition: Chara.cs:6302
override bool IsPCFaction
Definition: Chara.cs:669
override bool IsPCPartyMinion
Definition: Chara.cs:637
bool CanSee(Card c)
Definition: Chara.cs:1200
void SetAIImmediate(AIAct g)
Definition: Chara.cs:8431
bool CanInteractTo(Card c)
Definition: Chara.cs:2444
static NoGoal _NoGoalRepeat
Definition: Chara.cs:196
bool HasNoGoal
Definition: Chara.cs:986
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4481
void GiveGift(Chara c, Thing t)
Definition: Chara.cs:7829
Quest quest
Definition: Chara.cs:24
bool isBlind
Definition: Chara.cs:130
void FallFromZone()
Definition: Chara.cs:3420
Hostility hostility
Definition: Chara.cs:289
Card SplitHeld(int a)
Definition: Chara.cs:4444
bool IsHostile()
Definition: Chara.cs:6193
bool isDead
Definition: Chara.cs:387
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:4168
bool IsEscorted()
Definition: Chara.cs:2321
bool IsNeutral()
Definition: Chara.cs:6232
new GameConfig game
Definition: CoreConfig.cs:602
bool showExtra
Definition: CoreDebug.cs:167
bool enable
Definition: CoreDebug.cs:285
PCCManager pccs
Definition: Core.cs:41
CoreConfig config
Definition: Core.cs:70
static CursorInfo Arrow
Definition: CursorSystem.cs:46
static CursorInfo Hand
Definition: CursorSystem.cs:60
static CursorInfo Inventory
Definition: CursorSystem.cs:92
static CursorInfo Notice
Definition: CursorSystem.cs:76
static CursorInfo MoveZone
Definition: CursorSystem.cs:86
Definition: Dialog.cs:7
static bool warned
Definition: Dialog.cs:49
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
Definition: Dialog.cs:528
static void TryWarnDisassemble(Action action)
Definition: Dialog.cs:406
static void TryWarnCrime(Action action)
Definition: Dialog.cs:376
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
static Scene scene
Definition: EClass.cs:30
static ColorProfile Colors
Definition: EClass.cs:38
static Core core
Definition: EClass.cs:6
static Zone _zone
Definition: EClass.cs:20
static Map _map
Definition: EClass.cs:18
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
static CoreDebug debug
Definition: EClass.cs:48
static UI ui
Definition: EClass.cs:16
ConfigAutoCombat autoCombat
Definition: Game.cs:93
Config config
Definition: Game.cs:215
QuestManager quests
Definition: Game.cs:179
static bool disableTool
Definition: HotItemHeld.cs:11
static bool _TrySetAct(ActPlan p)
virtual void SetImage(Image icon)
Definition: HotItem.cs:91
virtual bool TrySetAct(ActPlan p)
Definition: HotItem.cs:107
virtual bool IsGameAction
Definition: HotItem.cs:46
virtual Thing Thing
Definition: HotItem.cs:38
static LayerDragGrid Create(InvOwnerDraglet owner, bool refuelFromLayerDragGrid=false)
static LayerInventory CreateContainer(Card owner)
List< Chara > charas
Definition: Map.cs:81
bool CanExitBorder(Point p)
Definition: Player.cs:1792
bool HasKeyItem(string alias)
Definition: Player.cs:2059
void EndTurn(bool consume=true)
Definition: Player.cs:1984
void EnterLocalZone(bool encounter=false, Chara mob=null)
Definition: Player.cs:1849
void ExitBorder(ActPlan p=null)
Definition: Player.cs:1750
HotItem currentHotItem
Definition: Player.cs:1020
bool isValid
Definition: PointTarget.cs:30
Chara TargetChara
Definition: PointTarget.cs:41
Definition: Point.cs:9
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1031
Point Copy()
Definition: Point.cs:479
bool IsSky
Definition: Point.cs:212
Point Set(int _x, int _z)
Definition: Point.cs:491
bool IsBlocked
Definition: Point.cs:351
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1233
bool HasThing
Definition: Point.cs:239
bool Equals(int _x, int _z)
Definition: Point.cs:940
bool IsValid
Definition: Point.cs:88
Effect PlayEffect(string id)
Definition: Point.cs:1228
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:969
bool IsHidden
Definition: Point.cs:335
Cell cell
Definition: Point.cs:51
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1120
bool IsDeliverTarget(Chara c)
PointTarget mouseTarget
Definition: Scene.cs:135
virtual bool IsRegion
Definition: Spatial.cs:501
void RefreshColor()
Definition: TCExtra.cs:171
Definition: Task.cs:4
Definition: Thing.cs:8
virtual bool AllowTraining
Definition: TraitShackle.cs:13
virtual bool IsBlendBase
Definition: Trait.cs:260
virtual bool CanBeAttacked
Definition: Trait.cs:164
virtual bool IsTool
Definition: Trait.cs:364
virtual void TrySetAct(ActPlan p)
Definition: Trait.cs:1025
virtual bool CanRead(Chara c)
Definition: Trait.cs:960
virtual void TrySetToggleAct(ActPlan p)
Definition: Trait.cs:1231
virtual bool CanName
Definition: Trait.cs:144
virtual bool CanEat(Chara c)
Definition: Trait.cs:969
virtual bool DisableAutoCombat
Definition: Trait.cs:198
virtual bool CanDrink(Chara c)
Definition: Trait.cs:978
virtual bool CanOnlyCarry
Definition: Trait.cs:290
virtual string Name
Definition: UIButton.cs:19
void Show(UIItem i)
UIContextMenuItem AddSlider(string text, Func< float, string > textFunc, float value, Action< float > action, float min=0f, float max=1f, bool isInt=false, bool hideOther=true, bool useInput=false)
void AddButton(Func< string > funcText, UnityAction action=null)
UIContextMenu AddChild(string idLang, TextAnchor anchor)
static WidgetCurrentTool Instance
UIPlaceHelper placer
virtual bool IsUserZone
Definition: Zone.cs:266
ZoneInstance instance
Definition: Zone.cs:52
bool IsCrime(Chara c, Act act)
Definition: Zone.cs:3401