Dec 262017
 
The Twilight Zone Casino and Bank. On-line door for WWIV BBS's.
File TZBANK14.ZIP from The Programmer’s Corner in
Category BBS Files
The Twilight Zone Casino and Bank. On-line door for WWIV BBS’s.
File Name File Size Zip Size Zip Type
TURBO.PCK 1201 217 deflated
TURBO.TP 1226 252 deflated
TZCASINO.C 1963 688 deflated
TZCASINO.DAT 454 275 deflated
TZCASINO.DOC 13846 4897 deflated
TZCASINO.EXE 72464 29932 deflated
TZCASINO.PAS 17185 3988 deflated
TZCOMMON.PAS 20941 5337 deflated
TZMENU.ANS 5922 1002 deflated
TZMENU.MSG 14369 4128 deflated
TZPROCS.PAS 55718 10911 deflated

Download File TZBANK14.ZIP Here

Contents of the TZCASINO.DOC file


The Twilight Zone Casino and Bank
Version 1.40

The following is the installation instructions for the Twilight Zone Bank
and Casino. I got the idea for this system from several sources, including
Doug Field's Time Bank, MrBill's Casino, and some of the Onliners that were
available in the old Genesis Deluxe Software I used to run. At least I finally
saw the light and switched to WWIV. To use the Casino you will need to be a
registered sysop, as some minor changes are needed to the WWIV source code to
pass the variable information back and forth.

Basically this program provides the following functions:

Bank - Buy/Sell Time, Deposit/Withdraw Time, Buy Upload Credit, Raise
Security Level. All these values are customizable by changing the
definitions in the TZCASINO.DAT file.

Casino - Logoff Lottery, Russian Roulette, Trivia Madness, Unsolved Phrases,
Blackjack and Wheel of Fortune.

If you've got any ideas of games you would like to see added to the casino,
I'm always willing to listen (especially if you are willing to code it up
yourself). Also, if you have ideas for any other WWIV mods but don't know how
to do it, give me a call either on my board or voice (it doesn't really matter
to me which) and I'll see what I can do. If you like this program, don't
bother sending me anything but be sure and register your source if you haven't
done so already. It's well worth the 50 bucks.

Tony "Goose" Geisler, [email protected]
Sysop of the Twilight Zone BBS - 703-369-5225 - 9600 baud HST
Voice Number 703-369-1225

===============================================================================

Revision History:

Rev 1.40 Additions - added the Blackjack game. Thanks to Jim Villani
June 3, 1990 (alias Schroeder) for writing it up for me! Now all I
need is a few more ideas for some new games.
Bug Fixes - again, fixed the calculations for the high scores.
You will need to issue the /R command if upgrading from a
version of 1.30 or higher. Also changed a few of the
prompts around, but this shouldn't be any big deal.

Rev 1.32 Additions - added statements to display gold won after solving
May 27, 1990 a phrase or trivia category. Added the TZCASINO.DAT
external file to the ZIP file.
Bug Fixes - fixed the bug in the TZCASINO.C file that would
assign level 255 access to a user if they entered the
casino as a temporary sysop. Fixed bugs in the calculations
of the high scores - you will need to issue the /R command
in the casino to reset the high scores if you upgraded from
version 1.30. fixed a bug in the calculation of phrases or
trivia if a category in the middle was deleted.

Rev 1.30 Additions - added a high score list for keeping track of the
May 24, 1990 trivia and phrases played and solved. made many of the long
displays abortable.
Changes - made some minor prompt changes. changed the control
variables to be external to the program. removed the
cost for playing unsolved phrases.
Bug Fixes - fixed the bug that would incorrectly count a phrase
as solved when a user missed the last question.

Rev 1.10 Additions - added a version number to the code, added an editor
May 12, 1990 for existing trivia categories.
Bug Fixes - fixed the bug that would not give gold for correctly
solving a phrase, fixed bugs in the adding of Trivia
Categories.
Changes - removed punctuation when checking for a correct
trivia answer so that slight deviations would not affect a
correct answer.

