Elin Decompiled Documentation EA 23.356.1 Nightly
Loading...
Searching...
No Matches
Feat Class Reference
Inheritance diagram for Feat:
Element EClass Mutation

Public Member Functions

override bool CanLink (ElementContainer owner)
 
override Sprite GetIcon (string suffix="")
 
override void OnWriteNote (UINote n, ElementContainer owner)
 
string GetHint (ElementContainer owner)
 
override bool IsPurchaseFeatReqMet (ElementContainer owner, int lv=-1)
 
override void WritePurchaseReq (UINote n, int lv=-1)
 
virtual List< string > Apply (int a, ElementContainer owner, bool hint=false)
 
- Public Member Functions inherited from Element
virtual SourceElement.Row GetSource ()
 
virtual int GetSourcePotential (int v)
 
virtual Sprite GetSprite ()
 
int GetMaterialSourceValue (Thing t, int v)
 
virtual long GetSourceValue (long v, int lv, SourceValueType type)
 
virtual Sprite GetIcon (string suffix="")
 
bool IsActive (Card c)
 
int SortVal (bool charaSheet=false)
 
virtual bool CanLink (ElementContainer owner)
 
bool HasTag (string tag)
 
void SetImage (Image i)
 
virtual string GetDetail ()
 
bool IsFactionElement (Chara c)
 
int GetDNABonus (Chara c)
 
Element GetParent (Card c)
 
void WriteNote (UINote n, ElementContainer owner=null, Action< UINote > onWriteNote=null)
 
void WriteNoteWithRef (UINote n, ElementContainer owner, Action< UINote > onWriteNote, Element refEle)
 
void _WriteNote (UINote n, Chara c, Act act)
 
void AddHeaderAbility (UINote n)
 
void _WriteNote (UINote n, ElementContainer owner, Action< UINote > onWriteNote, bool isRef, bool addHeader=true)
 
void AddEncNote (UINote n, Card Card, ElementContainer.NoteMode mode=ElementContainer.NoteMode.Default, Func< Element, string, string > funcText=null, Action< UINote, Element > onAddNote=null)
 
virtual void OnWriteNote (UINote n, ElementContainer owner)
 
virtual void OnChangeValue ()
 
void CheckLevelBonus (ElementContainer owner, UINote n=null)
 
int GetSortVal (UIList.SortMode m)
 
virtual Act.Cost GetCost (Chara c)
 
virtual int GetPower (Card c)
 
virtual void SetTextValue (UIText text, bool shorten=false)
 
virtual bool IsPurchaseFeatReqMet (ElementContainer owner, int lv=-1)
 
virtual void WritePurchaseReq (UINote n, int lv=1)
 

Static Public Attributes

static List< string > hints = new List<string>()
 
static string[] featRef = new string[5]
 
- Static Public Attributes inherited from Element
const int Div = 5
 
static Element Void = new Element()
 
static int[] List_MainAttributes = new int[9] { 70, 72, 71, 77, 74, 75, 76, 73, 79 }
 
static int[] List_MainAttributesMajor = new int[8] { 70, 72, 71, 77, 74, 75, 76, 73 }
 
static int[] List_Body = new int[4] { 70, 72, 71, 77 }
 
static int[] List_Mind = new int[4] { 74, 75, 76, 73 }
 
static List< SourceElement.Row > ListElements = new List<SourceElement.Row>()
 
static List< SourceElement.Row > ListAttackElements = new List<SourceElement.Row>()
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

override bool ShowBonuses [get]
 
override string Name [get]
 
override string FullName [get]
 
override bool ShowXP [get]
 
override bool ShowValue [get]
 
override int CostLearn [get]
 
- Properties inherited from Element
SourceElement.Row source [get]
 
virtual int DisplayValue [get]
 
virtual int MinValue [get]
 
int Value [get]
 
int ValueWithoutLink [get]
 
virtual int MinPotential [get]
 
int Potential [get]
 
virtual bool CanGainExp [get]
 
bool IsFlag [get]
 
virtual string Name [get]
 
virtual string FullName [get]
 
virtual int ExpToNext [get]
 
virtual bool UseExpMod [get]
 
virtual int CostTrain [get]
 
virtual int CostLearn [get]
 
