Implemented Improved Ground Slam Enchant.
This commit is contained in:
parent
97453baf61
commit
ea752c14c6
@ -1028,5 +1028,30 @@ namespace EnchantTests
|
|||||||
game->OnUserUpdate(8.f);
|
game->OnUserUpdate(8.f);
|
||||||
Assert::AreEqual(1.5f,player->GetAttackRange(),L"Attack range of Warrior is normal again.");
|
Assert::AreEqual(1.5f,player->GetAttackRange(),L"Attack range of Warrior is normal again.");
|
||||||
}
|
}
|
||||||
|
TEST_METHOD(ImprovedGroundSlamNoEnchantCheck){
|
||||||
|
testKey->bHeld=true; //Force the key to be held down for testing purposes.
|
||||||
|
player->CheckAndPerformAbility(player->GetAbility2(),testKeyboardInput);
|
||||||
|
Monster&newMonster{game->SpawnMonster({},MONSTER_DATA["TestName"])};
|
||||||
|
game->OnUserUpdate(0.f);
|
||||||
|
game->SetElapsedTime(1.f);
|
||||||
|
game->OnUserUpdate(1.f);
|
||||||
|
game->OnUserUpdate(0.f);
|
||||||
|
Assert::AreEqual(975,newMonster.GetHealth(),L"Monsters take normal damage from Ground Slam.");
|
||||||
|
}
|
||||||
|
TEST_METHOD(ImprovedGroundSlamEnchantCheck){
|
||||||
|
testKey->bHeld=true; //Force the key to be held down for testing purposes.
|
||||||
|
std::weak_ptr<Item>nullRing{Inventory::AddItem("Null Ring"s)};
|
||||||
|
std::weak_ptr<Item>leatherArmor{Inventory::AddItem("Leather Armor"s)};
|
||||||
|
Inventory::EquipItem(nullRing,EquipSlot::RING1);
|
||||||
|
Inventory::EquipItem(leatherArmor,EquipSlot::ARMOR);
|
||||||
|
nullRing.lock()->EnchantItem("Improved Ground Slam");
|
||||||
|
player->CheckAndPerformAbility(player->GetAbility2(),testKeyboardInput);
|
||||||
|
Monster&newMonster{game->SpawnMonster({},MONSTER_DATA["TestName"])};
|
||||||
|
game->OnUserUpdate(0.f);
|
||||||
|
game->SetElapsedTime(1.f);
|
||||||
|
game->OnUserUpdate(1.f);
|
||||||
|
game->OnUserUpdate(0.f);
|
||||||
|
Assert::AreEqual(973,newMonster.GetHealth(),L"Monsters take extra damage from defense from Improved Ground Slam.");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -465,7 +465,15 @@ void Player::Update(float fElapsedTime){
|
|||||||
spin_angle=0;
|
spin_angle=0;
|
||||||
z=0;
|
z=0;
|
||||||
float numb=4;
|
float numb=4;
|
||||||
const HurtList&hitEnemies=game->Hurt(pos,"Warrior.Ability 2.Range"_F/100*12,int(GetAttack()*"Warrior.Ability 2.DamageMult"_F),OnUpperLevel(),0,HurtType::MONSTER,HurtFlag::PLAYER_ABILITY);
|
float groundSlamVisualRange{"Warrior.Ability 2.Range"_F/300*1.33f};
|
||||||
|
float groundSlamRange{"Warrior.Ability 2.Range"_F/100*12};
|
||||||
|
int groundSlamDamage{int(GetAttack()*"Warrior.Ability 2.DamageMult"_F)};
|
||||||
|
if(HasEnchant("Improved Ground Slam")){
|
||||||
|
groundSlamVisualRange+=groundSlamVisualRange*"Improved Ground Slam"_ENC["GROUND SLAM RADIUS INCREASE"]/100.f;
|
||||||
|
groundSlamRange+=groundSlamRange*"Improved Ground Slam"_ENC["GROUND SLAM RADIUS INCREASE"]/100.f;
|
||||||
|
groundSlamDamage+=GetDefense()*"Improved Ground Slam"_ENC["DEFENSE DAMAGE"]/100.f;
|
||||||
|
}
|
||||||
|
const HurtList&hitEnemies=game->Hurt(pos,groundSlamRange,groundSlamDamage,OnUpperLevel(),0,HurtType::MONSTER,HurtFlag::PLAYER_ABILITY);
|
||||||
#pragma region Knockback effect
|
#pragma region Knockback effect
|
||||||
for(auto&[targetPtr,wasHurt]:hitEnemies){
|
for(auto&[targetPtr,wasHurt]:hitEnemies){
|
||||||
if(!std::holds_alternative<Monster*>(targetPtr))ERR("WARNING! A hurt request list was expecting only monster pointers, but got another type instead! THIS SHOULD NOT BE HAPPENING!");
|
if(!std::holds_alternative<Monster*>(targetPtr))ERR("WARNING! A hurt request list was expecting only monster pointers, but got another type instead! THIS SHOULD NOT BE HAPPENING!");
|
||||||
@ -483,7 +491,7 @@ void Player::Update(float fElapsedTime){
|
|||||||
monsterPtr->Knockback(vf2d{knockbackAmt,knockbackDir}.cart());
|
monsterPtr->Knockback(vf2d{knockbackAmt,knockbackDir}.cart());
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
game->AddEffect(std::make_unique<Effect>(GetPos(),"Warrior.Ability 2.EffectLifetime"_F,"ground-slam-attack-front.png",upperLevel,"Warrior.Ability 2.Range"_F/300*1.33f,"Warrior.Ability 2.EffectFadetime"_F),std::make_unique<Effect>(GetPos(),"Warrior.Ability 2.EffectLifetime"_F,"ground-slam-attack-back.png",upperLevel,"Warrior.Ability 2.Range"_F/300*1.33f,"Warrior.Ability 2.EffectFadetime"_F));
|
game->AddEffect(std::make_unique<Effect>(GetPos(),"Warrior.Ability 2.EffectLifetime"_F,"ground-slam-attack-front.png",upperLevel,groundSlamVisualRange,"Warrior.Ability 2.EffectFadetime"_F),std::make_unique<Effect>(GetPos(),"Warrior.Ability 2.EffectLifetime"_F,"ground-slam-attack-back.png",upperLevel,groundSlamVisualRange,"Warrior.Ability 2.EffectFadetime"_F));
|
||||||
SoundEffect::PlaySFX("Warrior Ground Slam",SoundEffect::CENTERED);
|
SoundEffect::PlaySFX("Warrior Ground Slam",SoundEffect::CENTERED);
|
||||||
}
|
}
|
||||||
if(lastAnimationFlip>0){
|
if(lastAnimationFlip>0){
|
||||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
|||||||
#define VERSION_MAJOR 1
|
#define VERSION_MAJOR 1
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_PATCH 3
|
#define VERSION_PATCH 3
|
||||||
#define VERSION_BUILD 11048
|
#define VERSION_BUILD 11050
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user