summary refs log tree commit diff stats
path: root/res/scripts
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-17 15:11:37 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-17 15:11:37 -0500
commitb3720c4a401f345c49eadabdb852968e273e7077 (patch)
tree79f6e3172c6b847a705157e698648e4a8a2da4b5 /res/scripts
parenta645524d19bb9183d4eece72bf8945bba4bed3a0 (diff)
downloadtanetane-b3720c4a401f345c49eadabdb852968e273e7077.tar.gz
tanetane-b3720c4a401f345c49eadabdb852968e273e7077.tar.bz2
tanetane-b3720c4a401f345c49eadabdb852968e273e7077.zip
Added expressions (currently just surprise)
Diffstat (limited to 'res/scripts')
-rw-r--r--res/scripts/common.lua18
-rw-r--r--res/scripts/map2.lua27
2 files changed, 45 insertions, 0 deletions
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index f88c4c1..8a9445b 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua
@@ -207,3 +207,21 @@ function DestroyNamedSprite(alias)
207 local spriteId = getSpriteByAlias(alias) 207 local spriteId = getSpriteByAlias(alias)
208 destroySprite(spriteId) 208 destroySprite(spriteId)
209end 209end
210
211function AliasForSpriteExpression(spriteName)
212 return "expression (" .. spriteName .. ")"
213end
214
215function ShowExpression(spriteName, expression)
216 local spriteId = getSpriteByAlias(spriteName)
217 local sprite = getSprite(spriteId)
218 local animFrame = sprite:getCurrentFrame()
219 local x = sprite.loc:x()
220 local y = sprite.loc:y() - animFrame.center:y()
221
222 CreateAnimatedSpriteAtPosition(AliasForSpriteExpression(spriteName), "expression", x, y, expression, Direction.DOWN, SpriteLayer.ABOVE)
223end
224
225function RemoveExpression(spriteName)
226 DestroyNamedSprite(AliasForSpriteExpression(spriteName))
227end
diff --git a/res/scripts/map2.lua b/res/scripts/map2.lua index c929e8d..295a0c1 100644 --- a/res/scripts/map2.lua +++ b/res/scripts/map2.lua
@@ -74,12 +74,36 @@ function map2.approach_doria()
74 gamestate.approached_doria = true 74 gamestate.approached_doria = true
75 75
76 StartCutscene() 76 StartCutscene()
77 SetDirection("boney", Direction.LEFT)
78 SetAnimation("boney", "barking")
79 local barkingNoise = LoopSound("barking_at_hallucination.wav")
80 Delay(200)
81
82 ShowExpression("lucas", "surprise")
83 SetDirection("lucas", Direction.LEFT)
84 Delay(100)
85
86 ShowExpression("kuma", "surprise")
87 ShowExpression("duster", "surprise")
88 SetDirection("kuma", Direction.LEFT)
89 SetDirection("duster", Direction.LEFT)
90 Delay(1000)
91
77 PanToSprite("doria", 2000) 92 PanToSprite("doria", 2000)
93 Delay(500)
94
95 RemoveExpression("lucas")
96 RemoveExpression("kuma")
97 RemoveExpression("duster")
78 WaitForPan() 98 WaitForPan()
79 99
80 SetDirection("doria", Direction.DOWN_RIGHT) 100 SetDirection("doria", Direction.DOWN_RIGHT)
81 SetAnimation("doria", "talk") 101 SetAnimation("doria", "talk")
102 ShowExpression("doria", "surprise")
82 DisplayMessage("* Oh my!\n\f* Is that our little Kumatora I spy? `", "Doria", SpeakerType.MAN) 103 DisplayMessage("* Oh my!\n\f* Is that our little Kumatora I spy? `", "Doria", SpeakerType.MAN)
104 Delay(1000)
105
106 RemoveExpression("doria")
83 WaitForEndOfMessage() 107 WaitForEndOfMessage()
84 108
85 SetAnimation("doria", "still") 109 SetAnimation("doria", "still")
@@ -89,6 +113,9 @@ function map2.approach_doria()
89 DisplayMessage("* Doria...?\n\f* What the hell... You're still alive?", "Kumatora", SpeakerType.WOMAN) 113 DisplayMessage("* Doria...?\n\f* What the hell... You're still alive?", "Kumatora", SpeakerType.WOMAN)
90 WaitForEndOfMessage() 114 WaitForEndOfMessage()
91 115
116 SetAnimation("boney", "crouch")
117 StopSound(barkingNoise)
118 PlaySound("boney_growl.wav")
92 SetAnimation("kuma", "still") 119 SetAnimation("kuma", "still")
93 Delay(1000) 120 Delay(1000)
94 121