home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2006 April
/
Gamestar_83_2006-04_dvd.iso
/
Dema
/
keepsake_demo_en.exe
/
res
/
puzzles
/
mill.puzzle.tcl
< prev
Wrap
Text File
|
2005-10-29
|
15KB
|
532 lines
proc pzlUseLever {device setting} {
set s [ozGet pzlMillCloseUp${device}]
if {$s == ""} {set s 0}
wizqDisableMouse
while {$s != $setting} {
oz'event {wq'widget::delete& puzzleCloseUp${device}::switch,${s}St}
set s [expr ($s + 1) % 4]
oz'event {puzzleCloseUp${device}::newSt switch,${s}St}
oz'event {puzzleCloseUp${device}::new switch,${s}}
oz'event {ozqSound::NewFX "sound/puzzles/puzzleMill/switch,${s}.ogg"}
oz'event {wq'widget::waitfor [set puzzleCloseUp${device}::switch,${s}] -animate}
oz'event {wq'widget::delete& puzzleCloseUp${device}::switch,${s}}
}
ozSet pzlMillCloseUp${device} $s
pzlMillLogic ${device}
wizqEnableMouse
}
event "usePuzzleLever0A" {
pzlUseLever A 0
}
event "usePuzzleLever1A" {
pzlUseLever A 1
}
event "usePuzzleLever2A" {
pzlUseLever A 2
}
event "usePuzzleLever3A" {
pzlUseLever A 3
}
event "usePuzzleLever0B" {
pzlUseLever B 0
}
event "usePuzzleLever1B" {
pzlUseLever B 1
}
event "usePuzzleLever2B" {
pzlUseLever B 2
}
event "usePuzzleLever3B" {
pzlUseLever B 3
}
event "usePuzzleLever0C" {
pzlUseLever C 0
}
event "usePuzzleLever1C" {
pzlUseLever C 1
}
event "usePuzzleLever2C" {
pzlUseLever C 2
}
event "usePuzzleLever3C" {
pzlUseLever C 3
}
event "usePuzzleLever0D" {
pzlUseLever D 0
}
event "usePuzzleLever1D" {
pzlUseLever D 1
}
event "usePuzzleLever2D" {
pzlUseLever D 2
}
event "usePuzzleLever3D" {
pzlUseLever D 3
}
event "usePuzzleLever0E" {
pzlUseLever E 0
}
event "usePuzzleLever1E" {
pzlUseLever E 1
}
event "usePuzzleLever2E" {
pzlUseLever E 2
}
event "usePuzzleLever3E" {
pzlUseLever E 3
}
event "usePuzzleLever0F" {
pzlUseLever F 0
}
event "usePuzzleLever1F" {
pzlUseLever F 1
}
event "usePuzzleLever2F" {
pzlUseLever F 2
}
event "usePuzzleLever3F" {
pzlUseLever F 3
}
event "usePuzzleLever0G" {
pzlUseLever G 0
}
event "usePuzzleLever1G" {
pzlUseLever G 1
}
event "usePuzzleLever2G" {
pzlUseLever G 2
}
event "usePuzzleLever3G" {
pzlUseLever G 3
}
event "usePuzzleLever0H" {
pzlUseLever H 0
}
event "usePuzzleLever1H" {
pzlUseLever H 1
}
event "usePuzzleLever2H" {
pzlUseLever H 2
}
event "usePuzzleLever3H" {
pzlUseLever H 3
}
proc pzlMillLogic {device} {
set startA 0
set startB 0
set startC 0
set startD 0
if {[ozGet pzlMillMachineE] == 1} {
ozSet pzlMillCloseUpAPower 0
ozSet pzlMillCloseUpBPower 0
ozSet pzlMillCloseUpCPower 0
ozSet pzlMillCloseUpDPower 0
ozSet pzlMillCloseUpEPower 0
ozSet pzlMillCloseUpFPower 0
ozSet pzlMillCloseUpGPower 0
ozSet pzlMillCloseUpHPower 0
ozSet pzlMillCloseUpZPower 0
set reset [pzlMillPower S A [expr {$device != ""}]]
if $reset return
if {[ozGet pzlMillMachineA] == 1} {SetAmbient 3d sfx/machineA "541.508 -17.481 274.492" 30 1.5 0.6}
if {[ozGet pzlMillMachineB] == 1} {SetAmbient 3d sfx/machineB "584.563 22.187 323.312" 30 1.5 0.6}
if {[ozGet pzlMillMachineC] == 1} {SetAmbient 3d sfx/machineC "634.052 22.187 318.092" 30 1.5 0.6}
if {[ozGet pzlMillMachineD] == 1} {SetAmbient 3d sfx/machineD "589.581 -16.969 267.858" 30 1.5 0.6}
if {[ozGet pzlMillMachineE] == 1} {SetAmbient 3d sfx/machineE "605.908 -30.502 304.112" 30 1.5 0.6}
if {[ozGet pzlMillCloseUpBPower] != 0} {
if {[ozGet pzlMillMachineC] == 0} {
set startC 1
}
ozSet pzlMillMachineC 1
oz'event {SetAmbient 3d sfx/machineC "634.052 22.187 318.092" 30 1.5 0.6}
} else {
if {[ozGet pzlMillMachineC] != 0} {
set startC 1
}
ozSet pzlMillMachineC 0
oz'event {SetAmbient 3d sfx/machineC "634.052 22.187 318.092" 30 0 0.6}
}
if {[ozGet pzlMillCloseUpDPower] != 0} {
if {[ozGet pzlMillMachineB] == 0} {
set startB 1
}
ozSet pzlMillMachineB 1
oz'event {SetAmbient 3d sfx/machineB "584.563 22.187 323.312" 30 1.5 0.6}
} else {
if {[ozGet pzlMillMachineB] != 0} {
set startB 1
}
ozSet pzlMillMachineB 0
oz'event {SetAmbient 3d sfx/machineB "584.563 22.187 323.312" 30 0 0.6}
}
if {[ozGet pzlMillCloseUpFPower] != 0} {
if {[ozGet pzlMillMachineD] == 0} {
set startD 1
}
ozSet pzlMillMachineD 1
oz'event {SetAmbient 3d sfx/machineD "589.581 -16.969 267.858" 30 1.5 0.6}
} else {
if {[ozGet pzlMillMachineD] != 0} {
set startD 1
}
ozSet pzlMillMachineD 0
oz'event {SetAmbient 3d sfx/machineD "589.581 -16.969 267.858" 30 0 0.6}
}
if {[ozGet pzlMillCloseUpZPower] != 0} {
if {[ozGet pzlMillMachineA] == 0} {
set startA 1
}
ozSet pzlMillMachineA 1
oz'event {SetAmbient 3d sfx/machineA "541.508 -17.481 274.492" 30 1.5 0.6}
} else {
if {[ozGet pzlMillMachineA] != 0} {
set startA 1
}
ozSet pzlMillMachineA 0
oz'event {SetAmbient 3d sfx/machineA "541.508 -17.481 274.492" 30 0 0.6}
}
}
if {$startA || $startB || $startC || $startD} {
oz'event {wizDisableMouse}
if {${device} != ""} {
oz'event {standardFadeout}
oz'event {
wq'widget::delete& puzzleCloseUp${device}::switch,0St
wq'widget::delete& puzzleCloseUp${device}::switch,1St
wq'widget::delete& puzzleCloseUp${device}::switch,2St
wq'widget::delete& puzzleCloseUp${device}::switch,3St
}
}
if {$startC || $startB} {
oz'event {callEvent mill.secondFloor}
oz'event {standardFadein}
oz'event {oz'delay 3}
oz'event {standardFadeout}
}
if $startD {
oz'event {callEvent mill.millFlourSac}
oz'event {standardFadein}
oz'event {oz'delay 3}
oz'event {standardFadeout}
}
if $startA {
oz'event {callEvent mill.barrels}
oz'event {standardFadein}
oz'event {oz'delay 3}
oz'event {standardFadeout}
}
oz'event {wizEnableMouse}
if {$device != ""} {
if {[ozGet pzlMillMachineA] && \
[ozGet pzlMillMachineB] && \
[ozGet pzlMillMachineC] && \
[ozGet pzlMillMachineD] && \
[ozGet pzlMillMachineE]} {
oz'event {
GoBack
}
} else {
oz'event {
setCamera puzzleCloseUp${device}
wizhCameraChange
puzzleCloseUp${device}::newSt switch,[ozGet pzlMillCloseUp$device]St
}
oz'event {standardFadein}
}
if {[ozGet pzlMillMachineA] && \
[ozGet pzlMillMachineB] && \
[ozGet pzlMillMachineC] && \
[ozGet pzlMillMachineD] && \
[ozGet pzlMillMachineE]} {
oz'event {
callEvent "mill.millSolved"
}
}
}
}
}
proc pzlMillPower {from to back} {
set s [ozGet pzlMillCloseUp$to]
set p [ozGet pzlMillCloseUp${to}Power]
if {$p != 0} {
pzlMillReset $back
return 1
}
ozSet pzlMillCloseUp${to}Power 1
switch -exact $to {
A {
switch -exact $from {
S {
switch -exact $s {
1 {return [pzlMillPower A B $back]}
2 {return [pzlMillPower A D $back]}
}
}
}
}
B {
switch -exact $from {
A {
switch -exact $s {
1 {return [pzlMillPower B E $back]}
2 {return [pzlMillPower B C $back]}
}
}
C {
switch -exact $s {
2 {return [pzlMillPower B A $back]}
3 {return [pzlMillPower B E $back]}
}
}
E {
switch -exact $s {
1 {return [pzlMillPower B A $back]}
3 {return [pzlMillPower B C $back]}
}
}
}
}
C {
switch -exact $from {
B {
switch -exact $s {
1 {return [pzlMillPower C D $back]}
2 {return [pzlMillPower C F $back]}
}
}
D {
switch -exact $s {
1 {return [pzlMillPower C B $back]}
3 {return [pzlMillPower C F $back]}
}
}
F {
switch -exact $s {
2 {return [pzlMillPower C B $back]}
3 {return [pzlMillPower C D $back]}
}
}
}
}
D {
switch -exact $from {
A {
switch -exact $s {
1 {return [pzlMillPower D C $back]}
2 {return [pzlMillPower D G $back]}
}
}
C {
switch -exact $s {
1 {return [pzlMillPower D A $back]}
3 {return [pzlMillPower D G $back]}
}
}
G {
switch -exact $s {
2 {return [pzlMillPower D A $back]}
3 {return [pzlMillPower D C $back]}
}
}
}
}
E {
switch -exact $from {
B {
switch -exact $s {
1 {return [pzlMillPower E H $back]}
2 {return [pzlMillPower E F $back]}
}
}
F {
switch -exact $s {
2 {return [pzlMillPower E B $back]}
3 {return [pzlMillPower E H $back]}
}
}
H {
switch -exact $s {
1 {return [pzlMillPower E B $back]}
3 {return [pzlMillPower E F $back]}
}
}
}
}
F {
switch -exact $from {
C {
switch -exact $s {
1 {return [pzlMillPower F E $back]}
2 {return [pzlMillPower F G $back]}
}
}
E {
switch -exact $s {
1 {return [pzlMillPower F C $back]}
3 {return [pzlMillPower F G $back]}
}
}
G {
switch -exact $s {
2 {return [pzlMillPower F C $back]}
3 {return [pzlMillPower F E $back]}
}
}
}
}
G {
switch -exact $from {
D {
switch -exact $s {
1 {return [pzlMillPower G F $back]}
2 {return [pzlMillPower G H $back]}
}
}
F {
switch -exact $s {
1 {return [pzlMillPower G D $back]}
3 {return [pzlMillPower G H $back]}
}
}
D {
switch -exact $s {
2 {return [pzlMillPower G D $back]}
3 {return [pzlMillPower G F $back]}
}
}
}
}
H {
switch -exact $from {
E {
switch -exact $s {
1 {return [pzlMillPower H G $back]}
2 {return [pzlMillPower H Z $back]}
}
}
G {
switch -exact $s {
1 {return [pzlMillPower H E $back]}
3 {return [pzlMillPower H Z $back]}
}
}
}
}
Z {
ozSet pzlMillCloseUp${to}Power 1
}
}
return 0
}
proc pzlMillReset {{back 1}} {
oz'event {
ozSet pzlMillCloseUpA 0
ozSet pzlMillCloseUpAPower 0
ozSet pzlMillCloseUpB 0
ozSet pzlMillCloseUpBPower 0
ozSet pzlMillCloseUpC 0
ozSet pzlMillCloseUpCPower 0
ozSet pzlMillCloseUpD 0
ozSet pzlMillCloseUpDPower 0
ozSet pzlMillCloseUpE 0
ozSet pzlMillCloseUpEPower 0
ozSet pzlMillCloseUpF 0
ozSet pzlMillCloseUpFPower 0
ozSet pzlMillCloseUpG 0
ozSet pzlMillCloseUpGPower 0
ozSet pzlMillCloseUpH 0
ozSet pzlMillCloseUpHPower 0
ozSet pzlMillCloseUpZPower 0
ozSet pzlMillMachineE 1
ozSet pzlMillMachineB 0
ozSet pzlMillMachineC 0
ozSet pzlMillMachineD 0
ozSet pzlMillMachineA 0
oz'event {
SetAmbient 3d sfx/machineA "541.508 -17.481 274.492" 30 0 0.6
SetAmbient 3d sfx/machineB "584.563 22.187 323.312" 30 0 0.6
SetAmbient 3d sfx/machineC "634.052 22.187 318.092" 30 0 0.6
SetAmbient 3d sfx/machineD "589.581 -16.969 267.858" 30 0 0.6
oz'delay 0.5
}
set delay [ozqSound::NewFX "sound/puzzles/puzzleMill/machineStop.ogg"]
if $back {
oz'event {GoBack}
oz'event {wizDisableMouse}
oz'event {oz'delay \$delay}
wizqTalkOpen
wizqTalkSay Lydia $::lng::millBreakL1 "sound/vo/$::LNG/scenes/mill/millBreakL1.ogg"
wizqTalkClose
oz'event {wizEnableMouse}
} else {
oz'event {oz'delay \$delay}
set delay [ozqSound::NewFX ""sound/vo/$::LNG/scenes/mill/millBreakL1.ogg"]
oz'event {oz'delay \$delay}
}
}
}