X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=src%2Fai.c;h=80465ba11e33fb9574d0f24a8a2c1fde5ace37ba;hp=9d9da5db244a60cd4038cf2256c04fb791df2e41;hb=3cabc30da8bc015a1c66c63ee7d5250a4b15ea47;hpb=c6572d37b244170f25b91413abe30427ae139350 diff --git a/src/ai.c b/src/ai.c index 9d9da5d..80465ba 100644 --- a/src/ai.c +++ b/src/ai.c @@ -10,8 +10,8 @@ static bool tryexit(coord look, int ienm, int loccom, bool irun) iq.y = game.quadrant.y+(look.y+(QUADSIZE-1))/QUADSIZE - 1; if (!VALID_QUADRANT(iq.x,iq.y) || game.state.galaxy[iq.x][iq.y].supernova || - game.state.galaxy[iq.x][iq.y].klingons > 8) - return false; /* no can do -- neg energy, supernovae, or >8 Klingons */ + game.state.galaxy[iq.x][iq.y].klingons > MAXKLQUAD-1) + return false; /* no can do -- neg energy, supernovae, or >MAXKLQUAD-1 Klingons */ if (ienm == IHR) return false; /* Romulans cannot escape! */ if (!irun) { /* avoid intruding on another commander's territory */ @@ -155,7 +155,7 @@ static void movebaddy(coord com, int loccom, feature ienm) motion -= game.skill*(2.0-square(Rand())); } if (idebug) - proutn("=== MOTION = %1.2f, FORCES = %1.2f, ", motion, forces); + proutn("=== MOTION = %d, FORCES = %1.2f, ", motion, forces); /* don't move if no motion */ if (motion==0) return; /* Limit motion according to skill */ @@ -296,7 +296,7 @@ static bool movescom(coord iq, bool flag, bool *ipage) if (same(iq, game.quadrant) || !VALID_QUADRANT(iq.x, iq.y) || game.state.galaxy[iq.x][iq.y].supernova || - game.state.galaxy[iq.x][iq.y].klingons > 8) + game.state.galaxy[iq.x][iq.y].klingons > MAXKLQUAD-1) return 1; if (flag) { /* Avoid quadrants with bases if we want to avoid Enterprise */ @@ -413,7 +413,7 @@ void scom(bool *ipage) ibq = game.state.baseq[i]; if (same(ibq, game.quadrant) || same(ibq, game.battle) || game.state.galaxy[ibq.x][ibq.y].supernova || - game.state.galaxy[ibq.x][ibq.y].klingons > 8) + game.state.galaxy[ibq.x][ibq.y].klingons > MAXKLQUAD-1) continue; /* if there is a commander, an no other base is appropriate, we will take the one with the commander */