Elin Decompiled Documentation EA 23.228 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)
 
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 283 of file FEAT.cs.

Member Function Documentation

◆ Apply()

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

Definition at line 364 of file FEAT.cs.

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

309 {
310 return !base.IsGlobalElement;
311 }

◆ GetHint()

string Feat.GetHint ( ElementContainer  owner)
inline

Definition at line 327 of file FEAT.cs.

328 {
329 string text = "";
330 Apply(base.Value, owner, hint: true);
331 foreach (string hint in hints)
332 {
333 text = text + hint.StripLastPun() + ", ";
334 }
335 return text.TrimEnd(' ').TrimEnd(',');
336 }
List< string > Apply(int a, ElementContainer owner, bool hint=false)
Definition: FEAT.cs:364

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

◆ GetIcon()

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

Reimplemented from Element.

Definition at line 313 of file FEAT.cs.

314 {
315 return SpriteSheet.Get("Media/Graphics/Icon/Element/icon_elements", "ele_Feat");
316 }
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 338 of file FEAT.cs.

339 {
340 if (base.source.req.Length != 0)
341 {
342 Element element = owner.GetElement(base.source.req[0]);
343 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()))
344 {
345 return false;
346 }
347 }
348 return true;
349 }
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 318 of file FEAT.cs.

319 {
320 Apply(base.Value, owner, hint: true);
321 foreach (string hint in hints)
322 {
323 n.AddText("_bullet".lang() + hint);
324 }
325 }
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 351 of file FEAT.cs.

352 {
353 if (base.source.req.Length != 0)
354 {
355 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());
356 if (element != null)
357 {
358 n.AddHeader("featReq");
359 n.AddText(element.Name + ": " + element.Value, FontColor.Bad);
360 }
361 }
362 }
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 287 of file FEAT.cs.

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

◆ hints

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

Definition at line 285 of file FEAT.cs.

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

Property Documentation

◆ CostLearn

override int Feat.CostLearn
get

Definition at line 306 of file FEAT.cs.

◆ FullName

override string Feat.FullName
get

Definition at line 293 of file FEAT.cs.

294 {
295 get
296 {
297 string[] array = base.source.GetText().SplitNewline();
298 return array.TryGet(base.Value - 1) + ((base.source.max > 1 && array.Length == 1 && base.Value > 1) ? (" " + base.Value) : "");
299 }
300 }

Referenced by Chara.SetFeat().

◆ Name

override string Feat.Name
get

Definition at line 291 of file FEAT.cs.

◆ ShowBonuses

override bool Feat.ShowBonuses
get

Definition at line 289 of file FEAT.cs.

◆ ShowValue

override bool Feat.ShowValue
get

Definition at line 304 of file FEAT.cs.

◆ ShowXP

override bool Feat.ShowXP
get

Definition at line 302 of file FEAT.cs.


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