Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / A simple (maybe advanced) stats system and simple level up

Author
Message
Project CHAOS
20
Years of Service
User Offline
Joined: 16th Apr 2004
Location:
Posted: 24th Apr 2004 07:43
This is a very simple stat system and if put togeter right in your game you would have RPG elements. This is just a simple thought in an half an hour and theres a do loop error. Sorry Plz E-mail me if you find how to fix the mistake.


Rem This is character stats just replace values if you want to

Rem make manual sync
Sync on : Sync Rate 60

Rem Player Stats
DIM PlayerChaos(8)

Rem Players Level
PlayerChaos(1) = 1

Rem Players Experience
PlayerChaos(2) = 0

Rem Players Health
PlayerChaos(3) = 100

Rem Players Attack
PlayerChaos(4) = 50

Rem Players Defense
PlayerChaos(5) = 20

Rem Players ATA
PlayerChaos(6) = 20

Rem Players Evasion
PlayerChaos(7) = 10

Rem Player Luck
PlayerChaos(8) = 10

Rem Start Loop
Stats:

Rem Set ink
Ink RGB(0,0,0),RGB(255,255,255)

RemStart
Rem Make Decrease and increse Box For LV.
box 130,20,PlayerChaos(1),1
Rem Make Decrease and increse Box For EXP.
box 130,40,PlayerChaos(2),21
Rem Make Decrease and increse Box For HP.
box 130,60,PlayerChaos(3),41
Rem Make Decrease and increse Box For ATK.
box 130,80,PlayerChaos(4),61
Rem Make Decrease and increse Box For DEF
box 130,100,PlayerChaos(5),81
Rem Make Decrease and increse Box For DEF
box 130,100,PlayerChaos(6),81
Rem Make Decrease and increse Box For EVA.
box 130,120,PlayerChaos(7),101
Rem Make Decrease and increse Box for LCK.
box 130,140,PlayerChaos(8),121
RemEnd

Rem Only Reachable To Hundred
If PlayerChaos(1) > 100
PlayerChaos(1)=PlayerChaos(1)-0.01
endif

Rem Only Reachable To Hundred
If PlayerChaos(2) > 100
PlayerChaos(2)=PlayerChaos(2)-0.01
endif

Rem Only Reachable To Hundred
If PlayerChaos(3) > 100
PlayerChaos(3)=PlayerChaos(3)-0.01
endif

Rem Only Reachable To Hundred
If PlayerChaos(4) > 100
PlayerChaos(4)=PlayerChaos(4)-0.01
endif

Rem Only Reachable To Hundred
If PlayerChaos(5) > 100
PlayerChaos(5)=PlayerChaos(5)-0.01
endif

Rem Only Reachable To Hundred
If PlayerChaos(6) >100
PlayerChaos(6)=PlayerChaos(6)-0.01
endif

Rem Only Reachable To Hundred
If PlayerChaos(7) >100
PlayerChaos(7)=PlayerChaos(7)-0.01
endif

Rem Only Reachable To Hundred
If PlayerChaos(8) >100
PlayerChaos(8)=PlayerChaos(8)-0.01
endif

Rem Now we make our test function, to make sure the box works.
Print "Press 1 to add experience"
If keystate(2)=1
Rem This makes PlayerChaos(2) equal PlayerChaos(2)+1
PlayerChaos(2)=PlayerChaos(2)+1
endif

Rem Make Level-up
If PlayerChaos(2)=100
Rem Make the level-up
PlayerChaos(1)=PlayerChaos(1)+1
Rem Health up
PlayerChaos(3)=PlayerChaos(3)+RND(5-15)
Rem Attack up
PlayerChaos(4)=PlayerChaos(3)+RND(5-15)
Rem Defense up
PlayerChaos(5)=PlayerChaos(3)+RND(5-15)
Rem ATA up
PlayerChaos(6)=PlayerChaos(3)+RND(5-15)
Rem Evasion up
PlayerChaos(7)=PlayerChaos(3)+RND(1-5)
Rem Luck up
PlayerChaos(8)=PlayerChaos(3)+RND(1-5)
Rem Make Experience 0 again
PlayerChaos(2)=0

Rem Set Ink
Ink RGB(0,0,150),RGB(255,255,255)

Rem Set ink
Ink RGB(200,200,200),RGB(255,255,255)

Rem Print Blank
Print ""

Rem Print It
Print " > Name:Chaos"
Print " > Level:",PlayerChaos(1)
Print " > Experience:",PlayerChaos(2)
Print " > Health:",PlayerChaos(3)
print " > Attack:",PlayerChaos(4)
print " > Defense:",PlayerChaos(5)
print " > Accuracy:",PlayerChaos(6)
print " > Evasion:",PlayerChaos(7)
print " > Luck:",PlayerChaos(8)

Rem Sync it
Sync

Rem End Loop
Loop

Blah,Blah,Blah is all I hear. Let's get to the part where I kill you. ~CHAOS the genetic hybrid.
The admiral
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location:
Posted: 24th Apr 2004 10:09
Wheres the do part of the loop??

[href]www.vapourhost.com/~flyer[/href]

Login to post a reply

Server time is: 2024-05-13 20:08:35
Your offset time is: 2024-05-13 20:08:35