2019-12-22 20:04:07 +00:00
|
|
|
#include "Runtime/World/CKnockBackController.hpp"
|
|
|
|
|
|
|
|
#include "Runtime/CStateManager.hpp"
|
|
|
|
#include "Runtime/Character/CPASAnimParmData.hpp"
|
|
|
|
#include "Runtime/World/CPatterned.hpp"
|
2018-11-05 06:12:53 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2018-11-05 06:12:53 +00:00
|
|
|
|
2020-04-12 15:53:15 +00:00
|
|
|
constexpr std::array<std::array<std::array<CKnockBackController::KnockBackParms, 4>, 19>, 3> KnockBackParmsTable{{
|
|
|
|
{{
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 1.000000f, 0.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 2.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 2.000000f, 0.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 4.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 0.000000f, 0.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 5.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 5.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 8.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 4.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
}},
|
|
|
|
{{
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 2.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 1.000000f, 0.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Shock, 2.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 2.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 2.000000f, 0.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 0.000000f, 0.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 5.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 5.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 8.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 8.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 4.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 4.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, -1.000000f},
|
2018-11-08 00:53:38 +00:00
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::BurnDeath, 6.000000f, -1.000000f},
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-08 00:53:38 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::BurnDeath, 6.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::BurnDeath, 6.000000f, -1.000000f},
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Burn, 6.000000f, -1.000000f},
|
2018-11-08 00:53:38 +00:00
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::BurnDeath, 0.000000f, -1.000000f},
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-08 00:53:38 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::LaggedBurnDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::LaggedBurnDeath, 0.000000f, -1.000000f},
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::PhazeOut, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
}},
|
|
|
|
{{
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 2.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 1.000000f, 0.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::Shock, 2.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 2.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 2.000000f, 0.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 4.000000f, 0.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 4.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 4.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::Burn, 6.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Burn, 6.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Burn, 6.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Burn, 6.000000f, -1.000000f},
|
2018-11-08 00:53:38 +00:00
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::BurnDeath, 0.000000f, -1.000000f},
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-08 00:53:38 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::LaggedBurnDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::LaggedBurnDeath, 0.000000f, -1.000000f},
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
{{
|
2018-11-06 06:16:12 +00:00
|
|
|
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::PhazeOut, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
|
|
|
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
|
2020-04-12 15:53:15 +00:00
|
|
|
}},
|
|
|
|
}},
|
|
|
|
}};
|
|
|
|
|
|
|
|
constexpr std::array ImpulseDurationTable{0.1f, 0.3f};
|
2018-11-05 06:12:53 +00:00
|
|
|
|
2020-04-20 04:57:50 +00:00
|
|
|
CKnockBackController::CKnockBackController(EKnockBackVariant variant) : x0_variant(variant) {
|
2020-04-17 17:17:01 +00:00
|
|
|
x24_.resize(x24_.capacity(), std::make_pair(0.0f, FLT_MAX));
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CKnockBackController::ApplyImpulse(float dt, CPatterned& parent) {
|
|
|
|
x60_impulseRemTime = std::max(0.f, x60_impulseRemTime - dt);
|
2020-04-17 17:12:17 +00:00
|
|
|
|
|
|
|
if (parent.GetMaterialList().HasMaterial(EMaterialTypes::Immovable) || x60_impulseRemTime <= 0.f) {
|
|
|
|
return;
|
2018-12-08 05:30:43 +00:00
|
|
|
}
|
2020-04-17 17:12:17 +00:00
|
|
|
|
|
|
|
float remFac = 1.f;
|
|
|
|
if (x20_impulseDurationIdx == 1) {
|
|
|
|
remFac = x60_impulseRemTime / ImpulseDurationTable[x20_impulseDurationIdx];
|
|
|
|
}
|
|
|
|
|
|
|
|
parent.ApplyImpulseWR(
|
|
|
|
parent.GetMoveToORImpulseWR(
|
|
|
|
parent.GetTransform().transposeRotate(
|
|
|
|
x50_impulseDir * (remFac * x5c_impulseMag * dt / ImpulseDurationTable[x20_impulseDurationIdx])),
|
|
|
|
dt),
|
|
|
|
zeus::CAxisAngle());
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
bool CKnockBackController::TickDeferredTimer(float dt) {
|
|
|
|
x68_deferRemTime -= dt;
|
2020-04-17 17:12:17 +00:00
|
|
|
if (x14_deferWeaponType != EWeaponType::None) {
|
2018-12-08 05:30:43 +00:00
|
|
|
return x68_deferRemTime <= 0.f;
|
2020-04-17 17:12:17 +00:00
|
|
|
}
|
2018-12-08 05:30:43 +00:00
|
|
|
return false;
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
|
|
|
|
2020-04-17 04:58:27 +00:00
|
|
|
EKnockBackCharacterState CKnockBackController::GetKnockBackCharacterState(const CPatterned& parent) const {
|
|
|
|
if (parent.GetBodyController()->IsFrozen()) {
|
2018-12-08 05:30:43 +00:00
|
|
|
return parent.IsAlive() ? EKnockBackCharacterState::FrozenAlive : EKnockBackCharacterState::FrozenDead;
|
2020-04-17 04:58:27 +00:00
|
|
|
}
|
2018-12-08 05:30:43 +00:00
|
|
|
return parent.IsAlive() ? EKnockBackCharacterState::Alive : EKnockBackCharacterState::Dead;
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
|
|
|
|
2020-04-17 05:03:10 +00:00
|
|
|
void CKnockBackController::ValidateState(const CPatterned& parent) {
|
2020-04-17 17:12:17 +00:00
|
|
|
if (x4_activeParms.x0_animState < x18_minAnimState) {
|
2018-12-08 05:30:43 +00:00
|
|
|
x4_activeParms.x0_animState = x18_minAnimState;
|
2020-04-17 17:12:17 +00:00
|
|
|
} else if (x4_activeParms.x0_animState > x1c_maxAnimState) {
|
2018-12-08 05:30:43 +00:00
|
|
|
x4_activeParms.x0_animState = x1c_maxAnimState;
|
2020-04-17 17:12:17 +00:00
|
|
|
}
|
2018-11-05 06:12:53 +00:00
|
|
|
|
2020-04-17 17:12:17 +00:00
|
|
|
auto useState = EKnockBackAnimationState::Invalid;
|
2018-12-08 05:30:43 +00:00
|
|
|
if (parent.IsAlive()) {
|
2019-08-14 14:58:54 +00:00
|
|
|
if (parent.GetBodyController()->HasBodyState(pas::EAnimationState::Hurled) && x80_availableStates.test(3) &&
|
2018-12-08 05:30:43 +00:00
|
|
|
x4_activeParms.x0_animState >= EKnockBackAnimationState::Hurled) {
|
|
|
|
useState = EKnockBackAnimationState::Hurled;
|
2019-08-14 14:58:54 +00:00
|
|
|
} else if (parent.GetBodyController()->HasBodyState(pas::EAnimationState::KnockBack) && x80_availableStates.test(2) &&
|
2018-12-08 05:30:43 +00:00
|
|
|
x4_activeParms.x0_animState >= EKnockBackAnimationState::KnockBack) {
|
|
|
|
useState = EKnockBackAnimationState::KnockBack;
|
2019-08-14 14:58:54 +00:00
|
|
|
} else if (parent.GetBodyController()->HasBodyState(pas::EAnimationState::AdditiveFlinch) &&
|
2018-12-08 05:30:43 +00:00
|
|
|
x80_availableStates.test(1) && x4_activeParms.x0_animState >= EKnockBackAnimationState::Flinch) {
|
|
|
|
useState = EKnockBackAnimationState::Flinch;
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
2020-05-21 15:32:48 +00:00
|
|
|
} else if (parent.GetBodyController()->HasBodyState(pas::EAnimationState::Fall) && x80_availableStates.test(4) &&
|
|
|
|
(x4_activeParms.x0_animState >= EKnockBackAnimationState::Fall ||
|
|
|
|
(!parent.GetBodyController()->HasBodyState(pas::EAnimationState::Hurled) &&
|
|
|
|
x4_activeParms.x0_animState >= EKnockBackAnimationState::Hurled))) {
|
|
|
|
useState = EKnockBackAnimationState::Fall;
|
|
|
|
} else if (parent.GetBodyController()->HasBodyState(pas::EAnimationState::Hurled) && x80_availableStates.test(3) &&
|
|
|
|
x4_activeParms.x0_animState >= EKnockBackAnimationState::Hurled) {
|
|
|
|
useState = EKnockBackAnimationState::Hurled;
|
2018-12-08 05:30:43 +00:00
|
|
|
}
|
2018-11-05 06:12:53 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
x4_activeParms.x0_animState =
|
|
|
|
(useState != EKnockBackAnimationState::Invalid) ? useState : EKnockBackAnimationState::None;
|
2018-11-05 06:12:53 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
bool disableFollowup = false;
|
|
|
|
switch (x4_activeParms.x4_animFollowup) {
|
|
|
|
case EKnockBackAnimationFollowUp::Freeze:
|
|
|
|
disableFollowup = !x81_25_enableFreeze;
|
|
|
|
break;
|
|
|
|
case EKnockBackAnimationFollowUp::Shock:
|
|
|
|
disableFollowup = !x81_26_enableShock;
|
|
|
|
break;
|
|
|
|
case EKnockBackAnimationFollowUp::Burn:
|
|
|
|
disableFollowup = !x81_27_enableBurn;
|
|
|
|
break;
|
|
|
|
case EKnockBackAnimationFollowUp::ExplodeDeath:
|
|
|
|
case EKnockBackAnimationFollowUp::IceDeath:
|
|
|
|
disableFollowup = !x81_29_enableExplodeDeath;
|
|
|
|
break;
|
|
|
|
case EKnockBackAnimationFollowUp::BurnDeath:
|
|
|
|
disableFollowup = !x81_28_enableBurnDeath;
|
|
|
|
break;
|
|
|
|
case EKnockBackAnimationFollowUp::LaggedBurnDeath:
|
|
|
|
disableFollowup = !x81_30_enableLaggedBurnDeath;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2018-11-05 06:12:53 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
if (disableFollowup) {
|
|
|
|
x4_activeParms.x4_animFollowup = EKnockBackAnimationFollowUp::None;
|
|
|
|
x4_activeParms.x8_followupDuration = 0.f;
|
|
|
|
}
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
|
|
|
|
2020-04-17 05:05:47 +00:00
|
|
|
float CKnockBackController::CalculateExtraHurlVelocity(CStateManager& mgr, float magnitude, float kbResistance) const {
|
|
|
|
if (magnitude <= kbResistance) {
|
|
|
|
return 0.f;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (1.1f - 0.2f * mgr.GetActiveRandom()->Float()) * 2.f * (magnitude - kbResistance);
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CKnockBackController::DoKnockBackAnimation(const zeus::CVector3f& backVec, CStateManager& mgr, CPatterned& parent,
|
|
|
|
float magnitude) {
|
|
|
|
switch (x4_activeParms.x0_animState) {
|
|
|
|
case EKnockBackAnimationState::Hurled: {
|
|
|
|
float hurlVel = 5.f;
|
2020-04-16 05:26:14 +00:00
|
|
|
if (CHealthInfo* hInfo = parent.HealthInfo(mgr)) {
|
2018-12-08 05:30:43 +00:00
|
|
|
hurlVel += CalculateExtraHurlVelocity(mgr, magnitude, hInfo->GetKnockbackResistance());
|
2020-04-16 05:26:14 +00:00
|
|
|
}
|
2018-12-08 05:30:43 +00:00
|
|
|
hurlVel = std::sqrt(parent.GetGravityConstant() * 0.5f * hurlVel);
|
2020-04-17 17:12:17 +00:00
|
|
|
const zeus::CVector3f backUpVec = backVec + backVec.magnitude() * zeus::skUp;
|
2018-12-08 05:30:43 +00:00
|
|
|
if (backUpVec.canBeNormalized()) {
|
2019-08-14 14:58:54 +00:00
|
|
|
parent.GetBodyController()->GetCommandMgr().DeliverCmd(CBCHurledCmd(-backVec, backUpVec.normalized() * hurlVel));
|
2018-12-08 05:30:43 +00:00
|
|
|
parent.SetMomentumWR({0.f, 0.f, parent.GetGravityConstant() * -parent.GetMass()});
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
2018-12-08 05:30:43 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EKnockBackAnimationState::Fall: {
|
2019-08-14 14:58:54 +00:00
|
|
|
parent.GetBodyController()->GetCommandMgr().DeliverCmd(CBCKnockDownCmd(-backVec, x7c_severity));
|
2018-12-08 05:30:43 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EKnockBackAnimationState::KnockBack: {
|
2019-08-14 14:58:54 +00:00
|
|
|
parent.GetBodyController()->GetCommandMgr().DeliverCmd(CBCKnockBackCmd(-backVec, x7c_severity));
|
2018-12-08 05:30:43 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EKnockBackAnimationState::Flinch: {
|
2020-04-22 09:08:02 +00:00
|
|
|
const std::pair<float, s32> bestAnim = parent.GetBodyController()->GetPASDatabase().FindBestAnimation(
|
|
|
|
CPASAnimParmData(pas::EAnimationState::AdditiveFlinch), *mgr.GetActiveRandom(), -1);
|
2018-12-08 05:30:43 +00:00
|
|
|
if (bestAnim.first > 0.f) {
|
2019-08-14 14:58:54 +00:00
|
|
|
parent.GetModelData()->GetAnimationData()->AddAdditiveAnimation(bestAnim.second, 1.f, false, true);
|
2018-12-08 05:30:43 +00:00
|
|
|
x64_flinchRemTime =
|
2019-08-14 14:58:54 +00:00
|
|
|
std::max(parent.GetModelData()->GetAnimationData()->GetAnimationDuration(bestAnim.second), x64_flinchRemTime);
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
2018-12-08 05:30:43 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
|
|
|
|
2020-04-17 05:03:10 +00:00
|
|
|
void CKnockBackController::ResetKnockBackImpulse(const CPatterned& parent, const zeus::CVector3f& backVec,
|
|
|
|
float magnitude) {
|
2020-05-21 15:32:48 +00:00
|
|
|
if (!x81_24_autoResetImpulse || x4_activeParms.x0_animState != EKnockBackAnimationState::KnockBack ||
|
|
|
|
x4_activeParms.x4_animFollowup == EKnockBackAnimationFollowUp::Freeze) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
x50_impulseDir = backVec.canBeNormalized() ? backVec.normalized() : -parent.GetTransform().frontVector();
|
|
|
|
if (x60_impulseRemTime <= 0.f) {
|
|
|
|
x5c_impulseMag = magnitude;
|
|
|
|
} else {
|
|
|
|
x5c_impulseMag += magnitude * (1.f - x60_impulseRemTime / ImpulseDurationTable[x20_impulseDurationIdx]);
|
2018-12-08 05:30:43 +00:00
|
|
|
}
|
2020-05-21 15:32:48 +00:00
|
|
|
x60_impulseRemTime = ImpulseDurationTable[x20_impulseDurationIdx];
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CKnockBackController::DoDeferredKnockBack(CStateManager& mgr, CPatterned& parent) {
|
|
|
|
if (x14_deferWeaponType == EWeaponType::Wave) {
|
2020-04-12 15:53:15 +00:00
|
|
|
x4_activeParms = KnockBackParmsTable[size_t(x0_variant)][size_t(EKnockBackWeaponType::WaveComboedDirect)]
|
|
|
|
[size_t(GetKnockBackCharacterState(parent))];
|
2018-12-08 05:30:43 +00:00
|
|
|
ValidateState(parent);
|
2020-04-17 17:12:17 +00:00
|
|
|
if (parent.HealthInfo(mgr) != nullptr) {
|
|
|
|
const zeus::CVector3f backVec = -parent.GetTransform().basis[1];
|
2018-12-08 05:30:43 +00:00
|
|
|
DoKnockBackAnimation(backVec, mgr, parent, 10.f);
|
|
|
|
ResetKnockBackImpulse(parent, backVec, 2.f);
|
|
|
|
x82_25_inDeferredKnockBack = true;
|
2020-01-31 06:48:04 +00:00
|
|
|
parent.KnockBack(backVec, mgr, CDamageInfo(CWeaponMode{x14_deferWeaponType, false, true, false}, 0.f, 0.f, 10.f),
|
2020-05-21 15:32:48 +00:00
|
|
|
EKnockBackType::Direct, x82_25_inDeferredKnockBack, 10.f);
|
2018-12-08 05:30:43 +00:00
|
|
|
x82_25_inDeferredKnockBack = false;
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
2018-12-08 05:30:43 +00:00
|
|
|
}
|
|
|
|
x68_deferRemTime = 0.f;
|
|
|
|
x4_activeParms = KnockBackParms{};
|
|
|
|
x14_deferWeaponType = EWeaponType::None;
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CKnockBackController::sub80233d40(int i, float f1, float f2) {
|
2020-04-17 17:12:17 +00:00
|
|
|
if (i < 0 || i > 4) {
|
2018-12-08 05:30:43 +00:00
|
|
|
return;
|
2020-04-17 17:12:17 +00:00
|
|
|
}
|
2018-12-08 05:30:43 +00:00
|
|
|
x24_[i] = std::make_pair(f1, f2);
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CKnockBackController::SetAutoResetImpulse(bool b) {
|
|
|
|
x81_24_autoResetImpulse = b;
|
2020-04-17 17:12:17 +00:00
|
|
|
|
|
|
|
if (b) {
|
|
|
|
return;
|
2018-12-08 05:30:43 +00:00
|
|
|
}
|
2020-04-17 17:12:17 +00:00
|
|
|
|
|
|
|
x5c_impulseMag = 0.f;
|
|
|
|
x60_impulseRemTime = 0.f;
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CKnockBackController::Update(float dt, CStateManager& mgr, CPatterned& parent) {
|
|
|
|
ApplyImpulse(dt, parent);
|
|
|
|
x64_flinchRemTime -= dt;
|
2020-04-16 05:26:14 +00:00
|
|
|
if (TickDeferredTimer(dt)) {
|
2018-12-08 05:30:43 +00:00
|
|
|
DoDeferredKnockBack(mgr, parent);
|
2020-04-16 05:26:14 +00:00
|
|
|
}
|
|
|
|
if (x82_26_locomotionDuringElectrocution && parent.GetBodyController()->IsElectrocuting()) {
|
2019-08-14 14:58:54 +00:00
|
|
|
parent.GetBodyController()->GetCommandMgr().DeliverCmd(CBodyStateCmd(EBodyStateCmd::Locomotion));
|
2020-04-16 05:26:14 +00:00
|
|
|
}
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
EKnockBackWeaponType CKnockBackController::GetKnockBackWeaponType(const CDamageInfo& info, EWeaponType wType,
|
2018-12-08 05:30:43 +00:00
|
|
|
EKnockBackType type) {
|
|
|
|
int stacking = 0;
|
2020-04-16 05:26:14 +00:00
|
|
|
if (info.GetWeaponMode().IsCharged()) {
|
2018-12-08 05:30:43 +00:00
|
|
|
stacking = 1;
|
2020-04-16 05:26:14 +00:00
|
|
|
} else if (info.GetWeaponMode().IsComboed()) {
|
2018-12-08 05:30:43 +00:00
|
|
|
stacking = 2;
|
2020-04-16 05:26:14 +00:00
|
|
|
}
|
2020-04-17 17:12:17 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
switch (wType) {
|
|
|
|
case EWeaponType::Power:
|
2020-05-21 15:32:48 +00:00
|
|
|
return EKnockBackWeaponType(type != EKnockBackType::Radius ? stacking : stacking + 1);
|
2018-12-08 05:30:43 +00:00
|
|
|
case EWeaponType::Ice:
|
2020-05-21 15:32:48 +00:00
|
|
|
return EKnockBackWeaponType(type != EKnockBackType::Radius ? stacking + 8 : stacking + 9);
|
2018-12-08 05:30:43 +00:00
|
|
|
case EWeaponType::Wave:
|
|
|
|
return EKnockBackWeaponType(stacking + 4);
|
|
|
|
case EWeaponType::Plasma:
|
|
|
|
return EKnockBackWeaponType(stacking + 12);
|
|
|
|
case EWeaponType::Bomb:
|
|
|
|
return EKnockBackWeaponType::Bomb;
|
|
|
|
case EWeaponType::PowerBomb:
|
|
|
|
return EKnockBackWeaponType::PowerBomb;
|
|
|
|
case EWeaponType::Missile:
|
|
|
|
return EKnockBackWeaponType::Missile;
|
|
|
|
case EWeaponType::Phazon:
|
|
|
|
return EKnockBackWeaponType::Phazon;
|
|
|
|
default:
|
|
|
|
return EKnockBackWeaponType::Invalid;
|
|
|
|
}
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
|
|
|
|
2020-04-17 05:03:10 +00:00
|
|
|
void CKnockBackController::SelectDamageState(const CPatterned& parent, const CDamageInfo& info, EWeaponType wType,
|
2018-12-08 05:30:43 +00:00
|
|
|
EKnockBackType type) {
|
2020-04-16 05:26:14 +00:00
|
|
|
x4_activeParms = KnockBackParms();
|
2020-04-17 05:03:10 +00:00
|
|
|
|
|
|
|
const EKnockBackWeaponType weaponType = GetKnockBackWeaponType(info, wType, type);
|
|
|
|
if (weaponType == EKnockBackWeaponType::Invalid) {
|
|
|
|
return;
|
2018-12-08 05:30:43 +00:00
|
|
|
}
|
2020-04-17 05:03:10 +00:00
|
|
|
|
|
|
|
x4_activeParms =
|
|
|
|
KnockBackParmsTable[size_t(x0_variant)][size_t(weaponType)][size_t(GetKnockBackCharacterState(parent))];
|
|
|
|
ValidateState(parent);
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CKnockBackController::KnockBack(const zeus::CVector3f& backVec, CStateManager& mgr, CPatterned& parent,
|
2018-12-08 05:30:43 +00:00
|
|
|
const CDamageInfo& info, EKnockBackType type, float magnitude) {
|
2020-04-17 17:12:17 +00:00
|
|
|
if (x82_25_inDeferredKnockBack) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
zeus::CVector3f vec(backVec.toVec2f());
|
|
|
|
if (!vec.isMagnitudeSafe()) {
|
2020-05-21 15:32:48 +00:00
|
|
|
vec = -parent.GetTransform().frontVector();
|
2018-12-08 05:30:43 +00:00
|
|
|
}
|
2020-04-17 17:12:17 +00:00
|
|
|
|
|
|
|
SelectDamageState(parent, info, info.GetWeaponMode().GetType(), type);
|
|
|
|
DoKnockBackAnimation(vec, mgr, parent, magnitude);
|
|
|
|
ResetKnockBackImpulse(parent, vec, 2.f);
|
2018-11-05 06:12:53 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|