Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
QuestDeliver Class Reference
Inheritance diagram for QuestDeliver:
QuestDestZone QuestRandom Quest EClass QuestSupply QuestShowSupply QuestSupplyCat QuestSupplySpecific QuestMeal_cat QuestMeal QuestSupplyBulk QuestMeal_bread QuestMeal_cake QuestMeal_cookie QuestMeal_egg QuestMeal_fish QuestMeal_fruit QuestMeal_meat QuestMeal_noodle QuestMeal_rice QuestMeal_soup QuestMeal_vegi QuestSupplyBulkJunk QuestSupplyBulkResource

Public Member Functions

override int GetExtraMoney ()
 
override void OnInit ()
 
virtual int GetDestNum ()
 
virtual void SetIdThing ()
 
override void OnStart ()
 
virtual bool IsDestThing (Thing t)
 
List< ThingListDestThing (bool onlyFirst=false)
 
override Thing GetDestThing ()
 
override bool IsDeliverTarget (Chara c)
 
override bool CanDeliverToClient (Chara c)
 
override bool CanDeliverToBox (Thing t)
 
override bool Deliver (Chara c, Thing t=null)
 
virtual int GetBonus (Thing t)
 
override string GetTextProgress ()
 
override void OnEnterZone ()
 
- Public Member Functions inherited from QuestDestZone
void SetDest (Zone z, int target)
 
- Public Member Functions inherited from QuestRandom
override void OnDropReward ()
 
- Public Member Functions inherited from Quest
virtual Thing GetDestThing ()
 
virtual int GetExtraMoney ()
 
virtual int GetRewardPlat (int money)
 
override bool Equals (object obj)
 
virtual bool IsVisibleOnQuestBoard ()
 
virtual bool CanStartQuest ()
 
virtual bool CanUpdateOnTalk (Chara c)
 
virtual Zone CreateInstanceZone (Chara c)
 
virtual bool UpdateOnTalk ()
 
void Init ()
 
virtual void OnInit ()
 
Quest SetClient (Chara c, bool assignQuest=true)
 
void SetTask (QuestTask _task)
 
void Start ()
 
virtual void OnStart ()
 
virtual void OnEnterZone ()
 
virtual void OnClickQuest ()
 
void Fail ()
 
virtual void OnFail ()
 
virtual void ShowCompleteText ()
 
void Complete ()
 
virtual void OnBeforeComplete ()
 
virtual void OnDropReward ()
 
Thing DropReward (string id)
 
Thing DropReward (Thing t)
 
virtual void OnComplete ()
 
void CompleteTask ()
 
virtual void OnCompleteTask ()
 
virtual void OnGiveItem (Chara c, Thing t)
 
virtual void OnKillChara (Chara c)
 
virtual void OnModKarma (int a)
 
void NextPhase ()
 
void ChangePhase (int a)
 
virtual void OnChangePhase (int a)
 
string Parse (string s)
 
virtual string GetTitle ()
 
virtual string GetTrackerText ()
 
virtual string GetDetail (bool onJournal=false)
 
virtual string GetDetailText (bool onJournal=false)
 
virtual string GetTextProgress ()
 
string GetRewardText ()
 
virtual string GetTalkProgress ()
 
virtual string GetTalkComplete ()
 
void UpdateJournal ()
 
virtual bool IsDeliverTarget (Chara c)
 
virtual bool CanDeliverToClient (Chara c)
 
virtual bool CanDeliverToBox (Thing t)
 
virtual bool Deliver (Chara c, Thing t=null)
 

Public Attributes

string idThing
 
int num
 
- Public Attributes inherited from QuestDestZone
int uidDest
 
int uidTarget
 
- Public Attributes inherited from Quest
string id
 
int uid
 
int uidClientZone
 
int phase
 
int lv
 
int deadline
 
int difficulty
 
int rewardMoney
 
int bonusMoney
 
int startDate
 
int dangerLv
 
bool isNew
 
bool isComplete
 
bool track
 
Person person
 
QuestTask task
 
RefChara refChara = new RefChara()
 

Properties

virtual bool ConsumeGoods [get]
 
SourceThing.Row sourceThing [get]
 
override string NameDeliver [get]
 
override string RefDrama2 [get]
 
override int KarmaOnFail [get]
 
override DifficultyType difficultyType [get]
 
override bool ForbidTeleport [get]
 
- Properties inherited from QuestDestZone
virtual bool IsDeliver [get]
 
Zone DestZone [get]
 
override Chara DestChara [get]
 
override string??? RefDrama3 [get]
 
