Farmhouse_Basement_Revised/ScienceHouse.cs
/// <summary>
/// Defines the carpenter loop. This method modifies the vanilla loop to account for an additional house upgrade.
/// </summary>
/// <param name="tileLocation">The location that an action should be performed on.</param>
Defines the carpenter loop. This method modifies the vanilla loop to account for an additional house upgrade.
Defines the carpenter loop . This method modifies the vanilla loop to account for an additional house upgrade .
private void carpenters(Location tileLocation)
        {
            if (Game1.player.currentUpgrade == null) {
                foreach (NPC character in characters) {
                    if (character.Name.Equals("Robin")) {
                        if (!(Microsoft.Xna.Framework.Vector2.Distance(character.getTileLocation(), new Microsoft.Xna.Framework.Vector2((float)tileLocation.X, (float)tileLocation.Y)) > 3f)) {
                            character.faceDirection(2);
                            if (Game1.player.daysUntilHouseUpgrade < 0 && !Game1.getFarm().isThereABuildingUnderConstruction()) {
                                System.Collections.Generic.List<Response> options = new System.Collections.Generic.List<Response>();
                                options.Add(new Response("Shop", Game1.content.LoadString("Strings\\Locations:ScienceHouse_CarpenterMenu_Shop")));
                                if (Game1.IsMasterGame) {
                                    if ((int)Game1.player.houseUpgradeLevel < 3) {
                                        options.Add(new Response("Upgrade", Game1.content.LoadString("Strings\\Locations:ScienceHouse_CarpenterMenu_UpgradeHouse")));
                                    } else if ((Game1.MasterPlayer.mailReceived.Contains("ccIsComplete") || Game1.MasterPlayer.mailReceived.Contains("JojaMember") || Game1.MasterPlayer.hasCompletedCommunityCenter()) && (int)(Game1.getLocationFromName("Town") as StardewValley.Locations.Town).daysUntilCommunityUpgrade <= 0 && !Game1.MasterPlayer.mailReceived.Contains("pamHouseUpgrade")) {
                                        options.Add(new Response("CommunityUpgrade", Game1.content.LoadString("Strings\\Locations:ScienceHouse_CarpenterMenu_CommunityUpgrade")));
                                    }
                                } else if ((int)Game1.player.houseUpgradeLevel < 2) {
                                    options.Add(new Response("Upgrade", Game1.content.LoadString("Strings\\Locations:ScienceHouse_CarpenterMenu_UpgradeCabin")));
                                }
                                options.Add(new Response("Construct", Game1.content.LoadString("Strings\\Locations:ScienceHouse_CarpenterMenu_Construct")));
                                options.Add(new Response("Leave", Game1.content.LoadString("Strings\\Locations:ScienceHouse_CarpenterMenu_Leave")));
                                createQuestionDialogue(Game1.content.LoadString("Strings\\Locations:ScienceHouse_CarpenterMenu"), options.ToArray(), "carpenter");
                            } else {
                                Game1.activeClickableMenu = new StardewValley.Menus.ShopMenu(Utility.getCarpenterStock(), 0, "Robin");
                            }
                        }
                        return;
                    }
                }
                if (Game1.shortDayNameFromDayOfSeason(Game1.dayOfMonth).Equals("Tue")) {
                    Game1.drawObjectDialogue(Game1.content.LoadString("Strings\\Locations:ScienceHouse_RobinAbsent").Replace('\n', '^'));
                }
            }
        }
private void carpenters ( Location tileLocation ) { if ( Game1 . player . currentUpgrade == null ) { foreach ( NPC character in characters ) { if ( character . Name . Equals ( " " ) ) { if ( ! ( Microsoft . Xna . Framework . Vector2 . Distance ( character . getTileLocation ( ) , new Microsoft . Xna . Framework . Vector2 ( ( float ) tileLocation . X , ( float ) tileLocation . Y ) ) > 3f ) ) { character . faceDirection ( 2 ) ; if ( Game1 . player . daysUntilHouseUpgrade < 0 && ! Game1 . getFarm ( ) . isThereABuildingUnderConstruction ( ) ) { System . Collections . Generic . List < Response > options = new System . Collections . Generic . List < Response > ( ) ; options . Add ( new Response ( " " , Game1 . content . LoadString ( " \\ " ) ) ) ; if ( Game1 . IsMasterGame ) { if ( ( int ) Game1 . player . houseUpgradeLevel < 3 ) { options . Add ( new Response ( " " , Game1 . content . LoadString ( " \\ " ) ) ) ; } else if ( ( Game1 . MasterPlayer . mailReceived . Contains ( " " ) || Game1 . MasterPlayer . mailReceived . Contains ( " " ) || Game1 . MasterPlayer . hasCompletedCommunityCenter ( ) ) && ( int ) ( Game1 . getLocationFromName ( " " ) as StardewValley . Locations . Town ) . daysUntilCommunityUpgrade <= 0 && ! Game1 . MasterPlayer . mailReceived . Contains ( " " ) ) { options . Add ( new Response ( " " , Game1 . content . LoadString ( " \\ " ) ) ) ; } } else if ( ( int ) Game1 . player . houseUpgradeLevel < 2 ) { options . Add ( new Response ( " " , Game1 . content . LoadString ( " \\ " ) ) ) ; } options . Add ( new Response ( " " , Game1 . content . LoadString ( " \\ " ) ) ) ; options . Add ( new Response ( " " , Game1 . content . LoadString ( " \\ " ) ) ) ; createQuestionDialogue ( Game1 . content . LoadString ( " \\ " ) , options . ToArray ( ) , " " ) ; } else { Game1 . activeClickableMenu = new StardewValley . Menus . ShopMenu ( Utility . getCarpenterStock ( ) , 0 , " " ) ; } } return ; } } if ( Game1 . shortDayNameFromDayOfSeason ( Game1 . dayOfMonth ) . Equals ( " " ) ) { Game1 . drawObjectDialogue ( Game1 . content . LoadString ( " \\ " ) . Replace ( ' \n ' , ' ' ) ) ; } } }
Defines the carpenter loop.
Defines the carpenter loop .
// @TODO: implement proper carpenter code for new upgrade // (this is just copy and paster from decompiled source code)
tileLocation
Location
The location that an action should be performed on.
The location that an action should be performed on .