Add in edge case so movement targeting direction while standing still for Deadly Dash will still work for controllers. Fix bug with Releasing spell key required for precast spells with target indicators, now activate immediately on press. Release Build 10164.

This commit is contained in:
sigonasr2 2024-07-19 09:00:22 -05:00
parent 747c9bbffe
commit 5e6f46b85a
6 changed files with 11 additions and 13 deletions

View File

@ -43,11 +43,9 @@ INCLUDE_game
PrecastData::PrecastData() PrecastData::PrecastData()
:castTime(0),range(0),size(0){}; :castTime(0),range(0),size(0){};
PrecastData::PrecastData(float castTime) PrecastData::PrecastData(float castTime)
:castTime(castTime),range(0),size(0){precastTargetingRequired=true;}; :castTime(castTime),range(0),size(0),precastTargetingRequired(castTime>0){};
PrecastData::PrecastData(float castTime,float range,float size) PrecastData::PrecastData(float castTime,float range,float size)
:castTime(castTime),range(range),size(size){ :castTime(castTime),range(range),size(size),precastTargetingRequired(range>0||castTime>0){};
if(range>0||castTime>0)precastTargetingRequired=true;
};
InputGroup Ability::DEFAULT; InputGroup Ability::DEFAULT;

View File

@ -504,8 +504,8 @@ void Player::Update(float fElapsedTime){
SetAdditiveBlending(!IsUsingAdditiveBlending()); SetAdditiveBlending(!IsUsingAdditiveBlending());
} }
if(deadlyDashAfterDashTimer<=0.f){ if(deadlyDashAfterDashTimer<=0.f){
geom2d::line mouseDir{GetPos(),GetWorldAimingLocation()}; geom2d::line mouseDir{GetPos(),GetWorldAimingLocation(Player::USE_WALK_DIR)};
vf2d clampedMousePolarDir{util::pointTo(GetPos(),GetWorldAimingLocation()).polar()}; vf2d clampedMousePolarDir{util::pointTo(GetPos(),GetWorldAimingLocation(Player::USE_WALK_DIR)).polar()};
clampedMousePolarDir.x=std::clamp(mouseDir.length(),24.f,"Thief.Ability 2.Range"_F*24.f/100); clampedMousePolarDir.x=std::clamp(mouseDir.length(),24.f,"Thief.Ability 2.Range"_F*24.f/100);
const vf2d originalPos{GetPos()}; const vf2d originalPos{GetPos()};
@ -776,7 +776,8 @@ vf2d Player::GetVelocity(){
} }
bool Player::CanMove(){ bool Player::CanMove(){
return knockUpTimer==0.f&&state!=State::ANIMATION_LOCK&&state!=State::DEADLYDASH&&(state!=State::CASTING||(castInfo.castTotalTime-castInfo.castTimer>0.2f)); const bool DeadlyDashExpiringOnThisFrame{deadlyDashAfterDashTimer-game->GetElapsedTime()<=0.f};
return knockUpTimer==0.f&&state!=State::ANIMATION_LOCK&&(DeadlyDashExpiringOnThisFrame||state!=State::DEADLYDASH)&&(state!=State::CASTING||(castInfo.castTotalTime-castInfo.castTimer>0.2f));
} }
bool Player::CanAct(){ bool Player::CanAct(){
@ -1050,7 +1051,7 @@ bool Player::CanPathfindTo(vf2d pos,vf2d targetPos,float range){
void Player::PrepareCast(Ability&ability){ void Player::PrepareCast(Ability&ability){
castPrepAbility=&ability; castPrepAbility=&ability;
if(ability.precastInfo.castTime>0||ability.precastInfo.range>0){ if(ability.precastInfo.range>0){
SetState(State::PREP_CAST); SetState(State::PREP_CAST);
}else{ }else{
CastSpell(ability); CastSpell(ability);
@ -1646,8 +1647,7 @@ void Player::CheckAndPerformAbility(Ability&ability,InputGroup key){
CancelCast(); CancelCast();
ConsumeMana(ability.manaCost); ConsumeMana(ability.manaCost);
}else }else
if(ability.precastInfo.precastTargetingRequired&&GetState()==State::NORMAL if(ability.precastInfo.precastTargetingRequired&&GetState()==State::NORMAL&&HasEnoughOfItem){
&&HasEnoughOfItem){
PrepareCast(ability); PrepareCast(ability);
} }
} }

View File

@ -21,7 +21,7 @@ Add rectangular hitbox posssibility to the game for monsters. (specifically for
DEMO DEMO
==== ====
Enable weapons for the new classes in the weapons crafting menu. Add Unit Test for Attack Speed Reduction stat.
PGETinker notes PGETinker notes
=============== ===============

View File

@ -109,7 +109,7 @@ void Thief::InitializeClassAbilities(){
p->SetState(State::ROLL); p->SetState(State::ROLL);
p->rolling_timer="Thief.Right Click Ability.Roll Time"_F; 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); p->AddBuff(BuffType::SPEEDBOOST,"Thief.Right Click Ability.Movespeed Buff"_f[1],"Thief.Right Click Ability.Movespeed Buff"_f[0]/100.f);
geom2d::line mouseDir{p->GetPos(),p->GetWorldAimingLocation(Player::USE_WALK_DIR)}; 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. 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.
p->SetVelocity(mouseDir.vector().norm()*velocity); p->SetVelocity(mouseDir.vector().norm()*velocity);
p->ApplyIframes("Thief.Right Click Ability.Iframe Time"_F); p->ApplyIframes("Thief.Right Click Ability.Iframe Time"_F);

View File

@ -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 10153 #define VERSION_BUILD 10164
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a