Elin Decompiled Documentation EA 23.240 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);
28 EClass.pc.Pick(t);
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)) + ((!EClass.debug.showExtra) ? "" : (Environment.NewLine + phase + "/" + gaveBill + "/" + paid + "/" + stage));
40 }
41
42 public bool CanGiveBill()
43 {
44 return stage < 7;
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:
87 {
88 EClass.player.flags.gotLoytelMart = true;
89 EClass.player.DropReward(ThingGen.Create("loytel_mart"));
90 }
91 break;
92 case 6:
93 EClass.player.flags.loytelMartLv = 1;
94 Msg.Say("upgradeLoytelMart");
95 break;
96 case 7:
97 EClass.player.flags.loytelMartLv = 2;
98 Msg.Say("upgradeLoytelMart");
99 break;
100 }
101 }
102
103 public string GetIdTalk_GiveBill()
104 {
105 if (stage != 0)
106 {
107 return "loytel_bill_give2";
108 }
109 return "loytel_bill_give1";
110 }
111}
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:2610
Definition: Chara.cs:10
Party party
Definition: Chara.cs:43
FactionBranch homeBranch
Definition: Chara.cs:1066
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:4263
bool showExtra
Definition: CoreDebug.cs:168
Definition: EClass.cs:6
static Game game
Definition: EClass.cs:9
static Player player
Definition: EClass.cs:13
static Chara pc
Definition: EClass.cs:15
static CoreDebug debug
Definition: EClass.cs:49
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:57
bool gotLoytelMart
Definition: Player.cs:551
int debt
Definition: Player.cs:947
Flags flags
Definition: Player.cs:1094
Thing DropReward(Thing t, bool silent=false)
Definition: Player.cs:2542
int GetBillAmount()
Definition: QuestDebt.cs:47
bool paid
Definition: QuestDebt.cs:10
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:103
bool gaveBill
Definition: QuestDebt.cs:7
void GiveBill()
Definition: QuestDebt.cs:58
int stage
Definition: QuestDebt.cs:13
bool IsValidBill(Thing t)
Definition: QuestDebt.cs:52
void GiveReward()
Definition: QuestDebt.cs:67
override void OnStart()
Definition: QuestDebt.cs:15
int phase
Definition: Quest.cs:40
Chara chara
Definition: Quest.cs:105
static Thing CreateCassette(int id)
Definition: ThingGen.cs:230
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8