1
This commit is contained in:
parent
d468a3f962
commit
a6ff08b619
@ -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_;
|
||||||
|
41
server/gameserver/trigger.cc
Normal file
41
server/gameserver/trigger.cc
Normal 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)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
22
server/gameserver/trigger.h
Normal file
22
server/gameserver/trigger.h
Normal 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;
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user