10 public virtual string id
20 public virtual bool IsAvailable
31 return EClass.sources.elements.alias[
"featGod_" + this.id + i.ToString()];
40 return this.source.GetName();
51 if ((result = this._source) ==
null)
53 result = (this._source =
EClass.sources.religions.map[this.id]);
61 public string NameShort
65 return this.source.GetTextArray(
"name2")[1];
71 public string NameDomain
75 return this.source.GetTextArray(
"name2")[0];
81 public string TextType
85 return (
"sub_" + this.source.type).lang();
91 public string TextGodGender
95 return this.source.GetText(
"textType",
false);
101 public string TextMood
105 return this.GetTextTemper(-99999);
115 return this.id ==
"eyth";
121 public bool IsEhekatl
125 return this.id ==
"luck";
135 return this.id ==
"earth";
141 public virtual bool IsMinorGod
151 public virtual bool CanJoin
162 this.relation = this.source.relation;
171 public void OnAdvanceDay()
176 public Sprite GetSprite()
178 return ResourceCache.Load<Sprite>(
"Media/Graphics/Image/Faction/" + this.source.id) ?? ResourceCache.Load<Sprite>(
"Media/Graphics/Image/Faction/eyth");
182 public void SetTextRelation(UIText text)
184 if (this.relation > 100)
186 text.SetText(
"reFriend".lang(), FontColor.Good);
189 if (this.relation < -100)
191 text.SetText(
"reEnemy".lang(), FontColor.Bad);
194 text.SetText(
"reNone".lang(), FontColor.Passive);
198 public string GetTextBenefit()
201 for (
int i = 0; i < this.source.elements.Length; i += 2)
205 text = text + Lang.words.comma.ToString() + Lang.space;
207 text +=
EClass.sources.elements.map[this.source.elements[i]].GetName();
209 return this.source.GetText(
"textBenefit",
false) + (this.IsEyth ?
"" :
"textBenefit".lang(text,
null,
null,
null,
null));
213 public string GetTextTemper(
int _temper = -99999)
219 if (_temper == -99999)
223 string[] list = Lang.GetList(
"temper");
226 return list[0].ToTitleCase(
false).TagColor(FontColor.Bad,
null);
230 return list[1].ToTitleCase(
false).TagColor(FontColor.Bad,
null);
234 return list[2].ToTitleCase(
false);
238 return list[3].ToTitleCase(
false);
242 return list[4].ToTitleCase(
false);
246 return list[5].ToTitleCase(
false).TagColor(FontColor.Great,
null);
248 return list[6].ToTitleCase(
false).TagColor(FontColor.Good,
null);
252 public void Revelation(
string idTalk,
int chance = 100)
254 if (this.IsEyth ||
EClass.rnd(100) > chance)
258 this.Talk(idTalk,
EClass.pc,
null);
262 public void Talk(
string idTalk,
Card c =
null,
Card agent =
null)
268 Msg.SetColor(
Msg.colors.TalkGod);
269 Msg.Say(
"<i>" + this.GetGodTalk(idTalk) +
" </i>", c ??
EClass.pc,
null,
null,
null);
273 public string GetGodTalk(
string suffix)
275 return EClass.sources.dataGodTalk.GetText(this.
id, suffix).Split(Environment.NewLine.ToCharArray()).RandomItem<
string>();
279 public int GetOfferingValue(
Thing t,
int num = -1)
286 if (t.source._origin ==
"meat")
288 num2 = Mathf.Clamp(t.SelfWeight / 10, 1, 1000);
292 foreach (
string text
in this.source.cat_offer)
294 if (t.category.IsChildOf(text))
296 num2 = Mathf.Clamp(t.SelfWeight / 10, 50, 1000);
297 num2 *=
EClass.sources.categories.map[text].offer / 100;
310 num2 *= (t.LV * 2 + 100) / 100;
311 return Mathf.Max(num2, 1) * num;
315 public bool TryGetGift()
317 if (this.IsEyth || this.source.rewards.Length == 0)
321 Point point =
EClass.pc.pos.GetNearestPoint(
false,
false,
false,
false) ??
EClass.pc.pos;
322 int num =
EClass.pc.Evalue(85);
323 if (this.giftRank == 0 && (num >= 15 ||
EClass.debug.enable))
325 this.Talk(
"pet",
null,
null);
327 EClass._zone.AddCard(chara, point);
328 chara.MakeAlly(
true);
329 chara.PlayEffect(
"aura_heaven",
true, 0f,
default(Vector3));
333 if (this.source.rewards.Length >= 2 &&
this.giftRank == 1 && (num >= 30 ||
EClass.debug.enable))
335 this.Talk(
"gift",
null,
null);
336 string[] array = this.source.rewards[1].Split(
'|', StringSplitOptions.None);
337 foreach (
string text
in array)
339 this.Reforge(text, point, text == array[0]);
348 public void Reforge(
string id,
Point pos =
null,
bool first =
true)
352 pos =
EClass.pc.pos.Copy();
354 pos.Set(pos.GetNearestPoint(
false,
false,
false,
true) ?? pos);
356 foreach (
Element element
in thing.elements.dict.Values)
358 if (element.id != 66 && element.id != 67 && element.id != 64 && element.id != 65 && element.id != 92)
360 uint num = <PrivateImplementationDetails>.ComputeStringHash(
id);
361 if (num <= 1934600421U)
363 if (num <= 968766664U)
365 if (num != 850586461U)
367 if (num == 968766664U)
369 if (
id ==
"sword_muramasa2")
371 if (element.id == 401 || element.id == 916 || element.id == 661)
378 else if (
id ==
"luckydagger")
380 if (element.id != 426)
386 else if (num != 1352297338U)
388 if (num != 1755407712U)
390 if (num == 1934600421U)
392 if (
id ==
"warmonger")
394 if (element.id == 423 || element.id == 463 || element.id == 460 || element.id == 464 || element.id == 465)
401 else if (
id ==
"scythe_kumi")
403 if (element.id == 6650 || element.id == 480 || element.id == 959 || element.id == 428 || element.id == 640 || element.id == 665)
409 else if (
id ==
"pole_holy")
411 if (element.id == 60 || element.id == 461 || element.id == 423)
417 else if (num <= 2931008955U)
419 if (num != 2376119426U)
421 if (num == 2931008955U)
423 if (
id ==
"kogitsunemaru")
425 if (element.id != 656)
432 else if (
id ==
"staff_element")
434 if (element.id == 411 || (element is
Resistance && element.id != 959))
440 else if (num != 3457783642U)
442 if (num != 3896459095U)
444 if (num == 3950410875U)
446 if (
id ==
"cloak_mani")
448 if (element.id == 427 || element.id == 957 || element.id == 105 || element.id == 466 || element.id == 664)
455 else if (
id ==
"blunt_earth")
457 if (element.id == 70 || element.id == 55 || element.id == 56 || element.id == 954 || element.id == 423 || element.id == 421)
463 else if (
id ==
"shirt_wind")
465 if (!(element is
Resistance) && element.id != 226 && element.id != 152 && element.id != 77)
472 thing.c_idDeity = this.source.id;
473 EClass._zone.AddCard(thing, pos);
474 pos.PlayEffect(
"aura_heaven");
477 pos.PlaySound(
"godbless",
true, 1f,
true);
482 public virtual void OnBecomeBranchFaith()
487 public void JoinFaith(
Chara c)
492 c.RefreshFaithElement();
493 EClass.Sound.Play(
"worship");
494 Msg.Say(
"changeFaith", c, this.Name,
null,
null);
499 c.faith.LeaveFaith(c);
501 EClass.pc.c_daysWithGod = 0;
502 Msg.Say(
"worship", this.Name,
null,
null,
null);
503 this.Talk(
"worship", c,
null);
504 EClass.Sound.Play(
"worship");
505 c.PlayEffect(
"aura_heaven",
true, 0f,
default(Vector3));
507 c.elements.SetBase(85, 0, 0);
517 c.RefreshFaithElement();
518 if (!c.HasElement(306, 1))
520 c.elements.Learn(306, 1);
524 EClass.pc.faction.charaElements.OnJoinFaith();
529 public void LeaveFaith(
Chara c)
542 EClass.pc.faction.charaElements.OnLeaveFaith();
545 c.RefreshFaithElement();
549 public void Punish(
Chara c)
551 this.Talk(
"wrath",
null,
null);
552 if (c.Evalue(1228) > 0)
554 c.SayNothingHappans();
561 thing.ChangeWeight(
EClass.pc.WeightLimit / 4 + 1000);
562 c.AddThing(thing,
true, -1, -1);
563 c.AddCondition<
ConWrath>(2000 + (c.IsPC ? (EClass.pc.c_daysWithGod * 20) : 0),
false);
567 public void PunishTakeOver(
Chara c)
569 this.Talk(
"takeoverFail",
null,
null);
570 if (c.Evalue(1228) > 0)
572 c.SayNothingHappans();
576 if (c.mana.value > 0)
578 c.mana.value = c.mana.value / 2;
580 if (c.stamina.value > 0)
582 c.stamina.value = c.stamina.value / 2;
585 thing.c_weight = EClass.pc.WeightLimit / 4 + 1000;
586 thing.isWeightChanged =
true;
587 thing.SetDirtyWeight();
588 c.AddThing(thing,
true, -1, -1);
589 c.AddCondition<
ConWrath>(200,
false);
593 public virtual void OnJoinFaith()
598 public virtual void OnLeaveFaith()
603 public void OnChangeHour()
610 this.mood =
EClass.rnd(200) - 100;