Okay, I'm looking forward to it
Alright, just to get the ball rolling I'll post my "BOB" program.
Duel Of Magic: You vs. Bob--- Made in DBPro v6.6 (probably runs in earlier versions)
Use the on screen instructions to attack, Spell attack (combines normal damage with spell damage), increase damage, increase spell bonus damage, and to increase energy regeneration per turn switch. You will be able to do any of these things when it is your turn. While spell attacks are more powerful, they cost 10 energy to use so use them wisely!
The objective of this turn-based game is to defeat Bob in a magical battle. Bob is controlled by a computer AI.
So basically all of the actions are as follows:
Attack: Attacks Bob.
Spell Attack: Attacks Bob with a spell-enhanced attack, draining 10 energy and dealing Normal+Spell Damage.
Increase Damage: Increases your normal damage.
Increase Spell Damage: Increases Spell damage.
Increase Energy Regeneration: Increases the amount of energy you regenerate per turn swap.
set display mode 640,480,32 : sync on : sync rate 60 : autocam off : set text font "Verdana" : set text size 14 : randomize timer() : SYNC : print "You and Bob both fall into a magical cloud of gas after being ressurected" : print "and gain magical fighting powers. Bob breathes in more of the gas..." : print "Then he punches you in the face, and the duel begins." : SYNC : WAIT KEY
TYPE Player
Health as float : Energy as float : EnergyRegeneration as float : Damage as float : SpellDamage as float : LastAction as string : MAxHealth as float : MaxEnergy as float
ENDTYPE
GLOBAL Player as Player : GLOBAL Bob as Player : GOSUb SetVariables : GOSUB MainLoop : END
SetVariables:
set text size 14 : Player.Health=690 : Bob.Health=1000 : Player.Energy=20 : Bob.Energy=20 : Player.Damage=50 : Bob.Damage=50 : Player.LastAction="None" : bob.LastAction="None" : Player.SpellDamage=30 : Bob.SpellDamage=30 : Player.EnergyRegeneration=1 : Bob.EnergyRegeneration=1 : Player.MaxHealth=700 : Bob.MaxHealth=1000 : Player.MaxEnergy=30 : Bob.MaxEnergy=30 : global Turn : Turn=1+rnd(1) : Oldturn=turn : bobtime=700
return
MainLoop:
do : cls : ink rgb(255,255,255),0 : box 0,10,200,20,rgb(155,155,155),0,rgb(155,155,155),0 : box 0,10,200*(Player.Health/Player.MaxHealth),20,rgb(0,255,0),0,rgb(0,255,0),0 : text 0,30,"^ YOUR HEALTH ("+str$(Player.Health)+"/"+str$(Player.MaxHealth)+")" : box 0,50,200,60,rgb(155,155,155),rgb(155,155,155),0,rgb(155,155,155) :box 0,50,200*(Player.Energy/Player.MaxEnergy),60,rgb(255,0,255),rgb(255,0,255),0,rgb(255,0,255) : text 0,80,"^ YOUR ENERGY ("+str$(Player.Energy)+"/"+str$(Player.MaxEnergy)+")" : Text 0,200,"Energy Regeneration: "+str$(Player.Energyregeneration) : text 0,220,"Damage: "+str$(Player.damage) : text 0,240,"Spell Bonus Damage: "+str$(Player.SpellDamage) : text 0,280,"TOTAL DAMAGE: "+str$(Player.Spelldamage+player.damage) :ink rgb(255,0,255),0 : text 0,320,"LAST ACTION: "+Player.LastAction
ink rgb(255,155,155),0 : box 640,10,640-200*(1),20,rgb(155,155,155),0,rgb(155,155,155),0 : box 640,10,640-200*(Bob.Health/Bob.MaxHealth),20,rgb(255,155,0),0,rgb(255,155,0),0 : text 640-text width("^ BOB'S HEALTH ("+str$(Bob.Health)+"/"+str$(Bob.MaxHealth)+")"),30,"^ BOB'S HEALTH ("+str$(Bob.Health)+"/"+str$(Bob.MaxHealth)+")" : box 640,50,640-200*(1),60,rgb(155,155,155),rgb(155,155,155),0,rgb(155,155,155) : box 640,50,640-200*(Bob.Energy/Bob.MaxEnergy),60,rgb(255,0,0),rgb(255,0,0),0,rgb(255,0,0) : text 640-text width("^ BOB'S ENERGY ("+str$(Bob.Energy)+"/"+str$(Bob.MaxEnergy)+")"),80,"^ BOB'S ENERGY ("+str$(Bob.Energy)+"/"+str$(Bob.MaxEnergy)+")" : Text 640-text width("Energy Regeneration: "+str$(Bob.Energyregeneration)),200,"Energy Regeneration: "+str$(Bob.Energyregeneration)
text 640-text width("Damage: "+str$(Bob.damage)),220,"Damage: "+str$(Bob.damage) : text 640-text width("Spell Bonus Damage: "+str$(Bob.SpellDamage)),240,"Spell Bonus Damage: "+str$(Bob.SpellDamage) : text 640-text width("TOTAL DAMAGE: "+str$(Bob.Spelldamage+Bob.damage)),280,"TOTAL DAMAGE: "+str$(Bob.Spelldamage+Bob.damage) : ink rgb(255,0,255),0 : text 640-text width("LAST ACTION: "+bob.LastAction),300,"LAST ACTION: "+bob.LastAction : ink rgb(0,255,0),0
if TURN=1 : Turn$="YOUR": else : turn$="BOB'S" : ENDIF : CENTER TEXT SCREEN WIDTH()/2,400,"IT IS "+turn$+" TURN." : if Turn>2 : turn=1 : endif : IF Player.health<=0 : victory("BOB WINS!!!") : endif : IF Bob.Health<=0 : Victory("YOU WIN!!!") : endif : IF TURN=1 : Center TEXT SCREEN WIDTH()/2,420,"CONTROLS:" : if Player.energy<10 : Flag$="(NOT ENOUGH ENERGY)" : ELSE : FLAG$="" : ENDIF : Center Text Screen Width()/2,440,"1= Attack 2=Spell Attack "+FLAG$ : CENTER TEXT SCREEN WIDTH()/2,460,"3=Increase Damage 4=Increase Spell Damage 5=Increase Energy Regeneration"
if keystate(2) : dec Bob.Health,Player.Damage : Player.LastAction="You Attacked Bob!" : endif : if keystate(3) and Player.energy>=10 : dec Bob.health,Player.SpellDamage+Player.Damage : Dec Player.Energy,10 : Player.LastAction="You Attacked Bob with a Spell-Enhanced Attack!": endif : if Keystate(4) : inc Player.Damage,45 : Player.LastAction="You Increased your damage by 45 points!" : endif
if keystate(5) : inc Player.spelldamage,50 : Player.LastAction="You Increased your SPELL damage by 50 points!" : endif : if Keystate(6) : inc Player.EnergyRegeneration,2 : Player.LastAction="You Increased your energy regeneration by 2 points!" : endif : if Scancode()>=2 and scancode()<=6 : IF Scancode()=3 and Player.Energy<10 : else : inc turn,1 : bobtime=700 : Bobaction=0 : endif : endif : endif : IF TURN=2 : if bobAction=0 and bobtime<400 : bobAction=1+rnd(4)
if bobaction>=3 and rnd(2)=0 : bobaction=1+rnd(1) : ENDIF : if bobAction=2 and bob.energy<10 : bobaction=1 : endif : if bobAction=1 : dec Player.Health,Bob.Damage : bob.LastAction="Bob Attacked You!" : endif : if bobaction=2 : dec Player.health,bob.damage+bob.spelldamage : bob.LastAction="Bob Attacked with a Spell-Enhanced Attack!" : dec Bob.Energy,10 : endif : if bobaction=3 : inc bob.damage,45 : bob.lastaction="Bob increased his damage by 45 points!" : endif : if bobaction=4 : inc bob.spelldamage,50 : bob.lastaction="Bob increased his SPELL damage by 35 points!" : endif : if bobaction=5 : inc bob.energyregeneration,2 : bob.lastaction="Bob increased his energy regeneration by 2 points!" : endif
endif : if bobtime<400 : center text screen width()/2,420,Bob.LastAction : endif : dec bobtime,3 : IF bobtime<0 : turn=1 : endif : ENDIF
If Player.health>Player.maxhealth : player.health=player.maxhealth : endif : if player.energy>player.maxenergy : player.energy=player.maxenergy : endif : If Bob.health>Bob.maxhealth : Bob.health=Bob.maxhealth : endif : if Bob.energy>Bob.maxenergy : Bob.energy=Bob.maxenergy : endif : IF TURN<>OldTurn : OldTurn=Turn : inc Player.energy,Player.EnergyRegeneration : inc bob.energy,bob.energyregeneration : endif : sync : loop : return
function WaitKey() : while scancode()>0 : endwhile
endfunction : function Victory(n as string) : set text size 32 : waitkey() : while scancode()=0 : center text screen width()/2,screen height()/2,n : sync : endwhile : waitkey() : GOSUB SetVariables: GOsub MainLoop : endfunction