Difference between revisions of "Program Code"

From BotF2-Wiki
Jump to: navigation, search
(GetProductionOutput)
(some code)
Line 36: Line 36:
 
                         baseOutput = (int)(moraleMod * baseOutput);
 
                         baseOutput = (int)(moraleMod * baseOutput);
 
*last line: return ((int)(baseOutput + (baseOutput * modifier.Efficiency)) + modifier.Bonus);
 
*last line: return ((int)(baseOutput + (baseOutput * modifier.Efficiency)) + modifier.Bonus);
 +
|style=text-align:left|
 +
|style=text-align:left|
 +
 +
|-
 +
|style=text-align:left|S-Core
 +
|style=text-align:center|Universe
 +
|style=text-align:center|Colony.cs
 +
|style=text-align:center|planet.HasFoodBonus (OutputModifier)
 +
|style=text-align:center|
 +
|style=text-align:left|
 +
                        if (planet.HasFoodBonus)
 +
                        modifier.Efficiency += 0.15f;
 +
|style=text-align:left|
 +
|style=text-align:left|
 +
 +
|-
 +
|style=text-align:left|S-Core
 +
|style=text-align:center|Universe
 +
|style=text-align:center|Colony.cs
 +
|style=text-align:center|planet.HasEnergyBonus (OutputModifier)
 +
|style=text-align:center|
 +
|style=text-align:left|
 +
                    if (planet.HasEnergyBonus)
 +
                        modifier.Efficiency += 0.15f;
 +
|style=text-align:left|
 +
|style=text-align:left|
 +
 +
|-
 +
|style=text-align:left|S-Core
 +
|style=text-align:center|Universe
 +
|style=text-align:center|Colony.cs
 +
|style=text-align:center|THIS IS ONLY A PATTERN !!
 +
|style=text-align:center|
 +
|style=text-align:left|
 
|style=text-align:left|
 
|style=text-align:left|
 
|style=text-align:left|
 
|style=text-align:left|
 
|}
 
|}

Revision as of 14:44, 1 January 2014

Source is at https://bitbucket.org/mstrobel/BotF2/

Program Code Language: C#



some code

where Folder File Function empty Description Custom1 Custom2
S-Core Universe Colony.cs GetProductionOutput(ProductionCategory category)

see last line, too !

  • Food: minimum 10
  • Research:
                       float moraleMod = _morale.CurrentValue / (0.5f * MoraleHelper.MaxValue);
                       baseOutput = (int)(moraleMod * baseOutput);
  • Industry: minimum 10 !
                       float moraleMod = _morale.CurrentValue / (0.5f * MoraleHelper.MaxValue);
                       baseOutput = (int)(moraleMod * baseOutput);
  • last line: return ((int)(baseOutput + (baseOutput * modifier.Efficiency)) + modifier.Bonus);
S-Core Universe Colony.cs planet.HasFoodBonus (OutputModifier)
                       if (planet.HasFoodBonus)
                       modifier.Efficiency += 0.15f;
S-Core Universe Colony.cs planet.HasEnergyBonus (OutputModifier)
                   if (planet.HasEnergyBonus)
                       modifier.Efficiency += 0.15f;
S-Core Universe Colony.cs THIS IS ONLY A PATTERN !!