Skip to content

Commit 7f6c397

Browse files
committed
up
1 parent f8d3732 commit 7f6c397

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

Source/kbengine_ue4_demo/kbe_scripts/LogicEvents.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,3 +297,24 @@ class KBENGINE_UE4_DEMO_API UKBEventData_reqRelive : public UKBEventData
297297
uint8 reliveType;
298298
};
299299

300+
UCLASS(Blueprintable, BlueprintType)
301+
class KBENGINE_UE4_DEMO_API UKBEventData_recvDamage : public UKBEventData
302+
{
303+
GENERATED_BODY()
304+
305+
public:
306+
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = KBEngine)
307+
int32 attackerID;
308+
309+
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = KBEngine)
310+
int32 skillID;
311+
312+
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = KBEngine)
313+
int32 damageType;
314+
315+
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = KBEngine)
316+
int32 damage;
317+
318+
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = KBEngine)
319+
int entityID;
320+
};

Source/kbengine_ue4_demo/kbe_scripts/interfaces/Combat.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,15 @@ void Combat::set_MP_Max(int32 old)
4242
pEventData->MP_Max = MP_Max;
4343
pEventData->entityID = self->id();
4444
KBENGINE_EVENT_FIRE("set_MP_Max", pEventData);
45+
}
46+
47+
void Combat::recvDamage(int32 attackerID, int32 skillID, int32 damageType, int32 damage)
48+
{
49+
UKBEventData_recvDamage* pEventData = NewObject<UKBEventData_recvDamage>();
50+
pEventData->attackerID = attackerID;
51+
pEventData->skillID = skillID;
52+
pEventData->damageType = damageType;
53+
pEventData->damage = damage;
54+
pEventData->entityID = self->id();
55+
KBENGINE_EVENT_FIRE("recvDamage", pEventData);
4556
}

Source/kbengine_ue4_demo/kbe_scripts/interfaces/Combat.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class Combat
1919
void set_MP(int32 old);
2020
void set_MP_Max(int32 old);
2121

22+
void recvDamage(int32 attackerID, int32 skillID, int32 damageType, int32 damage);
23+
2224
public:
2325
Entity* self;
2426

@@ -42,4 +44,5 @@ Declare all of the properties and methods of the KBE-Entity
4244
ENTITYDEF_PROPERTY_WITH_SETMETHOD_REGISTER(PARENT_MODULE, HP) \
4345
ENTITYDEF_PROPERTY_WITH_SETMETHOD_REGISTER(PARENT_MODULE, HP_Max) \
4446
ENTITYDEF_PROPERTY_WITH_SETMETHOD_REGISTER(PARENT_MODULE, MP) \
45-
ENTITYDEF_PROPERTY_WITH_SETMETHOD_REGISTER(PARENT_MODULE, MP_Max)
47+
ENTITYDEF_PROPERTY_WITH_SETMETHOD_REGISTER(PARENT_MODULE, MP_Max) \
48+
ENTITYDEF_METHOD_ARGS4_REGISTER(PARENT_MODULE, recvDamage)

0 commit comments

Comments
 (0)