From 88530b61ff77b4e9af38dcd5673d311738f54578 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 25 Feb 2021 22:15:04 -0500 Subject: Lucas wades into hot spring alone when Ionia is there --- res/maps/hallucination_hot_spring.tmx | 7 ++++++- res/scripts/hallucination_hot_spring.lua | 30 ++++++++++++++++++++---------- src/character_system.cpp | 12 ++++++++++++ src/character_system.h | 2 ++ src/script_system.cpp | 3 +++ 5 files changed, 43 insertions(+), 11 deletions(-) diff --git a/res/maps/hallucination_hot_spring.tmx b/res/maps/hallucination_hot_spring.tmx index 60b25d2..2bb840d 100644 --- a/res/maps/hallucination_hot_spring.tmx +++ b/res/maps/hallucination_hot_spring.tmx @@ -1,5 +1,5 @@ - + @@ -41,6 +41,11 @@ + + + + + diff --git a/res/scripts/hallucination_hot_spring.lua b/res/scripts/hallucination_hot_spring.lua index 6713e0c..df4084c 100644 --- a/res/scripts/hallucination_hot_spring.lua +++ b/res/scripts/hallucination_hot_spring.lua @@ -13,16 +13,26 @@ function hallucination_hot_spring.off_right() ChangeMap("hallucination_cliff", "fromLeft") end -function hallucination_hot_spring.testing_lucas_submerge() - StartCutscene(CutsceneOptions.DO_NOT_CHANGE_ANIMATION) - ShowExpression("lucas", "surprise") - Delay(1000) - RemoveExpression("lucas") - Delay(2000) - SetAnimation("lucas", "submerge!") - Delay(200) - PlaySound("splash_submerge.wav") - WaitForAnimation("lucas") +function hallucination_hot_spring.enter_hot_spring() + if gamestate.ionia_in_water then + StartCutscene(CutsceneOptions.DO_NOT_CHANGE_ANIMATION) + character():breakUpParty(getPlayerSprite()) + getSprite(getPlayerSprite()).paused = false + character():moveInDirection(getPlayerSprite(), Direction.UP) + Delay(500) + character():stopDirecting(getPlayerSprite()) + getSprite(getPlayerSprite()).paused = true + SetDirection("lucas", Direction.DOWN) + Delay(1000) + ShowExpression("lucas", "surprise") + Delay(1000) + RemoveExpression("lucas") + Delay(2000) + SetAnimation("lucas", "submerge!") + Delay(200) + PlaySound("splash_submerge.wav") + WaitForAnimation("lucas") + end end function hallucination_hot_spring.testing_lucas_resurface() diff --git a/src/character_system.cpp b/src/character_system.cpp index bcd3beb..d18c592 100644 --- a/src/character_system.cpp +++ b/src/character_system.cpp @@ -70,6 +70,18 @@ void CharacterSystem::transplantParty(int leaderId, vec2i pos, Direction dir) { } } +void CharacterSystem::breakUpParty(int leaderId) { + Sprite& leader = game_.getSprite(leaderId); + std::vector followers = leader.followers; + leader.followers.clear(); + leader.trailsAreHalved = false; + + for (int followerId : followers) { + Sprite& follower = game_.getSprite(followerId); + follower.trail.clear(); + } +} + void CharacterSystem::moveInDirection(int spriteId, Direction dir) { Sprite& sprite = game_.getSprite(spriteId); sprite.movementDir = dir; diff --git a/src/character_system.h b/src/character_system.h index 0962a6a..dff2a7f 100644 --- a/src/character_system.h +++ b/src/character_system.h @@ -25,6 +25,8 @@ public: void transplantParty(int leaderId, vec2i pos, Direction dir); + void breakUpParty(int leaderId); + void moveInDirection(int spriteId, Direction dir); void stopDirecting(int spriteId); diff --git a/src/script_system.cpp b/src/script_system.cpp index e890dfc..0d82436 100644 --- a/src/script_system.cpp +++ b/src/script_system.cpp @@ -59,6 +59,9 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) { "character", "addSpriteToParty", &CharacterSystem::addSpriteToParty, "transplantParty", &CharacterSystem::transplantParty, + "breakUpParty", &CharacterSystem::breakUpParty, + "moveInDirection", &CharacterSystem::moveInDirection, + "stopDirecting", &CharacterSystem::stopDirecting, "startRunning", &CharacterSystem::startRunning, "halt", &CharacterSystem::halt); -- cgit 1.4.1