Fix Issue #74. Falling Bullet properly activates side effect instead of randomly choosing to due to order of IBullet vs child class call updates. Update credits with Special Thanks section. Release Build 11970.

master
sigonasr2 1 month ago
parent dc9717c07f
commit 0d15ad2fa7
  1. 4
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 1
      Adventures in Lestoria/BulletTypes.h
  3. 11
      Adventures in Lestoria/FallingBullet.cpp
  4. 3
      Adventures in Lestoria/Player.cpp
  5. 2
      Adventures in Lestoria/Version.h
  6. 2
      Adventures in Lestoria/assets/config/MonsterStrategies.txt
  7. 44
      Adventures in Lestoria/assets/config/credits.txt
  8. BIN
      x64/Release/Adventures in Lestoria.exe

@ -927,9 +927,11 @@ void AiL::ProximityKnockback(const vf2d pos,const float radius,const float knock
} }
} }
if(CheckForPlayerCollisions){ if(CheckForPlayerCollisions){
LOG(std::format("Checking for player collision: {} {} {} {}",pos.str(),radius,GetPlayer()->GetPos().str(),12*GetPlayer()->GetSizeMult()));
if(geom2d::overlaps(geom2d::circle(pos,radius),geom2d::circle(GetPlayer()->GetPos(),12*GetPlayer()->GetSizeMult()))){ if(geom2d::overlaps(geom2d::circle(pos,radius),geom2d::circle(GetPlayer()->GetPos(),12*GetPlayer()->GetSizeMult()))){
LOG("Player collision succeeded.");
GetPlayer()->ProximityKnockback(pos,knockbackAmt); GetPlayer()->ProximityKnockback(pos,knockbackAmt);
} }else LOG("Player collision failed.");
} }
} }

@ -295,6 +295,7 @@ private:
SpellCircle indicator; SpellCircle indicator;
const float knockbackAmt; const float knockbackAmt;
float lastTrailEffect{}; float lastTrailEffect{};
const float collisionRadius{};
}; };
//While not a bullet directly, the DeadlyDash class generates a bunch of afterimages and collision checks. //While not a bullet directly, the DeadlyDash class generates a bunch of afterimages and collision checks.

