Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
BaseTaskHarvest Class Reference
Inheritance diagram for BaseTaskHarvest:
TaskDesignation TaskPoint ISyncScreen Task IInspect AIAct Act Element EClass TaskDig TaskHarvest TaskMine

Public Types

enum  HarvestType {
  Floor , Block , Obj , Thing ,
  Disassemble
}
 
- Public Types inherited from AIAct
enum  Status { Running , Fail , Success }
 
- Public Types inherited from Act
enum  CostType { None , MP , SP }
 
- Public Types inherited from IInspect
enum  NoteMode { Default , Recipe , Product , Info }
 

Public Member Functions

virtual string GetBaseText (string str)
 
override string GetTextSmall (Card c)
 
override string GetText (string str="")
 
void SetTarget (Chara c, Thing _tool=null)
 
int GetToolEfficiency (Thing t, SourceMaterial.Row mat)
 
override bool CanProgress ()
 
int[] GetToolEfficiency (SourceMaterial.Row mat)
 
string GetTextDifficulty ()
 
- Public Member Functions inherited from TaskDesignation
virtual string GetTextOrbit ()
 
bool PointHasOtherDesignation ()
 
virtual void DrawMarker (int x, int z, RenderParam p)
 
virtual void Draw (int x, int z, RenderParam p)
 
virtual void OnEnterScreen ()
 
virtual void OnLeaveScreen ()
 
virtual void TrySpawnOrbit ()
 
void DespawnOrbit ()
 
- Public Member Functions inherited from TaskPoint
override bool CanManualCancel ()
 
override bool CanPerform ()
 
override bool _CanPerformTask (Chara chara, int radius)
 
override IEnumerable< StatusRun ()
 
void OnInspect ()
 
