Elin Decompiled Documentation EA 23.183 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 int GetSourceValue (int 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 260 of file FEAT.cs.

Member Function Documentation

◆ Apply()

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

Definition at line 341 of file FEAT.cs.

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

286 {
287 return !base.IsGlobalElement;
288 }

◆ GetHint()

string Feat.GetHint ( ElementContainer  owner)
inline

Definition at line 304 of file FEAT.cs.

305 {
306 string text = "";
307 Apply(base.Value, owner, hint: true);
308 foreach (string hint in hints)
309 {
310 text = text + hint.StripLastPun() + ", ";
311 }
312 return text.TrimEnd(' ').TrimEnd(',');
313 }
List< string > Apply(int a, ElementContainer owner, bool hint=false)
Definition: FEAT.cs:341

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

◆ GetIcon()

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

Reimplemented from Element.

Definition at line 290 of file FEAT.cs.

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

316 {
317 if (base.source.req.Length != 0)
318 {
319 Element element = owner.GetElement(base.source.req[0]);
320 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()))
321 {
322 return false;
323 }
324 }
325 return true;
326 }
int Value(int ele)
Element GetElement(string alias)
int ValueWithoutLink
Definition: ELEMENT.cs:292

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

296 {
297 Apply(base.Value, owner, hint: true);
298 foreach (string hint in hints)
299 {
300 n.AddText("_bullet".lang() + hint);
301 }
302 }
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 328 of file FEAT.cs.

329 {
330 if (base.source.req.Length != 0)
331 {
332 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());
333 if (element != null)
334 {
335 n.AddHeader("featReq");
336 n.AddText(element.Name + ": " + element.Value, FontColor.Bad);
337 }
338 }
339 }
FontColor
Definition: FontColor.cs:2
virtual string Name
Definition: ELEMENT.cs:302
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1097
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 264 of file FEAT.cs.

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

◆ hints

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

Definition at line 262 of file FEAT.cs.

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

Property Documentation

◆ CostLearn

override int Feat.CostLearn
get

Definition at line 283 of file FEAT.cs.

◆ FullName

override string Feat.FullName
get

Definition at line 270 of file FEAT.cs.

271 {
272 get
273 {
274 string[] array = base.source.GetText().SplitNewline();
275 return array.TryGet(base.Value - 1) + ((base.source.max > 1 && array.Length == 1 && base.Value > 1) ? (" " + base.Value) : "");
276 }
277 }

Referenced by Chara.SetFeat().

◆ Name

override string Feat.Name
get

Definition at line 268 of file FEAT.cs.

◆ ShowBonuses

override bool Feat.ShowBonuses
get

Definition at line 266 of file FEAT.cs.

◆ ShowValue

override bool Feat.ShowValue
get

Definition at line 281 of file FEAT.cs.

◆ ShowXP

override bool Feat.ShowXP
get

Definition at line 279 of file FEAT.cs.


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