photos writings music about

<- prev | next ->

story


Namespace _STORY
Function scr_NewGame() As Integer
      '' Create objects for new game here.
      'inv_add(obj_linkScript(createObj,"alvarian river",Keys.Init),1)

     
      obj_create_soul(@scr_Arian,Keys.NewGame)
      'obj_create_soul(@scr_Aya,Keys.NewGame)
      'obj_create_soul(@scr_Bunny1,Keys.NewGame)
      'obj_create_soul(@scr_Bunny2,Keys.NewGame)
      obj_create_soul(@scr_Spider,Keys.NewGame)
      'obj_create_soul(@scr_Crab,Keys.NewGame)
     
      Create_Soul_Sheet()

      '' Now load current animations from char sheet:
      For n As Integer = 1 To n_o
            With obj(n)
                  If .kind = objKinds.Soul Then .anim_set(.anim)
            End With
      Next

      'world_load("world.dat")
      scene = "intro"
      scene_gather_objs()
      'pan_y = -26

      'scr_Intro()

End Function

Function scr_Intro() As Integer

      Dim As Integer rowboat = obj_create_scene("rowboat","rowing",TRUE)
      obj(rowboat).scene = "intro"
     
      scene_gather_objs()
     
      With obj(rowboat)
           
            .x = 240
            .y = 130
            .speedx = .6
            .speedy = .001
            .scale = .5
            .rgb_r = 255
            .rgb_g = 255
            .rgb_b = 255
            .addlight = 0
           
            Dim As Single cycle
           
            Do
                  cycle += .2
                  __continue(TRUE)
                  .move(0,.1)
                  .scale += (.y-123) / 8000
                  If .an.enabled AndAlso .an.frame >= 7 AndAlso .an.frame <= 9 Then .y += .04 + .y / 10000
                  If .y < 145 Then .speedy += .0002 + .y / 100000 Else .speedy += .0002 - .y / 100000
                  If Int(.y) = 145 AndAlso .anim_prev <> "rowing" Then .anim_set("gliding")
                  If .scale >= .9 Then .scale = .9
                  .addlight = Fix(cycle)
                  '.rgb_r = 70 + Fix(cycle)
                  '.rgb_g = 150 + Fix(cycle)
                  If .y > 152 Then Exit Do
            Loop
           
      End With

End Function

Function scr_General(oMe As _obj_ Ptr, key As Keys, oYou As _obj_ Ptr = 0) As Integer
      '' This is the default script for all objects. It can be called from within a private script as well.
      '' General scripting for when an object (oMe) is being acted upon (key) by an indirect object (oYou).
      '' This makes up general object functionality, such as opening/closing, turning on/off, and other basics.
      '' Examples: PC right-clicks a door mouse zone while standing within same object's trig zone.

End Function

