
-----------------------------------
araevin
Sat Jun 17, 2006 4:29 pm

Sort of RPG
-----------------------------------
This is my game. I took out the pictures becuse i forgot how to attach this.
it is not 100 % done.


 
drawfillbox (0, 0, maxx, maxy, black)
% var picID : int := Pic.FileNew ("Map3.jpg")
% var picID1 : int := Pic.FileNew ("necromancer.jpg")
% var picID2 : int := Pic.FileNew ("paladn.jpeg")
% var picID4, picID45, picID5, picID55, pic1, pic2, pic3, pic4, pic5, pic6 : int
% picID4 := Pic.FileNew ("necro1.jpg")
% picID45 := Pic.FileNew ("necro1.5.jpg")
% picID5 := Pic.FileNew ("necro2.jpg")
% picID55 := Pic.FileNew ("paladn.jpg")
% pic1 := Pic.FileNew ("don.bmp")
% pic2 := Pic.FileNew ("don1.5.bmp")
% pic3 := Pic.FileNew ("don2.bmp")
% pic4 := Pic.FileNew ("don3.bmp")
% pic5 := Pic.FileNew ("map2.bmp")
% pic6 := Pic.FileNew ("map3.bmp")
var oldweap, oldarm : int := 0
var weap, arm : int := 0
var ch, oldch : string (1) := " "
var row, col, face : int
row := maxrow div 2 % start in middle of the screen
col := maxcol div 2
face := 111  % character to display
row := 20
col := 145
var bs : int := 7
var ehp : int := 7
var bclr : int := 0
var number : int
var foodrow, foodcol : int
var tailrow2, tailcol2 : int
var tailrow, tailcol : array 1 .. 50 of int
var taillength : int := 1
var lives : int := 5
var hp : int := 20
var pwidth : int := 75
var plen : int := 8
var pclr : int := brightwhite
var left1 := 20 % this is the space from the left wall
var up := 430 % this is the max hight for the brick box
var pxpos : int := 20
var pypos : int := 145
const right := 1
const left := -1
var side : int := 30 % this is the side length of the sqare brick
var choice : string
var bxpos, bxpostest : int := maxx div 2
var bypos, bypostest : int := maxy div 2 - 100
var bsize := 10
var direction : int := right
var angle : real := 45
var hitBrick : boolean := false
var score : int := 0
var life : int := 3
var turn : int := 1
var good : int := 0
var evil : int := 0
tailrow (1) := row %initial values
tailcol (1) := col
var enemyx : int := 200
var enemyy : int := 135
var ch32 : string
var level := 1
var hit : int
var Exp := 0
var font1 : int
var mp := 6
var part := 1
font1 := Font.New ("serif:52")
var Dice : array 1 .. 3 of int
for i : 1 .. 3                      % Add up the elements of Dice
    Dice (i) := Rand.Int (1, 20)
end for
var weapbon : int := 0
var p1x, p1y, p2x, p2y : int := -10
var potRand : int
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% proc sp
%     Pic.Draw (picID45, maxx div 2 - 100, maxy div 2, picMerge)
%     delay (300)
%     Pic.Draw (picID5, maxx div 2 - 100, maxy div 2, picMerge)
%     delay (300)
%     Pic.Draw (picID4, maxx div 2 - 100, maxy div 2, picMerge)
%     delay (300)
% end sp
% proc mm
%     if level >= 1 then
%         Pic.Draw (pic1, maxx div 2 - 100, maxy div 2, picMerge)
%         delay (300)
%         Pic.Draw (pic2, maxx div 2 - 100, maxy div 2, picMerge)
%         delay (300)
%         Pic.Draw (pic3, maxx div 2 - 100, maxy div 2, picMerge)
%         delay (300)
%         Pic.Draw (pic4, maxx div 2 - 100, maxy div 2, picMerge)
%         delay (300)
%     end if
% end mm
% proc bp
%     Pic.Draw (picID45, maxx div 2 - 100, maxy div 2, picMerge)
%     delay (300)
%     Pic.Draw (picID5, maxx div 2 - 100, maxy div 2, picMerge)
%     delay (300)
%     Pic.Draw (picID4, maxx div 2 - 100, maxy div 2, picMerge)
%     delay (300)
% end bp
function trued : boolean
    if ehp  0 or arm > 0 then
        put "This is the game of dice, its very easy to understand: "
        put "Each player rolls three 20 sided dice and whoever gets "
        put "thigher numbers winns."
        delay (2000)
        put "You roll first ..."
        delay (1000)
        for i : 1 .. 3              % Add up the elements of Dice
            put "You rolled : ", Dice (i)
            sumU := sumU + Dice (i)
        end for

        put "You rolled a total of = ", sumU
        put "Your opponent Rolls..."
        delay (1000)
        %PIc
        for i : 1 .. 3              % Add up the elements of Dice
            Dice (i) := Rand.Int (1, 20)
        end for

        for i : 1 .. 3              % Add up the elements of Dice
            put "Opponent rolled : ", Dice (i)
            sumE := sumE + Dice (i)
        end for

        put "Opponent Rolled a Total of = ", sumE
        delay (2000)
        if sumU > sumE then
            put "You Won The Round!"
            put "You Get Your Choice of Item."
            delay (1000)
            put "These are The items Avalable"
            deal := Rand.Int (1, 3)
            if deal = 1 then
                put "Will you take the broadsword (b) or ogres gauntlets (o)"
                get d
                if d = "b" then
                    put "The broadsword is yours."
                    weap := 3
                else
                    put "The gauntlets are yours."
                    arm := 2
                end if
            elsif deal = 2 then
                put "Will you take the Poisoned dagger (p) or Holy Splint Mail (h)"
                get d
                if d = "p" then
                    put "The Dagger is yours."
                    weap := 4
                else
                    put "The Holy Splint Mail is yours "
                    arm := 5
                end if
            else
                put "Will you take the Saber (s) or Mages Robe (m)"
                get d
                if d = "s" then
                    put "The Saber is yours."
                    weap := 2
                else
                    put "The Robe is yours."
                    arm := arm + 1
                end if
            end if
            delay (2000)
        elsif sumU < sumE then

            if weap = 0 then
                put "Ha Ha You lost your armor"
                arm := 0
            elsif arm = 0 then
                put "Ha Ha You lost your weapon"
                weap := 0
            else

                put "What will you give away your weapon(w) or your armor(a)?"
                get d
                if d = "w" then
                    put "Ha! Ha! you lost your weapon"
                    weap := 0
                else
                    put "Ha! Ha! you lost your armor"
                    arm := 0
                end if
                delay (2000)
            end if
        else
            put "We tied... Upsetting... Next!"
            delay (2000)
        end if
    else
        put "Bah! You cant play You got nothing to loose Get out'a 'ere"
    end if
