Elin Decompiled Documentation EA 23.283 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 int GetResistDamage (int 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 315 of file FEAT.cs.

Member Function Documentation

◆ Apply()

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

Definition at line 396 of file FEAT.cs.

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

341 {
342 return !base.IsGlobalElement;
343 }

◆ GetHint()

string Feat.GetHint ( ElementContainer  owner)
inline

Definition at line 359 of file FEAT.cs.

360 {
361 string text = "";
362 Apply(base.Value, owner, hint: true);
363 foreach (string hint in hints)
364 {
365 text = text + hint.StripLastPun() + ", ";
366 }
367 return text.TrimEnd(' ').TrimEnd(',');
368 }
List< string > Apply(int a, ElementContainer owner, bool hint=false)
Definition: FEAT.cs:396

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

◆ GetIcon()

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

Reimplemented from Element.

Definition at line 345 of file FEAT.cs.

346 {
347 return SpriteSheet.Get("Media/Graphics/Icon/Element/icon_elements", "ele_Feat");
348 }
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 370 of file FEAT.cs.

371 {
372 if (base.source.req.Length != 0)
373 {
374 Element element = owner.GetElement(base.source.req[0]);
375 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()))
376 {
377 return false;
378 }
379 }
380 return true;
381 }
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 350 of file FEAT.cs.

351 {
352 Apply(base.Value, owner, hint: true);
353 foreach (string hint in hints)
354 {
355 n.AddText("_bullet".lang() + hint);
356 }
357 }
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 383 of file FEAT.cs.

384 {
385 if (base.source.req.Length != 0)
386 {
387 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());
388 if (element != null)
389 {
390 n.AddHeader("featReq");
391 n.AddText(element.Name + ": " + element.Value, FontColor.Bad);
392 }
393 }
394 }
FontColor
Definition: FontColor.cs:2
virtual string Name
Definition: ELEMENT.cs:309
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1111
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 319 of file FEAT.cs.

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

◆ hints

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

Definition at line 317 of file FEAT.cs.

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

Property Documentation

◆ CostLearn

override int Feat.CostLearn
get

Definition at line 338 of file FEAT.cs.

◆ FullName

override string Feat.FullName
get

Definition at line 325 of file FEAT.cs.

326 {
327 get
328 {
329 string[] array = base.source.GetText().SplitNewline();
330 return array.TryGet(base.Value - 1) + ((base.source.max > 1 && array.Length == 1 && base.Value > 1) ? (" " + base.Value) : "");
331 }
332 }

Referenced by Chara.SetFeat().

◆ Name

override string Feat.Name
get

Definition at line 323 of file FEAT.cs.

◆ ShowBonuses

override bool Feat.ShowBonuses
get

Definition at line 321 of file FEAT.cs.

◆ ShowValue

override bool Feat.ShowValue
get

Definition at line 336 of file FEAT.cs.

◆ ShowXP

override bool Feat.ShowXP
get

Definition at line 334 of file FEAT.cs.


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