Tumble enchant implemented. Release Build 10947.
This commit is contained in:
parent
6cbcbdb6b4
commit
2d3dbfac3c
@ -624,5 +624,27 @@ namespace EnchantTests
|
||||
testMonster.Hurt(10,testMonster.OnUpperLevel(),testMonster.GetZ(),HurtFlag::PLAYER_ABILITY);
|
||||
Assert::AreEqual(6,testMonster.GetHealth(),L"Monster should have taken 14 hitpoints of damage with the backstab bonus successfully applied.");
|
||||
}
|
||||
TEST_METHOD(TumbleCheck){
|
||||
testKey->bHeld=true; //Force the key to be held down for testing purposes.
|
||||
game->ChangePlayerClass(THIEF);
|
||||
player=game->GetPlayer();
|
||||
player->CheckAndPerformAbility(player->GetRightClickAbility(),testKeyboardInput);
|
||||
|
||||
const float originalIframeTime{"Thief.Right Click Ability.Iframe Time"_F};
|
||||
|
||||
Assert::AreEqual(originalIframeTime,player->GetIframeTime(),L"Iframe time should be normal.");
|
||||
|
||||
const float originalMovespdIntensity{"Thief.Right Click Ability.Movespeed Buff"_f[0]/100.f};
|
||||
|
||||
Assert::AreEqual(originalMovespdIntensity,player->GetBuffs(BuffType::SPEEDBOOST)[0].intensity,L"Player should have a movespeed buff of the regular intensity.");
|
||||
player->RemoveAllBuffs();
|
||||
player->GetRightClickAbility().charges=1;
|
||||
std::weak_ptr<Item>nullRing{Inventory::AddItem("Null Ring"s)};
|
||||
Inventory::EquipItem(nullRing,EquipSlot::RING1);
|
||||
nullRing.lock()->EnchantItem("Tumble");
|
||||
player->CheckAndPerformAbility(player->GetRightClickAbility(),testKeyboardInput);
|
||||
Assert::AreEqual(originalIframeTime+"Thief.Right Click Ability.Iframe Time"_F*"Tumble"_ENC["BOOST PERCENTAGE"]/100.f,player->GetIframeTime(),L"Iframe time should be longer.");
|
||||
Assert::AreEqual(originalMovespdIntensity+originalMovespdIntensity*"Tumble"_ENC["BOOST PERCENTAGE"]/100.f,player->GetBuffs(BuffType::SPEEDBOOST)[0].intensity,L"Player should have a movespeed buff with greater intensity.");
|
||||
}
|
||||
};
|
||||
}
|
@ -109,11 +109,26 @@ void Thief::InitializeClassAbilities(){
|
||||
[](Player*p,vf2d pos={}){
|
||||
p->SetState(State::ROLL);
|
||||
p->rolling_timer="Thief.Right Click Ability.Roll Time"_F;
|
||||
p->AddBuff(BuffType::SPEEDBOOST,"Thief.Right Click Ability.Movespeed Buff"_f[1],"Thief.Right Click Ability.Movespeed Buff"_f[0]/100.f);
|
||||
|
||||
const float originalRollIntensity{"Thief.Right Click Ability.Movespeed Buff"_f[0]/100.f};
|
||||
float rollIntensity{originalRollIntensity};
|
||||
if(p->HasEnchant("Tumble"))rollIntensity+=originalRollIntensity*("Tumble"_ENC["BOOST PERCENTAGE"]/100.f);
|
||||
|
||||
p->AddBuff(BuffType::SPEEDBOOST,"Thief.Right Click Ability.Movespeed Buff"_f[1],rollIntensity);
|
||||
geom2d::line mouseDir{p->GetPos(),p->GetWorldAimingLocation(Player::USE_WALK_DIR,Player::INVERTED)};
|
||||
float velocity=(0.5f*-p->friction*"Thief.Right Click Ability.Roll Time"_F*"Thief.Right Click Ability.Roll Time"_F-std::clamp(mouseDir.length(),24.f,24.f*"Thief.Right Click Ability.Max Roll Range"_F/100))/-"Thief.Right Click Ability.Roll Time"_F; //Derived from kinetic motion formula.
|
||||
|
||||
const float originalRollRange{"Thief.Right Click Ability.Max Roll Range"_F/100};
|
||||
float rollRange{originalRollRange};
|
||||
if(p->HasEnchant("Tumble"))rollRange+=originalRollRange*("Tumble"_ENC["BOOST PERCENTAGE"]/100.f);
|
||||
|
||||
float velocity=(0.5f*-p->friction*"Thief.Right Click Ability.Roll Time"_F*"Thief.Right Click Ability.Roll Time"_F-std::clamp(mouseDir.length(),24.f,24.f*rollRange))/-"Thief.Right Click Ability.Roll Time"_F; //Derived from kinetic motion formula.
|
||||
p->SetVelocity(mouseDir.vector().norm()*velocity);
|
||||
p->ApplyIframes("Thief.Right Click Ability.Iframe Time"_F);
|
||||
|
||||
const float originalIframeTime{"Thief.Right Click Ability.Iframe Time"_F};
|
||||
float iframeTime{originalIframeTime};
|
||||
if(p->HasEnchant("Tumble"))iframeTime+=originalIframeTime*"Tumble"_ENC["BOOST PERCENTAGE"]/100.f;
|
||||
|
||||
p->ApplyIframes(iframeTime);
|
||||
p->footstepTimer=0.f;
|
||||
return true;
|
||||
};
|
||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 2
|
||||
#define VERSION_PATCH 3
|
||||
#define VERSION_BUILD 10944
|
||||
#define VERSION_BUILD 10947
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user