virtual bool ShowXP [get]
 
virtual bool ShowMsgOnValueChanged [get]
 
virtual bool ShowValue [get]
 
virtual bool ShowPotential [get]
 
virtual bool UsePotential [get]
 
virtual bool PotentialAsStock [get]
 
virtual bool ShowRelativeAttribute [get]
 
virtual bool ShowBonuses [get]
 
virtual string ShortName [get]
 
bool IsGlobalElement [get]
 
bool IsFactionWideElement [get]
 
bool IsPartyWideElement [get]
 
virtual bool ShowEncNumber [get]
 
bool IsTrait [get]
 
bool IsFoodTrait [get]
 
bool IsFoodTraitMain [get]
 
bool IsMainAttribute [get]
 
Act act [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]
 

Additional Inherited Members

- Static Public Member Functions inherited from Element
static string GetName (string alias)
 
static SourceElement.Row Get (int id)
 
static Dictionary< int, int > GetElementMap (int[] list)
 
static Dictionary< int, int > GetElementMap (int[] list, Dictionary< int, int > map)
 
static SourceElement.Row GetRandomElement (int lv=1, bool useWeight=true)
 
static Element Create (int id, int v=0)
 
static Element Create (string id, int v=1)
 
static int GetId (string alias)
 
static int GetResistLv (int v)
 
static long GetResistDamage (long dmg, int v, int power=0)
 
- 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)
 
- Public Attributes inherited from Element
SourceElement.Row _source
 
int id
 
int vBase
 
int vExp
 
int vPotential
 
int vTempPotential
 
int vLink
 
int vSource
 
int vSourcePotential
 
ElementContainer owner
 

Detailed Description

Definition at line 344 of file FEAT.cs.

Member Function Documentation

◆ Apply()

virtual List< string > Feat.Apply ( int  a,
ElementContainer  owner,
bool  hint = false 
)
inlinevirtual

Definition at line 425 of file FEAT.cs.

