home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CyberMycha 2006 April
/
SGP.iso
/
dema
/
Keepsake-Demo-en-li-v1.0.exe
/
res
/
init.tcl
< prev
next >
Wrap
Text File
|
2005-10-29
|
7KB
|
232 lines
proc const { name value } {
eval [subst {proc $name {} {return $value}}]
}
const ROOT "../res"
const SCRIPTS "[ROOT]/scripts"
const SCENES "[ROOT]/scenes/common"
const BIN "[ROOT]/bin"
const PUZZLES "[ROOT]/puzzles"
const AUTO "[ROOT]/auto"
const ITF "[ROOT]/interface/common"
source "[ROOT]/config.tcl"
const MODE ${config::screen::width}x${config::screen::height}
const MOVIE_QUALITY ${config::movie::width}x${config::movie::height}
namespace eval movie {}
set SCENES [SCENES]
set SCRIPTS [SCRIPTS]
set PUZZLES [PUZZLES]
const TRUE 1
const FALSE 0
source "[BIN]/prime/stooop.tcl"
namespace import stooop::*
source "[BIN]/prime/cmdinterp.tcl"
source "[BIN]/prime/oz'event.tcl"
source "[BIN]/prime/wtcl.tcl"
const BACKGROUNDWIDGET [new oz'widget background]
const FOREGROUNDWIDGET [new oz'widget foreground]
const INTERFACEWIDGET [new oz'widget interface]
source "[BIN]/prime/oz'widget.tcl"
source "[BIN]/prime/oz'label.tcl"
source "[BIN]/prime/oz'sprite.tcl"
source "[BIN]/prime/oz'button.tcl"
source "[BIN]/prime/oz'sound.tcl"
source "[BIN]/prime/oz'track.tcl"
source "../res/bin/wizardofoz.tcl"
source "[SCRIPTS]/tools.tcl"
namespace eval sfx {}
proc SetAmbient {type name pos ref vol {roll 1}} {
if ![info exists ::sfx::$name] {set ::sfx::$name 0}
set factor 1
if {![set ::sfx::$name] && $vol} {
set ::sfx::$name [new oz'sound "sound/$name.ogg"]
oz'sound::volume [set ::sfx::$name] 0.01
if {$type == "3d"} {oz'sound::streaming [set ::sfx::$name] 0}
oz'sound::repeat [set ::sfx::$name] 1
oz'sound::play [set ::sfx::$name]
set factor 5
}
if [set ::sfx::$name] {
if !$vol {
set factor 2
}
oz'sound::fadeto [set ::sfx::$name] \
[expr [set config::ambient${type}::volume] * $vol] \
[expr [set config::ambient${type}::crosstime] * $factor]
oz'sound::position [set ::sfx::$name] $pos
oz'sound::reference_distance [set ::sfx::$name] $ref
oz'sound::rolloff [set ::sfx::$name] $roll
if !$vol {set ::sfx::$name 0}
}
}
proc Play3DSound {name {entity Lydia}} {
ozqSound::New3DFX s "sound/$name.ogg"
oz'event {
ozqSound::Position $s [wizEntityGetPosition $entity]
}
ozqSound::Volume $s 1
ozqSound::ReferenceDistance $s 30
ozqSound::Rolloff $s 0.6
ozqSound::Play $s
unset s
}
proc PlayMovieSound {scene movie sound args} {
oz'event {
ozSet mvDisableMouse 0
if [ozIsEnable mouse] {
wizDisableMouse
ozSet mvDisableMouse 1
}
}
eval "${scene}::new $movie $args"
ozqSound::NewFX "sound/$sound.ogg"
wq'widget::waitfor [set ${scene}::$movie] -animate
wq'widget::delete& ${scene}::$movie
oz'event {
if [ozGet mvDisableMouse] {
wizEnableMouse
}
}
}
proc SetModelLydia {} {
set book [expr {[ozGet "itemNoteBook"] == "pickedUp"}]
set circlet [expr {[ozGet "itemCirclet"] == "pickedUp"}]
set doll [expr {[ozGet "itemDoll"] == "pickedUp"}]
set staff [expr {[ozGet "itemStaff"] == "pickedUp"}]
set suffix ""
if { $book && !$circlet && !$doll && !$staff} {set suffix "-book"}
if { $book && $circlet && $doll && !$staff} {set suffix "-book-circlet-doll"}
if { $book && $circlet && $doll && $staff} {set suffix "-book-circlet-doll-staff"}
if { $book && !$circlet && $doll && !$staff} {set suffix "-book-doll"}
if { $book && !$circlet && $doll && $staff} {set suffix "-book-doll-staff"}
if {!$book && $circlet && $doll && !$staff} {set suffix "-circlet-doll"}
if {!$book && $circlet && $doll && $staff} {set suffix "-circlet-doll-staff"}
if {!$book && !$circlet && $doll && !$staff} {set suffix "-doll"}
if {!$book && !$circlet && $doll && $staff} {set suffix "-doll-staff"}
ozEntityLydia model "/character/lydia/lydia$suffix.cal3d"
}
proc tclGet {var} {
set value "UNDEFINED!"
catch {set value [set $var]}
return $value
}
proc PlaySound {name} {
set v [new oz'sound "sound/$name.ogg"]
oz'sound::volume $v $config::soundfx::volume
oz'sound::play $v
unset v
}
proc Load1 {} {
oz'event {set ::isGameReady 0}
oz'event {hideInterface}
oz'event {wizDisableMouse}
oz'event {oz'delay 0.01}
oz'event {standardFadeout}
oz'event {oz'track::stop $::music_track}
oz'event {source "[ROOT]/save/savegame1.tcl"}
oz'event {initializeGame}
oz'event {showInterface}
oz'event {oz'delay 0.01}
oz'event {standardFadein}
oz'event {wizEnableMouse}
oz'event {set ::isGameReady 1}
}
proc Load2 {} {
oz'event {set ::isGameReady 0}
oz'event {hideInterface}
oz'event {wizDisableMouse}
oz'event {oz'delay 0.01}
oz'event {standardFadeout}
oz'event {oz'track::stop $::music_track}
oz'event {source "[ROOT]/save/savegame2.tcl"}
oz'event {initializeGame}
oz'event {showInterface}
oz'event {oz'delay 0.01}
oz'event {standardFadein}
oz'event {wizEnableMouse}
oz'event {set ::isGameReady 1}
}
proc Load3 {} {
oz'event {set ::isGameReady 0}
oz'event {hideInterface}
oz'event {wizDisableMouse}
oz'event {oz'delay 0.01}
oz'event {standardFadeout}
oz'event {oz'track::stop $::music_track}
oz'event {source "[ROOT]/save/savegame3.tcl"}
oz'event {initializeGame}
oz'event {showInterface}
oz'event {oz'delay 0.01}
oz'event {standardFadein}
oz'event {wizEnableMouse}
oz'event {set ::isGameReady 1}
}
proc Load4 {} {
oz'event {set ::isGameReady 0}
oz'event {hideInterface}
oz'event {wizDisableMouse}
oz'event {oz'delay 0.01}
oz'event {standardFadeout}
oz'event {oz'track::stop $::music_track}
oz'event {source "[ROOT]/save/savegame4.tcl"}
oz'event {initializeGame}
oz'event {showInterface}
oz'event {oz'delay 0.01}
oz'event {standardFadein}
oz'event {wizEnableMouse}
oz'event {set ::isGameReady 1}
}
proc Load5 {} {
oz'event {set ::isGameReady 0}
oz'event {hideInterface}
oz'event {wizDisableMouse}
oz'event {oz'delay 0.01}
oz'event {standardFadeout}
oz'event {oz'track::stop $::music_track}
oz'event {source "[ROOT]/save/savegame5.tcl"}
oz'event {initializeGame}
oz'event {showInterface}
oz'event {oz'delay 0.01}
oz'event {standardFadein}
oz'event {wizEnableMouse}
oz'event {set ::isGameReady 1}
}