69 return base.GetText(str);
77 public override string GetText(
string str =
"")
88 switch (recipeLearnState)
91 text = text +
" " +
"TaskDisassemble_newrecipe".lang();
94 text = text +
" " + (
"TaskDisassemble_" + recipeLearnState).lang();
103 text = text.TagColor(
Color.gray);
121 task.SetTarget(c, t);
122 if (task.efficiency > best)
124 best = task.efficiency;
143 string[] array =
null;
145 switch (this.harvestType)
148 array = pos.sourceObj.reqHarvest;
149 row = pos.cell.matObj;
160 array =
new string[2] {
"handicraft",
"1" };
164 if (pos.cell.HasBridge)
166 array = pos.sourceBridge.reqHarvest;
171 array = pos.sourceFloor.reqHarvest;
178 array = pos.sourceBlock.reqHarvest;
182 array =
new string[pos.sourceFloor.reqHarvest.Length];
183 Array.Copy(pos.sourceFloor.reqHarvest, array, pos.sourceFloor.reqHarvest.Length);
191 matHardness = matHardness * ((pos.growth !=
null) ? pos.growth.GetHp() : pos.sourceObj.hp) / 100;
193 if (row.
tag.Contains(
"hard"))
198 if ((uint)harvestType <= 1u && row.id == 0)
204 int num = array[1].ToInt();
205 reqLv = matHardness + num;
206 isToolRequired = ((!IsHarvest && idEle != 250) ?
true :
false);
210 int num2 = ((idEle == 220 || idEle == 225) ? GetToolEfficiency(
tool, row) : 100);
211 toolLv += tool.material.hardness * num2 / 100;
212 toolLv += (int)(
tool.encLV +
tool.blessedState);
214 toolLv += c.
Evalue(idEle) * 3 / 2;
219 efficiency = (toolLv + 5) * 100 / ((reqLv + 5) * 140 / 100);
228 else if (efficiency > 150)
232 else if (efficiency > 100)
241 if (this.harvestType ==
HarvestType.Obj && IsHarvest && plantData !=
null && plantData.
size > 0)
243 maxProgress = (int)Mathf.Clamp(
Rand.
Range(8f, 10f) * (float)(100 + plantData.
size * 100 + plantData.
size * plantData.
size * 30) / (float)efficiency, 2f, 1000f);
247 maxProgress = (int)Mathf.Clamp(
Rand.
Range(8f, 16f) * 100f / (float)efficiency, 2f, 30f);
253 string[] array = _raw.Split(
',');
259 int[] toolEfficiency = GetToolEfficiency(mat);
263 toolEfficiency[0] = 0;
267 toolEfficiency[1] = 0;
271 toolEfficiency[0] = 50 + owner.Evalue(261);
274 int[] array = toolEfficiency;
275 foreach (
int num2
in array)
287 if (
tool != owner.Tool)
291 return base.CanProgress();
296 switch (mat.category)
299 return new int[2] { 100, 50 };
304 return new int[2] { 100, 25 };
307 return new int[2] { 50, 100 };
311 return new int[2] { 25, 100 };
314 return new int[2] { 100, 100 };
316 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
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)
bool HasElement(int ele, int req=1)
SourceMaterial.Row material
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