130 def PlayMusik(forcechange=1,hostile_dist=0):
135 mpl (PEACELIST,PEACELIST,forcechange)
137 elif un.DockedOrDocking()
not in [1,2]:
141 iter = VS.getUnitList()
142 target = iter.current()
146 while (iter.notDone()):
148 ftmp = 2*target.getRelation(un)
149 nam=target.getName().
lower()
150 fact=target.getFactionName()
151 if un.getSignificantDistance(target)<=2*target.rSize()
and (
'afield'==nam[:6]
or 'asteroid'==nam[:8]):
153 hdis = HOSTILE_AUTODIST
154 if (hostile_dist!=0):
156 if (target.GetTarget()==un
or (ftmp<0
and un.getDistance(target)<hdis)):
157 unfcount[fact] = unfcount.get(fact,0)+1
159 if ((target.GetTarget()==un)
and (ftmp<0
and un.getDistance(target)<hdis)):
161 if (target.isSignificant()
and (un.getSignificantDistance(target)<(SIGNIFICANT_DISTANCE_OFFSET+SIGNIFICANT_DISTANCE_MULTIPLY*target.rSize()))):
164 target=iter.current()
167 mpl(asteroidlist,PEACELIST,forcechange)
169 sys=VS.getSystemFile()
170 fact=VS.GetGalaxyFaction(sys)
171 ufact=un.getFactionName()
173 mpl(
LookupTable(peacearoundsiglist,fact),PEACESITUATION,forcechange)
176 if (VS.GetRelation(ufact,fact)>=0):
177 mpl(
LookupTable(peaceawayfriendlylist,fact),PEACESITUATION,forcechange)
180 mpl(
LookupTable(peaceawayhostilelist,fact),PEACESITUATION,forcechange)
183 ftmp = un.FShieldData()+2*un.GetHullPercent()+un.RShieldData()-2+0.5
186 for (fname,fcount)
in unfcount.iteritems():