Win00.txt

This is the win file for the human player in the sandbox. I have added my comments in dark red. These comments are based on my own analysis of the code and my experience in working with it. I do not have any special inside information from MuckyFoot about these files, and I may in some instances be wrong.

; This is a rather complex file on account of the multiple possibilites of ways to win
; in the sandbox. Your own win file needn't be so complex.

; no >= operator, so i've had to use (option + 1) everywhere
; this is so that the un-set options default to permitting a win

:ENERGYOPTIONSET
if
	(opt_winenergy) > 0
then
	set numwinoptions (numwinoptions + 1)
	disable
end

:TERRITORYOPTIONSET
if
	(opt_winterritory) > 0
then
	set numwinoptions (numwinoptions + 1)
	disable
end

:RESEARCHOPTIONSET
if
	(opt_winresearch) > 0
then
	set numwinoptions (numwinoptions + 1)
	disable
end

:SCOREOPTIONSET
if
	(opt_winscore) > 0
then
	set numwinoptions (numwinoptions + 1)
	disable
end


:WINCRITERIAa
if
	winenergymet < 1
	(opt_winenergy) > 0
	(energy + 1) > opt_winenergy
then
	set winconditionsmet (winconditionsmet + 1)
	set winenergymet 1
end

:WINCRITERIAaa
if
	winenergymet > 1
	(energy) < opt_winenergy
then
	set winconditionsmet (winconditionsmet - 1)
	set winenergyemet 0
end


:WINCRITERIAb
if
	winterritorymet < 1
	(opt_winterritory) > 0
	(segmentdecks + 1) > opt_winterritory
then
	set winconditionsmet (winconditionsmet + 1)
	set winterritorymet 1
end

:WINCRITERIAbb
if
	winterritorymet > 1
	(energy) < opt_winterritory
then
	set winconditionsmet (winconditionsmet - 1)
	set winterritorymet 0
end

:WINCRITERIAc
if
	(opt_winresearch) > 0
	(discovery_count + 1) > opt_winresearch
then
	set winconditionsmet (winconditionsmet + 1)
	disable
end

:WINCRITERIAd
if
	winscoremet < 1
	(opt_winscore) > 0
	(sandbox_score + 1) > opt_winscore
then
	set winconditionsmet (winconditionsmet + 1)
	set winscoremet 1
end

:WINCRITERIAdd
if
	winscoremet > 1
	(sandbox_score) < opt_winscore
then
	set winconditionsmet (winconditionsmet - 1)
	set winscorelimit 0
end

:haveIwonyetONE
if
	opt_wincriteria = 1
	winconditionsmet > 0
then
	multitrigger :LOSETRIGGER
	set winola 1
	win
end 

:haveIwonyetTWO
if
	((((opt_winenergy) + (opt_winterritory)) + (opt_winresearch)) + (opt_winscore)) > 1
	opt_wincriteria = 2
	winconditionsmet > 1
then
	multitrigger :LOSETRIGGER
	set winola 1
	win
end

:haveIwonyetTHREE
if
	((((opt_winenergy) + (opt_winterritory)) + (opt_winresearch)) + (opt_winscore)) > 2
	opt_wincriteria = 3
	winconditionsmet > 2
then
	multitrigger :LOSETRIGGER
	set winola 1
	win
end

;This bit is for when win conditions equal the number of available win criteria.
:haveIwonyetALL
if
	numwinoptions > 0
	(winconditionsmet + 1) > numwinoptions
then
	multitrigger :LOSETRIGGER
	set winola 1
	win
end

:LOSETRIGGER
if
	0
then
	set loser 1
	disable
end

:LOSECRITERIA
if
	winola = 0
	loser = 1
then
	set IAMALOSER 1
	lose
	disable
end

:WINPLAYER
if
	players > 1
then
	set winplayer 1
	disable
end

:IAMAWINNER
if
	winplayer > 0
	IAMALOSER < 1
	players < 2
then
	win
	disable
end	



/*
:WINCRITERIA
if
	opt_wincriteria < 1
	((((opt_winenergy) + (opt_winterritory)) + (opt_winresearch)) + (opt_winscore)) > 0
	(energy + 1) > opt_winenergy
	(segmentdecks + 1) > opt_winterritory
	(discovery_count + 1) > opt_winresearch
	(sandbox_score + 1) > opt_winscore
then
	multitrigger :LOSETRIGGER
	set winola 1
	win
end

:haveIwonyetFOUR
if
	((((opt_winenergy) + (opt_winterritory)) + (opt_winresearch)) + (opt_winscore)) > 3
	opt_wincriteria = 0
	winconditionsmet > 3
then
	multitrigger :LOSETRIGGER
	set winola 1
	win
end 

*/