summary refs log tree commit diff stats
path: root/res/scripts/hallucination_hot_spring.lua
blob: 805f85acaaab57e2210e86931c84475c1b972051 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
hallucination_hot_spring = {}

function hallucination_hot_spring.init()
  if randomChance(3.0/4.0) then
    DestroyNamedSprite("water_ionia")
    gamestate.ionia_in_water = false
  else
    gamestate.ionia_in_water = true
  end
end

function hallucination_hot_spring.off_right()
  ChangeMap("hallucination_cliff", "fromLeft")
end

function hallucination_hot_spring.enter_hot_spring()
  gamestate.went_in_hot_spring = true

  if gamestate.ionia_in_water then
    -- Soft cutscene start; don't show bars but do take away control
    DisablePlayerControl()
    character():halt(getPlayerSprite())

    -- Leave the rest of the party behind and have Lucas wade into the hot spring
    character():breakUpParty(getPlayerSprite())
    character():moveInDirection(getPlayerSprite(), Direction.UP)
    Delay(500)
    character():stopDirecting(getPlayerSprite())
    SetDirection("lucas", Direction.DOWN)
    Delay(1000)

    -- Show the cutscene bars when he gets surprised
    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")
    Delay(1000)

    -- After we fade to black, move the rest of the party offscreen.
    -- We need to remove control again right after the map change because
    -- ChangeMap automatically gives it back.
    FadeToBlack(1000)
    HideCutsceneBars()
    SetPosition("kuma", -100, -100)
    SetPosition("duster", -100, -100)
    SetPosition("boney", -100, -100)
    ChangeMap("underwater_start", "spawn", ChangeMapOptions.DO_NOT_FADE)
    DisablePlayerControl()
    Delay(500)
    RemoveFadeout(1000)
    EnablePlayerControl()
  end
end

function hallucination_hot_spring.testing_lucas_resurface()
  SetAnimation("lucas", "drown")
  Delay(3000)
  SetAnimation("lucas", "resurface!")
  PlaySound("splash_resurface.wav")
  WaitForAnimation("lucas")
end