Rev 1.00 The first official release of the package. This version
Apr 21, 1990 included the Turbo Pascal 5.0 source code. The only game
not complete for this version is Blackjack.

Rev 0.80 The TZGAMMA package. This version was distributed without
March, 1990 source and did not include the Unsolved Phrases, Trivia
Madness or Blackjack games.

===============================================================================

NOTES: + designates additions or changes to the source code
- designates existing source code

All changes are based on WWIV 4.11, and the existing code may be
slightly different for other versions. I make no promises as to
whether of not it will work with anything but 4.11, although it
*should* work for any WWIV version 4.07 or higher (which was the
first source I ever got) and probably any 4.xx version.

1) In VARDEC.H, edit the userrec structure:

NOTE: Where the char res[31] appears, subtract 2 from the number that is
currently inside the brackets. This value may change depending on
the version of the source code that you currently have, and is
changed from 33 to 31 for WWIV 4.11.

- unsigned short fsenttoday1; /* feedbacks today */
- unsigned char num_extended; /* num lines of ext desc */
+ char res[31]; /* mod - change reserved bytes-2 */
+ unsigned int timesaved; /* mod - add time in bank account */
- } userrec;


2) In NEWUSER.C, void newuser, initialize the timesaved to zero, and change
the zeroing of the reserved bytes to the same number as above (i.e. since
it's res[31], the loop should be 0 through 31):

- thisuser.fsenttoday1=0;
- thisuser.num_extended=0;
- thisuser.sysstatus |= sysstatus_pause_on_page;
+ thisuser.timesaved=0; /* mod - add */
-
+ for (i=0; i<31; i++) /* mod - change */
- thisuser.res[i]=0;


3) In SYSOPF.C, add the following code to void print_data to show the users
time in the bank:

- ltoa(u->uk,s2,10);
- ltoa(u->dk,s3,10);
- print("UpDn: U=",s,"-",s2,"k D=",s1,"-",s3,"k","");
+ itoa(u->timesaved,s,10); /* mod - add */
+ print("Bank: ",s,""); /* mod - add */
- if (u->note[0])
- print("Note: ",(u->note),"");


4) Again in SYSOPF.C, add the following code to void uedit to allow editing
of the time the user has in the bank (NOTE: these may not be in this order
if you've already made other modifications). Also, you may want to
update the sysop menu to reflect the new menu command:

- nl();
- prt(2,"Uedit : "); /* NOTE: You may not */
- if ((realsl==255) || (wfc)) /* have all these */
+ ch=onek("Q[]{}/,.?UDRNLCPOGMSTEYZAIHB$K~:"); /* letters in the */
- else /* prompt now - just */
+ ch=onek("Q[]{}/,.?UDRNLCPOGMSTEYZAIHBK"); /* add the letter B */
- switch(ch) {

/* This is the */
- prt(2,"Toggle which DAR? "); /* second part of */
- ch1=onek("\rABCDEFGHIJKLMNOP"); /* the change */
- if (ch1!=13) {
- ch1-='A';
- if ((wfc) || (thisuser.dar & (1 << ch1))) {
- u.dar ^= (1 << ch1);
- write_user(un,&u);
- }
- }
- break;
+ case 'B': /* mod - add */
+ nl(); /* mod - add */
+ prt(2,"New Time in Bank? "); /* mod - add */
+ input(s,8); /* mod - add */
+ i=atoi(s); /* mod - add */
+ if ((i>0) && (i<32000) && (s[0])) { /* mod - add */
+ u.timesaved=i; /* mod - add */
+ write_user(un,&u); /* mod - add */
+ } /* mod - add */
+ break; /* mod - add */
- case '~':
- u.ass_pts=0;


5) Update BBS.C, void mainmenu, to add the $ command for the bank. You will
also need to update the menu to reflect the new command:

- if ((sysstatus_expert & thisuser.sysstatus))
- printmenu(0);
- break;
- case '*':
- sublist();
- break;
+ case '$':
+ tzbank();
+ break;
- }


