Elin Decompiled Documentation EA 23.306 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)
 
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)
 
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.RowListElements = new List<SourceElement.Row>()
 
static List< SourceElement.RowListAttackElements = 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 328 of file FEAT.cs.

Member Function Documentation

◆ Apply()

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

Definition at line 409 of file FEAT.cs.

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

354 {
355 return !base.IsGlobalElement;
356 }

◆ GetHint()

string Feat.GetHint ( ElementContainer  owner)
inline

Definition at line 372 of file FEAT.cs.

373 {
374 string text = "";
375 Apply(base.Value, owner, hint: true);
376 foreach (string hint in hints)
377 {
378 text = text + hint.StripLastPun() + ", ";
379 }
380 return text.TrimEnd(' ').TrimEnd(',');
381 }
List< string > Apply(int a, ElementContainer owner, bool hint=false)
Definition: FEAT.cs:409

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

◆ GetIcon()

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

Reimplemented from Element.

Definition at line 358 of file FEAT.cs.

359 {
360 return SpriteSheet.Get("Media/Graphics/Icon/Element/icon_elements", "ele_Feat");
361 }
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 383 of file FEAT.cs.

384 {
385 if (base.source.req.Length != 0)
386 {
387 Element element = owner.GetElement(base.source.req[0]);
388 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()))
389 {
390 return false;
391 }
392 }
393 return true;
394 }
int Value(int ele)
Element GetElement(string alias)
int ValueWithoutLink
Definition: ELEMENT.cs:299

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 363 of file FEAT.cs.

364 {
365 Apply(base.Value, owner, hint: true);
366 foreach (string hint in hints)
367 {
368 n.AddText("_bullet".lang() + hint);
369 }
370 }
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 396 of file FEAT.cs.

397 {
398 if (base.source.req.Length != 0)
399 {
400 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());
401 if (element != null)
402 {
403 n.AddHeader("featReq");
404 n.AddText(element.Name + ": " + element.Value, FontColor.Bad);
405 }
406 }
407 }
FontColor
Definition: FontColor.cs:2
virtual string Name
Definition: ELEMENT.cs:309
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1119
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 332 of file FEAT.cs.

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

◆ hints

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

Definition at line 330 of file FEAT.cs.

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

Property Documentation

◆ CostLearn

override int Feat.CostLearn
get

Definition at line 351 of file FEAT.cs.

◆ FullName

override string Feat.FullName
get

Definition at line 338 of file FEAT.cs.

339 {
340 get
341 {
342 string[] array = base.source.GetText().SplitNewline();
343 return array.TryGet(base.Value - 1) + ((base.source.max > 1 && array.Length == 1 && base.Value > 1) ? (" " + base.Value) : "");
344 }
345 }

Referenced by Chara.SetFeat().

◆ Name

override string Feat.Name
get

Definition at line 336 of file FEAT.cs.

◆ ShowBonuses

override bool Feat.ShowBonuses
get

Definition at line 334 of file FEAT.cs.

◆ ShowValue

override bool Feat.ShowValue
get

Definition at line 349 of file FEAT.cs.

◆ ShowXP

override bool Feat.ShowXP
get

Definition at line 347 of file FEAT.cs.


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