void WriteNote (UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
 
- Public Member Functions inherited from Task
virtual HitResult GetHitResult ()
 
override void OnSuccess ()
 
void TryLater (int min=30)
 
Status Destroy ()
 
virtual void OnDestroy ()
 
override Status Cancel ()
 
override void OnReset ()
 
override bool CanProgress ()
 
bool CanPerformTask (Chara chara, int radius)
 
virtual bool _CanPerformTask (Chara chara, int radius)
 
virtual void OnAdd ()
 
void ToggleSuspend ()
 
- Public Member Functions inherited from AIAct
override string ToString ()
 
override MultiSprite GetStateIcon ()
 
virtual bool ShouldAllyAttack (Chara tg)
 
virtual Point GetDestination ()
 
AIProgress GetProgress ()
 
string GetCurrentActionText ()
 
override bool IsToolValid ()
 
virtual void OnStart ()
 
void SetOwner (Chara c)
 
virtual void OnSetOwner ()
 
void SetChild (AIAct seq, Func< Status > _onChildFail=null)
 
void Start ()
 
override bool Perform ()
 
Status Restart ()
 
Status Success (Action action=null)
 
virtual void OnSuccess ()
 
bool TryCancel (Card c)
 
virtual Status Cancel ()
 
virtual void OnCancel ()
 
virtual void OnCancelOrSuccess ()
 
virtual bool CanManualCancel ()
 
Status KeepRunning ()
 
void Reset ()
 
virtual void OnReset ()
 
Status Tick ()
 
virtual IEnumerable< StatusRun ()
 
Status TickChild ()
 
Status Do (AIAct _seq, Func< Status > _onChildFail=null)
 
Status DoGotoInteraction (Point pos, Func< Status > _onChildFail=null)
 
Status DoGoto (Point pos, int dist=0, bool ignoreConnection=false, Func< Status > _onChildFail=null)
 
Status DoGoto (Card card, Func< Status > _onChildFail=null)
 
Status DoGoto (Card card, int dist, Func< Status > _onChildFail=null)
 
Status DoGotoSpot (Card card, Func< Status > _onChildFail=null)
 
Status DoGoto< T > (Func< Status > _onChildFail=null)
 
Status DoGotoSpot< T > (Func< Status > _onChildFail=null, bool ignoreAccessType=false)
 
Status DoGrab (Card card, int num=-1, bool pickHeld=false, Func< Status > _onChildFail=null)
 
Status DoGrab< T > ()
 
Status DoProgress ()
 
Status DoIdle (int repeat=3)
 
Status DoWait (int count=1)
 
virtual AIProgress CreateProgress ()
 
virtual void OnCreateProgress (Progress_Custom p)
 
virtual bool CanProgress ()
 
virtual void OnBeforeProgress ()
 
virtual void OnProgress ()
 
virtual void OnProgressComplete ()
 
void SimulateZone (int days)
 
virtual void OnSimulateZone (int days)
 
virtual void OnSimulatePosition ()
 
- Public Member Functions inherited from Act
virtual CursorInfo GetCursorIcon (Card c)
 
virtual MultiSprite GetStateIcon ()
 
override Sprite GetSprite ()
 
virtual bool ShowMouseHint (Card c)
 
virtual bool IsValidTC (Card c)
 
virtual string GetHintText (string str="")
 
virtual string GetText (string str="")
 
virtual string GetTextSmall (Card c)
 
bool IsTargetHostileParty ()
 
virtual Color GetActPlanColor ()
 
virtual bool Perform ()
 
virtual bool CanPerform ()
 
bool Perform (Chara _cc, Card _tc=null, Point _tp=null)
 
bool CanPerform (Chara _cc, Card _tc=null, Point _tp=null)
 
virtual bool IsToolValid ()
 
new void SetImage (Image image)
 
virtual void OnMarkMapHighlights ()
 
virtual bool ShouldMapHighlight (Point p)
 
- Public Member Functions inherited from Element
virtual SourceElement.Row GetSource ()
 
virtual int GetSourcePotential (int v)
 
virtual Sprite GetSprite ()
 
int GetMaterialSourceValue (Thing t, int v)
 
virtual int GetSourceValue (int v, int lv, SourceValueType type)
 
virtual Sprite GetIcon (string suffix="")
 
bool IsActive (Card c)
 
int SortVal (bool charaSheet=false)
 
virtual bool CanLink (ElementContainer owner)
 
bool HasTag (string tag)
 
void SetImage (Image i)
 
virtual string GetDetail ()
 
bool IsFactionElement (Chara c)
 
Element GetParent (Card c)
 
void WriteNote (UINote n, ElementContainer owner=null, Action< UINote > onWriteNote=null)
 
void WriteNoteWithRef (UINote n, ElementContainer owner, Action< UINote > onWriteNote, Element refEle)
 
void _WriteNote (UINote n, Chara c, Act act)
 
void AddHeaderAbility (UINote n)
 
void _WriteNote (UINote n, ElementContainer owner, Action< UINote > onWriteNote, bool isRef, bool addHeader=true)
 
virtual void OnWriteNote (UINote n, ElementContainer owner)
 
virtual void OnChangeValue ()
 
void CheckLevelBonus (ElementContainer owner, UINote n=null)
 
int GetSortVal (UIList.SortMode m)
 
virtual Act.Cost GetCost (Chara c)
 
virtual int GetPower (Card c)
 
virtual void SetTextValue (UIText text)
 
virtual bool IsPurchaseFeatReqMet (ElementContainer owner, int lv=-1)
 
virtual void WritePurchaseReq (UINote n, int lv=1)
 
void WriteNote (UINote n, Action< UINote > onWriteNote=null, NoteMode mode=NoteMode.Default, Recipe recipe=null)
 
void OnInspect ()
 
void OnEnterScreen ()
 
void OnLeaveScreen ()
 

Static Public Member Functions

static Thing GetBestTool (Chara c, Point p)
 
static int GetReqEle (string _raw)
 
- Static Public Member Functions inherited from Act
static void SetReference (Chara _cc, Card _tc=null, Point _tp=null)
 
static void SetTool (Thing t)
 
- Static Public Member Functions inherited from Element
static string GetName (string alias)
 
static SourceElement.Row Get (int id)
 
static Dictionary< int, int > GetElementMap (int[] list)
 
static Dictionary< int, int > GetElementMap (int[] list, Dictionary< int, int > map)
 
static SourceElement.Row GetRandomElement (int lv=1)
 
static Element Create (int id, int v=0)
 
static Element Create (string id, int v=1)
 
static int GetId (string alias)
 
static int GetResistLv (int v)
 
static int GetResistDamage (int dmg, int v, int power=0)
 
- 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)
 

Public Attributes

Thing target
 
Element reqElement
 
int matHardness
 
int idEle
 
int reqLv
 
int toolLv
 
int maxProgress
 
int efficiency
 
int difficulty
 
int effectFrame = 1
 
bool isToolRequired
 
Thing tool
 
- Public Attributes inherited from TaskDesignation
long sync
 