426 {
427 if (hint)
428 {
429 hints.Clear();
430 }
432 {
433 feat = this,
434 owner = owner,
435 hint = hint
436 };
437 e.SetData(a);
438 BaseModManager.PublishEvent("elin.feat.apply", e);
439 a = e.data;
440 int value = base.Value;
441 int A = Mathf.Abs(a);
442 int invert = ((a >= 0) ? 1 : (-1));
443 if (hint)
444 {
445 featRef[0] = a.ToString() ?? "";
446 featRef[1] = a.ToString() ?? "";
447 }
448 Chara chara = owner.Chara;
449 int num = vPotential;
450 if (!hint && a > 0 && chara != null)
451 {
452 num = (vPotential = chara.LV);
453 }
454 switch (id)
455 {
456 case 1660:
457 featRef[0] = (a * 25).ToString() ?? "";
458 break;
459 case 1206:
460 ModBase(78, -a * 10, hide: false);
461 break;
462 case 1642:
463 featRef[0] = ((a == 1) ? 10 : ((a == 2) ? 20 : 30)).ToString() ?? "";
464 break;
465 case 1643:
466 featRef[0] = ((a == 1) ? 1 : ((a == 2) ? 3 : 5)).ToString() ?? "";
467 break;
468 case 1610:
469 ModBase(60, a * 4, hide: false);
470 break;
471 case 1611:
472 ModBase(61, a * 4, hide: false);
473 break;
474 case 1612:
475 ModBase(62, a * 4, hide: false);
476 break;
477 case 1620:
478 ModAttribute(70);
479 break;
480 case 1621:
481 ModAttribute(72);
482 break;
483 case 1622:
484 ModAttribute(71);
485 break;
486 case 1623:
487 ModAttribute(73);
488 break;
489 case 1626:
490 ModAttribute(75);
491 break;
492 case 1625:
493 ModAttribute(76);
494 break;
495 case 1627:
496 ModAttribute(77);
497 break;
498 case 1624:
499 ModAttribute(74);
500 break;
501 case 1629:
502 ModBase(79, a * 5, hide: false);
503 break;
504 case 1630:
505 ModBase(65, ((A == 1) ? 2 : ((A == 2) ? 5 : 10)) * invert, hide: false);
506 break;
507 case 1631:
508 ModBase(64, ((A == 1) ? 2 : ((A == 2) ? 5 : 10)) * invert, hide: false);
509 break;
510 case 1632:
511 ModBase(150, a * 2, hide: false);
512 break;
513 case 1633:
514 ModBase(210, a * 3, hide: false);
515 ModBase(402, ((A == 3) ? 1 : 0) * invert, hide: false);
516 break;
517 case 1634:
518 ModBase(291, a * 4, hide: false);
519 break;
520 case 1635:
521 ModBase(100, a * 3, hide: false);
522 break;
523 case 1636:
524 ModBase(306, a * 4, hide: false);
525 break;
526 case 1628:
527 ModBase(78, a * 2, hide: false);
528 break;
529 case 1640:
530 ModBase(77, a * 2, hide: false);
531 break;
532 case 1400:
533 featRef[0] = (a * 10).ToString() ?? "";
534 break;
535 case 1404:
536 featRef[0] = (a * 10).ToString() ?? "";
537 break;
538 case 1401:
539 ModBase(78, a * 15, hide: false);
540 break;
541 case 1406:
542 featRef[0] = (a * 20).ToString() ?? "";
543 featRef[1] = (a * 5).ToString() ?? "";
544 break;
545 case 1644:
546 featRef[0] = a.ToString() ?? "";
547 if (!hint)
548 {
549 if (a > 0)
550 {
552 }
553 else
554 {
555 _ = a;
556 _ = 0;
557 }
558 if (owner.Chara.IsPC)
559 {
561 }
562 }
563 ModBase(60, (A > 5) ? ((A - 5) * -3 * invert) : 0, hide: false);
564 ModBase(79, (A > 5) ? ((A - 5) * -5 * invert) : 0, hide: false);
565 ModBase(77, (A > 5) ? ((A - 5) * -3 * invert) : 0, hide: false);
566 break;
567 case 1230:
568 ModBase(60, A * 2 * invert, hide: false);
569 ModBase(79, A * 3 * invert, hide: false);
570 break;
571 case 1204:
572 ModBase(64, a * 50, hide: true);
573 ModBase(401, a, hide: false);
574 break;
575 case 1202:
576 ModBase(403, a * 20, hide: true);
577 break;
578 case 1210:
579 ModBase(955, a * 5, hide: false);
580 ModBase(953, a * 10, hide: false);
581 ModBase(958, a * 5, hide: false);
582 ModBase(956, a * 10, hide: false);
583 ModBase(950, a * -5, hide: false);
584 ModBase(960, a * -5, hide: false);
585 ModBase(423, a, hide: false);
586 break;
587 case 1290:
588 case 1292:
589 ModBase(418, a * 100, hide: false);
590 break;
591 case 1239:
592 ModBase(956, a * 5, hide: false);
593 ModBase(959, a * 5, hide: false);
594 ModBase(423, a, hide: false);
595 ModBase(424, a, hide: false);
596 ModBase(421, a, hide: false);
597 break;
598 case 1233:
599 ModBase(954, a * 10, hide: false);
600 ModBase(423, a, hide: false);
601 ModBase(425, a, hide: false);
602 ModBase(424, a, hide: false);
603 ModBase(421, a, hide: false);
604 break;
605 case 1226:
606 ModBase(955, a * 5, hide: false);
607 ModBase(953, a * 5, hide: false);
608 break;
609 case 1212:
610 ModBase(961, a * 5, hide: false);
611 ModBase(953, a * 5, hide: false);
612 ModBase(958, a * 5, hide: false);
613 ModBase(956, a * 5, hide: false);
614 ModBase(954, a * 5, hide: false);
615 ModBase(957, a * 5, hide: false);
616 ModBase(959, a * 5, hide: false);
617 break;
618 case 1213:
619 ModBase(962, a * 20, hide: false);
620 break;
621 case 1224:
622 ModBase(951, a * 15, hide: false);
623 break;
624 case 1217:
625 ModBase(952, a * -10, hide: false);
626 ModBase(955, a * 20, hide: false);
627 ModBase(964, a * 20, hide: false);
628 break;
629 case 1218:
630 ModBase(950, a / 40, hide: false);
631 ModBase(952, a / 40, hide: false);
632 ModBase(955, a / 40, hide: false);
633 ModBase(953, a / 40, hide: false);
634 ModBase(958, a / 40, hide: false);
635 ModBase(956, a / 40, hide: false);
636 ModBase(954, a / 40, hide: false);
637 ModBase(959, a / 40, hide: false);
638 ModBase(964, a / 40, hide: false);
639 ModBase(961, a / 40, hide: false);
640 break;
641 case 1221:
642 ModBase(964, a * 20, hide: false);
643 break;
644 case 1223:
645 ModBase(963, a * 20, hide: false);
646 break;
647 case 1216:
648 ModBase(6020, a, hide: false);
649 break;
650 case 1250:
651 ModBase(950, a * -10, hide: false);
652 ModBase(951, a * 5, hide: false);
653 ModBase(961, a * 5, hide: false);
654 ModBase(8793, a, hide: false);
655 ModBase(6607, a, hide: false);
656 break;
657 case 1415:
658 ModBase(60, a * 15, hide: false);
659 ModBase(79, a * 5, hide: false);
660 ModBase(953, a * 3, hide: false);
661 ModBase(961, a, hide: false);
662 ModBase(960, a, hide: false);
663 break;
664 case 1419:
665 ModPotential(101, a * 50);
666 ModPotential(111, a * 50);
667 ModPotential(103, a * 50);
668 ModPotential(106, a * 50);
669 ModPotential(122, a * 50);
670 ModPotential(120, a * 50);
671 ModPotential(123, a * 50);
672 break;
673 case 1274:
674 featRef[3] = (a - 7).ToString() ?? "";
675 break;
676 case 1750:
677 {
678 string[] array = featRef;
679 int num2 = a;
680 array[0] = num2.ToString() ?? "";
681 featRef[1] = (a * 2).ToString() ?? "";
682 break;
683 }
684 case 1532:
685 ModBase(73, -a * 5, hide: false);
686 break;
687 case 1533:
688 ModBase(73, a * 5, hide: false);
689 break;
690 case 1510:
691 ModBase(65, a * 3, hide: false);
692 break;
693 case 1511:
694 ModBase(65, -a * 3, hide: false);
695 break;
696 case 1512:
697 ModBase(73, a * 5, hide: false);
698 break;
699 case 1513:
700 ModBase(73, -a * 5, hide: false);
701 break;
702 case 1514:
703 ModBase(72, a * 3, hide: false);
704 break;
705 case 1515:
706 ModBase(72, -a * 3, hide: false);
707 break;
708 case 1516:
709 ModBase(300, a * 4, hide: false);
710 break;
711 case 1517:
712 ModBase(300, -a * 4, hide: false);
713 break;
714 case 1518:
715 ModBase(79, a * 5, hide: false);
716 break;
717 case 1519:
718 ModBase(79, -a * 5, hide: false);
719 break;
720 case 1520:
721 ModBase(70, a * 3, hide: false);
722 break;
723 case 1521:
724 ModBase(70, -a * 3, hide: false);
725 break;
726 case 1522:
727 ModBase(77, a * 5, hide: false);
728 break;
729 case 1523:
730 ModBase(77, -a * 5, hide: false);
731 break;
732 case 1524:
733 ModBase(307, a * 4, hide: false);
734 break;
735 case 1525:
736 ModBase(307, -a * 4, hide: false);
737 break;
738 case 1526:
739 ModBase(951, a * 5, hide: false);
740 ModBase(950, -a * 5, hide: false);
741 break;
742 case 1527:
743 ModBase(951, -a * 5, hide: false);
744 ModBase(950, a * 5, hide: false);
745 break;
746 case 1528:
747 ModBase(952, a * 5, hide: false);
748 break;
749 case 1529:
750 ModBase(952, -a * 5, hide: false);
751 break;
752 case 1530:
753 ModBase(960, a * 5, hide: false);
754 ModBase(956, -a * 5, hide: false);
755 break;
756 case 1531:
757 ModBase(960, -a * 5, hide: false);
758 ModBase(956, a * 5, hide: false);
759 break;
760 case 1300:
761 case 1305:
762 case 1310:
763 case 1315:
764 case 1320:
765 case 1325:
766 case 1330:
767 case 1335:
768 case 1340:
769 case 1345:
770 case 1350:
771 case 1355:
772 GodHint();
773 break;
774 case 1550:
775 ModBase(404, -a * 10, hide: false);
776 break;
777 case 1551:
778 ModBase(77, -a * (4 + num / 5), hide: false);
779 break;
780 case 1552:
781 ModBase(79, a * Mathf.Min(30 + num / 5, 100), hide: false);
782 if (!hint && a > 0)
783 {
784 chara?.body.UnequipAll(39);
785 }
786 break;
787 case 1553:
788 ModBase(73, a * (5 + num / 3), hide: false);
789 ModBase(77, -a * (5 + num / 3), hide: false);
790 break;
791 case 1554:
792 ModBase(404, a * 10, hide: false);
793 ModBase(401, a, hide: false);
794 ModBase(79, a * (10 + num / 5), hide: false);
795 if (!hint && a > 0)
796 {
797 chara?.body.UnequipAll(33);
798 }
799 break;
800 case 1555:
801 ModBase(65, a * (12 + num), hide: false);
802 ModBase(77, -a * (5 + num / 5), hide: false);
803 if (!hint && a > 0)
804 {
805 chara?.body.UnequipAll(31);
806 }
807 break;
808 case 1556:
809 ModBase(64, -a * (10 + num), hide: false);
810 ModBase(67, a * (5 + num / 2), hide: false);
811 break;
812 case 1557:
813 ModBase(71, -a * (5 + num / 3), hide: false);
814 ModBase(72, -a * (4 + num / 4), hide: false);
815 ModBase(74, a * (6 + num / 2), hide: false);
816 ModBase(75, a * (2 + num / 6), hide: false);
817 break;
818 case 1560:
819 ModBase(60, -a * 15, hide: false);
820 ModBase(70, -a * (4 + num / 3), hide: false);
821 break;
822 case 1561:
823 ModBase(61, -a * 15, hide: false);
824 ModBase(76, -a * (4 + num / 3), hide: false);
825 break;
826 case 1562:
827 ModBase(65, a * (15 + num / 2), hide: false);
828 ModBase(79, -a * (10 + num / 5), hide: false);
829 break;
830 case 1563:
831 ModBase(77, -a * (3 + num / 4), hide: false);
832 break;
833 case 1564:
834 ModBase(961, a * 5, hide: false);
835 break;
836 case 1565:
837 ModBase(955, a * 20, hide: false);
838 break;
839 }
840 if (hint)
841 {
842 string text = base.source.GetText("textExtra");
843 if (!text.IsEmpty())
844 {
845 string text2 = text.SplitNewline().TryGet(value - 1, 99);
846 if (!text2.IsEmpty())
847 {
848 int num3 = 0;
849 string[] array2 = text2.Split(',');
850 foreach (string obj in array2)
851 {
852 string text3 = featRef[num3];
853 string text4 = obj.Replace(";", ",");
854 if (text3.ToInt() < 0)
855 {
856 text4 = text4.Replace("+#1", text3);
857 }
858 text4 = text4.Replace("#1", text3);
859 hints.Add(text4);
860 num3++;
861 }
862 }
863 }
864 }
865 return hints;
866 void GodHint()
867 {
868 if (!hint)
869 {
870 return;
871 }
872 foreach (Element value2 in owner.Card.Chara.faithElements.dict.Values)
873 {
874 if (value2.source.id != id)
875 {
876 NoteElement(value2.id, value2.Value);
877 }
878 }
879 }
880 void ModAttribute(int ele)
881 {
882 _ = hint;
883 ModBase(ele, ((A == 1) ? 2 : ((A == 2) ? 4 : 5)) * invert, hide: false);
884 ModPotential(ele, a * 10);
885 }
886 void ModBase(int ele, int _v, bool hide)
887 {
888 if (!hint)
889 {
890 owner.ModBase(ele, _v);
891 }
892 if (!hide && _v != 0)
893 {
894 NoteElement(ele, _v);
895 }
896 }
897 void ModPotential(int ele, int _v)
898 {
899 if (!hint)
900 {
901 owner.ModPotential(ele, _v);
902 }
903 Note("modPotential".lang(EClass.sources.elements.map[ele].GetName(), "+" + _v + "%"));
904 }
905 void Note(string s)
906 {
907 if (hint)
908 {
909 hints.Add(s);
910 }
911 }
912 void NoteElement(int ele, int num4)
913 {
915 if (row.category == "ability")
916 {
917 Note("hintLearnAbility".lang(row.GetName().ToTitleCase()));
918 }
919 else if (row.tag.Contains("flag"))
920 {
921 Note(row.GetName());
922 }
923 else
924 {
925 string @ref = ((num4 < 0) ? "" : "+") + num4;
926 if (row.category == "resist")
927 {
928 int num5 = 0;
929 @ref = ((num4 > 0) ? "+" : "-").Repeat(Mathf.Clamp(Mathf.Abs(num4) / 5 + num5, 1, 5));
930 Note("modValueRes".lang(row.GetName(), @ref));
931 }
932 else
933 {
934 Note("modValue".lang(row.GetName(), @ref));
935 }
936 }
937 }
938 }
@ ModPotential
@ hint
static void PublishEvent(string eventId, object data=null)
virtual Chara Chara
Definition: Card.cs:2122
int LV
Definition: Card.cs:389
void UnequipAll(int idSlot)
Definition: CharaBody.cs:57
Definition: Chara.cs:10
CharaBody body
Definition: Chara.cs:96
override bool IsPC
Definition: Chara.cs:632
void AddRandomBodyPart(bool msg=false)
Definition: Chara.cs:2418
ElementContainer faithElements
Definition: Chara.cs:40
Definition: EClass.cs:6
static SourceManager sources
Definition: EClass.cs:43
virtual void SetData(T newData)
Definition: EVENT.cs:11
Dictionary< int, Element > dict
Element ModPotential(int ele, int v)
virtual Card Card
Element ModBase(int ele, int v)
virtual Chara Chara
int id
Definition: ELEMENT.cs:259
SourceElement.Row source
Definition: ELEMENT.cs:282
int vPotential
Definition: ELEMENT.cs:265
ElementContainer owner
Definition: ELEMENT.cs:275
int Value
Definition: ELEMENT.cs:301
static List< string > hints
Definition: FEAT.cs:346
static string[] featRef
Definition: FEAT.cs:348
override string GetName()
SourceElement elements
static void OnChangeBodyPart()
Definition: WidgetEquip.cs:53

