@@ -104,7 +104,6 @@ class Mod : GenericMod {
104104 game->PrintMessage (L" [Notification] Correctly recentered player region.\n " , 0 , 255 , 0 );
105105 return 1 ;
106106 }
107-
108107 return 0 ;
109108 }
110109
@@ -236,8 +235,14 @@ class Mod : GenericMod {
236235 if (attacker->entity_data .hostility_type == cube::Creature::EntityBehaviour::Player ||
237236 attacker->entity_data .hostility_type == cube::Creature::EntityBehaviour::Pet)
238237 {
239-
240- int xp_gain = GetCreatureLevel (creature) * (creature->entity_data .level + 1 );
238+ int xp_gain = 100 ;
239+
240+ if (player->entity_data .level > GetCreatureLevel (creature)) {
241+ xp_gain = (int )std::roundf (100 * (creature->entity_data .level + 1 ) * std::powf (0 .8f , player->entity_data .level - GetCreatureLevel (creature)));
242+ }
243+ else {
244+ xp_gain = (int )std::roundf (100 * (creature->entity_data .level + 1 ) * (1 + 0 .15f * (GetCreatureLevel (creature) - player->entity_data .level )) * std::powf (1 .05f , GetCreatureLevel (creature) - player->entity_data .level ));
245+ }
241246
242247 if ((creature->entity_data .appearance .flags2 & (1 << (int )cube::Creature::AppearanceModifiers::IsBoss)) != 0 )
243248 {
@@ -333,13 +338,13 @@ class Mod : GenericMod {
333338
334339 // ##### PLAYER ######
335340 // Defense
336- m_PlayerScaling.insert_or_assign (STAT_TYPE::HEALTH, 5 );
337- m_PlayerScaling.insert_or_assign (STAT_TYPE::ARMOR, 1 );
338- m_PlayerScaling.insert_or_assign (STAT_TYPE::RESISTANCE, 1 );
341+ m_PlayerScaling.insert_or_assign (STAT_TYPE::HEALTH, 1 );
342+ m_PlayerScaling.insert_or_assign (STAT_TYPE::ARMOR, 0.2 );
343+ m_PlayerScaling.insert_or_assign (STAT_TYPE::RESISTANCE, 0.2 );
339344
340345 // Offense
341- m_PlayerScaling.insert_or_assign (STAT_TYPE::ATK_POWER, 1 );
342- m_PlayerScaling.insert_or_assign (STAT_TYPE::SPELL_POWER, 1 );
346+ m_PlayerScaling.insert_or_assign (STAT_TYPE::ATK_POWER, 0.2 );
347+ m_PlayerScaling.insert_or_assign (STAT_TYPE::SPELL_POWER, 0.2 );
343348 m_PlayerScaling.insert_or_assign (STAT_TYPE::CRIT, 0 .0001f );
344349 m_PlayerScaling.insert_or_assign (STAT_TYPE::HASTE, 0 .0001f );
345350
@@ -349,13 +354,13 @@ class Mod : GenericMod {
349354
350355 // ##### CREATURE ######
351356 // Defense
352- m_CreatureScaling.insert_or_assign (STAT_TYPE::HEALTH, 20 );
353- m_CreatureScaling.insert_or_assign (STAT_TYPE::ARMOR, 0 .1f );
354- m_CreatureScaling.insert_or_assign (STAT_TYPE::RESISTANCE, 0 .1f );
357+ m_CreatureScaling.insert_or_assign (STAT_TYPE::HEALTH, 0.9 );
358+ m_CreatureScaling.insert_or_assign (STAT_TYPE::ARMOR, 0.7 );
359+ m_CreatureScaling.insert_or_assign (STAT_TYPE::RESISTANCE, 0.7 );
355360
356361 // Offense
357- m_CreatureScaling.insert_or_assign (STAT_TYPE::ATK_POWER, 1 );
358- m_CreatureScaling.insert_or_assign (STAT_TYPE::SPELL_POWER, 1 );
362+ m_CreatureScaling.insert_or_assign (STAT_TYPE::ATK_POWER, 0.8 );
363+ m_CreatureScaling.insert_or_assign (STAT_TYPE::SPELL_POWER, 0.8 );
359364 m_CreatureScaling.insert_or_assign (STAT_TYPE::CRIT, 0 );
360365 m_CreatureScaling.insert_or_assign (STAT_TYPE::HASTE, 0 );
361366
@@ -394,20 +399,19 @@ class Mod : GenericMod {
394399 if (creature->entity_data .hostility_type != cube::Creature::EntityBehaviour::Player &&
395400 creature->entity_data .hostility_type != cube::Creature::EntityBehaviour::Pet)
396401 {
397- *stat /= creature->entity_data .level + 1 ;
398- *stat += m_CreatureScaling.at (type) * (GetCreatureLevel (creature) - LEVELS_PER_REGION / 2 );
399- *stat *= creature->entity_data .level + 1 ;
402+ *stat *= m_CreatureScaling.at (type) * 0.5 * std::pow (2.7183 , 0.2 * GetCreatureLevel (creature)) / 1.21 * std::pow (0.99 , 1 + 0.07 * GetCreatureLevel (creature) * GetCreatureLevel (creature));
403+
400404 }
401405 }
402406
407+
403408 virtual void OnCreatureArmorCalculated (cube::Creature* creature, float * armor) override {
404409 ApplyStatBuff (creature, armor, STAT_TYPE::ARMOR);
405410 ApplyCreatureBuff (creature, armor, STAT_TYPE::ARMOR);
406411 }
407412
408413 virtual void OnCreatureCriticalCalculated (cube::Creature* creature, float * critical) override {
409414 ApplyStatBuff (creature, critical, STAT_TYPE::CRIT);
410- ApplyCreatureBuff (creature, critical, STAT_TYPE::CRIT);
411415 }
412416
413417 virtual void OnCreatureAttackPowerCalculated (cube::Creature* creature, float * power) override {
@@ -422,7 +426,6 @@ class Mod : GenericMod {
422426
423427 virtual void OnCreatureHasteCalculated (cube::Creature* creature, float * haste) override {
424428 ApplyStatBuff (creature, haste, STAT_TYPE::HASTE);
425- ApplyCreatureBuff (creature, haste, STAT_TYPE::HASTE);
426429 }
427430
428431 virtual void OnCreatureHPCalculated (cube::Creature* creature, float * hp) override {
0 commit comments