bool isSynced
 
TCOrbitTask orbit
 
- Public Attributes inherited from TaskPoint
Point pos = new Point()
 
bool isRepeated
 
- Public Attributes inherited from Task
TaskList taskList
 
bool isDestroyed
 
int nextTry
 
bool suspended
 
- Public Attributes inherited from AIAct
new Chara owner
 
Status status
 
IEnumerator< StatusEnumerator
 
AIAct child
 
AIAct parent
 
byte restartCount
 
Func< StatusonChildFail
 
Func< bool > isFail
 
- Public Attributes inherited from Element
SourceElement.Row _source
 
int id
 
int vBase
 
int vExp
 
int vPotential
 
int vTempPotential
 
int vLink
 
int vSource
 
int vSourcePotential
 
ElementContainer owner
 

Properties

bool IsTooHard [get]
 
bool IsHarvest [get]
 
virtual bool CanReapSeed [get]
 
virtual HarvestType harvestType [get]
 
virtual bool IsGrowth [get]
 
override bool CanPressRepeat [get]
 
override int LeftHand [get]
 
override CursorInfo CursorIcon [get]
 
- Properties inherited from TaskDesignation
override bool HasProgress [get]
 
virtual int idMarker [get]
 
virtual int W [get]
 
virtual int H [get]
 
virtual bool ShowOrbit [get]
 
virtual bool Working [get]
 
override bool ShowAuto [get]
 
override CursorInfo CursorIcon [get]
 
TaskManager.Designations Designations [get]
 
long Sync [get]
 
- Properties inherited from TaskPoint
override bool HasProgress [get]
 
virtual int destDist [get]
 
virtual bool destIgnoreConnection [get]
 
virtual bool isBlock [get]
 
virtual bool Loop [get]
 
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [get]
 
- Properties inherited from Task
override TargetType TargetType [get]
 
- Properties inherited from AIAct
virtual bool IsRunning [get]
 
bool IsChildRunning [get]
 
bool IsMoveAI [get]
 
virtual int MaxRestart [get]
 
virtual new string Name [get]
 
virtual MultiSprite stateIcon [get]
 
virtual Sprite actionIcon [get]
 
virtual bool IsNoGoal [get]
 
virtual bool IsAutoTurn [get]
 
virtual bool IsIdle [get]
 
virtual bool CancelOnAggro [get]
 
virtual bool PushChara [get]
 
virtual int MaxProgress [get]
 
virtual bool ShowProgress [get]
 
virtual bool UseTurbo [get]
 
virtual int CurrentProgress [get]
 
virtual bool ShowCursor [get]
 
virtual bool CancelWhenDamaged [get]
 
virtual bool CancelWhenMoved [get]
 
virtual bool InformCancel [get]
 
virtual Thing RenderThing [get]
 
AIAct Current [get]
 
override bool IsAct [get]
 
override bool ShowPotential [get]
 
override bool UsePotential [get]
 
override bool ShowRelativeAttribute [get]
 
virtual bool HasProgress [get]
 
- Properties inherited from Act
override bool ShowPotential [get]
 
override bool UsePotential [get]
 
override bool ShowRelativeAttribute [get]
 
virtual CursorInfo CursorIcon [get]
 
virtual string ID [get]
 
virtual bool IsAct [get]
 
virtual bool WillEndTurn [get]
 
virtual bool CloseLayers [get]
 
virtual int LeftHand [get]
 
virtual int RightHand [get]
 
virtual int ElementPowerMod [get]
 
virtual bool ShowMapHighlight [get]
 
virtual bool ShowMapHighlightBlock [get]
 
virtual bool PickHeldOnStart [get]
 
virtual bool DropHeldOnStart [get]
 
virtual bool CanPressRepeat [get]
 
virtual bool CanAutofire [get]
 
virtual bool ResetAxis [get]
 
virtual bool RequireTool [get]
 
virtual bool IsHostileAct [get]
 
virtual bool HideRightInfo [get]
 
virtual bool HaveLongPressAction [get]
 
virtual float Radius [get]
 
virtual int PerformDistance [get]
 
virtual int MaxRadius [get]
 
virtual TargetType TargetType [get]
 
virtual bool LocalAct [get]
 
virtual bool CanRapidFire [get]
 
virtual float RapidDelay [get]
 
virtual bool ShowAuto [get]
 
virtual bool IsCrime [get]
 
- Properties inherited from Element
SourceElement.Row source [get]
 
