コード例 #1
0
ファイル: functions.py プロジェクト: ckode/ArenaMUD2
def clearAttacksPlayerDead(victim):
    """
    Remove all attacks against dead
    player.
    """

    for player in AllPlayers.values():
        if player.attacking == victim:
            endCombat( player )
コード例 #2
0
ファイル: gameutils.py プロジェクト: ckode/ArenaMUD2
def doDurationEffectSpells():
    """
    Apply duration effects of spells.
    """
    for player in AllPlayers.values():
        # If player isn't playing.  No need to heal
        if player.status is not PLAYING:
            continue  
        for spell in player.spells.values():
            spell.durationEffect()
コード例 #3
0
ファイル: gameutils.py プロジェクト: ckode/ArenaMUD2
def naturalHealing():
    """
    Natural healing loop.
    """
    
    healRate = 5
    for player in AllPlayers.values():
        # If player isn't playing.  No need to heal
        if player.status is not PLAYING:
            continue        
        
        healPlayer(player, HP, healRate)     
        player.statLine()
コード例 #4
0
ファイル: gameutils.py プロジェクト: ckode/ArenaMUD2
def restHealing():
    """
    If player resting, rest heal him.
    """
    
    healRate = 15
    for player in AllPlayers.values():
        # If player isn't playing.  No need to heal
        if player.status is not PLAYING:
            continue
        if player.stats[RESTING]:
            healPlayer(player, HP, healRate)       
            player.statLine()
コード例 #5
0
ファイル: gameutils.py プロジェクト: ckode/ArenaMUD2
def saveAllPlayers():
    """
    Save all users.
    """
    
    i = 0
    
    for player in AllPlayers.values():
        if player.status is PLAYING or player.status is PURGATORY:
            i += 1
            player.save()
    
    logger.gamelogger.logger.log.debug("Saving {0} of {1} players.".format(i, len(AllPlayers)))