
Y(Hc        !   @   s  d  d k  Z  d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k	 Z	 d  d k l
 Z
 l Z l Z l Z d  d k l Z e a d   Z d   Z d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d d d d d d d d d d d d d d d d d  d! d" d# d$ g Z d%   Z d&   Z  d'   Z! d(   Z" d)   Z# d S(*   iN(   t   alwayst   voidt   exitt   Return(   t	   safe_callc      
   C   s
  t  i i t  i d |  d |  d d t |  d f  t  i i t  i d |  d d |  d d d t |  d d f  h  } xx t t |   D]d } t |  | t i |  d d	 |  d d	 | d f d | | d | | d t  i	 d d  <q Wt i
 |  S(   Nt   whitei    i   i   iF   t   blacki   i   i
   i   i2   i   (   i   i2   (   t   gt   screent   fillt   colorst   lent   rangeR    t   buttonst   make_norm_buttont   fontt   show_buttons(   t   xy_loct	   titlelistt   menu_buttonst   i(    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt   display_generic_menu'   s    $, bc          C   s3  g  }  |  i  d d g  |  i  d d g  |  i  d d g  |  i  d d g  |  i  d	 d
 g  |  i  d d g  t t i d d d d f |   } | d j o d Sn | d j o d Snj | d j o d SnU | d j o d Sn@ | d j o d Sn+ | d j o d Sn | d j o d Sn d  S(   Ns   NEW GAMEt   Ns	   SAVE GAMEt   Ss	   LOAD GAMEt   Lt   OPTIONSt   Ot   QUITt   Qt   BACKt   Bi    i   id   i2   ii   i   i   i   (   t   appendR   R   t   screen_size(   t   button_arrayt	   selection(    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt   display_pause_menu5   s,    $       c         C   s  t  i d j o d  Sn t  i d  g  } | i d d g  | i d d g  | i d d g  | i d	 d
 g  | i d d g  | i d d g  t t  i d d d d f |  } | d j o d  Sn| d j o t  i d d t  i d d t  i d d d d f d! d t  i d t  i d t  i d t  i d 
 } | i	   t
 j o d  Sn t  i i t |  7_ d  Sn&| d j of t i   d d k l } d | _ t i |  t  i i | i  o t  i | i i   n d  Sn | d j o7 x, t  i   D] } | i p | i   qqWd  Sno | d j o d t  _ d  SnQ | d j o. x# t  i i i   D] } d | _ qyWd  Sn | d  j o d  Sn d  S("   Ni    t   clicks
   GIVE MONEYt   Ms	   GIVE TECHt   Ts   END CONSTR.t   Et
   SUPERSPEEDR   s
   KILL SUSP.t   KR   R   i   id   i2   is   How much cash?t    i   i   i   t	   dark_blueR   t
   light_bluei   (   t	   fake_basei   i / i   i   (   i   id   (   R   t   cheatert
   play_soundR   R   R    t   create_textboxR   R
   t   isdigitt   Falset   plt   casht   intt   research_screent   init_fake_baseR-   t   studyingt   base_screent   change_techt   techst   has_keyt   finisht	   all_basest   donet
   curr_speedt   groupst   valuest	   suspicion(   R   R!   R"   t   cash_amountR-   t   baset   group(    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt   display_cheat_listG   sZ     $ ($ 
	 
	  c          C   s   t  i d  g  }  |  i d d g  |  i d d g  |  i d d g  |  i d d	 g  t t  i d
 d d d f |   } | d j o d  Snd | d
 j o t d  nI | d j o t   n1 | d j o t d  n | d j o d  Sn d  S(   NR$   t   TECHSR&   t   ITEMSt   It   CONCEPTSt   CR   R   i    i   id   ix   it   techi   t   concepti   (   R   R/   R   R   R    t   display_itemst   display_itemtype_list(   R!   R"   (    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt   display_knowledge_listr   s"    $   c          C   s#  g  }  |  i  d d g  |  i  d d g  |  i  d d g  |  i  d d g  |  i  d	 d
 g  t t i d d d d f |   } | d j o d  Sn | d j o t d  ng | d j o t d  nL | d j o t d  n1 | d j o t d  n | d j o d  Sn d  S(   Nt	   PROCESSORt   Pt   REACTORt   Rt   NETWORKR   t   SECURITYR   R   R   i    i   id   iF   it   computei   t   reactt   networki   t   securityi   (   R   R   R   R    RO   (   R!   R"   (    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyRP      s&    $      c            s7  d } g   g  }  d j o? g  } t  i i   D] } | i   o | | q3 q3 ~ } n  d j oJ g  } t  i i   D] } | | d d | d g q ~ } | i   nL g  } t  i i   D]. } | i  j o | i   o | | q q ~ }  d j o; g  }	 | D] } |	 | i | i	 g q~	 } | i   n x. | D]& \ }
 }  i
 |  | i
 |
  qOWt  i d d d d f   t i  |  h  } t i | t i   d d	   d d
 f d d d t  i d d  <    f d   } t i | | d | d   d d d | d t i d  S(   Ni   RM   RN   i   i    i   i!  i2   ig   io  id   R   R   i   c            sY    d j o t   |     n4  d j o t  |     n t  |     d  S(   NRM   RN   (   t   refresh_techt   refresh_conceptt   refresh_items(   t   item_pos(   R   t   listt	   item_type(    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt
   do_refresh   s
    t	   list_sizet   loct   box_sizei   i^  t   pos_callbackt   return_callback(   id   i2   (   i   i^  (   R   R;   RB   t	   availablet   help_stringst   itemst   sortRa   t   namet   idR   R    t   listboxt   resize_listR   R   R   R   t   show_listbox(   Ra   Rc   t   display_listt   _[1]RM   Rj   t   _[2]t   itemt   _[3]t   _[4]Rl   Rm   R   Rb   (    (   R   R`   Ra   s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyRO      s4    ?<1- Cc         C   s  | d d | d f } t  i i t  i d | d d | d d d f  t  i i t  i d | d d	 | d d d
 d f  |  d j o d  Sn t  i t  i t  i |  i t  i d d d | d d | d d f t  i d  t  i |  i p!d } t  i t  i | t  i d d d | d d | d d f t  i d  t  i	 t  i |  i
 d  d } t  i t  i | t  i d d d | d d | d d f t  i d  t  i t  i |  i
 d  d } t  i t  i | t  i d d d | d d | d d f t  i d  nH t  i t  i d t  i d d d | d d | d d f t  i d  t  i |  i d j o
 d } n t  i |  i d j o
 d } nd t  i |  i d j o
 d } nC t  i |  i d j o
 d } n" t  i |  i d  j o
 d! } n t  i t  i | t  i d d" d | d d | d d# f t  i d  t  i |  i og t  i t  i t  i |  i d$ t  i |  i t  i d d d% | d d | d d& f t  i d  nR t  i t  i t  i |  i t  i d d d% | d d | d d& f t  i d  d  S('   Ni    id   i   R   i   i,  i^  R+   i   i*  i\  R*   i   ii   i   s   Research Cost:i   i   s    Moneyi   i2   s    CPUiF   s   Research complete.s   Study anywhere.s   Study underseas or farther.i   s   Study off-planet.i   s    Study far away from this planet.i   s   Do not study in this dimension.i   iZ   s    \n \n i"  ix   (   R   R   R	   R
   t   print_stringR;   Rl   R   R?   t   to_moneyt	   cost_leftt   to_cput   dangert   print_multilinet   descriptiont   result(   t	   tech_namet   xyt   string(    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyR\      sJ    2688!8!<8




8<c         C   sx  | d d | d f } t  i i t  i d | d d | d d d f  t  i i t  i d | d d	 | d d d
 d f  |  d j o d  Sn t  i t  i t  i |  i t  i d d d | d d | d d f t  i d  d } t  i t  i | t  i d d d | d d | d d f t  i d  t  i t  i |  i	 d  d } t  i t  i | t  i d d d | d d | d d f t  i d  t  i
 t  i |  i	 d  } t  i t  i | t  i d d d | d d | d d f t  i d  t  i |  i d j o d t t  i |  i  } n t  i |  i d j o! d t  i t  i |  i  } nq t  i |  i d j o! d t  i t  i |  i  } n9 t  i |  i d j o! d t  i t  i |  i  } n t  i t  i | t  i d d  d | d d | d d! f t  i d  t  i t  i t  i |  i t  i d d d" | d d | d d# f t  i d  d  S($   Ni    id   i   R   i   i,  i^  R+   i   i*  i\  R*   i   ii   i   s   Building Cost:i   i   s    Moneyi   i2   i   iF   RX   s   CPU per day: RY   s   Detection chance reduction: RZ   s   CPU bonus: R[   i   iZ   i"  ix   (   R   R   R	   R
   Rw   Rj   Rl   R   Rx   t   costt   to_timeRa   t   strt	   item_qualt
   to_percentR|   R}   (   t	   item_nameR   R   (    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyR^      s8    2688!88!!!8c         C   s=  | d d | d f } t  i i t  i d | d d | d d d f  t  i i t  i d | d d	 | d d d
 d f  |  d j o d  Sn t  i t  i t  i |  d t  i d d d | d d | d d f t  i d  t  i t  i t  i |  d t  i d d d | d d | d d f t  i d  d  S(   Ni    id   i   R   i   i,  i^  R+   i   i*  i\  R*   i   ii   i   i   i"  i   (   R   R   R	   R
   Rw   Ri   R   R|   (   t   concept_nameR   (    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyR]     s    268c             s  d }  t  i d d j o
 d }  n h   t i d9 d: d	 d
 t  i d t  i d t  i d t  i d t  i d |  	  t   <t  t i d; d< d d t  i d d  <d   } d= d> d? d@ dA f } d  } x | D]z \ } } } } | d!  } t i | d f | d f | t	 |  t  i d d d" | }	 | |   |	 <| | d 7} q W|  }
 t  i d d j o |  d }
 n t i dB t  i d d# d f d$ d
 t  i d t  i d t  i d t  i d t  i d |
 	  t   <t i d t  i d d f t  i d d f d% d
 t  i d t  i d t  i d t  i d t  i d |
 	  t   <t i dC t  i d d# d f d' d
 t  i d t  i d t  i d t  i d t  i d |
 	  t   <t i d t  i d d( f dD d* d+ t  i d d   t
 i   <t i t  i d d) t  i d d( f dE d, d- t  i d d   t i   <t i t  i d d) t  i d d. f dF d/ d0 t  i d d   t   <t  i a         f d1        f d2   } xz t  i i   D]i } | | i   t i t  i d | i d t  i d | i d f d | i | i t  i d d  <qW f d3   } |  t i dG dH d
 d4 t  i d d  <d5 a d6   } d } xb | oZ t t i  g h    d7 <| d8 <d  } | d j o t   } t |   } qqWd S(I   Ni   i    i  i   id   ii   i   s   DAY 0000, 00:00:00R*   R   R+   R   i   i   t   MENUR%   c            s     f d   } | S(   Nc              s   t  i d    t  _ d  S(   NR$   (   R   R/   R@   (    (   t   speed(    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt	   set_speed-  s    (    (   R   R   (    (   R   s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt   make_set_speed,  s    t   iit   >s   >>i<   i   s   >>>i   i   i   s   >>>>i$   i i   i,  c         S   s   t  i | j S(   N(   R   R@   (   t   selfR   (    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt   speed_matches8  s    t   stay_selected_funci  t   CASHt	   SUSPICIONi   t   CPUi2   ix   t   RESEARCHRU   t   FINANCER'   iK   t	   KNOWLEDGER)   c             s  t  t i j oqt i d d j o
 d }  n d }  t i d d d f  _ t i d |   _  i   d t i d d f  _ t i d d f  _ t i d |   _  i   t i d d d f   _   i   t i d |    _ d t i d d	 f  _  i   t i d d
 t i d d	 f  _  i   t i d d
 t i d d f  _  i   t i a  n d t i i t i i	 t i i
 t i i f } |  _  i   t i t i i    } d t i t i i  d | d  _  i   h  } xf d D]^ } t i d i o' t i t i i | i t  | | <qt i t i i | i  | | <qWd | d d | d d | d d | d  _  i   t i   \ } } } } } }	 | |	 j  o t i d   _ n t i d   _ d t i |  d t i |  d   _   i     i d  t   t o d  Sn9 t a x  D] }
 |
 i t  qqWt i   t   d  S(   Ni    i  i   i   i  i   i   i   i2   ix   iK   s   DAY %04d, %02d:%02d:%02ds   CASH: s    (t   )t   newst   sciencet   covertt   publics   Advanced Socioanalyticss   [SUSPICION]s    NEWS: s     SCIENCE: s
     COVERT: s
     PUBLIC: t   redR   s   CPU: (   s   newss   sciences   coverts   publics   [SUSPICION] NEWS: (    t   old_sizeR   R    t   sizeR   t   remake_buttonR   R3   t   time_dayt	   time_hourt   time_mint   time_sect   textRx   t   future_cashR4   R;   R?   R   RA   RC   t   Truet   percent_to_detect_strt   finance_screent   cpu_numbersR
   t
   text_colort   refresh_buttont   refresh_mapt   intro_shownR2   t	   run_intro(   t	   font_sizet   time_stringt   result_casht   suspicion_display_dictRF   t	   total_cput   idle_cput   construction_cput   unusedt	   maint_cput   button(   t
   cpu_buttont   research_buttonR   t   cash_buttont   suspicion_buttont   knowledge_buttont   finance_buttont   time_button(    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyRb   g  sh    




%
%
+	
(
 '$5
+

 
c            s       f d   } | S(   Nc             sI   t  i d  t }  x/ |  t j o! t t  i     }     q Wd  S(   NR$   (   R   R/   R2   t   display_base_listt	   locations(   t	   done_base(   R   t   locationRb   (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt   show_location  s     	(    (   R   R   (   Rb   R   (   R   s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt   make_show_location  s    	c              s   t     d  S(   N(   RG   (    (   R   (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt   show_cheats  s    t   `i  c         S   s  t  |  t i 7a  t  d j o t i   t i i t  d  t i i   } | d j oL t i p t i	 i
 i   n t i d  t i t i d  t d  n | d j oL t i p t i	 i
 i   n t i d  t i t i d  t d  n t  d ;a  t Sn d  S(   Ni  i   t   loset   lost_nobasesi    i   t   lost_sus(   t   milli_clockR   R@   t
   play_musicR3   t	   give_timet	   lost_gamet   nosoundt   pygamet   mixert   musict   stopt   create_dialogt   stringsR   R   (   t   tick_amtt   lost(    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt   on_tick  s&    



t   refresh_callbackt   tick_callback(   id   i(   i   i   (   i    i    (   id   i   (   R   i   i    i    (   R   i   i   i   (   s   >>i   i<   i   (   s   >>>i   i   i   (   s   >>>>i$   i i   (   i  i(   i  i   (   ix   i   (   ix   i   (   ix   i   (   ii(   i    i    (   R   R    R   R   R
   R   R   R   R   R   R6   t   main_research_screenR   t   main_finance_screenRQ   R   R   RB   Rm   t   yt   xt   hotkeyR   R   R   R#   t   handle_pause_menu(   R   R   t   speed_button_soulst   x_post   legendt   widthR   t   keyR   t   speed_buttont   adjusted_sizeR   R   R   R   R~   R"   (    (	   Rb   R   R   R   R   R   R   R   R   s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt   map_loop  s    
(
*		 	(
(
(

	$U g*	 			c         C   s  |  d j o t  |  nw|  d j o t i t i d t i t i d d t i d d d d f d d t i d	 t i d
 t i d
 t i d 
 } | d j o t  |  d Sn t i |  t  |  n |  d j o d d k	 l
 } |   n |  d j oP t	 i   } | d j p | d j o t  |  qt i |  t   d Sn; |  d j o t i   n  |  d j o t	 i   d Sn d S(   Ni    i   t	   save_texti   i   id   i   i   R+   R   R,   R*   i(   t   difficulty_selecti   i   i   (   i   id   (   R   R   R0   R   t   default_savegame_nameR   R    R
   t	   save_gamet	   main_menuR   t   display_load_menut	   load_gameR   t	   quit_gamet   display_options(   R"   R   t   possible_nameR   t   load_return(    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyR      s:     
 
c         C   s  t  i i t  i d  t  i i t i i t  i d t  i	 d t  i	 d d f  d t  i	 d d t  i	 d d f  t i
 i   } x |  D] } t  i i | i  o t  i | i } | i   o d | _ n
 d | _ d | i t | i  f } t  i	 d | i d t  i	 d | i d f } | i | j p | i | j o  | | _ | | _ | i   qmn | i | i |   q Wd  S(	   NR   s	   earth.jpgi    i   i   i   s   %s (%d)id   (   R   R   R	   R
   t   blitR   t	   transformt   scalet   imagesR    t   mouset   get_posR   R<   t	   button_idRh   t   visibleRl   R   t   basesR   R   R   R   R   R   t   is_over(   R   t	   mouse_posR   Rd   t   new_textt   new_xy(    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyR     s(    ' 	 		t   42t   7t   23t   51t   19t   4t   8t   15t   16t   13t   1414t   1947t   2012t   2038t   1969t   2043t   2029t   3141t   1618t   2718t   29979c         C   s  t  i    d j  o d } t } x | o | d j  o t  i |  i  d t  i | i  d t  i t  } t } x, |  i D]! } | i | j o t } Pq~ q~ W| o | d 7} q" t } q" W| o | Sq n t  i |  i  d t  i | i  d t	 t  i
 d d   } | S(   Ng333333?i    i   t    i   i  (   t   randomR2   t   choicet   citiest   flavort   significant_numbersR   Rl   R   R   t   randint(   R   t	   base_typet   attemptsR?   Rl   t	   duplicatet
   check_base(    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt   generate_base_nameO  s(     7
 	'c   
      C   sL  |  i    p t Sn t |   } t |  | d j ot } x	| ot } t |   } | d j o | d j o t i | } t i t i	 d t
 |  t i |  t i d d t i d d d d	 f d d t i d t i d t i d t i d 
 } | d j o t } qA n t i i | t i |  } |  i |  qA qA Wt Sn| d j o| d j o| } | i pgd } | t i | i d  d 7} | d t i | i d  7} | d t i | i d  7} | d 7} t i | t i d d t i d d d	 d f d t i d t i d t i d d d t p t i d t i | i d  d t i | i d  d t i d d t i d d d	 d f d t i d t i d t i d  o | i   qq@n^ t }	 xT |	 oL t i | |   }	 |	 d j o | i   Pq|	 o | i |	  } qqWt Sn t S(   s/  
    display_base_list() displays the list of bases at a given location.  This
    is where players can add new bases, destroy old ones, and inspect the ones
    they have.

    It should return a Boolean representing whether or not the user is done
    with mucking around with bases at this location.
iR*   it   new_base_texti    i   i   i   id   i,  i   R+   R   R,   s%   Under Construction. \n Completion in s   . \n s   Remaining cost: s    money, and i   s    processor time.i2   i   t   OKt   DESTROYt   reverse_key_contexts#   Destroy this base? This will waste (   i,  id   (   i   i   (   s   OKR%  (   i   i   (   Rh   R   t   display_base_list_innerR   R2   t   build_new_base_windowR   R  R0   R   R"  R   R    R
   RE   t   Baset   add_baseR?   R   Ry   Rx   Rz   t   create_yesnot	   cost_paidt   destroyR9   t	   show_baset	   next_base(
   R   R   R"   t	   dont_exitt   base_to_addR   t   new_baseRE   R   t	   direction(    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyR   k  sh    
 
 

/3& 
c            sH  d } g    g   x  i  D] } | i } | i p t i d } nd | d j o t i d } nF | d j o t i d } n( t i i |  o t i | i } n   i | i d | d   i |  q W f d	   }     f d
   } t i	 d d d d f } h  } | | t
 i | d | d d f d& d d t i d d  <t i | t
 i | d d | d d f d' d d t i d d  <t d  | t
 i | d d | d d f d( d d t i d d  <| | t
 i | d d | d d f d) d d t i d d  <t i   | d  | d! | d" d* d% | S(+   Ni   t   buildingR*   t   nothingt   Constructiont   construct_tasks    (R   c            s)   |  t    i  j  o   i |  Sn d  S(   N(   R   R   (   t   base_pos(   R   (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt   do_open  s    c      	      s  |  t   i  j o d  Sn t i d  d }  i |  } | i p8 | d t i | i d  t i | i d  f 7} n t i | t i	 d d t i
 d d d d	 f d t i d t i d t i d  o) | i     |  = |  =  i d  n d  S(   NR$   s   Destroy this base?s0    This will waste %s money and %s processor time.i    i   i   i   id   i2   i   R+   R   R*   (   i   i   (   R   R   R   R/   R?   Rx   R,  Rz   R+  R   R    R
   R-  R   (   R8  t   prompt_stringRE   (   t   base_display_listt	   base_listR   (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt
   do_destroy  s"    

i    i   i  i2   i   io  id   t   OPENR   i   ii   R   R   ii   t   NEWR   i;  ix   R%  t   DRc   Rd   Re   i  i^  Rg   (   id   i2   (   id   i2   (   id   i2   (   ix   i2   (   i  i^  (   R   R8   R?   R   R   R;   R<   Rl   R   R    R   R   R   Rn   R   R    Rp   (   R   Rc   t	   this_baseR8   R9  R=  R   R   (    (   R;  R<  R   s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyR'    s8    
 	
<CF@c            s  g   g  } x| t  i D]q } xh t  i | i D]V } |  i j o@ t  i | i   o(  i |  | i t  i | i  q q- q- Wq Wd } t i  |  t  i	 d d d d f    f d   } h  } | | t
 i   d   d d f d d
 d t  i d d  <t i | t
 i   d d   d d f d d d t  i d d  <    f d   } t i | | d | d   d d d | d | S(   Ni   i    i   i!  i2   c            s     |  S(   N(    (   R8  (   R<  (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyt   do_build  s    i   io  id   t   BUILDt   Ui   ig   R   R   c            s   t   |      d  S(   N(   t   refresh_new_base(   R8  (   R   R   R<  (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyRb     s    Rc   Rd   Re   i   i^  Rf   Rg   (   id   i2   (   id   i2   (   i   i^  (   R   R  t   regionsRm   Rh   R   t	   base_nameRn   Ro   R    R   R   R   R   Rp   (   R   R;  RG  t   regionRc   RB  R   Rb   (    (   R   R<  R   s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyR(    s.    
  '<Cc      
   C   s  d | i  i d d  } d | i  i d d  } | i  i d d  } d | i  i d d  } | d d | d f } t i i t i d | d d	 | d d
 d f  t i i t i d | d d | d d d d f  |  d j o d  Sn t i t i t i |  i t i	 d d d | d d | d d f t i d  d } t i t i | t i	 d d d | d d | d d f t i d  t i
 t t i |  i d |   d } t i t i | t i	 d d d | d d | d d f t i d  t i t i |  i d |  d } t i t i | t i	 d d d | d d | d d f t i d  t i t t i |  i d |   } t i t i | t i	 d d d | d d | d d f t i d  d } t i t i | t i	 d d d | d d  | d d f t i d  t i
 t t i |  i d |   d } t i t i | t i	 d d d | d d  | d d f t i d  t i t i |  i d  d } t i t i | t i	 d d d | d d  | d d f t i d  d! t t i |  i  } t i t i | t i	 d d" d | d d | d d# f t i d  t } t i d$ i p
 t } n t i |  |  }	 x& |	 D] }
 t |	 |
 |  |	 |
 <qWt i d% i p t i d& } t } n d' } t } t i t i | t i	 d d d | d d | d d( f t i d  | od) t i |	 i d* d   } t i t i | t i	 d d d | d d | d d+ f t i d  d, t i |	 i d- d   } t i t i | t i	 d d d | d d  | d d+ f t i d  d. t i |	 i d/ d   } t i t i | t i	 d d d | d d | d d0 f t i d  d1 t i |	 i d2 d   } t i t i | t i	 d d d | d d  | d d0 f t i d  n t i t i t i |  i t i	 d d d  | d d | d d3 f t i d  | d j o | d j o t i d4 } n t i d5 } t i t i t i d6 t d7 |  t i	 d d d | d d | d d8 f t i d  n d  S(9   Ni   t   thriftR   t   cput   stealthi    id   R   i   i,  i^  R+   i   i*  i\  R*   i   ii   i   s   Building Cost:i   i   s    Moneyi   i2   s    CPUiF   i   iZ   s   Maintenance Cost:i"  s   Size: i   in   s   Advanced Socioanalyticst   Socioanalyticst   detect_chance_unknown_builds   Detection chance:i   s   News: R   i   s	   Science: R   s   Covert: R   i   s   Public: R   i   t	   cpu_bonust   cpu_penaltyt   location_modifierst	   modifiersiJ  (   RQ  t   getR   R   R	   R
   Rw   R  RG  R   Rx   R5   R   Rz   R   t   maintenancet
   add_commasR   R   R   R;   R?   R2   RE   t   calc_base_discovery_chanceR   R   R|   R}   t   dict(   RG  R   R   t   cost_factort   time_factort
   cpu_factort   detect_factorR   t   accuratet   detection_chanceRF   t   print_chancest   modifier(    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pyRE    s    26888%8'888!88
 
8888<8($   R   R   RE   R  R   Rn   R   R9   R6   R   R    R   R   R   t   safetyR   R   R   R   R#   RG   RQ   RP   RO   R\   R^   R]   R   R   R   R  R"  R   R'  R(  RE  (    (    (    s?   /home/phil/rcs/svn/endgame-singularity/trunk/code/map_screen.pys   <module>   sd   "			+			*	0	%							I	?	"