override string??? RefDrama4 [get]
 
- Properties inherited from QuestRandom
override bool CanAutoAdvance [get]
 
override bool IsRandomQuest [get]
 
override int RangeDeadLine [get]
 
override int KarmaOnFail [get]
 
override int FameOnComplete [get]
 
override string RefDrama1 [get]
 
- Properties inherited from Quest
Zone ClientZone [get]
 
Chara chara [get]
 
virtual SourceQuest.Row source [get]
 
bool Confetti [get]
 
bool IsExpired [get]
 
int Hours [get]
 
string TextDeadline [get]
 
virtual bool HasDLC [get]
 
virtual string idSource [get]
 
virtual string RewardSuffix [get]
 
virtual bool FameContent [get]
 
virtual string TextExtra [get]
 
virtual string TextExtra2 [get]
 
virtual int DangerLv [get]
 
virtual int AffinityGain [get]
 
virtual int BaseMoney [get]
 
virtual int KarmaOnFail [get]
 
virtual bool CanAbandon [get]
 
virtual int FameOnComplete [get]
 
virtual int RangeDeadLine [get]
 
virtual bool UseInstanceZone [get]
 
virtual bool ForbidTeleport [get]
 
virtual bool TrackOnStart [get]
 
virtual bool RequireClientInSameZone [get]
 
virtual DifficultyType difficultyType [get]
 
virtual Chara DestChara [get]
 
virtual string RefDrama1 [get]
 
virtual string RefDrama2 [get]
 
virtual string RefDrama3 [get]
 
virtual string RefDrama4 [get]
 
virtual string TitlePrefix [get]
 
virtual bool CanAutoAdvance [get]
 
virtual bool IsRandomQuest [get]
 
virtual string NameDeliver [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]
 

Private Member Functions

SourceCategory.Row GetDeliverCat ()
 

Static Private Attributes

static List< SourceCategory.Row_listDeliver = new List<SourceCategory.Row>()
 

Additional Inherited Members

- Public Types inherited from Quest
enum  DifficultyType {
  Default , Deliver , Supply , Escort ,
  Bulk , Meal , Farm , Music
}
 
enum  SubReward { plat , gacha_coin , money2 , ticket_furniture }
 
- Static Public Member Functions inherited from Quest
static Quest Create (string _id, string _idPerson=null, Chara c=null)
 
static List< ZoneListDeliver ()
 
- Static Public Member Functions inherited from EClass
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
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)
 
- Static Public Attributes inherited from Quest
const int PhaseComplete = 999
 
- Static Public Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 5 of file QuestDeliver.cs.

Member Function Documentation

◆ CanDeliverToBox()

override bool QuestDeliver.CanDeliverToBox ( Thing  t)
inlinevirtual

Reimplemented from Quest.

Definition at line 197 of file QuestDeliver.cs.

198 {
199 return false;
200 }

◆ CanDeliverToClient()

override bool QuestDeliver.CanDeliverToClient ( Chara  c)
inlinevirtual

Reimplemented from Quest.

Definition at line 172 of file QuestDeliver.cs.

173 {
174 if (GetDestThing() == null && !EClass.debug.autoAdvanceQuest)
175 {
176 return false;
177 }
178 if (IsDeliver)
179 {
180 if (EClass._zone == base.DestZone)
181 {
182 return c.uid == uidTarget;
183 }
184 return false;
185 }
186 if (person.chara?.uid == c.uid)
187 {
188 return true;
189 }
190 if (c.quest != null)
191 {
192 return c.quest.uid == uid;
193 }
194 return false;
195 }
int uid
Definition: Card.cs:118
Quest quest
Definition: Chara.cs:24
bool autoAdvanceQuest
Definition: CoreDebug.cs:210
Definition: EClass.cs:5
static Zone _zone
Definition: EClass.cs:20
static CoreDebug debug
Definition: EClass.cs:48
Chara chara
Definition: Person.cs:36
override Thing GetDestThing()
virtual bool IsDeliver
int uid
Definition: Quest.cs:34
Person person
Definition: Quest.cs:73

References EClass._zone, CoreDebug.autoAdvanceQuest, Person.chara, EClass.debug, GetDestThing(), QuestDestZone.IsDeliver, Quest.person, Chara.quest, Card.uid, Quest.uid, and QuestDestZone.uidTarget.

◆ Deliver()

override bool QuestDeliver.Deliver ( Chara  c,
Thing  t = null 
)
inlinevirtual

Reimplemented from Quest.

Definition at line 202 of file QuestDeliver.cs.

