Its in PRO - RPGs are hell without types.
Latest Updates
---------------
-Attack Battle Engine Finished
-Inventory System Up and Running
-Navigating Inventory In Progress
Props to xxxpetratxxx for help on the Inventory
Next Up [Finishing the Battle Engine]
--------------------------------------
-Implementing the items into the battle engine
-Adding Magic to the battle engine
-Adding a special Attack to the battle engine
-Put in all the nice looking coolio special effects!!!
-Release source code and Media
Here is the (UNEXPLAINED) Source code for the Inventory System so far!
Sync Rate 60
Type Inventory
SlotHolding as String
Gold as Integer
Endtype
Type Item
Name as String
Class as String
HPGain as Integer
MPGain as Integer
Cost as Integer
Resell as Integer
Endtype
Global MaxItems = 6 `Item Amount
Global ItemVarSize = 50 `Array Size for items
Global DifferentItems = 2
Global DifferentItemArraySize = 50
GLOBAL YPos = 40
Global ItemTypeVar= 3
Global WaitVar = 2
`Navigating the Array
Global Current_Slot = 0
Dim Item(3) as Item
Item(1).Name = "Potion"
Item(1).Class = "Item"
Item(1).HPGain = 25
Item(1).MPGain = 0
Item(1).Cost = 20
Item(1).Resell = 10
Item(2).Name = "Super Potion"
Item(2).Class = "Item"
Item(2).HPGain = 100
Item(2).MPGain = 0
Item(2).Cost = 75
Item(2).Resell = 40
Item(3).Name = "Ether"
Item(3).Class = "Item"
Item(3).HPGain = 0
Item(3).MPGain = 20
Item(3).Cost = 150
Item(3).Resell = 70
Dim Inventory(ItemVarSize) as Inventory
Inventory(0).SlotHolding = "Stick"
Inventory(1).SlotHolding = "Cloth"
Inventory(2).SlotHolding = "Potion"
Inventory(3).SlotHolding = "Cloth"
Inventory(4).SlotHolding = "Potion"
Inventory(5).SlotHolding = "Stick"
Inventory(6).SlotHolding = "Potion"
Dim DifferentItems$(DifferentItemArraySize)
DifferentItems$(0) = "Stick"
DifferentItems$(1) = "Cloth"
DifferentItems$(2) = "Potion"
DifferentItems$(3) = ""
Global Dim ItemTypeAmount(DifferentItemArraySize)
Item_Sort()
Item_Count()
Gosub printContent
Do
dec waitvar,1
`Adding Items
Input "Add which item? ";Item$
item_add(Item$)
Item_Sort()
Item_Count()
Gosub printContent
Loop
printContent:
Cls
Set Cursor 0,0
For x = 0 To DifferentItems
Print DifferentItems$(x)," x",ItemTypeAmount(x)
Next X
Return
FUNCTION item_add(Item$)
x = 0
Found = 0
Repeat
If lower$(DifferentItems$(x)) = lower$(Item$) Then Found = 1
If Found = 0 Then If DifferentItems$(x) = ""
DifferentItems$(x) = Item$
Inc DifferentItems
x = DifferentItems + 1
Endif
MaxItems = MaxItems + 1
x = x + 1
Until x >= DifferentItems + 2
For x = x-1 To DifferentItemArraySize
DifferentItems$(x) = ""
Next x
x = 0
Repeat
If Inventory(x).SlotHolding = "" Then Inventory(x).SlotHolding = Item$ : x=49
x = x + 1
Until x = 50
ENDFUNCTION
Function item_count()
Dim Storage(DifferentItems)
ItemAmount=0
`This counts how many of each item there are
For a = 0 TO DifferentItems
For b = 0 TO MaxItems
If Inventory(b).SlotHolding = DifferentItems$(a) Then storage(a)=storage(a)+1 : ItemAmount = ItemAmount+1
Next b
Next a
For a = 0 To DifferentItems
ItemTypeAmount(a) = Storage(a)
Next a
Undim Storage()
Endfunction
FUNCTION item_sort()
DIM Storage(DifferentItems)
Inven = 0
ItemAmount = 0
`This counts how many of each item there are
For a = 0 TO DifferentItems
For b = 0 TO MaxItems
If Lower$(Inventory(b).SlotHolding) = Lower$(DifferentItems$(a)) Then Storage(a)=Storage(a)+1 : ItemAmount = ItemAmount+1
Next b
Next a
For a = 0 To DifferentItems
For b = 0 To Storage(a)-1
Inventory(Inven).SlotHolding = DifferentItems$(a)
Inven=Inven+1
Next b
Next a
For x = ItemAmount To ItemVarSize
Inventory(x).SlotHolding = ""
Next x
Undim Storage()
ENDFUNCTION
RPGamer
We need help! Email us! join@eternaldestinyonline.com