コード例 #1
0
def SiftBattle(name):
    from mud.world.battle import BattleGroup,BattleSequence,BattleResult,BattleMustSurvive,BattleProto
    from mud.world.zone import Zone
    bp = BattleProto.byName(name)
    
    zone = Zone.byName(bp.zoneName)
    
    sequences = []
    seq = bp.side1StartSequence
    while seq:
        sequences.append(seq)
        seq = seq.nextSequence
    seq = bp.side2StartSequence
    while seq:
        sequences.append(seq)
        seq = seq.nextSequence
        
    sgroups = []
    for s in sequences:
        snd = s.zoneSound
        if snd:
            AddSound("./$/data/sound/%s"%snd)
        for g in s.battleGroups:
            if g.triggerSpawnGroup:
                for sg in zone.spawnGroups:
                    if sg.groupName == g.triggerSpawnGroup:
                        sgroups.append(sg)
                        
            if g.spawnGroup:
                for sg in zone.spawnGroups:
                    if sg.groupName == g.spawnGroup:
                        sgroups.append(sg)
        
    
    SiftBattleResult(zone,bp.side1VictoryResult)
    SiftBattleResult(zone,bp.side2VictoryResult)
    SiftBattleResult(zone,bp.side1DefeatResult)
    SiftBattleResult(zone,bp.side2DefeatResult)
    
    for sg in sgroups:
        for sinfo in sg.spawninfos:
            SiftSpawn(sinfo.spawn)
コード例 #2
0
def SiftBattle(name):
    from mud.world.battle import BattleGroup, BattleSequence, BattleResult, BattleMustSurvive, BattleProto
    from mud.world.zone import Zone
    bp = BattleProto.byName(name)

    zone = Zone.byName(bp.zoneName)

    sequences = []
    seq = bp.side1StartSequence
    while seq:
        sequences.append(seq)
        seq = seq.nextSequence
    seq = bp.side2StartSequence
    while seq:
        sequences.append(seq)
        seq = seq.nextSequence

    sgroups = []
    for s in sequences:
        snd = s.zoneSound
        if snd:
            AddSound("./$/data/sound/%s" % snd)
        for g in s.battleGroups:
            if g.triggerSpawnGroup:
                for sg in zone.spawnGroups:
                    if sg.groupName == g.triggerSpawnGroup:
                        sgroups.append(sg)

            if g.spawnGroup:
                for sg in zone.spawnGroups:
                    if sg.groupName == g.spawnGroup:
                        sgroups.append(sg)

    SiftBattleResult(zone, bp.side1VictoryResult)
    SiftBattleResult(zone, bp.side2VictoryResult)
    SiftBattleResult(zone, bp.side1DefeatResult)
    SiftBattleResult(zone, bp.side2DefeatResult)

    for sg in sgroups:
        for sinfo in sg.spawninfos:
            SiftSpawn(sinfo.spawn)
コード例 #3
0
from mud.world.battle import BattleGroup, BattleSequence, BattleResult, BattleMustSurvive, BattleProto
from genesis.dbdict import *

#--- DEFINES
durSecond = 6
durMinute = durSecond * 60
durHour = durMinute * 60

battle = BattleProto(name="HumanWolfSkirmish", zoneName="base")

battle.zoneMessage = "Great armies of humans and wolves are amassed!  The battle will soon be fought!"
battle.zoneSound = "sfx/College_DrumCadence07.ogg"

BattleMustSurvive(name="Taskmaster Duro", battleProto=battle)
BattleMustSurvive(name="Captain Flamehorn", battleProto=battle)

#--- SIDE 1 SEQUENCE 1
bs = BattleSequence()
bs.zoneSound = "sfx/College_DrumCadence03.ogg"
battle.side1StartSequence = bs

bg = BattleGroup()
bg.triggerSpawnGroup = "B1_S1_1"
bg.spawnGroup = "DESTROYER"
bg.attackDelay = 60 * durSecond
bg.battleSequence = bs

bg = BattleGroup()
bg.triggerSpawnGroup = "B1_S1_2"
bg.spawnGroup = "PUNISHER"
bg.attackDelay = 65 * durSecond