203 {
204 if (t == null)
205 {
206 t = GetDestThing();
207 if (t == null && EClass.debug.autoAdvanceQuest)
208 {
209 Debug.Log("[error] creating " + idThing);
211 }
212 }
213 if (t != null)
214 {
215 Thing thing = t.Split(num);
216 bonusMoney += GetBonus(thing);
217 Msg.Say("deliverItem", thing);
218 if (ConsumeGoods)
219 {
220 thing.Destroy();
221 }
222 else
223 {
224 c.Pick(thing);
225 }
227 c.quest = null;
228 return true;
229 }
230 return false;
231 }
Thing Split(int a)
Definition: Card.cs:3231
void Destroy()
Definition: Card.cs:4538
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:3920
static Game game
Definition: EClass.cs:8
QuestManager quests
Definition: Game.cs:179
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 idThing
Definition: QuestDeliver.cs:8
virtual int GetBonus(Thing t)
virtual bool ConsumeGoods
Definition: QuestDeliver.cs:15
void Complete(Quest q)
Definition: QuestManager.cs:98
int bonusMoney
Definition: Quest.cs:55
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8

References CoreDebug.autoAdvanceQuest, Quest.bonusMoney, QuestManager.Complete(), ConsumeGoods, ThingGen.Create(), EClass.debug, Debug, Card.Destroy(), EClass.game, GetBonus(), GetDestThing(), idThing, num, Chara.Pick(), Game.quests, Msg.Say(), and Card.Split().

◆ GetBonus()

virtual int QuestDeliver.GetBonus ( Thing  t)
inlinevirtual

Reimplemented in QuestSupply, and QuestSupplySpecific.

Definition at line 233 of file QuestDeliver.cs.

234 {
235 return 0;
236 }

Referenced by Deliver().

◆ GetDeliverCat()

SourceCategory.Row QuestDeliver.GetDeliverCat ( )
inlineprivate

Definition at line 71 of file QuestDeliver.cs.

72 {
73 if (_listDeliver.Count == 0)
74 {
75 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
76 {
77 if (row.deliver > 0)
78 {
79 _listDeliver.Add(row);
80 }
81 }
82 }
83 return _listDeliver.RandomItem();
84 }
static SourceManager sources
Definition: EClass.cs:42
static List< SourceCategory.Row > _listDeliver
Definition: QuestDeliver.cs:13
SourceCategory categories

References _listDeliver, SourceManager.categories, and EClass.sources.

Referenced by SetIdThing().

◆ GetDestNum()

virtual int QuestDeliver.GetDestNum ( )
inlinevirtual

Reimplemented in QuestSupplyBulk, and QuestSupplyBulkJunk.

Definition at line 54 of file QuestDeliver.cs.

55 {
56 return 1;
57 }

Referenced by OnInit().

◆ GetDestThing()

override Thing QuestDeliver.GetDestThing ( )
inlinevirtual

Reimplemented from Quest.

Definition at line 145 of file QuestDeliver.cs.

146 {
147 List<Thing> list = ListDestThing(onlyFirst: true);
148 if (list.Count <= 0)
149 {
150 return null;
151 }
152 return list[0];
153 }
List< Thing > ListDestThing(bool onlyFirst=false)

References ListDestThing().

Referenced by CanDeliverToClient(), Deliver(), GetTextProgress(), QuestSupplyCat.GetTextProgress(), and ItemQuest.SetQuest().

◆ GetExtraMoney()

override int QuestDeliver.GetExtraMoney ( )
inlinevirtual

Reimplemented from Quest.

Reimplemented in QuestSupplySpecific.

Definition at line 39 of file QuestDeliver.cs.

40 {
41 if (base.DestZone == null)
42 {
43 return 0;
44 }
45 return base.DestZone.Dist(base.ClientZone) * 6;
46 }

◆ GetTextProgress()

override string QuestDeliver.GetTextProgress ( )
inlinevirtual

Reimplemented from Quest.

Reimplemented in QuestSupplyCat.

Definition at line 238 of file QuestDeliver.cs.

239 {
240 string text = ((GetDestThing() != null) ? "supplyInInv".lang().TagColor(FontColor.Good) : "supplyNotInInv".lang());
241 if (IsDeliver)
242 {
243 string @ref = (base.DestZone.dictCitizen.TryGetValue(uidTarget) ?? "???") + " (" + base.DestZone.Name + ")";
244 return "progressDeliver".lang(sourceThing.GetName(num), @ref, text);
245 }
246 return "progressSupply".lang(sourceThing.GetName(num) + Lang.space + TextExtra2.IsEmpty(""), text);
247 }
FontColor
Definition: FontColor.cs:2
SourceThing.Row sourceThing
Definition: QuestDeliver.cs:17
virtual string TextExtra2
Definition: Quest.cs:158

