Elin Decompiled Documentation EA 23.264 Nightly
Loading...
Searching...
No Matches
Religion Class Reference
Inheritance diagram for Religion:
EClass ReligionEarth ReligionElement ReligionEyth ReligionHarmony ReligionHarvest ReligionHealing ReligionLuck ReligionMachine ReligionMinor ReligionOblivion ReligionWind

Public Types

enum  ConvertType { Default , Campaign }
 

Public Member Functions

virtual SourceElement.Row GetFeat (int i)
 
void Init ()
 
void OnLoad ()
 
void OnAdvanceDay ()
 
Sprite GetSprite ()
 
void SetTextRelation (UIText text)
 
string GetTextBenefit ()
 
string GetTextTemper (int _temper=-99999)
 
void Revelation (string idTalk, int chance=100)
 
void Talk (string idTalk, Card c=null, Card agent=null)
 
string GetGodTalk (string suffix)
 
virtual int GetOfferingMtp (Thing t)
 
int GetOfferingValue (Thing t, int num=-1)
 
bool TryGetGift ()
 
bool IsValidArtifact (string id)
 
virtual void OnBecomeBranchFaith ()
 
void JoinFaith (Chara c, ConvertType type=ConvertType.Default)
 
void LeaveFaith (Chara c, Religion newFaith, ConvertType type)
 
void Punish (Chara c)
 
void PunishTakeOver (Chara c)
 
virtual void OnJoinFaith ()
 
virtual void OnLeaveFaith ()
 
void OnChangeHour ()
 

Static Public Member Functions

static Religion GetArtifactDeity (string id)
 
static Thing Reforge (string id, Point pos=null, bool first=true)
 
