Skip to content

Commit

Permalink
update CaptainTako
Browse files Browse the repository at this point in the history
  • Loading branch information
tyanmahou committed Dec 14, 2024
1 parent 0e4b65d commit 679d1cc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Re-Abyss/app/components/Actor/Enemy/CaptainTako/Builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ namespace abyss::Actor::Enemy::CaptainTako
{
// 共通ビルド
CommonBuilder::Build(pActor, BuildOption{}
.setInitPos(entity.pos)
.setInitPos(entity.footPos)
.setForward(entity.forward)
.setBodyAnchor(BodyAnchor::BottomCenter)
.setBodySize(Param::Base::Size)
.setBodyOffset(Param::Base::Pivot)
.setInitHp(Param::Base::Hp)
.setInitState<WaitState>()
.setVModelPresenter<Presenter>(pActor)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <abyss/components/Actor/Enemy/CaptainTako/State/AttackState.hpp>
#include <abyss/components/Actor/Enemy/CaptainTako/State/AttackState.hpp>
#include <abyss/components/Actor/Enemy/CaptainTako/State/WaitState.hpp>

#include <abyss/modules/Actor/Actors.hpp>
Expand All @@ -23,7 +23,7 @@ namespace abyss::Actor::Enemy::CaptainTako

while (true) {
// ショット
constexpr s3d::Vec2 offset{ -9, 4 };
constexpr s3d::Vec2 offset{ -9, -20 + 4 };
const s3d::Vec2 fixedOffset{
m_body->isForward(Forward::Left()) ? offset.x : -offset.x,
offset.y
Expand Down
6 changes: 2 additions & 4 deletions Re-Abyss/app/params/Actor/Enemy/CaptainTako/Param.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include <Siv3D/Vector2D.hpp>
#include <abyss/utils/TOML/TOMLBind.hpp>

Expand All @@ -8,12 +8,10 @@ namespace abyss::Actor::Enemy::CaptainTako
{
[[TOML_BIND(Base::Hp, "Base.hp")]]
[[TOML_BIND(Base::Size, "Base.size")]]
[[TOML_BIND(Base::Pivot, "Base.pivot")]]
struct Base
{
inline static s3d::int32 Hp{ 10 };
inline static s3d::Vec2 Size{ 32, 38 };
inline static s3d::Vec2 Pivot{ 0, 1 };
};

[[TOML_BIND(Wait::TimeSec, "Wait.timeSec")]]
Expand Down Expand Up @@ -44,4 +42,4 @@ namespace abyss::Actor::Enemy::CaptainTako
inline static double ChargingAddScale{ 0.4 };
};
};
}
}
7 changes: 3 additions & 4 deletions Re-Abyss/app/views/Actor/Enemy/CaptainTako/CpatainTakoVM.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <abyss/views/Actor/Enemy/CaptainTako/CpatainTakoVM.hpp>
#include <abyss/views/Actor/Enemy/CaptainTako/CpatainTakoVM.hpp>

#include <Siv3D.hpp>
#include <abyss/params/Actor/Enemy/CaptainTako/Param.hpp>
Expand Down Expand Up @@ -50,7 +50,7 @@ namespace abyss::Actor::Enemy::CaptainTako
bool isRight = m_forward.isRight();
int32 page = static_cast<int32>(Periodic::Triangle0_1(Param::View::AnimeTimeSec, m_time) * 3.0);
auto tex = m_texture(40 * page, 0, 40, 40);
tex.mirrored(isRight).drawAt(m_pos, m_colorMul);
tex.mirrored(isRight).draw(Arg::bottomCenter = m_pos, m_colorMul);
}
void CaptainTakoVM::drawCharge() const
{
Expand All @@ -62,7 +62,6 @@ namespace abyss::Actor::Enemy::CaptainTako
auto tex = m_texture({ 40 * page, 40 }, rawSize);
const double scale = 1.0 + (m_chargeRate * Param::View::ChargingAddScale);
const Vec2 size = s3d::Round(rawSize * scale);
const Vec2 pos = s3d::Round(m_pos - size / 2.0 - Vec2{0, (size.y -rawSize.y) / 2.0});
tex.mirrored(isRight).resized(size).draw(pos, color);
tex.mirrored(isRight).resized(size).draw(Arg::bottomCenter = m_pos, color);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[Base]
hp = 10
size = "(32, 38)"
pivot = "(0, 1)"

[Wait]
timeSec = 2.0
Expand Down

0 comments on commit 679d1cc

Please sign in to comment.