home *** CD-ROM | disk | FTP | other *** search
- /* Chargen for AREXX with automatic character entry in Player */
- /* For use with the Energion Campaign System and Player */
- /* Energion rules material Copyright 1988 Henry Neufeld but may be */
- /* Redistributed freely. Macro by Henry Neufeld */
- /* Support via Wind Dragon Inn, (402) 291-8053 3/12/2400 */
-
- /* Get command line arguments, if any */
- arg species species1 species2 .
-
- /* Initialize variables for species profiles */
- races='HUMAN GERDLU ERTZLU KELARU KAL TLAZIL HALF RACE'
- Human='100 100 100 100 100 100 100 100'
- Gerdlu='120 100 100 125 115 100 110 105'
- Ertzlu='100 105 105 120 115 100 110 100'
- Kelaru='100 115 110 105 100 105 100 100'
- Kal='120 100 90 120 130 80 70 120'
- Tlazil='140 85 85 120 120 85 100 110'
- label='STAGCOENHEIQWIFOPOOL'
- call randu time(seconds)
- st=1;ag=2;co=3;en=4;he=5;iq=6;wi=7;fo=8;pool=9
-
- /* Make sure Player is running before we get started */
- if ~show(l,'rexxsupport.library') then do
- if ~addlib('rexxsupport.library',0,-30,0) then do
- say 'ERROR: Can''t load rexxsupport.library'
- exit 20
- end
- end
- if ~showlist('P','PLAYER') then do
- say 'Starting Player . . .'
- 'runwsh player' /* Or try "shell command 'run directory:player'" if you don't have WShell */
- end
- address player
-
- /* Choose Character Species */
- /* Get species choice if not passed through command line */
- do until left(upper(c),1)='Y'
- do while ~checkinput(species)
- call printrace
- species=input('Species name? ')
- end
- /* Half species get an average of the two parent species */
- if left(upper(species),4)='HALF' then do
- do while ~checkinput(species1)
- call printrace
- species1=input('Select first species: ')
- end
- interpret 'parse var '||species1||' bstat1.1 bstat1.2 bstat1.3 bstat1.4 bstat1.5 bstat1.6 bstat1.7 bstat1.8'
- do while ~checkinput(species2)
- species2=input('Select second species: ')
- end
- interpret 'parse var '||species2||' bstat2.1 bstat2.2 bstat2.3 bstat2.4 bstat2.5 bstat2.6 bstat2.7 bstat2.8'
- do i=1 to 8
- racebase.i=((bstat1.i+bstat2.i)/2)%1
- end
- species='HALF '||species1||' '||'HALF '||species2
- end; else do
- /* Get the profile for a full blood species */
- interpret 'parse var '||species||' racebase.1 racebase.2 racebase.3 racebase.4 racebase.5 racebase.6 racebase.7 racebase.8 .'
- end
- say 'HYou chose:'
- say species
- do i=1 to 8
- say right(racebase.i,3)
- end
- /* Make sure the player hasn't changed his mind */
- c=input('Is this the species combination you want? ')
- if left(upper(c),1)~='Y' then do
- species=''
- species1=''
- species2=''
- end
- end
-
- totalrange=0
- /* Note: From this point, this macro a close translation of CHARGEN.BAS */
- /* (originally published in the Energion Basic Rules manual, used by */
- /* permission) into AREXX */
- do i=st to fo
- racerange=100;if racebase.i<100 then racerange=racebase.i
- totalrange=totalrange+racerange
- racemin.i=racebase.i-racerange+1;racemax.i=racebase.i+racerange
- diesize=(racerange/3)%1
- stat.i=(racebase.i-.3*racerange+random(1,diesize)+random(1,diesize)+random(1,diesize))%1
- basestat.i=stat.i
- end
- stat.pool=(totalrange*.25+totalrange*.05*(random(1,100)/100))%1
- basestat.pool=0; racemin.pool=0; racemax.pool=32767
-
- /* Adjust Stats, loop until 'break' */
- do forever
- say 'H Stat Cur Min Base Max'
- say '-------- --- --- ---- ---'
- do i=st to fo
- say left(i,5) substr(label,i*2-1,2)||' ' ''||right(stat.i,3) ''||right(racemin.i,7) ''||right(basestat.i,4) ''||right(racemax.i,4) ''
- end
- say 'E9 Pool ' ''||left(stat.pool,4)||''
- do until (src>0 & src<10)
- src=input('Source stat (CHECK to look in Player; DONE when done)? ')
- if src='DONE' then break
- if src='CHECK' then do
- call enterit
- c=input('Hit return when done looking: ')
- 'set changed n'
- 'project unload'
- src=99
- end
- if ~datatype(src,'N') then if index(label,src)=0 then src='99'
- if datatype(src,'M') then src=(index(label,left(src,2))/2)%1+1
- end
- if src='DONE' then break
- do until dest>0 & dest<10 & dest~=src
- dest=input('Destination stat? ')
- if datatype(dest,'M') then dest=(index(label,left(dest,2))/2)%1+1
- end
- do until pts>0
- pts=input('Number of points to move? ')
- end
- l=2; if substr(label,src*2-1,2)='PO' then l=4
- say 'Taking some' substr(label,src*2-1,l) 'and putting it on' substr(label,dest*2-1,2) 'E'
- n=0
- do i=1 to pts
- n=n+1; if n//5=0 then say 'A@ .'
- if (stat.src>racemin.src) & (stat.dest<racemax.dest) then do
- x=1; if stat.src<=basestat.src then do; x=2; i=i+1; end
- stat.src=stat.src-x
- x=1; if stat.dest<basestat.dest then x=2
- stat.dest=stat.dest+x
- end; else i=pts
- end
- end
-
- /* Enter final version of stats into Player */
- call enterit
-
- /* Get out before these subroutines do something strange */
- say 'Done!'
- exit
-
- /* Print list of race choices */
- printrace:
- say 'HHuman'
- say 'Gerdlu'
- say 'Ertzlu'
- say 'Kelaru'
- say 'Kal'
- say 'Tlazil'
- say 'Half race'
- return
-
- /* Check validity of arguments and make them null if invalid */
- Checkinput:
- arg tocheck
- if index(races,tocheck)>0 then return 1
- else return 0
-
- /* Enter stats into Player */
- enterit:
- say 'Now entering your stats into Player . . .'
- 'lock'
- 'project new'
- do i=st to fo
- 'set stat' substr(label,i*2-1,2) stat.i
- end
- 'redisplay'
- 'unlock'
- return
-
- /* Set prompt string and get a response */
- input:
- parse arg prmt
- p='E'||prmt||''
- options prompt p
- pull r
- return r
-