Elin Decompiled Documentation EA 23.270 Nightly Patch 1
Loading...
Searching...
No Matches
ActPlan Class Reference
Inheritance diagram for ActPlan:
EClass

Classes

class  Item
 
class  List
 

Public Member Functions

string GetText (bool showName)
 
Func< bool > GetAction ()
 
void Order (string id)
 
void ShowContextMenu ()
 
bool TrySetAct (string lang, Func< bool > onPerform, Card tc, CursorInfo cursor=null, int dist=1, bool isHostileAct=false, bool localAct=true, bool canRepeat=false)
 
bool TrySetAct (string lang, Func< bool > onPerform, CursorInfo cursor=null, int dist=1)
 
bool TrySetAct (Act _act, Card _tc=null)
 
void Clear ()
 
void Update (PointTarget target)
 
void _Update (PointTarget target)
 

Public Attributes

Point pos = new Point()
 
ActInput input
 
bool performed
 
bool altAction
 
bool ignoreAddCondition
 
List list = new List()
 
int dist
 
Thing tool
 
List< ThinglistPick = new List<Thing>()
 
Act lastAct
 

Static Public Attributes

static bool warning
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

bool IsSelf [get]
 
bool IsSelfOrNeighbor [get]
 
bool IsNeighborBlocked [get]
 
bool canRepeat [get]
 
Chara cc [get]
 
CursorInfo CursorIcon [get]
 
bool WillEndTurn [get]
 
bool HideRightInfo [get]
 
bool HasAct [get]
 
bool ShowAct [get]
 
