-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7.05 project.md is hard to read #395
Comments
I have been looking at this for a while now. The game design seems a bit off. Each Pokemon has a max attack amount. Each attack has an attack power. The damage is dependent on the lower of the two. Let's think about that. You can't do 130 damage with a Grass Pokemon. The most is 60. You would never ever choose that attack because you have a much higher chance of missing. If your Pokemon can only do a max of 40 damage you will always want to choose the power 50 attack which is a guaranteed hit. You have just lost some of the game's fun. What I am going to do instead is what many games do. Each Pokemon has an attack power. That attack power is higher if the Pokemon has lower health and vice versa. Each attack will then have an attack power percentage. That percentage will be higher if the accuracy is lower and vice versa. I will make the percentage and accuracy multiply out to be around 50%. I will also use 3 random numbers added together for the damage so it falls on a bell curve. That way damage will mostly be around 25% of attack power over several attacks. But there is still a good chance to get very high or very low damage depending on how you play it. We also need to look at this in the given solution: # the attack should also randomly fail according to the attack's accuracy:
if accuracy != 100 and random.randint(100 - accuracy, 100) == 100:
print(self.name + " used " + attack_name + " and it failed!") I have seen uglier things, but this is ugly. So if accuracy is 100 it is a guaranteed hit. Good. Otherwise we have a random chance of missing. So if accuracy is the chance of a hit 100 - accuracy is the chance of a miss. We choose a random number between the chance of a miss and 100. If that is 100 then you miss. Wait...What?!!! Let's compute that for 100% accuracy. The chance of a miss is 1 in 101. Close enough. Okay let's look at 0 accuracy. The chance of a miss is 1 in 1. Perfect. Now what about 50% we are expecting 1 in 2. The chance of missing is 1 in 51. 1% accuracy is 1 in 2. That doesn't seem right. How about we just do something like this instead. def calculate_damage(self, attack_power):
if randint(1, 100) <= self.accuracy:
scaled_attack = round(attack_power * self.power_percent / 100 / 3)
# damage amount is on a bell curve. Most of the time you do half the max damage.
return (randint(1, scaled_attack) + randint(0, scaled_attack) + randint(0, scaled_attack))
else:
# Ha ha missed me
return 0 |
The names of 2 Pokeman are misspelled. Bulbasaur and Poliwag. |
I have rewritten it. #402 |
The biggest problem is "pp". It is defined as "pp(power points)".
We give the students the AP for the Pokemon types. We also give them the Power for each attack.
At no time do we give them the "pp". They must try to figure out if that is the same as Power or AP or something else.
The attack amount is hard to understand since it isn't a real sentence. Somehow there is a random bullet point in there.
The text was updated successfully, but these errors were encountered: