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

Public Member Functions

override string GetIdRecipe (Point p)
 
override bool CanManualCancel ()
 
override string GetBaseText (string str)
 
override string GetTextSmall (Card c)
 
override bool CanProgress ()
 
override HitResult GetHitResult ()
 
override void OnCreateProgress (Progress_Custom p)
 
string GetIdDismantled ()
 
bool ShouldGenerateDismantled (string dest)
 
bool HaveHarvestThing ()
 
void HarvestThing ()
 
- Public Member Functions inherited from BaseTaskHarvest
virtual string GetIdRecipe (Point p)
 
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 ()
 
override void OnStart ()
 
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 ()
 
HitResult GetHitResult (Point p)
 
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 ()
 
GetChild< T > ()
 
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, bool ignoreConnection=false, 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 ()
 
bool Perform (Chara _cc, Card _tc=null, Point _tp=null)
 
virtual bool ValidatePerform (Chara _cc, Card _tc, Point _tp)
 
virtual bool CanPerform ()
 
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 long GetSourceValue (long 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, bool shorten=false)
 
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 TaskHarvest TryGetAct (Chara c, Point p)
 
- Static Public Member Functions inherited from BaseTaskHarvest
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 long GetResistDamage (long 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 (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
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

bool wasReapSeed
 
bool wasCrime
 
bool harvestingCrop
 
HarvestType mode = HarvestType.Obj
 
- Public Attributes inherited from BaseTaskHarvest
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 IsObj [get]
 
bool IsReapSeed [get]
 
override HarvestType harvestType [get]
 
override int RightHand [get]
 
override int destDist [get]
 
override bool IsGrowth [get]
 
override bool IsHostileAct [get]
 
override bool Loop [get]
 
- Properties inherited from BaseTaskHarvest
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 ShouldEndMimicry [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]
 
- 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

- Public Types inherited from BaseTaskHarvest
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 }
 
- 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 3 of file TaskHarvest.cs.

Member Function Documentation

◆ CanManualCancel()

override bool TaskHarvest.CanManualCancel ( )
inlinevirtual

Reimplemented from AIAct.

Definition at line 98 of file TaskHarvest.cs.

99 {
100 return true;
101 }

◆ CanProgress()

override bool TaskHarvest.CanProgress ( )
inlinevirtual

Reimplemented from BaseTaskHarvest.

Definition at line 223 of file TaskHarvest.cs.

224 {
225 if (tool != null && tool.trait is TraitToolSickle && !pos.cell.CanReapSeed())
226 {
227 return false;
228 }
229 if (IsObj)
230 {
232 if (base.CanProgress())
233 {
234 return pos.HasObj;
235 }
236 return false;
237 }
238 if (target == null || !target.ExistsOnMap)
239 {
240 return false;
241 }
242 return base.CanProgress();
243 }
new Chara owner
Definition: AIAct.cs:14
void SetTarget(Chara c, Thing _tool=null)
bool ExistsOnMap
Definition: Card.cs:2137
Trait trait
Definition: Card.cs:54
bool CanReapSeed()
Definition: Cell.cs:1705
Definition: EClass.cs:6
static Chara pc
Definition: EClass.cs:15
bool HasObj
Definition: Point.cs:137
Cell cell
Definition: Point.cs:51
Point pos
Definition: TaskPoint.cs:11

References Cell.CanReapSeed(), Point.cell, Card.ExistsOnMap, Point.HasObj, IsObj, AIAct.owner, EClass.pc, TaskPoint.pos, BaseTaskHarvest.SetTarget(), BaseTaskHarvest.target, BaseTaskHarvest.tool, and Card.trait.

◆ GetBaseText()

override string TaskHarvest.GetBaseText ( string  str)
inlinevirtual

Reimplemented from BaseTaskHarvest.

Definition at line 103 of file TaskHarvest.cs.

104 {
105 if (IsReapSeed)
106 {
107 return "TaskHarvestSeed".lang();
108 }
109 if (mode == HarvestType.Disassemble)
110 {
111 return (HaveHarvestThing() ? "TaskDisassemble" : "TaskDisassemble_destroy").lang();
112 }
113 if (!base.IsHarvest)
114 {
115 return base.GetBaseText(str);
116 }
117 return "actHarvest".lang();
118 }
bool HaveHarvestThing()
Definition: TaskHarvest.cs:556
HarvestType mode
Definition: TaskHarvest.cs:11
bool IsReapSeed
Definition: TaskHarvest.cs:16

References HaveHarvestThing(), IsReapSeed, and mode.

◆ GetHitResult()

override HitResult TaskHarvest.GetHitResult ( )
inlinevirtual

Reimplemented from Task.

Definition at line 245 of file TaskHarvest.cs.

246 {
247 if (harvestingCrop && !base.IsHarvest)
248 {
249 return HitResult.Default;
250 }
251 if (IsObj)
252 {
253 if (base.IsHarvest)
254 {
255 return HitResult.Valid;
256 }
257 if (pos.HasObj)
258 {
259 return HitResult.Valid;
260 }
262 {
263 return HitResult.Valid;
264 }
265 return HitResult.Default;
266 }
267 if (target == null || !target.ExistsOnMap)
268 {
269 return HitResult.Default;
270 }
271 return HitResult.Valid;
272 }
HitResult
Definition: HitResult.cs:2
static BuildMenu Instance
Definition: BuildMenu.cs:77
bool godBuild
Definition: CoreDebug.cs:319
static CoreDebug debug
Definition: EClass.cs:49
bool HasDecal
Definition: Point.cs:139
bool harvestingCrop
Definition: TaskHarvest.cs:9

References EClass.debug, Card.ExistsOnMap, CoreDebug.godBuild, harvestingCrop, Point.HasDecal, Point.HasObj, BuildMenu.Instance, IsObj, TaskPoint.pos, and BaseTaskHarvest.target.

◆ GetIdDismantled()

string TaskHarvest.GetIdDismantled ( )
inline

Definition at line 499 of file TaskHarvest.cs.

500 {
501 if (target.HasElement(707))
502 {
503 return "fish_slice";
504 }
505 string[] array = target.source.components[0].Split('|');
506 for (int i = 0; i < array.Length; i++)
507 {
508 array[i] = array[i].Split('/')[0];
509 }
510 string result = array[0];
511 if (array.Length > 1)
512 {
513 string category = target.material.category;
514 bool flag = category == "rock" || category == "ore" || category == "gem";
515 if (array[0] == "ingot" && array[1] == "log" && !flag)
516 {
517 result = array[1];
518 }
519 }
521 {
522 result = target.material.thing;
523 }
524 return result;
525 }
SourceMaterial.Row material
Definition: Card.cs:2103
bool IsEquipmentOrRangedOrAmmo
Definition: Card.cs:2284
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6320
SourceThing.Row source
Definition: Thing.cs:11

References Card.HasElement(), Card.IsEquipmentOrRangedOrAmmo, Card.material, Thing.source, and BaseTaskHarvest.target.

Referenced by HarvestThing(), and HaveHarvestThing().

◆ GetIdRecipe()

override string TaskHarvest.GetIdRecipe ( Point  p)
inlinevirtual

Reimplemented from BaseTaskHarvest.

Definition at line 85 of file TaskHarvest.cs.

86 {
87 if (!IsObj)
88 {
89 if (target == null)
90 {
91 return "";
92 }
93 return target.source.RecipeID;
94 }
95 return p.sourceObj.RecipeID;
96 }
SourceObj.Row sourceObj
Definition: Point.cs:69

References IsObj, Thing.source, Point.sourceObj, and BaseTaskHarvest.target.

Referenced by OnCreateProgress().

◆ GetTextSmall()

override string TaskHarvest.GetTextSmall ( Card  c)
inlinevirtual

Reimplemented from BaseTaskHarvest.

Definition at line 120 of file TaskHarvest.cs.

121 {
122 if (IsObj)
123 {
124 return base.GetTextSmall(c);
125 }
126 if (target == null)
127 {
128 return "";
129 }
130 return target.Name;
131 }
string Name
Definition: Card.cs:2191

References IsObj, Card.Name, and BaseTaskHarvest.target.

◆ HarvestThing()

void TaskHarvest.HarvestThing ( )
inline

Definition at line 562 of file TaskHarvest.cs.

563 {
564 string text = GetIdDismantled();
565 if (target.id == "934" || target.id == "1002")
566 {
568 text = ThingGen.CreateFromCategory((EClass.rnd(2) == 0) ? "meal_cookie" : "meal_cake", 5 + EClass.rnd(EClass.rnd(50) + 1)).id;
569 Rand.SetSeed();
570 }
571 float num = target.Num;
572 float num2 = 1.0999999f;
573 if (target.trait.CraftNum > 1)
574 {
575 num2 = (float)target.trait.CraftNum * 1.35f;
576 }
577 switch (text)
578 {
579 case "log":
580 case "rock":
581 num2 = 2.1999998f;
582 break;
583 case "fish_slice":
584 num2 = 4.4f;
585 break;
586 }
587 string text2 = target.id;
588 if (text2 == "glass" || text2 == "brick")
589 {
590 num2 = 2.1999998f;
591 }
592 float num3 = num % num2;
593 num /= num2;
594 Debug.Log("num:" + num + " div:" + num3 + " chance:" + num2 + " check:" + (num2 - num3 + 1f));
595 if (num3 > 0f && EClass.rndf(num2 - num3 + 1f) < 1f)
596 {
597 num += 1f;
598 }
599 if (target.sockets != null)
600 {
602 }
603 int decay = target.decay;
604 int lV = target.LV;
605 target.Die(null, EClass.pc);
606 if ((int)num <= 0 || !ShouldGenerateDismantled(text))
607 {
608 return;
609 }
610 if (target.isCopy || target.HasElement(764))
611 {
612 text = "ash3";
613 }
615 {
616 fixedQuality = true
617 });
618 Thing thing = ThingGen.Create(text, 1, Mathf.Max(1, lV * 2 / 3));
619 if (thing == null)
620 {
621 return;
622 }
623 if (EClass._zone.IsUserZone && target.isNPCProperty && (thing.trait is TraitPotionLove || thing.HasTag(CTAG.rareResource)))
624 {
625 Msg.Say("spellbookCrumble", thing);
626 thing.Destroy();
627 return;
628 }
629 thing.SetNum((int)num);
631 thing.decay = decay;
632 if (thing.IsDecayed && thing.IsFood)
633 {
634 thing.elements.SetBase(73, -10);
635 }
637 }
CTAG
Definition: CTAG.cs:2
static void Set(CardBlueprint _bp=null)
bool IsDecayed
Definition: Card.cs:2357
ElementContainerCard elements
Definition: Card.cs:42
string id
Definition: Card.cs:36
bool isNPCProperty
Definition: Card.cs:557
virtual void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
Definition: Card.cs:5216
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3210
bool isCopy
Definition: Card.cs:881
void EjectSockets()
Definition: Card.cs:3750
Thing SetNum(int a)
Definition: Card.cs:3669
int decay
Definition: Card.cs:221
bool IsFood
Definition: Card.cs:2229
bool HasTag(CTAG tag)
Definition: Card.cs:2728
Point pos
Definition: Card.cs:60
int uid
Definition: Card.cs:125
void Destroy()
Definition: Card.cs:5284
int Num
Definition: Card.cs:161
List< int > sockets
Definition: Card.cs:48
int LV
Definition: Card.cs:389
static Zone _zone
Definition: EClass.cs:21
static Map _map
Definition: EClass.cs:19
static int rnd(long a)
Definition: EClass.cs:59
static float rndf(float a)
Definition: EClass.cs:102
Element SetBase(string alias, int v, int potential=0)
void TrySmoothPick(Cell cell, Thing t, Chara c)
Definition: Map.cs:1849
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
bool IsBlocked
Definition: Point.cs:363
Definition: Rand.cs:4
static void SetSeed(int a=-1)
Definition: Rand.cs:44
string GetIdDismantled()
Definition: TaskHarvest.cs:499
bool ShouldGenerateDismantled(string dest)
Definition: TaskHarvest.cs:527
static Thing CreateFromCategory(string idCat, int lv=-1)
Definition: ThingGen.cs:75
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8
virtual int CraftNum
Definition: Trait.cs:135
virtual bool IsUserZone
Definition: Zone.cs:275

