55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
#include "precompile.h"
|
|
|
|
#include "loot.h"
|
|
#include "metamgr.h"
|
|
#include "room.h"
|
|
#include "collider.h"
|
|
#include "entity.h"
|
|
#include "app.h"
|
|
#include "typeconvert.h"
|
|
#include "perfmonitor.h"
|
|
|
|
Loot::Loot():RoomEntity()
|
|
{
|
|
++PerfMonitor::Instance()->entity_num[ET_Loot];
|
|
}
|
|
|
|
Loot::~Loot()
|
|
{
|
|
--PerfMonitor::Instance()->entity_num[ET_Loot];
|
|
}
|
|
|
|
void Loot::Initialize()
|
|
{
|
|
RoomEntity::Initialize();
|
|
RecalcSelfCollider();
|
|
}
|
|
|
|
void Loot::RecalcSelfCollider()
|
|
{
|
|
}
|
|
|
|
void Loot::FillMFObjectPart(Room* room, Human* hum, cs::MFObjectPart* part_data)
|
|
{
|
|
part_data->set_object_type(ET_Loot);
|
|
cs::MFLootPart* p = part_data->mutable_union_obj_5();
|
|
p->set_obj_uniid(GetUniId());
|
|
TypeConvert::ToPb(GetPos(), p->mutable_pos());
|
|
}
|
|
|
|
void Loot::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_data)
|
|
{
|
|
full_data->set_object_type(ET_Loot);
|
|
cs::MFLootFull* p = full_data->mutable_union_obj_5();
|
|
p->set_obj_uniid(GetUniId());
|
|
TypeConvert::ToPb(GetPos(), p->mutable_pos());
|
|
TypeConvert::ToPb(born_pos, p->mutable_born_pos());
|
|
|
|
p->set_item_id(item_id);
|
|
p->set_count(count);
|
|
p->set_item_level(item_level);
|
|
if (show_anim && room->GetFrameNo() <= create_frame_no + 1) {
|
|
p->set_show_anim(true);
|
|
}
|
|
}
|