Function scr_Arian(oMe As _obj_ Ptr, key As Keys, oYou As _obj_ Ptr = 0) As Integer

      Static As Integer cycles
     
      With *oMe
      Select Case key
      Case Keys.Init
            .sID = "arian"
            .s.sex = 1
            .s.shadow = 4
            .s.pa.typ = PathFindGridType.FollowCam
            .s.pa.go = FALSE
            .s.pa.cw = 2
            .s.pa.ch = 2
            .speedx = .8'.6
            .speedy = .6'.4
            .hasMenu = TRUE
            .bz.en = FALSE
            .bz.tp = BaseIsOpen
            .bz.x1 = .w\2 : .bz.y1 = -.h\4 : .bz.x2 = -.w\2 : .bz.y2 = -.h\4
            .bz.x3 = -.w\2 : .bz.y3 = 0      : .bz.x4 = .w\2 : .bz.y4 = 0
            .mz.en = TRUE
            .mz.x1 = .w\2      : .mz.y1 = -.h+1: .mz.x2 = -.w\2: .mz.y2 = -.h+1
            .mz.x3 = -.w\2      : .mz.y3 = 1       : .mz.x4 = .w\2      : .mz.y4 = 1
            '.only_LR = TRUE
           
      Case Keys.NewGame
            .scene = "intro"
            .anim = "stand"
            .x = 150
            .y = 160
            .facing = 2
            .w = 32 : .h = 38
            .s.pa.x = .x
            .s.pa.y = .y
           
            .gID = "arian"
            .s.filename = "arian_body.gma"
            .s.gfxLayer(1).filename = "arian_body.png"
            '.s.gfxLayer(2).filename = "cloak1.png"
           
            .s.stat(xp).val = 0
            .s.stat(xp).max = 100
            .s.level = 1
            .s.stat(hp).val = 20
            .s.stat(hp).max = 55
            .s.stat(st).val = 8
            .s.stat(ag).val = 12
            .s.skill.fighting.base = 8
            .s.skill.archery.dmg_base = 25
           
      Case Keys.ResumeGame
     
      Case Keys.GetMenu
            With menu
            .title = "Testing"
            .optn(1) = "Talk to Aya"
            .optn(2) = "Fart"
            .optn(3) = "Camp Here"
            .optn(4) = "Sleep"
            End With
           
      Case Keys.MenuOption
            If menu.c_opt = 1 Then
                  Dim As Integer c
                  c = Convo("Aya","After you eat you can look around in the house. I will go out and send a message to your family. They will be very happy to hear about you. But we don't want to move too fast. Is it okay?","Aya-Smile",, _
                  "No problem.", "What kind of recovery do you mean?","That would be great.")
                  c = Convo("Aya","I will go out and send a message to your family. They will be very happy to hear about you. But we don't want to move too fast.","Aya-Smile",, _
                  "No problem.", "That would be great.")
                  c = Convo("Aya","We will help you. Is it okay?","Aya-Smile",, _
                  "No problem.", "What kind of recovery do you mean?","That would be great.")
                  c = Convo("Aya","So I will come here with my brother sometimes, and we will help you. Is it okay?","Aya-Smile",, _
                  "No problem.")
                  c = Convo("Aya","But we don't want to move too fast. So I will come here with my brother sometimes, and we will help you. Is it okay?","Aya-Smile",, _
                  "No problem.", "What kind of recovery do you mean?","That would be great.","That would be great.")
                  If c = 1 Then
                        msgbox("After you eat you can look around in the house. I will go out and send a message to your family. They will be very happy to hear about you. But we don't want to move too fast. So I will come here with my brother sometimes, and we will help you. Is it okay?")
                  Else
                        msgbox("else")
                  EndIf
                 
                  'MsgBox(0,SCR_H-48,"Aya: Aw, *giggle* Very sorry. I know it's strange for you. But, I am a ... familiar this kind of recovery.",6,34)
            ElseIf menu.c_opt = 2 Then
                  MsgBox("*FART*")
            EndIf
           
      Case Keys.AnimNewFrame
            If .anim = "drawbow" AndAlso .an.frame = 5 Then
                  fbs_Play_Wave(sfxArrowRelease)
            EndIf
           
      Case Keys.AnimFinishedPlayCount
            Select Case .anim
            Case "kick","talk"
                  .Anim_Set("stand")
            Case "drawbow"
                  .Anim_Set("sitbeetle")
            End Select
           
      Case Keys.Move
            .Anim_Set("walk")
            '.Anim_Set("walk")
            'If .y < 150 Then .scale = 1 + -(150 + .y) / 100
           
            If (.anim="ridebeetle" AndAlso .an.frame Mod 2 ) _
            OrElse (.anim="walk" AndAlso .an.frame=1 Or .an.frame=4 ) _
            AndAlso .an.countdown = .an.f(.an.frame).delay Then
                  fbs_Play_Wave(sfxStepSand,1,CSng(Rnd*.2)+1,CSng(Rnd*.2)+.1)
            EndIf
           
      Case Keys.NoArrowKeys, Keys.HitNoGo, Keys.PathfindBroke, Keys.NodeStop
            If .anim = "walk" then .Anim_Set("stand")
            'If .anim = "walk" then .Anim_Set("stand")
           
      Case Keys.Entered_SenseRad
            'battle_active = oYou.s.group
            'Battle_Init(battle_active)
           
      Case Keys.Moved
            If battle_active And battle_turn = 1 Then .s.stat(mp).val -= 1
           
      Case Keys.SpeedUp
            'If .action = Actions.Walk Then .speed = 2
     
      Case Keys.KeyB_SpaceBar
            If .anim<>"drawbow" Then
                  .Anim_Set("drawbow",1)
                  fbs_Play_Wave(sfxArrowDraw)
            EndIf
           
      End Select
      End With
      Return 0