- 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 (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
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

int relation
 
int giftRank
 
int mood
 
SourceReligion.Row _source
 

Static Public Attributes

static Religion recentWrath
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

virtual string id [get]
 
virtual bool IsAvailable [get]
 
string Name [get]
 
SourceReligion.Row source [get]
 
string NameShort [get]
 
string NameDomain [get]
 
string TextType [get]
 
string TextGodGender [get]
 
string TextMood [get]
 
bool IsEyth [get]
 
bool IsEhekatl [get]
 
bool IsOpatos [get]
 
virtual bool IsMinorGod [get]
 
virtual bool CanJoin [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]
 

Detailed Description

Definition at line 5 of file Religion.cs.

Member Enumeration Documentation

◆ ConvertType

Enumerator
Default 
Campaign 

Definition at line 7 of file Religion.cs.

Member Function Documentation

◆ GetArtifactDeity()

static Religion Religion.GetArtifactDeity ( string  id)
inlinestatic

Definition at line 255 of file Religion.cs.

256 {
257 return id switch
258 {
259 "gun_mani" => EClass.game.religions.Machine,
260 "cloak_mani" => EClass.game.religions.Machine,
261 "scythe_kumi" => EClass.game.religions.Harvest,
262 "blunt_earth" => EClass.game.religions.Earth,
263 "luckydagger" => EClass.game.religions.Luck,
264 "staff_element" => EClass.game.religions.Element,
265 "windbow" => EClass.game.religions.Wind,
266 "shirt_wind" => EClass.game.religions.Wind,
267 "pole_holy" => EClass.game.religions.Healing,
268 "sword_muramasa2" => EClass.game.religions.MoonShadow,
269 "kogitsunemaru" => EClass.game.religions.Trickery,
270 "warmonger" => EClass.game.religions.Strife,
271 _ => null,
272 };
273 }
Definition: EClass.cs:6
static Game game
Definition: EClass.cs:9
ReligionManager religions
Definition: Game.cs:159
ReligionWind Wind
ReligionHarvest Harvest
ReligionMachine Machine
ReligionLuck Luck
ReligionStrife Strife
ReligionMoonShadow MoonShadow
ReligionTrickery Trickery
ReligionElement Element
ReligionEarth Earth
ReligionHealing Healing

References ReligionManager.Earth, ReligionManager.Element, EClass.game, ReligionManager.Harvest, ReligionManager.Healing, ReligionManager.Luck, ReligionManager.Machine, ReligionManager.MoonShadow, Game.religions, ReligionManager.Strife, ReligionManager.Trickery, and ReligionManager.Wind.

Referenced by IsValidArtifact(), and Card.PurgeDuplicateArtifact().

◆ GetFeat()

virtual SourceElement.Row Religion.GetFeat ( int  i)
inlinevirtual

Definition at line 54 of file Religion.cs.

55 {
56 return EClass.sources.elements.alias["featGod_" + id + i];
57 }
static SourceManager sources
Definition: EClass.cs:43
SourceElement elements

References SourceManager.elements, and EClass.sources.

◆ GetGodTalk()

string Religion.GetGodTalk ( string  suffix)
inline

Definition at line 162 of file Religion.cs.

163 {
164 return EClass.sources.dataGodTalk.GetText(id, suffix).Split(Environment.NewLine.ToCharArray()).RandomItem();
165 }
string GetText(string id, string topic="text")
Definition: ExcelData.cs:209
ExcelData dataGodTalk

References SourceManager.dataGodTalk, ExcelData.GetText(), and EClass.sources.

Referenced by DramaActor.ConvertAdv(), and Talk().

◆ GetOfferingMtp()

virtual int Religion.GetOfferingMtp ( Thing  t)
inlinevirtual

Reimplemented in ReligionMoonShadow, and ReligionTrickery.

Definition at line 167 of file Religion.cs.

168 {
169 return 0;
170 }

Referenced by GetOfferingValue().

◆ GetOfferingValue()

int Religion.GetOfferingValue ( Thing  t,
int  num = -1 
)
inline

Definition at line 172 of file Religion.cs.

173 {
174 t.CheckJustCooked();
175 if (num == -1)
176 {
177 num = t.Num;
178 }
179 long v = 0L;
180 if (t.source._origin == "meat")
181 {
182 v = Mathf.Clamp(t.SelfWeight / 10, 1, 1000);
183 if (t.refCard == null)
184 {
185 v /= 10L;
186 }
187 }
188 else if (GetOfferingMtp(t) > 0)
189 {
190 SetValue(t.category, GetOfferingMtp(t));
191 }
192 else
193 {
194 string[] cat_offer = source.cat_offer;
195 foreach (string key in cat_offer)
196 {
197 if (t.category.IsChildOf(key))
198 {
199 SetValue(EClass.sources.categories.map[key], 1);
200 break;
201 }
202 }
203 }
204 if (v == 0L)
205 {
206 return 0;
207 }
208 if (t.IsDecayed)
209 {
210 v /= 10L;
211 }
212 v = v * (100 + Mathf.Min(t.LV * 2, 100) + (t.HasElement(757) ? 50 : 0)) / 100;
213 v = (int)Mathf.Clamp(Mathf.Max(v, 1f) * (float)num, 1f, 214748370f);
214 return (int)v;
215 void SetValue(SourceCategory.Row cat, int mtp)
216 {
217 v = Mathf.Clamp(t.SelfWeight / 10, 50, 1000);
218 v *= cat.offer * mtp / 100;
219 }
220 }
bool IsDecayed
Definition: Card.cs:2290
CardRow refCard
Definition: Card.cs:1968
void CheckJustCooked()
Definition: Card.cs:6777
int Num
Definition: Card.cs:159
SourceCategory.Row category
Definition: Card.cs:2050
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6061
int LV
Definition: Card.cs:387
virtual int GetOfferingMtp(Thing t)
Definition: Religion.cs:167
SourceReligion.Row source
Definition: Religion.cs:32
SourceCategory categories
SourceThing.Row source
Definition: Thing.cs:11
override int SelfWeight
Definition: Thing.cs:67

References SourceManager.categories, Card.category, Card.CheckJustCooked(), GetOfferingMtp(), Card.HasElement(), Card.IsDecayed, Card.LV, Card.Num, Card.refCard, Thing.SelfWeight, source, Thing.source, and EClass.sources.

Referenced by TraitAltar._OnOffer(), TraitAltar.CanOffer(), and TraitAltar.OnOffer().

◆ GetSprite()

Sprite Religion.GetSprite ( )
inline

Definition at line 72 of file Religion.cs.

73 {
74 return ResourceCache.Load<Sprite>("Media/Graphics/Image/Faction/" + source.id) ?? ResourceCache.Load<Sprite>("Media/Graphics/Image/Faction/eyth");
75 }

References source.

Referenced by UIHomeInfo.RefreshInfo(), Portrait.SetChara(), and UIFactionInfo.SetReligion().

◆ GetTextBenefit()

string Religion.GetTextBenefit ( )
inline

Definition at line 93 of file Religion.cs.

94 {
95 string text = "";
96 for (int i = 0; i < source.elements.Length; i += 2)
97 {
98 if (i != 0)
99 {
100 text = text + Lang.words.comma + Lang.space;
101 }
102 text += EClass.sources.elements.map[source.elements[i]].GetName();
103 }
104 return source.GetText("textBenefit") + (IsEyth ? "" : "textBenefit".lang(text));
105 }
Definition: Lang.cs:6
static string space
Definition: Lang.cs:32
bool IsEyth
Definition: Religion.cs:44

References SourceManager.elements, IsEyth, source, EClass.sources, and Lang.space.

Referenced by DramaActor.ConvertAdv().

◆ GetTextTemper()

string Religion.GetTextTemper ( int  _temper = -99999)
inline

Definition at line 107 of file Religion.cs.

108 {
109 if (IsEyth)
110 {
111 return "-";
112 }
113 if (_temper == -99999)
114 {
115 _temper = mood;
116 }
117 string[] list = Lang.GetList("temper");
118 if (_temper <= -85)
119 {
120 return list[0].ToTitleCase().TagColor(FontColor.Bad);
121 }
122 if (_temper <= -45)
123 {
124 return list[1].ToTitleCase().TagColor(FontColor.Bad);
125 }
126 if (_temper <= -15)
127 {
128 return list[2].ToTitleCase();
129 }
130 if (_temper < 15)
131 {
132 return list[3].ToTitleCase();
133 }
134 if (_temper < 45)
135 {
136 return list[4].ToTitleCase();
137 }
138 if (_temper < 85)
139 {
140 return list[5].ToTitleCase().TagColor(FontColor.Great);
141 }
142 return list[6].ToTitleCase().TagColor(FontColor.Good);
143 }
FontColor
Definition: FontColor.cs:2
static string[] GetList(string id)
Definition: Lang.cs:114
int mood
Definition: Religion.cs:20

References Lang.GetList(), IsEyth, and mood.

Referenced by UIHomeInfo.RefreshInfo().

◆ Init()

void Religion.Init ( )
inline

Definition at line 59 of file Religion.cs.

60 {
61 relation = source.relation;
62 }
int relation
Definition: Religion.cs:14

References relation, and source.

◆ IsValidArtifact()

bool Religion.IsValidArtifact ( string  id)
inline

Definition at line 275 of file Religion.cs.

276 {
277 return this == GetArtifactDeity(id);
278 }
static Religion GetArtifactDeity(string id)
Definition: Religion.cs:255

References GetArtifactDeity().

Referenced by TraitAltar.CanOffer().

◆ JoinFaith()

void Religion.JoinFaith ( Chara  c,
ConvertType  type = ConvertType::Default 
)
inline

Definition at line 387 of file Religion.cs.

388 {
389 if (!c.IsPC)
390 {
391 c.faith = this;
393 EClass.Sound.Play("worship");
394 Msg.Say("changeFaith", c, Name);
395 return;
396 }
397 if (c.faith != this)
398 {
399 c.faith.LeaveFaith(c, this, type);
400 }
401 if (type != ConvertType.Campaign)
402 {
403 EClass.pc.c_daysWithGod = 0;
404 }
405 Msg.Say("worship", Name);
406 Talk("worship", c);
407 EClass.Sound.Play("worship");
408 c.PlayEffect("aura_heaven");
409 c.faith = this;
410 OnJoinFaith();
411 if (IsEyth)
412 {
413 mood = 0;
414 }
415 else
416 {
417 mood = 50;
418 }
420 if (!c.HasElement(306))
421 {
422 c.elements.Learn(306);
423 }
424 if (!c.IsPC)
425 {
426 return;
427 }
429 if (EClass._zone.lv == 0)
430 {
431 if (EClass._zone is Zone_Mifu)
432 {
433 EClass._map.config.blossom = EClass.pc.faith == EClass.game.religions.Trickery;
435 }
436 if (EClass._zone is Zone_Nefu)
437 {
438 EClass._map.config.blossom = EClass.pc.faith == EClass.game.religions.MoonShadow;
440 }
441 if (EClass._zone is Zone_Aquli)
442 {
443 EClass._map.config.fixedCondition = ((EClass.pc.faith == EClass.game.religions.Strife) ? Weather.Condition.Ether : Weather.Condition.None);
445 }
446 }
448 }
virtual void RefreshWeather()
ElementContainerCard elements
Definition: Card.cs:42
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6348
void PurgeEythArtifact()
Definition: Card.cs:3303
Faction faction
Definition: Chara.cs:429
override bool IsPC
Definition: Chara.cs:614
void RefreshFaithElement()
Definition: Chara.cs:10184
Religion faith
Definition: Chara.cs:441
static Zone _zone
Definition: EClass.cs:21
static BaseGameScreen screen
Definition: EClass.cs:33
static Chara pc
Definition: EClass.cs:15
static SoundManager Sound
Definition: EClass.cs:47
void Learn(int ele, int v=1)
ElementContainerFaction charaElements
Definition: FACTION.cs:146
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
string Name
Definition: Religion.cs:30
virtual void OnJoinFaith()
Definition: Religion.cs:557
ConvertType
Definition: Religion.cs:8
void LeaveFaith(Chara c, Religion newFaith, ConvertType type)
Definition: Religion.cs:450
void Talk(string idTalk, Card c=null, Card agent=null)
Definition: Religion.cs:153
int lv
Definition: Spatial.cs:142
Condition
Definition: Weather.cs:16

References EClass._zone, Faction.charaElements, Card.elements, Chara.faction, Chara.faith, EClass.game, Card.HasElement(), IsEyth, Chara.IsPC, ElementContainer.Learn(), LeaveFaith(), Spatial.lv, mood, ReligionManager.MoonShadow, Name, ElementContainerFaction.OnJoinFaith(), OnJoinFaith(), EClass.pc, Card.PlayEffect(), Card.PurgeEythArtifact(), Chara.RefreshFaithElement(), BaseGameScreen.RefreshWeather(), Game.religions, Msg.Say(), EClass.screen, EClass.Sound, ReligionManager.Strife, Talk(), and ReligionManager.Trickery.

Referenced by DramaOutcome.convert_Jure().

◆ LeaveFaith()

void Religion.LeaveFaith ( Chara  c,
Religion  newFaith,
ConvertType  type 
)
inline

Definition at line 450 of file Religion.cs.

451 {
452 if (!IsEyth)
453 {
454 bool flag = (newFaith == EClass.game.religions.Trickery && this == EClass.game.religions.MoonShadow) || (newFaith == EClass.game.religions.MoonShadow && this == EClass.game.religions.Trickery);
455 if (c.IsPC)
456 {
457 Msg.Say("worship2");
458 if (!flag && type != ConvertType.Campaign)
459 {
460 Punish(c);
461 }
462 }
463 if (flag)
464 {
465 Talk("regards");
466 c.elements.SetBase(85, c.Evalue(85) / 2);
467 }
468 else
469 {
470 c.elements.SetBase(85, 0);
471 }
472 }
473 if (c.IsPC)
474 {
476 }
477 OnLeaveFaith();
479 }
int Evalue(int ele)
Definition: Card.cs:2574
Element SetBase(string alias, int v, int potential=0)
virtual void OnLeaveFaith()
Definition: Religion.cs:561

References Faction.charaElements, Card.elements, Card.Evalue(), Chara.faction, EClass.game, IsEyth, Chara.IsPC, ReligionManager.MoonShadow, ElementContainerFaction.OnLeaveFaith(), OnLeaveFaith(), EClass.pc, Punish, Chara.RefreshFaithElement(), Game.religions, Msg.Say(), ElementContainer.SetBase(), Talk(), and ReligionManager.Trickery.

Referenced by JoinFaith().

◆ OnAdvanceDay()

void Religion.OnAdvanceDay ( )
inline

Definition at line 68 of file Religion.cs.

69 {
70 }

◆ OnBecomeBranchFaith()

virtual void Religion.OnBecomeBranchFaith ( )
inlinevirtual

Reimplemented in ReligionEarth, ReligionHealing, and ReligionLuck.

Definition at line 383 of file Religion.cs.

384 {
385 }

◆ OnChangeHour()

void Religion.OnChangeHour ( )
inline

Definition at line 565 of file Religion.cs.

566 {
567 if (IsEyth)
568 {
569 mood = 0;
570 }
571 else
572 {
573 mood = EClass.rnd(200) - 100;
574 }
575 }
static int rnd(long a)
Definition: EClass.cs:59

References IsEyth, mood, and EClass.rnd().

Referenced by Player.OnAdvanceHour().

◆ OnJoinFaith()

virtual void Religion.OnJoinFaith ( )
inlinevirtual

Definition at line 557 of file Religion.cs.

558 {
559 }

Referenced by JoinFaith().

◆ OnLeaveFaith()

virtual void Religion.OnLeaveFaith ( )
inlinevirtual

Definition at line 561 of file Religion.cs.

562 {
563 }

Referenced by LeaveFaith().

◆ OnLoad()

void Religion.OnLoad ( )
inline

Definition at line 64 of file Religion.cs.

65 {
66 }

Referenced by ReligionManager.OnLoad().

◆ Punish()

void Religion.Punish ( Chara  c)
inline

Definition at line 481 of file Religion.cs.

482 {
483 if (c.mimicry != null)
484 {
485 c.mimicry.Kill();
486 }
487 Talk("wrath");
488 if (c.Evalue(1228) > 0)
489 {
491 return;
492 }
493 c.hp = 1;
494 c.mana.value = 1;
495 c.stamina.value = 1;
496 if (c.HasCondition<ConWrath>())
497 {
498 recentWrath = this;
499 c.DamageHP(999999L, AttackSource.Wrath);
500 recentWrath = null;
501 return;
502 }
503 Thing thing = ThingGen.Create("punish_ball");
504 int num = 0;
506 {
507 if (item.giftRank > 0)
508 {
509 num++;
510 }
511 }
512 if (num >= 4)
513 {
514 thing.idSkin = 1;
515 }
516 thing.ChangeWeight(EClass.pc.WeightLimit / 4 + 1000);
517 c.AddThing(thing);
518 c.AddCondition<ConWrath>(2000 + (c.IsPC ? (EClass.pc.c_daysWithGod * 20) : 0));
519 }
AttackSource
Definition: AttackSource.cs:2
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3123
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:4088
void ChangeWeight(int a)
Definition: Card.cs:2567
void SayNothingHappans()
Definition: Card.cs:6986
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9231
bool HasCondition(string alias)
Definition: Chara.cs:9392
override int WeightLimit
Definition: Chara.cs:712
ConTransmuteMimic mimicry
Definition: Chara.cs:106
void Kill(bool silent=false)
Definition: Condition.cs:91
List< Religion > list
static Religion recentWrath
Definition: Religion.cs:22
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8

References Card.ChangeWeight(), ThingGen.Create(), Card.DamageHP(), Card.Evalue(), EClass.game, Chara.HasCondition(), item, Condition.Kill(), ReligionManager.list, Chara.mimicry, EClass.pc, recentWrath, Game.religions, Card.SayNothingHappans(), Talk(), and Chara.WeightLimit.

◆ PunishTakeOver()

void Religion.PunishTakeOver ( Chara  c)
inline

Definition at line 521 of file Religion.cs.

522 {
523 if (c.mimicry != null)
524 {
525 c.mimicry.Kill();
526 }
527 Talk("takeoverFail");
528 if (c.Evalue(1228) > 0)
529 {
531 return;
532 }
533 c.hp /= 2;
534 if (c.mana.value > 0)
535 {
536 c.mana.value = c.mana.value / 2;
537 }
538 if (c.stamina.value > 0)
539 {
540 c.stamina.value = c.stamina.value / 2;
541 }
542 if (c.HasCondition<ConWrath>())
543 {
544 recentWrath = this;
545 c.DamageHP(999999L, AttackSource.Wrath);
546 recentWrath = null;
547 return;
548 }
549 Thing thing = ThingGen.Create("punish_ball");
550 thing.c_weight = EClass.pc.WeightLimit / 4 + 1000;
551 thing.isWeightChanged = true;
552 thing.SetDirtyWeight();
553 c.AddThing(thing);
554 c.AddCondition<ConWrath>(200);
555 }
void SetDirtyWeight()
Definition: Card.cs:2557
Stats mana
Definition: Chara.cs:1156
Stats stamina
Definition: Chara.cs:1148
virtual int value
Definition: Stats.cs:56

References Chara.AddCondition(), Card.AddThing(), ThingGen.Create(), Card.DamageHP(), Card.Evalue(), Chara.HasCondition(), Condition.Kill(), Chara.mana, Chara.mimicry, recentWrath, Card.SayNothingHappans(), Card.SetDirtyWeight(), Chara.stamina, Talk(), and Stats.value.

Referenced by TraitAltar.OnOffer().

◆ Reforge()

static Thing Religion.Reforge ( string  id,
Point  pos = null,
bool  first = true 
)
inlinestatic

Definition at line 280 of file Religion.cs.

281 {
282 if (pos == null)
283 {
284 pos = EClass.pc.pos.Copy();
285 }
286 pos.Set(pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: false, ignoreCenter: true) ?? pos);
287 Thing thing = ThingGen.Create(id);
288 foreach (Element value in thing.elements.dict.Values)
289 {
290 if (value.id == 66 || value.id == 67 || value.id == 64 || value.id == 65 || value.id == 92)
291 {
292 continue;
293 }
294 switch (id)
295 {
296 case "gun_mani":
297 thing.c_idDeity = EClass.game.religions.Machine.id;
298 break;
299 case "cloak_mani":
300 if (value.id == 427 || value.id == 957 || value.id == 105 || value.id == 466 || value.id == 664)
301 {
302 value.vExp = -1;
303 }
304 thing.c_idDeity = EClass.game.religions.Machine.id;
305 break;
306 case "scythe_kumi":
307 if (value.id == 6650 || value.id == 480 || value.id == 959 || value.id == 428 || value.id == 640 || value.id == 665)
308 {
309 value.vExp = -1;
310 }
311 thing.c_idDeity = EClass.game.religions.Harvest.id;
312 break;
313 case "blunt_earth":
314 if (value.id == 70 || value.id == 55 || value.id == 56 || value.id == 954 || value.id == 423 || value.id == 421)
315 {
316 value.vExp = -1;
317 }
318 thing.c_idDeity = EClass.game.religions.Earth.id;
319 break;
320 case "luckydagger":
321 if (value.id != 426)
322 {
323 value.vExp = -1;
324 }
325 thing.c_idDeity = EClass.game.religions.Luck.id;
326 break;
327 case "staff_element":
328 if (value.id == 411 || (value is Resistance && value.id != 959))
329 {
330 value.vExp = -1;
331 }
332 thing.c_idDeity = EClass.game.religions.Element.id;
333 break;
334 case "windbow":
335 thing.c_idDeity = EClass.game.religions.Wind.id;
336 break;
337 case "shirt_wind":
338 if (!(value is Resistance) && value.id != 226 && value.id != 152 && value.id != 77)
339 {
340 value.vExp = -1;
341 }
342 thing.c_idDeity = EClass.game.religions.Wind.id;
343 break;
344 case "pole_holy":
345 if (value.id == 60 || value.id == 461 || value.id == 423)
346 {
347 value.vExp = -1;
348 }
349 thing.c_idDeity = EClass.game.religions.Healing.id;
350 break;
351 case "sword_muramasa2":
352 if (value.id == 401 || value.id == 916 || value.id == 661)
353 {
354 value.vExp = -1;
355 }
356 thing.c_idDeity = EClass.game.religions.MoonShadow.id;
357 break;
358 case "kogitsunemaru":
359 if (value.id != 656)
360 {
361 value.vExp = -1;
362 }
363 thing.c_idDeity = EClass.game.religions.Trickery.id;
364 break;
365 case "warmonger":
366 if (value.id == 468 || value.id == 423 || value.id == 463 || value.id == 460 || value.id == 464 || value.id == 465)
367 {
368 value.vExp = -1;
369 }
370 thing.c_idDeity = EClass.game.religions.Strife.id;
371 break;
372 }
373 }
374 EClass._zone.AddCard(thing, pos);
375 pos.PlayEffect("aura_heaven");
376 if (first)
377 {
378 pos.PlaySound("godbless");
379 }
380 return thing;
381 }
Point pos
Definition: Card.cs:60
Dictionary< int, Element > dict
int id
Definition: ELEMENT.cs:255
Point Copy()
Definition: Point.cs:491
Point Set(int _x, int _z)
Definition: Point.cs:503
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:619
override string id
Definition: ReligionEarth.cs:3
override string id
override string id
override string id
override string id
Definition: ReligionLuck.cs:3
override string id
override string id
override string id
override string id
override string id
Definition: ReligionWind.cs:3
Card AddCard(Card t, Point point)
Definition: Zone.cs:1998