References EClass._map, EClass._zone, Card.ChangeMaterial(), Trait.CraftNum, ThingGen.Create(), ThingGen.CreateFromCategory(), Debug, Card.decay, Card.Destroy(), Card.Die(), Card.EjectSockets(), Card.elements, GetIdDismantled(), Card.HasElement(), Card.HasTag(), Card.id, Point.IsBlocked, Card.isCopy, Card.IsDecayed, Card.IsFood, Card.isNPCProperty, Zone.IsUserZone, Card.LV, Card.material, Card.Num, AIAct.owner, EClass.pc, Card.pos, TaskPoint.pos, EClass.rnd(), EClass.rndf(), Msg.Say(), CardBlueprint.Set(), ElementContainer.SetBase(), Card.SetNum(), Rand.SetSeed(), ShouldGenerateDismantled(), Card.sockets, BaseTaskHarvest.target, Card.trait, Map.TrySmoothPick(), and Card.uid.

Referenced by OnCreateProgress().

◆ HaveHarvestThing()

bool TaskHarvest.HaveHarvestThing ( )
inline

Definition at line 556 of file TaskHarvest.cs.

557 {
558 string idDismantled = GetIdDismantled();
559 return ShouldGenerateDismantled(idDismantled);
560 }

References GetIdDismantled(), and ShouldGenerateDismantled().

