Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: So I'm reading the source code...  (Read 714 times)

Think0028

  • Bay Watcher
    • View Profile
So I'm reading the source code...
« on: September 03, 2009, 12:43:47 pm »

I'm looking under the combat file, as I've had some bad luck with being horribly damaged lately and I was getting curious as to how it's all calculated. I noticed this bit right here:

Code: [Select]
      //SKILL BONUS FOR GOOD ROLL
      mod+=aroll-droll-5;

      if(mod>0)
      {
         //DO THE HEALTH MOD ON THE WOUND
         mod-=t.attval(ATTRIBUTE_HEALTH)-5;
         //If commented out, health works like body armor
         //if(mod<0)mod=0;
      }
Later on in the code, mod is used to modify damage in a multiplicative way, and fairly significantly reduces it if it's negative.

This strikes me as really weird. Consider the following:
Say I have a liberal with 15 health. If a conservative attacks him and beats his roll by, say, 5, then he'll have a mod of 0. If the conservative beats his roll by 6, on the other hand, then he has a mod of -4, because the health reduction kicks in.

So shouldn't the if mod>0 be removed now that health can reduce the mod below zero?

« Last Edit: September 03, 2009, 12:57:42 pm by Think0028 »
Logged
If it scares people into posting, then yes.

If they end up lynched because they didn't post, oh well. Too bad for them. Maybe they should've tried posting.
Web-based Lurker Tracker for Mafia

Jonathan S. Fox

  • Bay Watcher
    • View Profile
    • http://www.jonathansfox.com/
Re: So I'm reading the source code...
« Reply #1 on: September 03, 2009, 04:47:31 pm »

I see what you're saying, and you're right, that should be removed.
Logged