Elin Decompiled Documentation EA 23.312 Nightly Patch 4
Loading...
Searching...
No Matches
ReligionCustom.cs
Go to the documentation of this file.
1using UnityEngine;
2
3public class ReligionCustom : Religion
4{
5 public CustomReligionContent content;
6
7 public override string id => content?.SourceId ?? "";
8
9 public override bool CanJoin => content?.canJoin ?? true;
10
11 public override bool IsMinorGod => content?.isMinorGod ?? false;
12
13 public override bool IsAvailable => true;
14
15 public override Sprite GetSprite()
16 {
17 return ModUtil.LoadSprite(id, null, null, 150, 200) ?? base.GetSprite();
18 }
19
20 public override bool IsValidArtifact(string thingId)
21 {
22 return content.artifacts.Contains(thingId);
23 }
24
25 public override string[] GetValidArtifacts()
26 {
27 return content.artifacts.ToArray();
28 }
29
30 public override bool IsFaithElement(Element e)
31 {
32 return content.elements.Contains(e.source.alias);
33 }
34
35 public override int GetOfferingMtp(Thing t)
36 {
37 if (content.offeringMtp.TryGetValue(t.id, out var value))
38 {
39 return value;
40 }
41 return base.GetOfferingMtp(t);
42 }
43
44 public override int GetOfferingValue(Thing t, int num = -1)
45 {
46 if (num == -1)
47 {
48 num = t.Num;
49 }
50 int offeringValue = base.GetOfferingValue(t, num);
51 if (content.offeringValue.TryGetValue(t.id, out var value))
52 {
53 var args = new
54 {
55 @base = offeringValue,
56 lv = t.LV,
57 rarity = t.rarityLv
58 };
59 if (value.TryEvaluateAsCalc(out int result, (object)args))
60 {
61 return result;
62 }
63 }
64 return offeringValue;
65 }
66
67 public override void Punish(Chara c)
68 {
69 if (content.noPunish)
70 {
72 }
73 else
74 {
75 base.Punish(c);
76 }
77 }
78
79 public override void PunishTakeOver(Chara c)
80 {
81 if (content.noPunishTakeover)
82 {
84 }
85 else
86 {
87 base.PunishTakeOver(c);
88 }
89 }
90}
string id
Definition: Card.cs:36
void SayNothingHappans()
Definition: Card.cs:7203
int Num
Definition: Card.cs:161
int LV
Definition: Card.cs:389
Definition: Chara.cs:10
SourceElement.Row source
Definition: ELEMENT.cs:278
override bool IsFaithElement(Element e)
override void PunishTakeOver(Chara c)
override bool IsMinorGod
override string[] GetValidArtifacts()
override void Punish(Chara c)
override int GetOfferingMtp(Thing t)
override bool CanJoin
override bool IsAvailable
CustomReligionContent content
override Sprite GetSprite()
override bool IsValidArtifact(string thingId)
override int GetOfferingValue(Thing t, int num=-1)
Definition: Thing.cs:8