]> git.jsancho.org Git - lugaru.git/commitdiff
Moved creature power to PersonType
authorCôme Chilliet <come@chilliet.eu>
Sat, 25 Feb 2017 01:09:41 +0000 (02:09 +0100)
committerCôme Chilliet <come@chilliet.eu>
Sat, 25 Feb 2017 01:09:41 +0000 (02:09 +0100)
Source/Objects/Person.cpp
Source/Objects/PersonType.cpp
Source/Objects/PersonType.hpp

index 02c174e3c932fee2a3a5557cfba20d51ae1a0fb3..7a16709f30a2deffd852bec219fdc7c16b56cfd8 100644 (file)
@@ -506,7 +506,7 @@ void Person::CheckKick()
     }
 
     if (Animation::animations[victim->animTarget].height != lowheight) {
-        float damagemult = (creature == wolftype ? 2.5 : 1.) * power * power;
+        float damagemult = PersonType::types[creature].power * power * power;
         XYZ relative = velocity;
         relative.y = 0;
         Normalise(&relative);
@@ -2440,10 +2440,7 @@ void Person::DoAnimations()
             }
 
             //Move impacts
-            float damagemult = 1 * power;
-            if (creature == wolftype) {
-                damagemult = 2.5 * power;
-            }
+            float damagemult = PersonType::types[creature].power * power;
             if (hasvictim) {
                 damagemult /= victim->damagetolerance / 200;
             }
index 093dca38cf1645c5ef45c1e174327a84c85d1c1a..2cddb3201e5fe583e41e977d0c0adc48e04da193 100644 (file)
@@ -75,6 +75,8 @@ void PersonType::Load()
     types[wolftype].skins[1] = "Textures/FurWolfDark.jpg";
     types[wolftype].skins[2] = "Textures/FurWolfSnow.jpg";
 
+    types[wolftype].power = 2.5;
+
     /* Rabbit */
     types[rabbittype].proportions[0] = 1.2;
     types[rabbittype].proportions[1] = 1.05;
@@ -123,4 +125,6 @@ void PersonType::Load()
     types[rabbittype].skins[7] = "Textures/FurChocolate.jpg";
     types[rabbittype].skins[8] = "Textures/FurBlackWhite.jpg";
     types[rabbittype].skins[9] = "Textures/FurBrownWhite.jpg";
+
+    types[rabbittype].power = 1;
 }
index 1d48a719975437721fbf9e2537317e89c3a0a397..119fa20e95c208103b1704489e881af42664c200 100644 (file)
@@ -57,6 +57,8 @@ public:
 
     std::vector<std::string> skins;
 
+    float power;
+
     GLubyte bloodText[512 * 512 * 3] = { 0 };
 
     PersonType();