end GameDice
proc wiz
    drawfillbox (0, 0, maxx, maxy, brightcyan)
    locate (1, 1)
    put "You sit with the wizard and his apretice and start taling about "
    put "Different types of spells... as the night goes late the wizard says "
    put "That he has to go and take a nap but for making such good conversation "
    put "he gives you ..."
    var d := 0
    d := Rand.Int (1, 2)
    if d = 1 then
        put "A potion of might + 10 health"
        hp := hp + 10
        delay (1000)
    else
        put "A potion of Intelligence + 10 magic"
        mp := mp + 10
    end if
    put "You thank Him for his gift and wish him good night."
    delay (1000)
end wiz
proc bards
    drawfillbox (0, 0, maxx, maxy, brightcyan)
    locate (1, 1)
    put "You sit at a chair and listen to the bards soothing music"
    delay (1000)
    put "After a while you become invigorated and your sences are sharpend"
    put " +5 magic and +5 health."
    mp := mp + 5
    hp := hp + 5
    put "You compliment the bards for their magical songs and"
    put "leave a pouch of gold behind for them"
    delay (3000)
end bards
proc Hero
    drawfillbox (0, 0, maxx, maxy, brightcyan)
    locate (1, 1)
    var x : string := ""
    put "You sit down with the heroes and listen to their adventures ... "
    put "after a while they ask you about what you are doing right now and"
    put "You tell them about how you are on a mission to destroy the necromancer"
    put "That threatens the land, They wish to join your good case and you agree "
    put "But then you remember that your teleport spell can only take one peron so"
    put "They decide to give you a special talisman that they have found on their"
    put "last adventure it gives you 10 extra magic or they will put an "
    put "enchantment on your weapon. "
    put "Which do you want the talisman(t) or the enchantment(e)"
    get x
    if x = "t" then
        put "You take the talisman and thank them for their generocity."
    else
        put "Which enchantment do you want ?"
        put "A: The Holy touch enchantment Which gives your weapon +1 damage and"
        put "   which gives you + 2 health"
        put "B: The Spider Venom enchantment which gives your weapon + 1 damage"
        put "   and gives you + 2 magic"
        put "C: The Abbysal Scream enchantment which give your weapon + 2 damage"
        get x
        if x = "a" then
            put "One of the heroes takes out magical ingridients and casts a spell over"
            put "Your weapon"
            weapbon := weapbon + 1
            hp := hp + 2
            good := good + 1
        elsif x = "b" then
            put "One of the heroes takes out magical ingridients and casts a spell over"
            put "Your weapon"
            weapbon := weapbon + 1
            mp := mp + 2
            good := good + 1
            evil := evil + 1
        else
            put "One of the heroes takes out magical ingridients and casts a spell over"
            put "Your weapon"
            weapbon := weapbon + 2
            evil := evil + 1
        end if
    end if
    delay (3000)