virtual int DisplayValue [get]
 
virtual int MinValue [get]
 
int Value [get]
 
int ValueWithoutLink [get]
 
virtual int MinPotential [get]
 
int Potential [get]
 
virtual bool CanGainExp [get]
 
bool IsFlag [get]
 
virtual string Name [get]
 
virtual string FullName [get]
 
virtual int ExpToNext [get]
 
virtual bool UseExpMod [get]
 
virtual int CostTrain [get]
 
virtual int CostLearn [get]
 
virtual bool ShowXP [get]
 
virtual bool ShowMsgOnValueChanged [get]
 
virtual bool ShowValue [get]
 
virtual bool ShowPotential [get]
 
virtual bool UsePotential [get]
 
virtual bool PotentialAsStock [get]
 
virtual bool ShowRelativeAttribute [get]
 
virtual bool ShowBonuses [get]
 
virtual string ShortName [get]
 
bool IsGlobalElement [get]
 
bool IsFactionWideElement [get]
 
bool IsPartyWideElement [get]
 
virtual bool ShowEncNumber [get]
 
bool IsTrait [get]
 
bool IsFoodTrait [get]
 
bool IsFoodTraitMain [get]
 
bool IsMainAttribute [get]
 
Act act [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]
 
- Properties inherited from IInspect
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [get]
 
- Properties inherited from ISyncScreen
long Sync [get]
 

Additional Inherited Members

- Static Public Attributes inherited from Act
static Chara CC
 
static Card TC
 
static Point TP = new Point()
 
static Thing TOOL
 
static int powerMod = 100
 
static bool forcePt
 
- Static Public Attributes inherited from Element
const int Div = 5
 
static Element Void = new Element()
 
static int[] List_MainAttributes = new int[9] { 70, 72, 71, 77, 74, 75, 76, 73, 79 }
 
static int[] List_MainAttributesMajor = new int[8] { 70, 72, 71, 77, 74, 75, 76, 73 }
 
static int[] List_Body = new int[4] { 70, 72, 71, 77 }
 
static int[] List_Mind = new int[4] { 74, 75, 76, 73 }
 
static List< SourceElement.RowListElements = new List<SourceElement.Row>()
 
static List< SourceElement.RowListAttackElements = new List<SourceElement.Row>()
 
- Static Public Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 4 of file BaseTaskHarvest.cs.

Member Enumeration Documentation

◆ HarvestType

Enumerator
Floor 
Block 
Obj 
Thing 
Disassemble 

Definition at line 6 of file BaseTaskHarvest.cs.

Member Function Documentation

◆ CanProgress()

override bool BaseTaskHarvest.CanProgress ( )
inlinevirtual

Reimplemented from AIAct.

Reimplemented in TaskHarvest.

Definition at line 268 of file BaseTaskHarvest.cs.

269 {
270 if (tool != owner.Tool)
271 {
272 return false;
273 }
274 return base.CanProgress();
275 }
new Chara owner
Definition: AIAct.cs:14
Thing Tool
Definition: Card.cs:2270

References tool.

◆ GetBaseText()

virtual string BaseTaskHarvest.GetBaseText ( string  str)
inlinevirtual

Reimplemented in TaskHarvest.

Definition at line 65 of file BaseTaskHarvest.cs.

66 {
67 return base.GetText(str);
68 }

Referenced by GetText().

◆ GetBestTool()

static Thing BaseTaskHarvest.GetBestTool ( Chara  c,
Point  p 
)
inlinestatic

Definition at line 91 of file BaseTaskHarvest.cs.

92 {
94 {
95 pos = p
96 };
97 task.SetOwner(c);
98 Thing tool = null;
99 int best = 0;
100 c.things.Foreach(delegate(Thing t)
101 {
102 if (t.trait is TraitTool)
103 {
104 task.SetTarget(c, t);
105 if (task.efficiency > best)
106 {
107 best = task.efficiency;
108 tool = t;
109 }
110 }
111 });
112 return tool;
113 }
void SetOwner(Chara c)
Definition: AIAct.cs:179
Trait trait
Definition: Card.cs:49
ThingContainer things
Definition: Card.cs:34
Point pos
Definition: TaskPoint.cs:11
void Foreach(Action< Thing > action, bool onlyAccessible=true)
Definition: Thing.cs:8

References ThingContainer.Foreach(), TaskPoint.pos, AIAct.SetOwner(), Card.things, tool, and Card.trait.

