mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
Organize dScripts (#814)
* Organize dScripts whitespace Remove parent scope Remove parent scope from initial setter Remove debug Remove helper programs * Fix NtImagimeterVisibility script Co-authored-by: aronwk-aaron <aronwk.aaron@gmail.com>
This commit is contained in:
24
dScripts/02_server/Enemy/AM/AmSkeletonEngineer.cpp
Normal file
24
dScripts/02_server/Enemy/AM/AmSkeletonEngineer.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "AmSkeletonEngineer.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "SkillComponent.h"
|
||||
|
||||
void AmSkeletonEngineer::OnHit(Entity* self, Entity* attacker) {
|
||||
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||
|
||||
if (destroyableComponent == nullptr || skillComponent == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (destroyableComponent->GetHealth() < 12 && !self->GetVar<bool>(u"injured")) {
|
||||
self->SetVar(u"injured", true);
|
||||
|
||||
skillComponent->CalculateBehavior(953, 19864, self->GetObjectID(), true);
|
||||
|
||||
const auto attackerID = attacker->GetObjectID();
|
||||
|
||||
self->AddCallbackTimer(4.5f, [this, self, attackerID]() {
|
||||
self->Smash(attackerID);
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user