end Hero
var za : int := 0
proc Bar
    if za = 1 then
        colourback (brightcyan)
        colour (blue)
        drawfillbox (0, 0, maxx, maxy, brightcyan)
        locate (1, 1)
        put "As you died your soul was yanked out of your bodey and placed into enother"
        delay (100)
        put "You appeared at the foot steps of a mighty cloud city with golden spires and"
        delay (100)
        put "Unnaturally white walls. You see millions of winged people living within it "
        delay (100)
        put "and you wonder if this is heaven. Then a Small Wrinkled old man that has green"
        delay (100)
        put "skin and short stubby wings flies up to you and says:"
        delay (100)
        put "'Heh Heh Heh Died already little hero' He squeaks 'Well me and a coupla o my "
        delay (100)
        put "angel buddies had a bet on you and i bet that you would beat that old necro'"
        delay (100)
        put "'So i dont want to loose that bet... lets make a deal I will shove you back"
        delay (100)
        put "Into your world with a new life and all you have to do is kill the necro'"
        delay (100)
        put "He hastly adds 'or else you'll go to Abyss and serve a couple of eternities "
        delay (100)
        put "there."

        put "he doesn't wait for your answer, he points a finger at your heart and ..."
        delay (2000)
    else
        colourback (brightcyan)
        colour (blue)
        drawfillbox (0, 0, maxx, maxy, brightcyan)
        locate (1, 1)

        put "Before entering the Necromancers layer you decide to Rest at an inn"
        put "to which you can teleport to..."
        delay (1000)
        %PIc
    end if
    var b : string := ""
    delay (100)
    put "When you appear at the inns comfy surroundings you see Heroes talking about "
    put "their adventurers , Bards singing in the corner, people playing a "
    put "dice game and an old wizard talking to his young aprentice."
    put "What do you wish to do ?"
    put "(Remeber you only have time for 2 things you got to save the world and stuff)"
    put ""
    put "A: Sit and listen to the bards"
    delay (100)
    put "B: Eat at the tables"
    delay (100)
    put "C: Speak to the wizard and his apprentice."
    delay (100)
    put "D: Play the game of dice "
    delay (100)
    put "E: Talk with the adventurers "
    get b
    drawfillbox (0, 0, maxx, maxy, brightcyan)
    if b = "a" then
        bards
    elsif b = "b" then
        Food
    elsif b = "c" then
        wiz
    elsif b = "d" then
        GameDice
    else
        Hero
    end if
    drawfillbox (0, 0, maxx, maxy, brightcyan)
    put "You have time to do one more thing, what will it be?"
    if b = "a" then
        put "B: Eat at the tables"
        delay (100)
        put "C: Speak to the wizard and his apprentice."
        delay (100)
        put "D: Play the game of dice "
        delay (100)
        put "E: Talk with the adventurers "
        get b
        drawfillbox (0, 0, maxx, maxy, brightcyan)
        if b = "b" then
            Food
        elsif b = "c" then
            wiz
        elsif b = "d" then
            GameDice
        else
            Hero
        end if
    elsif b = "b" then
        put "A: Sit and listen to the bards"
        delay (100)
        put "C: Speak to the wizard and his apprentice."
        delay (100)
        put "D: Play the game of dice "
        delay (100)
        put "E: Talk with the adventurers "
        get b
        drawfillbox (0, 0, maxx, maxy, brightcyan)
        if b = "a" then
            bards
        elsif b = "c" then
            wiz
        elsif b = "d" then
            GameDice
        else
            Hero
        end if
    elsif b = "c" then
        put "A: Sit and listen to the bards"
        delay (100)
        put "B: Eat at the tables"
        delay (100)
        put "D: Play the game of dice "
        delay (100)
        put "E: Talk with the adventurers "
        get b
        drawfillbox (0, 0, maxx, maxy, brightcyan)
        if b = "a" then
            bards
        elsif b = "b" then
            Food
        elsif b = "d" then
            GameDice
        else
            Hero
        end if
    elsif b = "d" then
        put "A: Sit and listen to the bards"
        delay (100)
        put "B: Eat at the tables"
        delay (100)
        put "C: Speak to the wizard and his apprentice."
        delay (100)
        put "E: Talk with the adventurers "
        get b
        drawfillbox (0, 0, maxx, maxy, brightcyan)
        if b = "a" then
            bards
        elsif b = "b" then
            Food
        elsif b = "c" then
            wiz
        else
            Hero
        end if
    else
        put "A: Sit and listen to the bards"
        delay (100)
        put "B: Eat at the tables"
        delay (100)
        put "C: Speak to the wizard and his apprentice."
        delay (100)
        put "D: Play the game of dice "
        get b
        drawfillbox (0, 0, maxx, maxy, brightcyan)
        if b = "a" then
            bards
        elsif b = "b" then
            Food
        elsif b = "c" then
            wiz
        else
            GameDice
        end if
    end if
    delay (1000)
    drawfillbox (0, 0, maxx, maxy, brightcyan)
    put "You leave the bar refreshed and ready to beat the necromancers."
    delay (1000)
    %PIc
    colourback (black)
    colour (brightwhite)
end Bar
proc drawbackagain
    % if part = 1 then
    %     Pic.Draw (picID, 0, 0, picCopy)
    % elsif part = 2 then
    %     Pic.Draw (pic5, -35, -30, picCopy)
    % else
    %     Pic.Draw (pic6, -35, -40, picCopy)
    % end if
