Ticket #1693: 0002-Anomalous-races-Larger-races-to-eat-more-food.patch

File 0002-Anomalous-races-Larger-races-to-eat-more-food.patch, 1.7 KB (added by daniel.santos, 7 years ago)
  • src/cmd-obj.c

    From 34c7567937f285cc047ea1e4e0ea85a5ced964b4 Mon Sep 17 00:00:00 2001
    From: Daniel Santos <daniel.santos@pobox.com>
    Date: Sun, 21 Oct 2012 15:49:39 -0500
    Subject: [PATCH v2 02/11] Anomalous races: Larger races to eat more food
    
    More specifically, this patch will decrease the nourishment gained from
    large players eating food, based upon player weight.  We're doing this
    buy presuming 200lbs is the upper limit of a normal player (for which
    the current game is tuned) and requiring four times the food if the
    player is twice that weight.  The table below briefly illustrates how
    this works.
    
    Weight  Food    Nourishment
    200     1000    1000
    250     1000    640
    300     1000    444
    350     1000    327
    400     1000    250
    ---
     src/cmd-obj.c |   10 ++++++++--
     1 files changed, 8 insertions(+), 2 deletions(-)
    
    diff --git a/src/cmd-obj.c b/src/cmd-obj.c
    index 59f502e..9fc6ef9 100644
    a b void do_cmd_use(cmd_code code, cmd_arg args[]) 
    516516        int snd, boost, level; 
    517517        use_type use; 
    518518        int items_allowed = 0; 
     519        s32b food_value = o_ptr->pval[DEFAULT_PVAL]; 
    519520 
    520521        /* Determine how this item is used. */ 
    521522        if (obj_is_rod(o_ptr)) 
    void do_cmd_use(cmd_code code, cmd_arg args[]) 
    655656        if (ident) object_notice_effect(o_ptr); 
    656657 
    657658        /* Food feeds the player */ 
    658         if (o_ptr->tval == TV_FOOD || o_ptr->tval == TV_POTION) 
    659                 player_set_food(p_ptr, p_ptr->food + o_ptr->pval[DEFAULT_PVAL]); 
     659        if (o_ptr->tval == TV_FOOD || o_ptr->tval == TV_POTION) { 
     660 
     661                /* larger races require increasingly more food */ 
     662                if (p_ptr->wt >= 200) 
     663                        food_value = food_value * 200 * 200 / ((s32b)p_ptr->wt * p_ptr->wt); 
     664                player_set_food(p_ptr, p_ptr->food + food_value); 
     665        } 
    660666 
    661667        /* Use the turn */ 
    662668        p_ptr->energy_use = 100;