References Chara.AddRandomBodyPart(), Chara.body, ElementContainer.Card, SourceElement.Row.category, Card.Chara, ElementContainer.Chara, EVENT.ElinEventArgs< T >.data, ElementContainer.dict, SourceManager.elements, Chara.faithElements, featRef, SourceElement.Row.GetName(), hint, hints, Element.id, Chara.IsPC, Card.LV, ElementContainer.ModBase(), ModPotential, ElementContainer.ModPotential(), WidgetEquip.OnChangeBodyPart(), Element.owner, BaseModManager.PublishEvent(), EVENT.ElinEventArgs< T >.SetData(), Element.source, EClass.sources, SourceElement.Row.tag, CharaBody.UnequipAll(), Element.Value, and Element.vPotential.

Referenced by GetHint(), OnWriteNote(), and Chara.SetFeat().

◆ CanLink()

override bool Feat.CanLink ( ElementContainer  owner)
inlinevirtual

Reimplemented from Element.

Definition at line 369 of file FEAT.cs.

370 {
371 return !base.IsGlobalElement;
372 }

◆ GetHint()

string Feat.GetHint ( ElementContainer  owner)
inline

Definition at line 388 of file FEAT.cs.

389 {
390 string text = "";
391 Apply(base.Value, owner, hint: true);
392 foreach (string hint in hints)
393 {
394 text = text + hint.StripLastPun() + ", ";
395 }
396 return text.TrimEnd(' ').TrimEnd(',');
397 }
virtual List< string > Apply(int a, ElementContainer owner, bool hint=false)
Definition: FEAT.cs:425

