From 549d4cd1f6287f857b6ce7d0c6883d6eb387d37d Mon Sep 17 00:00:00 2001 From: Deskull Date: Sun, 22 Jun 2014 23:35:21 +0900 Subject: [PATCH] Implement HaveGameTime::PlusWait(). --- Deeangband/GameConstants.cpp | 1 + Deeangband/GameConstants.h | 1 + Deeangband/HaveGameTime.cpp | 3 +++ Deeangband/HaveGameTime.h | 2 ++ 4 files changed, 7 insertions(+) diff --git a/Deeangband/GameConstants.cpp b/Deeangband/GameConstants.cpp index 09ac262..9440fae 100644 --- a/Deeangband/GameConstants.cpp +++ b/Deeangband/GameConstants.cpp @@ -13,6 +13,7 @@ namespace Deeangband { double GameConstants::HeightStandardDeviation = 3.0l; double GameConstants::WeightStandardDeviation = 3.0l; + double GameConstants::ActionWaitDeviation = 2.0l; GameConstants::GameConstants(void) { diff --git a/Deeangband/GameConstants.h b/Deeangband/GameConstants.h index 075c997..a21a503 100644 --- a/Deeangband/GameConstants.h +++ b/Deeangband/GameConstants.h @@ -47,6 +47,7 @@ namespace Deeangband static double HeightStandardDeviation; static double WeightStandardDeviation; + static double ActionWaitDeviation; /*! * @brief GameConstants ƒNƒ‰ƒXƒRƒ“ƒXƒgƒ‰ƒNƒ^ diff --git a/Deeangband/HaveGameTime.cpp b/Deeangband/HaveGameTime.cpp index df32b4c..4f0c5eb 100644 --- a/Deeangband/HaveGameTime.cpp +++ b/Deeangband/HaveGameTime.cpp @@ -41,7 +41,10 @@ namespace Deeangband void HaveGameTime::PlusWait(ACTION_WAIT plusWait) { + double wait = plusWait; this->wait += plusWait; + std::normal_distribution<> distWait(wait, GameConstants::ActionWaitDeviation); + this->wait += (ACTION_WAIT)distWait(Dice::mt); } } diff --git a/Deeangband/HaveGameTime.h b/Deeangband/HaveGameTime.h index 78d39d0..8ebf2fa 100644 --- a/Deeangband/HaveGameTime.h +++ b/Deeangband/HaveGameTime.h @@ -11,6 +11,8 @@ #include "stdafx.h" #include "Color.h" #include "Deeangband.h" +#include "Dice.h" +#include "GameConstants.h" namespace Deeangband { -- 2.11.0