mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
Updated how skills and upgrades work, more gui stuff
This commit is contained in:
@@ -767,8 +767,8 @@ void BaseCombatAIComponent::SetTetherSpeed(float value) {
|
||||
m_TetherSpeed = value;
|
||||
}
|
||||
|
||||
void BaseCombatAIComponent::Stun(const float time) {
|
||||
if (m_StunImmune || m_StunTime > time) {
|
||||
void BaseCombatAIComponent::Stun(const float time, const bool ignoreImmunity) {
|
||||
if ((!ignoreImmunity && m_StunImmune) || m_StunTime > time) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -187,8 +187,9 @@ public:
|
||||
/**
|
||||
* Stuns the entity for a certain amount of time, will not work if the entity is stun immune
|
||||
* @param time the time to stun the entity, if stunnable
|
||||
* @param ignoreImmunity whether to ignore the stun immunity of the entity
|
||||
*/
|
||||
void Stun(float time);
|
||||
void Stun(float time, bool ignoreImmunity = false);
|
||||
|
||||
/**
|
||||
* Gets the radius that will cause this entity to get aggro'd, causing a target chase
|
||||
|
@@ -675,7 +675,7 @@ void DestroyableComponent::Damage(uint32_t damage, const LWOOBJID source, uint32
|
||||
|
||||
if (m_Parent->IsPlayer()) {
|
||||
m_Parent->SetNetworkVar<std::string>(u"renderText", damageUIStr, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (attacker->IsPlayer()) {
|
||||
} else if (attacker != nullptr && attacker->IsPlayer()) {
|
||||
attacker->SetNetworkVar<std::string>(u"renderText", damageUIStr, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,7 @@ ProjectileSyncEntry::ProjectileSyncEntry() {
|
||||
|
||||
std::unordered_map<uint32_t, uint32_t> SkillComponent::m_skillBehaviorCache = {};
|
||||
|
||||
Observable<SkillComponent*, uint32_t, bool> SkillComponent::OnSkillCast;
|
||||
Observable<SkillComponent*, uint32_t, bool&, uint32_t> SkillComponent::OnSkillCast;
|
||||
|
||||
bool SkillComponent::CastPlayerSkill(const uint32_t behaviorId, const uint32_t skillUid, RakNet::BitStream& bitStream, const LWOOBJID target, uint32_t skillID) {
|
||||
auto* context = new BehaviorContext(this->m_Parent->GetObjectID());
|
||||
@@ -50,7 +50,11 @@ bool SkillComponent::CastPlayerSkill(const uint32_t behaviorId, const uint32_t s
|
||||
|
||||
context->ExecuteUpdates();
|
||||
|
||||
OnSkillCast(this, skillID, !context->failed);
|
||||
bool success = !context->failed;
|
||||
|
||||
OnSkillCast(this, skillID, success, skillUid);
|
||||
|
||||
context->failed = !success;
|
||||
|
||||
return !context->failed;
|
||||
}
|
||||
|
@@ -185,8 +185,8 @@ public:
|
||||
*/
|
||||
uint32_t GetUniqueSkillId();
|
||||
|
||||
// SkillComponent, SkillID, Success
|
||||
static Observable<SkillComponent*, uint32_t, bool> OnSkillCast;
|
||||
// SkillComponent, SkillID, Success, skillUID
|
||||
static Observable<SkillComponent*, uint32_t, bool&, uint32_t> OnSkillCast;
|
||||
|
||||
private:
|
||||
/**
|
||||
|
Reference in New Issue
Block a user