bool HasMultipleTargets [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Private Attributes

bool _canInteractNeighbor
 
bool showOrder
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Detailed Description

Definition at line 7 of file ActPlan.cs.

Member Function Documentation

◆ _Update()

void ActPlan._Update ( PointTarget  target)
inline

Definition at line 469 of file ActPlan.cs.

470 {
471 showOrder = false;
472 performed = false;
473 list.Clear();
474 listPick.Clear();
475 if (!pos.Equals(target.pos))
476 {
477 lastAct = null;
478 }
479 pos.Set(target.pos);
481 if (!pos.IsValid || EClass.pc.isDead)
482 {
483 return;
484 }
485 Point _pos = new Point(pos);
486 _ = target.pos.cell;
487 List<Card> items = _pos.ListCards();
488 bool isKey = input == ActInput.Key;
489 altAction = (EInput.isShiftDown && !EInput.isAltDown && !isKey) || input == ActInput.AllAction;
490 _canInteractNeighbor = dist == 0 || (dist == 1 && cc.CanInteractTo(_pos));
491 if (EClass.pc.isBlind && !_pos.Equals(EClass.pc.pos) && !isKey && input != 0)
492 {
493 return;
494 }
495 if (isKey || input == ActInput.LeftMouse || input == ActInput.AllAction)
496 {
497 if (EClass.ui.IsDragging)
498 {
499 return;
500 }
501 if (_pos.cell.outOfBounds)
502 {
503 if (EClass.player.CanExitBorder(_pos))
504 {
506 }
507 return;
508 }
509 if (!isKey && _pos.Equals(cc.pos) && EClass._zone.IsRegion)
510 {
511 TrySetAct("actNewZone", delegate
512 {
514 return false;
516 if (input == ActInput.AllAction)
517 {
518 TrySetAct("LayerTravel", delegate
519 {
520 EClass.ui.AddLayer<LayerTravel>();
521 return false;
522 }, null, CursorSystem.MoveZone, 1, isHostileAct: false, localAct: false);
523 }
524 }
525 items.ForeachReverse(delegate(Card _c)
526 {
527 Chara c2 = _c.Chara;
528 if (c2 != null && !c2.IsPC && EClass.pc.CanSee(c2))
529 {
530 int num = c2.Dist(EClass.pc);
531 if (num <= 1 || !EClass.pc.isBlind)
532 {
533 if (c2.mimicry != null && !c2.IsPCParty)
534 {
535 if (num <= 1)
536 {
537 c2.mimicry.TrySetAct(this);
538 }
539 }
540 else
541 {
542 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)
543 {
544 bool flag5 = !c2.HasCondition<ConSuspend>() && (!c2.isRestrained || !c2.IsPCFaction);
546 {
547 flag5 = false;
548 }
549 if (flag5 || altAction)
550 {
551 if (EClass.pc.HasElement(1216) && c2.HasCondition<ConSleep>())
552 {
554 {
555 target = c2,
556 variation = AI_Fuck.Variation.Succubus
557 }, c2);
558 }
559 TrySetAct(ACT.Chat, c2);
560 }
561 }
562 if (!c2.IsPC && num <= 2 && ((c2.IsPCFaction && !c2.IsDisabled) || EClass.debug.enable) && input == ActInput.AllAction)
563 {
564 TrySetAct("actTrade", delegate
565 {
567 return false;
568 }, c2, null, 2);
569 }
570 if (c2.host != EClass.pc)
571 {
572 TraitShackle traitShackle = c2.pos.FindThing<TraitShackle>();
574 {
575 if (traitShackle != null && traitShackle.AllowTraining)
576 {
578 {
579 target = c2
580 });
581 }
582 }
583 else if ((c2.IsHostile() || altAction || c2.isRestrained) && c2.IsAliveInCurrentZone)
584 {
585 TrySetAct(ACT.Melee, c2);
586 }
587 }
588 if (c2.IsPCPartyMinion && !c2.Chara.IsEscorted() && altAction)
589 {
590 TrySetAct("ActBanishSummon", delegate
591 {
592 c2.Banish(EClass.pc);
593 return true;
594 }, c2, null, 99);
595 List<Chara> list2 = new List<Chara>();
596 foreach (Chara chara in EClass._map.charas)
597 {
598 if (chara.IsPCFactionMinion && !chara.IsEscorted())
599 {
600 list2.Add(chara);
601 }
602 }
603 if (list2.Count > 1)
604 {
605 TrySetAct("ActBanishSummonAll", delegate
606 {
607 foreach (Chara item in list2)
608 {
609 item.Banish(EClass.pc);
610 }
611 return true;
612 }, c2, null, 99);
613 }
614 }
615 }
616 }
617 }
618 });
619 if (_pos.IsHidden)
620 {
621 return;
622 }
624 {
625 items.ForeachReverse(delegate(Card _c)
626 {
627 Chara c = _c.Chara;
628 if (c != null && (c.mimicry == null || c.IsPCParty))
629 {
630 bool flag3 = EClass.pc.CanSee(c);
631 if (flag3)
632 {
633 if (input == ActInput.LeftMouse && c.IsPCFaction && !c.IsPC && pos.FindThing<TraitHitchingPost>() != null)
634 {
635 Chara ride = c;
636 List<string> list = EClass.core.pccs.sets["ride"].map["body"].map.Keys.ToList();
637 int index = list.IndexOf(ride.c_idRidePCC);
638 if (index == -1)
639 {
640 index = 0;
641 }
642 TrySetAct("ActChangeRideSkin", delegate
643 {
644 UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction();
645 uIContextMenu.AddSlider("rideSkin", (float a) => list[(int)a].Split('-')[0] ?? "", index, delegate(float a)
646 {
647 ride.c_idRidePCC = list[(int)a];
648 ride._CreateRenderer();
649 }, 0f, list.Count - 1, isInt: true, hideOther: false);
650 uIContextMenu.Show();
651 return false;
652 }, c);
653 }
654 if (c.host != null && EClass.pc.held != null && altAction)
655 {
656 bool flag4 = true;
658 {
659 flag4 = false;
660 }
661 if (!c.IsDisabled && flag4 && c.CanAcceptGift(EClass.pc, EClass.pc.held))
662 {
663 string lang = "actGive";
664 if (c.Evalue(1232) > 0 && EClass.pc.held.trait is TraitDrinkMilkMother)
665 {
666 lang = "actMilk";
667 }
668 TrySetAct(lang, delegate
669 {
670 if (!c.IsValidGiftWeight(EClass.pc.held, 1))
671 {
672 c.Talk("tooHeavy");
673 return true;
674 }
676 {
677 Dialog.YesNo("dialogGive".lang(EClass.pc.held.GetName(NameStyle.Full, 1)), func);
678 }
679 else
680 {
681 func();
682 }
683 return true;
684 }, c);
685 }
686 }
687 }
688 if (input == ActInput.AllAction && EClass.pc.held != null && EClass.pc.held.trait is TraitDrink)
689 {
690 TrySetAct(c.IsPC ? "actPour" : "ActThrow", delegate
691 {
692 ActThrow.Throw(EClass.pc, c.pos, c, EClass.pc.held.Split(1));
693 return true;
694 }, (c.host != null) ? c : EClass.pc.held);
695 }
696 if (!c.IsPC && c.host == null && ((!EClass.pc.isBlind && flag3) || input != ActInput.AllAction))
697 {
698 if (c.isRestrained && (input == ActInput.AllAction || (!c.IsRestrainedResident && !c.IsHostile())))
699 {
700 TrySetAct("ActUnrestrain", delegate
701 {
702 c.TryUnrestrain(force: true, EClass.pc);
703 return true;
704 }, c);
705 }
706 if (!EClass.pc.isBlind && flag3 && input == ActInput.AllAction)
707 {
708 TrySetAct(ACT.Kick, c);
709 if (c.IsMofuable)
710 {
711 TrySetAct("ActCuddle", delegate
712 {
713 EClass.pc.Cuddle(c);
714 return true;
715 }, c);
716 }
718 {
719 TrySetAct("inspect", delegate
720 {
721 c.Inspect();
722 return false;
723 }, c);
724 }
725 }
726 }
727 }
728 else if (_c.isThing)
729 {
730 if (!EClass.pc.isBlind)
731 {
732 Thing t = _c.Thing;
733 if (input == ActInput.AllAction)
734 {
735 if ((EClass.debug.enable || EClass.player.HasKeyItem("license_illumination")) && t.LightData != null)
736 {
737 if (t.c_lightColor != 0)
738 {
739 TrySetAct("actClearLight", delegate
740 {
741 t.c_lightColor = 0;
742 t.RecalculateFOV();
743 t.renderer.GetTC<TCExtra>()?.RefreshColor();
744 return false;
745 }, t);
746 }
747 TrySetAct("actSetLight", delegate
748 {
749 Color lightColor = t.LightColor;
750 EClass.ui.AddLayer<LayerColorPicker>().SetColor(lightColor, lightColor, delegate(PickerState state, Color _c)
751 {
752 if (state == PickerState.Cancel)
753 {
754 t.c_lightColor = 0;
755 }
756 else
757 {
758 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);
759 }
760 t.RecalculateFOV();
762 });
763 return false;
764 }, t);
765 }
767 {
768 TrySetAct("(debug) Toggle Float", delegate
769 {
770 t.isFloating = !t.isFloating;
771 return false;
772 }, t);
773 }
775 {
776 if (t.trait.CanEat(EClass.pc))
777 {
778 TrySetAct(new AI_Eat
779 {
780 target = t
781 }, t);
782 }
783 if (t.trait.CanDrink(EClass.pc))
784 {
786 {
787 target = t
788 }, t);
789 }
790 if (t.trait.CanRead(EClass.pc))
791 {
793 {
794 target = t
795 }, t);
796 }
797 if (t.trait.IsBlendBase)
798 {
799 TrySetAct("invBlend", delegate
800 {
802 return true;
803 }, t);
804 }
805 if (t.trait.CanName)
806 {
807 TrySetAct("changeName", delegate
808 {
809 Dialog.InputName("dialogChangeName", t.c_refText.IsEmpty(""), delegate(bool cancel, string text)
810 {
811 if (!cancel)
812 {
813 t.c_refText = text;
814 }
815 });
816 return false;
817 }, t);
818 }
819 }
820 }
821 if (isKey)
822 {
823 _ = t.trait.CanBeAttacked;
824 }
825 else
826 {
827 if (t.placeState == PlaceState.roaming && (_pos.cell.blocked || t.ignoreAutoPick || altAction || input == ActInput.AllAction || _pos.Equals(EClass.pc.pos)) && EClass.pc.CanPick(t))
828 {
829 listPick.Add(t);
830 }
831 if (t.IsInstalled)
832 {
833 t.trait.TrySetToggleAct(this);
834 t.trait.TrySetAct(this);
835 }
836 }
837 }
838 }
839 void func()
840 {
842 }
843 });
844 if (listPick.Count > 0)
845 {
846 if (listPick.Count == 1)
847 {
848 Thing _t = listPick[0];
850 {
851 TrySetAct("actPickOne", delegate
852 {
853 EClass.pc.Pick(_t);
854 return true;
855 }, listPick[0], CursorSystem.Hand, 1, isHostileAct: false, localAct: false);
856 }
857 }
858 else
859 {
860 IList<Card> _cards = items.Copy();
861 TrySetAct("actPickAll", delegate
862 {
863 foreach (Card item2 in _cards)
864 {
865 if (item2.isThing && item2.placeState == PlaceState.roaming)
866 {
867 EClass.pc.Pick(item2.Thing);
868 }
869 }
870 return true;
871 }, null, CursorSystem.Hand, 1, isHostileAct: false, localAct: false);
872 }
873 }
874 if (input == ActInput.AllAction && pos.IsSky && !EClass.game.IsSurvival)
875 {
876 TrySetAct("actSkyJump", delegate
877 {
879 return false;
880 });
881 }
882 if (_pos.Equals(cc.pos))
883 {
884 if (cc.held != null && !cc.held.IsHotItem)
885 {
886 TrySetAct("actPick", delegate
887 {
888 _ = cc.held;
889 cc.PickHeld(msg: true);
890 ActionMode.AdvOrRegion.updatePlans = true;
891 return false;
892 }, cc.held, CursorSystem.Inventory, 1, isHostileAct: false, localAct: false);
893 }
894 else if (!HasAct && !cc.isRestrained)
895 {
897 }
898 if (EClass.debug.enable)
899 {
900 showOrder = true;
901 }
902 if (input == ActInput.AllAction && EClass.pc.held != null && !EClass.pc.held.trait.CanOnlyCarry)
903 {
904 TrySetAct("actDrop", delegate
905 {
907 return true;
908 });
909 }
910 if (cc.isRestrained)
911 {
912 TrySetAct("ActUnrestrain", delegate
913 {
914 cc.TryUnrestrain(force: true, EClass.pc);
915 return true;
916 }, cc);
917 }
918 }
919 }
920 if (list.Count == 0 && input == ActInput.AllAction && EClass.pc.held == null && pos.cell.IsSnowTile && !pos.IsBlocked && !pos.HasObj && !pos.HasThing)
921 {
923 {
924 pos = pos.Copy()
925 });
926 }
927 if (list.Count != 0 && input != ActInput.AllAction)
928 {
929 return;
930 }
931 items.ForeachReverse(delegate(Card _c)
932 {
933 if (_c.isThing && _c.trait.CanBeAttacked && !(_c.trait is TraitTrainingDummy))
934 {
935 TrySetAct(ACT.Melee, _c);
936 }
937 });
938 }
939 else
940 {
941 if (input != ActInput.RightMouse)
942 {
943 return;
944 }
945 if (pos.cell.outOfBounds || EClass.ui.IsDragging)
946 {
947 return;
948 }
950 if (!hotItem.IsGameAction)
951 {
952 TrySetAct(hotItem.Name, delegate
953 {
954 hotItem.OnClick(hotItem.button, hotItem.hotbar);
955 return false;
956 }, null, -1);
957 }
958 else
959 {
960 hotItem.TrySetAct(this);
961 }
962 bool flag = EClass.game.config.autoCombat.enable && EClass.scene.mouseTarget.TargetChara != null && EClass.scene.mouseTarget.TargetChara.mimicry == null;
963 if (hotItem.Thing != null && hotItem.Thing.trait.DisableAutoCombat)
964 {
965 flag = false;
966 }
967 if (flag)
968 {
970 bool flag2 = true;
971 if (targetChara.hostility >= Hostility.Friend)
972 {
973 flag2 = false;
974 }
976 {
977 flag2 = false;
978 }
979 if (list.Count >= 2)
980 {
981 flag2 = false;
982 }
983 if (list.Count == 1)
984 {
985 if (targetChara.hostility >= Hostility.Neutral)
986 {
987 flag2 = false;
988 }
989 if (!list[0].act.ShowAuto)
990 {
991 flag2 = false;
992 }
993 if (EClass.player.currentHotItem is HotItemNoItem && targetChara.hostility <= Hostility.Enemy)
994 {
995 flag2 = true;
996 }
997 }
998 if (flag2)
999 {
1000 list.Clear();
1001 TrySetAct(new GoalAutoCombat(targetChara));
1002 }
1003 }
1004 if (list.Count == 0 && !EClass.core.config.test.toolNoPick)
1005 {
1007 }
1008 if ((bool)WidgetCurrentTool.Instance)
1009 {
1011 }
1012 }
1013 }
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: AI_Eat.cs:5
void Add(Act a, string s="")
Definition: ActPlan.cs:11
int dist
Definition: ActPlan.cs:168
bool _canInteractNeighbor
Definition: ActPlan.cs:162
bool altAction
Definition: ActPlan.cs:158
bool showOrder
Definition: ActPlan.cs:164
Chara cc
Definition: ActPlan.cs:204
Act lastAct
Definition: ActPlan.cs:174
ActInput input
Definition: ActPlan.cs:154
Point pos
Definition: ActPlan.cs:152
bool IsSelfOrNeighbor
Definition: ActPlan.cs:178
List< Thing > listPick
Definition: ActPlan.cs:172
List list
Definition: ActPlan.cs:166
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:368
bool performed
Definition: ActPlan.cs:156
bool HasAct
Definition: ActPlan.cs:246
TC GetTC(string id)
Definition: Card.cs:11
bool IsPCFactionOrMinion
Definition: Card.cs:2275
virtual bool isThing
Definition: Card.cs:2082
virtual Chara Chara
Definition: Card.cs:2071
bool isNPCProperty
Definition: Card.cs:555
bool IsRestrainedResident
Definition: Card.cs:2261
bool isFloating
Definition: Card.cs:651
bool isRestrained
Definition: Card.cs:567
bool ignoreAutoPick
Definition: Card.cs:507
string c_refText
Definition: Card.cs:1630
bool IsHotItem
Definition: Card.cs:120
PlaceState placeState
Definition: Card.cs:84
void RecalculateFOV()
Definition: Card.cs:6530
Point pos
Definition: Card.cs:60
int c_lightColor
Definition: Card.cs:1097
Trait trait
Definition: Card.cs:54
string c_idRidePCC
Definition: Card.cs:1654
bool IsInstalled
Definition: Card.cs:2384
virtual Thing Thing
Definition: Card.cs:2059
int Evalue(int ele)
Definition: Card.cs:2574
int Dist(Card c)
Definition: Card.cs:7838
LightData LightData
Definition: Card.cs:2433
void TryUnrestrain(bool force=false, Chara c=null)
Definition: Card.cs:7271
Color LightColor
Definition: Card.cs:1109
void Inspect()
Definition: Card.cs:8023
CardRenderer renderer
Definition: Card.cs:62
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6061
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:563
Card held
Definition: Chara.cs:70
bool CanAcceptGift(Chara c, Card t)
Definition: Chara.cs:8225
void Cuddle(Chara c, bool headpat=false)
Definition: Chara.cs:6258
bool CanPick(Card c)
Definition: Chara.cs:4290
override bool IsPC
Definition: Chara.cs:614
Chara host
Definition: Chara.cs:33
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:8194
bool IsMofuable
Definition: Chara.cs:1113
override bool IsPCParty
Definition: Chara.cs:617
void PickHeld(bool msg=false)
Definition: Chara.cs:4544
bool HasCondition(string alias)
Definition: Chara.cs:9424
void Banish(Chara owner)
Definition: Chara.cs:2364
override bool IsDisabled
Definition: Chara.cs:587
override bool IsMinion
Definition: Chara.cs:629
override bool isSynced
Definition: Chara.cs:693
ConTransmuteMimic mimicry
Definition: Chara.cs:106
override CardRenderer _CreateRenderer()
Definition: Chara.cs:6644
override bool IsPCFaction
Definition: Chara.cs:673
override bool IsPCPartyMinion
Definition: Chara.cs:641
bool CanSee(Card c)
Definition: Chara.cs:1232
override bool IsPCFactionMinion
Definition: Chara.cs:657
bool CanInteractTo(Card c)
Definition: Chara.cs:2551
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4641
void GiveGift(Chara c, Thing t)
Definition: Chara.cs:8250
Quest quest
Definition: Chara.cs:24
bool isBlind
Definition: Chara.cs:132
void FallFromZone()
Definition: Chara.cs:3516
Hostility hostility
Definition: Chara.cs:293
Card SplitHeld(int a)
Definition: Chara.cs:4604
bool IsHostile()
Definition: Chara.cs:6527
bool isDead
Definition: Chara.cs:391
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:4328
bool IsEscorted()
Definition: Chara.cs:2428
bool IsNeutral()
Definition: Chara.cs:6574
virtual void TrySetAct(ActPlan p)
new GameConfig game
Definition: CoreConfig.cs:609
bool showExtra
Definition: CoreDebug.cs:168
bool enable
Definition: CoreDebug.cs:286
PCCManager pccs
Definition: Core.cs:41
CoreConfig config
Definition: Core.cs:70
static CursorInfo Hand
Definition: CursorSystem.cs:60
static CursorInfo Inventory
Definition: CursorSystem.cs:92
static CursorInfo MoveZone
Definition: CursorSystem.cs:86
Definition: Dialog.cs:7
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
Definition: Dialog.cs:528
Definition: EClass.cs:6
static Game game
Definition: EClass.cs:9
static Scene scene
Definition: EClass.cs:31
static Core core
Definition: EClass.cs:7
static Zone _zone
Definition: EClass.cs:21
static Map _map
Definition: EClass.cs:19
static Player player
Definition: EClass.cs:13
static Chara pc
Definition: EClass.cs:15
static CoreDebug debug
Definition: EClass.cs:49
static UI ui
Definition: EClass.cs:17
ConfigAutoCombat autoCombat
Definition: Game.cs:94
bool IsSurvival
Definition: Game.cs:276
Config config
Definition: Game.cs:219
QuestManager quests
Definition: Game.cs:183
static bool disableTool
Definition: HotItemHeld.cs:11
static bool _TrySetAct(ActPlan p)
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:1891
bool HasKeyItem(string alias)
Definition: Player.cs:2165
void EnterLocalZone(bool encounter=false, Chara mob=null)
Definition: Player.cs:1948
void ExitBorder(ActPlan p=null)
Definition: Player.cs:1849
HotItem currentHotItem
Definition: Player.cs:1100
Chara TargetChara
Definition: PointTarget.cs:41
Definition: Point.cs:9
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1051
Point Copy()
Definition: Point.cs:491
bool IsSky
Definition: Point.cs:224
Point Set(int _x, int _z)
Definition: Point.cs:503
bool IsBlocked
Definition: Point.cs:363
bool HasThing
Definition: Point.cs:251
bool Equals(int _x, int _z)
Definition: Point.cs:960
bool IsValid
Definition: Point.cs:88
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:989
bool IsHidden
Definition: Point.cs:347
Cell cell
Definition: Point.cs:51
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1140
bool IsDeliverTarget(Chara c)
PointTarget mouseTarget
Definition: Scene.cs:135
virtual bool IsRegion
Definition: Spatial.cs:515
void RefreshColor()
Definition: TCExtra.cs:171
Definition: Thing.cs:8
virtual bool AllowTraining
Definition: TraitShackle.cs:15
virtual bool IsBlendBase
Definition: Trait.cs:275
virtual bool CanBeAttacked
Definition: Trait.cs:177
virtual bool IsTool
Definition: Trait.cs:379
virtual void TrySetAct(ActPlan p)
Definition: Trait.cs:1056
virtual bool CanRead(Chara c)
Definition: Trait.cs:991
virtual void TrySetToggleAct(ActPlan p)
Definition: Trait.cs:1262
virtual bool CanName
Definition: Trait.cs:147
virtual bool CanEat(Chara c)
Definition: Trait.cs:1000
virtual bool DisableAutoCombat
Definition: Trait.cs:211
virtual bool CanDrink(Chara c)
Definition: Trait.cs:1009
virtual bool CanOnlyCarry
Definition: Trait.cs:305
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)
static WidgetCurrentTool Instance
UIPlaceHelper placer
virtual bool IsUserZone
Definition: Zone.cs:271
ZoneInstance instance
Definition: Zone.cs:55

