Elin Decompiled Documentation EA 23.295 Stable Patch 2
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 323 of file FEAT.cs.

Member Function Documentation

◆ Apply()

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

Definition at line 404 of file FEAT.cs.

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

349 {
350 return !base.IsGlobalElement;
351 }

◆ GetHint()

string Feat.GetHint ( ElementContainer  owner)
inline

Definition at line 367 of file FEAT.cs.

368 {
369 string text = "";
370 Apply(base.Value, owner, hint: true);
371 foreach (string hint in hints)
372 {
373 text = text + hint.StripLastPun() + ", ";
374 }
375 return text.TrimEnd(' ').TrimEnd(',');
376 }
List< string > Apply(int a, ElementContainer owner, bool hint=false)
Definition: FEAT.cs:404

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

◆ GetIcon()

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

Reimplemented from Element.

Definition at line 353 of file FEAT.cs.

354 {
355 return SpriteSheet.Get("Media/Graphics/Icon/Element/icon_elements", "ele_Feat");
356 }
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 378 of file FEAT.cs.

379 {
380 if (base.source.req.Length != 0)
381 {
382 Element element = owner.GetElement(base.source.req[0]);
383 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()))
384 {
385 return false;
386 }
387 }
388 return true;
389 }
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 358 of file FEAT.cs.

359 {
360 Apply(base.Value, owner, hint: true);
361 foreach (string hint in hints)
362 {
363 n.AddText("_bullet".lang() + hint);
364 }
365 }
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 391 of file FEAT.cs.

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

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

◆ hints

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

Definition at line 325 of file FEAT.cs.

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

Property Documentation

◆ CostLearn

override int Feat.CostLearn
get

Definition at line 346 of file FEAT.cs.

◆ FullName

override string Feat.FullName
get

Definition at line 333 of file FEAT.cs.

334 {
335 get
336 {
337 string[] array = base.source.GetText().SplitNewline();
338 return array.TryGet(base.Value - 1) + ((base.source.max > 1 && array.Length == 1 && base.Value > 1) ? (" " + base.Value) : "");
339 }
340 }

Referenced by Chara.SetFeat().

◆ Name

override string Feat.Name
get

Definition at line 331 of file FEAT.cs.

◆ ShowBonuses

override bool Feat.ShowBonuses
get

Definition at line 329 of file FEAT.cs.

◆ ShowValue

override bool Feat.ShowValue
get

Definition at line 344 of file FEAT.cs.

◆ ShowXP

override bool Feat.ShowXP
get

Definition at line 342 of file FEAT.cs.


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