summary refs log tree commit diff stats
path: root/res/scripts/map2.lua
blob: 8058aa26332be944bb4f5a450514dd54a02163ab (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
map2 = {}

function map2.off_left()
  ChangeMap("map1", "fromRight")
end

function map2.mailbox1()
  StartCutscene()
  DisplayMessage("* The mailbox lid is open...\n* Peek inside?", "", SpeakerType.NONE)
  ShowChoice("Yes", "No")
  WaitForEndOfMessage()

  if GetChoiceSelection() == 0 then
    DisplayMessage("* There are lots of postcards inside.\n* Read them?", "", SpeakerType.NONE)
    ShowChoice("Yes", "No")
    WaitForEndOfMessage()

    if GetChoiceSelection() == 0 then
      DisplayMessage("* The boy named Lucas is crying at a grave.\n\f* The boy named Lucas and his dog are loitering in the forest.\n\f* The boy named Lucas is getting into trouble in the mountains.\n\f* The boy named Lucas stole Beanoff from our garden.\n\f* The boy named Lucas is bullying animals.\n\f* The boy named Lucas learned some bad magic.\n\f* The boy named Lucas ......\n\f* The boy named Lucas ......\n\f* The boy named Lucas ......\n\f* The boy named Lucas .........\n\f* The mailbox let out a tremendous scream.", "", SpeakerType.NONE)
      WaitForEndOfMessage()
    end
  end

  HideCutsceneBars()
end

function map2.mailbox_lightning()
  StartCutscene()
  DisplayMessage("* ...?", "", SpeakerType.NONE)
  WaitForEndOfMessage()

  PlaySound("lightning_crackle.wav")
  Delay(1196)

  local lucasPos = GetPosition("lucas")
  CreateAnimatedSpriteAtPosition("lightning_from_mailbox", "lightning", lucasPos:x() + 56, lucasPos:y() - 72, "strike", Direction.DOWN_LEFT, SpriteLayer.ABOVE)

  PlaySound("lightning_explosion.wav")
  SetDirection("lucas", Direction.DOWN)
  SetAnimation("lucas", "lightning_electrocute!")
  WaitForAnimation("lucas")

  DestroyNamedSprite("lightning_from_mailbox")
  SetAnimation("lucas", "lightning_collapse!")
  WaitForAnimation("lucas")

  DisplayMessage("* It was lightning.\n\fAh.", "", SpeakerType.NONE)
  WaitForEndOfMessage()
  HideCutsceneBars()
end