◆ GetReqEle()

static int BaseTaskHarvest.GetReqEle ( string  _raw)
inlinestatic

Definition at line 234 of file BaseTaskHarvest.cs.

235 {
236 string[] array = _raw.Split(',');
237 return EClass.sources.elements.alias[array[0]].id;
238 }
Definition: EClass.cs:5
static SourceManager sources
Definition: EClass.cs:42
SourceElement elements

References SourceManager.elements, and EClass.sources.

◆ GetText()

override string BaseTaskHarvest.GetText ( string  str = "")
inlinevirtual

Reimplemented from Act.

Definition at line 75 of file BaseTaskHarvest.cs.

76 {
77 if (owner == null)
78 {
79 owner = EClass.pc;
80 }
82 string text = "tHarvest".lang(GetBaseText(str), (EClass.pc.Tool == null) ? "hand".lang() : owner.Tool.NameSimple, toolLv.ToString() ?? "");
83 text = text + " (" + GetTextDifficulty() + ")";
84 if (IsTooHard)
85 {
86 text = text.TagColor(Color.gray);
87 }
88 return text;
89 }
string GetTextDifficulty()
virtual string GetBaseText(string str)
void SetTarget(Chara c, Thing _tool=null)
string NameSimple
Definition: Card.cs:2015
static Chara pc
Definition: EClass.cs:14

References Color, GetBaseText(), GetTextDifficulty(), IsTooHard, Card.NameSimple, AIAct.owner, EClass.pc, SetTarget(), Card.Tool, and toolLv.

◆ GetTextDifficulty()

string BaseTaskHarvest.GetTextDifficulty ( )
inline

Definition at line 303 of file BaseTaskHarvest.cs.

304 {
305 return Lang.GetList("skillDiff")[difficulty];
306 }
Definition: Lang.cs:6
static string[] GetList(string id)
Definition: Lang.cs:114

References Lang.GetList().

Referenced by GetText().

◆ GetTextSmall()

override string BaseTaskHarvest.GetTextSmall ( Card  c)
inlinevirtual

Reimplemented from Act.

Reimplemented in TaskDig, TaskHarvest, and TaskMine.

Definition at line 70 of file BaseTaskHarvest.cs.

71 {
72 return pos.cell.GetObjName();
73 }
string GetObjName()
Definition: Cell.cs:1600
Cell cell
Definition: Point.cs:51

References Point.cell, Cell.GetObjName(), and TaskPoint.pos.

◆ GetToolEfficiency() [1/2]

int[] BaseTaskHarvest.GetToolEfficiency ( SourceMaterial::Row  mat)
inline

Definition at line 277 of file BaseTaskHarvest.cs.

278 {
279 switch (mat.category)
280 {
281 case "bone":
282 return new int[2] { 100, 50 };
283 case "ore":
284 case "crystal":
285 case "rock":
286 case "gem":
287 return new int[2] { 100, 25 };
288 case "organic":
289 case "skin":
290 return new int[2] { 50, 100 };
291 case "grass":
292 case "fiber":
293 case "wood":
294 return new int[2] { 25, 100 };
295 case "soil":
296 case "water":
297 return new int[2] { 100, 100 };
298 default:
299 return new int[2] { 100, 100 };
300 }
301 }

◆ GetToolEfficiency() [2/2]

int BaseTaskHarvest.GetToolEfficiency ( Thing  t,
SourceMaterial::Row  mat 
)
inline

Definition at line 240 of file BaseTaskHarvest.cs.

241 {
242 int[] toolEfficiency = GetToolEfficiency(mat);
243 _ = new int[2];
244 if (!t.HasElement(220))
245 {
246 toolEfficiency[0] = 0;
247 }
248 if (!t.HasElement(225))
249 {
250 toolEfficiency[1] = 0;
251 }
252 if (t.trait is TraitToolHammer)
253 {
254 toolEfficiency[0] = 50 + owner.Evalue(261);
255 }
256 int num = 20;
257 int[] array = toolEfficiency;
258 foreach (int num2 in array)
259 {
260 if (num2 > num)
261 {
262 num = num2;
263 }
264 }
265 return num;
266 }
int GetToolEfficiency(Thing t, SourceMaterial.Row mat)
bool HasElement(int ele, int req=1)
Definition: Card.cs:5214
int Evalue(int ele)
Definition: Card.cs:2431

