9 public override string Name
13 return this.sourceWork.name_JP;
19 public virtual int destDist
29 public override int MaxRestart
39 public virtual AIWork.Work_Type WorkType
43 return AIWork.Work_Type.Default;
48 public override IEnumerable<
AIAct.Status> Run()
50 yield
return base.DoIdle(100);
51 AIWork.Work_Type workType = this.WorkType;
53 if (this.destPos !=
null)
55 yield
return base.DoGoto(this.destPos, this.destDist,
false,
null);
57 AIAct work = this.GetWork(this.destPos);
60 this.owner.Talk(
"work_" + this.sourceWork.talk,
null,
null,
false);
61 yield
return base.Do(work,
new Func<AIAct.Status>(base.KeepRunning));
63 yield
return base.Restart();
74 public bool SetDestination()
76 if (this.WorkType ==
AIWork.Work_Type.Explore)
78 return EClass.world.date.IsExpired(this.owner.GetInt(51,
null));
80 if (!this.sourceWork.workTag.IsEmpty())
82 if (this.destArea !=
null)
84 this.destThing =
EClass._map.FindThing(this.sourceWork.workTag,
this.destArea,
null);
88 this.destThing =
EClass._map.FindThing(this.sourceWork.workTag,
this.owner);
90 if (this.destThing !=
null)
95 if (this.sourceWork.destTrait.IsEmpty())
98 return this.destPos !=
null;
100 if (this.destArea !=
null)
102 this.destThing =
EClass._map.FindThing(Type.GetType(
"Trait" +
this.sourceWork.destTrait +
", Elin"),
this.destArea,
null);
103 return this.destThing !=
null;
105 this.destThing =
EClass._map.FindThing(Type.GetType(
"Trait" +
this.sourceWork.destTrait +
", Elin"),
this.owner);
106 return this.destThing !=
null;
110 public virtual void SetDestPos()
112 if (this.destThing !=
null && this.destThing.ExistsOnMap)
114 this.destPos = this.destThing.trait.GetRandomPoint(
new Func<Point, bool>(this._FuncWorkPoint));
119 public bool _FuncWorkPoint(
Point p)
121 Room room = this.destThing.pos.cell.room;
122 return p.cell.room == room && this.FuncWorkPoint(p);
126 public virtual bool FuncWorkPoint(
Point p)
136 id = this.sourceWork.id,
139 if (this.destThing !=
null)
141 workSession.efficiency = this.destThing.GetEfficiency();
143 else if (this.destArea !=
null)
145 workSession.efficiency = this.destArea.type.GetEfficiency();
147 this.OnGetSession(workSession);
157 public void AddDeliverable(
Thing t)
159 this.owner.GetWorkSummary().AddThing(t);
163 public virtual void OnPerformWork(
bool realtime)
168 public void DailyOutcome()
176 public Point destPos;
179 public Thing destThing;
185 public enum Work_Type