Elin Decompiled Documentation EA 23.153 Nightly
Loading...
Searching...
No Matches
QuestDebt.cs
Go to the documentation of this file.
1using System;
2using Newtonsoft.Json;
3
5{
6 [JsonProperty]
7 public bool gaveBill;
8
9 [JsonProperty]
10 public bool paid;
11
12 [JsonProperty]
13 public int stage;
14
15 public override void OnStart()
16 {
18 if (chara.homeBranch != null)
19 {
21 }
24 chara.homeZone = EClass.pc.homeBranch.owner;
25 chara.noMove = false;
26 chara.RemoveEditorTag(EditorTag.Invulnerable);
27 Thing thing = ThingGen.Create("856");
28 thing.refVal = 109;
29 EClass.pc.Pick(thing);
30 }
31
32 public override bool CanUpdateOnTalk(Chara c)
33 {
34 _ = phase;
35 return false;
36 }
37
38 public override string GetTextProgress()
39 {
40 return "progressDebt".lang(Lang._currency(EClass.player.debt, showUnit: true)) + ((!EClass.debug.showExtra) ? "" : (Environment.NewLine + phase + "/" + gaveBill + "/" + paid + "/" + stage));
41 }
42
43 public bool CanGiveBill()
44 {
45 return stage < 7;
46 }
47
48 public int GetBillAmount()
49 {
50 return (new int[10] { 1, 3, 6, 10, 30, 50, 100, 300, 500, 1000 })[stage] * 10000;
51 }
52
53 public bool IsValidBill(Thing t)
54 {
55 int billAmount = GetBillAmount();
56 return t.c_bill == billAmount;
57 }
58
59 public void GiveBill()
60 {
61 Thing thing = ThingGen.Create("bill_debt");
62 thing.c_bill = GetBillAmount();
63 thing.c_isImportant = true;
65 gaveBill = true;
66 }
67
68 public void GiveReward()
69 {
70 gaveBill = false;
71 paid = false;
72 switch (stage)
73 {
74 case 1:
75 EClass.player.DropReward(ThingGen.Create("ticket_massage"));
76 break;
77 case 2:
78 EClass.player.DropReward(ThingGen.Create("ticket_armpillow"));
79 break;
80 case 3:
81 EClass.player.DropReward(ThingGen.Create("ticket_champagne"));
82 break;
83 case 4:
84 EClass.player.DropReward(ThingGen.Create("ticket_resident"));
85 break;
86 case 5:
88 {
89 EClass.player.flags.gotLoytelMart = true;
90 EClass.player.DropReward(ThingGen.Create("loytel_mart"));
91 }
92 break;
93 case 6:
94 EClass.player.flags.loytelMartLv = 1;
95 Msg.Say("upgradeLoytelMart");
96 break;
97 case 7:
98 EClass.player.flags.loytelMartLv = 2;
99 Msg.Say("upgradeLoytelMart");
100 break;
101 }
102 }
103
104 public string GetIdTalk_GiveBill()
105 {
106 if (stage != 0)
107 {
108 return "loytel_bill_give2";
109 }
110 return "loytel_bill_give1";
111 }
112}
EditorTag
Definition: EditorTag.cs:2
Chara Find(string id)
Definition: CardManager.cs:20
GlobalCharaList globalCharas
Definition: CardManager.cs:46
void RemoveEditorTag(EditorTag tag)
Definition: Card.cs:2546
Definition: Chara.cs:10
Party party
Definition: Chara.cs:43
FactionBranch homeBranch
Definition: Chara.cs:932
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:4017
bool showExtra
Definition: CoreDebug.cs:167
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
static CoreDebug debug
Definition: EClass.cs:48
void RemoveMemeber(Chara c)
void AddMemeber(Chara c)
CardManager cards
Definition: Game.cs:155
Definition: Lang.cs:6
static string _currency(object a, string IDCurrency)
Definition: Lang.cs:162
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
void AddMemeber(Chara c, bool showMsg=false)
Definition: Party.cs:56
bool gotLoytelMart
Definition: Player.cs:438
int debt
Definition: Player.cs:766
Flags flags
Definition: Player.cs:910
Thing DropReward(Thing t, bool silent=false)
Definition: Player.cs:2342
int GetBillAmount()
Definition: QuestDebt.cs:48
bool paid
Definition: QuestDebt.cs:10
override bool CanUpdateOnTalk(Chara c)
Definition: QuestDebt.cs:32
override string GetTextProgress()
Definition: QuestDebt.cs:38
bool CanGiveBill()
Definition: QuestDebt.cs:43
string GetIdTalk_GiveBill()
Definition: QuestDebt.cs:104
bool gaveBill
Definition: QuestDebt.cs:7
void GiveBill()
Definition: QuestDebt.cs:59
int stage
Definition: QuestDebt.cs:13
bool IsValidBill(Thing t)
Definition: QuestDebt.cs:53
void GiveReward()
Definition: QuestDebt.cs:68
override void OnStart()
Definition: QuestDebt.cs:15
int phase
Definition: Quest.cs:40
Chara chara
Definition: Quest.cs:105
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8