Code: Select all
setscreen ("graphics:500;300,nocursor")
type MonsterStats :
record
race : string
strength, agility, vitality, wizardry : int
end record
function selectMonster : MonsterStats
var choice : int
var newMon : MonsterStats
loop
drawline (20, 20, 220, 20, 1)
drawline (20, 200, 20, 20, 1)
drawline (20, 200, 220, 200, 1)
drawline (220, 200, 220, 20, 1)
drawline (20, 170, 220, 170, 1)
locate (10, 4)
put "Pick a monster to Attck." ..
locate (12, 4)
put "1-Rat [Lv 1]" ..
locate (14, 4)
put "2-Bat [lv 2]" ..
locate (16, 4)
put "3-Spider [Lv 4]" ..
locate (18, 4)
put "4-Skeleton [Lv 5]" ..
get choice
case choice of
label 1 :
newMon.race := "Rat"
newMon.strength := 5
newMon.agility := 1
newMon.vitality := 5
newMon.wizardry := 1
exit
label 2 :
newMon.race := "Bat"
newMon.strength := 8
newMon.agility := 1
newMon.vitality := 7
newMon.wizardry := 1
exit
label 3 :
newMon.race := "Spider"
newMon.strength := 10
newMon.agility := 2
newMon.vitality := 10
newMon.wizardry := 1
exit
label 4 :
newMon.race := "Skeleton"
newMon.strength := 15
newMon.agility := 3
newMon.vitality := 10
newMon.wizardry := 1
exit
label :
put "That input is invalid."
end case
end loop
result newMon
end selectMonster
function name : string
var charName : string
drawline (180, 160, 330, 160, 1)
drawline (180, 120, 330, 120, 1)
drawline (180, 160, 180, 120, 1)
drawline (330, 120, 330, 160, 1)
locate (13, 25)
put "Enter your name." ..
locate (14, 25)
get charName : *
result charName
end name
var charName : string
type PlayerStats :
record
race : string
strength, agility, vitality, wizardry : int
end record
function selectRace : PlayerStats
var choice : int
var newChar : PlayerStats
loop
cls
%border around chars
drawline (370, 270, 230, 270, 1)
drawline (230, 240, 230, 270, 1)
drawline (370, 240, 370, 270, 1)
drawline (130, 240, 130, 100, 1)
drawline (490, 100, 130, 100, 1)
drawline (490, 240, 490, 100, 1)
drawline (490, 240, 130, 240, 1)
locate (4, 30)
%Chars
put "pick your race." ..
locate (8, 20)
put "1-Human (Str:15 Agi15 Vit:15 Wiz:15)"
locate (10, 20)
put "1-Night Elf (Str:15 Agi:20 Vit:10 Wiz:15)"
locate (12, 20)
put "1-Orc (Str:20 Agi:10 Vit:20 Wiz:10)"
locate (14, 20)
put "1-Undead (Str:10 Agi:10 Vit:20 Wiz:20)"
locate (4, 30)
get choice
%Choices of chars with status
case choice of
label 1 :
newChar.race := "Human"
newChar.strength := 15
newChar.agility := 15
newChar.vitality := 15
newChar.wizardry := 15
exit
label 2 :
newChar.race := "Night Elf"
newChar.strength := 15
newChar.agility := 20
newChar.vitality := 10
newChar.wizardry := 15
exit
label 3 :
newChar.race := "Orc"
newChar.strength := 20
newChar.agility := 10
newChar.vitality := 20
newChar.wizardry := 10
exit
label 4 :
newChar.race := "Undead"
newChar.strength := 10
newChar.agility := 10
newChar.vitality := 20
newChar.wizardry := 20
exit
label :
put "Please Select a Number from 1-4."
end case
end loop
result newChar
end selectRace
procedure myStats (myCharacter : PlayerStats, charName : string)
cls
%draw stats box
drawline (320, 260, 320, 100, 1)
drawline (410, 260, 410, 100, 1)
drawline (320, 100, 410, 100, 1)
drawline (420, 260, 320, 260, 1)
drawline (410, 230, 320, 230, 1)
drawline (410, 195, 320, 195, 1)
drawline (410, 160, 320, 160, 1)
drawline (410, 130, 320, 130, 1)
drawline (370, 230, 370, 100, 1)
%Display stats in box
locate (5, 42)
put myCharacter.race ..
locate (8, 48)
put myCharacter.strength ..
locate (11, 48)
put myCharacter.agility ..
locate (14, 48)
put myCharacter.vitality ..
locate (16, 48)
put myCharacter.wizardry ..
locate (8, 43)
put "Str"
locate (11, 43)
put "Agi"
locate (14, 43)
put "Vit"
locate (16, 43)
put "Wiz"
%stats bar
drawline (10, 280, 400, 280, 1)
drawline (10, 280, 10, 500, 1)
drawline (400, 280, 400, 300, 1)
locate (1, 3)
put charName, " ", myCharacter.race, " HP:", myCharacter.vitality * 1.5,
" SP:", myCharacter.wizardry * 2.2, " EXP:", "100", " z", "100000" ..
end myStats
charName := name
var myCharacter := selectRace
myStats (myCharacter, charName)
var myMonster := selectMonster
[code]
[color=#888888][size=85]Archived topic from Iceteks, old topic ID:3421, old post ID:27521[/size][/color]