public void GUI_EnterPort(Intention i = Intention.All)
    {
        //Turn off port welcome screen
        GameVars.showPortDockingNotification = false;
        port_info_main.SetActive(false);
        port_info_taxes.GetComponent <Text>().text = GameVars.currentPortTax.ToString();
        //Check if current Settlement is part of the main quest line
        Globals.Quests.CheckCityTriggers(GameVars.currentSettlement.settlementID);
        //Add this settlement to the player's knowledge base
        GameVars.playerShipVariables.ship.playerJournal.AddNewSettlementToLog(GameVars.currentSettlement.settlementID);
        //Determine what settlements are available to the player in the tavern
        GameVars.showSettlementGUI         = true;
        GameVars.showSettlementTradeButton = false;
        GameVars.controlsLocked            = true;

        //-------------------------------------------------
        //NEW GUI FUNCTIONS FOR SETTING UP TAB CONTENT
        //Show Port Menu
        Globals.UI.Hide <Dashboard>();

        if (i.Equals(Intention.Water) || i.Equals(Intention.Trading))
        {
            Globals.UI.Show <TownScreen, TradeViewModel>(new TradeViewModel(i.Equals(Intention.Water), false));
        }
        else
        {
            Globals.UI.Show <PortScreen, PortViewModel>(new PortViewModel(!i.Equals(Intention.Tavern)));
        }


        //Add a new route to the player journey log as a port entry
        GameVars.playerShipVariables.journey.AddRoute(new PlayerRoute(GameVars.playerShip.transform.position, Vector3.zero, GameVars.currentSettlement.settlementID, GameVars.currentSettlement.name, false, GameVars.playerShipVariables.ship.totalNumOfDaysTraveled), GameVars.playerShipVariables, GameVars.CaptainsLog);
        //We should also update the ghost trail with this route otherwise itp roduce an empty 0,0,0 position later
        GameVars.playerShipVariables.UpdatePlayerGhostRouteLineRenderer(GameVars.IS_NOT_NEW_GAME);

        //-------------------------------------------------
        // UPDATE PLAYER CLOUT METER
        GUI_UpdatePlayerCloutMeter();


        //-------------------------------------------------
        // OTHER PORT GUI SETUP FUNCTIONS
        GetCrewHometowns();
        GUI_GetListOfBuiltMonuments();
        GUI_GetBuiltMonuments();
        port_info_cityName.GetComponent <Text>().text    = GameVars.currentSettlement.name;
        port_info_description.GetComponent <Text>().text = GameVars.currentSettlement.description;
    }
        public override bool DropInt(Circumstance C, Literal goal, Unifier un)
        {
            Unifier bak                  = un.Clone();
            bool    isCurrentInt         = false;
            IEnumerator <Intention> iint = C.GetAllIntentions();

            while (iint.Current != null)
            {
                Intention i  = iint.Current;
                IPlanBody pb = i.Peek().GetPlan().GetBody();
                while (pb != null)
                {
                    if (pb.GetBodyType() == BodyType.Body_Type.achieve || pb.GetBodyType() == BodyType.Body_Type.achieveNF)
                    {
                        if (un.Unifies(pb.GetBodyTerm(), goal))
                        {
                            C.DropIntention(i);
                            isCurrentInt = isCurrentInt || i.Equals(C.GetSelectedIntention());
                            un           = bak.Clone();
                            break;
                        }
                    }
                    pb = pb.GetBodyNext();
                }
            }
            return(isCurrentInt);
        }
Beispiel #3
0
 public void IntentionDropped(Intention i)
 {
     if (i.Equals(si))
     {
         dropped = true;
         Resume(false);
     }
 }
Beispiel #4
0
        /**
         * Drops an intention based on a goal argument
         *
         * returns true if the current intention is dropped
         */
        public virtual bool DropInt(Circumstance C, Literal goal, Unifier un)
        {
            Unifier bak                  = un.Clone();
            Trigger g                    = new Trigger(TEOperator.add, TEType.achieve, goal);
            bool    isCurrentInt         = false;
            IEnumerator <Intention> iint = C.GetAllIntentions();

            while (iint.Current != null)
            {
                Intention i = iint.Current;
                if (i.HasTrigger(g, un))
                {
                    C.DropIntention(i);
                    isCurrentInt = isCurrentInt || i.Equals(C.GetSelectedIntention());
                    un           = bak.Clone();
                }
            }
            return(isCurrentInt);
        }