Elin Decompiled Documentation EA 23.233 Nightly Patch 1
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)
 
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 (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 
- 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 290 of file FEAT.cs.

Member Function Documentation

◆ Apply()

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

Definition at line 371 of file FEAT.cs.

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

316 {
317 return !base.IsGlobalElement;
318 }

◆ GetHint()

string Feat.GetHint ( ElementContainer  owner)
inline

Definition at line 334 of file FEAT.cs.

335 {
336 string text = "";
337 Apply(base.Value, owner, hint: true);
338 foreach (string hint in hints)
339 {
340 text = text + hint.StripLastPun() + ", ";
341 }
342 return text.TrimEnd(' ').TrimEnd(',');
343 }
List< string > Apply(int a, ElementContainer owner, bool hint=false)
Definition: FEAT.cs:371

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

◆ GetIcon()

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

Reimplemented from Element.

Definition at line 320 of file FEAT.cs.

321 {
322 return SpriteSheet.Get("Media/Graphics/Icon/Element/icon_elements", "ele_Feat");
323 }
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 345 of file FEAT.cs.

346 {
347 if (base.source.req.Length != 0)
348 {
349 Element element = owner.GetElement(base.source.req[0]);
350 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()))
351 {
352 return false;
353 }
354 }
355 return true;
356 }
int Value(int ele)
Element GetElement(string alias)
int ValueWithoutLink
Definition: ELEMENT.cs:294

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

326 {
327 Apply(base.Value, owner, hint: true);
328 foreach (string hint in hints)
329 {
330 n.AddText("_bullet".lang() + hint);
331 }
332 }
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 358 of file FEAT.cs.

359 {
360 if (base.source.req.Length != 0)
361 {
362 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());
363 if (element != null)
364 {
365 n.AddHeader("featReq");
366 n.AddText(element.Name + ": " + element.Value, FontColor.Bad);
367 }
368 }
369 }
FontColor
Definition: FontColor.cs:2
virtual string Name
Definition: ELEMENT.cs:304
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1100
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 294 of file FEAT.cs.

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

◆ hints

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

Definition at line 292 of file FEAT.cs.

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

Property Documentation

◆ CostLearn

override int Feat.CostLearn
get

Definition at line 313 of file FEAT.cs.

◆ FullName

override string Feat.FullName
get

Definition at line 300 of file FEAT.cs.

301 {
302 get
303 {
304 string[] array = base.source.GetText().SplitNewline();
305 return array.TryGet(base.Value - 1) + ((base.source.max > 1 && array.Length == 1 && base.Value > 1) ? (" " + base.Value) : "");
306 }
307 }

Referenced by Chara.SetFeat().

◆ Name

override string Feat.Name
get

Definition at line 298 of file FEAT.cs.

◆ ShowBonuses

override bool Feat.ShowBonuses
get

Definition at line 296 of file FEAT.cs.

◆ ShowValue

override bool Feat.ShowValue
get

Definition at line 311 of file FEAT.cs.

◆ ShowXP

override bool Feat.ShowXP
get

Definition at line 309 of file FEAT.cs.


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