master
sigonasr2 3 months ago
parent 6fb8556c79
commit c735f74a83
  1. 12
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 3
      Adventures in Lestoria/Error.h
  3. 12
      Adventures in Lestoria/GiantOctopus.cpp
  4. 2
      Adventures in Lestoria/Version.h
  5. 3
      Adventures in Lestoria/assets/config/MonsterStrategies.txt
  6. 4
      Adventures in Lestoria/assets/config/Monsters.txt
  7. 5
      Adventures in Lestoria/assets/config/items/ItemDatabase.txt
  8. BIN
      Adventures in Lestoria/assets/items/Takoyaki.png
  9. BIN
      x64/Release/Adventures in Lestoria.exe

@ -82,6 +82,7 @@ All rights reserved.
#include "SteamKeyboardCallbackHandler.h"
#include "SteamStatsReceivedHandler.h"
#include "StageMaskPolygon.h"
#include <stacktrace>
INCLUDE_EMITTER_LIST
INCLUDE_ITEM_CATEGORIES
@ -3074,6 +3075,17 @@ int main(const int argn,char**args)
LOG(std::format("Found {} args",argn));
bool usingSteam=true;
std::set_terminate([](){
try{
std::exception_ptr eptr{std::current_exception()};
if(eptr)std::rethrow_exception(eptr);
else std::cerr<<"Exiting without exception\n";
}catch(const std::exception& ex){std::cerr<<"Exception: "<<ex.what()<< '\n';}
catch(...){std::cerr << "Unknown exception caught\n";}
LOG(std::stacktrace::current());
std::exit(EXIT_FAILURE);
});
for(int i=0;i<argn;i++){
if(std::string(args[i])=="nosteam"){
LOG("nosteam flag detected. Disabling steam API...");

@ -43,6 +43,7 @@ All rights reserved.
#include <memory>
#include <source_location>
#include <fstream>
#include <stacktrace>
inline std::ofstream debugLogger;
@ -80,7 +81,9 @@ inline std::ofstream debugLogger;
}
inline static void log(std::stringstream&str,std::source_location loc){
debugLogger<<loc.file_name()<<"("<<loc.line()<<":"<<loc.column()<<") "<<loc.function_name()<<": "<<str.str()<<std::endl;
debugLogger<<std::stacktrace::current()<<std::endl;
std::cout<<loc.file_name()<<"("<<loc.line()<<":"<<loc.column()<<") "<<loc.function_name()<<": "<<str.str()<<std::endl;
std::cout<<std::stacktrace::current()<<std::endl;
throw std::runtime_error{std::format("{}({}:{}) {}: {}",loc.file_name(),loc.line(),loc.column(),loc.function_name(),str.str()).c_str()};
}
};

@ -52,6 +52,7 @@ void Monster::STRATEGY::GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string s
INIT,
IDENTIFY_ARMS,
NORMAL,
HURT_ANIMATION,
};
if(!m.B(A::ARM_SPEEDS_INCREASED)&&m.GetHealth()<=ConfigInt("Arm Speedup Health Threshold")){
@ -67,8 +68,16 @@ void Monster::STRATEGY::GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string s
switch(PHASE()){
case INIT:{
std::string takoyakiImgDir{"item_img_directory"_S+"Takoyaki.png"};
if(GFX.count(takoyakiImgDir))ERR(std::format("WARNING! Could not find item image {}",takoyakiImgDir));
m.F(A::BREAK_TIME)=0.5f;
m.AddBuff(BuffType::DAMAGE_REDUCTION,INFINITE,ConfigFloat("Permanent Resistance Buff")/100.f);
m.SetStrategyDeathFunction([](GameEvent&event,Monster&m,const std::string&strategy){
std::string takoyakiImgDir{"item_img_directory"_S+"Takoyaki.png"};
if(GFX.count(takoyakiImgDir))ERR(std::format("WARNING! Could not find item image {}",takoyakiImgDir));
game->AddEffect(std::make_unique<Effect>(m.GetPos(),INFINITE,"item_img_directory"_S+"Takoyaki.png",m.OnUpperLevel(),1.f,0.f,vf2d{4.f,4.f},vf2d{},WHITE));
return false;
});
SETPHASE(IDENTIFY_ARMS);
}break;
case IDENTIFY_ARMS:{
@ -117,5 +126,8 @@ void Monster::STRATEGY::GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string s
m.F(A::CASTING_TIMER)=util::random_range(ConfigFloatArr("Arm Move Timer",0),ConfigFloatArr("Arm Move Timer",1));
}
}break;
case HURT_ANIMATION:{
}break;
}
}

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

@ -1249,5 +1249,8 @@ MonsterStrategy
# Speed at which attacks come out when boss is below the health threshold.
Arm Animation Speed Increase = 10%
# How long to play the hurt animation for before reverting back to a normal animation.
Hurt Animation Time = 2s
}
}

@ -1750,13 +1750,13 @@ Monsters
# Animations must be defined in the same order as they are in their sprite sheets
# The First Four animations must represent a standing, walking, attack, and death animation. Their names are up to the creator.
IDLE = 4, 0.3, Repeat
HURT = 4, 0.15, Repeat
HURT = 4, 0.25, Repeat
ATTACKING = 4, 0.15, PingPong
DEATH = 4, 0.15, OneShot
}
# Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity
#DROP[0] = Broken Dagger,30%,1,1
DROP[0] = Takoyaki,100%,1,1
Hurt Sound = Monster Hurt
Death Sound = Slime Dead

@ -487,4 +487,9 @@ ItemDatabase
ItemCategory = Materials
SellValue = 14
}
Takoyaki
{
Description = Delicious cooked balls of delicacy filled with scraps from an Octopus.
ItemCategory = Materials
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

Loading…
Cancel
Save