Browse Source

It is conflict working

Noath 6 years ago
parent
commit
ec16cfeb04
2 changed files with 10 additions and 4 deletions
  1. 2 1
      include/units/unit.h
  2. 8 3
      source/units/unit.cpp

+ 2 - 1
include/units/unit.h

@@ -35,6 +35,7 @@ public:
     int getStartingActivityPoints();
 
     int getHealthPoints();
+  	void setHealthPoints(int value);
     int getMaxHealthPoints();
 
     int getMagicDefence();
@@ -137,7 +138,7 @@ protected:
 
     //durability
     int health_points_;
-    int current_health_points_;
+    int max_health_points_;
     int magic_defence_;  //less or equal 40
     int physic_defence_; //less or equal 40
 

+ 8 - 3
source/units/unit.cpp

@@ -59,7 +59,6 @@ void Unit::loadUnitBaseClass(QString unit_folder) {
 
 void Unit::loadUnitTraits(QString unit_folder) {
     QSettings traits(unit_folder + "traits.ini", QSettings::IniFormat);
-    //traits.beginGroup("CharactersTraits");
     level_ = traits.value("lvl", -1).toInt();
     cost_ = traits.value("cost", -1).toInt();
     starting_activity_points_ = traits.value("starting_ap", -1).toInt();
@@ -68,8 +67,6 @@ void Unit::loadUnitTraits(QString unit_folder) {
     initiative_ = traits.value("initiative", -1).toInt();
     magic_defence_ = traits.value("magic_def", -1).toInt();
     physic_defence_ = traits.value("physic_def", -1).toInt();
-    //traits.endGroup();
-    qDebug() <<  unit_folder + "traits.ini" << " " << level_;
 }
 
 void Unit::loadUnitIcon(QString unit_folder) {
@@ -145,6 +142,14 @@ void Unit::setLocation(Cell* to) {
 	location_ = to;
 }
 
+int Unit::getMaxHealthPoints(){
+ 	return max_health_points_;  
+}
+  	
+void Unit::setHealthPoints(int value){
+	health_points_ = value;
+}
+
 int Unit::getInitiative() {
 	return initiative_;
 }