Random Attributes
#1
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


The Random Attribute System will, upon new game, rebuild the $data_actors with random stats(randomized on making a new game). The attributes a derived from the class. Each class is assigned a catigory 1 trough 6(1 being best 6 worst) for each attribute (see chart below). On first level each actor gets 2 "rolls" for the attribute plus a bonus.

---hp---
best: max 109 min 54 per level extra random + 101 hp bonus at first (56r+53)
type2: max 100 min 49 per level extra random + 85 hp bonus at first (52r+48)
type3: max 99 min 44 per level extra random + 70 hp bonus at first (46r+43)
type4: max 80 min 39 per level extra random + 55 hp bonus at first (42r+38)
type5: max 70 min 35 per level extra random + 40 hp bonus at first (36r+34)
worst: max 60 min 39 per level extra random + 25 hp bonus at first (32r+28)

---sp---
best: max 55 min 17 per level extra random + 25 sp bonus at first (39r+16)
type2: max 47 min 14 per level extra random + 22 sp bonus at first (34r+13)
type3: max 39 min 11 per level extra random + 19 sp bonus at first (29r+10)
type4: max 32 min 9 per level extra random + 16 sp bonus at first (24r+8)
type5: max 23 min 6 per level extra random + 13 sp bonus at first (18r+5)
worst: max 14 min 3 per level extra random + 10 sp sp bonus at first (12r+2)

---attributes---
best: max 12 min 4 per level extra random + 50 stat bonus at first (9r+3)
type2: max 10 min 3 per level extra random + 46 stat bonus at first (8r+2)
type3: max 9 min 3 per level extra random + 42 stat bonus at first (7r+2)
type4: max 8 min 2 per level extra random + 38 stat bonus at first (6r+2)
type5: max 6 min 2 per level extra random + 34 stat bonus at first (5r+1)
worst: max 5 min 2 per level extra random + 30 stat bonus at first (4r+1)




total......class.........hp......sp.....str.....dex.....agi.....int
points
24.....1 fighter.........2.......4.......2.......3........3.......4
24.....2 barbarian.....1......6........1.......2........2.......6
24.....3 paladin........2.......4........2......3.......4.......3
24.....4 ranger.........3.......4.......3.......2.......2.......4
24.....5 cavalier.......1.......3.......2.......2.......6.......4
24.....6 rogue..........4.......3.......4.......1.......1.......5
24.....7 monk..........2.......4.......2.......2.......3.......5
24.....8 white mage..4.......1.......5.......3.......3.......2
24.....9 black mage..6.......1.......5.......3.......2.......1
24.....10 red mage...4.......2.......3.......3.......3.......3
24.....11 time mage..5.......2.......6......2.......2........1
24.....12 bard...........3......3.......3.......3.......3.......3

catigory/point
....1.........6
....2.........5
....3.........4
....4.........3
....5.........2
....6.........1


BELOW IS A NEW CLASS TO BE INSERTED IN.


Code:
class Random_Attributes
attr_reader �  :class_id

def initialize
   #############EXAMPLE######################
   for actor in $data_actors #For each actor
      tmp_class_id = 0
      tmp_sp = 0
      tmp_str = 0
      tmp_dex = 0
      tmp_agi = 0
      tmp_int = 0
      tmp_hp = 0 #Used to keep track of the HP for this actor
      if actor != nil #Skip nil actors (actor at index 0 is nil) �  #build for HP
         tmp_class_id = actor.class_id
         catigory = find_attributes_catigories(tmp_class_id)
         for i in 1..99 #For each level
          tmp_hp += Randomize_stat(0, catigory[0], i)      #Increment HP by random number (type based on class id, attribute)
          actor.parameters[0, i] = tmp_hp #Set HP for current level to the incremented HP value
          tmp_sp += Randomize_stat(1, catigory[1], i)      #Increment SP by random number based on class id
          actor.parameters[1, i] = tmp_sp #Set SP for current level to the incremented SP value
          tmp_str += Randomize_stat(2, catigory[2], i)      #Increment STR by random number based on class id
          actor.parameters[2, i] = tmp_str #Set STR for current level to the incremented STR value
          tmp_dex += Randomize_stat(3, catigory[3], i)      #Increment DEX by random number based on class id
          actor.parameters[3, i] = tmp_dex #Set DEX for current level to the incremented DEX value
          tmp_agi += Randomize_stat(4, catigory[4], i)      #Increment AGI by random number based on class id
          actor.parameters[4, i] = tmp_agi #Set AGI for current level to the incremented AGI value
           tmp_int += Randomize_stat(5, catigory[5], i)      #Increment INT by random number based on class id
          actor.parameters[5, i] = tmp_int #Set INT for current level to the incremented INT value
         end
      end
   end