References _canInteractNeighbor, Chara._CreateRenderer(), EClass._map, HotItemNoItem._TrySetAct(), EClass._zone, ActPlan.List.Add(), UIContextMenu.AddSlider(), TraitShackle.AllowTraining, altAction, Game.Config.autoCombat, Chara.Banish(), ConfigAutoCombat.bDontAutoAttackNeutral, Algorithms.WeightCell.blocked, Card.c_idRidePCC, Card.c_lightColor, Card.c_refText, Chara.CanAcceptGift(), Trait.CanBeAttacked, Trait.CanDrink(), Trait.CanEat(), Player.CanExitBorder(), Chara.CanInteractTo(), Trait.CanName, Trait.CanOnlyCarry, Chara.CanPick(), Trait.CanRead(), Chara.CanSee(), cc, Point.cell, Card.Chara, Map.charas, ACT.Chat, Color, Core.config, Game.config, CoreConfig.GameConfig.confirmGive, Point.Copy(), EClass.core, LayerDragGrid.Create(), LayerInventory.CreateContainer(), Chara.Cuddle(), Player.currentHotItem, EClass.debug, Trait.DisableAutoCombat, HotItemHeld.disableTool, dist, Card.Dist(), Point.Distance(), Chara.DropThing(), CoreDebug.enable, Player.EnterLocalZone(), Point.Equals(), Card.Evalue(), Player.ExitBorder(), Chara.FallFromZone(), Point.FindThing(), CoreConfig.game, EClass.game, CardRenderer.GetTC(), Chara.GiveGift(), CursorSystem.Hand, HasAct, Chara.HasCondition(), Card.HasElement(), Player.HasKeyItem(), Point.HasObj, Point.HasThing, Chara.held, Chara.host, Chara.hostility, if(), Card.ignoreAutoPick, input, Dialog.InputName(), Card.Inspect(), WidgetCurrentTool.Instance, Zone.instance, CursorSystem.Inventory, Chara.IsAliveInCurrentZone, Trait.IsBlendBase, Chara.isBlind, Point.IsBlocked, Chara.isDead, QuestManager.IsDeliverTarget(), Chara.IsDisabled, Chara.IsEscorted(), Card.isFloating, HotItem.IsGameAction, Point.IsHidden, Chara.IsHostile(), Card.IsHotItem, Card.IsInstalled, Chara.IsMinion, Chara.IsMofuable, Chara.IsNeutral(), Card.isNPCProperty, Chara.IsPC, Chara.IsPCFaction, Chara.IsPCFactionMinion, Card.IsPCFactionOrMinion, Chara.IsPCParty, Chara.IsPCPartyMinion, Spatial.IsRegion, Card.isRestrained, Card.IsRestrainedResident, IsSelfOrNeighbor, Point.IsSky, Cell.IsSnowTile, Game.IsSurvival, Chara.isSynced, Card.isThing, Trait.IsTool, Cell.IsTopWater, Zone.IsUserZone, Point.IsValid, Chara.IsValidGiftWeight(), item, ACT.Kick, lastAct, Card.LightColor, Card.LightData, list, Point.ListCards(), listPick, ACT.Melee, Chara.mimicry, Scene.mouseTarget, CursorSystem.MoveZone, UIButton.Item.Name, Cell.outOfBounds, EClass.pc, Core.pccs, performed, Chara.Pick(), Chara.PickHeld(), WidgetCurrentTool.placer, Card.placeState, EClass.player, pos, Card.pos, PointTarget.pos, Chara.quest, Game.quests, Card.RecalculateFOV(), UIPlaceHelper.Refresh(), TCExtra.RefreshColor(), Card.renderer, EClass.scene, Point.Set(), UIContextMenu.Show(), CoreDebug.showExtra, showOrder, Chara.SplitHeld(), PointTarget.TargetChara, CoreConfig.test, Card.Thing, HotItem.Thing, CoreConfig.Test.toolNoPick, Card.trait, ConTransmuteMimic.TrySetAct(), HotItem.TrySetAct(), Trait.TrySetAct(), TrySetAct(), Trait.TrySetToggleAct(), Card.TryUnrestrain(), EClass.ui, and ACT.Wait.