References Apply(), hint, hints, and Element.owner.

◆ GetIcon()

override Sprite Feat.GetIcon ( string  suffix = "")
inlinevirtual

Reimplemented from Element.

Definition at line 374 of file FEAT.cs.

375 {
376 return SpriteSheet.Get("Media/Graphics/Icon/Element/icon_elements", "ele_Feat");
377 }
static Sprite Get(string id)
Definition: SpriteSheet.cs:28

References SpriteSheet.Get().

◆ IsPurchaseFeatReqMet()

override bool Feat.IsPurchaseFeatReqMet ( ElementContainer  owner,
int  lv = -1 
)
inlinevirtual

Reimplemented from Element.

Definition at line 399 of file FEAT.cs.

400 {
401 if (base.source.req.Length != 0)
402 {
403 Element element = owner.GetElement(base.source.req[0]);
404 if (element == null || element.ValueWithoutLink < ((base.source.req.Length == 1) ? 1 : base.source.req[Mathf.Clamp(((lv == -1 && owner != null) ? owner.Value(id) : lv) + 1, 1, base.source.req.Length - 1)].ToInt()))
405 {
406 return false;
407 }
408 }
409 return true;
410 }
int Value(int ele)
Element GetElement(string alias)
int ValueWithoutLink
Definition: ELEMENT.cs:303

