72 return base.GetText(str);
80 public override string GetText(
string str =
"")
91 switch (recipeLearnState)
94 text = text +
" " +
"TaskDisassemble_newrecipe".lang();
97 text = text +
" " + (
"TaskDisassemble_" + recipeLearnState).lang();
106 text = text.TagColor(
Color.gray);
124 task.SetTarget(c, t);
125 if (task.efficiency > best)
127 best = task.efficiency;
146 string[] array =
null;
148 switch (this.harvestType)
151 array = pos.sourceObj.reqHarvest;
152 row = (pos.cell.isObjDyed ? pos.sourceObj.DefaultMaterial : pos.cell.matObj);
163 array =
new string[2] {
"handicraft",
"1" };
167 if (pos.cell.HasBridge)
169 array = pos.sourceBridge.reqHarvest;
174 array = pos.sourceFloor.reqHarvest;
181 array = pos.sourceBlock.reqHarvest;
185 array =
new string[pos.sourceFloor.reqHarvest.Length];
186 Array.Copy(pos.sourceFloor.reqHarvest, array, pos.sourceFloor.reqHarvest.Length);
194 matHardness = matHardness * ((pos.growth !=
null) ? pos.growth.GetHp() : pos.sourceObj.hp) / 100;
196 if (row.
tag.Contains(
"hard"))
201 if ((uint)harvestType <= 1u && row.id == 0)
207 int num = array[1].ToInt();
208 reqLv = matHardness + num;
209 isToolRequired = ((!IsHarvest && idEle != 250) ?
true :
false);
213 int num2 = ((idEle == 220 || idEle == 225) ? GetToolEfficiency(
tool, row) : 100);
214 toolLv += tool.material.hardness * num2 / 100;
215 toolLv += (int)(
tool.encLV +
tool.blessedState);
217 toolLv += c.
Evalue(idEle) * 3 / 2;
222 efficiency = (toolLv + 5) * 100 / ((reqLv + 5) * 140 / 100);
231 else if (efficiency > 150)
235 else if (efficiency > 100)
244 if (this.harvestType ==
HarvestType.Obj && IsHarvest && plantData !=
null && plantData.
size > 0)
246 maxProgress = (int)Mathf.Clamp(
Rand.
Range(8f, 10f) * (float)(100 + plantData.
size * 100 + plantData.
size * plantData.
size * 30) / (float)efficiency, 2f, 1000f);
250 maxProgress = (int)Mathf.Clamp(
Rand.
Range(8f, 16f) * 100f / (float)efficiency, 2f, 30f);
256 string[] array = _raw.Split(
',');
262 int[] toolEfficiency = GetToolEfficiency(mat);
266 toolEfficiency[0] = 0;
270 toolEfficiency[1] = 0;
274 toolEfficiency[0] = 50 + owner.Evalue(261);
277 int[] array = toolEfficiency;
278 foreach (
int num2
in array)
290 if (
tool != owner.Tool)
294 return base.CanProgress();
299 if (
tool != owner.Tool)
307 switch (mat.category)
310 return new int[2] { 100, 50 };
315 return new int[2] { 100, 25 };
318 return new int[2] { 50, 100 };
322 return new int[2] { 25, 100 };
325 return new int[2] { 100, 100 };
327 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