summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-03-04 22:11:34 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-03-04 22:11:34 -0500
commitdbc28c87fefbceb4eaec522b535f9034b05fe3f2 (patch)
tree80592868e36e76ddf37eb7827eb9b0d1093693fe
parent60f55603a8a880712a99ace377c09aed4f83c8f6 (diff)
downloadtanetane-dbc28c87fefbceb4eaec522b535f9034b05fe3f2.tar.gz
tanetane-dbc28c87fefbceb4eaec522b535f9034b05fe3f2.tar.bz2
tanetane-dbc28c87fefbceb4eaec522b535f9034b05fe3f2.zip
Started "Claus falls off ladder" scene
-rw-r--r--res/maps/hallucination_cliff.tmx16
-rw-r--r--res/scripts/common.lua7
-rw-r--r--res/scripts/global.lua14
-rw-r--r--res/scripts/hallucination_cliff.lua83
-rw-r--r--res/sfx/thud.wavbin0 -> 96234 bytes
-rw-r--r--res/sfx/wobble_and_fall.wavbin0 -> 399090 bytes
6 files changed, 119 insertions, 1 deletions
diff --git a/res/maps/hallucination_cliff.tmx b/res/maps/hallucination_cliff.tmx index 7ec3d99..ae4656d 100644 --- a/res/maps/hallucination_cliff.tmx +++ b/res/maps/hallucination_cliff.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="48" height="48" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="8"> 2<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="48" height="48" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="12">
3 <properties> 3 <properties>
4 <property name="music" value="red_green_yellow_yellow"/> 4 <property name="music" value="red_green_yellow_yellow"/>
5 </properties> 5 </properties>
@@ -136,6 +136,20 @@
136 <object id="7" name="fromInside" type="warp" x="440" y="232"> 136 <object id="7" name="fromInside" type="warp" x="440" y="232">
137 <point/> 137 <point/>
138 </object> 138 </object>
139 <object id="8" name="claus_fall_event" type="trigger" x="560" y="592" width="16" height="16">
140 <properties>
141 <property name="script" value="claus_fall_event"/>
142 </properties>
143 </object>
144 <object id="9" name="near_top_first_ladder" type="warp" x="568" y="498">
145 <point/>
146 </object>
147 <object id="10" name="claus_fall_location" type="warp" x="568" y="640">
148 <point/>
149 </object>
150 <object id="11" name="near_bottom_first_ladder" type="warp" x="568" y="632">
151 <point/>
152 </object>
139 </objectgroup> 153 </objectgroup>
140 <layer id="1" name="Upper" width="48" height="48"> 154 <layer id="1" name="Upper" width="48" height="48">
141 <properties> 155 <properties>
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index dad9c5d..eb3817e 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua
@@ -166,6 +166,13 @@ function SetPosition(spriteName, x, y)
166 transform():moveSprite(spriteId, vec2i.new(x, y)) 166 transform():moveSprite(spriteId, vec2i.new(x, y))
167end 167end
168 168
169--- Moves a sprite to the specified warp point.
170function MoveSpriteToWarp(spriteName, warp)
171 local spriteId = getSpriteByAlias(spriteName)
172 local warpPos = getMap():getWarpPoint(warp)
173 transform():moveSprite(spriteId, warpPos)
174end
175
169function SetDirection(spriteName, dir) 176function SetDirection(spriteName, dir)
170 local spriteId = getSpriteByAlias(spriteName) 177 local spriteId = getSpriteByAlias(spriteName)
171 animation():setSpriteDirection(spriteId, dir) 178 animation():setSpriteDirection(spriteId, dir)
diff --git a/res/scripts/global.lua b/res/scripts/global.lua index 48084c8..8eddf55 100644 --- a/res/scripts/global.lua +++ b/res/scripts/global.lua
@@ -5,3 +5,17 @@ function global.no_problem_here()
5 DisplayMessage("* No problem here.", "", SpeakerType.NONE) 5 DisplayMessage("* No problem here.", "", SpeakerType.NONE)
6 HideCutsceneBars() 6 HideCutsceneBars()
7end 7end
8
9-- for testing the claus joined route
10function global.test_join_claus()
11 CreateAnimatedSpriteAtPosition("join_claus", "claus", 0, 0, "still", Direction.DOWN, SpriteLayer.NORMAL)
12
13 local clausId = getSpriteByAlias("join_claus")
14 character():addSpriteToParty(getPlayerSprite(), clausId)
15
16 local clausSprite = getSprite(clausId)
17 clausSprite.persistent = true
18
19 gamestate.claus_joined = true
20 gamestate.still_has_claus = true
21end
diff --git a/res/scripts/hallucination_cliff.lua b/res/scripts/hallucination_cliff.lua index 250c0cf..d4ba921 100644 --- a/res/scripts/hallucination_cliff.lua +++ b/res/scripts/hallucination_cliff.lua
@@ -13,3 +13,86 @@ function hallucination_cliff.enter_door()
13 PlaySound("door_open.wav") 13 PlaySound("door_open.wav")
14 ChangeMap("pink_shell", "fromOutside") 14 ChangeMap("pink_shell", "fromOutside")
15end 15end
16
17function hallucination_cliff.claus_fall_event()
18 -- do not trigger if we don't have claus
19 if not gamestate.still_has_claus then
20 return
21 end
22
23 -- do not trigger a second time
24 if gamestate.claus_fall_scene then
25 return
26 end
27
28 gamestate.claus_fall_scene = true
29
30 -- have the player automatically climb most of the ladder. this is to ensure
31 -- that Claus is off screen when the event triggers.
32 DisablePlayerControl()
33 Halt("lucas")
34 DirectSpriteToLocation("lucas", "near_top_first_ladder", PathfindingOptions.CARDINAL_DIRECTIONS_ONLY)
35 WaitForSpritePath("lucas")
36 DisableBehaviour("lucas")
37
38 StartCutscene(CutsceneOptions.DO_NOT_CHANGE_ANIMATION)
39 DisplayMessage("* Aiee!", "Claus", SpeakerType.MAN)
40 PlaySound("wobble_and_fall.wav")
41 WaitForEndOfMessage()
42
43 Delay(1000)
44
45 PlaySound("thud.wav")
46 ShakeCamera(100)
47 Delay(50)
48
49 ShowExpression("lucas", "surprise")
50 Delay(50)
51
52 ShowExpression("kuma", "surprise")
53 ShowExpression("duster", "surprise")
54 Delay(100)
55
56 StopShakingCamera()
57 Delay(1000)
58
59 MoveSpriteToWarp("join_claus", "claus_fall_location")
60 SetDirection("join_claus", Direction.LEFT)
61 SetAnimation("join_claus", "collapsed")
62 PanToSprite("join_claus", 4000)
63 Delay(1000)
64
65 RemoveExpression("lucas")
66 RemoveExpression("kuma")
67 RemoveExpression("duster")
68 WaitForPan()
69
70 Delay(1000)
71
72 -- we need to break up the party to detach Claus anyway, and while we're there
73 -- we should turn down the movement speed because the pathfinding algorithm
74 -- doesn't take media into consideration, and if we don't change the speed
75 -- before adding the other characters back, they'll bunch up as they move down
76 BreakUpParty("lucas")
77 SetMovementSpeed("lucas", 1)
78 character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("kuma"))
79 character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("duster"))
80 character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("boney"))
81
82 UnpauseSprite("lucas")
83 DirectSpriteToLocation("lucas", "near_bottom_first_ladder", PathfindingOptions.CARDINAL_DIRECTIONS_ONLY)
84 WaitForSpritePath("lucas")
85 DisableBehaviour("lucas")
86 PauseSprite("lucas")
87 SetAnimation("lucas", "frozen") -- so he doesn't blink
88
89 -- TODO: rest of scene
90
91 -- same as before but less justifiable because the only reason we're doing
92 -- this is to fix the movement trails
93 -- BreakUpParty("lucas")
94 -- SetMovementSpeed("lucas", 2)
95 -- character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("kuma"))
96 -- character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("duster"))
97 -- character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("boney"))
98end
diff --git a/res/sfx/thud.wav b/res/sfx/thud.wav new file mode 100644 index 0000000..489d318 --- /dev/null +++ b/res/sfx/thud.wav
Binary files differ
diff --git a/res/sfx/wobble_and_fall.wav b/res/sfx/wobble_and_fall.wav new file mode 100644 index 0000000..2925f33 --- /dev/null +++ b/res/sfx/wobble_and_fall.wav
Binary files differ