References Card.HasElement(), and Card.trait.

◆ SetTarget()

void BaseTaskHarvest.SetTarget ( Chara  c,
Thing  _tool = null 
)
inline

Definition at line 115 of file BaseTaskHarvest.cs.

116 {
117 if (c == null)
118 {
119 c = EClass.pc;
120 }
121 if (_tool == null)
122 {
123 _tool = c.Tool;
124 }
125 tool = _tool;
126 string[] array = null;
127 SourceMaterial.Row row = null;
128 switch (this.harvestType)
129 {
130 case HarvestType.Obj:
131 array = pos.sourceObj.reqHarvest;
132 row = pos.cell.matObj;
133 break;
134 case HarvestType.Thing:
135 array = target.trait.ReqHarvest.Split(',');
136 row = target.material;
137 break;
138 case HarvestType.Disassemble:
139 if (target == null)
140 {
141 return;
142 }
143 array = new string[2] { "handicraft", "1" };
144 row = target.material;
145 break;
146 case HarvestType.Floor:
147 if (pos.cell.HasBridge)
148 {
149 array = pos.sourceBridge.reqHarvest;
150 row = pos.matBridge;
151 }
152 else
153 {
154 array = pos.sourceFloor.reqHarvest;
155 row = pos.matFloor;
156 }
157 break;
158 case HarvestType.Block:
159 if (pos.HasBlock)
160 {
161 array = pos.sourceBlock.reqHarvest;
162 row = pos.matBlock;
163 break;
164 }
165 array = new string[pos.sourceFloor.reqHarvest.Length];
166 Array.Copy(pos.sourceFloor.reqHarvest, array, pos.sourceFloor.reqHarvest.Length);
167 array[0] = "mining";
168 row = pos.matFloor;
169 break;
170 }
171 matHardness = row.hardness;
172 if (this.harvestType == HarvestType.Obj)
173 {
174 matHardness = matHardness * ((pos.growth != null) ? pos.growth.GetHp() : pos.sourceObj.hp) / 100;
175 }
176 if (row.tag.Contains("hard"))
177 {
178 matHardness *= 3;
179 }
181 if ((uint)harvestType <= 1u && row.id == 0)
182 {
183 matHardness *= 100;
184 }
185 idEle = (IsHarvest ? 250 : EClass.sources.elements.alias[array[0]].id);
187 int num = array[1].ToInt();
188 reqLv = matHardness + num;
189 isToolRequired = ((!IsHarvest && idEle != 250) ? true : false);
190 toolLv = 0;
191 if (tool != null)
192 {
193 int num2 = ((idEle == 220 || idEle == 225) ? GetToolEfficiency(tool, row) : 100);
194 toolLv += tool.material.hardness * num2 / 100;
195 toolLv += (int)(tool.encLV + tool.blessedState);
196 }
197 toolLv += c.Evalue(idEle) * 3 / 2;
198 if (toolLv < 0)
199 {
200 toolLv = 1;
201 }
202 efficiency = (toolLv + 5) * 100 / ((reqLv + 5) * 140 / 100);
203 if (efficiency < 50)
204 {
205 efficiency = 50;
206 }
207 if (IsTooHard)
208 {
209 difficulty = 3;
210 }
211 else if (efficiency > 150)
212 {
213 difficulty = 0;
214 }
215 else if (efficiency > 100)
216 {
217 difficulty = 1;
218 }
219 else
220 {
221 difficulty = 2;
222 }
224 if (this.harvestType == HarvestType.Obj && IsHarvest && plantData != null && plantData.size > 0)
225 {
226 maxProgress = (int)Mathf.Clamp(Rand.Range(8f, 10f) * (float)(100 + plantData.size * 100 + plantData.size * plantData.size * 30) / (float)efficiency, 2f, 1000f);
227 }
228 else
229 {
230 maxProgress = (int)Mathf.Clamp(Rand.Range(8f, 16f) * 100f / (float)efficiency, 2f, 30f);
231 }
232 }
virtual HarvestType harvestType
SourceMaterial.Row material
Definition: Card.cs:1927
int encLV
Definition: Card.cs:310
BlessedState blessedState
Definition: Card.cs:262
bool HasBridge
Definition: Cell.cs:671
SourceMaterial.Row matObj
Definition: Cell.cs:1036
static Map _map
Definition: EClass.cs:18
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:913
virtual int GetHp()
Definition: GrowSystem.cs:688
PlantData TryGetPlant(Point p)
Definition: Map.cs:1920
int size
Definition: PlantData.cs:15
SourceMaterial.Row matBlock
Definition: Point.cs:55
SourceMaterial.Row matFloor
Definition: Point.cs:57
SourceBlock.Row sourceBlock
Definition: Point.cs:63
SourceMaterial.Row matBridge
Definition: Point.cs:59
SourceObj.Row sourceObj
Definition: Point.cs:69
SourceFloor.Row sourceFloor
Definition: Point.cs:65
bool HasBlock
Definition: Point.cs:141
SourceFloor.Row sourceBridge
Definition: Point.cs:67
GrowSystem growth
Definition: Point.cs:77
Definition: Rand.cs:4
static int Range(int min, int max)
Definition: Rand.cs:42
virtual string ReqHarvest
Definition: Trait.cs:291