end drawbackagain
proc playadeath
    if good < evil then
        drawfillbox (maxx, maxy, 0, 0, yellow)
        Font.Draw ("You died as a holy warrior", (maxx div 2) - 320, maxy div 2, font1, brightwhite)
        delay (200000)
    elsif good > evil then
        drawfillbox (maxx, maxy, 0, 0, red)
        Font.Draw ("You died as an evil warrior", (maxx div 2) - 320, maxy div 2, font1, brightred)
        delay (200000)
    else
        if za > 1 then
            drawfillbox (maxx, maxy, 0, 0, cyan)
            Font.Draw ("Welcome To Abyss", (maxx div 2) - 220, maxy div 2, font1, brightred)
        else
            drawfillbox (maxx, maxy, 0, 0, cyan)
            Font.Draw ("You didn't actually die...", (maxx div 2) - 320, maxy div 2, font1, brightred)
            za := za + 1
            hp := 20
            mp := 6
            Bar
        end if

    end if
    if za = 0 or za > 1 then
        delay (200000)
        quit
    else
        part := 2
        pxpos := 100
        drawbackagain
    end if
end playadeath

proc endgood
    put "You have defeated the evil necromancer and rid the world of his undead army..."
    put "Now you will live your life as a poor goodly peasant in the middle of nowhere."
    put "Goodjob Idiot."
end endgood
proc endevil
    put "As you fought the necromancer and his minions you thought of how alike you are"
    put "When you defeated him you took his necromantic powers and got your own army of"
    put "Undead minions with which you took over the world. Good Job 'Hero'"
end endevil
proc endn
    put "When you defeat the evil necromancer a secret door opens into a room full of gold"
    put "and jewels. There are also four bisexual princeses living there ... "
    put "You live happily ever after. (Wink Wink Nudge Nudge Say no more Say no more)"
end endn
proc GoodOReviL
    if good > evil then
        endgood
    elsif good < evil then
        endevil
    else
        endn
    end if
end GoodOReviL
proc items
    var randi : int
    var ix, iy : int
    var wha : string := ""
    var item : int
    var cho : string
    randi := Rand.Int (1, 20)
    if randi + level >= 12 then
        if randi = randi then
            item := Rand.Int (1, 3)
            if item = 1 then
                wha := "weapon"
            elsif item = 2 then
                wha := "armor"
            elsif item = 3 then
                wha := "potion"
            end if
        end if
        if wha = "" then
        else
            if wha = "weapon" then
                randi := Rand.Int (1, 5)
                if randi = 1 then
                    oldweap := weap
                    if weap = 0 then
                        put "you have found a longsword +1 damage!"
                        delay (1000)
                        drawbackagain
                        weap := 1
                    else
                        put "you have found a longsword +1 damage, will you switch this item with your previous weapon?"
                        delay (1000)
                        drawbackagain
                        get wha
                        if wha = "n" then
                            weap := oldweap
                        else
                            weap := 1
                        end if
                    end if
                elsif randi = 2 then
                    oldweap := weap
                    if weap = 0 then
                        put "you have found a Greataxe + 2 damage!"
                        delay (1000)
                        drawbackagain
                        weap := 2
                    else
                        put "you have found a Greataxe + 2 damage, will you switch this item with your previous weapon?"
                        delay (1000)
                        drawbackagain
                        get wha
                        if wha = "n" then
                            weap := oldweap
                        else
                            weap := 2
                        end if
                    end if
                elsif randi = 3 then
                    oldweap := weap
                    if weap = 0 then
                        put "you have found a longspear + 3 damage"
                        delay (1000)
                        drawbackagain
                        weap := 3
                    else
                        put "you have found a longspear + 3 damage, will you switch this item with your previous weapon?"
                        delay (1000)
                        drawbackagain
                        get wha
                        if wha = "n" then
                            weap := oldweap
                        else
                            weap := 3
                        end if
                    end if
                elsif randi = 4 then
                    oldweap := weap
                    if weap = 0 then
                        put "you have found a runesword + 4 damage!"
                        delay (1000)
                        drawbackagain
                        weap := 4
                    else
                        put "you have found a runesword + 4 damage, will you switch this item with your previous weapon?"
                        delay (1000)
                        drawbackagain
                        get wha
                        if wha = "n" then
                            weap := oldweap
                        else
                            weap := 4
                        end if
                    end if
                else
                    oldweap := weap
                    if weap = 0 then
                        put "you have found two schimatrs + 5 damage"
                        delay (1000)
                        drawbackagain
                        weap := 5
                    else
                        put "you have found two schimatrs + 5 damage, will you switch this item with your previous weapon?"
                        delay (1000)
                        drawbackagain
                        get wha
                        if wha = "n" then
                            weap := oldweap
                        else
                            weap := 5
                        end if
                    end if
                end if
                wha := ""
            elsif wha = "armor" then
                randi := Rand.Int (1, 5)
                if randi = 1 then
                    oldarm := arm
                    if arm = 0 then
                        put "you have found hide armor -1 damage to yourself!"
                        delay (1000)
                        drawbackagain
                        arm := 1
                    else
                        put "you have found hidearmor -1 damage, will you switch this item with your armor?"
                        delay (1000)
                        drawbackagain
                        get wha
                        if wha = "n" then
                            arm := oldarm
                        else
                            arm := 1
                        end if
                    end if
                elsif randi = 2 then
                    oldarm := arm
                    if arm = 0 then
                        put "you have found leather armor - 2 damage!"
                        delay (1000)
                        drawbackagain
                        arm := 2
                    else
                        put "you have found leather armor - 2 damage, will you switch this item with your armor?"
                        delay (1000)
                        drawbackagain
                        get wha
                        if wha = "n" then
                            arm := oldarm
                        else
                            arm := 2
                        end if
                    end if
                elsif randi = 3 then
                    oldarm := arm
                    if arm = 0 then
                        put "you have found scale mail - 3 damage"
                        delay (1000)
                        drawbackagain
                        arm := 3
                    else
                        put "you have found scale mail - 3 damage, will you switch this item with your armor?"
                        delay (1000)
                        drawbackagain
                        get wha
                        if wha = "n" then
                            arm := oldarm
                        else
                            arm := 3
                        end if
                    end if
                elsif randi = 4 then
                    oldarm := arm
                    if arm = 0 then
                        put "you have found half plate armor - 4 damage!"
                        delay (1000)
                        drawbackagain
                        arm := 4
                    else
                        put "you have found half plate armor - 4 damage, will you switch this item with your armor?"
                        delay (1000)
                        drawbackagain
                        get wha
                        if wha = "n" then
                            arm := oldarm
                        else
                            arm := 4
                        end if
                    end if
                else
                    oldarm := arm
                    if arm = 0 then
                        put "you have found full plate armor - 5 damage"
                        delay (1000)
                        drawbackagain
                        arm := 5
                    else
                        put "you have found full plate armor - 5 damage, will you switch this item with your armor?"
                        delay (1000)
                        drawbackagain
                        get wha
                        if wha = "n" then
                            arm := oldarm
                        else
                            arm := 5
                        end if
                    end if
                end if
                wha := ""
            elsif wha = "potion" then
                randi := Rand.Int (1, 2)
                if randi = 1 then
                    put "you got a health potion"
                    delay (1000)
                    drawbackagain
                    hp := hp + 5
                else
                    put "you got a magic potion"
                    delay (1000)
                    drawbackagain
                    mp := mp + 5
                end if
            end if
        end if
    else
        wha := ""
    end if
