summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-25 22:15:04 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-25 22:15:04 -0500
commit88530b61ff77b4e9af38dcd5673d311738f54578 (patch)
treef8c96f4b2244591c8c2f8f9fbd58031892ab6d99
parentc6c0c1a5a553c66796418b07077465c0c7a89069 (diff)
downloadtanetane-88530b61ff77b4e9af38dcd5673d311738f54578.tar.gz
tanetane-88530b61ff77b4e9af38dcd5673d311738f54578.tar.bz2
tanetane-88530b61ff77b4e9af38dcd5673d311738f54578.zip
Lucas wades into hot spring alone when Ionia is there
-rw-r--r--res/maps/hallucination_hot_spring.tmx7
-rw-r--r--res/scripts/hallucination_hot_spring.lua30
-rw-r--r--src/character_system.cpp12
-rw-r--r--src/character_system.h2
-rw-r--r--src/script_system.cpp3
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 @@
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="32" height="16" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="4"> 2<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="32" height="16" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="5">
3 <tileset firstgid="1" source="hallucination.tsx"/> 3 <tileset firstgid="1" source="hallucination.tsx"/>
4 <layer id="2" name="Lower" width="32" height="16"> 4 <layer id="2" name="Lower" width="32" height="16">
5 <data encoding="csv"> 5 <data encoding="csv">
@@ -41,6 +41,11 @@
41 </properties> 41 </properties>
42 <point/> 42 <point/>
43 </object> 43 </object>
44 <object id="4" name="enter_hot_spring" type="trigger" x="288" y="96" width="80" height="48">
45 <properties>
46 <property name="script" value="enter_hot_spring"/>
47 </properties>
48 </object>
44 </objectgroup> 49 </objectgroup>
45 <layer id="1" name="Upper (most)" width="32" height="16"> 50 <layer id="1" name="Upper (most)" width="32" height="16">
46 <properties> 51 <properties>
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()
13 ChangeMap("hallucination_cliff", "fromLeft") 13 ChangeMap("hallucination_cliff", "fromLeft")
14end 14end
15 15
16function hallucination_hot_spring.testing_lucas_submerge() 16function hallucination_hot_spring.enter_hot_spring()
17 StartCutscene(CutsceneOptions.DO_NOT_CHANGE_ANIMATION) 17 if gamestate.ionia_in_water then
18 ShowExpression("lucas", "surprise") 18 StartCutscene(CutsceneOptions.DO_NOT_CHANGE_ANIMATION)
19 Delay(1000) 19 character():breakUpParty(getPlayerSprite())
20 RemoveExpression("lucas") 20 getSprite(getPlayerSprite()).paused = false
21 Delay(2000) 21 character():moveInDirection(getPlayerSprite(), Direction.UP)
22 SetAnimation("lucas", "submerge!") 22 Delay(500)
23 Delay(200) 23 character():stopDirecting(getPlayerSprite())
24 PlaySound("splash_submerge.wav") 24 getSprite(getPlayerSprite()).paused = true
25 WaitForAnimation("lucas") 25 SetDirection("lucas", Direction.DOWN)
26 Delay(1000)
27 ShowExpression("lucas", "surprise")
28 Delay(1000)
29 RemoveExpression("lucas")
30 Delay(2000)
31 SetAnimation("lucas", "submerge!")
32 Delay(200)
33 PlaySound("splash_submerge.wav")
34 WaitForAnimation("lucas")
35 end
26end 36end
27 37
28function hallucination_hot_spring.testing_lucas_resurface() 38function 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) {
70 } 70 }
71} 71}
72 72
73void CharacterSystem::breakUpParty(int leaderId) {
74 Sprite& leader = game_.getSprite(leaderId);
75 std::vector<int> followers = leader.followers;
76 leader.followers.clear();
77 leader.trailsAreHalved = false;
78
79 for (int followerId : followers) {
80 Sprite& follower = game_.getSprite(followerId);
81 follower.trail.clear();
82 }
83}
84
73void CharacterSystem::moveInDirection(int spriteId, Direction dir) { 85void CharacterSystem::moveInDirection(int spriteId, Direction dir) {
74 Sprite& sprite = game_.getSprite(spriteId); 86 Sprite& sprite = game_.getSprite(spriteId);
75 sprite.movementDir = dir; 87 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:
25 25
26 void transplantParty(int leaderId, vec2i pos, Direction dir); 26 void transplantParty(int leaderId, vec2i pos, Direction dir);
27 27
28 void breakUpParty(int leaderId);
29
28 void moveInDirection(int spriteId, Direction dir); 30 void moveInDirection(int spriteId, Direction dir);
29 31
30 void stopDirecting(int spriteId); 32 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) {
59 "character", 59 "character",
60 "addSpriteToParty", &CharacterSystem::addSpriteToParty, 60 "addSpriteToParty", &CharacterSystem::addSpriteToParty,
61 "transplantParty", &CharacterSystem::transplantParty, 61 "transplantParty", &CharacterSystem::transplantParty,
62 "breakUpParty", &CharacterSystem::breakUpParty,
63 "moveInDirection", &CharacterSystem::moveInDirection,
64 "stopDirecting", &CharacterSystem::stopDirecting,
62 "startRunning", &CharacterSystem::startRunning, 65 "startRunning", &CharacterSystem::startRunning,
63 "halt", &CharacterSystem::halt); 66 "halt", &CharacterSystem::halt);
64 67