def getPriceModifier(isUncapped):
    import difficulty
    if (not difficulty.usingDifficulty()):
        return 1.0
    if (isUncapped):
        return getMissionDifficulty() / .5 + .9
    return VS.GetDifficulty() / .5 + .9
Esempio n. 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
Esempio n. 3
0
def getPriceModifier(isUncapped):
    import difficulty
    if (not difficulty.usingDifficulty()):
        return 1.0
    if (isUncapped):
        return getMissionDifficulty()/.5+.9
    return VS.GetDifficulty()/.5+.9
Esempio n. 4
0
def launch(fgname,
           faction,
           type,
           ai,
           nr_ships,
           nr_waves,
           vec,
           logo='',
           useani=1):
    debug.debug("fgname: %s, faction %s" % (fgname, faction))
    debug.debug("type: %s" % (type))
    debug.debug("ai: %s, nr_ships: %d, nr_waves: %d" %
                (ai, nr_ships, nr_waves))
    debug.debug("vec: %s, logo: %s, useani: %d" % (vec, logo, useani))
    #debug.debug('log'+ str( logo) + ' useani '+ str(useani))
    use_diff = usingDifficulty()
    #   if useani:
    #       VS.playAnimation ("warp.ani",vec,300.0)
    if isinstance(type, list) or isinstance(type, tuple):
        debug.debug("inside isinstance conditional (type is list or tuple)")
        for t in type:
            if t.endswith(".blank"):
                isblank = True
                break
    else:
        isblank = type.endswith(".blank")
    debug.debug("isblank = %s" % (isblank))
    # originally, this was
    #   if (not diff or not isblank)
    # which effectively always ignored isblank, since diff is almost never false
    if (not isblank):
        debug.info("Launching non-blank ship(s)")
        ret = VS.launch(fgname, type, faction, "unit", ai, nr_ships, nr_waves,
                        VS.SafeEntrancePoint(vec, 40), logo)
        ship_upgrades.adjust_upgrades(ret)
        dj_lib.PlayMusik(0, dj_lib.HOSTILE_NEWLAUNCH_DISTANCE)
    else:  # only upgrade blank ships (for now)
        debug.info("Launching blank ship(s)")
        rsize = 0.0
        diffic = VS.GetDifficulty()
        #debug.debug("VS.Unit #1")
        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)
            if (i == 0):
                ret = mynew
                rsize = mynew.rSize() * 1.75
            debug.debug("upgradeUnit '%s' using difficulty %.2f ..." %
                        (mynew.getName(), float(diffic)))
            ship_upgrades.upgradeUnit(mynew, diffic)
            debug.debug(
                "'- Done upgrading unit '%s' using difficulty %.2f ..." %
                (mynew.getName(), float(diffic)))
            vec = (
                vec[0] - rsize,
                vec[1],  #-rsize
                vec[2] - rsize)
    dj_lib.PlayMusik(0, dj_lib.HOSTILE_NEWLAUNCH_DISTANCE)
    return ret
def getPriceModifier(isUncapped):
    return 1.15
    import difficulty

    if not difficulty.usingDifficulty():
        return 1.0
    if isUncapped:
        return getMissionDifficulty() / 0.5 + 0.9
    return VS.GetDifficulty() / 0.5 + 0.9
Esempio n. 6
0
def appendName(faction):
    from difficulty import usingDifficulty
    use_diff = usingDifficulty()
    use_blank = useBlank[faction]
    _random = vsrandom.random()
    #debug.debug("faction %s: (use_blank=%d >= _random=%.3f) ?" % (intToFaction(faction), use_blank, _random))
    if use_diff and use_blank >= _random:
        #debug.debug("'-> using .blank")
        return ".blank"
    else:
        #debug.debug("'-> NOT using .blank")
        return ""
Esempio n. 7
0
def appendName(faction):
    from difficulty import usingDifficulty
    use_diff = usingDifficulty()
    use_blank = useBlank[faction]
    _random = vsrandom.random()
    #debug.debug("faction %s: (use_blank=%d >= _random=%.3f) ?" % (intToFaction(faction), use_blank, _random))
    if use_diff and use_blank >= _random:
        #debug.debug("'-> using .blank")
        return ".blank"
    else:
        #debug.debug("'-> NOT using .blank")
        return ""
Esempio n. 8
0
def launch (fgname, faction, type, ai, nr_ships, nr_waves, vec, logo='',useani=1):
    debug.debug("fgname: %s, faction %s" % (fgname, faction))
    debug.debug("type: %s" % (type))
    debug.debug("ai: %s, nr_ships: %d, nr_waves: %d" % (ai, nr_ships, nr_waves))
    debug.debug("vec: %s, logo: %s, useani: %d" % (vec, logo, useani))
    #debug.debug('log'+ str( logo) + ' useani '+ str(useani))
    use_diff = usingDifficulty()
#   if useani:
#       VS.playAnimation ("warp.ani",vec,300.0)
    if isinstance(type, list) or isinstance(type, tuple):
        debug.debug("inside isinstance conditional (type is list or tuple)")
        for t in type:
            if t.endswith(".blank"):
                isblank = True
                break
    else:
        isblank = type.endswith(".blank")
    debug.debug("isblank = %s" % (isblank))
    # originally, this was
    #   if (not diff or not isblank)
    # which effectively always ignored isblank, since diff is almost never false
    if (not isblank):
        debug.info("Launching non-blank ship(s)")
        ret = VS.launch (fgname,type,faction,"unit",ai,nr_ships,nr_waves,VS.SafeEntrancePoint (vec,40),logo)
        ship_upgrades.adjust_upgrades(ret)
        dj_lib.PlayMusik(0,dj_lib.HOSTILE_NEWLAUNCH_DISTANCE)
    else:  # only upgrade blank ships (for now)
        debug.info("Launching blank ship(s)")
        rsize=0.0
        diffic = VS.GetDifficulty()
        #debug.debug("VS.Unit #1")
        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)
            if (i==0):
                ret = mynew
                rsize = mynew.rSize()*1.75
            debug.debug("upgradeUnit '%s' using difficulty %.2f ..." % (mynew.getName(), float(diffic)))
            ship_upgrades.upgradeUnit(mynew,diffic)
            debug.debug("'- Done upgrading unit '%s' using difficulty %.2f ..." % (mynew.getName(), float(diffic)))
            vec=(vec[0]-rsize,
                vec[1],#-rsize
                vec[2]-rsize)
    dj_lib.PlayMusik(0,dj_lib.HOSTILE_NEWLAUNCH_DISTANCE)
    return ret
Esempio n. 9
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
def appendName(faction):
    from difficulty import usingDifficulty
    if (useBlank[faction] and usingDifficulty()):
        return ".blank"
    else:
        return ""