Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
QuestDebt.cs
Go to the documentation of this file.
1using Newtonsoft.Json;
2
4{
5 [JsonProperty]
6 public bool gaveBill;
7
8 [JsonProperty]
9 public bool paid;
10
11 [JsonProperty]
12 public int stage;
13
14 public override void OnStart()
15 {
17 if (chara.homeBranch != null)
18 {
20 }
23 chara.homeZone = EClass.pc.homeBranch.owner;
24 chara.noMove = false;
25 chara.RemoveEditorTag(EditorTag.Invulnerable);
26 Thing thing = ThingGen.Create("856");
27 thing.refVal = 109;
28 EClass.pc.Pick(thing);
29 }
30
31 public override bool CanUpdateOnTalk(Chara c)
32 {
33 _ = phase;
34 return false;
35 }
36
37 public override string GetTextProgress()
38 {
39 return "progressDebt".lang(Lang._currency(EClass.player.debt, showUnit: true));
40 }
41
42 public bool CanGiveBill()
43 {
44 return stage < 6;
45 }
46
47 public int GetBillAmount()
48 {
49 return (new int[10] { 1, 3, 6, 10, 30, 50, 100, 300, 500, 1000 })[stage] * 10000;
50 }
51
52 public bool IsValidBill(Thing t)
53 {
54 int billAmount = GetBillAmount();
55 return t.c_bill == billAmount;
56 }
57
58 public void GiveBill()
59 {
60 Thing thing = ThingGen.Create("bill_debt");
61 thing.c_bill = GetBillAmount();
62 thing.c_isImportant = true;
64 gaveBill = true;
65 }
66
67 public void GiveReward()
68 {
69 gaveBill = false;
70 paid = false;
71 switch (stage)
72 {
73 case 1:
74 EClass.player.DropReward(ThingGen.Create("ticket_massage"));
75 break;
76 case 2:
77 EClass.player.DropReward(ThingGen.Create("ticket_armpillow"));
78 break;
79 case 3:
80 EClass.player.DropReward(ThingGen.Create("ticket_champagne"));
81 break;
82 case 4:
83 EClass.player.DropReward(ThingGen.Create("ticket_resident"));
84 break;
85 case 5:
86 EClass.player.DropReward(ThingGen.Create("loytel_mart"));
87 break;
88 case 6:
89 EClass.player.flags.loytelMartLv = 1;
90 Msg.Say("upgradeLoytelMart");
91 break;
92 }
93 }
94
95 public string GetIdTalk_GiveBill()
96 {
97 if (stage != 0)
98 {
99 return "loytel_bill_give2";
100 }
101 return "loytel_bill_give1";
102 }
103}
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:2470
Definition: Chara.cs:10
Party party
Definition: Chara.cs:43
FactionBranch homeBranch
Definition: Chara.cs:889
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:3920
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
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:51
int debt
Definition: Player.cs:754
Thing DropReward(Thing t, bool silent=false)
Definition: Player.cs:2320
int GetBillAmount()
Definition: QuestDebt.cs:47
bool paid
Definition: QuestDebt.cs:9
override bool CanUpdateOnTalk(Chara c)
Definition: QuestDebt.cs:31
override string GetTextProgress()
Definition: QuestDebt.cs:37
bool CanGiveBill()
Definition: QuestDebt.cs:42
string GetIdTalk_GiveBill()
Definition: QuestDebt.cs:95
bool gaveBill
Definition: QuestDebt.cs:6
void GiveBill()
Definition: QuestDebt.cs:58
int stage
Definition: QuestDebt.cs:12
bool IsValidBill(Thing t)
Definition: QuestDebt.cs:52
void GiveReward()
Definition: QuestDebt.cs:67
override void OnStart()
Definition: QuestDebt.cs:14
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