References EClass._zone, Zone.AddCard(), Point.Copy(), ThingGen.Create(), ReligionManager.Earth, ReligionManager.Element, EClass.game, ReligionManager.Harvest, ReligionManager.Healing, Element.id, ReligionEarth.id, ReligionElement.id, ReligionHarvest.id, ReligionHealing.id, ReligionLuck.id, ReligionMachine.id, ReligionMoonShadow.id, ReligionStrife.id, ReligionTrickery.id, ReligionWind.id, ReligionManager.Luck, ReligionManager.Machine, ReligionManager.MoonShadow, EClass.pc, Card.PlayEffect(), Card.pos, Game.religions, Point.Set(), ReligionManager.Strife, ReligionManager.Trickery, and ReligionManager.Wind.

Referenced by TraitAltar.OnOffer(), TryGetGift(), and ActEffect.Wish().

◆ Revelation()

void Religion.Revelation ( string  idTalk,
int  chance = 100 
)
inline

Definition at line 145 of file Religion.cs.

146 {
147 if (!IsEyth && EClass.rnd(100) <= chance)
148 {
149 Talk(idTalk, EClass.pc);
150 }
151 }

References IsEyth, EClass.pc, EClass.rnd(), and Talk().

Referenced by Chara.Die(), Scene.Init(), ActPray.Pray(), and LayerSleep.Sleep().

