21 public override string TextWidgetDate
25 return "eventHarvest".lang((this.TimeLimit - this.minElapsed <= 30) ?
"end_soon".lang() :
"", Lang._weight(
this.questHarvest.weightDelivered,
true, 0), Lang._weight(
this.questHarvest.destWeight,
true, 0),
null,
null);
31 public override int TimeLimit
40 public override void OnVisit()
46 EClass._zone.SetBGM(17,
true);
48 PartialMap.Apply(
"Special/farm_chest.mp", centerPos);
50 genBounds.marginPartial = 2;
51 genBounds.FuncCheckEmpty = ((
Cell cell) => cell.sourceFloor.id == 42);
52 List<
SourceObj.
Row> crops = (from o in EClass.sources.objs.rows
53 where o.tag.Contains(
"harvest")
55 Action<PartialMap, GenBounds> <>9__2;
56 for (
int i = 0; i < 50; i++)
59 MapPiece.Type type =
MapPiece.Type.Farm;
62 Action<PartialMap, GenBounds> onCreate;
63 if ((onCreate = <>9__2) ==
null)
67 List<Point> list = b.ListEmptyPoint();
69 int num = 1 +
EClass.rnd(5 + this.quest.difficulty * 2);
70 foreach (
Point point
in list)
72 if (point.sourceFloor.id == 4 &&
EClass.rnd(4) != 0)
74 point.SetObj(row.id, 1, 0);
75 int num2 = point.growth.HarvestStage -
EClass.rnd(4);
76 point.growth.SetStage(num2,
false);
77 if (num2 == point.growth.HarvestStage)
79 EClass._map.AddPlant(point,
null).size = Mathf.Clamp(num +
EClass.rnd(2) -
EClass.rnd(2), 0, 9) + 1;
81 point.cell.isClearSnow =
true;
86 genBounds2.TryAddMapPiece(type, ruin, tags, onCreate);
90 thing.isNPCProperty =
true;
92 for (
int j = 0; j < 12; j++)
94 EClass._zone.SpawnMob(
null,
null);
96 for (
int k = 0; k < 30; k++)
103 public override ZoneInstance.Status OnReachTimeLimit()
105 Msg.Say(
"harvest_end", Lang._weight(
this.questHarvest.weightDelivered,
true, 0),
null,
null,
null);
106 if (this.questHarvest.weightDelivered <
this.questHarvest.destWeight)
114 public override void OnLeaveZone()
118 EClass._zone.instance.status = this.OnReachTimeLimit();
120 List<Thing> list =
new List<Thing>();
121 Action<Thing> <>9__0;
125 Action<Thing> action;
126 if ((action = <>9__0) ==
null)
128 action = (<>9__0 = delegate(
Thing t)
130 if (t.GetBool(115) &&
EClass.rnd(2) != 0)
136 things.Foreach(action,
true);
140 Msg.Say(
"harvest_confiscate", list.Count.ToString() ??
"",
null,
null,
null);
141 foreach (
Thing thing
in list)
145 EClass.player.ModKarma(-1);