Elin Decompiled Documentation EA 23.153 Nightly
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 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 (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
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 446 of file ActPlan.cs.

447 {
448 showOrder = false;
449 performed = false;
450 list.Clear();
451 listPick.Clear();
452 if (!pos.Equals(target.pos))
453 {
454 lastAct = null;
455 }
456 pos.Set(target.pos);
458 if (!pos.IsValid || EClass.pc.isDead)
459 {
460 return;
461 }
462 Point _pos = new Point(pos);
463 _ = target.pos.cell;
464 List<Card> items = _pos.ListCards();
465 bool isKey = input == ActInput.Key;
466 altAction = (EInput.isShiftDown && !EInput.isAltDown && !isKey) || input == ActInput.AllAction;
467 _canInteractNeighbor = dist == 0 || (dist == 1 && cc.CanInteractTo(_pos));
468 if (EClass.pc.isBlind && !_pos.Equals(EClass.pc.pos) && !isKey && input != 0)
469 {
470 return;
471 }
472 if (isKey || input == ActInput.LeftMouse || input == ActInput.AllAction)
473 {
474 if (EClass.ui.IsDragging)
475 {
476 return;
477 }
478 if (_pos.cell.outOfBounds)
479 {
480 if (EClass.player.CanExitBorder(_pos))
481 {
483 }
484 return;
485 }
486 if (!isKey && _pos.Equals(cc.pos) && EClass._zone.IsRegion)
487 {
488 TrySetAct("actNewZone", delegate
489 {
491 return false;
493 if (input == ActInput.AllAction)
494 {
495 TrySetAct("LayerTravel", delegate
496 {
497 EClass.ui.AddLayer<LayerTravel>();
498 return false;
499 }, null, CursorSystem.MoveZone, 1, isHostileAct: false, localAct: false);
500 }
501 }
502 items.ForeachReverse(delegate(Card _c)
503 {
504 Chara c2 = _c.Chara;
505 if (c2 != null && !c2.IsPC && EClass.pc.CanSee(c2))
506 {
507 int num = c2.Dist(EClass.pc);
508 if (num <= 1 || !EClass.pc.isBlind)
509 {
510 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)
511 {
512 bool flag5 = !c2.HasCondition<ConSuspend>() && (!c2.isRestrained || !c2.IsPCFaction);
514 {
515 flag5 = false;
516 }
517 if (flag5 || altAction)
518 {
519 if (EClass.pc.HasElement(1216) && c2.HasCondition<ConSleep>())
520 {
522 {
523 target = c2,
524 succubus = true
525 }, c2);
526 }
527 TrySetAct(ACT.Chat, c2);
528 }
529 }
530 if (c2.host != EClass.pc)
531 {
532 TraitShackle traitShackle = c2.pos.FindThing<TraitShackle>();
534 {
535 if (traitShackle != null && traitShackle.AllowTraining)
536 {
538 {
539 target = c2
540 });
541 }
542 }
543 else if ((c2.IsHostile() || altAction || c2.isRestrained) && c2.IsAliveInCurrentZone)
544 {
545 TrySetAct(ACT.Melee, c2);
546 }
547 }
548 if (c2.IsPCPartyMinion && !c2.Chara.IsEscorted() && altAction)
549 {
550 TrySetAct("ActBanishSummon", delegate
551 {
552 Banish(c2);
553 return true;
554 }, c2, null, 99);
555 List<Chara> list2 = new List<Chara>();
556 foreach (Chara chara in EClass._map.charas)
557 {
558 if (chara.IsPCPartyMinion && !chara.IsEscorted())
559 {
560 list2.Add(chara);
561 }
562 }
563 if (list2.Count > 1)
564 {
565 TrySetAct("ActBanishSummonAll", delegate
566 {
567 foreach (Chara item in list2)
568 {
569 Banish(item);
570 }
571 return true;
572 }, c2, null, 99);
573 }
574 }
575 }
576 }
577 });
578 if (_pos.IsHidden)
579 {
580 return;
581 }
583 {
584 items.ForeachReverse(delegate(Card _c)
585 {
586 Chara c = _c.Chara;
587 if (c != null)
588 {
589 bool flag3 = EClass.pc.CanSee(c);
590 if (flag3)
591 {
592 if (input == ActInput.LeftMouse && c.IsPCFaction && !c.IsPC && pos.FindThing<TraitHitchingPost>() != null)
593 {
594 Chara ride = c;
595 List<string> list = EClass.core.pccs.sets["ride"].map["body"].map.Keys.ToList();
596 int index = list.IndexOf(ride.c_idRidePCC);
597 if (index == -1)
598 {
599 index = 0;
600 }
601 TrySetAct("ActChangeRideSkin", delegate
602 {
603 UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction();
604 uIContextMenu.AddSlider("rideSkin", (float a) => list[(int)a].Split('-')[0] ?? "", index, delegate(float a)
605 {
606 ride.c_idRidePCC = list[(int)a];
607 ride._CreateRenderer();
608 }, 0f, list.Count - 1, isInt: true, hideOther: false);
609 uIContextMenu.Show();
610 return false;
611 }, c);
612 }
613 if (!c.IsPC && ((c.IsPCFaction && !c.IsDisabled) || EClass.debug.enable) && input == ActInput.AllAction)
614 {
615 TrySetAct("actTrade", delegate
616 {
618 return false;
619 }, c);
620 }
621 if (c.host != null && EClass.pc.held != null && altAction)
622 {
623 bool flag4 = true;
625 {
626 flag4 = false;
627 }
628 if (!c.IsDisabled && flag4 && c.CanAcceptGift(EClass.pc, EClass.pc.held))
629 {
630 string lang = "actGive";
631 if (c.Evalue(1232) > 0 && EClass.pc.held.trait is TraitDrinkMilkMother)
632 {
633 lang = "actMilk";
634 }
635 TrySetAct(lang, delegate
636 {
637 if (!c.IsValidGiftWeight(EClass.pc.held, 1))
638 {
639 c.Talk("tooHeavy");
640 return true;
641 }
643 {
644 Dialog.YesNo("dialogGive".lang(EClass.pc.held.GetName(NameStyle.Full, 1)), func);
645 }
646 else
647 {
648 func();
649 }
650 return true;
651 }, c);
652 }
653 }
654 }
655 if (input == ActInput.AllAction && EClass.pc.held != null && EClass.pc.held.trait is TraitDrink)
656 {
657 TrySetAct(c.IsPC ? "actPour" : "ActThrow", delegate
658 {
659 ActThrow.Throw(EClass.pc, c.pos, c, EClass.pc.held.Split(1));
660 return true;
661 }, (c.host != null) ? c : EClass.pc.held);
662 }
663 if (!c.IsPC && c.host == null && ((!EClass.pc.isBlind && flag3) || input != ActInput.AllAction))
664 {
665 if (c.isRestrained && (input == ActInput.AllAction || (!c.IsRestrainedResident && !c.IsHostile())))
666 {
667 TrySetAct("ActUnrestrain", delegate
668 {
669 c.TryUnrestrain(force: true, EClass.pc);
670 return true;
671 }, c);
672 }
673 if (!EClass.pc.isBlind && flag3 && input == ActInput.AllAction)
674 {
675 TrySetAct(ACT.Kick, c);
676 if (c.IsMofuable)
677 {
678 TrySetAct("ActCuddle", delegate
679 {
680 EClass.pc.Cuddle(c);
681 return true;
682 }, c);
683 }
685 {
686 TrySetAct("inspect", delegate
687 {
688 c.Inspect();
689 return false;
690 }, c);
691 }
692 }
693 }
694 }
695 else if (_c.isThing)
696 {
697 if (!EClass.pc.isBlind)
698 {
699 Thing t = _c.Thing;
700 if (input == ActInput.AllAction)
701 {
702 if ((EClass.debug.enable || EClass.player.HasKeyItem("license_illumination")) && t.LightData != null)
703 {
704 if (t.c_lightColor != 0)
705 {
706 TrySetAct("actClearLight", delegate
707 {
708 t.c_lightColor = 0;
709 t.RecalculateFOV();
710 t.renderer.GetTC<TCExtra>()?.RefreshColor();
711 return false;
712 }, t);
713 }
714 TrySetAct("actSetLight", delegate
715 {
716 Color lightColor = t.LightColor;
717 EClass.ui.AddLayer<LayerColorPicker>().SetColor(lightColor, lightColor, delegate(PickerState state, Color _c)
718 {
719 if (state == PickerState.Cancel)
720 {
721 t.c_lightColor = 0;
722 }
723 else
724 {
725 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);
726 }
727 t.RecalculateFOV();
729 });
730 return false;
731 }, t);
732 }
734 {
735 TrySetAct("(debug) Toggle Float", delegate
736 {
737 t.isFloating = !t.isFloating;
738 return false;
739 }, t);
740 }
742 {
743 if (t.trait.CanEat(EClass.pc))
744 {
745 TrySetAct(new AI_Eat
746 {
747 target = t
748 }, t);
749 }
750 if (t.trait.CanDrink(EClass.pc))
751 {
753 {
754 target = t
755 }, t);
756 }
757 if (t.trait.CanRead(EClass.pc))
758 {
760 {
761 target = t
762 }, t);
763 }
764 if (t.trait.IsBlendBase)
765 {
766 TrySetAct("invBlend", delegate
767 {
769 return true;
770 }, t);
771 }
772 if (t.trait.CanName)
773 {
774 TrySetAct("changeName", delegate
775 {
776 Dialog.InputName("dialogChangeName", t.c_refText.IsEmpty(""), delegate(bool cancel, string text)
777 {
778 if (!cancel)
779 {
780 t.c_refText = text;
781 }
782 });
783 return false;
784 }, t);
785 }
786 }
787 }
788 if (isKey)
789 {
790 _ = t.trait.CanBeAttacked;
791 }
792 else
793 {
794 if (t.placeState == PlaceState.roaming && (_pos.cell.blocked || t.ignoreAutoPick || altAction || input == ActInput.AllAction || _pos.Equals(EClass.pc.pos)) && EClass.pc.CanPick(t))
795 {
796 listPick.Add(t);
797 }
798 if (t.IsInstalled)
799 {
800 t.trait.TrySetToggleAct(this);
801 t.trait.TrySetAct(this);
802 }
803 }
804 }
805 }
806 void func()
807 {
809 }
810 });
811 if (listPick.Count > 0)
812 {
813 if (listPick.Count == 1)
814 {
815 Thing _t = listPick[0];
817 {
818 TrySetAct("actPickOne", delegate
819 {
820 EClass.pc.Pick(_t);
821 return true;
822 }, listPick[0], CursorSystem.Hand, 1, isHostileAct: false, localAct: false);
823 }
824 }
825 else
826 {
827 IList<Card> _cards = items.Copy();
828 TrySetAct("actPickAll", delegate
829 {
830 foreach (Card item2 in _cards)
831 {
832 if (item2.isThing && item2.placeState == PlaceState.roaming)
833 {
834 EClass.pc.Pick(item2.Thing);
835 }
836 }
837 return true;
838 }, null, CursorSystem.Hand, 1, isHostileAct: false, localAct: false);
839 }
840 }
841 if (input == ActInput.AllAction && pos.IsSky)
842 {
843 TrySetAct("actSkyJump", delegate
844 {
846 return false;
847 });
848 }
849 if (_pos.Equals(cc.pos))
850 {
851 if (cc.held != null && !cc.held.IsHotItem)
852 {
853 TrySetAct("actPick", delegate
854 {
855 _ = cc.held;
856 cc.PickHeld(msg: true);
857 ActionMode.AdvOrRegion.updatePlans = true;
858 return false;
859 }, cc.held, CursorSystem.Inventory, 1, isHostileAct: false, localAct: false);
860 }
861 else if (!HasAct && !cc.isRestrained)
862 {
864 }
865 if (EClass.pc.party.members.Count > 1)
866 {
867 showOrder = true;
868 }
869 if (input == ActInput.AllAction && EClass.pc.held != null && !EClass.pc.held.trait.CanOnlyCarry)
870 {
871 TrySetAct("actDrop", delegate
872 {
874 return true;
875 });
876 }
877 if (cc.isRestrained)
878 {
879 TrySetAct("ActUnrestrain", delegate
880 {
881 cc.TryUnrestrain(force: true, EClass.pc);
882 return true;
883 }, cc);
884 }
885 }
886 }
887 if (list.Count == 0 && input == ActInput.AllAction && EClass.pc.held == null && pos.cell.IsSnowTile && !pos.IsBlocked && !pos.HasObj && !pos.HasThing)
888 {
890 {
891 pos = pos.Copy()
892 });
893 }
894 if (list.Count != 0 && input != ActInput.AllAction)
895 {
896 return;
897 }
898 items.ForeachReverse(delegate(Card _c)
899 {
900 if (_c.isThing && _c.trait.CanBeAttacked && !(_c.trait is TraitTrainingDummy))
901 {
902 TrySetAct(ACT.Melee, _c);
903 }
904 });
905 }
906 else
907 {
908 if (input != ActInput.RightMouse)
909 {
910 return;
911 }
912 if (pos.cell.outOfBounds || EClass.ui.IsDragging)
913 {
914 return;
915 }
917 if (!hotItem.IsGameAction)
918 {
919 TrySetAct(hotItem.Name, delegate
920 {
921 hotItem.OnClick(hotItem.button, hotItem.hotbar);
922 return false;
923 }, null, -1);
924 }
925 else
926 {
927 hotItem.TrySetAct(this);
928 }
929 bool flag = EClass.game.config.autoCombat.enable && EClass.scene.mouseTarget.TargetChara != null;
930 if (hotItem.Thing != null && hotItem.Thing.trait.DisableAutoCombat)
931 {
932 flag = false;
933 }
934 if (flag)
935 {
937 bool flag2 = true;
938 if (targetChara.hostility >= Hostility.Friend)
939 {
940 flag2 = false;
941 }
943 {
944 flag2 = false;
945 }
946 if (list.Count >= 2)
947 {
948 flag2 = false;
949 }
950 if (list.Count == 1)
951 {
952 if (targetChara.hostility >= Hostility.Neutral)
953 {
954 flag2 = false;
955 }
956 if (!list[0].act.ShowAuto)
957 {
958 flag2 = false;
959 }
960 if (EClass.player.currentHotItem is HotItemNoItem && targetChara.hostility <= Hostility.Enemy)
961 {
962 flag2 = true;
963 }
964 }
965 if (flag2)
966 {
967 list.Clear();
968 TrySetAct(new GoalAutoCombat(targetChara));
969 }
970 }
971 if (list.Count == 0 && !EClass.core.config.test.toolNoPick)
972 {
974 }
975 if ((bool)WidgetCurrentTool.Instance)
976 {
978 }
979 }
980 static void Banish(Chara m)
981 {
982 EClass.pc.Say("summon_vanish", m);
983 m.pos.PlayEffect("vanish");
984 m.pos.PlaySound("vanish");
985 m.pos.PlayEffect("teleport");
986 m.Destroy();
987 }
988 }
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:166
bool _canInteractNeighbor
Definition: ActPlan.cs:160
bool altAction
Definition: ActPlan.cs:156
bool showOrder
Definition: ActPlan.cs:162
Chara cc
Definition: ActPlan.cs:202
Act lastAct
Definition: ActPlan.cs:172
ActInput input
Definition: ActPlan.cs:152
Point pos
Definition: ActPlan.cs:150
bool IsSelfOrNeighbor
Definition: ActPlan.cs:176
List< Thing > listPick
Definition: ActPlan.cs:170
List list
Definition: ActPlan.cs:164
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:345
bool performed
Definition: ActPlan.cs:154
bool HasAct
Definition: ActPlan.cs:244
TC GetTC(string id)
Definition: Card.cs:11
bool IsPCFactionOrMinion
Definition: Card.cs:2208
virtual bool isThing
Definition: Card.cs:2017
virtual Chara Chara
Definition: Card.cs:2006
bool isNPCProperty
Definition: Card.cs:538
bool IsRestrainedResident
Definition: Card.cs:2194
bool isFloating
Definition: Card.cs:634
bool HasElement(int ele, int req=1)
Definition: Card.cs:5566
bool isRestrained
Definition: Card.cs:550
bool ignoreAutoPick
Definition: Card.cs:490
string c_refText
Definition: Card.cs:1589
bool IsHotItem
Definition: Card.cs:115
PlaceState placeState
Definition: Card.cs:79
void RecalculateFOV()
Definition: Card.cs:5988
Point pos
Definition: Card.cs:55
int c_lightColor
Definition: Card.cs:1068
Trait trait
Definition: Card.cs:49
string c_idRidePCC
Definition: Card.cs:1613
void Destroy()
Definition: Card.cs:4783
bool IsInstalled
Definition: Card.cs:2317
virtual Thing Thing
Definition: Card.cs:1994
int Evalue(int ele)
Definition: Card.cs:2507
int Dist(Card c)
Definition: Card.cs:7235
LightData LightData
Definition: Card.cs:2366
void TryUnrestrain(bool force=false, Chara c=null)
Definition: Card.cs:6703
Color LightColor
Definition: Card.cs:1080
void Inspect()
Definition: Card.cs:7420
CardRenderer renderer
Definition: Card.cs:57
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6423
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:557
Card held
Definition: Chara.cs:70
bool CanAcceptGift(Chara c, Card t)
Definition: Chara.cs:7603
void Cuddle(Chara c, bool headpat=false)
Definition: Chara.cs:5769
bool CanPick(Card c)
Definition: Chara.cs:3979
override bool IsPC
Definition: Chara.cs:608
Chara host
Definition: Chara.cs:33
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:7572
bool IsMofuable
Definition: Chara.cs:960
override bool IsPCParty
Definition: Chara.cs:611
Party party
Definition: Chara.cs:43
void PickHeld(bool msg=false)
Definition: Chara.cs:4233
bool HasCondition(string alias)
Definition: Chara.cs:8716
override bool IsDisabled
Definition: Chara.cs:581
override bool IsMinion
Definition: Chara.cs:623
override bool isSynced
Definition: Chara.cs:687
override CardRenderer _CreateRenderer()
Definition: Chara.cs:6143
override bool IsPCFaction
Definition: Chara.cs:667
override bool IsPCPartyMinion
Definition: Chara.cs:635
bool CanSee(Card c)
Definition: Chara.cs:1070
bool CanInteractTo(Card c)
Definition: Chara.cs:2293
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4330
void GiveGift(Chara c, Thing t)
Definition: Chara.cs:7628
Quest quest
Definition: Chara.cs:24
bool isBlind
Definition: Chara.cs:130
void FallFromZone()
Definition: Chara.cs:3269
Hostility hostility
Definition: Chara.cs:287
Card SplitHeld(int a)
Definition: Chara.cs:4293
bool IsHostile()
Definition: Chara.cs:6034
bool isDead
Definition: Chara.cs:385
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:4017
bool IsEscorted()
Definition: Chara.cs:2170
bool IsNeutral()
Definition: Chara.cs:6073
new GameConfig game
Definition: CoreConfig.cs:600
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 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:5
static Game game
Definition: EClass.cs:8
static Scene scene
Definition: EClass.cs:30
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 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
List< Chara > members
Definition: Party.cs:18
bool CanExitBorder(Point p)
Definition: Player.cs:1695
bool HasKeyItem(string alias)
Definition: Player.cs:1962
void EnterLocalZone(bool encounter=false, Chara mob=null)
Definition: Player.cs:1752
void ExitBorder(ActPlan p=null)
Definition: Player.cs:1653
HotItem currentHotItem
Definition: Player.cs:916
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: Thing.cs:8
virtual bool AllowTraining
Definition: TraitShackle.cs:13
virtual bool IsBlendBase
Definition: Trait.cs:257
virtual bool CanBeAttacked
Definition: Trait.cs:163
virtual bool IsTool
Definition: Trait.cs:361
virtual void TrySetAct(ActPlan p)
Definition: Trait.cs:1022
virtual bool CanRead(Chara c)
Definition: Trait.cs:957
virtual void TrySetToggleAct(ActPlan p)
Definition: Trait.cs:1228
virtual bool CanName
Definition: Trait.cs:143
virtual bool CanEat(Chara c)
Definition: Trait.cs:966
virtual bool DisableAutoCombat
Definition: Trait.cs:195
virtual bool CanDrink(Chara c)
Definition: Trait.cs:975
virtual bool CanOnlyCarry
Definition: Trait.cs:287
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:266
ZoneInstance instance
Definition: Zone.cs:52

