Ticket #1700: 0001-Add-PF_FAST-player-flag.txt​

File 0001-Add-PF_FAST-player-flag.txt​, 1.9 KB (added by daniel.santos, 7 years ago)

updated patch

Line 
1From 215ea1baa0ae606005e0c6dd355748970cea816b Mon Sep 17 00:00:00 2001
2From: Daniel Santos <daniel.santos@pobox.com>
3Date: Wed, 7 Nov 2012 13:16:10 -0600
4Subject: Add PF_FAST player flag
5
6Grants the player an innate haste of 1 + (level * 4 / 50), or +1 at
7level 1 and +5 at level 50.  The following table shows the results of
8this formula:
9
10Level  Bonus
111      +1
1213     +2
1325     +3
1438     +4
1550     +5
16---
17 src/list-player-flags.h |    1 +
18 src/player/calcs.c      |    3 +++
19 src/ui-birth.c          |    1 +
20 3 files changed, 5 insertions(+)
21
22diff --git a/src/list-player-flags.h b/src/list-player-flags.h
23index cfbdc3d..0dae25a 100644
24--- a/src/list-player-flags.h
25+++ b/src/list-player-flags.h
26@@ -19,3 +19,4 @@ PF(PSEUDO_ID_IMPROV, "get better at psudo id with experience")
27 PF(KNOW_MUSHROOM,    "easily recognize mushrooms")
28 PF(KNOW_ZAPPER,      "easily recognize magic devices")
29 PF(SEE_ORE,          "can sense ore in the walls")
30+PF(FAST,             "receive one extra haste at levels 1, 13, 25, 38 and 50")
31diff --git a/src/player/calcs.c b/src/player/calcs.c
32index d8c4763..af58d7f 100644
33--- a/src/player/calcs.c
34+++ b/src/player/calcs.c
35@@ -1545,6 +1545,9 @@ void calc_bonuses(object_type inventory[], player_state *state, bool id_only)
36        /* Extract the player flags */
37        player_flags(collect_f);
38 
39+       /* Player speed bonus */
40+       if (player_has(PF_FAST))
41+               state->speed += 1 + (p_ptr->lev * 4 / 50);
42 
43        /*** Analyze equipment ***/
44 
45diff --git a/src/ui-birth.c b/src/ui-birth.c
46index a2ce57e..b1cfa6e 100644
47--- a/src/ui-birth.c
48+++ b/src/ui-birth.c
49@@ -254,6 +254,7 @@ static const char *get_pflag_desc(bitflag flag)
50                case PF_KNOW_MUSHROOM: return "Identifies mushrooms";
51                case PF_KNOW_ZAPPER: return "Identifies magic devices";
52                case PF_SEE_ORE: return "Senses ore/minerals";
53+               case PF_FAST: return "Gains speed bonus";
54                default: return "Undocumented pflag";
55        }
56 }
57--
581.7.10.4
59