X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=sst.py;fp=sst.py;h=a598e43f709d5e2d254263ee2821f7357f37b2a3;hp=3eb972a2e70623e80ae265842f8ad3996bbba04c;hb=11091a194a879833f28764e6f7537e7dabe431ae;hpb=117f6a73ad77653422df5600920fc07d8176e235 diff --git a/sst.py b/sst.py index 3eb972a..a598e43 100755 --- a/sst.py +++ b/sst.py @@ -518,8 +518,8 @@ def welcoming(iq): def tryexit(enemy, look, irun): "A bad guy attempts to bug out." iq = Coord() - iq.i = game.quadrant.i+(look.i+(QUADSIZE-1))/QUADSIZE - 1 - iq.j = game.quadrant.j+(look.j+(QUADSIZE-1))/QUADSIZE - 1 + iq.i = game.quadrant.i+(look.i+(QUADSIZE-1))//QUADSIZE - 1 + iq.j = game.quadrant.j+(look.j+(QUADSIZE-1))//QUADSIZE - 1 if not welcoming(iq): return False if enemy.type == 'R': @@ -604,7 +604,7 @@ def movebaddy(enemy): irun = False # This should probably be just (game.quadrant in game.state.kcmdr) + (game.state.kscmdr==game.quadrant) if game.skill >= SKILL_EXPERT: - nbaddys = (((game.quadrant in game.state.kcmdr)*2 + (game.state.kscmdr==game.quadrant)*2+game.klhere*1.23+game.irhere*1.5)/2.0) + nbaddys = int(((game.quadrant in game.state.kcmdr)*2 + (game.state.kscmdr==game.quadrant)*2+game.klhere*1.23+game.irhere*1.5)/2.0) else: nbaddys = (game.quadrant in game.state.kcmdr) + (game.state.kscmdr==game.quadrant) old_dist = enemy.kdist @@ -1211,7 +1211,7 @@ def collision(rammed, enemy): # In the pre-SST2K version, all devices got equiprobably damaged, # which was silly. Instead, pick up to half the devices at # random according to our weighting table, - ncrits = rnd.randrange(NDEVICES/2) + ncrits = rnd.randrange(NDEVICES//2) while ncrits > 0: ncrits -= 1 dev = randdevice()