End Function

Function scr_Aya(oMe As _obj_ Ptr, key As Keys, oYou As _obj_ Ptr = 0) As Integer

      Static As Integer cycles, opdir, StepSeq
      Static As Double lastFootStepTime
      If lastFootStepTime = 0 Then lastFootStepTime = Timer
     
      With *oMe
      Select Case key
      Case Keys.Init
            .sID = "aya"
            .s.sex = 2
            .s.shadow = 4
            .s.pa.typ = 0
            .s.pa.go = FALSE
            .s.pa.cw = 2
            .s.pa.ch = 2
            .s.pa.x = .x
            .s.pa.y = .y
            .speedx = .5
            .speedy = .4
            .hasMenu = TRUE
     
      Case Keys.NewGame
            .scene = "bridge"
            .anim = "stand"
            .x = 238
            .y = 120
            .facing = 4
            .w = 32 : .h = 38
           
            .gID = "aya"
            .s.filename = "aya_body.gma"
            .s.gfxLayer(1).filename = "aya_body.png"
            '.s.gfxLayer(2).filename = "cloak1.png"

           
      Case Keys.GetMenu
            With menu
            .title = "Testing"
            .optn(1) = "Talk to Arian"
            .optn(2) = "Dance"
            .optn(3) = "Camp Here"
            .optn(4) = "Sleep"
            End With
           
      Case Keys.MenuOption
            If menu.c_opt = 1 Then
            EndIf
           
      Case Keys.AnimFinishedPlayCount
            Select Case .anim
            Case "kick","shootbow","talk"
                  .Anim_Set("stand")
                 
            End Select
           
      Case Keys.Move
            .Anim_Set("walk")
           
            If Timer > lastFootStepTime + .45 Then
                  lastFootStepTime = Timer
                  StepSeq+= 1
                  If StepSeq > 8 Then StepSeq = 1
                  'fbs_Play_Wave(sfxWetStep(StepSeq),1)
            EndIf
           
      Case Keys.NoArrowKeys, Keys.HitNoGo, Keys.PathfindBroke
            If .anim = "walk" then .Anim_Set("stand")
           
      Case Keys.Entered_SenseRad
            'battle_active = oYou.s.group
            'Battle_Init(battle_active)
      Case Keys.Moved
            If battle_active <> 0 And battle_turn = 1 Then .s.stat(mp).val -= 1
      Case Keys.SpeedUp
            'If .action = Actions.Walk Then .speed = 2
      End Select
      End With
      Return 0

End Function

Function scr_Bunny1(oMe As _obj_ Ptr, key As Keys, oYou As _obj_ Ptr = 0) As Integer

      With *oMe
      Select Case key

      Case Keys.NewGame
            .scene = "bridge"
            .facing = 1
            .anim = "stand"
            .x = 8
            .y = 105
           
            .gID = "bunny"
            .s.filename = "bunny.gma"
            .s.gfxLayer(1).filename = "bunny.png"
           
            .de.go = TRUE
            .de.countdown = 200
            .d(1).x = .x+20      :      .d(1).y = .y+10      :      .d(1).delay = 200
            .d(2).x = .x      :      .d(2).y = .y      :      .d(2).delay = 100
            .d(3).x = .x+10      :      .d(3).y = .y+5      :      .d(3).delay = 50      :      .d(3).go = dNodes.First
     
      Case Else
            scr_Bunny_(oMe,key,oYou)
     
      End Select
      End With
      Return 0
End Function

Function scr_Bunny2(oMe As _obj_ Ptr, key As Keys, oYou As _obj_ Ptr = 0) As Integer

      With *oMe
      Select Case key

      Case Keys.NewGame
            .scene = "bridge"
            .facing = 1
            .anim = "stand"
            .x = 80
            .y = 105
           
            .gID = "bunny"
           
            .de.go = TRUE
            .de.countdown = 200
            .d(1).x = .x-20      :      .d(1).y = .y-10      :      .d(1).delay = 200
            .d(2).x = .x      :      .d(2).y = .y      :      .d(2).delay = 100
            .d(3).x = .x+10      :      .d(3).y = .y+5      :      .d(3).delay = 50      :      .d(3).go = dNodes.First

      Case Else
            scr_Bunny_(oMe,key,oYou)
     
      End Select
      End With
      Return 0