end items
proc potions
    potRand := Rand.Int (1, 30)
    if potRand > 15 then
        p1x := pxpos + 50
        p1y := pypos
        drawfilloval (p1x, p1y, 5, 5, red)
    elsif potRand < 15 then
        p2x := pxpos + 50
        p2y := pypos
        drawfilloval (p2x, p2y, 5, 5, red)
    else
    end if
end potions
proc beatlvl
    if part = 3 then
        locate (1, 1)
        put "You Beat this mission!"
        delay (2000)
        drawfillbox (0, 0, maxx, maxy, green)
        color (brightred)
        GoodOReviL
        delay (200000)
        quit
    else
    end if
end beatlvl
proc lvlUp
    if level = 1 and Exp >= 100 then
        Exp := 0
        level := level + 1
        drawfillbox (0, 0, maxx, maxy, green)
        locate (maxrow div 2, maxcol div 2)
        put "You leveled up! You are now Level ", level
        delay (1000)
        drawFight
        mp := mp + 4
        hp := 20
        drawfillbox (0, 0, maxx, maxy, black)
    elsif level = 2 and Exp >= 120 then
        Exp := 0
        level := level + 1
        drawfillbox (0, 0, maxx, maxy, green)
        locate (maxrow div 2, maxcol div 2)
        put "You leveled up! You are now Level ", level
        delay (1000)
        drawFight
        mp := mp + 4
        hp := 20
        drawfillbox (0, 0, maxx, maxy, black)
    elsif level >= 3 and Exp >= 200 then
        Exp := 0
        level := level + 1
        drawfillbox (0, 0, maxx, maxy, green)
        locate (maxrow div 2, maxcol div 2 - 10)
        put "You leveled up! You are now Level ", level
        delay (1000)
        drawFight
        mp := mp + 4
        hp := 20
        drawfillbox (0, 0, maxx, maxy, black)
    end if
end lvlUp
proc enemydeath
    var agrajag : int
    if ehp = 0 or ehp < 0 then
        var getexp : int := 0
        drawFight
        locate (maxrow, 1)
        if part = 1 then
            getexp := Rand.Int (10, 50)
        elsif part = 2 then
            getexp := Rand.Int (25, 65)
        end if
        items
        Exp := Exp + getexp
        put "You have defeated a necromnacer! You Get ", getexp, " Exp."
        delay (1000)
        score := score + 1
        beatlvl
        lvlUp
        enemyx := enemyx + 100
        % if part = 1 then
        %     Pic.Draw (picID, 0, 0, picCopy)
        % elsif part = 2 then
        %     Pic.Draw (pic5, -35, -30, picCopy)
        % else
        %     Pic.Draw (pic6, -35, -40, picCopy)
        % end if
        if part = 1 then
            ehp := Rand.Int (5, 10)
        elsif part = 2 then
            ehp := Rand.Int (10, 18)
        end if
        agrajag := Rand.Int (1, 20) + level
        if agrajag + level >= 5 then
            potions
        end if
        turn := 1
        drawfillbox (0, 0, maxx, maxy, black)
    end if
end enemydeath
proc bossdeath
    drawfillbox (0, 0, maxx, maxy, green)
    Font.Draw ("You Have Won!", (maxx div 2) - 220, maxy div 2, font1, 46)
    delay (2000)
    drawfillbox (0, 0, maxx, maxy, green)
    GoodOReviL
    delay (20000)
    quit