References EClass._map, Element.Create(), SourceManager.elements, Card.Evalue(), SourceMaterial.Row.hardness, Card.material, EClass.pc, Rand.Range(), Trait.ReqHarvest, PlantData.size, EClass.sources, SourceMaterial.Row.tag, Card.Tool, tool, Card.trait, and Map.TryGetPlant().

Referenced by TaskHarvest.CanProgress(), GetText(), TaskDig.OnCreateProgress(), TaskHarvest.OnCreateProgress(), and TaskMine.OnCreateProgress().

Member Data Documentation

◆ difficulty

int BaseTaskHarvest.difficulty

Definition at line 31 of file BaseTaskHarvest.cs.

Referenced by TaskHarvest.OnCreateProgress().

◆ effectFrame

int BaseTaskHarvest.effectFrame = 1

Definition at line 33 of file BaseTaskHarvest.cs.

Referenced by TaskHarvest.OnCreateProgress().

◆ efficiency

int BaseTaskHarvest.efficiency

Definition at line 29 of file BaseTaskHarvest.cs.

◆ idEle

int BaseTaskHarvest.idEle

Definition at line 21 of file BaseTaskHarvest.cs.

Referenced by TaskHarvest.OnCreateProgress().

◆ isToolRequired

bool BaseTaskHarvest.isToolRequired

Definition at line 35 of file BaseTaskHarvest.cs.

◆ matHardness

int BaseTaskHarvest.matHardness

Definition at line 19 of file BaseTaskHarvest.cs.

◆ maxProgress

int BaseTaskHarvest.maxProgress

◆ reqElement

Element BaseTaskHarvest.reqElement

Definition at line 17 of file BaseTaskHarvest.cs.

◆ reqLv

int BaseTaskHarvest.reqLv

Definition at line 23 of file BaseTaskHarvest.cs.

◆ target

◆ tool

Thing BaseTaskHarvest.tool

Definition at line 37 of file BaseTaskHarvest.cs.

Referenced by TaskHarvest.CanProgress(), and GetBestTool().

◆ toolLv

int BaseTaskHarvest.toolLv

Definition at line 25 of file BaseTaskHarvest.cs.

Referenced by GetText().

Property Documentation

◆ CanPressRepeat

override bool BaseTaskHarvest.CanPressRepeat
get

Definition at line 59 of file BaseTaskHarvest.cs.

◆ CanReapSeed

virtual bool BaseTaskHarvest.CanReapSeed
get

Definition at line 53 of file BaseTaskHarvest.cs.

◆ CursorIcon

override CursorInfo BaseTaskHarvest.CursorIcon
get

Definition at line 63 of file BaseTaskHarvest.cs.

◆ harvestType

virtual HarvestType BaseTaskHarvest.harvestType
get

Definition at line 55 of file BaseTaskHarvest.cs.

◆ IsGrowth

virtual bool BaseTaskHarvest.IsGrowth
get

Definition at line 57 of file BaseTaskHarvest.cs.

◆ IsHarvest

bool BaseTaskHarvest.IsHarvest
get

Definition at line 51 of file BaseTaskHarvest.cs.

◆ IsTooHard

bool BaseTaskHarvest.IsTooHard
get

Definition at line 39 of file BaseTaskHarvest.cs.

40 {
41 get
42 {
44 {
45 return reqLv > toolLv;
46 }
47 return false;
48 }
49 }

Referenced by GetText().

◆ LeftHand

override int BaseTaskHarvest.LeftHand
get

Definition at line 61 of file BaseTaskHarvest.cs.


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