Skip to content

Commit

Permalink
add debug
Browse files Browse the repository at this point in the history
  • Loading branch information
tyanmahou committed Dec 20, 2024
1 parent 99da5bc commit 5da7b99
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Re-Abyss/app/components/Actor/Common/ColCtrl.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <abyss/components/Actor/Common/ColCtrl.hpp>
#include <abyss/components/Actor/Common/ColCtrl.hpp>
#include <abyss/modules/Actor/base/ActorObj.hpp>
#include <abyss/modules/ColSys/CollisionManager.hpp>

Expand Down Expand Up @@ -54,6 +54,10 @@ namespace abyss::Actor
}
return m_branchs[index];
}
size_t ColCtrl::branchCount() const
{
return m_branchs.size();
}
bool ColCtrl::isHitAny() const
{
return m_branchs.any([](const Ref<ColSys::Branch>& b) {
Expand Down
10 changes: 8 additions & 2 deletions Re-Abyss/app/components/Actor/Common/ColCtrl.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include <abyss/modules/GameObject/IComponent.hpp>
#include <abyss/components/Actor/Common/Col/Node.hpp>
#include <abyss/modules/ColSys/Branch.hpp>
Expand Down Expand Up @@ -33,6 +33,12 @@ namespace abyss::Actor
/// <returns></returns>
Ref<ColSys::Branch> branch(size_t index) const;

/// <summary>
/// ブランチ数
/// </summary>
/// <returns></returns>
size_t branchCount() const;

/// <summary>
/// 何かにヒットしたか
/// </summary>
Expand Down Expand Up @@ -111,4 +117,4 @@ namespace abyss::Actor
s3d::Array<std::shared_ptr<ColSys::Branch>> m_branchs;
bool m_isActive = true;
};
}
}
12 changes: 10 additions & 2 deletions Re-Abyss/app/components/Actor/Common/DamageCtrl.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include <abyss/components/Actor/Common/DamageCtrl.hpp>
#include <abyss/components/Actor/Common/DamageCtrl.hpp>
#include <abyss/modules/Actor/base/ActorObj.hpp>
#include <abyss/components/Actor/Common/IDamageCallback.hpp>
#include <abyss/components/Actor/Common/Col/Extension/Attacker.hpp>
#include <abyss/commons/ColorDef.hpp>
#include <abyss/debugs/Debug.hpp>
#include <Siv3D.hpp>

namespace abyss::Actor
Expand Down Expand Up @@ -51,7 +52,14 @@ namespace abyss::Actor
// 無敵
return;
}

#if ABYSS_DEBUG
if (Debug::MenuUtil::IsDebug(Debug::DebugFlag::ActorInvincible) &&
m_colCtrl->branchCount() >= 1 &&
m_colCtrl->branch(0)->layer() == ColSys::LayerGroup::Player) {
// 無敵
return;
}
#endif
DamageData data;
const bool isDamaged = m_colCtrl->anyThen<Col::Attacker, 0>([this, &data](s3d::uint64 id, const Col::Attacker::Data& attacker) {
const auto& record = m_comboHistory.find(id);
Expand Down

0 comments on commit 5da7b99

Please sign in to comment.