protected override string GetDescription()
        {
            generateExperimentIfNeeded();

            //those 3 strings appear to do nothing
            return(TextGen.GenerateBackStories(Agent.Name, Agent.GetMindsetString(), "researching", "research", "it was aliens", new System.Random().Next()));
        }
Beispiel #2
0
    public void DrawnMapGeneration()
    {
        Color[] colourMap = new Color[mWidth * mHeight];
        float[,] noiseMap = ScriptMap.NoiseMapGen(mWidth, mHeight, seed, octaves,
                                                  lacunarity, persistance, scale, offset);

        for (int i = 0; i < mHeight; i++)
        {
            for (int j = 0; j < mWidth; j++)
            {
                float currentHeight = noiseMap[j, i];

                for (int k = 0; k < terrains.Length; k++)
                {
                    if (currentHeight <= terrains[k].terrainHeight)
                    {
                        colourMap[i * mWidth + j] = terrains[k].terrainColour;
                        break;
                    }
                }
            }
        }

        MapDisplayGen mapCanvas = FindObjectOfType <MapDisplayGen>();

        if (drawMode == DrawMode.noiseMap)
        {
            mapCanvas.DrawTexMap(TextGen.textHeightMap(noiseMap));
        }

        else if (drawMode == DrawMode.colourMap)
        {
            mapCanvas.DrawTexMap(TextGen.textColourMap(colourMap, mWidth, mHeight));
        }
    }
        protected override string GetDescription()
        {
            generateExperimentIfNeeded();

            //those 3 strings appear to do nothing
            return(TextGen.GenerateBackStories("Research", Agent.GetMindsetString(), "Science", experimentNode.GetValue("title"), new System.Random().Next(), true, true, true));
        }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey("w") || Input.GetKey("up"))
        {
            pc.Player.setAcceleration(new pointf(0, pc.Player.Speed));
            ui.Canvas.SetActive(false);
        }
        if (Input.GetKey("s") || Input.GetKey("down"))
        {
            pc.Player.setAcceleration(new pointf(0, -pc.Player.Speed));
            ui.Canvas.SetActive(false);
        }
        if (Input.GetKey("d") || Input.GetKey("right"))
        {
            pc.Player.setAcceleration(new pointf(pc.Player.Speed, 0));
            ui.Canvas.SetActive(false);
        }
        if (Input.GetKey("a") || Input.GetKey("left"))
        {
            pc.Player.setAcceleration(new pointf(-pc.Player.Speed, 0));
            ui.Canvas.SetActive(false);
        }


        if (Input.GetKeyDown("i"))
        {
            if (ui.Canvas.activeInHierarchy)
            {
                ui.Canvas.SetActive(false);
            }
            else
            {
                pointf pos     = pc.Player.getPosition();
                bool   matches = false;
                foreach (Character npc in npcs.Character)
                {
                    //Debug.Log("Test Player: "+pos.X+"|"+pos.Y);
                    // Test if th player is touching any NPC's
                    if (pos == npc.getPosition())
                    {
                        if (npc.Interactable == true)
                        {
                            ui.Canvas.SetActive(true);



                            ui.setText(npc.Talk + "\n" + TextGen.ramble());
                            matches = true;
                        }
                    }
                }
                if (matches == false)
                {
                    ui.Canvas.SetActive(false);
                }
            }
        }
    }
Beispiel #5
0
        protected override string GetDescription()
        {
            //those 3 strings appear to do nothing

            if (onLand)
            {
                return(TextGen.GenerateBackStories(Agent.Name, Agent.GetMindsetString(), "building a base", "engineering", "planetary structures", new System.Random().Next()));
            }
            else
            {
                return(TextGen.GenerateBackStories(Agent.Name, Agent.GetMindsetString(), "building a station", "orbital structures", "engineering", new System.Random().Next()));
            }
        }
