@@ -78,7 +78,6 @@ class Mod : GenericMod {
7878 game->PrintMessage (L" [Notification] Correctly recentered player region.\n " , 0 , 255 , 0 );
7979 return 1 ;
8080 }
81-
8281 return 0 ;
8382 }
8483
@@ -193,7 +192,16 @@ class Mod : GenericMod {
193192 if (player->id == attacker->id || player->pet_id == attacker->id )
194193 {
195194 FloatRGBA purple (0 .65f , 0 .40f , 1 .0f , 1 .0f );
196- int xp_gain = GetCreatureLevel (creature) * (creature->entity_data .level + 1 );
195+
196+ int xp_gain = 100 ;
197+
198+ if (player->entity_data .level > GetCreatureLevel (creature)) {
199+ xp_gain = (int )std::roundf (100 * (creature->entity_data .level + 1 ) * std::powf (0 .8f , player->entity_data .level - GetCreatureLevel (creature)));
200+ }
201+ else {
202+ 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 ));
203+ }
204+
197205
198206 if ((creature->entity_data .appearance .flags2 & (1 << (int )cube::Creature::AppearanceModifiers::IsBoss)) != 0 )
199207 {
@@ -292,13 +300,13 @@ class Mod : GenericMod {
292300
293301 // ##### PLAYER ######
294302 // Defense
295- m_PlayerScaling.insert_or_assign (STAT_TYPE::HEALTH, 5 );
296- m_PlayerScaling.insert_or_assign (STAT_TYPE::ARMOR, 1 );
297- m_PlayerScaling.insert_or_assign (STAT_TYPE::RESISTANCE, 1 );
303+ m_PlayerScaling.insert_or_assign (STAT_TYPE::HEALTH, 1 );
304+ m_PlayerScaling.insert_or_assign (STAT_TYPE::ARMOR, 0.2 );
305+ m_PlayerScaling.insert_or_assign (STAT_TYPE::RESISTANCE, 0.2 );
298306
299307 // Offense
300- m_PlayerScaling.insert_or_assign (STAT_TYPE::ATK_POWER, 1 );
301- m_PlayerScaling.insert_or_assign (STAT_TYPE::SPELL_POWER, 1 );
308+ m_PlayerScaling.insert_or_assign (STAT_TYPE::ATK_POWER, 0.2 );
309+ m_PlayerScaling.insert_or_assign (STAT_TYPE::SPELL_POWER, 0.2 );
302310 m_PlayerScaling.insert_or_assign (STAT_TYPE::CRIT, 0 .0001f );
303311 m_PlayerScaling.insert_or_assign (STAT_TYPE::HASTE, 0 .0001f );
304312
@@ -308,7 +316,6 @@ class Mod : GenericMod {
308316
309317 // ##### CREATURE ######
310318 // Defense
311-
312319 m_CreatureScaling.insert_or_assign (STAT_TYPE::HEALTH, 0.9 );
313320 m_CreatureScaling.insert_or_assign (STAT_TYPE::ARMOR, 0.7 );
314321 m_CreatureScaling.insert_or_assign (STAT_TYPE::RESISTANCE, 0.7 );
@@ -354,20 +361,19 @@ class Mod : GenericMod {
354361 if (creature->entity_data .hostility_type != cube::Creature::EntityBehaviour::Player &&
355362 creature->entity_data .hostility_type != cube::Creature::EntityBehaviour::Pet)
356363 {
357-
358364 *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));
359365
360366 }
361367 }
362368
369+
363370 virtual void OnCreatureArmorCalculated (cube::Creature* creature, float * armor) override {
364371 ApplyStatBuff (creature, armor, STAT_TYPE::ARMOR);
365372 ApplyCreatureBuff (creature, armor, STAT_TYPE::ARMOR);
366373 }
367374
368375 virtual void OnCreatureCriticalCalculated (cube::Creature* creature, float * critical) override {
369376 ApplyStatBuff (creature, critical, STAT_TYPE::CRIT);
370- ApplyCreatureBuff (creature, critical, STAT_TYPE::CRIT);
371377 }
372378
373379 virtual void OnCreatureAttackPowerCalculated (cube::Creature* creature, float * power) override {
@@ -382,7 +388,6 @@ class Mod : GenericMod {
382388
383389 virtual void OnCreatureHasteCalculated (cube::Creature* creature, float * haste) override {
384390 ApplyStatBuff (creature, haste, STAT_TYPE::HASTE);
385- ApplyCreatureBuff (creature, haste, STAT_TYPE::HASTE);
386391 }
387392
388393 virtual void OnCreatureHPCalculated (cube::Creature* creature, float * hp) override {
@@ -407,4 +412,4 @@ class Mod : GenericMod {
407412// Export of the mod created in this file, so that the modloader can see and use it.
408413EXPORT Mod* MakeMod () {
409414 return new Mod ();
410- }
415+ }
0 commit comments