Menu

#190 ClassSpecificStuff() has bad logic

open
nobody
5
2004-12-02
2004-12-02
No

First of all, ClassSpecificStuff() is not set up very well, I
would think that a reference to every class would be a
good thing, allowing for future building and ease of
updating.

But the bug that I was specifically looking at was the
fact that the whole block of ch->mult_att code is set in
a big warrior if, but then references thieves in the code
contained in the if. That code will never be reached,
since it would only catch if somehow had a Monk/Thief.

Essentially, I would rewrite the code to do 2 things.
One is the bug fix, the other is a change.

First, set up the function to handle each class
specifically, even if it doesn't really need much to
happen for the class, and so you only have to have one
set of if's for the char_data passed in.

Second, I would recommend changing it so that dual or
tri-class characters sum up their attacks and divide
them by the number of classes.

Say that a wa/th got 2.5 attacks for warrior and 1.5
attacks for thief.
2.5 + 1.5 / 2 = 2 attacks

Or a Wa/Cl/Ma got 2.75/2.0/1.0:
2.75+2.0+1.0 / 2 = 1.92 attacks

Discussion


Log in to post a comment.

MongoDB Logo MongoDB