Referenced by GetBaseText().

◆ OnCreateProgress()

override void TaskHarvest.OnCreateProgress ( Progress_Custom  p)
inlinevirtual

Reimplemented from AIAct.

Definition at line 274 of file TaskHarvest.cs.

275 {
277 string i = (IsObj ? pos.cell.GetObjName() : target.Name);
278 SourceMaterial.Row mat = ((!IsObj) ? target.material : (pos.cell.isObjDyed ? pos.sourceObj.DefaultMaterial : pos.cell.matObj));
279 GrowSystem growth = pos.growth;
280 float num = (base.IsHarvest ? 0.5f : ((!IsObj) ? 1f : ((growth != null) ? growth.MtpProgress : 1f)));
281 int exp = 50;
284 p.textHint = i;
285 p.maxProgress = (int)((float)(maxProgress * 150) * num / 100f);
286 p.interval = 1;
287 p.onProgressBegin = delegate
288 {
289 if (TryGetAct(owner, pos) == null)
290 {
291 p.Cancel();
292 }
293 else if (base.IsTooHard)
294 {
295 owner.Say((mode == HarvestType.Disassemble) ? "tooHardToDisassemble" : "tooHardToHarvest", owner, i);
296 p.Cancel();
297 }
298 else if (mode == HarvestType.Disassemble)
299 {
300 owner.Say("disassemble_start", owner, owner.Tool, i);
301 }
302 else if (owner.Tool == null)
303 {
304 owner.Say("harvestHand_start", owner, i);
305 }
306 else
307 {
308 owner.Say("harvest_start", owner, owner.Tool, i);
309 }
310 };
311 p.onProgress = delegate(Progress_Custom _p)
312 {
315 if (_p.progress % 2 == 0)
316 {
317 if (IsObj)
318 {
319 if (base.IsHarvest && growth != null)
320 {
322 if (growth.AnimeProgress != 0)
323 {
324 pos.Animate(growth.AnimeProgress);
325 }
326 return;
327 }
328 pos.Animate(AnimeID.HitObj);
329 }
330 else
331 {
332 target.PlayAnime(AnimeID.HitObj);
333 }
335 mat.PlayHitEffect(pos);
336 mat.AddBlood(pos);
337 effectFrame += maxProgress / 4 + 1;
338 if (EClass._zone.IsCrime(owner, this))
339 {
341 }
342 }
343 };
344 p.onProgressComplete = delegate
345 {
346 string idRecipe = GetIdRecipe(pos);
348 int num2 = ((EClass.rnd(3) != 0) ? 1 : 0);
349 if (IsObj)
350 {
351 SourceObj.Row sourceObj = pos.sourceObj;
352 bool flag = false;
353 if (difficulty >= 0 && EClass.rnd(6) == 0)
354 {
355 flag = true;
356 }
357 if (difficulty >= 2 && EClass.rnd(3) == 0)
358 {
359 flag = true;
360 }
361 if (flag && growth != null)
362 {
363 growth.OnHitFail(owner);
364 }
365 if (EClass._zone is Zone_Harvest && !base.IsHarvest && pos.IsFarmField)
366 {
368 pos.SetObj();
369 }
370 else
371 {
372 if (base.IsHarvest && !IsReapSeed)
373 {
374 if (pos.growth.CanHarvest())
375 {
376 harvestingCrop = true;
377 }
379 }
380 else if (growth != null && !IsReapSeed)
381 {
383 }
384 else
385 {
386 EClass._map.MineObj(pos, this);
387 }
388 if (sourceObj.alias == "mound")
389 {
390 if (EClass.rnd(7) == 0)
391 {
392 EClass._zone.AddThing("plat", pos);
393 }
394 else if (EClass.rnd(3) == 0)
395 {
397 }
398 else
399 {
400 EClass._zone.AddThing("bone", pos);
401 }
402 }
403 }
404 }
405 else
406 {
407 exp = target.Num * 5;
408 num2 = target.Num / 3 + EClass.rnd(target.Num / 3 + 2);
410 {
411 HarvestThing();
412 }
413 }
414 if (EClass._zone.IsCrime(owner, this) && EClass.rnd(3) != 0)
415 {
417 }
418 if (backerObj != null)
419 {
420 if (backerObj != null && !backerObj.loot.IsEmpty() && !EClass.player.doneBackers.Contains(backerObj.id))
421 {
422 if (EClass.sources.cards.map.ContainsKey(backerObj.loot))
423 {
424 Thing thing = ThingGen.Create(backerObj.loot);
425 switch (backerObj.id)
426 {
427 case 490:
428 case 867:
429 case 5160:
430 thing.c_charges = 0;
431 thing.c_priceFix = -100;
432 break;
433 case 2531:
434 thing.MakeFoodFrom("cloud_electric");
435 break;
436 case 1027:
437 thing.ChangeMaterial(25);
438 thing.SetBlessedState(BlessedState.Doomed);
439 thing.ChangeRarity(Rarity.Legendary);
440 break;
441 case 4565:
442 EClass._zone.AddThing("rod", pos);
443 EClass._zone.AddThing("money", pos).SetNum(121);
444 break;
445 case 5367:
446 thing.Dye("obsidian");
447 break;
448 case 471:
449 case 1828:
450 case 5765:
451 thing.SetBlessedState(BlessedState.Cursed);
452 break;
453 case 5529:
454 thing.ChangeMaterial(25);
455 break;
456 case 1854:
457 thing.decay = 10000;
458 break;
459 case 4788:
460 thing.SetEncLv(1);
461 break;
462 case 4615:
463 thing.ChangeMaterial("meat");
464 break;
465 }
466 EClass._zone.AddCard(thing, pos);
467 }
468 else
469 {
470 Debug.LogError("exception: Backer Loot not valid:" + backerObj.id + "/" + backerObj.loot);
471 }
472 Debug.Log(backerObj.id + "/" + backerObj.Name + "/" + backerObj.loot);
473 }
474 EClass.player.doneBackers.Add(backerObj.id);
475 if (!backerObj.Text.IsEmpty() && EClass.core.config.backer.Show(backerObj))
476 {
477 bool num3 = backerObj.type == 1;
478 Msg.Say(num3 ? "backerRemain_read" : "backerTree_read");
479 Msg.Say(num3 ? "backerRemain" : "backerTree", backerObj.Text);
480 }
481 }
482 if (owner.IsPC)
483 {
485 }
487 if (wasReapSeed)
488 {
489 owner.ModExp(286, 20);
490 }
491 owner.stamina.Mod(-num2);
492 if (owner != null && owner.IsPC)
493 {
495 }
496 };
497 }
AnimeID
Definition: AnimeID.cs:2
BlessedState
Definition: BlessedState.cs:2
Rarity
Definition: Rarity.cs:2
virtual Status Cancel()
Definition: AIAct.cs:305
int progress
Definition: AIProgress.cs:5
virtual void NextFrame()
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6578
Thing Tool
Definition: Card.cs:2480
void CalculateFOV()
Definition: Card.cs:6911
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:4069
void Dye(string idMat)
Definition: Card.cs:6411
void SetEncLv(int a)
Definition: Card.cs:4038
Card MakeFoodFrom(string _id)
Definition: Card.cs:5781
void ModExp(string alias, int a)
Definition: Card.cs:2781
void PlayAnime(AnimeID id, bool force=false)
Definition: Card.cs:6597
virtual void ChangeRarity(Rarity q)
Definition: Card.cs:4094
CardRenderer renderer
Definition: Card.cs:64
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7256
SourceMaterial.Row matObj
Definition: Cell.cs:1046
string GetObjName()
Definition: Cell.cs:1640
bool isObjDyed
Definition: Cell.cs:626
override bool IsPC
Definition: Chara.cs:630
Stats stamina
Definition: Chara.cs:1181
override void LookAt(Card c)
Definition: Chara.cs:3725
BackerContentConfig backer
Definition: CoreConfig.cs:621
CoreConfig config
Definition: Core.cs:70
static Game game
Definition: EClass.cs:9
static Core core
Definition: EClass.cs:7
static SourceManager sources
Definition: EClass.cs:43
static Player player
Definition: EClass.cs:13
void ModExp(int ele, float a, bool chain=false)
bool disableUsermapBenefit
GamePrincipal principal
Definition: Game.cs:225
bool CanHarvest()
Definition: GrowSystem.cs:520
virtual AnimeID AnimeProgress
Definition: GrowSystem.cs:113
virtual void OnHitFail(Chara c)
Definition: GrowSystem.cs:538
void OnProgressComplete(Chara c)
Definition: GrowSystem.cs:542
virtual string GetSoundProgress()
Definition: GrowSystem.cs:139
void Harvest(Chara c)
Definition: GrowSystem.cs:637
void DestroyObj(Point point)
Definition: Map.cs:1870
void MineObj(Point point, Task task=null, Chara c=null)
Definition: Map.cs:1885
SourceBacker.Row GetBackerObj(Point p)
Definition: Map.cs:1637
RecipeManager recipes
Definition: Player.cs:1164
void ModKarma(int a)
Definition: Player.cs:2610
HashSet< int > doneBackers
Definition: Player.cs:1140
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:934
bool IsFarmField
Definition: Point.cs:127
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1259
bool TryWitnessCrime(Chara criminal, Chara target=null, int radius=4, Func< Chara, bool > funcWitness=null)
Definition: Point.cs:878
void Animate(AnimeID id, bool animeBlock=false)
Definition: Point.cs:1308
GrowSystem growth
Definition: Point.cs:77
void ComeUpWithRecipe(string idRecipe, int chanceForRandomRecipe=0)
Dictionary< string, CardRow > map
Definition: SourceCard.cs:9
SourceCard cards
string GetSoundImpact(RenderRow c=null)
void AddBlood(Point p, int a=1)
void PlayHitEffect(Point p, int emit=2)
virtual void Mod(int a)
Definition: Stats.cs:135
bool wasReapSeed
Definition: TaskHarvest.cs:5
override string GetIdRecipe(Point p)
Definition: TaskHarvest.cs:85
override bool IsHostileAct
Definition: TaskHarvest.cs:40
void HarvestThing()
Definition: TaskHarvest.cs:562
bool wasCrime
Definition: TaskHarvest.cs:7
static TaskHarvest TryGetAct(Chara c, Point p)
Definition: TaskHarvest.cs:133
string alias
Definition: TileRow.cs:12
Card AddThing(string id, int x, int z)
Definition: Zone.cs:2076
bool IsCrime(Chara c, Act act)
Definition: Zone.cs:3714
Card AddCard(Card t, Point point)
Definition: Zone.cs:2086

