View Single Post
  #3  
Old 01-30-2002, 06:33 AM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
I made a gambling game for sidra, but sidra is dead so here it is, go use it on your crappy delteria **** or whatever :o

NPC Code:

// NPC made by Supersonic
if (playertouchsme && playerdir=0 && this.mode=0) {
this.mode=1;
if (playerrupees>=200) {
setani idle,;
while (!keydown(5)) {
freezeplayer .05;
message This game requires 200g, press S to continue or A to cancel;
if (keydown(6)) break;
sleep .05;
}
if (keydown(5)) setplayerprop #c,;
if (!keydown(6)) {
playerrupees-=200;
message;
this.7={0,0,0};
setbackpal dusk8.png;
while (!keydown(4)) {
this.1=int(random(0,7));
this.2=int(random(0,7));
this.3=int(random(0,7));
updateimg();
freezeplayer .05;
sleep .05;
}
while (keydown(4)) {
this.2=int(random(0,7));
this.3=int(random(0,7));
updateimg();
freezeplayer .05;
sleep .05;
}
while (!keydown(4)) {
this.2=int(random(0,7));
this.3=int(random(0,7));
updateimg();
freezeplayer .05;
sleep .05;
}
while (keydown(4)) {
this.3=int(random(0,7));
updateimg();
freezeplayer .05;
sleep .05;
}
while (!keydown(4)) {
this.3=int(random(0,7));
updateimg();
freezeplayer .05;
sleep .05;
}
while (keydown(4)) {
sleep .05;
}
checkwinnings();
playerrupees+=this.winnings;
message;
if (this.winnings>0) say2 You have won #v(this.winnings) rupees;
else say2 Try again!;
sleep .05;
hideimg 200;
hideimg 201;
hideimg 202;
setbackpal pics1.png;
}else{
setplayerprop #c,;
message;
say2 Slot Machine Aborted;
}
}else{
say2 You need 200 rupees to play!;
}
this.mode=0;
}
function updateimg() {
showimg 200,sidra_slotmachinesprites.png,screenwidth/2-96,screenheight/2-32;
changeimgpart 200,this.1*64,0,64,64;
changeimgvis 200,4;
showimg 201,sidra_slotmachinesprites.png,screenwidth/2-32,screenheight/2-32;
changeimgpart 201,this.2*64,0,64,64;
changeimgvis 201,4;
showimg 202,sidra_slotmachinesprites.png,screenwidth/2+32,screenheight/2-32;
changeimgpart 202,this.3*64,0,64,64;
changeimgvis 202,4;
}
function checkwinnings() {
this.winnings=0;
tokenize #v(this.1) #v(this.2) #v(this.3);
for (i=0; i<3; i++) {
if (strequals(#t(i),0)) this.winnings+=20;
}
if (this.1 in |4,6|) this.7[0]=1;
else this.7[0]=0;
if (this.2 in |4,6|) this.7[1]=1;
else this.7[1]=0;
if (this.3 in |4,6|) this.7[2]=1;
else this.7[2]=0;
if (strequals(#t(0)#t(1)#t(2),111)) this.winnings=100;
if (strequals(#t(0)#t(1)#t(2),222)) this.winnings=250;
if (strequals(#t(0)#t(1)#t(2),333)) this.winnings=400;
if (this.7[0]=1 && this.7[1]=1 && this.7[2]=1) this.winnings=500;
if (strequals(#t(0)#t(1)#t(2),444)) this.winnings=750;
if (strequals(#t(0)#t(1)#t(2),555)) this.winnings=1000;
if (strequals(#t(0)#t(1)#t(2),666)) this.winnings=2500;
}



give the npc an image like slot.gif...

it is old and crappy now, but it maybe it could be improved and put on g2k1?

*attached is the necessary image*
Attached Thumbnails
Click image for larger version

Name:	sidra_slotmachinesprites.png
Views:	184
Size:	1.2 KB
ID:	11213  
Reply With Quote