rendered paste bodyalias stratego {
window -poxz @Stratego
set %stratego 1
drawpic -s @stratego 0 0 $window(@stratego).w $window(@stratego).h $qt($scriptdir $+ \stratego\strategoback.jpg)
drawtext -r @Stratego 7910 Arial 100 300 100 Stratego
drawtext -r @Stratego 7910 Arial 30 300 200 Made by Kerst
drawtext -r @Stratego 7910 Arial 30 300 250 Left click to continue.
drawtext -r @Stratego 7910 Arial 30 300 300 http://forum.swiftirc.net
}
menu @stratego {
sclick:{
if (%stratego == 3) && ($inrect($mouse.x,$mouse.y,200,435,100,50)) strategomenu
if (%stratego == 3) && ($inrect($mouse.x,$mouse.y,375,225,205,50)) { window -pdoxz @Stratego-pieces | drawpic @Stratego-pieces 0 0 $qt($scriptdir $+ \Stratego\stratego_Pieces.jpg) }
if (%stratego == 2) && ($inrect($mouse.x,$mouse.y,300,295,100,50)) strategohelp
if (%stratego == 2) && ($inrect($mouse.x,$mouse.y,300,360,100,50)) run http://en.wikipedia.org/wiki/Stratego
if (%stratego == 2) && ($inrect($mouse.x,$mouse.y,300,220,100,50)) strategoplay
if (%stratego == 1) strategomenu
}
}
on *:close:@stratego: unset %stratego*
alias -l strategomenu {
clear @stratego
set %stratego 2
drawpic -s @stratego 0 0 $window(@stratego).w $window(@stratego).h $qt($scriptdir $+ \stratego\strategoback.jpg)
drawrect -rf @stratego 0 5 300 220 100 50
drawrect -rf @stratego 0 5 300 295 100 50
drawrect -rf @stratego 0 5 300 360 100 50
drawrect -cr @stratego 7910 5 300 220 100 50
drawrect -cr @stratego 7910 5 300 295 100 50
drawrect -cr @stratego 7910 5 300 360 100 50
drawtext -r @Stratego 7910 Arial 100 300 100 Stratego
drawtext -r @Stratego 7910 Arial 30 320 225 Play
drawtext -r @Stratego 7910 Arial 30 320 300 Help
drawtext -r @Stratego 7910 Arial 30 320 375 Wiki
}
;made by kerst lawl;
alias -l strategohelp {
clear @stratego
set %stratego 3
drawpic -s @stratego 0 0 $window(@stratego).w $window(@stratego).h $qt($scriptdir $+ \stratego\strategoback.jpg)
drawrect -rf @stratego 0 5 200 435 100 50
drawrect -rf @stratego 0 5 375 225 205 50
drawrect -cr @stratego 7910 5 200 435 100 50
drawrect -cr @stratego 7910 5 375 225 205 50
drawtext -r @Stratego 7910 Arial 100 300 100 Stratego help
drawtext -r @Stratego 7910 Arial 30 120 225 There are 12 units, see the picture. Bombs can't walk Only spies
drawtext -r @Stratego 7910 Arial 30 120 300 and bombs can kill Marshals. Bombs can only be killed by Miners.
drawtext -r @Stratego 7910 Arial 30 120 375 Order of strongest is from left to right, outside of the exceptions.
drawtext -r @Stratego 7910 Arial 30 220 440 Back
}
alias -l strategoplay {
dialog -mvd stratego stratego
window -h @stratego
}
dialog Stratego {
title "Challenge player"
size -1 -1 109 68
option dbu
edit "Players name", 3, 8 9 92 10
button "Challenge", 4, 35 50 37 12
edit "Status:", 5, 8 24 92 17, read
}
on *:dialog:stratego:sclick:4:{
if ($me !ison #stratego) join #stratego
if ($did(3) !ison #stratego) did -a $dname 5 $did(3) isn't in #stratego.
else msg $nick You have been challenged for a game of stratego, want to fight?
}
on *:text:You have been challenged for a game of stratego, want to fight?:?:{
set %nick $nick
dialog -mdv challenged challenged
window -h @stratego
}
dialog challenged {
title "Challenged"
size -1 -1 109 41
option dbu
text "", 1, 9 9 90 8
button "Yes", 2, 9 21 37 12
button "No", 3, 62 21 37 12, cancel
}
on *:dialog:challenged:sclick:3:{
close -m %nick
msg %nick I decline your challenge.
unset %nick
}
menu nicklist {
.-
.stratego:
..Play: /strategoplay
..Help: /strategohelp
..Wiki: /http://en.wikipedia.org/wiki/Stratego
}
on *:dialog:challenged:init:0: did -a $dname 1 %nick wants to fight you accept?
on *:dialog:challenged:sclick:2:{
close -m %nick
msg %nick I accept your challenge.
playboard %nick
}
alias playboard {
set %stratego 4
var %x = 0
if ($dialog(challenged)) dialog -x challenged challenged
if ($dialog(stratego)) dialog -x stratego stratego
window -oxzp @stratego
drawpic -s @stratego 0 0 $window(@stratego).w $window(@stratego).h $qt($scriptdir $+ \stratego\strategobord.jpg)
drawpic -s @stratego $calc($window(@stratego).w /13 *3.5) $calc($window(@stratego).h /2 -80) $calc($window(@stratego).w /13 *2) $calc($window(@stratego).h /2 -180) $qt($scriptdir $+ \stratego\orkaan.jpg)
drawpic -s @stratego $calc($window(@stratego).w /13 * 7.5) $calc($window(@stratego).h /2 -80) $calc($window(@stratego).w /13 *2) $calc($window(@stratego).h /2 -180) $qt($scriptdir $+ \stratego\orkaan.jpg)
while %x < 11 {
drawrect @stratego 1 3 100 50 $calc($window(@stratego).w /13 * %x) $calc($window(@stratego).h -100)
inc %x
}
var %x = 0
while %x < 11 {
drawrect @stratego 1 3 100 50 $calc($window(@stratego).w /13 *10) $calc($window(@stratego).h /13 * %x)
inc %x
}
if (!$input(Select where you want your pieces! $crlf $+ click on a box and select which piece you want. $crlf $+ pushing Cancel will stop the game.,,Let's play,)) window -c @stratego
else {
}
}
on *:text:i accept your challenge.:?: playboard $nick