Skip to content

Commit

Permalink
Generate skill sound when Skill "Teleport": Slow Fadeout from Scene_T…
Browse files Browse the repository at this point in the history
…eleport.

Problem: Using a teleport skill generates an item sound instead of the skill sound (even "(OFF)") and it fades out quickly from the Teleport Menu.
  • Loading branch information
Albeleon authored and Ghabry committed Dec 23, 2018
1 parent 2e8dc49 commit 9f1cb8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/scene_teleport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "game_player.h"
#include "game_system.h"
#include "input.h"
#include "transition.h"

Scene_Teleport::Scene_Teleport(Game_Actor& actor, const RPG::Skill& skill)
: actor(&actor), skill(&skill) {
Expand All @@ -42,7 +43,7 @@ void Scene_Teleport::Update() {
teleport_window->Update();

if (Input::IsTriggered(Input::DECISION)) {
Game_System::SePlay(Game_System::GetSystemSE(Game_System::SFX_UseItem));
Game_System::SePlay(skill->sound_effect);

if (skill) {
Main_Data::game_party->UseSkill(skill->ID, actor, actor);
Expand All @@ -62,3 +63,11 @@ void Scene_Teleport::Update() {
Scene::Pop();
}
}

void Scene_Teleport::TransitionOut() {
if (Scene::instance->type == Map) {
Graphics::GetTransition().Init(Transition::TransitionFadeOut, this, 32, true);
} else {
Scene::TransitionOut();
}
}
1 change: 1 addition & 0 deletions src/scene_teleport.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Scene_Teleport : public Scene {

void Start() override;
void Update() override;
void TransitionOut() override;
private:
std::unique_ptr<Window_Teleport> teleport_window;

Expand Down

0 comments on commit 9f1cb8b

Please sign in to comment.