◆ SetTextRelation()

void Religion.SetTextRelation ( UIText  text)
inline

Definition at line 77 of file Religion.cs.

78 {
79 if (relation > 100)
80 {
81 text.SetText("reFriend".lang(), FontColor.Good);
82 }
83 else if (relation < -100)
84 {
85 text.SetText("reEnemy".lang(), FontColor.Bad);
86 }
87 else
88 {
89 text.SetText("reNone".lang(), FontColor.Passive);
90 }
91 }
void SetText(string s)
Definition: UIText.cs:159

References relation, and UIText.SetText().

Referenced by ContentFaction.RefreshFactions().

◆ Talk()

void Religion.Talk ( string  idTalk,
Card  c = null,
Card  agent = null 
)
inline

Definition at line 153 of file Religion.cs.

154 {
155 if (!IsEyth)
156 {
158 Msg.Say("<i>" + GetGodTalk(idTalk) + " </i>", c ?? EClass.pc);
159 }
160 }
Color TalkGod
Definition: MsgColors.cs:9
static MsgColors colors
Definition: Msg.cs:20
static void SetColor()
Definition: Msg.cs:22
string GetGodTalk(string suffix)
Definition: Religion.cs:162

References Msg.colors, GetGodTalk(), IsEyth, EClass.pc, Msg.Say(), Msg.SetColor(), and MsgColors.TalkGod.

