From: fluffymormegil Date: Fri, 16 Mar 2012 22:19:16 +0000 (+0000) Subject: adding summoning cooldown and removing room-dependent logic X-Git-Tag: contest-release-signed~11 X-Git-Url: http://git.blackswordsonics.com/?a=commitdiff_plain;h=5bd8ebfb7689da740ff9fe5973a4bd27b7c4e265;p=cavechop-7drl adding summoning cooldown and removing room-dependent logic --- diff --git a/bmagic.c b/bmagic.c index 0e3b994..fba3c47 100644 --- a/bmagic.c +++ b/bmagic.c @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "dunbash.h" +#include "cavechop.h" #include "bmagic.h" #include "monsters.h" #include "combat.h" @@ -79,7 +79,7 @@ int use_black_magic(int mon) int cansee; int range; compute_directions(u.y, u.x, mptr->y, mptr->x, &dy, &dx, &sy, &sx, &meleerange, &oncardinal); - cansee = inyourroom(mptr->y, mptr->x) || meleerange; + cansee = mon_visible(mon); if ((dy * sy) >= (dx * sx)) { range = dy * sy; @@ -146,7 +146,7 @@ int use_black_magic(int mon) { if ((mptr->hpcur < (mptr->hpmax * 25 / 100)) && (zero_die(10) < 4)) { - to_cast = !zero_die(3) ? MS_TELEPORT_ESCAPE : MS_TELEPORT_AND_SUMMON; + to_cast = ((mptr->next_summon < game_tick) || !zero_die(3)) ? MS_TELEPORT_ESCAPE : MS_TELEPORT_AND_SUMMON; } else if (meleerange) { @@ -373,6 +373,7 @@ int use_black_magic(int mon) break; case MS_TELEPORT_AND_SUMMON: + mptr->next_summon = game_tick + 1000; /* Do the summoning... */ print_mon_name(mon, 3); print_msg(" calls for help...\n");