From 5da7b991eb86c75ccfd626ca40ed2b45391e558c Mon Sep 17 00:00:00 2001 From: tyanmahou Date: Fri, 20 Dec 2024 22:43:37 +0900 Subject: [PATCH] add debug --- Re-Abyss/app/components/Actor/Common/ColCtrl.cpp | 6 +++++- Re-Abyss/app/components/Actor/Common/ColCtrl.hpp | 10 ++++++++-- Re-Abyss/app/components/Actor/Common/DamageCtrl.cpp | 12 ++++++++++-- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/Re-Abyss/app/components/Actor/Common/ColCtrl.cpp b/Re-Abyss/app/components/Actor/Common/ColCtrl.cpp index 30ef6acb9..c01201b04 100644 --- a/Re-Abyss/app/components/Actor/Common/ColCtrl.cpp +++ b/Re-Abyss/app/components/Actor/Common/ColCtrl.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -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& b) { diff --git a/Re-Abyss/app/components/Actor/Common/ColCtrl.hpp b/Re-Abyss/app/components/Actor/Common/ColCtrl.hpp index 9f1f1d157..348fed23f 100644 --- a/Re-Abyss/app/components/Actor/Common/ColCtrl.hpp +++ b/Re-Abyss/app/components/Actor/Common/ColCtrl.hpp @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include #include #include @@ -33,6 +33,12 @@ namespace abyss::Actor /// Ref branch(size_t index) const; + /// + /// ブランチ数 + /// + /// + size_t branchCount() const; + /// /// 何かにヒットしたか /// @@ -111,4 +117,4 @@ namespace abyss::Actor s3d::Array> m_branchs; bool m_isActive = true; }; -} \ No newline at end of file +} diff --git a/Re-Abyss/app/components/Actor/Common/DamageCtrl.cpp b/Re-Abyss/app/components/Actor/Common/DamageCtrl.cpp index ef4e2d812..3cd7addce 100644 --- a/Re-Abyss/app/components/Actor/Common/DamageCtrl.cpp +++ b/Re-Abyss/app/components/Actor/Common/DamageCtrl.cpp @@ -1,8 +1,9 @@ -#include +#include #include #include #include #include +#include #include namespace abyss::Actor @@ -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([this, &data](s3d::uint64 id, const Col::Attacker::Data& attacker) { const auto& record = m_comboHistory.find(id);