
-----------------------------------
rownale
Wed May 31, 2006 7:23 am

RPG Items
-----------------------------------
I am trying to make an rpg and it will have lots of items.  I dont know the best way to program it though.  So far im using this.... (I know its probably a really bad way to do it.)


%This is the loot subprogram

var mindamage : int
var maxdamage : int
var sellvalue : int
var item_number : int
var item_description : string
var item_name : string
var loot_roll : int := Rand.Int (1, 100)

procedure item_1
    item_name := "Short Sword"
    item_description := "This sword is unsharpened, rusty and the handle is partially broken."
    mindamage := 3
    maxdamage := 5
    sellvalue := 4
end item_1

procedure item_2
    item_name := "Hatchet"
    item_description := "A small axe, barely powerful enough to cut through a small branch"
    mindamage := 2
    maxdamage := 4
    sellvalue := 2
end item_2

if loot_roll >= 1 and loot_roll = 20 and loot_roll 