Implemented Stealthy Retreat enchant. Release Build 10803.
This commit is contained in:
parent
78956e986c
commit
8ac625660d
@ -524,5 +524,21 @@ namespace EnchantTests
|
||||
}
|
||||
Assert::AreEqual(0.f,player->GetAutoAttackTimer(),L"The auto attack timer should have been reset at some point.");
|
||||
}
|
||||
TEST_METHOD(StealthyRetreatCheck){
|
||||
game->ChangePlayerClass(RANGER);
|
||||
player=game->GetPlayer();
|
||||
testKey->bHeld=true; //Force the key to be held down for testing purposes.
|
||||
player->CheckAndPerformAbility(player->GetRightClickAbility(),testKeyboardInput);
|
||||
Assert::AreEqual("Ranger.Right Click Ability.RetreatTime"_F,player->GetIframeTime(),L"Ranger's retreat iframe time is normal.");
|
||||
player->_SetIframes(0.f);
|
||||
player->GetRightClickAbility().cooldown=0.f;
|
||||
player->SetState(State::NORMAL);
|
||||
std::weak_ptr<Item>nullRing{Inventory::AddItem("Null Ring"s)};
|
||||
Inventory::EquipItem(nullRing,EquipSlot::RING1);
|
||||
nullRing.lock()->EnchantItem("Stealthy Retreat");
|
||||
player->CheckAndPerformAbility(player->GetRightClickAbility(),testKeyboardInput);
|
||||
Assert::AreEqual("Ranger.Right Click Ability.RetreatTime"_F+"Stealthy Retreat"_ENC["INVULNERABILITY INCREASE"],player->GetIframeTime(),L"Ranger's retreat iframe time is much greater.");
|
||||
|
||||
}
|
||||
};
|
||||
}
|
@ -87,7 +87,14 @@ void Ranger::InitializeClassAbilities(){
|
||||
float velocity=(0.5f*-p->friction*p->RETREAT_TIME*p->RETREAT_TIME-p->RETREAT_DISTANCE)/-p->RETREAT_TIME; //Derived from kinetic motion formula.
|
||||
p->SetVelocity(mouseDir.vector().norm()*velocity);
|
||||
p->retreatTimer=p->RETREAT_TIME;
|
||||
p->ApplyIframes(p->RETREAT_TIME);
|
||||
|
||||
float finalIframeTime{p->RETREAT_TIME};
|
||||
if(p->HasEnchant("Stealthy Retreat")){
|
||||
finalIframeTime+="Stealthy Retreat"_ENC["INVULNERABILITY INCREASE"];
|
||||
game->ShowDamageVignetteOverlay("Item Enchants.Class Enchants.Ranger.Stealthy Retreat.VIGNETTE COLOR"_Pixel);
|
||||
}
|
||||
|
||||
p->ApplyIframes(finalIframeTime);
|
||||
p->ghostPositions.push_back(p->GetPos()+vf2d{0,-p->GetZ()});
|
||||
p->ghostFrameTimer=p->RETREAT_GHOST_FRAME_DELAY;
|
||||
p->ghostRemoveTimer=p->RETREAT_GHOST_FRAMES*p->RETREAT_GHOST_FRAME_DELAY;
|
||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 2
|
||||
#define VERSION_PATCH 3
|
||||
#define VERSION_BUILD 10801
|
||||
#define VERSION_BUILD 10803
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
@ -89,6 +89,7 @@ Item Enchants
|
||||
Affects = Right Click Ability
|
||||
|
||||
INVULNERABILITY INCREASE = 2.0s
|
||||
VIGNETTE COLOR = 0r, 0g, 64b, 255a
|
||||
|
||||
# Stat, Lowest, Highest Value
|
||||
# Stat Modifier[0] = ..., 0, 0
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user