end
     ####The charts with the random numbet the modifier and the firstlevel plus#########
##############grouped by 3's for each catigory######################
def find_rand_mod (stat, type)
   case stat
     when 0
       list = [0,0,0,56,53,101,52,48,85,46,43,70,42,38,55,36,34,40,32,28,25]
     when 1
       list = [0,0,0,39,16,25,34,14,22,29,10,19,24,8,16,18,5,13,12,2,10]
     when 2
       list = [0,0,0,9,3,50,8,2,46,7,2,42,6,1,38,5,1,34,4,1,30]
     when 3
       list = [0,0,0,9,3,50,8,2,46,7,2,42,6,1,38,5,1,34,4,1,30]
     when 4
       list = [0,0,0,9,3,50,8,2,46,7,2,42,6,1,38,5,1,34,4,1,30]
     when 5
       list = [0,0,0,9,3,50,8,2,46,7,2,42,6,1,38,5,1,34,4,1,30]
   end
   x = (type*3)
   random = list[x]
   x = x + 1
   modifier = list[x]
   x = x + 1
   plus = list[x]
   response = [random,modifier,plus]
   return response
end
###########catigories for by class_id 1 is best 6 is terrible##################
def find_attributes_catigories(tmp_class_id)
   case tmp_class_id
     when 1
     catigory = [2,4,2,3,3,4]
     when 2
     catigory = [1,6,1,2,2,6]
     when 3
     catigory = [2,4,2,3,4,3]
     when 4
     catigory = [3,4,3,2,2,4]
     when 5
     catigory = [1,3,2,2,6,4]
     when 6
     catigory = [4,3,4,1,1,5]
     when 7
     catigory = [2,4,2,2,3,5]
     when 8
     catigory = [4,1,5,3,3,2]
     when 9
     catigory = [6,1,5,3,2,1]
     when 10
     catigory = [4,2,3,3,3,3]
     when 11
     catigory = [5,2,6,2,2,1]
     when 12
     catigory = [3,3,3,3,3,3]
   end
   return catigory
end


def Randomize_stat(stat, type, level)
   catigorydata = find_rand_mod(stat, type) #looks up random and constant numbers
   random = catigorydata[0]
   modifier = catigorydata[1]
   plus = catigorydata[2]
   case stat
   when 0..1
     if level != 1
       return rand(random) + modifier #Random number derived from find_rand_mod
     else
       return rand(random) + modifier + plus #Random number plus level 1 bonus
     end
   when 2..5
     if level != 1
       return rand(random) + modifier #Random number derived from find_rand_mod
     else
       return rand(random) + rand(random) + modifier + modifier + plus #Random number plus level 1 bonus
     end
   end
end
end

In Scene_Title under def command_new_game put a new line in Random_Attribute.new
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Random Character Generator SephirothSpawn 0 2,506 03-20-2006, 01:00 PM
Last Post: SephirothSpawn
  Random Battle Music Boss & Final Boss setup Eccid 0 2,347 11-03-2005, 01:00 PM
Last Post: Eccid



Users browsing this thread: 1 Guest(s)