References EClass._map, EClass._zone, SourceMaterial.Row.AddBlood(), Zone.AddCard(), Zone.AddThing(), TileRow.alias, Point.Animate(), GrowSystem.AnimeProgress, CoreConfig.backer, Card.CalculateFOV(), AIAct.Cancel(), GrowSystem.CanHarvest(), SourceManager.cards, Point.cell, Card.ChangeMaterial(), Card.ChangeRarity(), RecipeManager.ComeUpWithRecipe(), Core.config, EClass.core, ThingGen.Create(), ThingGen.CreateFromCategory(), Debug, Map.DestroyObj(), BaseTaskHarvest.difficulty, GamePrincipal.disableUsermapBenefit, Player.doneBackers, Card.Dye(), BaseTaskHarvest.effectFrame, Card.elements, EClass.game, Map.GetBackerObj(), GetIdRecipe(), Cell.GetObjName(), SourceMaterial.Row.GetSoundImpact(), GrowSystem.GetSoundProgress(), Point.growth, GrowSystem.Harvest(), harvestingCrop, HarvestThing(), SourceBacker.Row.id, BaseTaskHarvest.idEle, Zone.IsCrime(), Point.IsFarmField, IsHostileAct, Card.isNPCProperty, IsObj, Cell.isObjDyed, Chara.IsPC, IsReapSeed, Zone.IsUserZone, Chara.LookAt(), SourceBacker.Row.loot, Card.MakeFoodFrom(), SourceCard.map, Card.material, Cell.matObj, BaseTaskHarvest.maxProgress, Map.MineObj(), Stats.Mod(), mode, ElementContainer.ModExp(), Card.ModExp(), Player.ModKarma(), Card.Name, SourceBacker.Row.Name, CardRenderer.NextFrame(), Card.Num, GrowSystem.OnHitFail(), GrowSystem.OnProgressComplete(), AIAct.owner, EClass.pc, Card.PlayAnime(), EClass.player, SourceMaterial.Row.PlayHitEffect(), Point.PlaySound(), Card.PlaySound(), Card.pos, TaskPoint.pos, Game.principal, AIProgress.progress, Player.recipes, Card.renderer, EClass.rnd(), Msg.Say(), Card.Say(), Card.SetBlessedState(), Card.SetEncLv(), Card.SetNum(), Point.SetObj(), BaseTaskHarvest.SetTarget(), CoreConfig.BackerContentConfig.Show(), Point.sourceObj, EClass.sources, Chara.stamina, BaseTaskHarvest.target, SourceBacker.Row.Text, Card.Tool, TryGetAct(), Point.TryWitnessCrime(), wasCrime, and wasReapSeed.

