Warrior sword swing now lingers for the entirety of the animation instead of only applying damage immediately on use. Release Build 8451.

mac-build
sigonasr2 8 months ago
parent b8339ff9cc
commit fe52623a17
  1. 19
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 4
      Adventures in Lestoria/AdventuresInLestoria.h
  3. 5
      Adventures in Lestoria/Effect.h
  4. 2
      Adventures in Lestoria/Player.cpp
  5. 4
      Adventures in Lestoria/SwordSlash.cpp
  6. 16
      Adventures in Lestoria/TODO.txt
  7. 2
      Adventures in Lestoria/Version.h
  8. 5
      Adventures in Lestoria/Warrior.cpp
  9. 3
      Adventures in Lestoria/assets/config/classes/Warrior.txt
  10. BIN
      Adventures in Lestoria/assets/gamepack.pak
  11. 1
      Adventures in Lestoria/steam/matchmakingtypes.h
  12. BIN
      x64/Release/Adventures in Lestoria.exe

@ -159,6 +159,8 @@ AiL::AiL()
_DEBUG_MAP_LOAD_INFO=bool("debug_map_load_info"_I); _DEBUG_MAP_LOAD_INFO=bool("debug_map_load_info"_I);
MONSTER_LIST.reserve(500); //This is going to make it so the monster limit is soft-capped. We have hitlists in this game that may store pointers to monsters, this hopefully protects them from invalidated pointers. Worst-case-scenario we get double hits when there are more than 500 monsters on-screen at once which I really don't think will ever occur.
std::string CONFIG_PATH = "config_path"_S; std::string CONFIG_PATH = "config_path"_S;
std::string GFX_CONFIG = CONFIG_PATH + "gfx_config"_S; std::string GFX_CONFIG = CONFIG_PATH + "gfx_config"_S;
@ -758,7 +760,7 @@ void AiL::UpdateBullets(float fElapsedTime){
} }
std::erase_if(BULLET_LIST,[](std::unique_ptr<Bullet>&b){return b->dead;}); std::erase_if(BULLET_LIST,[](std::unique_ptr<Bullet>&b){return b->dead;});
} }
const MonsterHurtList AiL::HurtEnemies(vf2d pos,float radius,int damage,bool upperLevel,float z){ const MonsterHurtList AiL::HurtEnemies(vf2d pos,float radius,int damage,bool upperLevel,float z)const{
MonsterHurtList hitList; MonsterHurtList hitList;
for(Monster&m:MONSTER_LIST){ for(Monster&m:MONSTER_LIST){
if(geom2d::overlaps(geom2d::circle(pos,radius),geom2d::circle(m.GetPos(),12*m.GetSizeMult()))){ if(geom2d::overlaps(geom2d::circle(pos,radius),geom2d::circle(m.GetPos(),12*m.GetSizeMult()))){
@ -769,6 +771,19 @@ const MonsterHurtList AiL::HurtEnemies(vf2d pos,float radius,int damage,bool upp
return hitList; return hitList;
} }
const MonsterHurtList AiL::HurtEnemiesNotHit(vf2d pos,float radius,int damage,HitList&hitList,bool upperLevel,float z){
MonsterHurtList affectedList;
for(Monster&m:MONSTER_LIST){
if(!hitList.count(&m)&&geom2d::overlaps(geom2d::circle(pos,radius),geom2d::circle(m.GetPos(),12*m.GetSizeMult()))){
HurtReturnValue returnVal=m.Hurt(damage,upperLevel,z);
affectedList.push_back({&m,returnVal});
hitList.insert(&m);
}
}
return affectedList;
}
void AiL::PopulateRenderLists(){ void AiL::PopulateRenderLists(){
monstersBeforeLower.clear(); monstersBeforeLower.clear();
monstersAfterLower.clear(); monstersAfterLower.clear();
@ -3827,7 +3842,9 @@ void AiL::UpdateMonsters(){
m.Update(game->GetElapsedTime()); m.Update(game->GetElapsedTime());
} }
for(Monster&m:game->monstersToBeSpawned){ for(Monster&m:game->monstersToBeSpawned){
size_t prevCapacity=MONSTER_LIST.capacity();
MONSTER_LIST.push_back(m); MONSTER_LIST.push_back(m);
if(MONSTER_LIST.capacity()>prevCapacity)LOG(std::format("WARNING! The monster list has automatically reserved more space and resized to {}! This caused one potential frame where bullet/effect hitlists that stored information on what monsters were hit to potentially be hit a second time or cause monsters that should've been hit to never be hit. Consider starting with a larger default reserved size for MONSTER_LIST if your intention was to have this many monsters!",MONSTER_LIST.capacity()));
} }
game->monstersToBeSpawned.clear(); game->monstersToBeSpawned.clear();
} }

@ -215,7 +215,9 @@ public:
void AddEffect(std::unique_ptr<Effect>foreground,std::unique_ptr<Effect>background); void AddEffect(std::unique_ptr<Effect>foreground,std::unique_ptr<Effect>background);
//If back is true, places the effect in the background //If back is true, places the effect in the background
void AddEffect(std::unique_ptr<Effect>foreground,bool back=false); void AddEffect(std::unique_ptr<Effect>foreground,bool back=false);
const MonsterHurtList HurtEnemies(vf2d pos,float radius,int damage,bool upperLevel,float z); const MonsterHurtList HurtEnemies(vf2d pos,float radius,int damage,bool upperLevel,float z)const;
//NOTE: This function will also add any enemies that were hit into the hit list!
const MonsterHurtList HurtEnemiesNotHit(vf2d pos,float radius,int damage,HitList&hitList,bool upperLevel,float z);
vf2d GetWorldMousePos(); vf2d GetWorldMousePos();
bool LeftHeld(); bool LeftHeld();
bool RightHeld(); bool RightHeld();

@ -37,6 +37,9 @@ All rights reserved.
#pragma endregion #pragma endregion
#pragma once #pragma once
#include "Animation.h" #include "Animation.h"
#include <unordered_set>
class Monster;
using HitList=std::unordered_set<Monster*>;
struct Effect{ struct Effect{
friend class AiL; friend class AiL;
@ -86,4 +89,6 @@ struct PulsatingFire:Effect{
struct SwordSlash:Effect{ struct SwordSlash:Effect{
SwordSlash(float lifetime,std::string imgFile,vf2d size={1,1},float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false); SwordSlash(float lifetime,std::string imgFile,vf2d size={1,1},float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
bool Update(float fElapsedTime)override; bool Update(float fElapsedTime)override;
private:
HitList hitList;
}; };

@ -263,7 +263,7 @@ float Player::GetSizeMult(){
} }
float Player::GetAttackRangeMult(){ float Player::GetAttackRangeMult(){
return attack_range; return attack_range*GetSizeMult();
} }
float Player::GetSpinAngle(){ float Player::GetSpinAngle(){

@ -44,6 +44,10 @@ SwordSlash::SwordSlash(float lifetime, std::string imgFile, vf2d size, float fad
:Effect(game->GetPlayer()->GetPos(),lifetime,imgFile,game->GetPlayer()->OnUpperLevel(),size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){} :Effect(game->GetPlayer()->GetPos(),lifetime,imgFile,game->GetPlayer()->OnUpperLevel(),size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
bool SwordSlash::Update(float fElapsedTime){ bool SwordSlash::Update(float fElapsedTime){
if(lifetime>0){
game->HurtEnemiesNotHit(game->GetPlayer()->GetPos(),game->GetPlayer()->GetAttackRangeMult()*12.f,game->GetPlayer()->GetAttack(),hitList,game->GetPlayer()->OnUpperLevel(),game->GetPlayer()->GetZ());
}
pos=game->GetPlayer()->GetPos(); pos=game->GetPlayer()->GetPos();
return Effect::Update(fElapsedTime); return Effect::Update(fElapsedTime);
} }

@ -1,22 +1,6 @@
February 28th -> Begin Internal Game Playtesting
March 6th -> Discord/Friend Playtesting
March 30th -> Public Demo Release
end of worldmap is visible. needs to be extended a little bit
distance on 1_1 between first and second Enemy spawn feels to empty
Materials for initial craft seems to be wrong? need to recheck
do we need a minimap? (maybe with fog of war?) Maybe polling that once testing with more people.
should gemstones dropp from boss stages aswell? (Maybe lower droprate?)
Toggle for displaying error messages
Equip Gear using Start menu tutorial Equip Gear using Start menu tutorial
Steam Controller SDK
Steam Rich Presence
Add in vsync system option Add in vsync system option
Sword attack should linger
============================================ ============================================
Make another actions config file for the main build (The app # is different) Make another actions config file for the main build (The app # is different)

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

@ -82,7 +82,6 @@ bool Warrior::AutoAttack(){
float targetDirection; float targetDirection;
if(closest!=nullptr){ if(closest!=nullptr){
closest->Hurt(int(GetAttack()*"Warrior.Auto Attack.DamageMult"_F),OnUpperLevel(),GetZ());
float dirToEnemy=geom2d::line<float>(GetPos(),closest->GetPos()).vector().polar().y; float dirToEnemy=geom2d::line<float>(GetPos(),closest->GetPos()).vector().polar().y;
targetDirection=dirToEnemy; targetDirection=dirToEnemy;
SetAnimationBasedOnTargetingDirection(dirToEnemy); SetAnimationBasedOnTargetingDirection(dirToEnemy);
@ -93,9 +92,9 @@ bool Warrior::AutoAttack(){
} }
attack_cooldown_timer=ATTACK_COOLDOWN-GetAttackRecoveryRateReduction(); attack_cooldown_timer=ATTACK_COOLDOWN-GetAttackRecoveryRateReduction();
swordSwingTimer="Warrior.Auto Attack.SwordSwingTime"_F; swordSwingTimer="Warrior.Auto Attack.SwordAnimationSwingTime"_F;
game->AddEffect(std::make_unique<SwordSlash>(0.15f,"swordslash.png"s,vf2d{1.f,1.f}*"Warrior.Auto Attack.Range"_F/100.f,0.1f,vf2d{0.f,0.f},WHITE,targetDirection)); game->AddEffect(std::make_unique<SwordSlash>(0.125f,"swordslash.png"s,vf2d{0.9f,0.9f}*"Warrior.Auto Attack.Range"_F/100.f,0.1f,vf2d{0.f,0.f},WHITE,targetDirection));
SetState(State::SWING_SWORD); SetState(State::SWING_SWORD);
SoundEffect::PlaySFX("Warrior Auto Attack",SoundEffect::CENTERED); SoundEffect::PlaySFX("Warrior Auto Attack",SoundEffect::CENTERED);

@ -20,7 +20,8 @@ Warrior
# Whether or not this ability cancels casts. # Whether or not this ability cancels casts.
CancelCast = 1 CancelCast = 1
SwordSwingTime = 0.2 SwordAnimationSwingTime = 0.2s
SwordSlashLingerTime = 0.125s
} }
Right Click Ability Right Click Ability
{ {

@ -7,6 +7,7 @@
#ifndef MATCHMAKINGTYPES_H #ifndef MATCHMAKINGTYPES_H
#define MATCHMAKINGTYPES_H #define MATCHMAKINGTYPES_H
#include "olcPixelGameEngine.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

Loading…
Cancel
Save