Fix Ranger's Rapid Fire and Multi Shot abilities not abiding by the new Arrow constructor. Arrows once again have the correct acceleration and can hit monsters. Fix bug with knockback being applied while the player has iframes. Fix bug with Slime King constantly applying knockback to the player due to no iframes. Release Build 9152.

mac-build
sigonasr2 7 months ago
parent aa9c818773
commit aaaf10f6fc
  1. 6
      Adventures in Lestoria/Player.cpp
  2. 2
      Adventures in Lestoria/Ranger.cpp
  3. 6
      Adventures in Lestoria/SlimeKing.cpp
  4. 2
      Adventures in Lestoria/Version.h
  5. 4
      Adventures in Lestoria/assets/config/Monsters.txt
  6. BIN
      x64/Release/Adventures in Lestoria.exe

@ -305,7 +305,9 @@ State::State Player::GetState(){
}
void Player::Knockback(vf2d vel){
this->vel+=vel;
if(!HasIframes()){
this->vel+=vel;
}
}
void Player::Update(float fElapsedTime){
@ -678,7 +680,7 @@ void Player::Update(float fElapsedTime){
vf2d extendedLine=pointTowardsCursor.upoint(1.1f);
float angleToCursor=atan2(extendedLine.y-GetPos().y,extendedLine.x-GetPos().x);
attack_cooldown_timer=ARROW_ATTACK_COOLDOWN;
BULLET_LIST.push_back(std::make_unique<Arrow>(Arrow(GetPos(),extendedLine,vf2d{cos(angleToCursor)*"Ranger.Ability 1.ArrowSpd"_F,float(sin(angleToCursor)*"Ranger.Ability 1.ArrowSpd"_F-PI/8*"Ranger.Ability 1.ArrowSpd"_F)}+movementVelocity/1.5f,12*"Ranger.Ability 1.ArrowRadius"_F/100,int(GetAttack()*"Ranger.Ability 1.DamageMult"_F),OnUpperLevel(),true)));
BULLET_LIST.push_back(std::make_unique<Arrow>(Arrow(GetPos(),extendedLine,vf2d{cos(angleToCursor)*"Ranger.Ability 1.ArrowSpd"_F,float(sin(angleToCursor)*"Ranger.Ability 1.ArrowSpd"_F-PI/8*"Ranger.Ability 1.ArrowSpd"_F)}+movementVelocity/1.5f,PI/2*"Ranger.Auto Attack.ArrowSpd"_F,12*"Ranger.Ability 1.ArrowRadius"_F/100,int(GetAttack()*"Ranger.Ability 1.DamageMult"_F),OnUpperLevel(),true)));
SetAnimationBasedOnTargetingDirection(angleToCursor);
rapidFireTimer=RAPID_FIRE_SHOOT_DELAY;
}else{

@ -139,7 +139,7 @@ void Ranger::InitializeClassAbilities(){
const float newAngle=shootingAngle+leftAngle/2+i*increment;
geom2d::line pointTowardsCursor=geom2d::line(p->GetPos(),p->GetPos()+vf2d{cos(newAngle),sin(newAngle)}*shootingDist);
vf2d extendedLine=pointTowardsCursor.upoint(1.1f);
BULLET_LIST.push_back(std::make_unique<Arrow>(Arrow(p->GetPos(),extendedLine,vf2d{cos(newAngle)*"Ranger.Ability 3.ArrowSpd"_F,float(sin(newAngle)*"Ranger.Ability 3.ArrowSpd"_F-PI/8*"Ranger.Ability 3.ArrowSpd"_F)}+p->movementVelocity,12*"Ranger.Ability 3.ArrowRadius"_F/100,int(p->GetAttack()*"Ranger.Ability 3.DamageMult"_F),p->OnUpperLevel(),true)));
BULLET_LIST.push_back(std::make_unique<Arrow>(Arrow(p->GetPos(),extendedLine,vf2d{cos(newAngle)*"Ranger.Ability 3.ArrowSpd"_F,float(sin(newAngle)*"Ranger.Ability 3.ArrowSpd"_F-PI/8*"Ranger.Ability 3.ArrowSpd"_F)}+p->movementVelocity,PI/2*"Ranger.Auto Attack.ArrowSpd"_F,12*"Ranger.Ability 3.ArrowRadius"_F/100,int(p->GetAttack()*"Ranger.Ability 3.DamageMult"_F),p->OnUpperLevel(),true)));
}
p->rangerShootAnimationTimer=0.3f;
p->SetState(State::SHOOT_ARROW);

@ -211,8 +211,10 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat
lineToPlayer={m.GetPos(),m.GetPos()+vf2d{cos(randomDir),sin(randomDir)}*1};
}
game->GetPlayer()->Knockback(lineToPlayer.vector().norm()*float(ConfigInt("JumpKnockbackFactor")));
if(m.phase!=2){ //In phase 2, the player can get slammed multiple times. No iframes for messing up.
game->GetPlayer()->SetIframes(1);
if(m.phase!=2){
game->GetPlayer()->SetIframes(1.f);
}else{ //In phase 2 you can get hit by multiple knockbacks, so the iframe time is a lot shorter.
game->GetPlayer()->SetIframes(0.2f);
}
}
m.SetZ(0);

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define VERSION_PATCH 0
#define VERSION_BUILD 9146
#define VERSION_BUILD 9153
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -68,7 +68,7 @@ Monsters
# The First Four animations must represent a standing, walking, attack, and death animation. Their names are up to the creator.
IDLE = 10, 0.1, Repeat
JUMP = 10, 0.06, Repeat
SHOOT = 10, 0.1, OneShot
SHOOT = 10, 0.1, Repeat
DEATH = 10, 0.1, OneShot
}
@ -197,7 +197,7 @@ Monsters
# The First Four animations must represent a standing, walking, attack, and death animation. Their names are up to the creator.
IDLE = 7, 0.1, PingPong
JUMP = 1, 0.1, OneShot
SHOOT = 5, 0.1, OneShot
SHOOT = 5, 0.1, Repeat
DEATH = 5, 0.2, OneShot
}

Loading…
Cancel
Save