Referenced by Update().

◆ Clear()

void ActPlan.Clear ( )
inline

Definition at line 429 of file ActPlan.cs.

430 {
431 list.Clear();
432 pos.IsValid = false;
433 }

References list.

Referenced by AM_Adv.ClearPlans().

◆ GetAction()

Func< bool > ActPlan.GetAction ( )
inline

Definition at line 289 of file ActPlan.cs.

290 {
291 if (list.Count == 0)
292 {
293 return () => false;
294 }
295 if (list.Count > 1)
296 {
297 return delegate
298 {
300 {
301 return false;
302 }
304 return false;
305 };
306 }
307 Item item = list[0];
308 return delegate
309 {
310 if (performed && !item.act.CanPressRepeat)
311 {
312 return false;
313 }
314 performed = true;
315 lastAct = item.act;
316 return item.Perform(performed);
317 };
318 }
void ShowContextMenu()
Definition: ActPlan.cs:326
static bool SearchMedal(Chara c, Point p)
Definition: ActWait.cs:22

References Point.Equals(), item, lastAct, list, EClass.pc, performed, pos, Card.pos, ActWait.SearchMedal(), and ShowContextMenu().

Referenced by AM_Adv.AxisMove(), and AM_Adv.PressedAction.SetPlan().

◆ GetText()

