From 531231a75250008d187c609b60cc486d7e930b76 Mon Sep 17 00:00:00 2001
From: Daniel Santos <daniel.santos@pobox.com>
Date: Mon, 15 Oct 2012 01:39:09 0500
Subject: [PATCH v2 2/3] Do not allow stats below 3 and force usage of points to get them there

src/birth.c  27 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 4 deletions()
diff git a/src/birth.c b/src/birth.c
index 8d0f45e..3c769af 100644
a

b

static void reset_stats(int stats[A_MAX], int points_spent[A_MAX], int *points_l 
642  642  
643  643  for (i = 0; i < A_MAX; i++) 
644  644  { 
645   /* Initial stats are all 10 and costs are zero */ 
646   stats[i] = 10; 
647   points_spent[i] = 0; 
 645  /* Initial stats are all 10 and costs are zero, unless race and class 
 646  * adjustments bring it below 3, in which case we force them to spend 
 647  * points to bring it up to 3, considering that the minimum acceptable. 
 648  * to be an adventurer. 
 649  */ 
 650  int adj = p_ptr>race>r_adj[i] + p_ptr>class>c_adj[i]; 
 651  int penalty; 
 652  
 653  if (adj > 8) 
 654  penalty = 0; 
 655  else 
 656  penalty = (adj + 7); 
 657  
 658  stats[i] = 10 + penalty; 
 659  points_spent[i] = penalty; 
 660  *points_left = penalty; 
648  661  } 
649  662  
650  663  /* Use the new "birth stat" values to work out the "other" 
… 
… 
static bool buy_stat(int choice, int stats[A_MAX], int points_spent[A_MAX], int 
688  701  static bool sell_stat(int choice, int stats[A_MAX], int points_spent[A_MAX], 
689  702  int *points_left) 
690  703  { 
691   /* Must be a valid stat, and we can't "sell" stats below the base of 10. */ 
 704  /* Must be a valid stat, and we can't "sell" stats below the base of 10 
 705  * or best of 3. 
 706  */ 
692  707  if (!(choice >= A_MAX  choice < 0) && (stats[choice] > 10)) 
693  708  { 
 709  int adj = p_ptr>race>r_adj[choice] + p_ptr>class>c_adj[choice]; 
694  710  int stat_cost = birth_stat_costs[stats[choice]]; 
695  711  
 712  if ((stats[choice] + adj) <= 3) 
 713  return FALSE; 
 714  
696  715  stats[choice]; 
697  716  points_spent[choice] = stat_cost; 
698  717  *points_left += stat_cost; 