1
This commit is contained in:
parent
02579d1f81
commit
9376761336
@ -7,6 +7,7 @@
|
|||||||
#include "room.h"
|
#include "room.h"
|
||||||
#include "skill.h"
|
#include "skill.h"
|
||||||
#include "human.h"
|
#include "human.h"
|
||||||
|
#include "hero.h"
|
||||||
#include "collider.h"
|
#include "collider.h"
|
||||||
#include "roomobstacle.h"
|
#include "roomobstacle.h"
|
||||||
|
|
||||||
@ -1636,12 +1637,34 @@ void Creature::SlaveOnRemove(Entity* slave)
|
|||||||
|
|
||||||
void Creature::RemoveSurplusHero(int buff_id, int id, int num)
|
void Creature::RemoveSurplusHero(int buff_id, int id, int num)
|
||||||
{
|
{
|
||||||
|
if (slave_heros_.size() >= num) {
|
||||||
|
std::vector<Hero*> matched_heros;
|
||||||
|
for (auto& itr : slave_heros_) {
|
||||||
|
if (std::get<0>(itr) == buff_id &&
|
||||||
|
std::get<1>(itr)->meta->i->id() == id) {
|
||||||
|
matched_heros.push_back(std::get<1>(itr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (matched_heros.size() >= num) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature::RemoveSurplusObstacle(int buff_id, int id, int num)
|
void Creature::RemoveSurplusObstacle(int buff_id, int id, int num)
|
||||||
{
|
{
|
||||||
|
if (slave_things_.size() >= num) {
|
||||||
|
std::vector<RoomObstacle*> matched_things;
|
||||||
|
for (auto& itr : slave_things_) {
|
||||||
|
if (std::get<0>(itr) == buff_id &&
|
||||||
|
std::get<1>(itr)->meta->i->thing_id() == id) {
|
||||||
|
matched_things.push_back(std::get<1>(itr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (matched_things.size() >= num) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Creature::IsInvincible()
|
bool Creature::IsInvincible()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user