End Function

Function scr_Bunny_(oMe As _obj_ Ptr, key As Keys, oYou As _obj_ Ptr = 0) As Integer

      With *oMe
      Select Case key
      Case Keys.Init
            .sID = "bunny"
            .w = 16 : .h = 16
            .only_LR = TRUE
            .s.pa.typ = 0
            .s.pa.go = FALSE
            .s.pa.cw = 2
            .s.pa.ch = 2
            .s.pa.x = .x
            .s.pa.y = .y
            .speedx = .2
            .speedy = .2
            .hasMenu = TRUE
     
            .bz.en = FALSE
            .bz.tp = BaseIsOpen
            .bz.x1 = .w\2 : .bz.y1 = -.h\4 : .bz.x2 = -.w\2 : .bz.y2 = -.h\4
            .bz.x3 = -.w\2 : .bz.y3 = 0      : .bz.x4 = .w\2 : .bz.y4 = 0
            .mz.en = FALSE
            .mz.x1 = 4 : .mz.y1 = -8      : .mz.x2 = -4 : .mz.y2 = -8
            .mz.x3 = -4 : .mz.y3 = 0 : .mz.x4 = 4 : .mz.y4 = 0

      Case Keys.Move
            .Anim_Set("hop")
            If .an.frame >= 2 And .an.frame <= 4 Then .speedx = .2 : .speedy = .2 Else .speedx = .1 : .speedy = .1
           
      Case Keys.HitNoGo, Keys.PathfindBroke, Keys.NodeWait, Keys.NodeStop
            If .anim = "hop" then .Anim_Set("stand")
           
      Case Keys.Entered_SenseRad
           
      Case Keys.GetMenu
      Case Keys.MenuOption
            If menu.c_opt = 1 Then
            EndIf
     
      End Select
      End With
      Return 0
End Function

Function scr_Spider(oMe As _obj_ Ptr, key As Keys, oYou As _obj_ Ptr = 0) As Integer

      With *oMe
      Select Case key
      Case Keys.Init
            .sID = "spider"
            .only_LR = TRUE
            .s.pa.typ = 1
            .s.pa.go = FALSE
            .s.pa.cw = 2
            .s.pa.ch = 2
            .speedx = .6
            .speedy = .5
            .hasMenu = TRUE
     
            .bz.en = FALSE
            .bz.tp = BaseIsOpen
            .bz.x1 = .w\2 : .bz.y1 = -.h\4 : .bz.x2 = -.w\2 : .bz.y2 = -.h\4
            .bz.x3 = -.w\2 : .bz.y3 = 0      : .bz.x4 = .w\2 : .bz.y4 = 0
            .mz.en = FALSE
            .mz.x1 = 4 : .mz.y1 = -8      : .mz.x2 = -4 : .mz.y2 = -8
            .mz.x3 = -4 : .mz.y3 = 0 : .mz.x4 = 4 : .mz.y4 = 0
           
            .s.skill.sensing.rad_w = 50
            .s.skill.sensing.rad_h = 25
            .s.skill.sensing.range = 10

      Case Keys.NewGame
            .scene = "intro"
            .facing = 4
            .anim = "stand"
            .x = 220
            .y = 156
            .w = 64 : .h = 32
            .s.pa.x = .x
            .s.pa.y = .y
                       
            .gID = "spider"
            .s.filename = "spider.gma"
            .s.gfxLayer(1).filename = "spider.png"
           
            .de.go = TRUE
            .de.countdown = 200
            .d(1).x = .x+60      :      .d(1).y = .y+20      :      .d(1).delay = 200
            .d(2).x = .x      :      .d(2).y = .y      :      .d(2).delay = 100
            .d(3).x = .x-80      :      .d(3).y = .y+5      :      .d(3).delay = 50      :      .d(3).go = dNodes.Random
            For n As Integer = 1 To 2 : .d(n).go = dNodes.Nxt : Next
           
      Case Keys.Move
            .Anim_Set("walk")
           
      Case Keys.HitNoGo, Keys.PathfindBroke, Keys.NodeStop
            If .anim = "walk" then .Anim_Set("stand")
     
      Case Keys.NodeWait
            If .anim = "walk" then .Anim_Set("stand")
            'Randomize
            '.d(1).x += Int(Rnd*60)-30
           
      Case Keys.Entered_SenseRad
     
      Case Keys.Entered_My_SenseRad
            .x+=1
           
      Case Keys.Moved

      Case Keys.GetMenu
      Case Keys.MenuOption
            If menu.c_opt = 1 Then
            EndIf
     
      End Select
      End With
      Return 0