References _canInteractNeighbor, Chara._CreateRenderer(), EClass._map, HotItemNoItem._TrySetAct(), EClass._zone, ActPlan.List.Add(), UIContextMenu.AddSlider(), TraitShackle.AllowTraining, altAction, Game.Config.autoCombat, 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, Card.Destroy(), 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, Card.IsPCFactionOrMinion, Chara.IsPCParty, Chara.IsPCPartyMinion, Spatial.IsRegion, Card.isRestrained, Card.IsRestrainedResident, IsSelfOrNeighbor, Point.IsSky, Cell.IsSnowTile, 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, Party.members, Scene.mouseTarget, CursorSystem.MoveZone, UIButton.Item.Name, Cell.outOfBounds, Chara.party, EClass.pc, Core.pccs, performed, Chara.Pick(), Chara.PickHeld(), WidgetCurrentTool.placer, Card.placeState, Point.PlayEffect(), EClass.player, Point.PlaySound(), pos, Card.pos, PointTarget.pos, Chara.quest, Game.quests, Card.RecalculateFOV(), UIPlaceHelper.Refresh(), TCExtra.RefreshColor(), Card.renderer, Card.Say(), EClass.scene, Point.Set(), UIContextMenu.Show(), CoreDebug.showExtra, showOrder, Chara.SplitHeld(), PointTarget.TargetChara, CoreConfig.test, Card.Thing, HotItem.Thing, CoreConfig.Test.toolNoPick, Card.trait, 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 406 of file ActPlan.cs.