References GetDestThing(), QuestDestZone.IsDeliver, num, sourceThing, Quest.TextExtra2, and QuestDestZone.uidTarget.

◆ IsDeliverTarget()

override bool QuestDeliver.IsDeliverTarget ( Chara  c)
inlinevirtual

Reimplemented from Quest.

Definition at line 155 of file QuestDeliver.cs.

156 {
157 if (IsDeliver)
158 {
159 if (EClass._zone == base.DestZone)
160 {
161 return c.uid == uidTarget;
162 }
163 return false;
164 }
165 if (c.quest != null)
166 {
167 return c.quest.uid == uid;
168 }
169 return false;
170 }

References EClass._zone, QuestDestZone.IsDeliver, Chara.quest, Quest.uid, and QuestDestZone.uidTarget.

◆ IsDestThing()

virtual bool QuestDeliver.IsDestThing ( Thing  t)
inlinevirtual

Reimplemented in QuestSupplyCat.

Definition at line 97 of file QuestDeliver.cs.

98 {
99 if (t.parentCard != null && !t.parentCard.trait.CanUseContent)
100 {
101 return false;
102 }
103 if (!t.c_isImportant && t.Num >= num && t.IsIdentified && (!t.IsContainer || t.things.Count == 0) && !t.isEquipped)
104 {
105 if (t.id == idThing)
106 {
107 return true;
108 }
109 if (t.c_altName.IsEmpty())
110 {
111 string name = sourceThing.GetName();
112 if (t.source.GetName() == name || t.GetName(NameStyle.Simple, 1) == name)
113 {
114 return true;
115 }
116 }
117 }
118 return false;
119 }
NameStyle
Definition: NameStyle.cs:2
string id
Definition: Card.cs:31
string c_altName
Definition: Card.cs:1493
Trait trait
Definition: Card.cs:49
bool c_isImportant
Definition: Card.cs:984
ThingContainer things
Definition: Card.cs:34
Card parentCard
Definition: Card.cs:99
int Num
Definition: Card.cs:154
bool IsIdentified
Definition: Card.cs:2237
bool IsContainer
Definition: Card.cs:1965
SourceThing.Row source
Definition: Thing.cs:11
bool isEquipped
Definition: Thing.cs:17
override string GetName(NameStyle style, int _num=-1)
Definition: Thing.cs:494
virtual bool CanUseContent
Definition: Trait.cs:207

References Card.c_altName, Card.c_isImportant, Trait.CanUseContent, Thing.GetName(), Card.id, idThing, Card.IsContainer, Thing.isEquipped, Card.IsIdentified, Card.Num, num, Card.parentCard, Thing.source, sourceThing, Card.things, and Card.trait.

Referenced by ListDestThing().

◆ ListDestThing()

List< Thing > QuestDeliver.ListDestThing ( bool  onlyFirst = false)
inline

Definition at line 121 of file QuestDeliver.cs.

122 {
123 List<Thing> list = EClass.pc.things.List((Thing t) => IsDestThing(t), onlyAccessible: true);
124 if (onlyFirst && list.Count > 0)
125 {
126 return list;
127 }
129 {
130 foreach (Thing thing in EClass._map.props.stocked.things)
131 {
132 if (IsDestThing(thing))
133 {
134 list.Add(thing);
135 if (onlyFirst)
136 {
137 return list;
138 }
139 }
140 }
141 }
142 return list;
143 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
static Map _map
Definition: EClass.cs:18
static Chara pc
Definition: EClass.cs:14
PropsManager props
Definition: Map.cs:91
PropsStocked stocked
Definition: PropsManager.cs:6
List< Thing > things
Definition: Props.cs:20
virtual bool IsDestThing(Thing t)
Definition: QuestDeliver.cs:97
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)
bool IsPCFaction
Definition: Zone.cs:464

References EClass._map, EClass._zone, ActPlan.List.Add(), QuestDestZone.IsDeliver, IsDestThing(), Zone.IsPCFaction, ThingContainer.List(), EClass.pc, Map.props, PropsManager.stocked, Card.things, and Props.things.

Referenced by GetDestThing().

◆ OnEnterZone()

override void QuestDeliver.OnEnterZone ( )
inlinevirtual

Reimplemented from Quest.

Definition at line 249 of file QuestDeliver.cs.

