home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CyberMycha 2006 April
/
SGP.iso
/
dema
/
Keepsake-Demo-en-li-v1.0.exe
/
res
/
scenes
/
common
/
introduction
/
main.tcl
< prev
next >
Wrap
Text File
|
2006-01-25
|
46KB
|
1,266 lines
source "[AUTO]/introduction.mvwrap.tcl"
## ===================================================== ##
## The after effect of the first Vision ##
## ===================================================== ##
proc subtitle {widget label who text delay} {
set color "1 1 1"
oz'event {
eval "oz'label::property $label -color $color -text \\\"$text\\\""
}
oz'event {
oz'widget::fadeto $widget 1 0.1
oz'delay 0.1
}
oz'event {
oz'delay [expr $delay - 0.2]
}
oz'event {
oz'widget::fadeto $widget 0 0.1
oz'delay 0.1
}
}
proc update_var {} {
set ::config::user::voice_volume [expr double([itf'slider::get_pos $itfopt::($itf::opt,voice)]) / 10.0]
set ::config::user::soundfx_volume [expr double([itf'slider::get_pos $itfopt::($itf::opt,sfx)]) / 10.0]
set ::config::user::music_volume [expr double([itf'slider::get_pos $itfopt::($itf::opt,music)]) / 25]
set ::config::user::gamma_correction [expr double([itf'slider::get_pos $itfopt::($itf::opt,gamma)]) / 10.0]
if {$::config::user::music_volume == 0} {
set ::config::user::music_volume 0.01
}
set ::config::voice::volume $::config::user::voice_volume
set ::config::soundfx::volume $::config::user::soundfx_volume
set ::config::music::volume $::config::user::music_volume
set ::config::ambient2d::volume $::config::user::soundfx_volume
set ::ref_voice_volume $::config::user::voice_volume
set ::ref_soundfx_volume $::config::user::soundfx_volume
set ::ref_music_volume $::config::user::music_volume
set ::ref_ambient2d_volume $::config::user::soundfx_volume
oz'track::play $::music_track "sound/music/introKeepsake.ogg" -repeat 1
masterVolume $::config::music::volume
updateGamma
updateVolume
}
proc ShowIntroPanel {} {
set ::itf::logo [new oz'sprite "interface/[MODE]/intro/intro.logo"]
set ::itf::intro [new itf'intro]
set ::itf::vers [new oz'label "version" 0.13 0.07]
set ::itf::vbox [new oz'widget "vbox"]
oz'label::property $::itf::vers -pos 0 0 -font system.ttf -fsize 16 -color 0 0 0.1 -alpha 1 -text "Keepsake Demo v1.0"
oz'widget::property $::itf::vbox -pos 0 0.93 -alpha 0
oz'widget::property $::itf::logo -pos 0.246582 0.083333 -alpha 0
oz'widget::property $::itf::intro -pos 0.328125 0.657552 -alpha 0
oz'widget::child [FOREGROUNDWIDGET] $::itf::logo 0.5
oz'widget::child [FOREGROUNDWIDGET] $::itf::intro 0.5
oz'widget::child $::itf::vbox $::itf::vers 0.5
oz'widget::child [FOREGROUNDWIDGET] $::itf::vbox 0.5
wq'widget::fadeto $::itf::logo 1
wq'widget::fadeto $::itf::intro 1
wq'widget::fadeto $::itf::vbox 0.5
}
proc ShowSaveGamePanel {} {
set y 0.041666
for {set i 1} {$i <= 5} {incr i} {
set ::itf::game$i 0
if [file exists "[ROOT]/save/savegame$i.tcl"] {
set ::itf::game$i [new itf'game $i]
oz'widget::property [set ::itf::game$i] -pos 0.0625 $y -alpha 0
oz'widget::child [FOREGROUNDWIDGET] [set ::itf::game$i] 0.5
}
set y [expr $y + 0.1875]
}
oz'event {wizDisableMouse}
for {set i 1} {$i <= 5} {incr i} {
if [set ::itf::game$i] {
oz'event {
oz'widget::fadeto [set ::itf::game$i] 1
oz'delay 0.125
}
}
}
oz'event {
set ::itf::back [new itf'back]
oz'widget::property [set ::itf::back] -pos 0.703125 0.791666 -alpha 0
oz'widget::child [FOREGROUNDWIDGET] [set ::itf::back] 0.5
oz'widget::fadeto [set ::itf::back] 1
oz'delay 0.125
}
oz'event {wizEnableMouse}
}
proc CloseSaveGamePanel {} {
wq'widget::fadeto $::itf::game1 0
wq'widget::fadeto $::itf::game2 0
wq'widget::fadeto $::itf::game3 0
wq'widget::fadeto $::itf::game4 0
wq'widget::fadeto $::itf::game5 0
wq'widget::fadeto $::itf::history 0
wq'widget::fadeto $::itf::back 0
}
proc DeleteSaveGamePanel {} {
wq'widget::delete& ::itf::game1
wq'widget::delete& ::itf::game2
wq'widget::delete& ::itf::game3
wq'widget::delete& ::itf::game4
wq'widget::delete& ::itf::game5
wq'widget::delete& ::itf::history
wq'widget::delete& ::itf::back
}
class itf'history {
proc itf'history {this n} oz'widget {itf'game} {
set roomname "Unknown"
set icon [expr int(rand() * 10)]
if [file exists "[ROOT]/save/savegame$n-info.tcl"] {
if [catch {source "[ROOT]/save/savegame$n-info.tcl"}] {
set roomname "Unknown"
set icon [expr int(rand() * 10)]
}
}
set ($this,bg) [new oz'sprite "interface/[MODE]/history/history.bg"]
if [file exists "[ROOT]/save/ss$n-[MODE].tga"] {
set ($this,ss) [new oz'sprite "save/ss$n-[MODE]"]
} else {
set ($this,ss) [new oz'sprite "save/newgamess-[MODE]"]
}
set ($this,icon) [new oz'sprite "interface/[MODE]/intro/intro.icon/intro.icon.$icon"]
set ($this,enter) [new oz'button "interface/[MODE]/intro/intro.enter"]
set ($this,erase) [new oz'button "interface/[MODE]/intro/intro.erase"]
set ($this,name) [new oz'label "name" 0.227539 0.061197]
set ($this,time) [new oz'label "time" 0.227539 0.061197]
set ($this,time0) [new oz'label "time0" 0.227539 0.061197]
set ($this,time1) [new oz'label "time1" 0.227539 0.061197]
set ($this,time2) [new oz'label "time2" 0.227539 0.061197]
set ($this,time3) [new oz'label "time3" 0.227539 0.061197]
set ($this,time4) [new oz'label "time4" 0.227539 0.061197]
set ($this,time5) [new oz'label "time5" 0.227539 0.061197]
set ($this,time6) [new oz'label "time6" 0.227539 0.061197]
set ($this,time7) [new oz'label "time7" 0.227539 0.061197]
set ($this,enter0) [new oz'button "interface/[MODE]/intro/intro.enter"]
set ($this,enter1) [new oz'button "interface/[MODE]/intro/intro.enter"]
set ($this,enter2) [new oz'button "interface/[MODE]/intro/intro.enter"]
set ($this,enter3) [new oz'button "interface/[MODE]/intro/intro.enter"]
set ($this,enter4) [new oz'button "interface/[MODE]/intro/intro.enter"]
set ($this,enter5) [new oz'button "interface/[MODE]/intro/intro.enter"]
set ($this,enter6) [new oz'button "interface/[MODE]/intro/intro.enter"]
set ($this,enter7) [new oz'button "interface/[MODE]/intro/intro.enter"]
set time [file mtime "[ROOT]/save/savegame$n.tcl"]
set time [ctime $time]
oz'label::property $($this,name) -pos 0.234375 0.026041 -font system.ttf -fsize 16 -color 1 1 1
oz'label::property $($this,time) -pos 0.234375 0.087239 -font system.ttf -fsize 14 -color 1 1 1
set name ""
catch {set name $::lng::roomName($roomname)}
oz'label::property $($this,name) -text "$name"
oz'label::property $($this,time) -text "$time"
set max 0
while 1 {
if ![file exists "[ROOT]/save/$n/$max.tcl"] {
break
}
incr max
}
incr max -1
oz'button::disable $($this,enter0)
oz'button::disable $($this,enter1)
oz'button::disable $($this,enter2)
oz'button::disable $($this,enter3)
oz'button::disable $($this,enter4)
oz'button::disable $($this,enter5)
oz'button::disable $($this,enter6)
oz'button::disable $($this,enter7)
set p 0
set ($this,gamenb0) 0
set ($this,gamenb1) 0
set ($this,gamenb2) 0
set ($this,gamenb3) 0
set ($this,gamenb4) 0
set ($this,gamenb5) 0
set ($this,gamenb6) 0
set ($this,gamenb7) 0
for {set i $max} {$i >= 0 && $i > [expr $max - 8]} {incr i -1} {
if ![file exists "[ROOT]/save/$n/$i.tcl"] {
break
}
set roomname "Unknown"
set icon [expr int(rand() * 10)]
if [file exists "[ROOT]/save/$n/$i-info.tcl"] {
if [catch {source "[ROOT]/save/$n/$i-info.tcl"}] {
set roomname "Unknown"
set icon [expr int(rand() * 10)]
}
}
set time ""
catch {set time $::lng::roomName($roomname)}
oz'label::property $($this,time$p) -pos 0.234375 [expr 0.083333*$p + 0.177] \
-font system.ttf -fsize 16 -color 1 1 1
oz'label::property $($this,time$p) -text $time
oz'button::enable $($this,enter$p)
set ($this,gamenb$p) $i
incr p
}
oz'button::property $($this,enter) -click itf'game::enter2 $n $icon
oz'button::property $($this,erase) -click itf'game::erase $n
oz'button::property $($this,enter0) -click itf'history::enter_old $($this,gamenb0) $n $icon
oz'button::property $($this,enter1) -click itf'history::enter_old $($this,gamenb1) $n $icon
oz'button::property $($this,enter2) -click itf'history::enter_old $($this,gamenb2) $n $icon
oz'button::property $($this,enter3) -click itf'history::enter_old $($this,gamenb3) $n $icon
oz'button::property $($this,enter4) -click itf'history::enter_old $($this,gamenb4) $n $icon
oz'button::property $($this,enter5) -click itf'history::enter_old $($this,gamenb5) $n $icon
oz'button::property $($this,enter6) -click itf'history::enter_old $($this,gamenb6) $n $icon
oz'button::property $($this,enter7) -click itf'history::enter_old $($this,gamenb7) $n $icon
oz'widget::property $($this,icon) -pos 0.5 0
oz'widget::property $($this,enter) -pos 0.188477 [expr 0.031250 + 0.001]
oz'widget::property $($this,erase) -pos 0.188477 0.096354
oz'widget::property $($this,enter0) -pos 0.187500 [expr 0.184896 - 0.000]
oz'widget::property $($this,enter1) -pos 0.187500 [expr 0.268229 - 0.000]
oz'widget::property $($this,enter2) -pos 0.187500 [expr 0.351563 - 0.000]
oz'widget::property $($this,enter3) -pos 0.187500 [expr 0.434896 - 0.000]
oz'widget::property $($this,enter4) -pos 0.187500 [expr 0.518229 - 0.000]
oz'widget::property $($this,enter5) -pos 0.187500 [expr 0.601563 - 0.000]
oz'widget::property $($this,enter6) -pos 0.187500 [expr 0.684896 - 0.000]
oz'widget::property $($this,enter7) -pos 0.187500 [expr 0.766927 - 0.000]
oz'widget::child $this $($this,bg) 0.5
oz'widget::child $this $($this,ss) 1
oz'widget::child $this $($this,icon) 1
oz'widget::child $this $($this,enter) 0
oz'widget::child $this $($this,erase) 0
oz'widget::child $this $($this,name) 0
oz'widget::child $this $($this,time) 0
oz'widget::child $this $($this,time0) 0
oz'widget::child $this $($this,time1) 0
oz'widget::child $this $($this,time2) 0
oz'widget::child $this $($this,time3) 0
oz'widget::child $this $($this,time4) 0
oz'widget::child $this $($this,time5) 0
oz'widget::child $this $($this,time6) 0
oz'widget::child $this $($this,time7) 0
oz'widget::child $this $($this,enter0) 0
oz'widget::child $this $($this,enter1) 0
oz'widget::child $this $($this,enter2) 0
oz'widget::child $this $($this,enter3) 0
oz'widget::child $this $($this,enter4) 0
oz'widget::child $this $($this,enter5) 0
oz'widget::child $this $($this,enter6) 0
oz'widget::child $this $($this,enter7) 0
}
proc ~itf'history {this} {
delete $($this,bg)
delete $($this,ss)
delete $($this,icon)
delete $($this,enter)
delete $($this,erase)
delete $($this,name)
delete $($this,time)
delete $($this,time0)
delete $($this,time1)
delete $($this,time2)
delete $($this,time3)
delete $($this,time4)
delete $($this,time5)
delete $($this,time6)
delete $($this,time7)
delete $($this,enter0)
delete $($this,enter1)
delete $($this,enter2)
delete $($this,enter3)
delete $($this,enter4)
delete $($this,enter5)
delete $($this,enter6)
delete $($this,enter7)
}
proc enter_old {slot n c} {
iactive interface.sidebar true
ozIMenu enable menu
iactive interface.help true
ozIMenu enable help
setGameNumber $n $c
CloseSaveGamePanel
oz'event {oz'delay 0.25}
oz'event {wizDisableMouse}
oz'event {standardFadeout}
oz'event {oz'track::stop $::music_track}
oz'event {wizqEntityStopFollow Zak}
oz'event {
if [info exists ::debug_] {
source "[ROOT]/save/$n/$slot.tcl"
} else {
if [catch {source "[ROOT]/save/$n/$slot.tcl"}] {
ozMessage "$::lng::i_corrupted"
closeGameNoSave
}
}
}
oz'event {
if !\$::isGameReady {
oz'event {initializeGame}
oz'event {showInterface}
DeleteSaveGamePanel
oz'event {oz'delay 0.01}
oz'event {standardFadein}
oz'event {wizEnableMouse}
oz'event {set ::isGameReady 1}
}
}
oz'flush
}
}
class itf'message {
proc itf'message {this msg} oz'widget {itf'message} {
set ($this,bg) [new oz'sprite "interface/[MODE]/intro/intro.message.bg"]
set ($this,ok) [new oz'button "interface/[MODE]/intro/intro.ok"]
set ($this,label) [new oz'label "message" 0.768554 0.058593]
oz'widget::property $($this,ok) -pos 0.419922 0.089844
oz'button::property $($this,ok) -click itf'message::ok
oz'label::property $($this,label) -pos 0.053710 0.016927 -font caligula.ttf -fsize 24 -color 1 1 1
oz'label::property $($this,label) -text "$msg"
oz'widget::child $this $($this,bg) 0.5
oz'widget::child $this $($this,ok) 0
oz'widget::child $this $($this,label) 0
}
proc ~itf'message {this} {
delete $($this,bg)
delete $($this,ok)
delete $($this,label)
}
proc ok {} {
wq'widget::fadeto $::itf::message 0 -wait
oz'event {ShowIntroPanel}
wq'widget::delete& ::itf::message
oz'flush
}
}
class itf'message2 {
proc itf'message2 {this msg n} oz'widget {itf'message2} {
set ($this,bg) [new oz'sprite "interface/[MODE]/intro/intro.message.bg"]
set ($this,ok) [new oz'button "interface/[MODE]/intro/intro.ok"]
set ($this,label) [new oz'label "message" 0.768554 [expr 0.058593]]
oz'widget::property $($this,ok) -pos 0.419922 0.089844
oz'button::property $($this,ok) -click itf'message2::ok $n
oz'label::property $($this,label) -pos 0.053710 0.020 -font system.ttf -fsize 16 -color 1 1 1
oz'label::property $($this,label) -text "$msg"
oz'widget::child $this $($this,bg) 0.5
oz'widget::child $this $($this,ok) 0
oz'widget::child $this $($this,label) 0
}
proc ~itf'message2 {this} {
delete $($this,bg)
delete $($this,ok)
delete $($this,label)
}
proc ok {n} {
wq'widget::fadeto $::itf::message 0 -wait
set ::itf::history [new itf'history $n]
oz'widget::property $::itf::history -pos 0.062500 0.041667 -alpha 0
oz'widget::child [FOREGROUNDWIDGET] $::itf::history 0.5
wq'widget::fadeto $::itf::history 1
oz'event {oz'delay 0.125}
oz'event {
set ::itf::back [new itf'back]
oz'widget::property [set ::itf::back] -pos 0.703125 0.791666 -alpha 0
oz'widget::child [FOREGROUNDWIDGET] [set ::itf::back] 0.5
oz'widget::fadeto [set ::itf::back] 1
oz'delay 0.125
}
wq'widget::delete& ::itf::message
oz'flush
}
}
class itf'delete {
proc itf'delete {this n} oz'widget {itf'delete} {
set ($this,bg) [new oz'sprite "interface/[MODE]/intro/intro.delete.bg"]
set ($this,yes) [new oz'button "interface/[MODE]/intro/intro.yes"]
set ($this,no) [new oz'button "interface/[MODE]/intro/intro.no"]
set ($this,label) [new oz'label "question" 0.768554 0.058593]
oz'widget::property $($this,yes) -pos 0.279297 0.089849
oz'button::property $($this,yes) -click itf'delete::yes $n
oz'widget::property $($this,no) -pos 0.560547 0.089849
oz'button::property $($this,no) -click itf'delete::no
oz'label::property $($this,label) -pos 0.053710 0.016927 -font caligula.ttf -fsize 24 -color 1 1 1 \
-text $::lng::i_confirm
oz'widget::child $this $($this,bg) 0.5
oz'widget::child $this $($this,yes) 0
oz'widget::child $this $($this,no) 0
oz'widget::child $this $($this,label) 0
}
proc ~itf'delete {this} {
delete $($this,bg)
delete $($this,yes)
delete $($this,no)
delete $($this,label)
}
proc yes {n} {
wq'widget::fadeto $::itf::delete 0 -wait
oz'event {
set m 0
for {set i $n} {\$i <= 7} {incr i} {
if ![file exists "[ROOT]/save/savegame\$i.tcl"] {
set m [expr \$i-1]
break
}
}
for {set i $n} {\$i < \$m} {incr i} {
catch {file copy -force "[ROOT]/save/savegame[expr \$i+1].tcl" "[ROOT]/save/savegame\$i.tcl"}
catch {file copy -force "[ROOT]/save/savegame[expr \$i+1]-info.tcl" "[ROOT]/save/savegame\$i-info.tcl"}
catch {file copy -force "[ROOT]/save/ss[expr \$i+1]-[MODE].tga" "[ROOT]/save/ss\$i-[MODE].tga"}
catch {file mkdir "[ROOT]/save/\$i"}
catch {file copy -force "[ROOT]/save/[expr \$i+1]/0.tcl" "[ROOT]/save/\$i/0.tcl"}
catch {file copy -force "[ROOT]/save/[expr \$i+1]/1.tcl" "[ROOT]/save/\$i/1.tcl"}
catch {file copy -force "[ROOT]/save/[expr \$i+1]/2.tcl" "[ROOT]/save/\$i/2.tcl"}
catch {file copy -force "[ROOT]/save/[expr \$i+1]/3.tcl" "[ROOT]/save/\$i/3.tcl"}
catch {file copy -force "[ROOT]/save/[expr \$i+1]/4.tcl" "[ROOT]/save/\$i/4.tcl"}
catch {file copy -force "[ROOT]/save/[expr \$i+1]/5.tcl" "[ROOT]/save/\$i/5.tcl"}
catch {file copy -force "[ROOT]/save/[expr \$i+1]/6.tcl" "[ROOT]/save/\$i/6.tcl"}
catch {file copy -force "[ROOT]/save/[expr \$i+1]/7.tcl" "[ROOT]/save/\$i/7.tcl"}
}
catch {file delete -force "[ROOT]/save/savegame\$m.tcl"}
catch {file delete -force "[ROOT]/save/savegame\$m-info.tcl"}
catch {file delete -force "[ROOT]/save/ss\$m-[MODE].tga"}
catch {file delete -force "[ROOT]/save/\$m"}
if {\$m == 1} {
oz'event {ShowIntroPanel}
} else {
oz'event {ShowSaveGamePanel}
}
}
wq'widget::delete& ::itf::delete
oz'flush
}
proc no {} {
wq'widget::fadeto $::itf::delete 0 -wait
oz'event {ShowSaveGamePanel}
wq'widget::delete& ::itf::delete
oz'flush
}
}
class itf'back {
proc itf'back {this} oz'widget {itf'back} {
set ($this,bg) [new oz'sprite "interface/[MODE]/intro/intro.back.bg"]
set ($this,back) [new oz'button "interface/[MODE]/intro/intro.back"]
set ($this,back.label) [new oz'label "back" 0.131835 0.061197]
oz'widget::property $($this,back) -pos 0.025391 0.059896
oz'button::property $($this,back) -click itf'back::click
oz'label::property $($this,back.label) -pos 0.080242 0.050781 -font caligula.ttf -fsize 24 -color 1 1 1 \
-center 0 -text $::lng::i_back
oz'widget::child $this $($this,bg) 0.5
oz'widget::child $this $($this,back) 0
oz'widget::child $this $($this,back.label) 0
}
proc ~itf'back {this} {
delete $($this,bg)
delete $($this,back)
delete $($this,back.label)
}
proc click {} {
CloseSaveGamePanel
oz'event {oz'delay 0.5}
ShowIntroPanel
DeleteSaveGamePanel
oz'flush
}
}
class itf'intro {
proc itf'intro {this} oz'widget {itf'intro} {
set ($this,bg) [new oz'sprite "interface/[MODE]/intro/intro.bg"]
set ($this,newgame) [new oz'button "interface/[MODE]/intro/intro.newgame"]
set ($this,continue) [new oz'button "interface/[MODE]/intro/intro.continue"]
set ($this,option) [new oz'button "interface/[MODE]/intro/intro.option"]
set ($this,quit) [new oz'button "interface/[MODE]/intro/intro.quit"]
set ($this,newgame.label) [new oz'label "newgame" 0.227539 0.059895]
set ($this,continue.label) [new oz'label "continue" 0.227539 0.059895]
set ($this,option.label) [new oz'label "option" 0.227539 0.059895]
set ($this,quit.label) [new oz'label "quit" 0.227539 0.059895]
oz'widget::property $($this,newgame) -pos 0.028320 0.032552
oz'widget::property $($this,continue) -pos 0.028320 0.096354
oz'widget::property $($this,option) -pos 0.028320 0.160156
oz'widget::property $($this,quit) -pos 0.028320 0.223958
oz'button::property $($this,newgame) -click itf'intro::newgame
oz'button::property $($this,continue) -click itf'intro::continue
oz'button::property $($this,option) -click itf'intro::option
oz'button::property $($this,quit) -click itf'intro::quit
oz'label::property $($this,newgame.label) -pos 0.079218 0.024739 -font caligula.ttf -fsize 24 -color 1 1 1 \
-center 0 -text $::lng::i_newGame
oz'label::property $($this,continue.label) -pos 0.079218 0.087239 -font caligula.ttf -fsize 24 -color 1 1 1 \
-center 0 -text $::lng::i_continue
oz'label::property $($this,option.label) -pos 0.079218 0.151041 -font caligula.ttf -fsize 24 -color 1 1 1 \
-center 0 -text $::lng::i_option
oz'label::property $($this,quit.label) -pos 0.079218 0.214843 -font caligula.ttf -fsize 24 -color 1 1 1 \
-center 0 -text $::lng::i_quit
oz'widget::child $this $($this,bg) 0.5
oz'widget::child $this $($this,newgame) 0
oz'widget::child $this $($this,continue) 0
oz'widget::child $this $($this,option) 0
oz'widget::child $this $($this,quit) 0
oz'widget::child $this $($this,newgame.label) 0
oz'widget::child $this $($this,continue.label) 0
oz'widget::child $this $($this,option.label) 0
oz'widget::child $this $($this,quit.label) 0
}
proc ~itf'intro {this} {
delete $($this,bg)
delete $($this,newgame)
delete $($this,continue)
delete $($this,quit)
delete $($this,newgame.label)
delete $($this,continue.label)
delete $($this,quit.label)
}
proc newgame {} {
for {set i 1} {$i <= 5} {incr i} {
if ![file exists "[ROOT]/save/savegame$i.tcl"] break
}
if {$i == 6} {
wq'widget::fadeto $::itf::logo 0
wq'widget::fadeto $::itf::vbox 0
if $::itf::opt {
wq'widget::fadeto $::itf::opt 0
}
wq'widget::fadeto $::itf::intro 0 -wait
set ::itf::message [new itf'message $::lng::i_tooMuchGame]
oz'widget::property $::itf::message -pos 0.0625 0.416666 -alpha 0
oz'widget::child [FOREGROUNDWIDGET] $::itf::message 0.5
wq'widget::fadeto $::itf::message 1
wq'widget::delete& ::itf::vers
wq'widget::delete& ::itf::vbox
wq'widget::delete& ::itf::logo
wq'widget::delete& ::itf::opt
wq'widget::delete& ::itf::intro
oz'flush
return
}
set i 1
file copy -force "[ROOT]/save/newgame.tcl" "[ROOT]/save/savegame$i.tcl"
file copy -force "[ROOT]/save/newgame-info.tcl" "[ROOT]/save/savegame$i-info.tcl"
file copy -force "[ROOT]/save/newgamess-[MODE].tga" "[ROOT]/save/ss$i-[MODE].tga"
iactive interface.sidebar true
ozIMenu enable menu
iactive interface.help true
ozIMenu enable help
setGameNumber $i [expr int(rand() * 10)]
wq'widget::fadeto $::itf::logo 0
wq'widget::fadeto $::itf::vbox 0
if $::itf::opt {
wq'widget::fadeto $::itf::opt 0
}
wq'widget::fadeto $::itf::intro 0
oz'event {oz'delay 0.25}
oz'event {wizDisableMouse}
oz'event {standardFadeout}
oz'event {oz'track::stop $::music_track}
oz'event {cameraFadein 0}
oz'event {hideMouse}
set l [new oz'label "label" 0.8 0.25]
set w [new oz'widget "widget"]
oz'label::property $l -pos 0.1 0.75 -font caligula.ttf -fsize 20 -alpha 1
oz'widget::property $w -alpha 0
oz'widget::child $w $l 0
oz'widget::child [FOREGROUNDWIDGET] $w 0
introduction::new introduction -foreground -depth 0.5 -nopan
ozqSound::NewFX "sound/vo/$::LNG/intro/introduction.ogg"
wizqQueue 1 [subst {
oz'event {oz'delay 12}
subtitle $w $l Nathaniel "$::lng::introN1" 4
oz'event {oz'delay 2}
subtitle $w $l Nathaniel "$::lng::introN2" 4.5
oz'event {oz'delay 2}
subtitle $w $l Nathaniel "$::lng::introN3" 4
oz'event {oz'delay 1.5}
subtitle $w $l Nathaniel "$::lng::introN4" 6.5
oz'event {oz'delay 3.5}
subtitle $w $l Nathaniel "$::lng::introN5" 2
oz'event {oz'delay 4}
subtitle $w $l Nathaniel "$::lng::introN6" 6.5
oz'event {oz'delay 4.5}
subtitle $w $l Nathaniel "$::lng::introN7" 4
oz'event {oz'delay 6.5}
subtitle $w $l Nathaniel "$::lng::introN8" 7
oz'event {oz'delay 1}
subtitle $w $l Nathaniel "$::lng::introN9" 9
oz'event {oz'delay 3.5}
subtitle $w $l Nathaniel "$::lng::introN10" 5
oz'event {delete $l}
oz'event {delete $w}
}]
chainEvent {
standardFadein
}
wq'widget::waitfor $introduction::introduction -animate
wq'widget::delete& introduction::introduction
oz'event {showMouse}
oz'event {cameraFadeout 0}
# Wait for Block 1
wizqWaitQueue 1
oz'event {wizqEntityStopFollow Zak}
oz'event {
if [info exists ::debug_] {
source "[ROOT]/save/savegame$i.tcl"
} else {
if [catch {source "[ROOT]/save/savegame$i.tcl"}] {
ozMessage "$::lng::i_corrupted"
closeGameNoSave
}
}
}
oz'event {
if !\$::isGameReady {
oz'event {initializeGame}
oz'event {showInterface}
oz'event {standardFadein}
oz'event {wizEnableMouse}
oz'event {set ::isGameReady 1}
}
}
wq'widget::delete& ::itf::vers
wq'widget::delete& ::itf::vbox
wq'widget::delete& ::itf::logo
wq'widget::delete& ::itf::opt
wq'widget::delete& ::itf::intro
oz'flush
}
proc continue {} {
for {set i 1} {$i <= 5} {incr i} {
if ![file exists "[ROOT]/save/savegame$i.tcl"] break
}
if {$i == 1} {
wq'widget::fadeto $::itf::logo 0
wq'widget::fadeto $::itf::vbox 0
if $::itf::opt {
wq'widget::fadeto $::itf::opt 0
}
wq'widget::fadeto $::itf::intro 0 -wait
set ::itf::message [new itf'message $::lng::i_create]
oz'widget::property $::itf::message -pos 0.0625 0.416666 -alpha 0
oz'widget::child [FOREGROUNDWIDGET] $::itf::message 0.5
wq'widget::fadeto $::itf::message 1
wq'widget::delete& ::itf::logo
wq'widget::delete& ::itf::vers
wq'widget::delete& ::itf::vbox
wq'widget::delete& ::itf::opt
wq'widget::delete& ::itf::intro
oz'flush
return
}
wq'widget::fadeto $::itf::logo 0
wq'widget::fadeto $::itf::vbox 0
if $::itf::opt {
wq'widget::fadeto $::itf::opt 0
}
wq'widget::fadeto $::itf::intro 0 -wait
wq'widget::delete& ::itf::logo
wq'widget::delete& ::itf::vbox
wq'widget::delete& ::itf::vers
wq'widget::delete& ::itf::opt
wq'widget::delete& ::itf::intro
oz'event {ShowSaveGamePanel}
oz'flush
}
proc option {} {
if {$::itf::opt == 0} {
set ::itf::opt [new itfopt]
oz'widget::property $::itf::opt -pos 0.328125 0.276042 -alpha 0
oz'widget::child [FOREGROUNDWIDGET] $::itf::opt 0.5
wq'widget::fadeto $::itf::opt 1
oz'flush
}
}
proc quit {} {
set config "set soundfx_volume $::config::user::soundfx_volume\nset voice_volume $::config::user::voice_volume\nset music_volume $::config::user::music_volume\nset gamma_correction $::config::user::gamma_correction"
set fid [open "../res/user.tcl" "w"]
puts $fid $config
close $fid
chainEvent {standardFadeout}
chainEvent {closeGameNoSave}
oz'flush
}
}
class itf'slider {
proc itf'slider {this} oz'widget {itf'slider} {
set ($this,more) [new oz'button "interface/[MODE]/slider/slider.more"]
set ($this,less) [new oz'button "interface/[MODE]/slider/slider.less"]
set ($this,bar0) [new oz'sprite "interface/[MODE]/slider/slider.bar0"]
set ($this,bar1) [new oz'sprite "interface/[MODE]/slider/slider.bar1"]
set ($this,bar2) [new oz'sprite "interface/[MODE]/slider/slider.bar2"]
set ($this,bar3) [new oz'sprite "interface/[MODE]/slider/slider.bar3"]
set ($this,bar4) [new oz'sprite "interface/[MODE]/slider/slider.bar4"]
set ($this,bar5) [new oz'sprite "interface/[MODE]/slider/slider.bar5"]
set ($this,bar6) [new oz'sprite "interface/[MODE]/slider/slider.bar6"]
set ($this,bar7) [new oz'sprite "interface/[MODE]/slider/slider.bar7"]
set ($this,bar8) [new oz'sprite "interface/[MODE]/slider/slider.bar8"]
set ($this,bar9) [new oz'sprite "interface/[MODE]/slider/slider.bar9"]
oz'widget::property $($this,less) -pos 0.005859 0.010417
oz'widget::property $($this,more) -pos 0.213867 0.010417
oz'button::property $($this,less) -click itf'slider::less $this
oz'button::property $($this,more) -click itf'slider::more $this
oz'widget::property $($this,bar0) -pos 0.050781 0.010417 -alpha 0
oz'widget::property $($this,bar1) -pos 0.066406 0.010417 -alpha 0
oz'widget::property $($this,bar2) -pos 0.082031 0.010417 -alpha 0
oz'widget::property $($this,bar3) -pos 0.097656 0.010417 -alpha 0
oz'widget::property $($this,bar4) -pos 0.113281 0.010417 -alpha 0
oz'widget::property $($this,bar5) -pos 0.128906 0.010417 -alpha 0
oz'widget::property $($this,bar6) -pos 0.144531 0.010417 -alpha 0
oz'widget::property $($this,bar7) -pos 0.160156 0.010417 -alpha 0
oz'widget::property $($this,bar8) -pos 0.175781 0.010417 -alpha 0
oz'widget::property $($this,bar9) -pos 0.191406 0.010417 -alpha 0
set ($this,pos) 0
oz'widget::child $this $($this,less) 0
oz'widget::child $this $($this,more) 0
oz'widget::child $this $($this,bar0) 0
oz'widget::child $this $($this,bar1) 0
oz'widget::child $this $($this,bar2) 0
oz'widget::child $this $($this,bar3) 0
oz'widget::child $this $($this,bar4) 0
oz'widget::child $this $($this,bar5) 0
oz'widget::child $this $($this,bar6) 0
oz'widget::child $this $($this,bar7) 0
oz'widget::child $this $($this,bar8) 0
oz'widget::child $this $($this,bar9) 0
}
proc ~itf'slider {this} {
delete $($this,more)
delete $($this,less)
delete $($this,bar0)
delete $($this,bar1)
delete $($this,bar2)
delete $($this,bar3)
delete $($this,bar4)
delete $($this,bar5)
delete $($this,bar6)
delete $($this,bar7)
delete $($this,bar8)
delete $($this,bar9)
}
proc get_pos {this} {
return $($this,pos)
}
proc set_pos {this p} {
set ($this,pos) $p
for {set i 0} {$i < $p} {incr i} {
oz'widget::alpha $($this,bar$i) 1
}
for {set i $p} {$i < 10} {incr i} {
oz'widget::alpha $($this,bar$i) 0
}
}
proc less {this} {
oz'flush
if {$($this,pos) <= 0} return
incr ($this,pos) -1
oz'widget::fadeto $($this,bar$($this,pos)) 0
update_var
oz'flush
}
proc more {this} {
oz'flush
if {$($this,pos) >= 10} return
oz'widget::fadeto $($this,bar$($this,pos)) 1
incr ($this,pos) 1
update_var
oz'flush
}
}
class itfopt {
proc itfopt {this} oz'widget {itfopt} {
set ($this,bg) [new oz'sprite "interface/[MODE]/opt/opt.bg"]
set ($this,voice) [new itf'slider]
set ($this,music) [new itf'slider]
set ($this,sfx) [new itf'slider]
set ($this,gamma) [new itf'slider]
oz'widget::property $($this,voice) -pos 0.072266 [expr 0.036459 - 0.004]
oz'widget::property $($this,sfx) -pos 0.072266 [expr 0.109375 - 0.004]
oz'widget::property $($this,music) -pos [expr 0.072266 - 0.001] [expr 0.182292 - 0.004]
oz'widget::property $($this,gamma) -pos [expr 0.072266 - 0.001] [expr 0.296875 - 0.004]
oz'widget::child $this $($this,bg) 0.5
oz'widget::child $this $($this,voice) 0
oz'widget::child $this $($this,sfx) 0
oz'widget::child $this $($this,music) 0
oz'widget::child $this $($this,gamma) 0
itf'slider::set_pos $($this,voice) [expr int($::config::user::voice_volume * 10)]
itf'slider::set_pos $($this,sfx) [expr int($::config::user::soundfx_volume * 10)]
itf'slider::set_pos $($this,music) [expr int($::config::user::music_volume * 25)]
itf'slider::set_pos $($this,gamma) [expr int($::config::user::gamma_correction * 10)]
}
proc ~itfopt {this} {
delete $($this,bg)
delete $($this,voice)
delete $($this,music)
delete $($this,sfx)
delete $($this,gamma)
}
}
class itf'game {
proc itf'game {this n} oz'widget {itf'game} {
set roomname "Unknown"
set icon [expr int(rand() * 10)]
if [file exists "[ROOT]/save/savegame$n-info.tcl"] {
if [catch {source "[ROOT]/save/savegame$n-info.tcl"}] {
set roomname "Unknown"
set icon [expr int(rand() * 10)]
}
}
set ($this,bg) [new oz'sprite "interface/[MODE]/intro/intro.continue.bg"]
if [file exists "[ROOT]/save/ss$n-[MODE].tga"] {
set ($this,ss) [new oz'sprite "save/ss$n-[MODE]"]
} else {
set ($this,ss) [new oz'sprite "save/newgamess-[MODE]"]
}
set ($this,icon) [new oz'sprite "interface/[MODE]/intro/intro.icon/intro.icon.$icon"]
set ($this,enter) [new oz'button "interface/[MODE]/intro/intro.enter"]
set ($this,history) [new oz'button "interface/[MODE]/intro/intro.history"]
set ($this,erase) [new oz'button "interface/[MODE]/intro/intro.erase"]
set ($this,name) [new oz'label "name" 0.227539 0.061197]
set ($this,time) [new oz'label "time" 0.227539 0.061197]
set time [file mtime "[ROOT]/save/savegame$n.tcl"]
set time [clock format $time -format "%x %H:%M"]
oz'label::property $($this,name) -pos 0.234375 0.026041 -font system.ttf -fsize 16 -color 1 1 1
oz'label::property $($this,time) -pos 0.234375 0.087239 -font system.ttf -fsize 14 -color 1 1 1
set name ""
catch {set name $::lng::roomName($roomname)}
oz'label::property $($this,name) -text "$name"
oz'label::property $($this,time) -text "$time"
oz'button::property $($this,enter) -click itf'game::enter2 $n $icon
oz'button::property $($this,history) -click itf'game::enter $n $icon
oz'button::property $($this,erase) -click itf'game::erase $n
oz'widget::property $($this,icon) -pos 0.5 0
oz'widget::property $($this,enter) -pos 0.188477 [expr 0.031250 + 0.001]
oz'widget::property $($this,history) -pos 0.465820 0.110677
oz'widget::property $($this,erase) -pos 0.188477 0.096354
oz'widget::child $this $($this,bg) 0.5
oz'widget::child $this $($this,ss) 1
oz'widget::child $this $($this,icon) 1
oz'widget::child $this $($this,enter) 0
oz'widget::child $this $($this,history) 0
oz'widget::child $this $($this,erase) 0
oz'widget::child $this $($this,name) 0
oz'widget::child $this $($this,time) 0
}
proc ~itf'game {this} {
delete $($this,bg)
delete $($this,ss)
delete $($this,icon)
delete $($this,enter)
delete $($this,history)
delete $($this,erase)
delete $($this,name)
delete $($this,time)
}
proc enter {n c} {
CloseSaveGamePanel
oz'event {oz'delay 0.5}
set ::itf::message [new itf'message2 $::lng::h_warning $n]
oz'widget::property $::itf::message -pos 0.0625 0.416666 -alpha 0
oz'widget::child [FOREGROUNDWIDGET] $::itf::message 0.5
wq'widget::fadeto $::itf::message 1
oz'flush
}
proc enter2 {n c} {
iactive interface.sidebar true
ozIMenu enable menu
iactive interface.help true
ozIMenu enable help
setGameNumber $n $c
CloseSaveGamePanel
oz'event {oz'delay 0.25}
oz'event {wizDisableMouse}
oz'event {standardFadeout}
oz'event {oz'track::stop $::music_track}
oz'event {wizqEntityStopFollow Zak}
oz'event {
if [info exists ::debug_] {
source "[ROOT]/save/savegame$n.tcl"
} else {
if [catch {source "[ROOT]/save/savegame$n.tcl"}] {
ozMessage "$::lng::i_corrupted"
closeGameNoSave
}
}
}
oz'event {
if !\$::isGameReady {
oz'event {initializeGame}
oz'event {showInterface}
DeleteSaveGamePanel
oz'event {oz'delay 0.01}
oz'event {standardFadein}
oz'event {wizEnableMouse}
oz'event {set ::isGameReady 1}
}
}
oz'flush
}
proc erase {n} {
CloseSaveGamePanel
oz'event {oz'delay 0.5}
set ::itf::delete [new itf'delete $n]
oz'widget::property $::itf::delete -pos 0.0625 0.416666 -alpha 0
oz'widget::child [FOREGROUNDWIDGET] $::itf::delete 0.5
wq'widget::fadeto $::itf::delete 1
DeleteSaveGamePanel
oz'flush
}
}
proc initializeGame { } {
set config "set soundfx_volume $::config::user::soundfx_volume\nset voice_volume $::config::user::voice_volume\nset music_volume $::config::user::music_volume\nset gamma_correction $::config::user::gamma_correction"
set fid [open "../res/user.tcl" "w"]
puts $fid $config
close $fid
source "../res/config.tcl"
updateVolume
ozSet "ghostWhiningVar" [expr 10000 + [ random 5000]]
chainCallEvent optionnalConversation.optionnalConversation
ozSet "libraryZoomIn" ""
if {[ozGet "trialAllegianceDoor"] == "open" || \
[ozGet "trialWisdomDoor"] == "open" || \
[ozGet "trialTriumphDoor"] == "open"} {
ozSet "trialRoomDoorSeen" "complete"
}
if { [ozGet "zakForm"] == "cat" } {
wizqEntityModel Zak "/character/zakCat/zakCat.cal3d"
oz'event {ozEntityZak follownormal 1}
} elseif { [ozGet "zakForm"] == "dragon" } {
wizqEntityModel Zak "/character/zakDragon/zakDragon.cal3d"
oz'event {ozEntityZak follownormal 0}
} elseif { [ozGet "zakForm"] == "human" } {
wizqEntityModel Zak "/character/zakHuman/zakHuman.cal3d"
oz'event {ozEntityZak follownormal 0}
} else {
wizqEntityModel Zak "/character/zakWolf/zakWolf.cal3d"
oz'event {ozEntityZak follownormal 1}
}
SetModelLydia
if { [ozGet "puzzleZak"] == "complete" } {
oz'event {ozEntityZak show}
} else {
oz'event {ozEntityZak hide}
}
if { [ozGet "zakHide"] == "initiated" } {
oz'event {ozEntityZak hide}
}
if {[ozGet "characterControlled"] == "Zak"} {
oz'event {switchAppearance}
oz'event {
ozEntityLydia follownormal 1
ozEntityZak follownormal 0
}
} elseif { [ozGet "mainCharacter"] == "zak" } {
chainEvent { switchAppearance }
oz'event {
ozEntityLydia follownormal 1
ozEntityZak follownormal 0
}
} elseif {[ozGet "sanctuaryZakSwitch"] == "initiated"} {
chainEvent { switchAppearance }
}
if {[ozGet "zakPresence"] == "away"} {
wizqEntityStopFollow Zak
} elseif { [ozGet "characterControlled"] == "zak" } {
wizqEntityStopFollow Zak
} elseif { [ozGet "mainCharacter"] == "zak" } {
wizqEntityStopFollow Zak
} else {
wizqEntityResumeFollow Zak
}
if {([ozGet "zakOnGround"] == "C" && [ozGet "lydiaOnGround"] == "A") ||
([ozGet "lydiaOnGround"] == "C" && [ozGet "zakOnGround"] == "A")} {
chainEvent {
wizEntityShow Lydia
wizEntityHide Zak
}
}
oz'event {oz'delay 0.25}
ozSet "npcDiscussion" ""
}
event "Entrance" {
setCamera "intro"
}
camera "menu" {
layer background "introduction/menu" 0 0 0 0 0 0 0 0
cursor "introduction/menuCursor.tga"
}
camera "intro" {
layer background "introduction/intro" 0 0 0 0 0 0 0 0
cursor "introduction/introCursor.tga"
}
camera "info" {
layer background "introduction/scrollIntro" 0 0 0 0 0 0 0 0
cursor "introduction/infoCursor.tga"
}
event "main" {
wizqEntityModel Npc "/character/mustavio/mustavio.cal3d"
chainEvent {wizEntityHide Npc}
updateGamma
updateVolume
wizqEntityStopFollow Zak
set ::isGameReady 0
hideMouse
hideInterface
set ::itf::game1 0
set ::itf::game2 0
set ::itf::game3 0
set ::itf::game4 0
set ::itf::game5 0
set ::itf::history 0
set ::itf::opt 0
set ::itf::back 0
set ::ref_voice_volume $::config::user::voice_volume
set ::ref_soundfx_volume $::config::user::soundfx_volume
set ::ref_music_volume $::config::user::music_volume
set ::ref_ambient2d_volume $::config::user::soundfx_volume
chainEvent {
bind next 3 1 1 1
}
chainEvent {
setCamera "menu"
}
chainEvent {cameraFadein 1000}
introduction::new logoB
set s [ozqSound::NewFX2 "sound/cutscenes/lb.ogg"]
wq'widget::waitfor [set introduction::logoB] -animate
wq'widget::delete& introduction::logoB
ozqSound::Volume $s 0
oz'event {oz'track::play $::music_track "sound/music/introKeepsake.ogg" -repeat 1}
introduction::new logo -play
chainEvent {cameraFadeout 0}
chainEvent {standardFadein}
chainEvent {
showMouse
}
ShowIntroPanel
}
event "next" {
callChainEvent "newsavegame"
chainEvent { initializeGame }
chainEvent { showInterface }
chainEvent { standardFadein }
}