@ -46,7 +46,7 @@ All rights reserved.
INCLUDE_game INCLUDE_game
FallingBullet::FallingBullet(const std::string&imgName,vf2d targetPos,vf2d vel,float zVel,float indicatorDisplayTime,float radius,int damage,bool upperLevel,bool hitsMultiple,float knockbackAmt,float lifetime,bool friendly,Pixel spellCircleCol,vf2d scale,float image_angle,float spellCircleRotation,float spellCircleRotationSpd,Pixel insigniaCol,float insigniaRotation,float insigniaRotationSpd) FallingBullet::FallingBullet(const std::string&imgName,vf2d targetPos,vf2d vel,float zVel,float indicatorDisplayTime,float radius,int damage,bool upperLevel,bool hitsMultiple,float knockbackAmt,float lifetime,bool friendly,Pixel spellCircleCol,vf2d scale,float image_angle,float spellCircleRotation,float spellCircleRotationSpd,Pixel insigniaCol,float insigniaRotation,float insigniaRotationSpd)
:Bullet(targetPos,vel,radius,damage,imgName,upperLevel,false,lifetime+0.1f,false,friendly,WHITE,scale,image_angle),targetPos(targetPos),zVel(zVel),indicatorDisplayTime(indicatorDisplayTime),knockbackAmt(knockbackAmt), :Bullet(targetPos,vel,0.f,damage,imgName,upperLevel,false,lifetime+0.1f,false,friendly,WHITE,scale,image_angle),targetPos(targetPos),zVel(zVel),indicatorDisplayTime(indicatorDisplayTime),knockbackAmt(knockbackAmt),collisionRadius(radius),
indicator(targetPos,lifetime+0.1f,"range_indicator.png","spell_insignia.png",upperLevel,radius/12.f,0.5f,{},spellCircleCol,spellCircleRotation,spellCircleRotationSpd,false,radius/12.f,0.f,{},insigniaCol,insigniaRotation,insigniaRotationSpd,false){ indicator(targetPos,lifetime+0.1f,"range_indicator.png","spell_insignia.png",upperLevel,radius/12.f,0.5f,{},spellCircleCol,spellCircleRotation,spellCircleRotationSpd,false,radius/12.f,0.f,{},insigniaCol,insigniaRotation,insigniaRotationSpd,false){
pos+=-vel*lifetime; pos+=-vel*lifetime;
z=-zVel*lifetime; z=-zVel*lifetime;
@ -62,16 +62,15 @@ void FallingBullet::Update(float fElapsedTime){
fadeOutTime=0.5f; fadeOutTime=0.5f;
SoundEffect::PlaySFX("Stone Land",pos); SoundEffect::PlaySFX("Stone Land",pos);
if(friendly){ if(friendly){
for(auto&[monsterPtr,hurt]:game->Hurt(pos,radius,damage,OnUpperLevel(),z,HurtType::MONSTER)){ for(auto&[monsterPtr,hurt]:game->Hurt(pos,collisionRadius,damage,OnUpperLevel(),z,HurtType::MONSTER)){
if(hurt)std::get<Monster*>(monsterPtr)->ApplyIframes(0.1f); if(hurt)std::get<Monster*>(monsterPtr)->ApplyIframes(0.1f);
} }
} }else{
else{ for(auto&[playerPtr,hurt]:game->Hurt(pos,collisionRadius,damage,OnUpperLevel(),z,HurtType::PLAYER)){
for(auto&[playerPtr,hurt]:game->Hurt(pos,radius,damage,OnUpperLevel(),z,HurtType::PLAYER)){
if(hurt)std::get<Player*>(playerPtr)->ApplyIframes(0.1f); if(hurt)std::get<Player*>(playerPtr)->ApplyIframes(0.1f);
} }
} }
game->ProximityKnockback(pos,radius,knockbackAmt,HurtType::PLAYER|HurtType::MONSTER); game->ProximityKnockback(pos,collisionRadius,knockbackAmt,HurtType::PLAYER|HurtType::MONSTER);
for(int i:std::ranges::iota_view(0,30))game->AddEffect(std::make_unique<Effect>(pos-vf2d{0.f,GetZ()},util::random_range(0.05f,0.2f),"circle_outline.png",OnUpperLevel(),util::random_range(0.5f,1.f),0.2f,vf2d{util::random_range(-10.f,10.f),util::random_range(-3.f,0.f)},PixelLerp(BLACK,col,util::random(1.f)),0.f,0.f,true)); for(int i:std::ranges::iota_view(0,30))game->AddEffect(std::make_unique<Effect>(pos-vf2d{0.f,GetZ()},util::random_range(0.05f,0.2f),"circle_outline.png",OnUpperLevel(),util::random_range(0.5f,1.f),0.2f,vf2d{util::random_range(-10.f,10.f),util::random_range(-3.f,0.f)},PixelLerp(BLACK,col,util::random(1.f)),0.f,0.f,true));
Deactivate(); Deactivate();
} }

@ -683,6 +683,7 @@ void Player::Update(float fElapsedTime){
float newX=pos.x+totalVel.x*fElapsedTime; float newX=pos.x+totalVel.x*fElapsedTime;
float newY=pos.y+totalVel.y*fElapsedTime; float newY=pos.y+totalVel.y*fElapsedTime;
MoveFlag::MoveFlag flag{MoveFlag::NONE}; MoveFlag::MoveFlag flag{MoveFlag::NONE};
LOG(std::format("Vel is currently: {}",totalVel.str()));
if(vel==vf2d{})flag=MoveFlag::PREVENT_CAST_CANCELLING; //This means added velocity is the only thing affecting movement, we don't stop casting for additional velocity actors. if(vel==vf2d{})flag=MoveFlag::PREVENT_CAST_CANCELLING; //This means added velocity is the only thing affecting movement, we don't stop casting for additional velocity actors.
SetX(newX,flag); SetX(newX,flag);
SetY(newY,flag); SetY(newY,flag);
@ -1918,7 +1919,7 @@ void Player::ProximityKnockback(const vf2d centerPoint,const float knockbackFact
float dist=lineToPlayer.length(); float dist=lineToPlayer.length();
if(dist<0.001f){ if(dist<0.001f){
float randomDir=util::random(2*PI); float randomDir=util::random(2*PI);
lineToPlayer={centerPoint,centerPoint+vf2d{cos(randomDir),sin(randomDir)}*1}; lineToPlayer={centerPoint,centerPoint+vf2d{cos(randomDir),sin(randomDir)}*knockbackFactor};
} }
game->GetPlayer()->Knockback(lineToPlayer.vector().norm()*knockbackFactor); game->GetPlayer()->Knockback(lineToPlayer.vector().norm()*knockbackFactor);
} }

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 3 #define VERSION_MINOR 3
#define VERSION_PATCH 0 #define VERSION_PATCH 0
#define VERSION_BUILD 11958 #define VERSION_BUILD 11970
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

@ -1302,7 +1302,7 @@ MonsterStrategy
{ {
# 0 = Normal Cannon Shot, 1 = Silence, 2 = Shrapnel Shot # 0 = Normal Cannon Shot, 1 = Silence, 2 = Shrapnel Shot
# Repeats at end of cycle. # Repeats at end of cycle.
Cannon Cycle = 0,0,0,0,0,0,0,0,1,2,1 Cannon Cycle = 0
Cannon Shot Delay = 0.4s Cannon Shot Delay = 0.4s
Cannon Shot Impact Time = 2.5s Cannon Shot Impact Time = 2.5s

@ -65,21 +65,33 @@ Credits
LINE[62]="Gull sounds by Jonathon Jongsma https://www.xeno-canto.org/75111" LINE[62]="Gull sounds by Jonathon Jongsma https://www.xeno-canto.org/75111"
LINE[63]=" " LINE[63]=" "
LINE[64]=" " LINE[64]=" "
LINE[65]=" " LINE[65]="Special Thanks"
LINE[66]="Game License" LINE[66]="~~~~~~~~~~~~~~~~~~~~"
LINE[67]="~~~~~~~~~~~~~~~~" LINE[67]=" "
LINE[68]="License (OLC-3)" LINE[68]="Plasticky"
LINE[69]="~~~~~~~~~~~~~~~" LINE[69]="(You're welcome for making you get lunch)"
LINE[70]=" " LINE[70]="brainbleepblop"
LINE[71]="Copyright ` 2024 Sig Productions <niconiconii@lestoria.net>" LINE[71]="Respect"
LINE[72]=" " LINE[72]="Smaha"
LINE[73]="Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:" LINE[73]="Azzerxzz"
LINE[74]=" " LINE[74]="Blueyoshi6"
LINE[75]="1. Redistributions or derivations of source code must retain the above copyright notice, this list of conditions and the following disclaimer." LINE[75]=" "
LINE[76]=" " LINE[76]=" "
LINE[77]="2. Redistributions or derivative works in binary form must reproduce the above copyright notice. This list of conditions and the following disclaimer must be reproduced in the documentation and/or other materials provided with the distribution." LINE[77]="~~~~~~~~~~~~~~~~"
LINE[78]=" " LINE[78]="Game License"
LINE[79]="3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission." LINE[79]="~~~~~~~~~~~~~~~~"
LINE[80]=" " LINE[80]="License (OLC-3)"
LINE[81]="THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." LINE[81]="~~~~~~~~~~~~~~~"
LINE[82]=" "
LINE[83]="Copyright ` 2024 Sig Productions <niconiconii@lestoria.net>"
LINE[84]=" "
LINE[85]="Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:"
LINE[86]=" "
LINE[87]="1. Redistributions or derivations of source code must retain the above copyright notice, this list of conditions and the following disclaimer."
LINE[88]=" "
LINE[89]="2. Redistributions or derivative works in binary form must reproduce the above copyright notice. This list of conditions and the following disclaimer must be reproduced in the documentation and/or other materials provided with the distribution."
LINE[90]=" "
LINE[91]="3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission."
LINE[92]=" "
LINE[93]="THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
} }
Loading…
Cancel
Save