Beispiel #6
0
 protected override string GetDescription()
 {
     if (contractType.description == null || contractType.description == "")
     {
         // Generate the contract description
         return(TextGen.GenerateBackStories(agent.Name, agent.GetMindsetString(),
                                            contractType.topic, contractType.subject, contractType.motivation, MissionSeed));
     }
     else
     {
         return(contractType.description);
     }
 }
        public override void DoWindowContents(Rect inRect)
        {
            Rect headerLabelRect = new Rect(inRect.position, new Vector2(inRect.width, StandardHeight));

            Rect fullNameLabelRect  = new Rect(StandardMargin, StandardHeight, inRect.width / 4, StandardHeight);
            Rect shortNameLabelRect = new Rect(StandardMargin, StandardMargin + StandardHeight * 2, inRect.width / 4, StandardHeight);

            float x = StandardMargin + inRect.width / 4;
            Rect  fullNameInputRect  = new Rect(x, StandardHeight, inRect.width - x - StandardMargin - StandardHeight, StandardHeight);
            Rect  shortNameInputRect = new Rect(x, StandardMargin + StandardHeight * 2, inRect.width - x - StandardMargin - StandardHeight, StandardHeight);

            Rect resetFullNameButtonRect  = new Rect(inRect.width - StandardHeight, StandardHeight, StandardHeight, StandardHeight);
            Rect resetShortNameButtonRect = new Rect(inRect.width - StandardHeight, StandardMargin + StandardHeight * 2, StandardHeight, StandardHeight);

            GameFont   fontBefore   = Text.Font;
            TextAnchor anchorBefore = Text.Anchor;

            Text.Anchor = TextAnchor.MiddleLeft;
            Text.Font   = GameFont.Medium;

            Widgets.Label(headerLabelRect, "FCCustomizeSettlement".Translate());

            Text.Font = GameFont.Small;

            Widgets.Label(fullNameLabelRect, "FCSettlementFullName".Translate());
            name = Widgets.TextField(fullNameInputRect, name);

            Widgets.Label(shortNameLabelRect, "FCSettlementShortName".Translate());
            shortName = Widgets.TextField(shortNameInputRect, shortName);

            if (Widgets.ButtonImage(resetFullNameButtonRect, TexLoad.refreshIcon))
            {
                name = settlement.name;
            }
            if (Widgets.ButtonImage(resetShortNameButtonRect, TexLoad.refreshIcon))
            {
                shortName = TextGen.ToShortName(name);
            }

            Text.Anchor = TextAnchor.MiddleCenter;

            //reset anchor/font
            Text.Font   = fontBefore;
            Text.Anchor = anchorBefore;
        }
Beispiel #8
0
 protected override string GetDescription()
 {
     return(TextGen.GenerateBackStories(Localizer.Format("#autoLOC_TST_0052"), agent.Name, Localizer.Format("#autoLOC_TST_0053"), target.name, MissionSeed, true, true, true)); //#autoLOC_TST_0052 = Exploration # autoLOC_TST_0053 = ChemCam
 }
Beispiel #9
0
 protected override string GetDescription()
 {
     //those 3 strings appear to do nothing
     return(TextGen.GenerateBackStories(Agent.Name, Agent.GetMindsetString(), "experiment", "station", "kill all humans", new System.Random().Next()));
 }
Beispiel #10
0
 protected override string GetDescription()
 {
     //those 3 strings appear to do nothing
     return(TextGen.GenerateBackStories("Station Science", Agent.Name, "station science experiment", experimentType.title, new System.Random().Next(), true, true, true));
 }
