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)
Line 
1From eb458341a97bd8ebe30ba8099a4beb06a527be66 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 * 6 / 50), or +1 at
7level 1 and +7 at level 50.  The following table shows the results of
8this formula:
9
10Level  Bonus
111      +1
129      +2
1317     +3
1425     +4
1534     +5
1642     +6
1750     +7
18---
19 src/list-player-flags.h |    1 +
20 src/player/calcs.c      |    3 +++
21 src/ui-birth.c          |    1 +
22 3 files changed, 5 insertions(+)
23
24diff --git a/src/list-player-flags.h b/src/list-player-flags.h
25index cfbdc3d..89ba3b4 100644
26--- a/src/list-player-flags.h
27+++ b/src/list-player-flags.h
28@@ -19,3 +19,4 @@ PF(PSEUDO_ID_IMPROV, "get better at psudo id with experience")
29 PF(KNOW_MUSHROOM,    "easily recognize mushrooms")
30 PF(KNOW_ZAPPER,      "easily recognize magic devices")
31 PF(SEE_ORE,          "can sense ore in the walls")
32+PF(FAST,             "receive 1 + level / 10 haste bonus")
33diff --git a/src/player/calcs.c b/src/player/calcs.c
34index d8c4763..16ee609 100644
35--- a/src/player/calcs.c
36+++ b/src/player/calcs.c
37@@ -1545,6 +1545,9 @@ void calc_bonuses(object_type inventory[], player_state *state, bool id_only)
38        /* Extract the player flags */
39        player_flags(collect_f);
40 
41+       /* Player speed bonus */
42+       if (player_has(PF_FAST))
43+               state->speed += 1 + (p_ptr->lev * 6 / 50);
44 
45        /*** Analyze equipment ***/
46 
47diff --git a/src/ui-birth.c b/src/ui-birth.c
48index a2ce57e..b1cfa6e 100644
49--- a/src/ui-birth.c
50+++ b/src/ui-birth.c
51@@ -254,6 +254,7 @@ static const char *get_pflag_desc(bitflag flag)
52                case PF_KNOW_MUSHROOM: return "Identifies mushrooms";
53                case PF_KNOW_ZAPPER: return "Identifies magic devices";
54                case PF_SEE_ORE: return "Senses ore/minerals";
55+               case PF_FAST: return "Gains speed bonus";
56                default: return "Undocumented pflag";
57        }
58 }
59--
601.7.10.4
61