71 return base.GetText(str);
79 public override string GetText(
string str =
"")
90 switch (recipeLearnState)
93 text = text +
" " +
"TaskDisassemble_newrecipe".lang();
96 text = text +
" " + (
"TaskDisassemble_" + recipeLearnState).lang();
105 text = text.TagColor(
Color.gray);
123 task.SetTarget(c, t);
124 if (task.efficiency > best)
126 best = task.efficiency;
145 string[] array =
null;
147 switch (this.harvestType)
150 array = pos.sourceObj.reqHarvest;
151 row = (pos.cell.isObjDyed ? pos.sourceObj.DefaultMaterial : pos.cell.matObj);
162 array =
new string[2] {
"handicraft",
"1" };
166 if (pos.cell.HasBridge)
168 array = pos.sourceBridge.reqHarvest;
173 array = pos.sourceFloor.reqHarvest;
180 array = pos.sourceBlock.reqHarvest;
184 array = pos.sourceFloor.reqHarvest?.Clone() as
string[];
185 if (array !=
null && array.Length != 0)
194 Debug.LogWarning(
string.Format(
"#source {0} at {1} has no valid reqHarvest 'skill,level' ({2}), using default", this.harvestType, pos, (array ==
null) ?
"null" :
string.Join(
',', array)));
195 string text = this.harvestType
switch
197 HarvestType.Obj =>
"gathering",
198 HarvestType.Floor =>
"digging",
201 array =
new string[2] { text,
"1" };
206 matHardness = matHardness * ((pos.growth !=
null) ? pos.growth.GetHp() : pos.sourceObj.hp) / 100;
208 if (row.
tag.Contains(
"hard"))
213 if ((uint)harvestType <= 1u && row.id == 0)
219 int num = array[1].ToInt();
220 reqLv = matHardness + num;
221 isToolRequired = ((!IsHarvest && idEle != 250) ?
true :
false);
225 int num2 = ((idEle == 220 || idEle == 225) ? GetToolEfficiency(
tool, row) : 100);
226 toolLv += tool.material.hardness * num2 / 100;
227 toolLv += (int)(
tool.encLV +
tool.blessedState);
229 toolLv += c.
Evalue(idEle) * 3 / 2;
234 efficiency = (toolLv + 5) * 100 / ((reqLv + 5) * 140 / 100);
243 else if (efficiency > 150)
247 else if (efficiency > 100)
256 if (this.harvestType ==
HarvestType.Obj && IsHarvest && plantData !=
null && plantData.
size > 0)
258 maxProgress = (int)Mathf.Clamp(
Rand.
Range(8f, 10f) * (float)(100 + plantData.
size * 100 + plantData.
size * plantData.
size * 30) / (float)efficiency, 2f, 1000f);
262 maxProgress = (int)Mathf.Clamp(
Rand.
Range(8f, 16f) * 100f / (float)efficiency, 2f, 30f);
268 string[] array = _raw.Split(
',');
274 int[] toolEfficiency = GetToolEfficiency(mat);
278 toolEfficiency[0] = 0;
282 toolEfficiency[1] = 0;
286 toolEfficiency[0] = 50 + owner.Evalue(261);
289 int[] array = toolEfficiency;
290 foreach (
int num2
in array)
302 if (
tool != owner.Tool)
306 return base.CanProgress();
311 if (
tool != owner.Tool)
319 switch (mat.category)
322 return new int[2] { 100, 50 };
327 return new int[2] { 100, 25 };
330 return new int[2] { 50, 100 };
334 return new int[2] { 25, 100 };
337 return new int[2] { 100, 100 };
339 return new int[2] { 100, 100 };
override CursorInfo CursorIcon
string GetTextDifficulty()
override string GetTextSmall(Card c)
int GetToolEfficiency(Thing t, SourceMaterial.Row mat)
static Thing GetBestTool(Chara c, Point p)
virtual string GetBaseText(string str)
override bool CanPressRepeat
virtual HarvestType harvestType
virtual string GetIdRecipe(Point p)
override bool CanProgress()
int[] GetToolEfficiency(SourceMaterial.Row mat)
override string GetText(string str="")
void SetTarget(Chara c, Thing _tool=null)
static int GetReqEle(string _raw)
SourceMaterial.Row material
bool HasElement(int ele, bool includeNagative=false)
static SourceManager sources
static Element Create(int id, int v=0)
static string[] GetList(string id)
PlantData TryGetPlant(Point p)
static int Range(int min, int max)
LearnState GetRecipeLearnState(string idRecipe)
void Foreach(Action< Thing > action, bool onlyAccessible=true)
virtual string ReqHarvest