end bossdeath
proc holySmite
    mp := mp - 1
    good := good + 1
    drawFight
    locate (maxrow, 1)
    put "You cast holy smite!"
    delay (1000)
    hit := Rand.Int (1, 20)
    if (hit + level) >= 5 then
        locate (maxrow, 1)
        put "You Sucsessfully cast the spell!"
        Font.Draw ("!!!Holy Smite!!!", (maxx div 2) - 220, maxy div 2, font1, 43)
        delay (1000)
        ehp := ehp div 2
    else
        locate (maxrow, 1)
        put "Omg you missed, You sore loser!"
        delay (1000)
    end if
    hit := 0
end holySmite
proc mpUp
    drawFight
    good := good - 1
    evil := evil - 1
    locate (maxrow, 1)
    put "You cast Mage Strength!"
    delay (1000)
    hit := Rand.Int (1, 20)
    if (hit + level) >= 1 then
        locate (maxrow, 1)
        put "You Sucsessfully cast the spell!"
        Font.Draw ("!!!Mage Strength!!!", (maxx div 2) - 220, maxy div 2, font1, 43)
        delay (1000)
        mp := mp + 5
    else
        locate (maxrow, 1)
        put "Omg you missed, You sore loser!"
        delay (1000)
    end if
    hit := 0
end mpUp
proc lloth
    mp := mp - 3
    drawFight
    evil := evil + 1
    locate (maxrow, 1)
    put "You cast Lloths Wrath!"
    delay (1000)
    hit := Rand.Int (1, 20)
    if (hit + level) >= 5 then
        locate (maxrow, 1)
        put "You Sucsessfully cast the spell!"
        Font.Draw ("!!!Lloths Wrath!!!", (maxx div 2) - 220, maxy div 2, font1, 43)
        delay (1000)
        ehp := ehp div 2 - 3
    else
        locate (maxrow, 1)
        put "Omg you missed, You sore loser!"
        delay (1000)
    end if
    hit := 0
end lloth
proc godsWrath
    mp := mp - 2
    drawFight
    good := good + 1
    locate (maxrow, 1)
    put "You cast gods wrath!"
    delay (1000)
    hit := Rand.Int (1, 20)
    if (hit + level) >= 7 then
        locate (maxrow, 1)
        put "You Sucsessfully cast the spell!"
        Font.Draw ("!!!Gods Wrath!!!", (maxx div 2) - 220, maxy div 2, font1, 34)
        delay (1000)
        ehp := ehp div ehp + 1
    else
        locate (maxrow, 1)
        put "Omg you missed, You sore loser!"
        delay (1000)
    end if
    hit := 0
end godsWrath
proc windBlade
    mp := mp - 1
    drawFight
    evil := evil - 1
    good := good - 1
    locate (maxrow, 1)
    put "You cast Wind Blade!"
    delay (1000)
    hit := Rand.Int (1, 20)
    if (hit + level) >= 1 then
        locate (maxrow, 1)
        put "You Sucsessfully cast the spell!"
        Font.Draw ("!!!Wind Blade!!!", (maxx div 2) - 220, maxy div 2, font1, 47)
        put ehp
        ehp := ehp - 10
        delay (1000)
        put ehp
        delay (1000)
    else
        locate (maxrow, 1)
        put "Omg you missed, You sore loser!"
        delay (1000)
    end if
    hit := 0
end windBlade
proc flameBlade
    mp := mp - 1
    drawFight
    good := good + 1
    locate (maxrow, 1)
    put "You cast Flame Blade!"
    delay (1000)
    hit := Rand.Int (1, 20)
    if (hit + level) >= 5 then
        locate (maxrow, 1)
        put "You Sucsessfully cast the spell!"
        Font.Draw ("!!!Flame Blade!!!", (maxx div 2) - 220, maxy div 2, font1, 44)
        delay (1000)
        ehp := ehp - 1
    else
        locate (maxrow, 1)
        put "Omg you missed, You sore loser!"
        delay (1000)
    end if
    hit := 0
end flameBlade
proc shadowBlade
    mp := mp - 1
    drawFight
    evil := evil + 1
    locate (maxrow, 1)
    put "You cast Shadow Blade!"
    delay (1000)
    hit := Rand.Int (1, 20)
    if (hit + level) >= 5 then
        locate (maxrow, 1)
        put "You Sucsessfully cast the spell!"
        Font.Draw ("!!!Shadow Blade!!!", (maxx div 2) - 220, maxy div 2, font1, 40)
        delay (1000)
        ehp := ehp - 1
    else
        locate (maxrow, 1)
        put "Omg you missed, You sore loser!"
        delay (1000)
    end if
    hit := 0
end shadowBlade
proc purify
    mp := mp - 3
    drawFight
    good := good + 1
    locate (maxrow, 1)
    put "You cast purify!"
    delay (1000)
    hit := Rand.Int (1, 20)
    if (hit + level) >= 12 then
        locate (maxrow, 1)
        put "You Sucsessfully cast the spell!"
        Font.Draw ("!!!Purify!!!", (maxx div 2) - 220, maxy div 2, font1, 68)
        delay (1000)
        ehp := 0
    else
        locate (maxrow, 1)
        put "Omg you missed, You sore loser!"
        delay (1000)
    end if
    hit := 0
