Allow loadout items to be used in the camp without consuming the item. Release Build 11922.

master
sigonasr2 4 weeks ago
parent d89b82bc41
commit 7d0b15f652
  1. 6
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 3
      Adventures in Lestoria/Player.cpp
  3. 2
      Adventures in Lestoria/Version.h
  4. 18
      Adventures in Lestoria/VisualNovel.cpp
  5. 4
      Adventures in Lestoria/assets/config/levels.txt
  6. BIN
      x64/Release/Adventures in Lestoria.exe

@ -3996,8 +3996,10 @@ bool AiL::UseLoadoutItem(int slot,const std::optional<vf2d>targetingPos){
if(!ISBLANK(GetLoadoutItem(slot).lock())&&GetLoadoutItem(slot).lock()->Amt()>0){
Tutorial::GetTask(TutorialTaskName::USE_RECOVERY_ITEMS).I(A::ITEM_USE_COUNT)++;
Inventory::UseItem(GetLoadoutItem(slot).lock()->ActualName(),1U,targetingPos);
Inventory::AddLoadoutItemUsed(GetLoadoutItem(slot).lock()->ActualName(),slot);
GetLoadoutItem(slot).lock()->amt--;
if(game->GetCurrentMapName()!="HUB"){
Inventory::AddLoadoutItemUsed(GetLoadoutItem(slot).lock()->ActualName(),slot);
GetLoadoutItem(slot).lock()->amt--;
}
if(GetLoadoutItem(slot).lock()->UseSound().length()>0){
SoundEffect::PlaySFX(GetLoadoutItem(slot).lock()->UseSound(),SoundEffect::CENTERED);
}

@ -886,8 +886,7 @@ bool Player::CanAct(){
const bool Player::CanAct(const Ability&ability){
return knockUpTimer==0&&!ability.waitForRelease&&(ability.canCancelCast||state!=State::CASTING)&&state!=State::ANIMATION_LOCK&&state!=State::DEADLYDASH&&state!=State::RETREAT&&
(GameState::STATE==GameState::states[States::GAME_RUN]
||GameState::STATE==GameState::states[States::GAME_HUB]&&!ability.itemAbility);
(GameState::STATE==GameState::states[States::GAME_RUN]||GameState::STATE==GameState::states[States::GAME_HUB]);
}
bool Player::HasIframes(){

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

@ -126,40 +126,40 @@ void VisualNovel::Initialize(){
arguments=ReadCSVArgs(args);
}
if(line.find("{LOCATION")!=std::string::npos){//Location command
if(line.find("{LOCATION")!=std::string::npos){
if(arguments.size()!=1)ERR("Arguments size is "<<arguments.size()<<". Expecting only 1 argument.")
data.emplace_back(std::make_unique<LocationCommand>(arguments[0]));
}else
if(line.find("{BACKGROUND")!=std::string::npos){//Background command
if(line.find("{BACKGROUND")!=std::string::npos){
if(arguments.size()!=1)ERR("Arguments size is "<<arguments.size()<<". Expecting only 1 argument.")
graphicsToLoad.insert("story_background_image_location"_S+arguments[0]);
data.push_back(std::make_unique<BackgroundCommand>(arguments[0]));
}else
if(line.find("{LEFT")!=std::string::npos){//Left command
if(line.find("{LEFT")!=std::string::npos){
AddImagesForLoading(arguments);
data.emplace_back(std::make_unique<LeftCommand>(arguments));
}else
if(line.find("{RIGHT")!=std::string::npos){//Right command
if(line.find("{RIGHT")!=std::string::npos){
AddImagesForLoading(arguments);
data.emplace_back(std::make_unique<RightCommand>(arguments));
}else
if(line.find("{PAUSE")!=std::string::npos){//Pause command
if(line.find("{PAUSE")!=std::string::npos){
if(arguments.size()!=0)ERR("Arguments size is "<<arguments.size()<<". Expecting no arguments.")
data.emplace_back(std::make_unique<PauseCommand>());
}else
if(line.find("{AUDIOPITCH")!=std::string::npos){//Pause command
if(line.find("{AUDIOPITCH")!=std::string::npos){
if(arguments.size()!=1)ERR("Arguments size is "<<arguments.size()<<". Expecting only 1 argument.")
data.emplace_back(std::make_unique<AudioPitchCommand>(arguments[0]));
}else
if(line.find("{BGM")!=std::string::npos){//Pause command
if(line.find("{BGM")!=std::string::npos){
if(arguments.size()!=1)ERR("Arguments size is "<<arguments.size()<<". Expecting only 1 argument.")
data.emplace_back(std::make_unique<BGMCommand>(arguments[0]));
}else
if(line.find("{CHAPTER")!=std::string::npos){//Pause command
if(line.find("{CHAPTER")!=std::string::npos){
if(arguments.size()!=1)ERR("Arguments size is "<<arguments.size()<<". Expecting only 1 argument.")
data.emplace_back(std::make_unique<ChapterCommand>(std::stoi(arguments[0])));
}else
if(line.find("{SETPLAYERWORLDLOC")!=std::string::npos){//Pause command
if(line.find("{SETPLAYERWORLDLOC")!=std::string::npos){
if(arguments.size()<1)ERR("Arguments size is "<<arguments.size()<<". Expecting at least 1 argument.")
std::string connectionPointName{};
for(int i=0;std::string&arg:arguments){

@ -25,7 +25,7 @@ Levels
Loot[1] = Berries, 1, 1, 30%
Loot[2] = Green Gemstone, 1, 1, 5%
}
BOSS_1
BOSS_1
{
Map File = Boss_1_v2.tmx
}
@ -106,7 +106,7 @@ Levels
Loot[2] = Berries, 1, 2, 25%
Loot[3] = Green Gemstone, 1, 1, 5%
}
BOSS_1_B
BOSS_1_B
{
Map File = Boss_1_B.tmx
}

Loading…
Cancel
Save