Added TriggerMark convenience function and appropriate unit test for it.

mac-build
sigonasr2 4 months ago
parent f16d10a095
commit 540f0c39ae
  1. 7
      Adventures in Lestoria Tests/MonsterTests.cpp
  2. 4
      Adventures in Lestoria/Monster.cpp
  3. 1
      Adventures in Lestoria/Monster.h
  4. 2
      Adventures in Lestoria/Version.h

@ -431,6 +431,13 @@ namespace MonsterTests
testMonster._DealTrueDamage(10,HurtFlag::DOT|HurtFlag::PLAYER_ABILITY);
Assert::AreEqual(2,testMonster.GetMarkStacks(),L"Monster should have 2 marks remaining after taking true damage, even though it's classified as a DOT. This is an edge case, but it's really meaningless here...");
testMonster.Heal(testMonster.GetMaxHealth());
testMonster.TriggerMark();
Assert::AreEqual(1,testMonster.GetMarkStacks(),L"Monster should have 1 mark remaining after using TriggerMark function");
Assert::AreEqual(24,testMonster.GetHealth(),L"Monster should not take damage from the TriggerMark function (Mark deals 6 damage though).");
}
};
}

@ -1219,3 +1219,7 @@ void Monster::RemoveMarkStack(){
}
}
}
void Monster::TriggerMark(){
Hurt(0,OnUpperLevel(),GetZ(),HurtFlag::PLAYER_ABILITY);
}

@ -200,6 +200,7 @@ public:
//The collision rectangle is only used currently for determining the safe spots for the stone golem boss fight.
const std::optional<geom2d::rect<float>>&GetRectangleCollision()const;
const int GetMarkStacks()const; //Number of Trapper marks on this target.
void TriggerMark(); //Deals no damage, but causes a mark proc to occur.
private:
//NOTE: Marking a monster for deletion does not trigger any death events. It just simply removes the monster from the field!!
// The way this works is that monsters marked for deletion will cause the monster update loop to detect there's at least one or more monsters that must be deleted and will call erase_if on the list at the end of the iteration loop.

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define VERSION_PATCH 3
#define VERSION_BUILD 10261
#define VERSION_BUILD 10262
#define stringify(a) stringify_(a)
#define stringify_(a) #a

Loading…
Cancel
Save