string ActPlan.GetText ( bool  showName)
inline

Definition at line 276 of file ActPlan.cs.

277 {
278 if (list.Count == 0)
279 {
280 return "";
281 }
282 if (list.Count == 1)
283 {
284 return list[0].GetText(showName);
285 }
286 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>"));
287 }
bool HasMultipleTargets
Definition: ActPlan.cs:265

References HasMultipleTargets, and list.

Referenced by Update().

◆ Order()

void ActPlan.Order ( string  id)
inline

Definition at line 320 of file ActPlan.cs.

321 {
322 EClass.player.forceTalk = true;
323 EClass.pc.SayRaw(id.lang());
324 }
void SayRaw(string text, string ref1=null, string ref2=null)
Definition: Card.cs:6970

References EClass.pc, and Card.SayRaw().

Referenced by ShowContextMenu().

◆ ShowContextMenu()

void ActPlan.ShowContextMenu ( )
inline

Definition at line 326 of file ActPlan.cs.

327 {
328 UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction();
329 int num = 1;
330 if (showOrder)
331 {
332 UIContextMenu uIContextMenu2 = uIContextMenu.AddChild("order_ally");
333 uIContextMenu2.AddButton("order_fight", delegate
334 {
335 Order("order_fight");
336 });
337 uIContextMenu2.AddButton("order_heal", delegate
338 {
339 Order("order_heal");
340 });
341 uIContextMenu2.AddButton("order_wait", delegate
342 {
343 Order("order_wait");
344 });
345 }
346 foreach (Item i in list)
347 {
348 string textContext = i.GetTextContext(HasMultipleTargets);
349 textContext = textContext.Replace("\n", " ").Replace(Environment.NewLine, " ");
350 uIContextMenu.AddButton(textContext, delegate
351 {
352 performed = true;
353 if (i.Perform())
354 {
356 }
357 });
358 num++;
359 if (num >= 21)
360 {
361 break;
362 }
363 }
364 uIContextMenu.Show();
365 EClass.ui.hud.HideMouseInfo();
366 }
void Order(string id)
Definition: ActPlan.cs:320
void EndTurn(bool consume=true)
Definition: Player.cs:2083
void AddButton(Func< string > funcText, UnityAction action=null)
UIContextMenu AddChild(string idLang, TextAnchor anchor)

