Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
Check Class Reference
Inheritance diagram for Check:
EClass SkillCheck

Public Types

enum  Result { CriticalPass , Pass , Fail , CriticalFail }
 
enum  Output { None , Default }
 

Public Member Functions

string GetText (Chara p, Card tg, bool inDialog=false)
 
int GetDC (Card tg=null)
 
int GetFinalDC (Chara p, Card tg=null)
 
Result Perform (Chara p, Card tg=null)
 
Result Perform (Chara p, Card tg, Action< Result > action)
 

Static Public Member Functions

static Check Get (string id, float dcMod=1f)
 
- Static Public Member Functions inherited from EClass
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

SourceCheck.Row _source
 
string id
 
float dcMod
 

Properties

SourceCheck.Row source [get]
 
string mainElementName [get]
 
int baseDC [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 Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 4 of file Check.cs.

Member Enumeration Documentation

◆ Output

Enumerator
None 
Default 

Definition at line 14 of file Check.cs.

15 {
16 None,
18 }

◆ Result

Enumerator
CriticalPass 
Pass 
Fail 
CriticalFail 

Definition at line 6 of file Check.cs.

Member Function Documentation

◆ Get()

static Check Check.Get ( string  id,
float  dcMod = 1f 
)
inlinestatic

Definition at line 32 of file Check.cs.

33 {
34 return new Check
35 {
36 id = id,
37 dcMod = dcMod
38 };
39 }
Definition: Check.cs:5
float dcMod
Definition: Check.cs:24
string id
Definition: Check.cs:22

References dcMod, and id.

Referenced by DramaActor.SetChoice().

◆ GetDC()

int Check.GetDC ( Card  tg = null)
inline

Definition at line 54 of file Check.cs.

55 {
56 float num = (float)baseDC * dcMod;
57 if (tg == null)
58 {
59 return (int)num;
60 }
61 num += source.lvMod * (float)tg.LV;
62 if (source.targetElement != 0)
63 {
64 Element element = tg.elements.GetElement(source.element);
65 if (element != null)
66 {
67 num += (float)element.Value;
68 if (source.targetSubFactor > 0f && !element.source.aliasParent.IsEmpty())
69 {
70 Element element2 = tg.elements.GetElement(element.source.aliasParent);
71 if (element2 != null)
72 {
73 num += source.targetSubFactor * (float)element2.Value;
74 }
75 }
76 }
77 }
78 return (int)num;
79 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
ElementContainerCard elements
Definition: Card.cs:37
int LV
Definition: Card.cs:370
int baseDC
Definition: Check.cs:30
SourceCheck.Row source
Definition: Check.cs:26
Element GetElement(string alias)
SourceElement.Row source
Definition: ELEMENT.cs:263
int Value
Definition: ELEMENT.cs:282

References baseDC, dcMod, if(), source, Element.source, and Element.Value.

Referenced by GetFinalDC(), and GetText().

◆ GetFinalDC()

int Check.GetFinalDC ( Chara  p,
Card  tg = null 
)
inline

Definition at line 81 of file Check.cs.

82 {
83 int num = GetDC(tg);
84 if (source.element != 0)
85 {
86 Element element = p.elements.GetElement(source.element);
87 if (element != null)
88 {
89 num -= element.Value;
90 if (source.subFactor > 0f && !element.source.aliasParent.IsEmpty())
91 {
92 Element element2 = p.elements.GetElement(element.source.aliasParent);
93 if (element2 != null)
94 {
95 num -= (int)(source.subFactor * (float)element2.Value);
96 }
97 }
98 }
99 }
100 if (num > 14)
101 {
102 num = 14 + (int)Mathf.Sqrt(num - 14);
103 }
104 else if (num < 6)
105 {
106 num = 6 - (int)Mathf.Sqrt(6 - num);
107 }
108 return num;
109 }
int GetDC(Card tg=null)
Definition: Check.cs:54

References Card.elements, GetDC(), ElementContainer.GetElement(), source, Element.source, and Element.Value.

Referenced by GetText(), and Perform().

◆ GetText()

string Check.GetText ( Chara  p,
Card  tg,
bool  inDialog = false 
)
inline

Definition at line 41 of file Check.cs.

42 {
43 string text = "";
44 int finalDC = GetFinalDC(p, tg);
45 string text2 = ((finalDC > 20) ? "絶望的" : ((finalDC > 17) ? "ほぼ絶望的" : ((finalDC > 14) ? "とても難しい" : ((finalDC > 11) ? "難しい" : ((finalDC > 8) ? "普通" : ((finalDC > 5) ? "簡単" : ((finalDC > 2) ? "とても簡単" : "とても余裕")))))));
46 if (finalDC <= 20 && finalDC <= 15 && finalDC <= 10)
47 {
48 _ = 5;
49 }
50 text = text + "DC " + GetDC(tg) + " " + mainElementName + " " + text2;
51 return text + " " + source.element + "/" + EClass.sources.elements.map[source.element].alias;
52 }
string mainElementName
Definition: Check.cs:28
int GetFinalDC(Chara p, Card tg=null)
Definition: Check.cs:81
Definition: EClass.cs:5
static SourceManager sources
Definition: EClass.cs:42
SourceElement elements

References SourceManager.elements, GetDC(), GetFinalDC(), mainElementName, source, and EClass.sources.

◆ Perform() [1/2]

Result Check.Perform ( Chara  p,
Card  tg,
Action< Result action 
)
inline

Definition at line 140 of file Check.cs.

141 {
142 Result result = Perform(p, tg);
143 action?.Invoke(result);
144 return result;
145 }
Result Perform(Chara p, Card tg=null)
Definition: Check.cs:111
Result
Definition: Check.cs:7

References Perform().

◆ Perform() [2/2]

Result Check.Perform ( Chara  p,
Card  tg = null 
)
inline

Definition at line 111 of file Check.cs.

112 {
113 int finalDC = GetFinalDC(p, tg);
114 int num = Dice.Roll(1, 20);
115 if (EClass.debug.logDice)
116 {
117 string text = "Check:" + source.id + " dc=" + finalDC + " roll=" + num + " ";
118 Debug.Log(num switch
119 {
120 20 => text + "CriticalPass",
121 1 => text + "CriticalFail",
122 _ => (num < finalDC) ? (text + "Fail") : (text + "Pass"),
123 });
124 }
125 switch (num)
126 {
127 case 20:
128 return Result.CriticalPass;
129 case 1:
130 return Result.CriticalFail;
131 default:
132 if (num >= finalDC)
133 {
134 return Result.Pass;
135 }
136 return Result.Fail;
137 }
138 }
bool logDice
Definition: CoreDebug.cs:246
Definition: Dice.cs:4
static int Roll(int num, int sides, int bonus=0, Card card=null)
Definition: Dice.cs:15
static CoreDebug debug
Definition: EClass.cs:48

References EClass.debug, Debug, GetFinalDC(), CoreDebug.logDice, and Dice.Roll().

Referenced by Perform().

Member Data Documentation

◆ _source

SourceCheck.Row Check._source

Definition at line 20 of file Check.cs.

◆ dcMod

float Check.dcMod

Definition at line 24 of file Check.cs.

Referenced by Get(), and GetDC().

◆ id

string Check.id

Definition at line 22 of file Check.cs.

Referenced by Get().

Property Documentation

◆ baseDC

int Check.baseDC
get

Definition at line 30 of file Check.cs.

Referenced by GetDC().

◆ mainElementName

string Check.mainElementName
get

Definition at line 28 of file Check.cs.

Referenced by GetText().

◆ source

SourceCheck.Row Check.source
get

Definition at line 26 of file Check.cs.

Referenced by GetDC(), GetFinalDC(), and GetText().


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