407 {
408 list.Clear();
409 pos.IsValid = false;
410 }

References list.

Referenced by AM_Adv.ClearPlans().

◆ GetAction()

Func< bool > ActPlan.GetAction ( )
inline

Definition at line 287 of file ActPlan.cs.

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 }
void ShowContextMenu()
Definition: ActPlan.cs:318
static bool SearchMedal(Chara c, Point p)
Definition: ActWait.cs:20

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 274 of file ActPlan.cs.

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 }
bool HasMultipleTargets
Definition: ActPlan.cs:263

References HasMultipleTargets, and list.

Referenced by Update().

◆ ShowContextMenu()

void ActPlan.ShowContextMenu ( )
inline

Definition at line 318 of file ActPlan.cs.

319 {
320 UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction();
321 int num = 1;
322 _ = showOrder;
323 foreach (Item i in list)
324 {
325 string textContext = i.GetTextContext(HasMultipleTargets);
326 textContext = textContext.Replace("\n", " ").Replace(Environment.NewLine, " ");
327 uIContextMenu.AddButton(textContext, delegate
328 {
329 performed = true;
330 if (i.Perform())
331 {
332 EClass.player.EndTurn();
333 }
334 });
335 num++;
336 if (num >= 21)
337 {
338 break;
339 }
340 }
341 uIContextMenu.Show();
342 EClass.ui.hud.HideMouseInfo();
343 }
void AddButton(Func< string > funcText, UnityAction action=null)