References UIContextMenu.AddButton(), UIContextMenu.AddChild(), Player.EndTurn(), ActPlan.Item.GetTextContext(), HasMultipleTargets, list, Order(), ActPlan.Item.Perform(), performed, EClass.player, showOrder, and EClass.ui.

Referenced by GetAction(), and AM_Adv.ShowAllAction().

◆ TrySetAct() [1/3]

bool ActPlan.TrySetAct ( Act  _act,
Card  _tc = null 
)
inline

Definition at line 391 of file ActPlan.cs.

392 {
393 if (!ignoreAddCondition && !_act.CanPerform(cc, _tc, pos))
394 {
395 return false;
396 }
397 Item item = new Item
398 {
399 act = _act,
400 tc = _tc,
401 pos = pos.Copy()
402 };
403 if (_tc != null && _tc.isChara)
404 {
405 int num = -1;
406 for (int i = 0; i < list.Count; i++)
407 {
408 if (list[i].tc == _tc)
409 {
410 num = i;
411 }
412 }
413 if (num != -1)
414 {
415 list.Insert(num + 1, item);
416 }
417 else
418 {
419 list.Add(item);
420 }
421 }
422 else
423 {
424 list.Add(item);
425 }
426 return true;
427 }
bool ignoreAddCondition
Definition: ActPlan.cs:160
virtual bool CanPerform()
Definition: ACT.cs:303
virtual bool isChara
Definition: Card.cs:2084

