… | |
… | |
147 | draw_ext_info_format (NDI_UNIQUE | NDI_GREEN, 0, op, |
147 | draw_ext_info_format (NDI_UNIQUE | NDI_GREEN, 0, op, |
148 | MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_NEWS, "INFORMATION: %s\n%s\n", (char *)"%s\n%s", subject, news); |
148 | MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_NEWS, "INFORMATION: %s\n%s\n", (char *)"%s\n%s", subject, news); |
149 | close_and_delete (fp, comp); |
149 | close_and_delete (fp, comp); |
150 | } |
150 | } |
151 | |
151 | |
|
|
152 | float |
|
|
153 | player::weapon_speed () const |
|
|
154 | { |
|
|
155 | return ob->speed / weapon_sp * .5f;//TODO, the .5 is arbitrary |
|
|
156 | } |
|
|
157 | |
152 | /* This loads the first map an puts the player on it. */ |
158 | /* This loads the first map an puts the player on it. */ |
153 | static void |
159 | static void |
154 | set_first_map (object *op) |
160 | set_first_map (object *op) |
155 | { |
161 | { |
156 | op->contr->maplevel = first_map_path; |
162 | op->contr->maplevel = first_map_path; |
… | |
… | |
1632 | if (arrow->slaying) |
1638 | if (arrow->slaying) |
1633 | arrow->spellarg = strdup (arrow->slaying); |
1639 | arrow->spellarg = strdup (arrow->slaying); |
1634 | |
1640 | |
1635 | if (player *pl = op->contr) |
1641 | if (player *pl = op->contr) |
1636 | { |
1642 | { |
|
|
1643 | if (!pl->has_hit) |
1637 | { |
1644 | { |
1638 | pl->has_hit = 1; |
1645 | pl->has_hit = 1; |
1639 | pl->ob->speed_left += pl->weapon_sp - pl->ob->speed; |
1646 | pl->ob->speed_left += pl->weapon_speed () - pl->ob->speed; |
1640 | } |
1647 | } |
1641 | #if 0 |
1648 | #if 0 |
1642 | float speed = pl->weapon_sp; |
1649 | float speed = pl->weapon_sp; |
1643 | |
1650 | |
1644 | /* penalize ROF for bestarrow */ |
1651 | /* penalize ROF for bestarrow */ |
1645 | if (pl->bowtype == bow_bestarrow) |
1652 | if (pl->bowtype == bow_bestarrow) |
… | |
… | |
1748 | ret = fire_bow (op, op, NULL, dir, 0, op->x, op->y); |
1755 | ret = fire_bow (op, op, NULL, dir, 0, op->x, op->y); |
1749 | } |
1756 | } |
1750 | |
1757 | |
1751 | return ret; |
1758 | return ret; |
1752 | } |
1759 | } |
1753 | |
|
|
1754 | |
1760 | |
1755 | /* Fires a misc (wand/rod/horn) object in 'dir'. |
1761 | /* Fires a misc (wand/rod/horn) object in 'dir'. |
1756 | * Broken apart from 'fire' to keep it more readable. |
1762 | * Broken apart from 'fire' to keep it more readable. |
1757 | */ |
1763 | */ |
1758 | void |
1764 | void |
… | |
… | |
2170 | * that party_number -1 is no party, so attacks can still happen. |
2176 | * that party_number -1 is no party, so attacks can still happen. |
2171 | */ |
2177 | */ |
2172 | else if ((mon->stats.hp >= 0) && QUERY_FLAG (mon, FLAG_ALIVE) && |
2178 | else if ((mon->stats.hp >= 0) && QUERY_FLAG (mon, FLAG_ALIVE) && |
2173 | ((mon->type != PLAYER || op->contr->party == NULL || op->contr->party != mon->contr->party))) |
2179 | ((mon->type != PLAYER || op->contr->party == NULL || op->contr->party != mon->contr->party))) |
2174 | { |
2180 | { |
|
|
2181 | if (!op->contr->has_hit) |
|
|
2182 | { |
2175 | op->contr->has_hit = 1; |
2183 | op->contr->has_hit = 1; |
2176 | op->speed_left += op->contr->weapon_sp - op->speed; |
2184 | op->speed_left += op->contr->weapon_speed () - op->speed; |
|
|
2185 | } |
2177 | |
2186 | |
2178 | skill_attack (mon, op, 0, 0, 0); |
2187 | skill_attack (mon, op, 0, 0, 0); |
2179 | |
2188 | |
2180 | /* If attacking another player, that player gets automatic |
2189 | /* If attacking another player, that player gets automatic |
2181 | * hitback, and doesn't loose luck either. |
2190 | * hitback, and doesn't loose luck either. |