Beispiel #11
0
        public bool Initialize(ContractType contractType)
        {
            LoggingUtil.LogLevel origLogLevel = LoggingUtil.logLevel;
            try
            {
                this.contractType = contractType;
                if (contractType.trace)
                {
                    LoggingUtil.logLevel = LoggingUtil.LogLevel.VERBOSE;
                }

                LoggingUtil.LogDebug(this, "Initializing contract: " + contractType);

                // Set stuff from contract type
                subType    = contractType.name;
                hash       = contractType.hash;
                AutoAccept = contractType.autoAccept;

                // Set the contract expiry
                if (contractType.maxExpiry == 0.0f)
                {
                    LoggingUtil.LogDebug(this, contractType.name + ": Setting expirty to none");
                    SetExpiry();
                    expiryType = DeadlineType.None;
                }
                else
                {
                    SetExpiry(contractType.minExpiry, contractType.maxExpiry);
                    // Force set the expiry, in stock this is normally done on Contract.Offer()
                    dateExpire = GameTime + TimeExpiry;
                }

                // Set the contract deadline
                if (contractType.deadline == 0.0f)
                {
                    deadlineType = Contract.DeadlineType.None;
                }
                else
                {
                    SetDeadlineDays(contractType.deadline, null);
                }

                // Set rewards
                SetScience(contractType.rewardScience, contractType.targetBody);
                SetReputation(contractType.rewardReputation, contractType.failureReputation, contractType.targetBody);
                SetFunds(contractType.advanceFunds, contractType.rewardFunds, contractType.advanceFunds + contractType.failureFunds, contractType.targetBody);

                // Copy text from contract type
                title            = contractType.title;
                synopsis         = contractType.synopsis;
                completedMessage = contractType.completedMessage;
                notes            = contractType.notes;

                // Set the agent
                if (contractType.agent != null)
                {
                    agent = contractType.agent;
                }
                else
                {
                    agent = AgentList.Instance.GetSuitableAgentForContract(this);
                }

                // Set description
                if (string.IsNullOrEmpty(contractType.description) && agent != null)
                {
                    // Generate the contract description
                    description = TextGen.GenerateBackStories("ConfiguredContract", agent.Name, contractType.topic, contractType.subject, random.Next(), true, true, true);
                }
                else
                {
                    description = contractType.description;
                }

                // Generate behaviours
                behaviours = new List <ContractBehaviour>();
                if (!contractType.GenerateBehaviours(this))
                {
                    return(false);
                }

                // Generate parameters
                bool paramsGenerated = contractType.GenerateParameters(this);
                bodiesLoaded = false;
                contractType.contractBodies = ContractBodies;
                if (!paramsGenerated)
                {
                    return(false);
                }

                // Do a very late research bodies check
                try
                {
                    contractType.ResearchBodiesCheck(this);
                }
                catch (ContractRequirementException)
                {
                    return(false);
                }

                // Copy in the requirement nodes
                requirements = new List <ContractRequirement>();
                foreach (ContractRequirement requirement in contractType.Requirements)
                {
                    requirements.Add(requirement);
                }

                LoggingUtil.LogDebug(this, "Initialized contract: " + contractType);
                return(true);
            }
            catch (Exception e)
            {
                LoggingUtil.LogError(this, "Error initializing contract " + contractType);
                LoggingUtil.LogException(e);
                ExceptionLogWindow.DisplayFatalException(ExceptionLogWindow.ExceptionSituation.CONTRACT_GENERATION, e,
                                                         contractType == null ? "unknown" : contractType.FullName);

                return(false);
            }
            finally
            {
                LoggingUtil.logLevel = origLogLevel;
            }
        }
Beispiel #12
0
 protected override string GetDescription()
 {
     return(TextGen.GenerateBackStories(Agent.Name, Agent.GetMindsetString(), "", "", "", new System.Random().Next()));
 }
Beispiel #13
0
 protected override string GetDescription()
 {
     //those 3 strings appear to do nothing
     return(TextGen.GenerateBackStories(Agent.Name, Agent.GetMindsetString(), "unmanned", "probes", "GPS", new System.Random().Next()));
 }
 protected override string GetDescription()
 {
     // Topic and Subject are unused in the standard StoryDefs.cfg for "CollectScience" missions
     return(TextGen.GenerateBackStories("CollectScience", Agent.Name, "", "", MissionSeed, true, true, true));
 }
 protected override string GetDescription()
 {
     return(TextGen.GenerateBackStories(agent.Name, agent.GetMindsetString(), "Space Telescope", target.name, "test", MissionSeed));
 }
 protected override string GetDescription()
 {
     //those 3 strings appear to do nothing
     return(TextGen.GenerateBackStories(Agent.Name, Agent.GetMindsetString(), "science", "station", "expand knowledge", new System.Random().Next()));
 }