Referenced by TraitAltar._OnOffer(), TraitGodStatue._OnUse(), JoinFaith(), LeaveFaith(), ActEffect.Proc(), Punish(), PunishTakeOver(), Revelation(), TraitAltar.TakeOver(), CoreDebug.Test_GodTalk(), and TryGetGift().

◆ TryGetGift()

bool Religion.TryGetGift ( )
inline

Definition at line 222 of file Religion.cs.

223 {
224 if (IsEyth || source.rewards.Length == 0)
225 {
226 return false;
227 }
228 Point point = EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: false) ?? EClass.pc.pos;
229 int num = EClass.pc.Evalue(85);
230 if (giftRank == 0 && (num >= 15 || EClass.debug.enable))
231 {
232 Talk("pet");
233 Chara chara = CharaGen.Create(source.rewards[0]);
234 EClass._zone.AddCard(chara, point);
235 chara.MakeAlly();
236 chara.PlayEffect("aura_heaven");
237 giftRank = 1;
238 return true;
239 }
240 if (source.rewards.Length >= 2 && giftRank == 1 && (num >= 30 || EClass.debug.enable))
241 {
242 Talk("gift");
243 string[] array = source.rewards[1].Split('|');
244 string[] array2 = array;
245 foreach (string text in array2)
246 {
247 Reforge(text, point, text == array[0]);
248 }
249 giftRank = 2;
250 return true;
251 }
252 return false;
253 }
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Definition: Chara.cs:10
void MakeAlly(bool msg=true)
Definition: Chara.cs:2294
bool enable
Definition: CoreDebug.cs:286
static CoreDebug debug
Definition: EClass.cs:49
Definition: Point.cs:9
int giftRank
Definition: Religion.cs:17
static Thing Reforge(string id, Point pos=null, bool first=true)
Definition: Religion.cs:280