References ActPlan.List.Add(), Act.CanPerform(), cc, Point.Copy(), ignoreAddCondition, item, list, and pos.

◆ TrySetAct() [2/3]

bool ActPlan.TrySetAct ( string  lang,
Func< bool >  onPerform,
Card  tc,
CursorInfo  cursor = null,
int  dist = 1,
bool  isHostileAct = false,
bool  localAct = true,
bool  canRepeat = false 
)
inline

Definition at line 368 of file ActPlan.cs.

369 {
370 return TrySetAct(new DynamicAct(lang, onPerform)
371 {
372 id = lang,
373 dist = dist,
374 isHostileAct = isHostileAct,
375 localAct = localAct,
376 cursor = ((cursor == CursorSystem.Arrow) ? null : cursor),
377 canRepeat = () => canRepeat
378 }, tc);
379 }
bool canRepeat
Definition: ActPlan.cs:193
static CursorInfo Arrow
Definition: CursorSystem.cs:46

References CursorSystem.Arrow, canRepeat, dist, and TrySetAct().

Referenced by HotItemNoItem._TrySetAct(), _Update(), ConTransmuteMimic.TrySetAct(), HotItemAct.TrySetAct(), HotItemHeld.TrySetAct(), Trait.TrySetAct(), TraitAltar.TrySetAct(), TraitAltarChaos.TrySetAct(), TraitBath.TrySetAct(), TraitBed.TrySetAct(), TraitBuildBoard.TrySetAct(), TraitCanvas.TrySetAct(), TraitContainer.TrySetAct(), TraitCoreDefense.TrySetAct(), TraitCoreZone.TrySetAct(), TraitCrafter.TrySetAct(), TraitDeliveryChest.TrySetAct(), TraitDoor.TrySetAct(), TraitDrawingPaper.TrySetAct(), TraitEffect.TrySetAct(), TraitFactionBoard.TrySetAct(), TraitFigure.TrySetAct(), TraitGacha.TrySetAct(), TraitHoard.TrySetAct(), TraitHomeBoard.TrySetAct(), TraitHouseBoard.TrySetAct(), TraitMapBoard.TrySetAct(), TraitMirror.TrySetAct(), TraitNewspaper.TrySetAct(), TraitNewZone.TrySetAct(), TraitNote.TrySetAct(), TraitPaintBoard.TrySetAct(), TraitPillowStrange.TrySetAct(), TraitQuestBoard.TrySetAct(), TraitResearchBoard.TrySetAct(), TraitResidentBoard.TrySetAct(), TraitRoomPlate.TrySetAct(), TraitSpecialLantern.TrySetAct(), TraitSwitch.TrySetAct(), TraitTeleporter.TrySetAct(), TraitToolMusic.TrySetAct(), TraitToolMusicBig.TrySetAct(), TraitTrainingDummy.TrySetAct(), TraitWaystone.TrySetAct(), TraitWell.TrySetAct(), TrySetAct(), TraitBroom.TrySetHeldAct(), TraitCatalyst.TrySetHeldAct(), TraitDetector.TrySetHeldAct(), TraitFakeTile.TrySetHeldAct(), TraitGene.TrySetHeldAct(), TraitRod.TrySetHeldAct(), TraitSalesTag.TrySetHeldAct(), TraitShackle.TrySetHeldAct(), TraitSyringeBlood.TrySetHeldAct(), TraitSyringeGene.TrySetHeldAct(), TraitSyringeHeaven.TrySetHeldAct(), TraitSyringeUnicorn.TrySetHeldAct(), TraitToolBuild.TrySetHeldAct(), TraitToolSickle.TrySetHeldAct(), TraitToolTorch.TrySetHeldAct(), TraitToolWaterCan.TrySetHeldAct(), TraitToolWaterPot.TrySetHeldAct(), TraitWrench.TrySetHeldAct(), Trait.TrySetToggleAct(), and HotItemHeld.TrySetToolAct().

◆ TrySetAct() [3/3]

bool ActPlan.TrySetAct ( string  lang,
Func< bool >  onPerform,
CursorInfo  cursor = null,
int  dist = 1 
)
inline

Definition at line 381 of file ActPlan.cs.

382 {
383 return TrySetAct(new DynamicAct(lang, onPerform)
384 {
385 id = lang,
386 dist = dist,
387 cursor = ((cursor == CursorSystem.Arrow) ? null : cursor)
388 });
389 }

References CursorSystem.Arrow, dist, and TrySetAct().

◆ Update()

void ActPlan.Update ( PointTarget  target)
inline

Definition at line 435 of file ActPlan.cs.