6) Update the following variable definitions at the top of EXTRN.C:

- extern userrec thisuser;
+ extern double timeon,extratimecall; /* mod - change */
- extern long hanguptime1;
- extern int in_extern,input_extern,wfc,charbufferpointer,async_irq,base;
- extern char charbuffer[161],curspeed[81];
- extern unsigned int modem_speed,com_speed;
- extern char *xenviron[50];
- extern int screenbottom,defscreenbottom,curatr,topline,ok_modem_stuff,screenlinest;
+ extern unsigned char realsl,andwith; /* mod - change */
+ extern int chatcall,high_speed; /* mod - add */

7) In EXTRN.C, add the following code to char *create_chain_file (at the very
end of the file) to allow the chain to read the amount of time the user has
remaining and the user's expert status:

- else
- alf(f,"8N1");
+ l=(long) (timeon); /* mod - add */
+ ltoa(l,s,10); /* mod - add */
+ alf(f,s); /* mod - add */
+ if ((sysstatus_expert & thisuser.sysstatus)==0) /* mod - add */
+ alf(f,"0"); /* mod - add */
+ else /* mod - add */
+ alf(f,"1"); /* mod - add */
+ itoa(thisuser.timesaved,s,10); /* mod - add */
+ alf(f,s); /* mod - add */
- close(f);
- get_dir(fpn,1);

8) At the end of EXTRN.C, read in the TZCASINO.C file, which is the code
required to actually call the external program (this is read in after
char *create_chain_file).

NOTE: Some sysops may have problems running the casino if they don't have
much free memory left. If this is the case, you will get the message
"Checking the Casino door.." then be returned to the main BBS menu when
you try to enter the casino. To fix this you can have the BBS shrink
when entering the casino by changing the line that reads:

full_external(s,0,0);

to:

shrink_out(s,1,1,0,0);

This will slow down the loading and exiting of the casino, but should
allow it to load properly. I think it takes about 100K or so of free
memory when you do a shell to run the casino.

9) Edit the FCNS.H file to recognize the TZBANK procedure:

- void gotcaller();
- void main (int argc, char *argv[]);
+ void tzbank();

10) Copy the menu/help files, TZMENU.MSG and TZMENU.ANS, to your GFILES
directory. You can edit these to customize the menus for your system.

11) Copy the control file TZCASINO.DAT into your DATA directory. You can
edit this file to change the cost of the things in the bank. Directions
are shown in the file.

12) Copy the TZCASINO.EXE file into the WWIV directory (the same directory
with BBS.EXE in it). This is the external part of the program and is
written in Turbo Pascal 5.0

13) In your DATA directory, create a TEXT file called SPONSORS.DAT. This
file contains the names of the users that "sponsor" the Unsolved Phrases
and Trivia Madness games. These are users of level less than 255 (i.e.
they don't have sysop access) that will be able to access the editors
for Unsolved Phrases or Trivia Madness. If only users who have sysop
access will be doing the editing, this file is not necessary. If you do
create the file, the format is:

# NAME

Where # is the 1 for Unsolved Phrases, or 2 for Trivia Madness. Don't
put any extra spaces in the file, either. For example, the line:

1 JOE MAMA

would give the user "JOE MAMA" sponsorship of Unsolved Phrases. Note that
there can be more than one sponsor for each event, or the same person can
sponsor both games, but remember that sponsors are not allowed to play the
games (unless they also happen to have sysop access). Also, the name
should be in ALL CAPITALS to work properly. (The name is the name/alias,
not the real name of the user).

14) Oh yeah, guess I should tell you that /? in the Casino gives the sponsor
menu... just like in the rest of the BBS. You'll need to know that to be
able to add phrases and trivia.

15) By the way, if you want to recompile the Casino.. I've included the TP
definition file with the correct compiler options. It works with Turbo
Pascal 5.0, I make no guarantees for other versions.

That's it - you've now got a complete banking and casino system. If there are
any questions I can be reached as described at the top of this file.


 December 26, 2017  Add comments

Leave a Reply