From b35798eb8ef5e05a4574bbf1115c31a504496616 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Sat, 25 Feb 2017 02:09:41 +0100 Subject: [PATCH] Moved creature power to PersonType --- Source/Objects/Person.cpp | 7 ++----- Source/Objects/PersonType.cpp | 4 ++++ Source/Objects/PersonType.hpp | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/Objects/Person.cpp b/Source/Objects/Person.cpp index 02c174e..7a16709 100644 --- a/Source/Objects/Person.cpp +++ b/Source/Objects/Person.cpp @@ -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; } diff --git a/Source/Objects/PersonType.cpp b/Source/Objects/PersonType.cpp index 093dca3..2cddb32 100644 --- a/Source/Objects/PersonType.cpp +++ b/Source/Objects/PersonType.cpp @@ -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; } diff --git a/Source/Objects/PersonType.hpp b/Source/Objects/PersonType.hpp index 1d48a71..119fa20 100644 --- a/Source/Objects/PersonType.hpp +++ b/Source/Objects/PersonType.hpp @@ -57,6 +57,8 @@ public: std::vector skins; + float power; + GLubyte bloodText[512 * 512 * 3] = { 0 }; PersonType(); -- 2.39.2