Examples
Player: {
maxLife: 50
maxMana: 20
life: 50
mana: 20
gold: 40
classes: ["Warrior","Mage","Rogue"]
Event: Game_Start {
// Declares new properties on player and assigns initial values to them
this.str = floor(rand(0,5))
this.agi = floor(rand(0,5))
this.will = floor(rand(0,5))
this.luck = floor(rand(0,5))
// If the total value of player strength, agility and will is less than 6 (average),
// increase luck by one
// Else if luck is higher than 3 (above average), decrease it by one
if (str + agi + will < 6)
luck++
else if (luck > 3)
luck--
this.class = classes[floor(rand(0,3))]
// Assigns a random class from the list of classes to player
// Changes the player properties according to the assigned class
if (class == "Warrior"){
str++
maxLife += 10
life = maxLife
}
else if (class == "Rogue"){
will++
gold += 40
}
else{
will++
maxMana += 5
mana = maxMana
}
}
}