References ActPlan.Item.GetTextContext(), HasMultipleTargets, list, ActPlan.Item.Perform(), performed, 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 368 of file ActPlan.cs.

369 {
370 if (!ignoreAddCondition && !_act.CanPerform(cc, _tc, pos))
371 {
372 return false;
373 }
374 Item item = new Item
375 {
376 act = _act,
377 tc = _tc,
378 pos = pos.Copy()
379 };
380 if (_tc != null && _tc.isChara)
381 {
382 int num = -1;
383 for (int i = 0; i < list.Count; i++)
384 {
385 if (list[i].tc == _tc)
386 {
387 num = i;
388 }
389 }
390 if (num != -1)
391 {
392 list.Insert(num + 1, item);
393 }
394 else
395 {
396 list.Add(item);
397 }
398 }
399 else
400 {
401 list.Add(item);
402 }
403 return true;
404 }
bool ignoreAddCondition
Definition: ActPlan.cs:158
virtual bool CanPerform()
Definition: ACT.cs:303
virtual bool isChara
Definition: Card.cs:2019

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 345 of file ActPlan.cs.

346 {
347 return TrySetAct(new DynamicAct(lang, onPerform)
348 {
349 id = lang,
350 dist = dist,
351 isHostileAct = isHostileAct,
352 localAct = localAct,
353 cursor = ((cursor == CursorSystem.Arrow) ? null : cursor),
354 canRepeat = () => canRepeat
355 }, tc);
356 }
bool canRepeat
Definition: ActPlan.cs:191
static CursorInfo Arrow
Definition: CursorSystem.cs:46

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

