예제 #1
0
        public string GetDescription(City city, GameMaster game)
        {
            string output = "<b>" + Name + "</b>\n";

            if (WorkingPopPreReq > 0 || ProjectPreReqs.Length > 0)
            {
                output += "Requirements:\n";
                if (WorkingPopPreReq > 0)
                {
                    output += "\tWorking Population: " + WorkingPopPreReq + "\n";
                }
                foreach (string projectID in ProjectPreReqs)
                {
                    output += "\t" + GlobalProjectDictionary.GetProjectData(projectID).Name + "\n";
                }
            }
            output += "Cost:\n";
            foreach (KeyValuePair <string, int> resource in project.GetResourceCost(city, game))
            {
                output += "\t" + GlobalResourceDictionary.GetResourceData(resource.Key).name + " (" + resource.Value + ")\n";
            }
            output += "Employs: " + Employment + "\n";
            output += "<b>" + Type + "</b>\n";
            output += "Description: \n" + project.GetDescription();
            return(output);
        }
예제 #2
0
        public void OnNextTurn(City city, GameMaster game)
        {
            float tilePower         = UseFertility ? game.World.GetFertilityAtTile(position) : game.World.GetRichnessAtTile(position);
            float hardnessModifier  = game.GetResourceModifier(ModifierAttributeID.HARDNESS, resourceID, city);
            float efficienyModifier = game.GetResourceModifier(ModifierAttributeID.EFFICIENCY, resourceID, city);

            game.AddPendingResource(resourceID, tilePower * efficienyModifier / (GlobalResourceDictionary.GetResourceData(resourceID).hardness *hardnessModifier));
        }
예제 #3
0
 private void UpdateConstructionProgressCost(GameMaster game)
 {
     requiredConstructionProgress = 0;
     foreach (KeyValuePair <string, int> cost in project.GetResourceCost(city, game))
     {
         requiredConstructionProgress += GlobalResourceDictionary.GetResourceData(cost.Key).weight *cost.Value;
     }
 }
예제 #4
0
        public override string ToString()
        {
            string output = "";

            if (value > 0)
            {
                output += "Increases " + GlobalResourceDictionary.GetResourceData(id).name;
                output += " " + attr.ToString() + " by " + Mathf.RoundToInt(value * 100) + "%";
            }
            else if (value < 0)
            {
                output += "Decreases " + GlobalResourceDictionary.GetResourceData(id).name;
                output += " " + attr.ToString() + " by " + Mathf.RoundToInt(value * 100) + "%";
            }
            return(output);
        }