-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathFarmer.cs
4679 lines (4472 loc) · 177 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.2.6400.27469, Culture=neutral, PublicKeyToken=null
// MVID: 77B7094A-F6F0-4ACC-91F4-E335E2733EDB
// Assembly location: D:\SteamLibrary\steamapps\common\Stardew Valley\Stardew Valley.exe
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using StardewValley.BellsAndWhistles;
using StardewValley.Characters;
using StardewValley.Locations;
using StardewValley.Menus;
using StardewValley.Objects;
using StardewValley.Quests;
using StardewValley.Tools;
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 static int tileSlideThreshold = Game1.tileSize / 2;
public List<Quest> questLog = new List<Quest>();
public List<int> professions = new List<int>();
public List<Point> newLevels = new List<Point>();
private Queue<int> newLevelSparklingTexts = new Queue<int>();
public int[] experiencePoints = new int[6];
public List<int> dialogueQuestionsAnswered = new List<int>();
public List<string> furnitureOwned = new List<string>();
public SerializableDictionary<string, int> cookingRecipes = new SerializableDictionary<string, int>();
public SerializableDictionary<string, int> craftingRecipes = new SerializableDictionary<string, int>();
public SerializableDictionary<string, int> activeDialogueEvents = new SerializableDictionary<string, int>();
public List<int> eventsSeen = new List<int>();
public List<string> songsHeard = new List<string>();
public List<int> achievements = new List<int>();
public List<int> specialItems = new List<int>();
public List<int> specialBigCraftables = new List<int>();
public List<string> mailReceived = new List<string>();
public List<string> mailForTomorrow = new List<string>();
public List<string> blueprints = new List<string>();
public List<CoopDweller> coopDwellers = new List<CoopDweller>();
public List<BarnDweller> barnDwellers = new List<BarnDweller>();
public Tool[] toolBox = new Tool[30];
public Object[] cupboard = new Object[30];
[XmlIgnore]
public List<int> movementDirections = new List<int>();
public string farmName = "";
public string favoriteThing = "";
[XmlIgnore]
public List<Buff> buffs = new List<Buff>();
[XmlIgnore]
public List<object[]> multiplayerMessage = new List<object[]>();
[XmlIgnore]
public GameLocation currentLocation = Game1.getLocationFromName("FarmHouse");
[XmlIgnore]
public long uniqueMultiplayerID = -6666666;
[XmlIgnore]
public string _tmpLocationName = "FarmHouse";
[XmlIgnore]
public string previousLocationName = "";
public bool catPerson = true;
public int accessory = -1;
public int facialHair = -1;
public int maxStamina = 270;
public int maxItems = 12;
public float stamina = 270f;
public int money = 500;
public int daysUntilHouseUpgrade = -1;
public bool showChestColorPicker = true;
public int magneticRadius = Game1.tileSize * 2;
private int craftingTime = 1000;
private int raftPuddleCounter = 250;
private int raftBobCounter = 1000;
public int health = 100;
public int maxHealth = 100;
[XmlIgnore]
public Vector2 jitter = Vector2.Zero;
[XmlIgnore]
public Vector2 lastGrabTile = Vector2.Zero;
public bool isMale = true;
[XmlIgnore]
public bool canMove = true;
[XmlIgnore]
public Microsoft.Xna.Framework.Rectangle temporaryImpassableTile = Microsoft.Xna.Framework.Rectangle.Empty;
public string bobber = "";
public float movementMultiplier = 0.01f;
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 FESTIVAL_WINNER = -9999;
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 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;
private SparklingText sparklingText;
[XmlIgnore]
private Item activeObject;
public List<Item> items;
[XmlIgnore]
public Item mostRecentlyGrabbedItem;
[XmlIgnore]
public Item itemToEat;
private FarmerRenderer farmerRenderer;
[XmlIgnore]
public int toolPower;
[XmlIgnore]
public int toolHold;
public Vector2 mostRecentBed;
public int shirt;
public int hair;
public int skin;
[XmlIgnore]
public int currentEyes;
[XmlIgnore]
public int blinkTimer;
[XmlIgnore]
public int festivalScore;
[XmlIgnore]
public float temporarySpeedBuff;
public Color hairstyleColor;
public Color pantsColor;
public Color newEyeColor;
public Hat hat;
public Boots boots;
public Ring leftRing;
public Ring rightRing;
[XmlIgnore]
public NPC dancePartner;
[XmlIgnore]
public bool ridingMineElevator;
[XmlIgnore]
public bool mineMovementDirectionWasUp;
[XmlIgnore]
public bool cameFromDungeon;
[XmlIgnore]
public bool readyConfirmation;
[XmlIgnore]
public bool exhausted;
[XmlIgnore]
public bool divorceTonight;
[XmlIgnore]
public AnimatedSprite.endOfAnimationBehavior toolOverrideFunction;
public int deepestMineLevel;
private int currentToolIndex;
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 int caveChoice;
public int feed;
public int farmingLevel;
public int miningLevel;
public int combatLevel;
public int foragingLevel;
public int fishingLevel;
public int luckLevel;
public int newSkillPointsToSpend;
public int addedFarmingLevel;
public int addedMiningLevel;
public int addedCombatLevel;
public int addedForagingLevel;
public int addedFishingLevel;
public int addedLuckLevel;
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;
public int clubCoins;
public uint totalMoneyEarned;
public uint millisecondsPlayed;
public Tool toolBeingUpgraded;
public int daysLeftForToolUpgrade;
private float timeOfLastPositionPacket;
private int numUpdatesSinceLastDraw;
public int houseUpgradeLevel;
public int coopUpgradeLevel;
public int barnUpgradeLevel;
public bool hasGreenhouse;
public bool hasRustyKey;
public bool hasSkullKey;
public bool hasUnlockedSkullDoor;
public bool hasDarkTalisman;
public bool hasMagicInk;
public int temporaryInvincibilityTimer;
[XmlIgnore]
public float rotation;
public int timesReachedMineBottom;
[XmlIgnore]
public Vector2 lastPosition;
[XmlIgnore]
public float jitterStrength;
[XmlIgnore]
public float xOffset;
[XmlIgnore]
public bool running;
[XmlIgnore]
public bool usingTool;
[XmlIgnore]
public bool forceTimePass;
[XmlIgnore]
public bool isRafting;
[XmlIgnore]
public bool usingSlingshot;
[XmlIgnore]
public bool bathingClothes;
[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;
public bool canUnderstandDwarves;
public SerializableDictionary<int, int> basicShipped;
public SerializableDictionary<int, int> mineralsFound;
public SerializableDictionary<int, int> recipesCooked;
public SerializableDictionary<int, int[]> archaeologyFound;
public SerializableDictionary<int, int[]> fishCaught;
public SerializableDictionary<string, int[]> friendships;
[XmlIgnore]
public Vector2 positionBeforeEvent;
[XmlIgnore]
public Vector2 remotePosition;
[XmlIgnore]
public int orientationBeforeEvent;
[XmlIgnore]
public int swimTimer;
[XmlIgnore]
public int timerSinceLastMovement;
[XmlIgnore]
public int noMovementPause;
[XmlIgnore]
public int freezePause;
[XmlIgnore]
public float yOffset;
public BuildingUpgrade currentUpgrade;
public string spouse;
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;
private Horse mount;
private LocalizedContentManager farmerTextureManager;
public int saveTime;
public int daysMarried;
private int toolPitchAccumulator;
private int charactercollisionTimer;
private NPC collisionNPC;
[XmlIgnore]
public int MaxItems
{
get
{
return this.maxItems;
}
set
{
this.maxItems = value;
}
}
[XmlIgnore]
public int Level
{
get
{
return (this.farmingLevel + this.fishingLevel + this.foragingLevel + this.combatLevel + this.miningLevel + this.luckLevel) / 2;
}
}
[XmlIgnore]
public int CraftingTime
{
get
{
return this.craftingTime;
}
set
{
this.craftingTime = value;
}
}
[XmlIgnore]
public int NewSkillPointsToSpend
{
get
{
return this.newSkillPointsToSpend;
}
set
{
this.newSkillPointsToSpend = value;
}
}
[XmlIgnore]
public int FarmingLevel
{
get
{
return this.farmingLevel + this.addedFarmingLevel;
}
set
{
this.farmingLevel = value;
}
}
[XmlIgnore]
public int MiningLevel
{
get
{
return this.miningLevel + this.addedMiningLevel;
}
set
{
this.miningLevel = value;
}
}
[XmlIgnore]
public int CombatLevel
{
get
{
return this.combatLevel + this.addedCombatLevel;
}
set
{
this.combatLevel = value;
}
}
[XmlIgnore]
public int ForagingLevel
{
get
{
return this.foragingLevel + this.addedForagingLevel;
}
set
{
this.foragingLevel = value;
}
}
[XmlIgnore]
public int FishingLevel
{
get
{
return this.fishingLevel + this.addedFishingLevel;
}
set
{
this.fishingLevel = value;
}
}
[XmlIgnore]
public int LuckLevel
{
get
{
return this.luckLevel + this.addedLuckLevel;
}
set
{
this.luckLevel = value;
}
}
[XmlIgnore]
public int HouseUpgradeLevel
{
get
{
return this.houseUpgradeLevel;
}
set
{
this.houseUpgradeLevel = value;
}
}
[XmlIgnore]
public int CoopUpgradeLevel
{
get
{
return this.coopUpgradeLevel;
}
set
{
this.coopUpgradeLevel = value;
}
}
[XmlIgnore]
public int BarnUpgradeLevel
{
get
{
return this.barnUpgradeLevel;
}
set
{
this.barnUpgradeLevel = value;
}
}
[XmlIgnore]
public Microsoft.Xna.Framework.Rectangle TemporaryImpassableTile
{
get
{
return this.temporaryImpassableTile;
}
set
{
this.temporaryImpassableTile = value;
}
}
[XmlIgnore]
public List<Item> Items
{
get
{
return this.items;
}
set
{
this.items = value;
}
}
[XmlIgnore]
public int MagneticRadius
{
get
{
return this.magneticRadius;
}
set
{
this.magneticRadius = value;
}
}
[XmlIgnore]
public Object ActiveObject
{
get
{
if (this.currentToolIndex < this.items.Count && this.items[this.currentToolIndex] != null && this.items[this.currentToolIndex] is Object)
return (Object) this.items[this.currentToolIndex];
return (Object) null;
}
set
{
if (value == null)
this.removeItemFromInventory((Item) this.ActiveObject);
else
this.addItemToInventory((Item) value, this.CurrentToolIndex);
}
}
[XmlIgnore]
public string Name
{
get
{
return this.name;
}
set
{
this.name = value;
}
}
[XmlIgnore]
public bool IsMale
{
get
{
return this.isMale;
}
set
{
this.isMale = value;
}
}
[XmlIgnore]
public List<int> DialogueQuestionsAnswered
{
get
{
return this.dialogueQuestionsAnswered;
}
set
{
this.dialogueQuestionsAnswered = value;
}
}
[XmlIgnore]
public int WoodPieces
{
get
{
return this.woodPieces;
}
set
{
this.woodPieces = value;
}
}
[XmlIgnore]
public int StonePieces
{
get
{
return this.stonePieces;
}
set
{
this.stonePieces = value;
}
}
[XmlIgnore]
public int CopperPieces
{
get
{
return this.copperPieces;
}
set
{
this.copperPieces = value;
}
}
[XmlIgnore]
public int IronPieces
{
get
{
return this.ironPieces;
}
set
{
this.ironPieces = value;
}
}
[XmlIgnore]
public int CoalPieces
{
get
{
return this.coalPieces;
}
set
{
this.coalPieces = value;
}
}
[XmlIgnore]
public int GoldPieces
{
get
{
return this.goldPieces;
}
set
{
this.goldPieces = value;
}
}
[XmlIgnore]
public int IridiumPieces
{
get
{
return this.iridiumPieces;
}
set
{
this.iridiumPieces = value;
}
}
[XmlIgnore]
public int QuartzPieces
{
get
{
return this.quartzPieces;
}
set
{
this.quartzPieces = value;
}
}
[XmlIgnore]
public int Feed
{
get
{
return this.feed;
}
set
{
this.feed = value;
}
}
[XmlIgnore]
public bool CanMove
{
get
{
return this.canMove;
}
set
{
this.canMove = value;
}
}
[XmlIgnore]
public bool UsingTool
{
get
{
return this.usingTool;
}
set
{
this.usingTool = value;
}
}
[XmlIgnore]
public Tool CurrentTool
{
get
{
if (this.CurrentItem != null && this.CurrentItem is Tool)
return (Tool) this.CurrentItem;
return (Tool) null;
}
set
{
this.items[this.CurrentToolIndex] = (Item) value;
}
}
[XmlIgnore]
public Item CurrentItem
{
get
{
if (this.currentToolIndex >= this.items.Count)
return (Item) null;
return this.items[this.currentToolIndex];
}
}
[XmlIgnore]
public int CurrentToolIndex
{
get
{
return this.currentToolIndex;
}
set
{
if (this.currentToolIndex >= 0 && this.CurrentItem != null && value != this.currentToolIndex)
this.CurrentItem.actionWhenStopBeingHeld(this);
this.currentToolIndex = value;
}
}
[XmlIgnore]
public float Stamina
{
get
{
return this.stamina;
}
set
{
this.stamina = Math.Min((float) this.maxStamina, Math.Max(value, -16f));
}
}
[XmlIgnore]
public int MaxStamina
{
get
{
return this.maxStamina;
}
set
{
this.maxStamina = value;
}
}
[XmlIgnore]
public bool IsMainPlayer
{
get
{
return this.uniqueMultiplayerID == Game1.player.uniqueMultiplayerID;
}
}
[XmlIgnore]
public FarmerSprite FarmerSprite
{
get
{
return (FarmerSprite) this.sprite;
}
set
{
this.sprite = (AnimatedSprite) value;
}
}
[XmlIgnore]
public FarmerRenderer FarmerRenderer
{
get
{
return this.farmerRenderer;
}
set
{
this.farmerRenderer = value;
}
}
[XmlIgnore]
public int Money
{
get
{
return this.money;
}
set
{
if (value > this.money)
{
this.totalMoneyEarned = this.totalMoneyEarned + (uint) (value - this.money);
Game1.stats.checkForMoneyAchievements();
}
else
{
int money = this.money;
}
this.money = value;
}
}
public Farmer()
{
this.farmerTextureManager = Game1.content.CreateTemporary();
this.farmerRenderer = new FarmerRenderer(this.farmerTextureManager.Load<Texture2D>("Characters\\Farmer\\farmer_" + (this.isMale ? "" : "girl_") + "base"));
this.currentLocation = Game1.getLocationFromName("FarmHouse");
Game1.player.sprite = (AnimatedSprite) new FarmerSprite((Texture2D) null);
}
public Farmer(FarmerSprite sprite, Vector2 position, int speed, string name, List<Item> initialTools, bool isMale)
: base((AnimatedSprite) sprite, position, speed, name)
{
this.farmerTextureManager = Game1.content.CreateTemporary();
this.pantsColor = new Color(46, 85, 183);
this.hairstyleColor = new Color(193, 90, 50);
this.newEyeColor = new Color(122, 68, 52);
this.name = name;
this.displayName = name;
this.currentToolIndex = 0;
this.isMale = isMale;
this.basicShipped = new SerializableDictionary<int, int>();
this.fishCaught = new SerializableDictionary<int, int[]>();
this.archaeologyFound = new SerializableDictionary<int, int[]>();
this.mineralsFound = new SerializableDictionary<int, int>();
this.recipesCooked = new SerializableDictionary<int, int>();
this.friendships = new SerializableDictionary<string, int[]>();
this.stamina = (float) this.maxStamina;
this.items = initialTools;
if (this.items == null)
this.items = new List<Item>();
for (int count = this.items.Count; count < this.maxItems; ++count)
this.items.Add((Item) null);
this.activeDialogueEvents.Add("Introduction", 6);
name = "Cam";
this.farmerRenderer = new FarmerRenderer(this.farmerTextureManager.Load<Texture2D>("Characters\\Farmer\\farmer_" + (isMale ? "" : "girl_") + "base"));
this.currentLocation = Game1.getLocationFromName("FarmHouse");
if (this.currentLocation != null)
this.mostRecentBed = Utility.PointToVector2((this.currentLocation as FarmHouse).getBedSpot()) * (float) Game1.tileSize;
else
this.mostRecentBed = new Vector2(9f, 9f) * (float) Game1.tileSize;
}
public Texture2D getTexture()
{
if (this.farmerTextureManager == null)
this.farmerTextureManager = Game1.content.CreateTemporary();
return this.farmerTextureManager.Load<Texture2D>("Characters\\Farmer\\farmer_" + (this.isMale ? "" : "girl_") + "base");
}
public void checkForLevelTenStatus()
{
}
public void unload()
{
if (this.farmerTextureManager == null)
return;
this.farmerTextureManager.Unload();
this.farmerTextureManager.Dispose();
this.farmerTextureManager = (LocalizedContentManager) null;
}
public void setInventory(List<Item> newInventory)
{
this.items = newInventory;
if (this.items == null)
this.items = new List<Item>();
for (int count = this.items.Count; count < this.maxItems; ++count)
this.items.Add((Item) null);
}
public void makeThisTheActiveObject(Object o)
{
if (this.freeSpotsInInventory() <= 0)
return;
Item currentItem = this.CurrentItem;
this.ActiveObject = o;
this.addItemToInventory(currentItem);
}
public int getNumberOfChildren()
{
int num = 0;
foreach (NPC character in Utility.getHomeOfFarmer(Game1.player).characters)
{
if (character is Child && (character as Child).isChildOf(Game1.player))
++num;
}
foreach (NPC character in Game1.getLocationFromName("Farm").characters)
{
if (character is Child && (character as Child).isChildOf(Game1.player))
++num;
}
return num;
}
public void mountUp(Horse mount)
{
this.mount = mount;
this.xOffset = -11f;
this.position = Utility.PointToVector2(mount.GetBoundingBox().Location);
this.position.Y -= (float) (Game1.pixelZoom * 4);
this.position.X -= (float) (Game1.pixelZoom * 2);
this.speed = 2;
this.showNotCarrying();
}
public Horse getMount()
{
return this.mount;
}
public void dismount()
{
if (this.mount != null)
this.mount = (Horse) null;
this.collisionNPC = (NPC) null;
this.running = false;
this.speed = !Game1.isOneOfTheseKeysDown(Keyboard.GetState(), Game1.options.runButton) || Game1.options.autoRun ? 2 : 5;
this.running = this.speed == 5;
if (this.running)
{
this.speed = 5;
}
else
{
this.speed = 2;
this.Halt();
}
this.Halt();
this.xOffset = 0.0f;
}
public bool isRidingHorse()
{
if (this.mount != null)
return !Game1.eventUp;
return false;
}