References ElementContainer.GetElement(), Element.owner, ElementContainer.Value(), and Element.ValueWithoutLink.

Referenced by Chara.ListAvailabeFeats().

◆ OnWriteNote()

override void Feat.OnWriteNote ( UINote  n,
ElementContainer  owner 
)
inlinevirtual

Reimplemented from Element.

Definition at line 379 of file FEAT.cs.

380 {
381 Apply(base.Value, owner, hint: true);
382 foreach (string hint in hints)
383 {
384 n.AddText("_bullet".lang() + hint);
385 }
386 }
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113

References Apply(), hint, hints, and Element.owner.

◆ WritePurchaseReq()

override void Feat.WritePurchaseReq ( UINote  n,
int  lv = -1 
)
inlinevirtual

Reimplemented from Element.

Definition at line 412 of file FEAT.cs.

413 {
414 if (base.source.req.Length != 0)
415 {
416 Element element = Element.Create(base.source.req[0], (base.source.req.Length == 1) ? 1 : base.source.req[Mathf.Clamp(((lv == -1 && owner != null) ? owner.Value(id) : lv) + 1, 1, base.source.req.Length - 1)].ToInt());
417 if (element != null)
418 {
419 n.AddHeader("featReq");
420 n.AddText(element.Name + ": " + element.Value, FontColor.Bad);
421 }
422 }
423 }
FontColor
Definition: FontColor.cs:2
virtual string Name
Definition: ELEMENT.cs:313
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1163
UIItem AddHeader(string text, Sprite sprite=null)
Definition: UINote.cs:79

