示例#1
0
def launch (fgname, faction, type,ai, nr_ships, nr_waves, vec, logo='',useani=1,skipdj=0):
#  print 'log'+ str( logo) + ' useani '+ str(useani)
    diff=usingDifficulty()
#    if useani:
#        VS.playAnimation ("warp.ani",vec,300.0)
    if (not diff or (type.find(".blank")==-1 and -1==type.find(".stock"))):
        for i in range(nr_ships):
            ret = VS.launch (fgname,type,faction,"unit",ai,1,nr_waves,VS.SafeEntrancePoint (vec,40),logo)
            unit.moveOutOfPlayerPath(ret)
        if (not skipdj):
            dj_lib.PlayMusik(0,dj_lib.HOSTILE_NEWLAUNCH_DISTANCE)
        return ret
    rsize=0.0
    diffic = VS.GetDifficulty()
    ret=VS.Unit()
    for i in range(nr_ships):
        mynew=VS.launch(fgname,type,faction,"unit",ai,1,nr_waves,VS.SafeEntrancePoint (vec,40),logo)
        unit.moveOutOfPlayerPath(mynew)
        if (i==0):
            ret = mynew
            rsize =mynew.rSize ()*1.75
        ship_upgrades.upgradeUnit ( mynew,diffic)
        vec=(vec[0]-rsize,
             vec[1],#-rsize
            vec[2]-rsize)
    if (not skipdj):
        dj_lib.PlayMusik(0,dj_lib.HOSTILE_NEWLAUNCH_DISTANCE)
    return ret
示例#2
0
def launch(fgname,
           faction,
           type,
           ai,
           nr_ships,
           nr_waves,
           vec,
           logo='',
           useani=1,
           skipdj=0):
    #  print 'log'+ str( logo) + ' useani '+ str(useani)
    diff = usingDifficulty()
    #    if useani:
    #        VS.playAnimation ("warp.ani",vec,300.0)
    if (not diff or (type.find(".blank") == -1 and -1 == type.find(".stock"))):
        for i in range(nr_ships):
            ret = VS.launch(fgname, type, faction, "unit", ai, 1, nr_waves,
                            VS.SafeEntrancePoint(vec, 40), logo)
            unit.moveOutOfPlayerPath(ret)
        if (not skipdj):
            dj_lib.PlayMusik(0, dj_lib.HOSTILE_NEWLAUNCH_DISTANCE)
        return ret
    rsize = 0.0
    diffic = VS.GetDifficulty()
    ret = VS.Unit()
    for i in range(nr_ships):
        mynew = VS.launch(fgname, type, faction, "unit", ai, 1, nr_waves,
                          VS.SafeEntrancePoint(vec, 40), logo)
        unit.moveOutOfPlayerPath(mynew)
        if (i == 0):
            ret = mynew
            rsize = mynew.rSize() * 1.75
        ship_upgrades.upgradeUnit(mynew, diffic)
        vec = (
            vec[0] - rsize,
            vec[1],  #-rsize
            vec[2] - rsize)
    if (not skipdj):
        dj_lib.PlayMusik(0, dj_lib.HOSTILE_NEWLAUNCH_DISTANCE)
    return ret
示例#3
0
def move_to (un, where):
    un.SetPosition(where)
    unit.moveOutOfPlayerPath(un)
    un.SetTarget (VS.Unit())
    return NextPos (un,where)
示例#4
0
def move_to (un, where):
    un.SetPosition(where)
    unit.moveOutOfPlayerPath(un)
    un.SetTarget (VS.Unit())
    return NextPos (un,where)