end purify
proc Drain
    mp := mp - 3
    drawFight
    evil := evil + 1
    locate (maxrow, 1)
    put "You cast Drain!"
    delay (1000)
    hit := Rand.Int (1, 20)
    if (hit + level) >= 12 then
        locate (maxrow, 1)
        put "You Sucsessfully cast the spell!"
        Font.Draw ("!!!Drain!!!", (maxx div 2) - 220, maxy div 2, font1, 68)
        delay (1000)
        ehp := ehp - 5
        hp := hp + 5
    else
        locate (maxrow, 1)
        put "Omg you missed, You sore loser!"
        delay (1000)
    end if
    hit := 0
end Drain
proc lightning
    mp := mp - 3
    drawFight
    good := good + 1
    locate (maxrow, 1)
    put "You cast lightning!"
    delay (1000)
    hit := Rand.Int (1, 20)
    if (hit + level) >= 12 then
        locate (maxrow, 1)
        put "You Sucsessfully cast the spell!"
        Font.Draw ("!!!Lightning!!!", (maxx div 2) - 220, maxy div 2, font1, 68)
        delay (1000)
        ehp := ehp - 7

    else
        locate (maxrow, 1)
        put "Omg you missed, You sore loser!"
        delay (1000)
    end if
    hit := 0
end lightning
proc speed
    mp := mp - 4
    drawFight
    evil := evil + 1
    good := good + 1
    locate (maxrow, 1)
    put "You cast speed!"
    delay (1000)
    hit := Rand.Int (1, 20)
    if (hit + level) >= 12 then
        locate (maxrow, 1)
        put "You Sucsessfully cast the spell!"
        Font.Draw ("!!!Speed!!!", (maxx div 2) - 220, maxy div 2, font1, cyan)
        delay (1000)
        ehp := (-10 + Rand.Int (7, 12))
        hp := hp + level
        turn := 1
    else
        locate (maxrow, 1)
        put "Omg you missed, You sore loser!"
        delay (1000)
    end if
    hit := 0
end speed
proc magic
    if level = 1 and mp > 0 then
        drawFight
        locate (maxrow, 1)
        put "Holy smite (h), Shadow (s), Wind (w) or Flame Blade (f) "
        get choice
        if choice = "h" then
            holySmite
        elsif choice = "s" then
            shadowBlade
        elsif choice = "w" then
            windBlade
        elsif choice = "f" then
            flameBlade
        else
            holySmite
        end if
    elsif level = 2 and mp > 0 then
        if good > evil then
            drawFight
            locate (maxrow, 1)
            put "Spells Avalable : Holy Smite (H) 1 MP , Gods Wrath (G) 2 MP , purify (P) ."
            get choice
            if choice = "h" or choice = "H" then
                holySmite
            elsif choice = "g" then
                godsWrath
            elsif choice = "p" then
                purify
            end if
        elsif good < evil then
            drawFight
            locate (maxrow, 1)
            put "Spells Avalable : shadow blade (S) 1 MP, Lloth Wrath (L) 3 MP, Drain (D) 3 MP."
            get choice
            if choice = "s" or choice = "S" then
                shadowBlade
            elsif choice = "l" then
                lloth
            elsif choice = "d" then
                Drain
            end if
        else
            drawFight
            locate (maxrow, 1)
            put "Spells Avalable : Wind Blade (w) 1 MP , Speed (s) 4 MP , MpUp (m) 0 MP."
            get choice
            if choice = "w" or choice = "W" then
                windBlade
            elsif choice = "s" then
                speed
            elsif choice = "m" then
                mpUp
            end if
        end if
    elsif level > 2 and mp > 0 then
        if good > evil then
            drawFight
            locate (maxrow, 1)
            put "Spells Avalable : Holy Smite (H) 1 MP , Lightning (L) 2 MP , purify (P)."
            get choice
            if choice = "h" or choice = "H" then
                holySmite
            elsif choice = "l" then
                lightning
            elsif choice = "p" then
                purify
            end if
        elsif good < evil then
            drawFight
            locate (maxrow, 1)
            put "Spells Avalable : shadow blade (S) 1 MP, Lloth Wrath (L) 3 MP, Drain (D) 3 MP."
            get choice
            if choice = "s" or choice = "S" then
                shadowBlade
            elsif choice = "l" then
                lloth
            elsif choice = "d" then
                Drain
            end if
        else
            drawFight
            locate (maxrow, 1)
            put "Spells Avalable : Wind Blade (w) 1 MP , Speed (s) 4 MP , MpUp (m) 0 MP."
            get choice
            if choice = "w" or choice = "W" then
                windBlade
            elsif choice = "s" then
                speed
            elsif choice = "m" then
                mpUp
            end if
        end if
    else
        if good > evil then
            drawFight
            locate (maxrow, 1)
            put "Spells Avalable : Holy Smite (H) 1 MP , Lightning (L) 2 MP , purify (P)."
            get choice
            if choice = "h" or choice = "H" then
                holySmite
            elsif choice = "l" then
                lightning
            elsif choice = "p" then
                purify
            end if
        elsif good < evil then
            drawFight
            locate (maxrow, 1)
            put "Spells Avalable : shadow blade (S) 1 MP, Lloth Wrath (L) 3 MP, Drain (D) 3 MP."
            get choice
            if choice = "s" or choice = "S" then
                shadowBlade
            elsif choice = "l" then
                lloth
            elsif choice = "d" then
                Drain
            end if
        else
            drawFight
            locate (maxrow, 1)
            put "Spells Avalable : Wind Blade (w) 1 MP , Speed (s) 4 MP , MpUp (m) 0 MP."
            get choice
            if choice = "w" or choice = "W" then
                windBlade
            elsif choice = "s" then
                speed
            elsif choice = "m" then
                mpUp
            end if
        end if
    end if