Referenced by HotItemNoItem._TrySetAct(), _Update(), 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(), TraitRod.TrySetHeldAct(), TraitSalesTag.TrySetHeldAct(), TraitShackle.TrySetHeldAct(), TraitSyringeGene.TrySetHeldAct(), TraitSyringeHeaven.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 358 of file ActPlan.cs.

359 {
360 return TrySetAct(new DynamicAct(lang, onPerform)
361 {
362 id = lang,
363 dist = dist,
364 cursor = ((cursor == CursorSystem.Arrow) ? null : cursor)
365 });
366 }

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

◆ Update()

void ActPlan.Update ( PointTarget  target)
inline

Definition at line 412 of file ActPlan.cs.

413 {
414 if (warning)
415 {
416 return;
417 }
418 _Update(target);
419 if (!HasAct)
420 {
421 return;
422 }
423 Color effectColor = ((list.Count == 1) ? list[0].act.GetActPlanColor() : EClass.Colors.colorAct);
424 if (input == ActInput.LeftMouse || input == ActInput.Key)
425 {
426 EClass.ui.hud.textLeft.SetText(GetText(showName: true));
427 Outline[] components = EClass.ui.hud.textLeft.GetComponents<Outline>();
428 for (int i = 0; i < components.Length; i++)
429 {
430 components[i].effectColor = effectColor;
431 }
432 }
433 else if (input == ActInput.RightMouse)
434 {
436 EClass.ui.hud.imageRight.rectTransform.localScale = new Vector3(2f, 2f, 1f);
437 EClass.ui.hud.textRight.SetText(GetText(showName: true));
438 Outline[] components = EClass.ui.hud.textRight.GetComponents<Outline>();
439 for (int i = 0; i < components.Length; i++)
440 {
441 components[i].effectColor = effectColor;
442 }
443 }
444 }
static bool warning
Definition: ActPlan.cs:148
string GetText(bool showName)
Definition: ActPlan.cs:274
void _Update(PointTarget target)
Definition: ActPlan.cs:446
static ColorProfile Colors
Definition: EClass.cs:38
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 160 of file ActPlan.cs.