Beispiel #17
0
 protected override string GetDescription()
 {
     return(TextGen.GenerateBackStories(Agent.Name, Agent.GetMindsetString(), "commerce", "trading", "Resources Transportation", new System.Random().Next()));
 }
Beispiel #18
0
 protected override string GetDescription()
 {
     //those 3 strings appear to do nothing
     return(TextGen.GenerateBackStories(Agent.Name, Agent.GetMindsetString(), "driving a rover", "joyriding", "surface travel", new System.Random().Next()));
 }
Beispiel #19
0
        protected override bool Generate()
        {
            // MeetsRequirement gets called first and sets the contract type, but check it and
            // select the contract type just in case.
            if (contractType == null)
            {
                if (!SelectContractType())
                {
                    return(false);
                }
            }

            LoggingUtil.LogDebug(this.GetType(), "Generating contract: " + contractType);

            hash = contractType.hash;

            // Set the agent
            if (contractType.agent != null)
            {
                agent = contractType.agent;
            }

            // Set the contract expiry
            if (contractType.maxExpiry == 0.0f)
            {
                SetExpiry();
                expiryType = DeadlineType.None;
            }
            else
            {
                SetExpiry(contractType.minExpiry, contractType.maxExpiry);
            }

            // Set the contract deadline
            if (contractType.deadline == 0.0f)
            {
                deadlineType = Contract.DeadlineType.None;
            }
            else
            {
                SetDeadlineDays(contractType.deadline, contractType.targetBody);
            }

            // Set rewards
            SetScience(contractType.rewardScience, contractType.targetBody);
            SetReputation(contractType.rewardReputation, contractType.failureReputation, contractType.targetBody);
            SetFunds(contractType.advanceFunds, contractType.rewardFunds, contractType.failureFunds, contractType.targetBody);

            // Copy text from contract type
            title            = contractType.title;
            synopsis         = contractType.synopsis;
            completedMessage = contractType.completedMessage;
            notes            = contractType.notes;

            // Set description
            if (string.IsNullOrEmpty(contractType.description))
            {
                if (agent == null)
                {
                    agent = AgentList.Instance.GetSuitableAgentForContract(this);
                }

                // Generate the contract description
                description = TextGen.GenerateBackStories(agent.Name, agent.GetMindsetString(),
                                                          contractType.topic, contractType.subject, contractType.motivation, MissionSeed);
            }
            else
            {
                description = contractType.description;
            }

            // Generate behaviours
            behaviours = new List <ContractBehaviour>();
            if (!contractType.GenerateBehaviours(this))
            {
                return(false);
            }

            // Generate parameters
            try
            {
                if (!contractType.GenerateParameters(this))
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                LoggingUtil.LogException(new Exception("Failed generating parameters for " + contractType, e));
                return(false);
            }

            LoggingUtil.LogInfo(this.GetType(), "Generated contract: " + contractType);
            return(true);
        }
Beispiel #20
0
 protected override string GetDescription()
 {
     //those 3 strings appear to do nothing
     return(TextGen.GenerateBackStories(Agent.Name, Agent.GetMindsetString(), "retrieving an asteroid", "snooker", "large rocks", new System.Random().Next()));
 }
Beispiel #21
0
 protected override string GetDescription()
 {
     //those 3 strings appear to do nothing
     return(TextGen.GenerateBackStories(Agent.Name, Agent.GetMindsetString(), "flying", "not crashing", "aerial", new System.Random().Next()));
 }
Beispiel #22
0
 protected override string GetDescription()
 {
     //those 3 strings appear to do nothing
     return(TextGen.GenerateBackStories(Agent.Name, Agent.GetMindsetString(), "ISRU", "resource extraction", "sustainability", new System.Random().Next()));
 }