changeset 13:408853e127e9

=hp anstieg bei maxhpmod geaendert
author wuha
date Wed, 01 Oct 2008 11:49:54 +0000
parents 5d7cea3f23f3
children c0da8ff7daeb
files src/core/creature.cpp
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/creature.cpp	Wed Oct 01 10:49:06 2008 +0000
+++ b/src/core/creature.cpp	Wed Oct 01 11:49:54 2008 +0000
@@ -3609,6 +3609,8 @@
 {
 	int i;
 	// Deltawerte dazu addieren
+	float oldmaxhp = m_base_attr_mod.m_max_health;
+	
 	m_base_attr_mod.m_armor +=mod->m_darmor;
 	m_base_attr_mod.m_block +=mod->m_dblock;
 	m_base_attr_mod.m_strength +=mod->m_dstrength;
@@ -3619,6 +3621,7 @@
 	m_base_attr_mod.m_max_health += mod->m_dmax_health;
 	m_base_attr_mod.m_max_health += mod->m_dstrength*5;
 	m_base_attr_mod.m_attack_speed += mod->m_ddexterity*3;
+	m_dyn_attr.m_health *= m_base_attr_mod.m_max_health /oldmaxhp;
 
 	
 	m_base_attr_mod.m_attack_speed +=mod->m_dattack_speed;
@@ -3688,7 +3691,8 @@
 {
 	int i;
 	bool ret = false;
-
+	float oldmaxhp = m_base_attr_mod.m_max_health;
+	
 	// Deltas abziehen
 	m_base_attr_mod.m_armor -=mod->m_darmor;
 	m_base_attr_mod.m_block -=mod->m_dblock;
@@ -3701,6 +3705,9 @@
 	m_base_attr_mod.m_max_health -= mod->m_dstrength*5;
 	m_base_attr_mod.m_attack_speed -= mod->m_ddexterity*3;
 	
+	m_dyn_attr.m_health *= m_base_attr_mod.m_max_health /oldmaxhp;
+
+	
 	// Modifikationen feststellen
 	if (mod->m_dwalk_speed!=0)
 	{