… | |
… | |
1681 | } |
1681 | } |
1682 | |
1682 | |
1683 | return friendlyfire; |
1683 | return friendlyfire; |
1684 | } |
1684 | } |
1685 | |
1685 | |
1686 | |
|
|
1687 | /* This isn't used just for players, but in fact most objects. |
1686 | /* This isn't used just for players, but in fact most objects. |
1688 | * op is the object to be hit, dam is the amount of damage, hitter |
1687 | * op is the object to be hit, dam is the amount of damage, hitter |
1689 | * is what is hitting the object, type is the attacktype, and |
1688 | * is what is hitting the object, type is the attacktype, and |
1690 | * full_hit is set if monster area does not matter. |
1689 | * full_hit is set if monster area does not matter. |
1691 | * dam is base damage - protections/vulnerabilities/slaying matches can |
1690 | * dam is base damage - protections/vulnerabilities/slaying matches can |
… | |
… | |
1861 | #endif |
1860 | #endif |
1862 | } |
1861 | } |
1863 | |
1862 | |
1864 | if (!full_hit) |
1863 | if (!full_hit) |
1865 | { |
1864 | { |
1866 | archetype *at; |
|
|
1867 | int area; |
1865 | int area; |
1868 | int remainder; |
1866 | int remainder; |
1869 | |
1867 | |
1870 | area = 0; |
1868 | area = 0; |
1871 | for (at = op->arch; at != NULL; at = at->more) |
1869 | |
|
|
1870 | for (archetype *at = op->arch; at; at = (archetype *)at->more) |
1872 | area++; |
1871 | area++; |
|
|
1872 | |
1873 | assert (area > 0); |
1873 | assert (area > 0); |
1874 | |
1874 | |
1875 | /* basically: maxdam /= area; we try to "simulate" a float |
1875 | /* basically: maxdam /= area; we try to "simulate" a float |
1876 | value-effect */ |
1876 | value-effect */ |
1877 | remainder = 100 * (maxdam % area) / area; |
1877 | remainder = 100 * (maxdam % area) / area; |