References EClass._zone, Zone.AddCard(), CharaGen.Create(), EClass.debug, CoreDebug.enable, Card.Evalue(), Point.GetNearestPoint(), giftRank, IsEyth, Chara.MakeAlly(), EClass.pc, Card.PlayEffect(), Card.pos, Reforge(), source, and Talk().

Member Data Documentation

◆ _source

SourceReligion.Row Religion._source

Definition at line 24 of file Religion.cs.

◆ giftRank

int Religion.giftRank

Definition at line 17 of file Religion.cs.

Referenced by TryGetGift().

◆ mood

int Religion.mood

Definition at line 20 of file Religion.cs.

Referenced by GetTextTemper(), JoinFaith(), and OnChangeHour().

◆ recentWrath

Religion Religion.recentWrath
static

Definition at line 22 of file Religion.cs.

Referenced by Chara.Die(), Punish(), and PunishTakeOver().

◆ relation

int Religion.relation

Definition at line 14 of file Religion.cs.

Referenced by Init(), UIFactionInfo.SetReligion(), and SetTextRelation().

Property Documentation

◆ CanJoin

virtual bool Religion.CanJoin
get

Definition at line 52 of file Religion.cs.

Referenced by ReligionManager.GetRandomReligion(), and TraitAltar.TrySetAct().

◆ id

◆ IsAvailable

virtual bool Religion.IsAvailable
get

Definition at line 28 of file Religion.cs.

Referenced by LayerFaith.AddReligion().

◆ IsEhekatl

bool Religion.IsEhekatl
get

Definition at line 46 of file Religion.cs.

◆ IsEyth

◆ IsMinorGod

virtual bool Religion.IsMinorGod
get

◆ IsOpatos

bool Religion.IsOpatos
get

Definition at line 48 of file Religion.cs.

◆ Name

◆ NameDomain

string Religion.NameDomain
get

Definition at line 36 of file Religion.cs.

◆ NameShort

string Religion.NameShort
get

Definition at line 34 of file Religion.cs.

Referenced by Chara.Die().

◆ source

◆ TextGodGender

string Religion.TextGodGender
get

Definition at line 40 of file Religion.cs.

Referenced by TraitAltar._OnOffer(), and TraitAltar.OnOffer().

◆ TextMood

string Religion.TextMood
get

Definition at line 42 of file Religion.cs.

Referenced by WidgetStatsBar.Build().

◆ TextType

string Religion.TextType
get

Definition at line 38 of file Religion.cs.

Referenced by ContentFaction.RefreshFactions().


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