Loading ...
Sorry, an error occurred while loading the content.
 

RE: [pcgen] AGE tag from race lst and age function in race.java question

Expand Messages
  • Damian
    that s odd. i thought age was simply a fuction of race, not class............ though i can see where it should be a fucntion of class. being a mage prolly
    Message 1 of 5 , Oct 1, 2001
      that's odd.  i thought age was simply a fuction of race, not class............ though i can see where it should be a fucntion of class.  being a mage prolly takes more years of study than beating things up with a sharp piece of metal.
      -----Original Message-----
      From: rodac@... [mailto:rodac@...]
      Sent: Sunday, September 30, 2001 11:11 PM
      To: pcgen@yahoogroups.com
      Subject: [pcgen] AGE tag from race lst and age function in race.java question

      The customize doc says:

      AGE:min:dice:sides:dice:sides:dice:sides</td>
          the minimum age for the race and the number of dice and sides
      used - the
          first dice:sides pair is used for Barbarian, Rogue and Sorcerer.
      The second pair is used
          for Bard, Fighter, Paladin and Ranger. The last pair is used for
      Cleric, Druid, Monk and
          Wizard

      And in race.java the code is shown as:

      public void rollAgeForClass(String className)
            {
                  if (Globals.getCurrentPC() == null)
                  {
                        return;
                  }
                  boolean startCounting = false;
                  final StringTokenizer aTok = new StringTokenizer
      (ageString, ":", false);

                  // For XML migration, there is a separate entry for
      each class,
                  // and the classes are attributes, so users can
      define new ones
                  // but still give them age features.
                  int i = 2;
                  if (className.equals("Barbarian") || className.equals
      ("Rogue") ||
                        className.equals("Sorcerer"))
                  {
                        i = 0;
                  }
                  else if (className.equals("Bard") || className.equals
      ("Fighter") ||
                        className.equals("Paladin") ||
      className.equals("Ranger"))
                  {
                        i = 1;
                  }
                  int min = 0;
                  int diceNum = 0;
                  int diceSide = 0;
                  int total = 0;
                  Random aRand = new Random();
                  if (aTok.countTokens() < 7)
                  {
                        return;
                  }
                  min = Integer.parseInt(aTok.nextToken());
                  while (i > 0)
                  {
                        aTok.nextToken();
                        aTok.nextToken();
                        i--;
                  }
                  diceNum = Integer.parseInt(aTok.nextToken());
                  diceSide = Integer.parseInt(aTok.nextToken());
                  total = min;
                  while (diceNum > 0)
                  {
                        int roll = aRand.nextInt(diceSide);
                        if (roll < 0) roll = -roll;
                        total += roll + 1;
                        diceNum--;
                  }
                  Globals.getCurrentPC().setAge(total);
            }


      So my question is why are only some of the classes defined in the
      race.java for the age roll and then the other question is why are the
      ones defined even there. Shouldnt the calls be made aginst the info
      in the tag from the race lst? I am looking through the code to
      familiarize myself with java and how the java files interact with
      each other and the lst files and this has me confused. Is something
      wrong here or is it just me?



      To unsubscribe from this group, send an email to:
      pcgen-unsubscribe@egroups.com



      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
    • merton_monk@yahoo.com
      Yeah - in the interest of removing hard-coding, consider this one on the list for 2.1.8. -Bryan
      Message 2 of 5 , Oct 1, 2001
        Yeah - in the interest of removing hard-coding, consider this one on
        the list for 2.1.8.

        -Bryan

        --- In pcgen@y..., Arcady <arcady0@y...> wrote:
        > So can we expect an 'AGESET' tag to be added by version
        > 2.1.8?
        >
        > --- merton_monk@y... wrote:
        > > everyone else uses the last pair. Obviously we should have
        > > every
        > > class define which pair it uses... so in class.lst
        > > Barbarian should
        > > have AGESET:1 and Bard would have AGESET:2.
        > > -Bryan
        > >
        > > --- In pcgen@y..., rodac@e... wrote:
        > > > The customize doc says:
        > > >
        > > > AGE:min:dice:sides:dice:sides:dice:sides</td>
        > > > if (className.equals("Barbarian") || className.equals
        > > > ("Rogue") ||
        >
        >
        > __________________________________________________
        > Do You Yahoo!?
        > Listen to your Yahoo! Mail messages from any phone.
        > http://phone.yahoo.com
      Your message has been successfully submitted and would be delivered to recipients shortly.