References UINote.AddHeader(), UINote.AddText(), Element.Create(), Element.Name, Element.owner, Element.Value, and ElementContainer.Value().

Member Data Documentation

◆ featRef

string [] Feat.featRef = new string[5]
static

Definition at line 348 of file FEAT.cs.

Referenced by Apply(), and ElementContainer.GetFeatRef().

◆ hints

List<string> Feat.hints = new List<string>()
static

Definition at line 346 of file FEAT.cs.

Referenced by Apply(), GetHint(), and OnWriteNote().

Property Documentation

◆ CostLearn

override int Feat.CostLearn
get

Definition at line 367 of file FEAT.cs.

◆ FullName

override string Feat.FullName
get

Definition at line 354 of file FEAT.cs.

355 {
356 get
357 {
358 string[] array = base.source.GetText().SplitNewline();
359 return array.TryGet(base.Value - 1) + ((base.source.max > 1 && array.Length == 1 && base.Value > 1) ? (" " + base.Value) : "");
360 }
361 }

Referenced by Chara.SetFeat().

◆ Name

override string Feat.Name
get

Definition at line 352 of file FEAT.cs.

◆ ShowBonuses

override bool Feat.ShowBonuses
get

Definition at line 350 of file FEAT.cs.

◆ ShowValue

override bool Feat.ShowValue
get

Definition at line 365 of file FEAT.cs.

◆ ShowXP

override bool Feat.ShowXP
get

Definition at line 363 of file FEAT.cs.


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