This commit is contained in:
aozhiwei 2021-06-24 09:26:21 +00:00
parent d468a3f962
commit a6ff08b619
3 changed files with 67 additions and 0 deletions

View File

@ -4,6 +4,7 @@
#include "moveableentity.h" #include "moveableentity.h"
#include "buff.h" #include "buff.h"
#include "weakptr.h" #include "weakptr.h"
#include "trigger.h"
#include "cs_proto.pb.h" #include "cs_proto.pb.h"
@ -40,6 +41,7 @@ class RoomObstacle;
class Hero; class Hero;
class Team; class Team;
class Car; class Car;
class Trigger;
class Creature : public MoveableEntity class Creature : public MoveableEntity
{ {
public: public:
@ -196,6 +198,7 @@ class Creature : public MoveableEntity
Entity* GetLastCollisionDoor() { return last_collision_door_; } Entity* GetLastCollisionDoor() { return last_collision_door_; }
void SetLastCollisionDoor(Entity* door) { last_collision_door_ = door; } void SetLastCollisionDoor(Entity* door) { last_collision_door_ = door; }
bool CheckCollision(); bool CheckCollision();
Trigger* GetTrigger() { return trigger_; };
protected: protected:
@ -231,6 +234,7 @@ protected:
private: private:
CreatureWeakPtr weak_ptr_; CreatureWeakPtr weak_ptr_;
Trigger* trigger_ = nullptr;
Team* team_ = nullptr; Team* team_ = nullptr;
Weapon* curr_weapon_ = nullptr; Weapon* curr_weapon_ = nullptr;
CreatureWeakPtrChunk weak_ptr_chunk_; CreatureWeakPtrChunk weak_ptr_chunk_;

View File

@ -0,0 +1,41 @@
#include "precompile.h"
#include "trigger.h"
void Trigger::Init()
{
}
void Trigger::UnInit()
{
}
void Trigger::TakeonWeapon(Weapon* old_weapon, Weapon* new_weapon)
{
}
void Trigger::Shot(Weapon* weapon)
{
}
void Trigger::Kill(Creature* target)
{
}
void Trigger::UseItemAction()
{
}
void Trigger::UseSkill(Skill* skill)
{
}
void Trigger::HpChg(float old_hp, float new_hp)
{
}

View File

@ -0,0 +1,22 @@
#pragma once
class Weapon;
class Creature;
class Skill;
class Trigger
{
public:
void Init();
void UnInit();
Creature* GetOwner() { return owner_; };
void TakeonWeapon(Weapon* old_weapon, Weapon* new_weapon);
void Shot(Weapon* weapon);
void Kill(Creature* target);
void UseItemAction();
void UseSkill(Skill* skill);
void HpChg(float old_hp, float new_hp);
private:
Creature* owner_ = nullptr;
};