OSDN Git Service

Add hit point to Square class.
authorDeskull <deskull@users.sourceforge.jp>
Mon, 3 Mar 2014 04:04:51 +0000 (13:04 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Mon, 3 Mar 2014 04:04:51 +0000 (13:04 +0900)
Deeangband/Creature.h
Deeangband/Deeangband.h
Deeangband/Square.cpp
Deeangband/Square.h

index 18c2b35..e0ef944 100644 (file)
 #include "Item.h"
 #include "GameElement.h"
 
-typedef int Status; /*!< \8aî\91b\94\\97Í\92l\82Ì\95Ï\90\94\8c^ */
-typedef int HP;     /*!< HP\82Ì\95Ï\90\94\8c^ */
-typedef int MP;     /*!< MP\82Ì\95Ï\90\94\8c^ */
-typedef int SOUL;   /*!< \83\\83E\83\8b\82Ì\95Ï\90\94\8c^ */
-
 /*!
  * @brief \83N\83\8a\81[\83`\83\83\81[\82Ì\8aî\91b\94\\97Í\92l6\8eí\82Ì\97ñ\8b\93\91Ì
  */
@@ -49,13 +44,12 @@ struct StatusTable
  * @struct SavingTable
  * @brief \83Z\81[\83r\83\93\83O\92l\82Ì\8d\\91¢\91Ì
  */
-struct SavingTable
+typedef struct
 {
        Status armor;    /*!< \91\95\8db\83Z\81[\83u\92l */
        Status evasion;  /*!< \89ñ\94ð\83Z\81[\83u\92l */
        Status volition; /*!< \88Ó\8ev\83Z\81[\83u\92l */
-};
-
+} SavingTable;
 
 /*!
  * @class Creature
index 1d11918..a021d57 100644 (file)
@@ -38,5 +38,9 @@ class Square;
 class Door;
 class Trap;
 
+typedef int Status; /*!< \8aî\91b\94\\97Í\92l\82Ì\95Ï\90\94\8c^ */
+typedef int HP;     /*!< HP\82Ì\95Ï\90\94\8c^ */
+typedef int MP;     /*!< MP\82Ì\95Ï\90\94\8c^ */
+typedef int SOUL;   /*!< \83\\83E\83\8b\82Ì\95Ï\90\94\8c^ */
 
 
index f252992..ceea412 100644 (file)
@@ -21,6 +21,10 @@ Square::~Square()
 
 bool Square::take_effect(Effect *effectPtr, POWER amount)
 {
+       if(effectPtr)
+       {
+               this->hitPoint -= amount;
+       }
        return false;
 }
 
index f2a63ef..f3fb483 100644 (file)
@@ -20,7 +20,8 @@ class Square : public GameElement
 {
 private:
        Floor *floor_ptr; //!<\8f\8a\91®\83t\83\8d\83A\8eQ\8fÆ\83|\83C\83\93\83^
-       ID feature_id; //!<\92n\8c`ID
+       ID feature_id;    //!<\92n\8c`ID
+       HP hitPoint;      //!<\92n\8c`HP
 public:
 
        /*!