class Astromapper::Builder::Terrestrial

Public Class Methods

new(star,orbit_number) click to toggle source
Calls superclass method Astromapper::Builder::Planet::new
# File lib/astromapper/builder/orbit.rb, line 168
def initialize(star,orbit_number)
  super
  @kid       = 'R'
  
  # Size, Climate & Biosphere. MgT 170--71.
  @size      = toss(2,1)
  @atmo      = toss()
                          # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
  temp_dice  = toss(2,0) + [0, 0,-2,-2,-1,-1, 0, 0, 1, 1, 2, 6, 6, 2,-1, 2][@atmo]
  
  @temp      = %w{F F F C C T T T T T H H R R R R R }[temp_dice]
  
  # Hydrographics. MgT p. 172
  @h20 = case 
    when (@size < 2 or !biozone?) then 0
    when ([0,1,10,11,12].include?(@atmo)) then (toss(2,11) + @size).max(10)
    else @h20  = (toss(2,7) + @size).max(10)
  end
  @h20 -= 2 if @temp == 'H'
  @h20 -= 6 if @temp == 'R'
  @h20 = @h20.whole
  
  # Adjust Atmosphere and Hydrographics when not Normal. MgT p. 180.
  if (%{opera firm}.include?(config['genre'].downcase))
    @atmo = case
      when (@size < 3 or (@size < 4 and @atmo < 3)) then 0
      when ([3,4].include?(@size) and (3..5).include?(@atmo)) then 1
      when ([3,4].include?(@size) and @atmo > 5) then 10
      else @atmo
    end
    @h20 -= 6 if (((3..4).include?(@size) and @atmo == 'A' ) or @atmo < 2)
    @h20 -= 4 if ([2,3,11,12].include?(@atmo))
  end
end