250 {
251 if (!IsDeliver || EClass._zone != base.DestZone)
252 {
253 return;
254 }
255 Chara chara = EClass._map.charas.Find((Chara c) => c.uid == uidTarget);
256 if (chara == null)
257 {
258 chara = EClass._map.deadCharas.Find((Chara c) => c.uid == uidTarget);
259 }
260 if (chara == null)
261 {
262 Msg.Say("deliver_funny");
263 Complete();
264 }
265 }
Definition: Chara.cs:10
List< Chara > deadCharas
Definition: Map.cs:46
List< Chara > charas
Definition: Map.cs:81
Chara chara
Definition: Quest.cs:105
void Complete()
Definition: Quest.cs:468

References EClass._map, EClass._zone, Quest.chara, Map.charas, Quest.Complete(), Map.deadCharas, QuestDestZone.IsDeliver, Msg.Say(), Card.uid, and QuestDestZone.uidTarget.

◆ OnInit()

override void QuestDeliver.OnInit ( )
inlinevirtual

Reimplemented from Quest.

Definition at line 48 of file QuestDeliver.cs.

49 {
50 num = GetDestNum();
51 SetIdThing();
52 }
virtual int GetDestNum()
Definition: QuestDeliver.cs:54
virtual void SetIdThing()
Definition: QuestDeliver.cs:59

References GetDestNum(), num, and SetIdThing().

◆ OnStart()

override void QuestDeliver.OnStart ( )
inlinevirtual

Reimplemented from Quest.

Definition at line 86 of file QuestDeliver.cs.

87 {
88 if (IsDeliver)
89 {
91 thing.Identify(show: false, IDTSource.SuperiorIdentify);
92 Msg.Say("get_quest_item");
93 EClass.pc.Pick(thing);
94 }
95 }
IDTSource
Definition: IDTSource.cs:2
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:1959

References ThingGen.Create(), Thing.Identify(), idThing, QuestDestZone.IsDeliver, EClass.pc, Chara.Pick(), and Msg.Say().

◆ SetIdThing()

virtual void QuestDeliver.SetIdThing ( )
inlinevirtual

Reimplemented in QuestSupplyCat, and QuestSupplySpecific.

Definition at line 59 of file QuestDeliver.cs.

60 {
61 CardRow cardRow;
62 do
63 {
65 cardRow = SpawnListThing.Get("cat_" + r.id, (SourceThing.Row s) => EClass.sources.categories.map[s.category].IsChildOf(r.id)).Select();
66 }
67 while (cardRow == null);
68 idThing = cardRow.id;
69 }
string id
Definition: CardRow.cs:7
SourceCategory.Row GetDeliverCat()
Definition: QuestDeliver.cs:71
static SpawnList Get(string id, Func< SourceThing.Row, bool > func)
CardRow Select(int lv=-1, int levelRange=-1)
Definition: SpawnList.cs:139

References SourceManager.categories, SpawnListThing.Get(), GetDeliverCat(), CardRow.id, SourceCategory.Row.id, idThing, SpawnList.Select(), and EClass.sources.

Referenced by OnInit().

Member Data Documentation

◆ _listDeliver

List<SourceCategory.Row> QuestDeliver._listDeliver = new List<SourceCategory.Row>()
staticprivate

Definition at line 13 of file QuestDeliver.cs.

Referenced by GetDeliverCat().

◆ idThing

string QuestDeliver.idThing

◆ num

Property Documentation

◆ ConsumeGoods

virtual bool QuestDeliver.ConsumeGoods
get

Definition at line 15 of file QuestDeliver.cs.

Referenced by Deliver().

◆ difficultyType

override DifficultyType QuestDeliver.difficultyType
get

Definition at line 35 of file QuestDeliver.cs.

◆ ForbidTeleport

override bool QuestDeliver.ForbidTeleport
get

Definition at line 37 of file QuestDeliver.cs.

◆ KarmaOnFail

override int QuestDeliver.KarmaOnFail
get

Definition at line 23 of file QuestDeliver.cs.

24 {
25 get
26 {
27 if (!IsDeliver)
28 {
29 return base.KarmaOnFail;
30 }
31 return -15;
32 }
33 }

◆ NameDeliver

override string QuestDeliver.NameDeliver
get

Definition at line 19 of file QuestDeliver.cs.

◆ RefDrama2

override string QuestDeliver.RefDrama2
get

Definition at line 21 of file QuestDeliver.cs.

◆ sourceThing

SourceThing.Row QuestDeliver.sourceThing
get

Definition at line 17 of file QuestDeliver.cs.

Referenced by GetTextProgress(), and IsDestThing().


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