End Function

Function scr_Crab(oMe As _obj_ Ptr, key As Keys, oYou As _obj_ Ptr = 0) As Integer

      With *oMe
      Select Case key
      Case Keys.Init
            .sID = "crab"
            .scale = 1.0
            .only_LR = TRUE
            .s.pa.typ = 0
            .s.pa.go = FALSE
            .s.pa.cw = 2
            .s.pa.ch = 2
            .s.pa.x = .x
            .s.pa.y = .y
            .speedx = .6
            .speedy = .5
            .hasMenu = TRUE
     
            .bz.en = FALSE
            .bz.tp = BaseIsOpen
            .bz.x1 = .w\2      : .bz.y1 = -.h\4 : .bz.x2 = -.w\2 : .bz.y2 = -.h\4
            .bz.x3 = -.w\2      : .bz.y3 = 0      : .bz.x4 = .w\2 : .bz.y4 = 0
            .mz.en = FALSE
            .mz.x1 = 4      : .mz.y1 = -8      : .mz.x2 = -4      : .mz.y2 = -8
            .mz.x3 = -4      : .mz.y3 = 0      : .mz.x4 = 4      : .mz.y4 = 0

      Case Keys.NewGame
            .scene = ""
            .facing = 4
            .anim = "stand"
            .x = 130
            .y = 175
            .w = 64 : .h = 32
           
            .gID = "crab"
            .s.filename = "crab.gma"
            .s.gfxLayer(1).filename = "crab.png"
           
      Case Keys.Move
            '.Anim_Set("walk")
           
      Case Keys.HitNoGo, Keys.PathfindBroke, Keys.NodeWait
            If .anim = "walk" then .Anim_Set("stand")
           
      Case Keys.Entered_SenseRad
           
      Case Keys.Moved

      Case Keys.GetMenu
      Case Keys.MenuOption
            If menu.c_opt = 1 Then
            EndIf
     
      End Select
      End With
      Return 0
End Function


Function scr_Scene_Well(key As Keys) As Integer
      Select Case key
      Case Keys.LoadScene
            'scene_game_load("well.map")
      Case Keys.Seq1
            With obj(Me)
            .WalkTo(-80,0)
            'Dialog("Well, here I am... getting soaking wet.")
            '__continue(FALSE,2)
            '.face(3)
            '__continue(FALSE,.5)
            '.face(2)
            '__continue(FALSE,3)
            'Dialog("Need to find some food, I'm starving.")
            '.WalkTo(300,0)
            End With
      End Select
      Return 0
End Function

Function scr_Worm(oMe As _obj_ Ptr, key As Keys, oYou As _obj_ Ptr = 0) As Integer

End Function

Function scr_Item_AlvarianRiver(oMe As _obj_ Ptr, key As Keys, oYou As _obj_ Ptr = 0) As Integer
     
      With *oMe
      Select Case key
      Case Keys.Init
            .kind = objKinds.Item
            .upright = TRUE
            '.global = TRUE
            .w = 64
            .h = 64
            '.bx = .w\2
            '.by = .h-4
            .x = 320
            .y = 240
            .scale = 1.0
            '.scale_h = 1.0
            .visible = FALSE
           
            '.it.thumb = spr_with_id(@thm_spr(0),"Alvarian River")
            .it.titl = "Alvarian River"
            .it.desc = "Delicious and pure water from Alvarian country rivers."
            .it.qty = 2
           

      Case Keys.AlwaysPreInput
           
      End Select
      End With
      Return 0     

End Function


End Namespace


<- back