Referenced by _Update().

◆ altAction

◆ dist

int ActPlan.dist

Definition at line 166 of file ActPlan.cs.

Referenced by _Update(), and TrySetAct().

◆ ignoreAddCondition

bool ActPlan.ignoreAddCondition

Definition at line 158 of file ActPlan.cs.

Referenced by TrySetAct().

◆ input

◆ lastAct

Act ActPlan.lastAct

Definition at line 172 of file ActPlan.cs.

Referenced by _Update(), and GetAction().

◆ list

◆ listPick

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

Definition at line 170 of file ActPlan.cs.

Referenced by _Update().

◆ performed

bool ActPlan.performed

◆ pos

◆ showOrder

bool ActPlan.showOrder
private

Definition at line 162 of file ActPlan.cs.

Referenced by _Update(), and ShowContextMenu().

◆ tool

Thing ActPlan.tool

Definition at line 168 of file ActPlan.cs.

◆ warning

bool ActPlan.warning
static

Definition at line 148 of file ActPlan.cs.

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

Property Documentation

◆ canRepeat

bool ActPlan.canRepeat
get

Definition at line 190 of file ActPlan.cs.

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

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

◆ cc

Chara ActPlan.cc
get

Definition at line 202 of file ActPlan.cs.

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

◆ CursorIcon

CursorInfo ActPlan.CursorIcon
get

Definition at line 204 of file ActPlan.cs.

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 }
static CursorInfo Notice
Definition: CursorSystem.cs:76

Referenced by AM_Adv.OnUpdateCursor().

◆ HasAct

◆ HasMultipleTargets

bool ActPlan.HasMultipleTargets
get

Definition at line 262 of file ActPlan.cs.

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

Referenced by GetText(), and ShowContextMenu().

◆ HideRightInfo

bool ActPlan.HideRightInfo
get

Definition at line 232 of file ActPlan.cs.

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

Referenced by AM_Adv.PressedAction.SetPlan().

◆ IsNeighborBlocked

bool ActPlan.IsNeighborBlocked
get

Definition at line 178 of file ActPlan.cs.

179 {
180 get
181 {
183 {
184 return dist == 1;
185 }
186 return false;
187 }
188 }

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

◆ IsSelf

◆ IsSelfOrNeighbor

◆ ShowAct

bool ActPlan.ShowAct
get

Definition at line 246 of file ActPlan.cs.

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 }

Referenced by AM_Adv.OnUpdateCursor().

◆ WillEndTurn

bool ActPlan.WillEndTurn
get

Definition at line 220 of file ActPlan.cs.

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

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


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