Elin Decompiled Documentation EA 23.200 Stable
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)
 
void AddEncNote (UINote n, Card Card, ElementContainer.NoteMode mode=ElementContainer.NoteMode.Default, Func< Element, string, string > funcText=null, Action< UINote, Element > onAddNote=null)
 
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, bool useWeight=true)
 
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 rndSeed (int a, int seed)
 
static int rnd (long a)
 
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 string IdRecipe [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 Act CurrentAct
 
- 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 274 of file BaseTaskHarvest.cs.

275 {
276 if (tool != owner.Tool)
277 {
278 return false;
279 }
280 return base.CanProgress();
281 }
new Chara owner
Definition: AIAct.cs:14
Thing Tool
Definition: Card.cs:2372

References tool.

◆ GetBaseText()

virtual string BaseTaskHarvest.GetBaseText ( string  str)
inlinevirtual

Reimplemented in TaskHarvest.

Definition at line 67 of file BaseTaskHarvest.cs.

68 {
69 return base.GetText(str);
70 }

Referenced by GetText().

◆ GetBestTool()

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

Definition at line 97 of file BaseTaskHarvest.cs.

98 {
100 {
101 pos = p
102 };
103 task.SetOwner(c);
104 Thing tool = null;
105 int best = 0;
106 c.things.Foreach(delegate(Thing t)
107 {
108 if (t.trait is TraitTool)
109 {
110 task.SetTarget(c, t);
111 if (task.efficiency > best)
112 {
113 best = task.efficiency;
114 tool = t;
115 }
116 }
117 });
118 return tool;
119 }
void SetOwner(Chara c)
Definition: AIAct.cs:179
Trait trait
Definition: Card.cs:51
ThingContainer things
Definition: Card.cs:36
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 240 of file BaseTaskHarvest.cs.

241 {
242 string[] array = _raw.Split(',');
243 return EClass.sources.elements.alias[array[0]].id;
244 }
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 77 of file BaseTaskHarvest.cs.

78 {
79 if (owner == null)
80 {
81 owner = EClass.pc;
82 }
84 string text = "tHarvest".lang(GetBaseText(str), (EClass.pc.Tool == null) ? "hand".lang() : owner.Tool.NameSimple, toolLv.ToString() ?? "");
86 {
87 text = text + " " + "TaskDisassemble_newrecipe".lang();
88 }
89 text = text + " (" + GetTextDifficulty() + ")";
90 if (IsTooHard)
91 {
92 text = text.TagColor(Color.gray);
93 }
94 return text;
95 }
string GetTextDifficulty()
virtual string GetBaseText(string str)
virtual string IdRecipe
void SetTarget(Chara c, Thing _tool=null)
bool HasElement(int ele, int req=1)
Definition: Card.cs:5725
string NameSimple
Definition: Card.cs:2101
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
RecipeManager recipes
Definition: Player.cs:1053
bool CanCeomUpWithRecipe(string idRecipe)

References RecipeManager.CanCeomUpWithRecipe(), Color, GetBaseText(), GetTextDifficulty(), Card.HasElement(), IdRecipe, IsTooHard, Card.NameSimple, AIAct.owner, EClass.pc, EClass.player, Player.recipes, SetTarget(), Card.Tool, and toolLv.

◆ GetTextDifficulty()

string BaseTaskHarvest.GetTextDifficulty ( )
inline

Definition at line 309 of file BaseTaskHarvest.cs.

310 {
311 return Lang.GetList("skillDiff")[difficulty];
312 }
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 72 of file BaseTaskHarvest.cs.

73 {
74 return pos.cell.GetObjName();
75 }
string GetObjName()
Definition: Cell.cs:1604
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 283 of file BaseTaskHarvest.cs.

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

◆ GetToolEfficiency() [2/2]

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

Definition at line 246 of file BaseTaskHarvest.cs.

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

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

◆ SetTarget()

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

Definition at line 121 of file BaseTaskHarvest.cs.

122 {
123 if (c == null)
124 {
125 c = EClass.pc;
126 }
127 if (_tool == null)
128 {
129 _tool = c.Tool;
130 }
131 tool = _tool;
132 string[] array = null;
133 SourceMaterial.Row row = null;
134 switch (this.harvestType)
135 {
136 case HarvestType.Obj:
137 array = pos.sourceObj.reqHarvest;
138 row = pos.cell.matObj;
139 break;
140 case HarvestType.Thing:
141 array = target.trait.ReqHarvest.Split(',');
142 row = target.material;
143 break;
144 case HarvestType.Disassemble:
145 if (target == null)
146 {
147 return;
148 }
149 array = new string[2] { "handicraft", "1" };
150 row = target.material;
151 break;
152 case HarvestType.Floor:
153 if (pos.cell.HasBridge)
154 {
155 array = pos.sourceBridge.reqHarvest;
156 row = pos.matBridge;
157 }
158 else
159 {
160 array = pos.sourceFloor.reqHarvest;
161 row = pos.matFloor;
162 }
163 break;
164 case HarvestType.Block:
165 if (pos.HasBlock)
166 {
167 array = pos.sourceBlock.reqHarvest;
168 row = pos.matBlock;
169 break;
170 }
171 array = new string[pos.sourceFloor.reqHarvest.Length];
172 Array.Copy(pos.sourceFloor.reqHarvest, array, pos.sourceFloor.reqHarvest.Length);
173 array[0] = "mining";
174 row = pos.matFloor;
175 break;
176 }
177 matHardness = row.hardness;
178 if (this.harvestType == HarvestType.Obj)
179 {
180 matHardness = matHardness * ((pos.growth != null) ? pos.growth.GetHp() : pos.sourceObj.hp) / 100;
181 }
182 if (row.tag.Contains("hard"))
183 {
184 matHardness *= 3;
185 }
187 if ((uint)harvestType <= 1u && row.id == 0)
188 {
189 matHardness *= 100;
190 }
191 idEle = (IsHarvest ? 250 : EClass.sources.elements.alias[array[0]].id);
193 int num = array[1].ToInt();
194 reqLv = matHardness + num;
195 isToolRequired = ((!IsHarvest && idEle != 250) ? true : false);
196 toolLv = 0;
197 if (tool != null)
198 {
199 int num2 = ((idEle == 220 || idEle == 225) ? GetToolEfficiency(tool, row) : 100);
200 toolLv += tool.material.hardness * num2 / 100;
201 toolLv += (int)(tool.encLV + tool.blessedState);
202 }
203 toolLv += c.Evalue(idEle) * 3 / 2;
204 if (toolLv < 0)
205 {
206 toolLv = 1;
207 }
208 efficiency = (toolLv + 5) * 100 / ((reqLv + 5) * 140 / 100);
209 if (efficiency < 50)
210 {
211 efficiency = 50;
212 }
213 if (IsTooHard)
214 {
215 difficulty = 3;
216 }
217 else if (efficiency > 150)
218 {
219 difficulty = 0;
220 }
221 else if (efficiency > 100)
222 {
223 difficulty = 1;
224 }
225 else
226 {
227 difficulty = 2;
228 }
230 if (this.harvestType == HarvestType.Obj && IsHarvest && plantData != null && plantData.size > 0)
231 {
232 maxProgress = (int)Mathf.Clamp(Rand.Range(8f, 10f) * (float)(100 + plantData.size * 100 + plantData.size * plantData.size * 30) / (float)efficiency, 2f, 1000f);
233 }
234 else
235 {
236 maxProgress = (int)Mathf.Clamp(Rand.Range(8f, 16f) * 100f / (float)efficiency, 2f, 30f);
237 }
238 }
virtual HarvestType harvestType
SourceMaterial.Row material
Definition: Card.cs:2013
int encLV
Definition: Card.cs:312
BlessedState blessedState
Definition: Card.cs:264
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:1100
virtual int GetHp()
Definition: GrowSystem.cs:719
PlantData TryGetPlant(Point p)
Definition: Map.cs:1942
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:302

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 61 of file BaseTaskHarvest.cs.

◆ CanReapSeed

virtual bool BaseTaskHarvest.CanReapSeed
get

Definition at line 55 of file BaseTaskHarvest.cs.

◆ CursorIcon

override CursorInfo BaseTaskHarvest.CursorIcon
get

Definition at line 65 of file BaseTaskHarvest.cs.

◆ harvestType

virtual HarvestType BaseTaskHarvest.harvestType
get

Definition at line 57 of file BaseTaskHarvest.cs.

◆ IdRecipe

virtual string BaseTaskHarvest.IdRecipe
get

Definition at line 53 of file BaseTaskHarvest.cs.

Referenced by GetText().

◆ IsGrowth

virtual bool BaseTaskHarvest.IsGrowth
get

Definition at line 59 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 63 of file BaseTaskHarvest.cs.


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