OSDN Git Service

Implement HaveGameTime::PlusWait().
authorDeskull <desull@users.sourceforge.jp>
Sun, 22 Jun 2014 14:35:21 +0000 (23:35 +0900)
committerDeskull <desull@users.sourceforge.jp>
Sun, 22 Jun 2014 14:35:21 +0000 (23:35 +0900)
Deeangband/GameConstants.cpp
Deeangband/GameConstants.h
Deeangband/HaveGameTime.cpp
Deeangband/HaveGameTime.h

index 09ac262..9440fae 100644 (file)
@@ -13,6 +13,7 @@ namespace Deeangband
 {
        double GameConstants::HeightStandardDeviation = 3.0l;
        double GameConstants::WeightStandardDeviation = 3.0l;
+       double GameConstants::ActionWaitDeviation = 2.0l;
 
        GameConstants::GameConstants(void)
        {
index 075c997..a21a503 100644 (file)
@@ -47,6 +47,7 @@ namespace Deeangband
 
                static double HeightStandardDeviation;
                static double WeightStandardDeviation;
+               static double ActionWaitDeviation;
 
                /*! 
                * @brief GameConstants \83N\83\89\83X\83R\83\93\83X\83g\83\89\83N\83^
index df32b4c..4f0c5eb 100644 (file)
@@ -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);
        }
 
 }
index 78d39d0..8ebf2fa 100644 (file)
@@ -11,6 +11,8 @@
 #include "stdafx.h"
 #include "Color.h"
 #include "Deeangband.h"
+#include "Dice.h"
+#include "GameConstants.h"
 
 namespace Deeangband
 {