OSDN Git Service

Add feed point to Creature class.
authorDeskull <deskull@users.sourceforge.jp>
Sun, 9 Mar 2014 12:01:25 +0000 (21:01 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Sun, 9 Mar 2014 12:01:25 +0000 (21:01 +0900)
Deeangband/Creature.cpp
Deeangband/Creature.h
Deeangband/Deeangband.h

index 75341e9..5c4a663 100644 (file)
@@ -84,14 +84,15 @@ Creature::Creature(ID id, TAG tag, GameWorld *gameWorld) : GameElement(id, tag,
 Creature::Creature(void)
 {
        int statID;
-       name = "\83_\83~\81[";
-       currentMp = maxMp = maxMaxMp = 10;
-       currentSoul = maxSoul = Creature::soulLevel[0];
-       currentDiscipilne.SetPoint(0, 0, 0, 0, 0);
-       height = 160;
-       weight = 50;
-
+       this->name = "\83_\83~\81[";
+       this->currentMp = this->maxMp = this->maxMaxMp = 10;
+       this->currentSoul = this->maxSoul = Creature::soulLevel[0];
+       this->currentDiscipilne.SetPoint(0, 0, 0, 0, 0);
+       this->height = 160;
+       this->weight = 50;
+       this->divineLevel = -1;
        savings.Set(10, 10, 10);
+       this->currentFeed = this->maxFeed = 20000;
 
        for(statID = 0; statID < CS_MAX; statID++)
        {
@@ -185,7 +186,7 @@ void Creature::setMP(MP amount)
 
 string Creature::GetName(void)
 {
-       return name;
+       return this->name;
 }
 
 LEVEL Creature::GetLevel(void)
@@ -202,57 +203,57 @@ LEVEL Creature::GetLevel(void)
 
 HP Creature::GetCurHP(void)
 {
-       return currentHp;
+       return this->currentHp;
 }
 
 HP Creature::GetMaxHP(void)
 {
-       return max_hp;
+       return this->max_hp;
 }
 
 HP Creature::GetNorMaxHP(void)
 {
-       return this->hpTable[0];
+       return this->hpTable[this->GetLevel()];
 }
 
 MP Creature::GetCurMP(void)
 {
-       return currentMp;
+       return this->currentMp;
 }
 
 MP Creature::GetMaxMP(void)
 {
-       return maxMp;
+       return this->maxMp;
 }
 
 MP Creature::GetNorMaxMP(void)
 {
-       return maxMaxMp;
+       return this->maxMaxMp;
 }
 
 AC Creature::GetArmorSaving(void)
 {
-       return savings.GetArmor();
+       return this->savings.GetArmor();
 }
 
 EV Creature::GetEvasionSaving(void)
 {
-       return savings.GetEvasion();
+       return this->savings.GetEvasion();
 }
 
 VO Creature::GetVolitionSaving(void)
 {
-       return savings.GetVolition();
+       return this->savings.GetVolition();
 }
 
 SOUL Creature::GetCurrentSoul(void)
 {
-       return currentSoul;
+       return this->currentSoul;
 }
 
 SOUL Creature::GetMaxSoul(void)
 {
-       return maxSoul;
+       return this->maxSoul;
 }
 
 BASE_STATUS Creature::GetCurrentStatus(CREATURE_STATUS stat)
@@ -322,9 +323,20 @@ void Creature::LostSoul(SOUL amount)
 {
        this->currentSoul -= amount;
        this->maxSoul -= amount / 20;
+       if(this->currentSoul < 1) this->die();
 }
 
 LEVEL Creature::GetDivineLevel(void)
 {
        return this->divineLevel;
 }
+
+FEED Creature::GetCurrentFeedPoint(void)
+{
+       return this->currentFeed;
+}
+       
+FEED Creature::GetMaxFeedPoint(void)
+{
+       return this->maxFeed;
+}
index 95e7328..b3394a7 100644 (file)
@@ -40,6 +40,9 @@ private:
        HEIGHT height;    //!< \90g\92·
        HEIGHT weight;    //!< \91Ì\8fd
 
+       FEED currentFeed; //!< \8c»\8dÝ\8e \97{\92l
+       FEED maxFeed;     //!< \8dÅ\91å\8e \97{\92l
+
        Discipline currentDiscipilne; /*!< \8c»\8dÝ\82Ì\8fC\97{\92l */
        LEVEL divineLevel; //!< \90_\90«\83\8c\83x\83\8b
 
@@ -297,5 +300,17 @@ public:
         */
        LEVEL Creature::GetDivineLevel(void);
 
+       /*!
+        * @brief \8c»\8dÝ\8e \97{\92l\82ð\95Ô\82·
+        * @return \8c»\8dÝ\8e \97{\92l
+        */
+       FEED Creature::GetCurrentFeedPoint(void);
+
+       /*!
+        * @brief \8dÅ\91å\8e \97{\92l\82ð\95Ô\82·
+        * @return \8dÅ\91å\8e \97{\92l
+        */
+       FEED Creature::GetMaxFeedPoint(void);
+
 };
 
index e5ad96d..e052b74 100644 (file)
@@ -89,6 +89,7 @@ typedef int BASE_STATUS; //!< 
 typedef int LEVEL;  //!< LEVEL\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 FEED;     //!< \8e \97{\93x\82Ì\95Ï\90\94\8c^
 typedef int64_t SOUL;   //!< \83\\83E\83\8b\82Ì\95Ï\90\94\8c^
 typedef int DISCIPLINE_POINT; //!< \8fC\97{\92l\82Ì\95Ï\90\94\8c^
 typedef int AC;     //!< \8aæ\8c\92\90«