11 public virtual bool ConsumeGoods
25 return EClass.sources.things.map[this.idThing.IsEmpty(
"generator_snowman")];
31 public override string NameDeliver
35 return this.sourceThing.GetName();
41 public override string RefDrama2
45 return this.NameDeliver;
51 public override int KarmaOnFail
57 return base.KarmaOnFail;
65 public override Quest.DifficultyType difficultyType
69 return Quest.DifficultyType.Deliver;
75 public override bool ForbidTeleport
84 public override int GetExtraMoney()
86 if (base.DestZone ==
null)
90 return base.DestZone.Dist(base.ClientZone) * 6;
94 public override void OnInit()
96 this.num = this.GetDestNum();
101 public virtual int GetDestNum()
107 public virtual void SetIdThing()
115 while (cardRow ==
null);
116 this.idThing = cardRow.id;
136 public override void OnStart()
141 thing.Identify(
false, IDTSource.SuperiorIdentify);
142 Msg.Say(
"get_quest_item");
143 EClass.pc.Pick(thing,
true,
true);
148 public virtual bool IsDestThing(
Thing t)
150 if (!t.c_isImportant && t.Num >=
this.num && t.IsIdentified && t.things.Count == 0 && !t.isEquipped)
152 if (t.id ==
this.idThing)
156 if (t.c_altName.IsEmpty())
158 string name = this.sourceThing.GetName();
159 if (t.source.GetName() == name || t.GetName(NameStyle.Simple, 1) == name)
169 public List<Thing> ListDestThing()
171 return EClass.pc.things.List((
Thing t) => this.IsDestThing(t),
false);
175 public override Thing GetDestThing()
177 return EClass.pc.things.Find((
Thing t) => this.IsDestThing(t),
true);
181 public override bool IsDeliverTarget(
Chara c)
185 return EClass._zone == base.DestZone && c.uid == this.uidTarget;
187 return c.quest !=
null && c.quest.uid == this.uid;
191 public override bool CanDeliverToClient(
Chara c)
193 if (this.GetDestThing() ==
null && !
EClass.debug.autoAdvanceQuest)
199 return EClass._zone == base.DestZone && c.uid == this.uidTarget;
201 Chara chara = this.person.chara;
202 int? num = (chara !=
null) ?
new int?(chara.uid) :
null;
204 return (num.GetValueOrDefault() == uid & num !=
null) || (c.quest !=
null && c.quest.uid == this.uid);
208 public override bool CanDeliverToBox(
Thing t)
214 public override bool Deliver(
Chara c,
Thing t =
null)
218 t = this.GetDestThing();
219 if (t ==
null &&
EClass.debug.autoAdvanceQuest)
221 Debug.Log(
"[error] creating " + this.idThing);
222 t =
ThingGen.Create(this.idThing, -1, -1);
227 Thing thing = t.Split(this.num);
228 this.bonusMoney += this.GetBonus(thing);
229 Msg.Say(
"deliverItem", thing,
null,
null,
null);
230 if (this.ConsumeGoods)
236 c.Pick(thing,
true,
true);
238 EClass.game.quests.Complete(
this);
246 public virtual int GetBonus(
Thing t)
252 public override string GetTextProgress()
254 string text = (this.GetDestThing() !=
null) ?
"supplyInInv".lang().TagColor(FontColor.Good,
null) :
"supplyNotInInv".lang();
257 string @ref = (base.DestZone.dictCitizen.TryGetValue(this.uidTarget,
null) ??
"???") +
" (" + base.DestZone.Name +
")";
258 return "progressDeliver".lang(this.sourceThing.GetName(
this.num), @ref, text,
null,
null);
260 return "progressSupply".lang(this.sourceThing.GetName(
this.num), text,
null,
null,
null);
265 public string idThing;