From 50c996d8240c483ef9bff732b0d3d0e7588f1ddc Mon Sep 17 00:00:00 2001 From: Deskull Date: Sun, 16 Mar 2014 12:15:03 +0900 Subject: [PATCH] Add turn count to Creature class. --- Deeangband/Creature.cpp | 7 +++++++ Deeangband/Creature.h | 33 +++++++++++++++++++++------------ Deeangband/GameWorld.h | 1 + 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/Deeangband/Creature.cpp b/Deeangband/Creature.cpp index afb43a8..9c97fc6 100644 --- a/Deeangband/Creature.cpp +++ b/Deeangband/Creature.cpp @@ -125,6 +125,8 @@ void Creature::SetDammyData(void) this->calcHPTable(); currentHp = max_hp = this->GetNorMaxHP(); + + this->turn = 0; } bool Creature::IsAlive(void) @@ -367,3 +369,8 @@ void Creature::TimeProcess(void) { this->currentFeed -= 10; } + +TURN Creature::GetTurn(void) +{ + return this->turn; +} diff --git a/Deeangband/Creature.h b/Deeangband/Creature.h index fa93959..41a85f1 100644 --- a/Deeangband/Creature.h +++ b/Deeangband/Creature.h @@ -44,21 +44,24 @@ private: FEED currentFeed; //!< Œ»ÝŽ —{’l FEED maxFeed; //!< Å‘厠—{’l - Discipline currentDiscipilne; /*!< Œ»Ý‚̏C—{’l */ - LEVEL divineLevel; //!< _«ƒŒƒxƒ‹ + Discipline currentDiscipilne; //!< Œ»Ý‚̏C—{’l + LEVEL divineLevel; //!< _«ƒŒƒxƒ‹ - BaseStatusTable currentStatus; /*!< Œ»Ý‚̃Xƒe[ƒ^ƒX */ - BaseStatusTable maxStatus; /*!< ’ʏí‚̃Xƒe[ƒ^ƒX */ - BaseStatusTable maxMaxStatus; /*!< ŒÀŠE‚̃Xƒe[ƒ^ƒX */ + BaseStatusTable currentStatus; //!< Œ»Ý‚̃Xƒe[ƒ^ƒX + BaseStatusTable maxStatus; //!< ’ʏí‚̃Xƒe[ƒ^ƒX + BaseStatusTable maxMaxStatus; //!< ŒÀŠE‚̃Xƒe[ƒ^ƒX - SavingTable savings; /*!< ƒZ[ƒrƒ“ƒO */ + SavingTable savings; //!< ƒZ[ƒrƒ“ƒO - ID floorID; /*!< Œ»Ý‚¢‚éƒtƒƒAID */ - Coordinates position; /*!< Œ»À•W */ - map itemList; /*!< ŠŽƒAƒCƒeƒ€ƒŠƒXƒg */ - char symbol; /*!< ƒVƒ“ƒ{ƒ‹ƒLƒƒƒ‰ */ - Color symbolColor; /*!< ƒVƒ“ƒ{ƒ‹ƒJƒ‰[ */ - ID tileID ;/*!< ƒ^ƒCƒ‹ID */ + ID floorID; //!< Œ»Ý‚¢‚éƒtƒƒAID + Coordinates position; //!< Œ»À•W + map itemList; //!< ŠŽƒAƒCƒeƒ€ƒŠƒXƒg + + char symbol; //!< ƒVƒ“ƒ{ƒ‹ƒLƒƒƒ‰ + Color symbolColor; //!< ƒVƒ“ƒ{ƒ‹ƒJƒ‰[ + ID tileID; //!< ƒ^ƒCƒ‹ID + + TURN turn; //!< ‘ƒ^[ƒ“” HP hpTable[CREATURE_MAX_LEVEL]; //!< ƒqƒbƒgƒ_ƒCƒX‚ÉŠî‚«¶¬‚³‚ꂽƒŒƒxƒ‹–ˆ‚ÌŠî–{HP @@ -359,5 +362,11 @@ public: */ void Creature::TimeProcess(void); + /*! + * @brief ƒNƒŠ[ƒ`ƒƒ[‚ÌŒo‰ß‘ƒ^[ƒ“”‚ð•Ô‚· + * @return ‘ƒ^[ƒ“” + */ + TURN Creature::GetTurn(void); + }; diff --git a/Deeangband/GameWorld.h b/Deeangband/GameWorld.h index 3dde457..747f664 100644 --- a/Deeangband/GameWorld.h +++ b/Deeangband/GameWorld.h @@ -67,6 +67,7 @@ private: map> trapList; /*!<‘Sƒgƒ‰ƒbƒvƒŠƒXƒg*/ GAME_TIME gameTime; //!<ƒQ[ƒ€ŽžŠÔ + public: /*! -- 2.11.0