◆ ShouldGenerateDismantled()

bool TaskHarvest.ShouldGenerateDismantled ( string  dest)
inline

Definition at line 527 of file TaskHarvest.cs.

528 {
530 {
531 return false;
532 }
533 if (target.trait is TraitGrave)
534 {
535 return false;
536 }
538 {
539 return false;
540 }
541 if (dest.Contains("$") || dest.Contains("#") || dest.Contains("@") || dest.Contains("-"))
542 {
543 return false;
544 }
545 if (dest == target.id || !EClass.sources.cards.map.ContainsKey(dest))
546 {
547 return false;
548 }
549 if (target.source.components.IsEmpty())
550 {
551 return false;
552 }
553 return true;
554 }

References SourceManager.cards, Card.id, SourceCard.map, Thing.source, EClass.sources, BaseTaskHarvest.target, and Card.trait.

Referenced by HarvestThing(), and HaveHarvestThing().

◆ TryGetAct()

static TaskHarvest TaskHarvest.TryGetAct ( Chara  c,
Point  p 
)
inlinestatic

Definition at line 133 of file TaskHarvest.cs.

134 {
135 Thing t = c.Tool;
136 bool hasTool = t != null && (t.HasElement(225) || t.HasElement(220));
137 bool hasDiggingTool = t != null && t.HasElement(230);
138 if (t != null)
139 {
140 if (t.trait is TraitToolBrush)
141 {
142 return null;
143 }
144 if (t.trait is TraitToolShears)
145 {
146 return null;
147 }
148 if (t.trait is TraitToolWaterCan)
149 {
150 return null;
151 }
152 if (t.trait is TraitToolMusic)
153 {
154 return null;
155 }
156 if (t.trait is TraitToolSickle && !p.cell.CanReapSeed())
157 {
158 return null;
159 }
160 if (t.trait is TraitAbility)
161 {
162 return null;
163 }
164 }
166 {
167 return null;
168 }
169 if (p.HasObj && IsValidTarget(p.sourceObj.reqHarvest))
170 {
171 return new TaskHarvest
172 {
173 pos = p.Copy()
174 };
175 }
176 if (p.HasThing)
177 {
178 for (int num = p.Things.Count - 1; num >= 0; num--)
179 {
180 t = p.Things[num];
181 if (t.trait.ReqHarvest != null && IsValidTarget(t.trait.ReqHarvest.Split(',')))
182 {
183 return new TaskHarvest
184 {
185 pos = p.Copy(),
186 mode = HarvestType.Thing,
187 target = t
188 };
189 }
190 }
191 for (int num2 = p.Things.Count - 1; num2 >= 0; num2--)
192 {
193 t = p.Things[num2];
195 {
196 return new TaskHarvest
197 {
198 pos = p.Copy(),
199 mode = HarvestType.Disassemble,
200 target = t
201 };
202 }
203 }
204 }
205 return null;
206 bool IsValidTarget(string[] raw)
207 {
208 if (raw[0] == "digging")
209 {
210 return hasDiggingTool;
211 }
212 bool num3 = p.cell.CanHarvest();
213 int num4 = (num3 ? 250 : EClass.sources.elements.alias[raw[0]].id);
214 bool flag = ((!num3 && num4 != 250) ? true : false);
215 if (!flag && t != null && !t.trait.CanHarvest)
216 {
217 return false;
218 }
219 return !flag || hasTool;
220 }
221 }
bool isMasked
Definition: Card.cs:593
bool isHidden
Definition: Card.cs:533
bool CanHarvest()
Definition: Cell.cs:1700
HotItem currentHotItem
Definition: Player.cs:1167
Point Copy()
Definition: Point.cs:491
List< Thing > Things
Definition: Point.cs:338
bool HasThing
Definition: Point.cs:251
SourceElement elements
virtual bool CanHarvest
Definition: Trait.cs:92
virtual bool CanBeDisassembled
Definition: Trait.cs:318
virtual string ReqHarvest
Definition: Trait.cs:315

References Trait.CanBeDisassembled, Cell.CanHarvest(), Trait.CanHarvest, Cell.CanReapSeed(), Point.cell, Point.Copy(), Player.currentHotItem, SourceManager.elements, Card.HasElement(), Point.HasObj, Point.HasThing, Card.isHidden, Card.isMasked, Chara.IsPC, mode, EClass.player, TaskPoint.pos, Trait.ReqHarvest, Point.sourceObj, EClass.sources, BaseTaskHarvest.target, Point.Things, Card.Tool, and Card.trait.

Referenced by OnCreateProgress(), and HotItemHeld.TrySetToolAct().

Member Data Documentation

◆ harvestingCrop

bool TaskHarvest.harvestingCrop

Definition at line 9 of file TaskHarvest.cs.

Referenced by GetHitResult(), and OnCreateProgress().

◆ mode

HarvestType TaskHarvest.mode = HarvestType.Obj

Definition at line 11 of file TaskHarvest.cs.

Referenced by GetBaseText(), OnCreateProgress(), and TryGetAct().

◆ wasCrime

bool TaskHarvest.wasCrime

Definition at line 7 of file TaskHarvest.cs.

Referenced by OnCreateProgress().

◆ wasReapSeed

bool TaskHarvest.wasReapSeed

Definition at line 5 of file TaskHarvest.cs.

Referenced by OnCreateProgress().

Property Documentation

◆ destDist

override int TaskHarvest.destDist
get

Definition at line 35 of file TaskHarvest.cs.

◆ harvestType

override HarvestType TaskHarvest.harvestType
get

Definition at line 31 of file TaskHarvest.cs.

◆ IsGrowth

override bool TaskHarvest.IsGrowth
get

Definition at line 37 of file TaskHarvest.cs.

◆ IsHostileAct

override bool TaskHarvest.IsHostileAct
get

Definition at line 39 of file TaskHarvest.cs.

40 {
41 get
42 {
43 if (!wasCrime)
44 {
45 if (mode == HarvestType.Disassemble)
46 {
47 Thing thing = target;
48 if (thing != null && thing.isNPCProperty)
49 {
50 goto IL_007b;
51 }
52 }
53 if (mode == HarvestType.Obj)
54 {
55 if (!pos.sourceObj.ContainsTag("crime"))
56 {
57 if (pos.growth != null && pos.growth.IsCrimeToHarvest)
58 {
59 return !(EClass._zone is Zone_Harvest);
60 }
61 return false;
62 }
63 return true;
64 }
65 return false;
66 }
67 goto IL_007b;
68 IL_007b:
69 return true;
70 }
71 }
virtual bool IsCrimeToHarvest
Definition: GrowSystem.cs:103

Referenced by OnCreateProgress().

◆ IsObj

bool TaskHarvest.IsObj
get

Definition at line 13 of file TaskHarvest.cs.

Referenced by CanProgress(), GetHitResult(), GetIdRecipe(), GetTextSmall(), and OnCreateProgress().

◆ IsReapSeed

bool TaskHarvest.IsReapSeed
get

Definition at line 15 of file TaskHarvest.cs.

16 {
17 get
18 {
19 if (IsObj && CanReapSeed && owner.Tool != null)
20 {
22 {
23 return owner.Tool.category.IsChildOf("scythe");
24 }
25 return true;
26 }
27 return false;
28 }
29 }
virtual bool CanReapSeed
SourceCategory.Row category
Definition: Card.cs:2101

Referenced by GetBaseText(), and OnCreateProgress().

◆ Loop

override bool TaskHarvest.Loop
get

Definition at line 73 of file TaskHarvest.cs.

74 {
75 get
76 {
78 {
79 return CanProgress();
80 }
81 return false;
82 }
83 }
bool IsSurvival
Definition: Game.cs:276
override bool CanProgress()
Definition: TaskHarvest.cs:223

◆ RightHand

override int TaskHarvest.RightHand
get

Definition at line 33 of file TaskHarvest.cs.


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