mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-23 22:17:31 +00:00
a0d51e21ca
* allow usage of NiPoint3 and NiQuaternion in constexpr context * removed .cpp files entirely * moving circular dependency circumvention stuff to an .inl file * real world usage!!!!! * reverting weird branch cross-pollination * removing more weird branch cross-pollination * remove comment * added inverse header guard to inl file * Update NiPoint3.inl * trying different constructor syntax * reorganize into .inl files for readability * uncomment include * moved non-constexpr definitions to cpp file * moved static definitions back to inl files * testing fix * moved constants into seperate namespace * Undo change in build-and-test.yml * nodiscard
29 lines
1.1 KiB
C++
29 lines
1.1 KiB
C++
#include "AgLaserSensorServer.h"
|
|
|
|
#include "PhantomPhysicsComponent.h"
|
|
#include "SkillComponent.h"
|
|
#include "ePhysicsEffectType.h"
|
|
|
|
void AgLaserSensorServer::OnStartup(Entity* self) {
|
|
self->SetBoolean(u"active", true);
|
|
auto repelForce = self->GetVarAs<float>(u"repelForce");
|
|
if (!repelForce) repelForce = m_RepelForce;
|
|
auto* phantomPhysicsComponent = self->GetComponent<PhantomPhysicsComponent>();
|
|
if (!phantomPhysicsComponent) return;
|
|
phantomPhysicsComponent->SetPhysicsEffectActive(true);
|
|
phantomPhysicsComponent->SetEffectType(ePhysicsEffectType::REPULSE);
|
|
phantomPhysicsComponent->SetDirectionalMultiplier(repelForce);
|
|
phantomPhysicsComponent->SetDirection(NiPoint3Constant::UNIT_Y);
|
|
}
|
|
|
|
|
|
void AgLaserSensorServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
|
auto active = self->GetVar<bool>(u"active");
|
|
if (!active) return;
|
|
auto skillCastID = self->GetVarAs<float>(u"skillCastID");
|
|
if (skillCastID == 0) skillCastID = m_SkillCastID;
|
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
|
if (!skillComponent) return;
|
|
skillComponent->CastSkill(m_SkillCastID, target->GetObjectID());
|
|
}
|