436 {
437 if (warning)
438 {
439 return;
440 }
441 _Update(target);
442 if (!HasAct)
443 {
444 return;
445 }
446 Color effectColor = ((list.Count == 1) ? list[0].act.GetActPlanColor() : EClass.Colors.colorAct);
447 if (input == ActInput.LeftMouse || input == ActInput.Key)
448 {
449 EClass.ui.hud.textLeft.SetText(GetText(showName: true));
450 Outline[] components = EClass.ui.hud.textLeft.GetComponents<Outline>();
451 for (int i = 0; i < components.Length; i++)
452 {
453 components[i].effectColor = effectColor;
454 }
455 }
456 else if (input == ActInput.RightMouse)
457 {
459 EClass.ui.hud.imageRight.rectTransform.localScale = new Vector3(2f, 2f, 1f);
460 EClass.ui.hud.textRight.SetText(GetText(showName: true));
461 Outline[] components = EClass.ui.hud.textRight.GetComponents<Outline>();
462 for (int i = 0; i < components.Length; i++)
463 {
464 components[i].effectColor = effectColor;
465 }
466 }
467 }
static bool warning
Definition: ActPlan.cs:150
string GetText(bool showName)
Definition: ActPlan.cs:276
void _Update(PointTarget target)
Definition: ActPlan.cs:469
static ColorProfile Colors
Definition: EClass.cs:39
virtual void SetImage(Image icon)
Definition: HotItem.cs:91

References _Update(), Color, ColorProfile.colorAct, EClass.Colors, Player.currentHotItem, GetText(), HasAct, input, list, Outline, EClass.player, HotItem.SetImage(), EClass.ui, and warning.

Referenced by AM_Adv.AxisMove(), HotItemHeld.CanRotate(), AM_Adv.SetPressedAction(), AM_Adv.ShowAllAction(), and AM_Adv.UpdatePlans().

Member Data Documentation

◆ _canInteractNeighbor

bool ActPlan._canInteractNeighbor
private

Definition at line 162 of file ActPlan.cs.

Referenced by _Update().

◆ altAction

◆ dist

int ActPlan.dist

Definition at line 168 of file ActPlan.cs.

Referenced by _Update(), and TrySetAct().

◆ ignoreAddCondition

bool ActPlan.ignoreAddCondition

Definition at line 160 of file ActPlan.cs.

Referenced by TrySetAct().

◆ input

◆ lastAct

Act ActPlan.lastAct

Definition at line 174 of file ActPlan.cs.

Referenced by _Update(), and GetAction().

◆ list

◆ listPick

List<Thing> ActPlan.listPick = new List<Thing>()

Definition at line 172 of file ActPlan.cs.

Referenced by _Update().

◆ performed

bool ActPlan.performed

◆ pos

◆ showOrder

bool ActPlan.showOrder
private

Definition at line 164 of file ActPlan.cs.

Referenced by _Update(), and ShowContextMenu().

◆ tool

Thing ActPlan.tool

Definition at line 170 of file ActPlan.cs.

◆ warning

bool ActPlan.warning
static

Definition at line 150 of file ActPlan.cs.

Referenced by ActPlan.Item.Perform(), and Update().

Property Documentation

◆ canRepeat

bool ActPlan.canRepeat
get

Definition at line 192 of file ActPlan.cs.

193 {
194 get
195 {
196 if (list.Count == 1)
197 {
198 return list[0].act.CanPressRepeat;
199 }
200 return false;
201 }
202 }

Referenced by AM_Adv.AxisMove(), AM_Adv.PressedAction.SetPlan(), and TrySetAct().

◆ cc

Chara ActPlan.cc
get

Definition at line 204 of file ActPlan.cs.

Referenced by _Update(), TrySetAct(), HotItemHeld.TrySetAct(), and Trait.TrySetAct().

◆ CursorIcon

CursorInfo ActPlan.CursorIcon
get

Definition at line 206 of file ActPlan.cs.

207 {
208 get
209 {
210 if (list.Count != 0)
211 {
212 if (list.Count <= 1)
213 {
214 return list[0].act.GetCursorIcon(list[0].tc);
215 }
216 return CursorSystem.Notice;
217 }
218 return null;
219 }
220 }
static CursorInfo Notice
Definition: CursorSystem.cs:76

Referenced by AM_Adv.OnUpdateCursor().

◆ HasAct

◆ HasMultipleTargets

bool ActPlan.HasMultipleTargets
get

Definition at line 264 of file ActPlan.cs.

265 {
266 get
267 {
268 if (list.Count > 1)
269 {
270 return list[0].tc != list.LastItem().tc;
271 }
272 return false;
273 }
274 }

Referenced by GetText(), and ShowContextMenu().

◆ HideRightInfo

bool ActPlan.HideRightInfo
get

Definition at line 234 of file ActPlan.cs.

235 {
236 get
237 {
238 if (list.Count > 0)
239 {
240 return list[0].act.HideRightInfo;
241 }
242 return false;
243 }
244 }

Referenced by AM_Adv.PressedAction.SetPlan().

◆ IsNeighborBlocked

bool ActPlan.IsNeighborBlocked
get

Definition at line 180 of file ActPlan.cs.

181 {
182 get
183 {
185 {
186 return dist == 1;
187 }
188 return false;
189 }
190 }

Referenced by HotItemNoItem._TrySetAct(), and HotItemHeld.TrySetToolAct().

◆ IsSelf

◆ IsSelfOrNeighbor

◆ ShowAct

bool ActPlan.ShowAct
get

Definition at line 248 of file ActPlan.cs.

249 {
250 get
251 {
252 if (HasAct)
253 {
254 if (lastAct != list[0].act)
255 {
256 return list[0].act.ShowMouseHint(list[0].tc);
257 }
258 return false;
259 }
260 return false;
261 }
262 }

Referenced by AM_Adv.OnUpdateCursor().

◆ WillEndTurn

bool ActPlan.WillEndTurn
get

Definition at line 222 of file ActPlan.cs.

223 {
224 get
225 {
226 if (list.Count > 0)
227 {
228 return list[0].act.WillEndTurn;
229 }
230 return false;
231 }
232 }

Referenced by AM_Adv.AxisMove(), and AM_Adv.PressedAction.SetPlan().


The documentation for this class was generated from the following file: