-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathFarmer.cs
6854 lines (6512 loc) · 284 KB
/
Farmer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Decompiled with JetBrains decompiler
// Type: StardewValley.Farmer
// Assembly: Stardew Valley, Version=1.5.6.22018, Culture=neutral, PublicKeyToken=null
// MVID: BEBB6D18-4941-4529-AC12-B54F0C61CC20
// Assembly location: C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley\Stardew Valley.dll
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Netcode;
using StardewValley.BellsAndWhistles;
using StardewValley.Buildings;
using StardewValley.Characters;
using StardewValley.Locations;
using StardewValley.Menus;
using StardewValley.Minigames;
using StardewValley.Monsters;
using StardewValley.Network;
using StardewValley.Objects;
using StardewValley.Quests;
using StardewValley.Tools;
using StardewValley.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Serialization;
using xTile.Dimensions;
using xTile.ObjectModel;
using xTile.Tiles;
namespace StardewValley
{
public class Farmer : Character, IComparable
{
public const int millisecondsPerSpeedUnit = 64;
public const byte halt = 64;
public const byte up = 1;
public const byte right = 2;
public const byte down = 4;
public const byte left = 8;
public const byte run = 16;
public const byte release = 32;
public const int farmingSkill = 0;
public const int miningSkill = 3;
public const int fishingSkill = 1;
public const int foragingSkill = 2;
public const int combatSkill = 4;
public const int luckSkill = 5;
public const float interpolationConstant = 0.5f;
public const int runningSpeed = 5;
public const int walkingSpeed = 2;
public const int caveNothing = 0;
public const int caveBats = 1;
public const int caveMushrooms = 2;
public const int millisecondsInvincibleAfterDamage = 1200;
public const int millisecondsPerFlickerWhenInvincible = 50;
public const int startingStamina = 270;
public const int totalLevels = 35;
public static int tileSlideThreshold = 32;
public const int maxInventorySpace = 36;
public const int hotbarSize = 12;
public const int eyesOpen = 0;
public const int eyesHalfShut = 4;
public const int eyesClosed = 1;
public const int eyesRight = 2;
public const int eyesLeft = 3;
public const int eyesWide = 5;
public const int rancher = 0;
public const int tiller = 1;
public const int butcher = 2;
public const int shepherd = 3;
public const int artisan = 4;
public const int agriculturist = 5;
public const int fisher = 6;
public const int trapper = 7;
public const int angler = 8;
public const int pirate = 9;
public const int baitmaster = 10;
public const int mariner = 11;
public const int forester = 12;
public const int gatherer = 13;
public const int lumberjack = 14;
public const int tapper = 15;
public const int botanist = 16;
public const int tracker = 17;
public const int miner = 18;
public const int geologist = 19;
public const int blacksmith = 20;
public const int burrower = 21;
public const int excavator = 22;
public const int gemologist = 23;
public const int fighter = 24;
public const int scout = 25;
public const int brute = 26;
public const int defender = 27;
public const int acrobat = 28;
public const int desperado = 29;
public readonly NetObjectList<Quest> questLog = new NetObjectList<Quest>();
public readonly NetIntList professions = new NetIntList();
public readonly NetList<Point, NetPoint> newLevels = new NetList<Point, NetPoint>();
private Queue<int> newLevelSparklingTexts = new Queue<int>();
private SparklingText sparklingText;
public readonly NetArray<int, NetInt> experiencePoints = new NetArray<int, NetInt>(6);
public readonly NetObjectList<Item> items = new NetObjectList<Item>();
public readonly NetIntList dialogueQuestionsAnswered = new NetIntList();
public List<string> furnitureOwned = new List<string>();
[XmlElement("cookingRecipes")]
public readonly NetStringDictionary<int, NetInt> cookingRecipes = new NetStringDictionary<int, NetInt>();
[XmlElement("craftingRecipes")]
public readonly NetStringDictionary<int, NetInt> craftingRecipes = new NetStringDictionary<int, NetInt>();
[XmlElement("activeDialogueEvents")]
public readonly NetStringDictionary<int, NetInt> activeDialogueEvents = new NetStringDictionary<int, NetInt>();
public readonly NetIntList eventsSeen = new NetIntList();
public readonly NetIntList secretNotesSeen = new NetIntList();
public List<string> songsHeard = new List<string>();
public readonly NetIntList achievements = new NetIntList();
public readonly NetIntList specialItems = new NetIntList();
public readonly NetIntList specialBigCraftables = new NetIntList();
public readonly NetStringList mailReceived = new NetStringList();
public readonly NetStringList mailForTomorrow = new NetStringList();
public readonly NetStringList mailbox = new NetStringList();
public readonly NetInt timeWentToBed = new NetInt();
[XmlIgnore]
public bool hasMoved;
public readonly NetBool sleptInTemporaryBed = new NetBool();
[XmlIgnore]
public readonly NetBool requestingTimePause = new NetBool();
public Stats stats = new Stats();
[XmlIgnore]
public readonly NetCollection<Item> personalShippingBin = new NetCollection<Item>();
[XmlIgnore]
public IList<Item> displayedShippedItems = (IList<Item>) new List<Item>();
public List<string> blueprints = new List<string>();
[XmlElement("biteChime")]
public NetInt biteChime = new NetInt(-1);
[XmlIgnore]
public float usernameDisplayTime;
[XmlIgnore]
protected NetRef<Item> _recoveredItem = new NetRef<Item>();
public NetObjectList<Item> itemsLostLastDeath = new NetObjectList<Item>();
public List<int> movementDirections = new List<int>();
[XmlElement("farmName")]
public readonly NetString farmName = new NetString("");
[XmlElement("favoriteThing")]
public readonly NetString favoriteThing = new NetString();
[XmlElement("horseName")]
public readonly NetString horseName = new NetString();
public string slotName;
public bool slotCanHost;
[XmlIgnore]
public bool hasReceivedToolUpgradeMessageYet;
[XmlIgnore]
private readonly NetArray<int, NetInt> appliedBuffs = new NetArray<int, NetInt>(12);
[XmlIgnore]
public readonly NetIntDictionary<int, NetInt> appliedSpecialBuffs = new NetIntDictionary<int, NetInt>();
[XmlIgnore]
public IList<OutgoingMessage> messageQueue = (IList<OutgoingMessage>) new List<OutgoingMessage>();
[XmlIgnore]
public readonly NetLong uniqueMultiplayerID = new NetLong(Utility.RandomLong());
[XmlElement("userID")]
public readonly NetString userID = new NetString("");
[XmlIgnore]
public string previousLocationName = "";
[XmlIgnore]
public readonly NetString platformType = new NetString("");
[XmlIgnore]
public readonly NetString platformID = new NetString("");
[XmlIgnore]
public readonly NetBool hasMenuOpen = new NetBool(false);
[XmlIgnore]
public readonly Color DEFAULT_SHIRT_COLOR = Color.White;
[XmlIgnore]
public readonly Color DEFAULT_PANTS_COLOR = new Color(46, 85, 183);
public string defaultChatColor;
public bool catPerson = true;
public int whichPetBreed;
[XmlIgnore]
public bool isAnimatingMount;
[XmlElement("acceptedDailyQuest")]
public readonly NetBool acceptedDailyQuest = new NetBool(false);
[XmlIgnore]
public Item mostRecentlyGrabbedItem;
[XmlIgnore]
public Item itemToEat;
[XmlElement("farmerRenderer")]
private readonly NetRef<FarmerRenderer> farmerRenderer = new NetRef<FarmerRenderer>();
[XmlIgnore]
public int toolPower;
[XmlIgnore]
public int toolHold;
public Vector2 mostRecentBed;
public static Dictionary<int, string> hairStyleMetadataFile = (Dictionary<int, string>) null;
public static List<int> allHairStyleIndices = (List<int>) null;
public static int lastHairStyle = -1;
[XmlIgnore]
public static Dictionary<int, HairStyleMetadata> hairStyleMetadata = new Dictionary<int, HairStyleMetadata>();
[XmlElement("emoteFavorites")]
public readonly NetStringList emoteFavorites = new NetStringList();
[XmlElement("performedEmotes")]
public readonly NetStringDictionary<bool, NetBool> performedEmotes = new NetStringDictionary<bool, NetBool>();
[XmlElement("shirt")]
public readonly NetInt shirt = new NetInt(0);
[XmlElement("hair")]
public readonly NetInt hair = new NetInt(0);
[XmlElement("skin")]
public readonly NetInt skin = new NetInt(0);
[XmlElement("shoes")]
public readonly NetInt shoes = new NetInt(2);
[XmlElement("accessory")]
public readonly NetInt accessory = new NetInt(-1);
[XmlElement("facialHair")]
public readonly NetInt facialHair = new NetInt(-1);
[XmlElement("pants")]
public readonly NetInt pants = new NetInt(0);
[XmlIgnore]
public int currentEyes;
[XmlIgnore]
public int blinkTimer;
[XmlIgnore]
public readonly NetInt netFestivalScore = new NetInt();
[XmlIgnore]
public float temporarySpeedBuff;
[XmlElement("hairstyleColor")]
public readonly NetColor hairstyleColor = new NetColor(new Color(193, 90, 50));
[XmlElement("pantsColor")]
public readonly NetColor pantsColor = new NetColor(new Color(46, 85, 183));
[XmlElement("newEyeColor")]
public readonly NetColor newEyeColor = new NetColor(new Color(122, 68, 52));
[XmlElement("hat")]
public readonly NetRef<Hat> hat = new NetRef<Hat>();
[XmlElement("boots")]
public readonly NetRef<Boots> boots = new NetRef<Boots>();
[XmlElement("leftRing")]
public readonly NetRef<Ring> leftRing = new NetRef<Ring>();
[XmlElement("rightRing")]
public readonly NetRef<Ring> rightRing = new NetRef<Ring>();
[XmlElement("shirtItem")]
public readonly NetRef<Clothing> shirtItem = new NetRef<Clothing>();
[XmlElement("pantsItem")]
public readonly NetRef<Clothing> pantsItem = new NetRef<Clothing>();
[XmlIgnore]
public readonly NetDancePartner dancePartner = new NetDancePartner();
[XmlIgnore]
public bool ridingMineElevator;
[XmlIgnore]
public bool mineMovementDirectionWasUp;
[XmlIgnore]
public bool cameFromDungeon;
[XmlIgnore]
public readonly NetBool exhausted = new NetBool();
[XmlElement("divorceTonight")]
public readonly NetBool divorceTonight = new NetBool();
[XmlElement("changeWalletTypeTonight")]
public readonly NetBool changeWalletTypeTonight = new NetBool();
[XmlIgnore]
public AnimatedSprite.endOfAnimationBehavior toolOverrideFunction;
[XmlIgnore]
public NetBool onBridge = new NetBool();
[XmlIgnore]
public SuspensionBridge bridge;
private readonly NetInt netDeepestMineLevel = new NetInt();
[XmlElement("currentToolIndex")]
private readonly NetInt currentToolIndex = new NetInt(0);
[XmlIgnore]
private readonly NetRef<Item> temporaryItem = new NetRef<Item>();
[XmlIgnore]
private readonly NetRef<Item> cursorSlotItem = new NetRef<Item>();
[XmlIgnore]
public readonly NetBool netItemStowed = new NetBool(false);
protected bool _itemStowed;
public int woodPieces;
public int stonePieces;
public int copperPieces;
public int ironPieces;
public int coalPieces;
public int goldPieces;
public int iridiumPieces;
public int quartzPieces;
public string gameVersion = "-1";
public string gameVersionLabel;
[XmlIgnore]
public bool isFakeEventActor;
[XmlElement("caveChoice")]
public readonly NetInt caveChoice = new NetInt();
public int feed;
[XmlElement("farmingLevel")]
public readonly NetInt farmingLevel = new NetInt();
[XmlElement("miningLevel")]
public readonly NetInt miningLevel = new NetInt();
[XmlElement("combatLevel")]
public readonly NetInt combatLevel = new NetInt();
[XmlElement("foragingLevel")]
public readonly NetInt foragingLevel = new NetInt();
[XmlElement("fishingLevel")]
public readonly NetInt fishingLevel = new NetInt();
[XmlElement("luckLevel")]
public readonly NetInt luckLevel = new NetInt();
[XmlElement("newSkillPointsToSpend")]
public readonly NetInt newSkillPointsToSpend = new NetInt();
[XmlElement("addedFarmingLevel")]
public readonly NetInt addedFarmingLevel = new NetInt();
[XmlElement("addedMiningLevel")]
public readonly NetInt addedMiningLevel = new NetInt();
[XmlElement("addedCombatLevel")]
public readonly NetInt addedCombatLevel = new NetInt();
[XmlElement("addedForagingLevel")]
public readonly NetInt addedForagingLevel = new NetInt();
[XmlElement("addedFishingLevel")]
public readonly NetInt addedFishingLevel = new NetInt();
[XmlElement("addedLuckLevel")]
public readonly NetInt addedLuckLevel = new NetInt();
[XmlElement("maxStamina")]
public readonly NetInt maxStamina = new NetInt(270);
[XmlElement("maxItems")]
public readonly NetInt maxItems = new NetInt(12);
[XmlElement("lastSeenMovieWeek")]
public readonly NetInt lastSeenMovieWeek = new NetInt(-1);
[XmlIgnore]
public readonly NetString viewingLocation = new NetString((string) null);
private readonly NetFloat netStamina = new NetFloat(270f);
public int resilience;
public int attack;
public int immunity;
public float attackIncreaseModifier;
public float knockbackModifier;
public float weaponSpeedModifier;
public float critChanceModifier;
public float critPowerModifier;
public float weaponPrecisionModifier;
[XmlIgnore]
public NetRoot<FarmerTeam> teamRoot = new NetRoot<FarmerTeam>(new FarmerTeam());
public int clubCoins;
public int trashCanLevel;
private NetLong netMillisecondsPlayed = new NetLong();
[XmlElement("toolBeingUpgraded")]
public readonly NetRef<Tool> toolBeingUpgraded = new NetRef<Tool>();
[XmlElement("daysLeftForToolUpgrade")]
public readonly NetInt daysLeftForToolUpgrade = new NetInt();
/// <summary>//////////////////////////////</summary>
[XmlIgnore]
private float timeOfLastPositionPacket;
private int numUpdatesSinceLastDraw;
[XmlElement("houseUpgradeLevel")]
public readonly NetInt houseUpgradeLevel = new NetInt(0);
[XmlElement("daysUntilHouseUpgrade")]
public readonly NetInt daysUntilHouseUpgrade = new NetInt(-1);
public int coopUpgradeLevel;
public int barnUpgradeLevel;
public bool hasGreenhouse;
public bool hasUnlockedSkullDoor;
public bool hasDarkTalisman;
public bool hasMagicInk;
public bool showChestColorPicker = true;
public bool hasMagnifyingGlass;
public bool hasWateringCanEnchantment;
[XmlIgnore]
public List<BaseEnchantment> enchantments = new List<BaseEnchantment>();
protected NetBool hasTownKey = new NetBool(false);
[XmlElement("magneticRadius")]
public readonly NetInt magneticRadius = new NetInt(128);
public int temporaryInvincibilityTimer;
public int currentTemporaryInvincibilityDuration = 1200;
[XmlIgnore]
public float rotation;
private int craftingTime = 1000;
private int raftPuddleCounter = 250;
private int raftBobCounter = 1000;
public int health = 100;
public int maxHealth = 100;
private readonly NetInt netTimesReachedMineBottom = new NetInt(0);
public float difficultyModifier = 1f;
[XmlIgnore]
public Vector2 jitter = Vector2.Zero;
[XmlIgnore]
public Vector2 lastPosition;
[XmlIgnore]
public Vector2 lastGrabTile = Vector2.Zero;
[XmlIgnore]
public float jitterStrength;
[XmlIgnore]
public float xOffset;
[XmlElement("isMale")]
public readonly NetBool isMale = new NetBool(true);
[XmlIgnore]
public bool canMove = true;
[XmlIgnore]
public bool running;
[XmlIgnore]
public bool ignoreCollisions;
[XmlIgnore]
public readonly NetBool usingTool = new NetBool(false);
[XmlIgnore]
public bool isEating;
[XmlIgnore]
public readonly NetBool isInBed = new NetBool(false);
[XmlIgnore]
public bool forceTimePass;
[XmlIgnore]
public bool isRafting;
[XmlIgnore]
public bool usingSlingshot;
[XmlIgnore]
public readonly NetBool bathingClothes = new NetBool(false);
[XmlIgnore]
public bool canOnlyWalk;
[XmlIgnore]
public bool temporarilyInvincible;
public bool hasBusTicket;
public bool stardewHero;
public bool hasClubCard;
public bool hasSpecialCharm;
[XmlIgnore]
public bool canReleaseTool;
[XmlIgnore]
public bool isCrafting;
[XmlIgnore]
public bool isEmoteAnimating;
[XmlIgnore]
public bool passedOut;
[XmlIgnore]
public bool hasNutPickupQueued;
[XmlIgnore]
protected int _emoteGracePeriod;
[XmlIgnore]
private BoundingBoxGroup temporaryPassableTiles = new BoundingBoxGroup();
[XmlIgnore]
public readonly NetBool hidden = new NetBool();
[XmlElement("basicShipped")]
public readonly NetIntDictionary<int, NetInt> basicShipped = new NetIntDictionary<int, NetInt>();
[XmlElement("mineralsFound")]
public readonly NetIntDictionary<int, NetInt> mineralsFound = new NetIntDictionary<int, NetInt>();
[XmlElement("recipesCooked")]
public readonly NetIntDictionary<int, NetInt> recipesCooked = new NetIntDictionary<int, NetInt>();
[XmlElement("fishCaught")]
public readonly NetIntIntArrayDictionary fishCaught = new NetIntIntArrayDictionary();
[XmlElement("archaeologyFound")]
public readonly NetIntIntArrayDictionary archaeologyFound = new NetIntIntArrayDictionary();
[XmlElement("callsReceived")]
public readonly NetIntDictionary<int, NetInt> callsReceived = new NetIntDictionary<int, NetInt>();
public SerializableDictionary<string, SerializableDictionary<int, int>> giftedItems;
[XmlElement("tailoredItems")]
public readonly NetStringDictionary<int, NetInt> tailoredItems = new NetStringDictionary<int, NetInt>();
public SerializableDictionary<string, int[]> friendships;
[XmlElement("friendshipData")]
public readonly NetStringDictionary<Friendship, NetRef<Friendship>> friendshipData = new NetStringDictionary<Friendship, NetRef<Friendship>>();
[XmlIgnore]
public NetString locationBeforeForcedEvent = new NetString((string) null);
[XmlIgnore]
public Vector2 positionBeforeEvent;
[XmlIgnore]
public int orientationBeforeEvent;
[XmlIgnore]
public int swimTimer;
[XmlIgnore]
public int regenTimer;
[XmlIgnore]
public int timerSinceLastMovement;
[XmlIgnore]
public int noMovementPause;
[XmlIgnore]
public int freezePause;
[XmlIgnore]
public float yOffset;
public BuildingUpgrade currentUpgrade;
[XmlElement("spouse")]
protected readonly NetString netSpouse = new NetString();
public string dateStringForSaveGame;
public int? dayOfMonthForSaveGame;
public int? seasonForSaveGame;
public int? yearForSaveGame;
public int overallsColor;
public int shirtColor;
public int skinColor;
public int hairColor;
public int eyeColor;
[XmlIgnore]
public Vector2 armOffset;
public string bobber = "";
private readonly NetRef<Horse> netMount = new NetRef<Horse>();
[XmlIgnore]
public ISittable sittingFurniture;
[XmlIgnore]
public NetBool isSitting = new NetBool();
[XmlIgnore]
public NetVector2 mapChairSitPosition = new NetVector2(new Vector2(-1f, -1f));
[XmlIgnore]
public NetBool hasCompletedAllMonsterSlayerQuests = new NetBool(false);
[XmlIgnore]
public bool isStopSitting;
[XmlIgnore]
protected bool _wasSitting;
[XmlIgnore]
public Vector2 lerpStartPosition;
[XmlIgnore]
public Vector2 lerpEndPosition;
[XmlIgnore]
public float lerpPosition = -1f;
[XmlIgnore]
public float lerpDuration = -1f;
[XmlIgnore]
protected Item _lastSelectedItem;
[XmlElement("qiGems")]
public NetIntDelta netQiGems = new NetIntDelta();
[XmlElement("JOTPKProgress")]
public NetRef<AbigailGame.JOTPKProgress> jotpkProgress = new NetRef<AbigailGame.JOTPKProgress>();
[XmlElement("hasUsedDailyRevive")]
public NetBool hasUsedDailyRevive = new NetBool(false);
private readonly NetEvent0 fireToolEvent = new NetEvent0(true);
private readonly NetEvent0 beginUsingToolEvent = new NetEvent0(true);
private readonly NetEvent0 endUsingToolEvent = new NetEvent0(true);
private readonly NetEvent0 sickAnimationEvent = new NetEvent0();
private readonly NetEvent0 passOutEvent = new NetEvent0();
private readonly NetEvent0 haltAnimationEvent = new NetEvent0();
private readonly NetEvent1Field<Object, NetRef<Object>> drinkAnimationEvent = new NetEvent1Field<Object, NetRef<Object>>();
private readonly NetEvent1Field<Object, NetRef<Object>> eatAnimationEvent = new NetEvent1Field<Object, NetRef<Object>>();
private readonly NetEvent1Field<string, NetString> doEmoteEvent = new NetEvent1Field<string, NetString>();
private readonly NetEvent1Field<long, NetLong> kissFarmerEvent = new NetEvent1Field<long, NetLong>();
private readonly NetEvent1Field<float, NetFloat> synchronizedJumpEvent = new NetEvent1Field<float, NetFloat>();
public readonly NetEvent1Field<string, NetString> renovateEvent = new NetEvent1Field<string, NetString>();
[XmlElement("chestConsumedLevels")]
public readonly NetIntDictionary<bool, NetBool> chestConsumedMineLevels = new NetIntDictionary<bool, NetBool>();
public int saveTime;
[XmlIgnore]
public float drawLayerDisambiguator;
[XmlElement("isCustomized")]
public readonly NetBool isCustomized = new NetBool(false);
[XmlElement("homeLocation")]
public readonly NetString homeLocation = new NetString("FarmHouse");
[XmlElement("lastSleepLocation")]
public readonly NetString lastSleepLocation = new NetString();
[XmlElement("lastSleepPoint")]
public readonly NetPoint lastSleepPoint = new NetPoint();
public static readonly Farmer.EmoteType[] EMOTES;
[XmlIgnore]
public int emoteFacingDirection = 2;
public int daysMarried;
private int toolPitchAccumulator;
private int charactercollisionTimer;
private NPC collisionNPC;
public float movementMultiplier = 0.01f;
public int visibleQuestCount
{
get
{
int visibleQuestCount = 0;
foreach (SpecialOrder specialOrder in this.team.specialOrders)
{
if (!specialOrder.IsHidden())
++visibleQuestCount;
}
foreach (Quest quest in (NetList<Quest, NetRef<Quest>>) this.questLog)
{
if (!quest.IsHidden())
++visibleQuestCount;
}
return visibleQuestCount;
}
}
public Item recoveredItem
{
get => this._recoveredItem.Value;
set => this._recoveredItem.Value = value;
}
[XmlElement("theaterBuildDate")]
public long theaterBuildDate
{
get => (long) this.teamRoot.Value.theaterBuildDate;
set => this.teamRoot.Value.theaterBuildDate.Value = value;
}
[XmlIgnore]
public int festivalScore
{
get => (int) (NetFieldBase<int, NetInt>) this.netFestivalScore;
set
{
if (Game1.player != null && Game1.player.team != null && Game1.player.team.festivalScoreStatus != null)
Game1.player.team.festivalScoreStatus.UpdateState(Game1.player.festivalScore.ToString() ?? "");
this.netFestivalScore.Value = value;
}
}
public int deepestMineLevel
{
get => (int) (NetFieldBase<int, NetInt>) this.netDeepestMineLevel;
set => this.netDeepestMineLevel.Value = value;
}
public float stamina
{
get => (float) (NetFieldBase<float, NetFloat>) this.netStamina;
set => this.netStamina.Value = value;
}
[XmlIgnore]
public FarmerTeam team => Game1.player != null && this != Game1.player ? Game1.player.team : this.teamRoot.Value;
public uint totalMoneyEarned
{
get => (uint) this.teamRoot.Value.totalMoneyEarned.Value;
set
{
if (this.teamRoot.Value.totalMoneyEarned.Value != 0)
{
if (value >= 15000U && this.teamRoot.Value.totalMoneyEarned.Value < 15000)
Game1.multiplayer.globalChatInfoMessage("Earned15k", (string) (NetFieldBase<string, NetString>) this.farmName);
if (value >= 50000U && this.teamRoot.Value.totalMoneyEarned.Value < 50000)
Game1.multiplayer.globalChatInfoMessage("Earned50k", (string) (NetFieldBase<string, NetString>) this.farmName);
if (value >= 250000U && this.teamRoot.Value.totalMoneyEarned.Value < 250000)
Game1.multiplayer.globalChatInfoMessage("Earned250k", (string) (NetFieldBase<string, NetString>) this.farmName);
if (value >= 1000000U && this.teamRoot.Value.totalMoneyEarned.Value < 1000000)
Game1.multiplayer.globalChatInfoMessage("Earned1m", (string) (NetFieldBase<string, NetString>) this.farmName);
if (value >= 10000000U && this.teamRoot.Value.totalMoneyEarned.Value < 10000000)
Game1.multiplayer.globalChatInfoMessage("Earned10m", (string) (NetFieldBase<string, NetString>) this.farmName);
if (value >= 100000000U && this.teamRoot.Value.totalMoneyEarned.Value < 100000000)
Game1.multiplayer.globalChatInfoMessage("Earned100m", (string) (NetFieldBase<string, NetString>) this.farmName);
}
this.teamRoot.Value.totalMoneyEarned.Value = (int) value;
}
}
public ulong millisecondsPlayed
{
get => (ulong) this.netMillisecondsPlayed.Value;
set => this.netMillisecondsPlayed.Value = (long) value;
}
public bool hasRustyKey
{
get => (bool) (NetFieldBase<bool, NetBool>) this.teamRoot.Value.hasRustyKey;
set => this.teamRoot.Value.hasRustyKey.Value = value;
}
public bool hasSkullKey
{
get => (bool) (NetFieldBase<bool, NetBool>) this.teamRoot.Value.hasSkullKey;
set => this.teamRoot.Value.hasSkullKey.Value = value;
}
public bool canUnderstandDwarves
{
get => (bool) (NetFieldBase<bool, NetBool>) this.teamRoot.Value.canUnderstandDwarves;
set => this.teamRoot.Value.canUnderstandDwarves.Value = value;
}
public bool HasTownKey
{
get => this.hasTownKey.Value;
set => this.hasTownKey.Value = value;
}
[XmlIgnore]
public bool hasPendingCompletedQuests
{
get
{
foreach (SpecialOrder specialOrder in this.team.specialOrders)
{
if (specialOrder.participants.ContainsKey(this.UniqueMultiplayerID) && specialOrder.ShouldDisplayAsComplete())
return true;
}
foreach (Quest quest in (NetList<Quest, NetRef<Quest>>) this.questLog)
{
if (!quest.IsHidden() && quest.ShouldDisplayAsComplete() && !quest.destroy.Value)
return true;
}
return false;
}
}
[XmlElement("useSeparateWallets")]
public bool useSeparateWallets
{
get => (bool) (NetFieldBase<bool, NetBool>) this.teamRoot.Value.useSeparateWallets;
set => this.teamRoot.Value.useSeparateWallets.Value = value;
}
public int timesReachedMineBottom
{
get => (int) (NetFieldBase<int, NetInt>) this.netTimesReachedMineBottom;
set => this.netTimesReachedMineBottom.Value = value;
}
public string spouse
{
get => this.netSpouse.Value != null && this.netSpouse.Value.Length != 0 ? this.netSpouse.Value : (string) null;
set
{
if (value == null)
this.netSpouse.Value = "";
else
this.netSpouse.Value = value;
}
}
[XmlIgnore]
public bool isUnclaimedFarmhand => !this.IsMainPlayer && !(bool) (NetFieldBase<bool, NetBool>) this.isCustomized;
[XmlIgnore]
public Horse mount
{
get => this.netMount.Value;
set => this.setMount(value);
}
[XmlIgnore]
public int MaxItems
{
get => (int) (NetFieldBase<int, NetInt>) this.maxItems;
set => this.maxItems.Value = value;
}
[XmlIgnore]
public int Level => ((int) (NetFieldBase<int, NetInt>) this.farmingLevel + (int) (NetFieldBase<int, NetInt>) this.fishingLevel + (int) (NetFieldBase<int, NetInt>) this.foragingLevel + (int) (NetFieldBase<int, NetInt>) this.combatLevel + (int) (NetFieldBase<int, NetInt>) this.miningLevel + (int) (NetFieldBase<int, NetInt>) this.luckLevel) / 2;
[XmlIgnore]
public int CraftingTime
{
get => this.craftingTime;
set => this.craftingTime = value;
}
[XmlIgnore]
public int NewSkillPointsToSpend
{
get => (int) (NetFieldBase<int, NetInt>) this.newSkillPointsToSpend;
set => this.newSkillPointsToSpend.Value = value;
}
[XmlIgnore]
public int FarmingLevel
{
get => (int) (NetFieldBase<int, NetInt>) this.farmingLevel + (int) (NetFieldBase<int, NetInt>) this.addedFarmingLevel;
set => this.farmingLevel.Value = value;
}
[XmlIgnore]
public int MiningLevel
{
get => (int) (NetFieldBase<int, NetInt>) this.miningLevel + (int) (NetFieldBase<int, NetInt>) this.addedMiningLevel;
set => this.miningLevel.Value = value;
}
[XmlIgnore]
public int CombatLevel
{
get => (int) (NetFieldBase<int, NetInt>) this.combatLevel + (int) (NetFieldBase<int, NetInt>) this.addedCombatLevel;
set => this.combatLevel.Value = value;
}
[XmlIgnore]
public int ForagingLevel
{
get => (int) (NetFieldBase<int, NetInt>) this.foragingLevel + (int) (NetFieldBase<int, NetInt>) this.addedForagingLevel;
set => this.foragingLevel.Value = value;
}
[XmlIgnore]
public int FishingLevel
{
get => (int) (NetFieldBase<int, NetInt>) this.fishingLevel + (int) (NetFieldBase<int, NetInt>) this.addedFishingLevel + (this.CurrentTool == null || !this.CurrentTool.hasEnchantmentOfType<MasterEnchantment>() ? 0 : 1);
set => this.fishingLevel.Value = value;
}
[XmlIgnore]
public int LuckLevel
{
get => (int) (NetFieldBase<int, NetInt>) this.luckLevel + (int) (NetFieldBase<int, NetInt>) this.addedLuckLevel;
set => this.luckLevel.Value = value;
}
[XmlIgnore]
public double DailyLuck => this.team.sharedDailyLuck.Value + (this.hasSpecialCharm ? 0.025000000372529 : 0.0);
[XmlIgnore]
public int HouseUpgradeLevel
{
get => (int) (NetFieldBase<int, NetInt>) this.houseUpgradeLevel;
set => this.houseUpgradeLevel.Value = value;
}
[XmlIgnore]
public int CoopUpgradeLevel
{
get => this.coopUpgradeLevel;
set => this.coopUpgradeLevel = value;
}
[XmlIgnore]
public int BarnUpgradeLevel
{
get => this.barnUpgradeLevel;
set => this.barnUpgradeLevel = value;
}
[XmlIgnore]
public BoundingBoxGroup TemporaryPassableTiles
{
get => this.temporaryPassableTiles;
set => this.temporaryPassableTiles = value;
}
[XmlIgnore]
public IList<Item> Items
{
get => (IList<Item>) this.items;
set => this.items.CopyFrom(value);
}
[XmlIgnore]
public int MagneticRadius
{
get => this.magneticRadius.Value;
set => this.magneticRadius.Value = value;
}
[XmlIgnore]
public Object ActiveObject
{
get
{
if (this.TemporaryItem != null)
return this.TemporaryItem is Object ? (Object) this.TemporaryItem : (Object) null;
if (this._itemStowed)
return (Object) null;
return (int) (NetFieldBase<int, NetInt>) this.currentToolIndex < this.items.Count && this.items[(int) (NetFieldBase<int, NetInt>) this.currentToolIndex] != null && this.items[(int) (NetFieldBase<int, NetInt>) this.currentToolIndex] is Object ? (Object) this.items[(int) (NetFieldBase<int, NetInt>) this.currentToolIndex] : (Object) null;
}
set
{
this.netItemStowed.Set(false);
if (value == null)
this.removeItemFromInventory((Item) this.ActiveObject);
else
this.addItemToInventory((Item) value, this.CurrentToolIndex);
}
}
[XmlIgnore]
public bool IsMale
{
get => (bool) (NetFieldBase<bool, NetBool>) this.isMale;
set => this.isMale.Set(value);
}
[XmlIgnore]
public IList<int> DialogueQuestionsAnswered => (IList<int>) this.dialogueQuestionsAnswered;
[XmlIgnore]
public int WoodPieces
{
get => this.woodPieces;
set => this.woodPieces = value;
}
[XmlIgnore]
public int StonePieces
{
get => this.stonePieces;
set => this.stonePieces = value;
}
[XmlIgnore]
public int CopperPieces
{
get => this.copperPieces;
set => this.copperPieces = value;
}
[XmlIgnore]
public int IronPieces
{
get => this.ironPieces;
set => this.ironPieces = value;
}
[XmlIgnore]
public int CoalPieces
{
get => this.coalPieces;
set => this.coalPieces = value;
}
[XmlIgnore]
public int GoldPieces
{
get => this.goldPieces;
set => this.goldPieces = value;
}
[XmlIgnore]
public int IridiumPieces
{
get => this.iridiumPieces;
set => this.iridiumPieces = value;
}
[XmlIgnore]
public int QuartzPieces
{
get => this.quartzPieces;
set => this.quartzPieces = value;
}
[XmlIgnore]
public int Feed
{
get => this.feed;
set => this.feed = value;
}
[XmlIgnore]
public bool CanMove
{
get => this.canMove;
set => this.canMove = value;
}
[XmlIgnore]
public bool UsingTool
{
get => (bool) (NetFieldBase<bool, NetBool>) this.usingTool;
set => this.usingTool.Set(value);
}
[XmlIgnore]
public Tool CurrentTool
{
get => this.CurrentItem != null && this.CurrentItem is Tool ? (Tool) this.CurrentItem : (Tool) null;
set
{
while (this.CurrentToolIndex >= this.items.Count)
this.items.Add((Item) null);
this.items[this.CurrentToolIndex] = (Item) value;
}
}
[XmlIgnore]
public Item TemporaryItem
{
get => this.temporaryItem.Value;
set => this.temporaryItem.Value = value;
}
public Item CursorSlotItem
{
get => this.cursorSlotItem.Value;
set => this.cursorSlotItem.Value = value;
}
[XmlIgnore]
public Item CurrentItem
{
get
{
if (this.TemporaryItem != null)
return this.TemporaryItem;
if (this._itemStowed)
return (Item) null;
return (int) (NetFieldBase<int, NetInt>) this.currentToolIndex >= this.items.Count ? (Item) null : this.items[(int) (NetFieldBase<int, NetInt>) this.currentToolIndex];
}
}
[XmlIgnore]
public int CurrentToolIndex
{
get => (int) (NetFieldBase<int, NetInt>) this.currentToolIndex;
set
{
this.netItemStowed.Set(false);
if ((int) (NetFieldBase<int, NetInt>) this.currentToolIndex >= 0 && this.CurrentItem != null && value != (int) (NetFieldBase<int, NetInt>) this.currentToolIndex)
this.CurrentItem.actionWhenStopBeingHeld(this);
this.currentToolIndex.Set(value);
}
}
[XmlIgnore]
public float Stamina
{
get => this.stamina;
set => this.stamina = Math.Min((float) (int) (NetFieldBase<int, NetInt>) this.maxStamina, Math.Max(value, -16f));
}
[XmlIgnore]
public int MaxStamina
{
get => (int) (NetFieldBase<int, NetInt>) this.maxStamina;
set => this.maxStamina.Value = value;
}
public long UniqueMultiplayerID
{
get => (long) this.uniqueMultiplayerID;
set => this.uniqueMultiplayerID.Value = value;
}
[XmlIgnore]