From 640ab4ffa99e7b5eac2cf864f459c761f477efb7 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 01/11] Anomalous races: Use points to keep stats above 3
Currently, no matter how badly a stat is adjusted downwards, it the
"best" value will always result in three. In fact, it can never go
below that point. Such an assumption makes sense in the face of
existing race/class combinations, but future races (e.g., Trolls) and/or
classes could bring the baseline lower. As is, the code will give them
a free upgrade to 3 and we don't want that.
This patch will force the usage of spendable stat points to bring all
stats up to three.

src/birth.c  27 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 4 deletions()
diff git a/src/birth.c b/src/birth.c
index 8618bcd..3f34bce 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 >= 7) 
 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 
694  707  static bool sell_stat(int choice, int stats[A_MAX], int points_spent[A_MAX], 
695  708  int *points_left, bool update_display) 
696  709  { 
697   /* Must be a valid stat, and we can't "sell" stats below the base of 10. */ 
 710  /* Must be a valid stat, and we can't "sell" stats below the base of 10 
 711  * or best of 3. 
 712  */ 
698  713  if (!(choice >= A_MAX  choice < 0) && (stats[choice] > 10)) 
699  714  { 
 715  int adj = p_ptr>race>r_adj[choice] + p_ptr>class>c_adj[choice]; 
700  716  int stat_cost = birth_stat_costs[stats[choice]]; 
701  717  
 718  if ((stats[choice] + adj) <= 3) 
 719  return FALSE; 
 720  
702  721  stats[choice]; 
703  722  points_spent[choice] = stat_cost; 
704  723  *points_left += stat_cost; 