Elin Modding Docs Doc
All Classes Namespaces
QuestSupplySpecific.cs
1using System;
2using System.Collections.Generic;
3
4// Token: 0x020000EB RID: 235
6{
7 // Token: 0x17000179 RID: 377
8 // (get) Token: 0x06000665 RID: 1637 RVA: 0x000291A4 File Offset: 0x000273A4
9 public virtual string idCat
10 {
11 get
12 {
13 return "meal";
14 }
15 }
16
17 // Token: 0x1700017A RID: 378
18 // (get) Token: 0x06000666 RID: 1638 RVA: 0x000291AB File Offset: 0x000273AB
19 public virtual bool UseWeight
20 {
21 get
22 {
23 return true;
24 }
25 }
26
27 // Token: 0x1700017B RID: 379
28 // (get) Token: 0x06000667 RID: 1639 RVA: 0x000291AE File Offset: 0x000273AE
29 public override string RewardSuffix
30 {
31 get
32 {
33 return "Supply";
34 }
35 }
36
37 // Token: 0x06000668 RID: 1640 RVA: 0x000291B5 File Offset: 0x000273B5
38 public override int GetExtraMoney()
39 {
40 return (int)((float)(base.sourceThing.value * this.num) * 0.1f) + 5 * this.num;
41 }
42
43 // Token: 0x06000669 RID: 1641 RVA: 0x000291DC File Offset: 0x000273DC
44 public override int GetBonus(Thing t)
45 {
46 int num = (int)((float)t.GetPrice(CurrencyType.Money, true, PriceType.Shipping, EClass.pc) * 1.2f) * this.num - this.rewardMoney;
47 if (num <= 0)
48 {
49 return 0;
50 }
51 return num;
52 }
53
54 // Token: 0x0600066A RID: 1642 RVA: 0x00029218 File Offset: 0x00027418
55 public override void SetIdThing()
56 {
57 List<SourceThing.Row> list = new List<SourceThing.Row>();
58 int num = EClass.pc.Evalue(287) * 150 / 100 + 5;
59 for (int i = 0; i < 2; i++)
60 {
61 foreach (SourceThing.Row row in EClass.sources.things.rows)
62 {
63 if ((i != 0 || !(this is QuestMeal) || row.LV <= num || EClass.rnd(4) == 0) && row.category == this.idCat && !row.isOrigin)
64 {
65 list.Add(row);
66 }
67 }
68 if (list.Count != 0)
69 {
70 break;
71 }
72 }
73 string id;
74 if (!this.UseWeight)
75 {
76 id = list.RandomItem<SourceThing.Row>().id;
77 }
78 else
79 {
80 id = list.RandomItemWeighted((SourceThing.Row a) => (float)a.chance).id;
81 }
82 this.idThing = id;
83 if (this.difficultyType == Quest.DifficultyType.Meal)
84 {
85 this.difficulty = base.sourceThing.LV / 10 + 1;
86 }
87 }
88}
Definition Quest.cs:8
Definition Thing.cs:10