end magic
proc enemyfight
    if part = 1 then
        drawFight
        Font.Draw ("Enemy Turn", (maxx div 2) - 155, maxy div 2, font1, brightgreen)
        delay (1000)
        drawFight
        turn := 1
        drawfillbox (0, 0, maxx, 100, red)
        locate (maxrow, 1)
        put "Enemy Attacks!"
        %sp
        delay (1000)
        hit := (Rand.Int (1, 20)) - level
        if hit > 9 + (level div 2) then
            Font.Draw ("!!!HIT!!!", (maxx div 2) - 125, maxy div 2, font1, brightred)
            delay (1000)
            drawFight
            locate (maxrow, 1)
            hp := hp - (Rand.Int (5, 6) - arm)
            put "                        Your HP : ", hp, " Enemy Hp : ", ehp
            delay (1400)
            if hp  7 + (level div 2) then
            Font.Draw ("!!!HIT!!!", (maxx div 2) - 125, maxy div 2, font1, brightred)
            delay (1000)
            drawFight
            locate (maxrow, 1)
            hp := hp - (Rand.Int (5, 8) - arm)
            put "                        Your HP : ", hp, " Enemy Hp : ", ehp
            delay (1400)
            if hp  9 + (level div 2) then
            Font.Draw ("!!!HIT!!!", (maxx div 2) - 125, maxy div 2, font1, brightred)
            delay (1000)
            drawFight
            locate (maxrow, 1)
            hp := hp - (Rand.Int (5, 10) - arm)
            put "                          Your HP : ", hp, " Enemy Hp : ", ehp
            delay (1400)
            if hp  9 then
                    drawFight
                    Font.Draw ("!!!HIT!!!", (maxx div 2) - 125, maxy div 2, font1, brightred)
                    delay (1000)
                    drawFight
                    locate (maxrow, 1)
                    ehp := ehp - level - 2 - weap - weapbon
                    put "                        Your HP : ", hp, " Enemy Hp : ", ehp
                    delay (1400)
                    if ehp  evil then
        drawfilloval (pxpos, pypos, bs, bs, pclr)
        drawline (pxpos, pypos, pxpos + 15, pypos + 7, brightblue)
        drawfilloval (pxpos + 3, pypos + 2, bs - 3, bs - 5, brightgreen)
        drawfilloval (pxpos - 2, pypos - 2, bs - 3, bs - 3, green)
        drawfilloval (pxpos - 2, pypos - 2, bs - 5, bs - 5, blue)
    else
        drawfilloval (pxpos, pypos, bs, bs, pclr)
        drawline (pxpos, pypos, pxpos + 15, pypos + 7, brightred)
        drawfilloval (pxpos + 3, pypos + 2, bs - 3, bs - 5, red)
        drawfilloval (pxpos - 2, pypos - 2, bs - 3, bs - 3, brightred)
        drawfilloval (pxpos - 2, pypos - 2, bs - 5, bs - 5, yellow)
    end if
end drawPlayer
proc enemytest
    if pxpos = enemyx - 10 then
        drawfillbox (3, 3, maxx - 3, maxy - 3, brightred)
        Font.Draw ("!!!FIGHT!!!", (maxx div 2) - 145, maxy div 2, font1, brightblue)
        delay (2000)
        fightscreen
    end if
end enemytest
proc enemy
    drawEnemy
end enemy
proc part2
    font1 := Font.New ("serif:37")
    if part = 2 then
        drawfillbox (0, 0, maxx, maxy, 100)
        Font.Draw ("You have entered the dungeons.", (maxx div 2) - 310, maxy div 2, font1, brightblue)
        font1 := Font.New ("serif:52")
        delay (1500)
        drawfillbox (0, 0, maxx, maxy, black)
        %Pic.Draw (pic5, -35, -30, picCopy)
        enemyx := 200
        enemyy := 135
        enemy
    elsif part = 3 then
        drawfillbox (0, 0, maxx, maxy, 99)
        Font.Draw ("!!Boss Fight!!", (maxx div 2) - 155, maxy div 2, font1, blue)
        delay (1500)
        drawfillbox (0, 0, maxx, maxy, black)
        %Pic.Draw (pic6, -35, -40, picCopy)
        enemyx := 400
        enemyy := 135
        enemy
        font1 := Font.New ("serif:52")
    end if
end part2
proc pmove (ch : string (1))

