This commit is contained in:
aozhiwei 2024-01-04 11:23:56 +08:00
parent e535767d53
commit 2fb058d6b5
2 changed files with 36 additions and 2 deletions

View File

@ -55,11 +55,11 @@ namespace mt
int RandDrop() const;
const HeroShotAnimation* GetShotAnimi(int shotfire) const;
float GetHeight() const { return height_; }
mt::BattleBasicAttribute* GetBasicMeta() { return basic_meta_; }
const mt::BattleBasicAttribute* GetBasicMeta() const { return basic_meta_; }
private:
float height_ = 0.0f;
mt::BattleBasicAttribute* basic_meta_ = nullptr;
const mt::BattleBasicAttribute* basic_meta_ = nullptr;
static void LoadHeroAndEquipShotData();
};

View File

@ -32,6 +32,7 @@
#include "mt/SkillNumber.h"
#include "mt/FormulaPvp.h"
#include "mt/Robot.h"
#include "mt/BattleBasicAttribute.h"
#include "attrhelper.h"
@ -140,6 +141,38 @@ private:
void DefaultInit(Creature* c)
{
#ifdef NEW_NUM
{
float pHealRateAm = 0.0f; //加基础点数属性绝对值
float pHealthAm_Add = 0.0f; //buff或者养成的属性
pHealRateAm += pHealthAm_Add;
float pHealthRateSe = 0.0f;
float pHealthRateSe_Add = 0.0f; //buff或者养成的属性
pHealthRateSe += pHealthRateSe_Add;
float pHealthRateIn = 0.0f;
float pHealthRateIn_Add = 0.0f; //buff或者养成的属性
pHealthRateIn = (1 + pHealthRateIn) * (1 + pHealthRateIn_Add) - 1;
float pHealth = (hero_meta->GetBasicMeta()->pOrigHealth() + pHealRateAm) * (1 + pHealthRateSe) * (1 + pHealthRateIn);
float vHealthAm = 0.0f;
float vHealthAm_Add = 0.0f; //buff或者养成的属性
vHealthAm += vHealthAm_Add;
float vHealthRateSe = 0.0f;
float vHealthRateSe_Add = 0.0f; //buff或者养成的属性
vHealthRateSe += vHealthRateSe_Add;
float vHealthRateIn = 0.0f;
float vHealthRateIn_Add = 0.0f; //buff或者养成的属性
vHealthRateIn = (1 + vHealthRateIn) * (1 + vHealthRateIn_Add) - 1;
hp_ = (hero_meta->GetBasicMeta()->vOrigHealth() * (1 + pHealth / hero_meta->GetBasicMeta()->pBaseHealth() + vHealthAm)) *
(1 + vHealthRateSe) * (1 + vHealthRateIn);
}
#else
hp_ = hero_meta->hp();
atk_ = hero_meta->damage();
def_ = hero_meta->defence();
@ -192,6 +225,7 @@ private:
}
}
}
#endif
}
void DtoInit(Creature* c)