diff options
-rw-r--r-- | res/scripts/common.lua | 15 | ||||
-rw-r--r-- | res/scripts/hallucination_interior.lua | 18 | ||||
-rw-r--r-- | src/script_system.cpp | 1 |
3 files changed, 33 insertions, 1 deletions
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index f984667..dbc021c 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua | |||
@@ -518,6 +518,21 @@ function FaceTowardSprite(spriteName, targetName) | |||
518 | SetDirection(spriteName, dir) | 518 | SetDirection(spriteName, dir) |
519 | end | 519 | end |
520 | 520 | ||
521 | --- Makes the specified sprite's entire party face toward the †arget sprite. | ||
522 | -- This version of the function uses any of the eight directions. | ||
523 | -- @param spriteName the name of the sprite to change the direction of | ||
524 | -- @param targetName the name of the sprite to face toward | ||
525 | function FacePartyTowardSprite(spriteName, targetName) | ||
526 | FaceTowardSprite(spriteName, targetName) | ||
527 | |||
528 | local sprite = getSprite(getSpriteByAlias(spriteName)) | ||
529 | |||
530 | for i=1,#sprite.followers do | ||
531 | local follower = getSprite(sprite.followers[i]) | ||
532 | FaceTowardSprite(follower.alias, targetName) | ||
533 | end | ||
534 | end | ||
535 | |||
521 | --- Makes the specified sprite face toward the †arget sprite. | 536 | --- Makes the specified sprite face toward the †arget sprite. |
522 | -- This version of the function uses the closest cardinal direction. | 537 | -- This version of the function uses the closest cardinal direction. |
523 | -- @param spriteName the name of the sprite to change the direction of | 538 | -- @param spriteName the name of the sprite to change the direction of |
diff --git a/res/scripts/hallucination_interior.lua b/res/scripts/hallucination_interior.lua index 0622453..96b90a6 100644 --- a/res/scripts/hallucination_interior.lua +++ b/res/scripts/hallucination_interior.lua | |||
@@ -268,5 +268,21 @@ function hallucination_interior.switch_claus_lose_interest() | |||
268 | end | 268 | end |
269 | 269 | ||
270 | function hallucination_interior.lets_switch_places() | 270 | function hallucination_interior.lets_switch_places() |
271 | -- TODO: let's switch places | 271 | StartCutscene() |
272 | |||
273 | FacePartyTowardSprite("lucas", "switch_claus") | ||
274 | Halt("switch_claus") | ||
275 | SetAnimation("switch_claus", "talk") | ||
276 | |||
277 | DisplayMessage("* Let's switch places.\n\f* Let's switch places.\n\f* Lucas. Lucas\nLet's switch places.", "Claus", SpeakerType.MAN) | ||
278 | ShowChoice("Yes", "No") | ||
279 | WaitForEndOfMessage() | ||
280 | |||
281 | if GetChoiceSelection() == 0 then | ||
282 | DisplayMessage("* You'd like that, wouldn't you?\n\f* ...no. That's too easy.\n\fI'm not letting you off that easy.\n\f* It should've been you, right?\nYou feel guilty, right?\n\f* Well guess what, Lucas?\n\fYou're going to live with that for the rest of your life.\n\f* You know why?\n\f* Because you're going to live, Lucas!\n\fYOU'RE. GOING. TO. LIVE!", "Claus", SpeakerType.MAN) | ||
283 | SetAnimation("switch_claus", "still") | ||
284 | HideCutsceneBars() | ||
285 | else | ||
286 | -- TODO: let's switch places | ||
287 | end | ||
272 | end | 288 | end |
diff --git a/src/script_system.cpp b/src/script_system.cpp index a50fa7a..505957b 100644 --- a/src/script_system.cpp +++ b/src/script_system.cpp | |||
@@ -34,6 +34,7 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) { | |||
34 | 34 | ||
35 | engine_.new_usertype<Sprite>( | 35 | engine_.new_usertype<Sprite>( |
36 | "sprite", | 36 | "sprite", |
37 | "alias", &Sprite::alias, | ||
37 | "loc", &Sprite::loc, | 38 | "loc", &Sprite::loc, |
38 | "dir", &Sprite::dir, | 39 | "dir", &Sprite::dir, |
39 | "followers", &Sprite::followers, | 40 | "followers", &Sprite::followers, |