示例#1
0
from lib.floo_network import ANVIL_DROP, FlooEvent
from lib.const_ints import CONST_INTS
from lib.scoreboard import OBJECTIVES, TEAMS
from lib.consts import *
from lib.coords import Coords

event = ANVIL_DROP
floo_event = FlooEvent(event, saturation="false")

select_spawn_coords = Coords("-19 4 85 -12 9 89")
select_spawn = select_spawn_coords.selector()

select_arena_coords = Coords("-33 2 81 -21 7 93")
select_arena = select_arena_coords.selector()

# region coords to be quickly set with redstone and back to stonebrick
# to save the structure blocks for "AD_layer" and "AD_walls"
save_layers = Coords("-57 5 80 -57 4 80")

# Placement of the structure blocks
struct_1 = Coords("-36 15 79")
struct_2 = Coords("-36 14 79")
struct_walls = Coords("-36 13 79")

# Placement of the redstone blocks required to activate
# the structure blocks
layer_1 = Coords("-36 15 80")
layer_2 = Coords("-36 14 80")
layer_walls = Coords("-36 13 80")

door_region = Coords("20 7 88 -20 5 86")
tp_back = 152 8 180 90 -30

# redstone block to open the door with
activate_door = 158 1 180

"""
inputList = """

1 = x=73,y=14,z=-102,dy=1
1 = 73 12 -102

2 = x=73,y=14,z=-100,dy=1
2 = 73 12 -100

3 = x=73,y=14,z=-104,dy=1
3 = 73 12 -104

sp = x=68,y=6,z=-104,dx=10,dy=2,dz=4
sp = 73 7 -102 90 0



""".splitlines()

for line in inputList:
    if not line.strip() or line.strip()[0] == "#":
        print(line)
        continue
    name, equals, selector = line.split(maxsplit=2)
    print("{0} = {1}".format(name, repr(Coords(selector)).replace(r"'", r'"')))
示例#3
0
def relative(*coords):
    return Coords(*map(lambda x: "~" + str(x), coords))
示例#4
0
from lib.floo_network import THE_PIT_3, FlooEvent
from lib.const_ints import CONST_INTS
from lib.scoreboard import OBJECTIVES, TEAMS
from lib.consts import Sounds, Effects
from lib.coords import Coords

event = THE_PIT_3
floo_event = FlooEvent(THE_PIT_3, pvp="true")
initials = "TP"
select_all = event.select_all

select_spawn = Coords("-107 25 193 -98 30 202")
select_arena = Coords("-107 6 146 -51 56 202")

# teleport coords to get to the spectator area
# selection of the area around the above teleport coords
select_spectate = Coords("-111 16 204 -109 20 206")

# teleport to the arena inside the middle ball
arena_tp = Coords("-79 18 174")

# activates the structure for loading up the middle ball
activate_struct_mid = Coords("-80 7 174")

# fill region to clear out the middle ball
mid_ball_region = Coords("-77 17 172 -81 22 176")

# region to kill all players on the floor
floor_region = Coords("-107 6 146 -51 6 202")

# region to kill all players on the sides of the middle pillar
示例#5
0
from lib.floo_network import MASTERMIND, FlooEvent
from lib.const_ints import CONST_INTS
from lib.scoreboard import OBJECTIVES, TEAMS
from lib.coords import Coords
from lib.vector import Vector3
from lib.consts import *
from room import Room

event = MASTERMIND
floo_event = FlooEvent(MASTERMIND)
initials = "MM"
select_all = event.select_all

# activating the structure blocks to save the rooms
activate_struct_save = Coords("107 4 82 96 4 82")

# filling the doors
fill_doors_north = Coords("49 8 37 105 6 37")
fill_doors_south = Coords("49 8 46 105 6 46")

# fills the buttons
fill_buttons_north = Coords("46 6 26 101 6 34")
fill_buttons_south = Coords("53 6 57 108 6 49")

# activates the structure blocks underneath the map to reset the rooms
activate_struct_reset = Coords("45 2 60 109 2 23")

room_size_north = Vector3(7, 5, 12)
room_size_south = Vector3(-7, 5, -12)

示例#6
0
    def __repr__(self):
        return "Event[id={id}, name={name}, colors={colors}, coords={coords}, disp_coords={disp_coords}, shortcut={short}], initials={init}".format(
            id=self.id,
            name=self.name,
            colors=self.colors,
            coords=self.coords,
            disp_coords=self.disp_coords,
            short=str(self.shortcut)[1:-1],
            init=repr(self.begin))


# Races
ICE_RACE = Event("ice_race",
                 "Ice race",
                 "aqua",
                 Coords("49 36 -45 -90 0"),
                 "ir",
                 select_coords=Coords("34 2 -64 175 71 -21"))
SLOW_RACE = Event("slow_race",
                  "Slow Race",
                  "gray",
                  Coords("75 7 -80 90 0"),
                  "sr",
                  select_coords=Coords("21 4 -88 82 104 -67"))
NETHER_RACE = Event("nether_race",
                    "Nether Race",
                    "red",
                    Coords("73 7 -102 90 0"),
                    "nr",
                    select_coords=Coords("32 4 -108 80 104 -93"))
EVIL_RACE = Event("evil_race",
        Returns the given book command to give a player
        the event book
        """
        return "scoreboard players set {0} FLbk {1}".format(selector, self.id)

    def __str__(self):
        return "Event[{name} ({short})]".format(name=repr(self.full_name), short=str(self.shortcut)[1:-1])

    def __repr__(self):
        return "Event[id={id}, name={name}, colors={colors}, coords={coords}, disp_coords={disp_coords}, shortcut={short}], initials={init}".format(
            id=self.id, name=self.name, colors=self.colors, coords=self.coords,
            disp_coords=self.disp_coords, short=str(self.shortcut)[1:-1], init=repr(self.begin))


# Races
ICE_RACE = Event("ice_race", "Ice race", "aqua", Coords("49 36 -45 -90 0"), "ir", select_coords=Coords("34 2 -64 175 71 -21"))
SLOW_RACE = Event("slow_race", "Slow Race", "gray", Coords("75 7 -80 90 0"), "sr", select_coords=Coords("21 4 -88 82 104 -67"))
NETHER_RACE = Event("nether_race", "Nether Race", "red", Coords("73 7 -102 90 0"), "nr", select_coords=Coords("32 4 -108 80 104 -93"))
EVIL_RACE = Event("evil_race", "Evil Race", "gray", Coords("23 7 -133 -90 0"), "evilr", initials="EvilR", select_coords=Coords("19 6 -147 107 106 -120"))
DIAMOND_RACE = Event("diamond_race", "Diamond Race", "aqua", Coords("218 18 -37 -90 0"), "dr", select_coords=Coords("206 4 -57 255 104 -18"))
EMERALD_RACE = Event("emerald_race", "Emerald Race", "green", Coords("276 17 -96 90 0"), "er", select_coords=Coords("219 5 -121 294 105 -70"))
QUARTZ_RACE = Event("quartz_race", "Quartz Race", "white", Coords("229 8 -157 -90 0"), "qr", select_coords=Coords("219 4 -177 296 104 -139"))
V1_8_RACE = Event("1_8_race", "1.8 Race", "gold", Coords("242 26 -222 -90 0"), "18r", select_coords=Coords("212 7 -241 341 107 -191"))
EPIC_RACE = Event("epic_race", "Epic Race", "gold", Coords("424 12 -122 -90 0"), "epicr", initials="EpicR", select_coords=Coords("416 4 -135 476 33 -70"))
SALT_RACE = Event("salt_race", "Salt Race", "gray", Coords("467 8 -33 -90 0"), "saltr", initials="SaltR", select_coords=Coords("419 4 -47 498 44 -15"))
DEATH_RUN = Event("death_run", "Death Run", "red", Coords("31 20 -240 -45 0"), "deathr", initials="DeathR", select_coords=Coords("13 12 -260 148 62 -205"))
DIRT_RACE = Event("dirt_race", "Dirt Race", "gray", Coords("23 15 -189.0 -90 0"), "dirtr", initials="DirtR", select_coords=Coords("18 11 -207 67 31 -162"))
MYCELIUM_RACE = Event("mycelium_race", "Mycelium Race", "dark_purple", Coords("445 68 -669.0 -90 0"), "mr", select_coords=Coords("433 5 -739 473 85 -639"))
FROSTBURN_RUN = Event("frostburn_run", "Frostburn Run", "aqua", Coords("517 11 -827 90 0"), "fbr", select_coords=Coords("433 3 -841 523 53 -751"))
EVERCHANGING_RACE = Event("ever_changing_race", "EverChanging Race", "yellow", Coords("460 3 -331 -90 0"), "ecr", select_coords=Coords("450 0 -353 574 30 -308"))
示例#8
0
        Returns the given book command to give a player
        the event book
        """
        return "scoreboard players set {0} FLbk {1}".format(selector, self.id)

    def __str__(self):
        return "Event[{name} ({short})]".format(name=repr(self.full_name), short=str(self.shortcut)[1:-1])

    def __repr__(self):
        return "Event[id={id}, name={name}, colors={colors}, coords={coords}, disp_coords={disp_coords}, shortcut={short}], initials={init}".format(
            id=self.id, name=self.name, colors=self.colors, coords=self.coords,
            disp_coords=self.disp_coords, short=str(self.shortcut)[1:-1], init=repr(self.begin))


# Races
ICE_RACE = Event("ice_race", "Ice race", "aqua", Coords("49 36 -45 -90 0"), "ir", select_coords=Coords("34 2 -64 175 71 -21"))
SLOW_RACE = Event("slow_race", "Slow Race", "gray", Coords("75 7 -80 90 0"), "sr", select_coords=Coords("21 4 -88 82 104 -67"))
NETHER_RACE = Event("nether_race", "Nether Race", "red", Coords("73 7 -102 90 0"), "nr", select_coords=Coords("32 4 -108 80 104 -93"))
EVIL_RACE = Event("evil_race", "Evil Race", "gray", Coords("23 7 -133 -90 0"), "evilr", initials="EvilR", select_coords=Coords("19 6 -147 107 106 -120"))
DIAMOND_RACE = Event("diamond_race", "Diamond Race", "aqua", Coords("218 18 -37 -90 0"), "dr", select_coords=Coords("206 4 -57 255 104 -18"))
EMERALD_RACE = Event("emerald_race", "Emerald Race", "green", Coords("276 17 -96 90 0"), "er", select_coords=Coords("219 5 -121 294 105 -70"))
QUARTZ_RACE = Event("quartz_race", "Quartz Race", "white", Coords("229 8 -157 -90 0"), "qr", select_coords=Coords("219 4 -177 296 104 -139"))
V1_8_RACE = Event("1_8_race", "1.8 Race", "gold", Coords("242 26 -222 -90 0"), "18r", select_coords=Coords("212 7 -241 341 107 -191"))
EPIC_RACE = Event("epic_race", "Epic Race", "gold", Coords("424 12 -122 -90 0"), "epicr", initials="EpicR", select_coords=Coords("416 4 -135 476 33 -70"))
SALT_RACE = Event("salt_race", "Salt Race", "gray", Coords("467 8 -33 -90 0"), "saltr", initials="SaltR", select_coords=Coords("419 4 -47 498 44 -15"))
DEATH_RUN = Event("death_run", "Death Run", "red", Coords("31 20 -240 -45 0"), "deathr", initials="DeathR", select_coords=Coords("13 12 -260 148 62 -205"))
DIRT_RACE = Event("dirt_race", "Dirt Race", "gray", Coords("23 15 -189.0 -90 0"), "dirtr", initials="DirtR", select_coords=Coords("18 11 -207 67 31 -162"))
MYCELIUM_RACE = Event("mycelium_race", "Mycelium Race", "dark_purple", Coords("445 68 -669.0 -90 0"), "mr", select_coords=Coords("433 5 -739 473 85 -639"))
FROSTBURN_RUN = Event("frostburn_run", "Frostburn Run", "aqua", Coords("517 11 -827 90 0"), "fbr", select_coords=Coords("433 3 -841 523 53 -751"))
EVERCHANGING_RACE = Event("ever_changing_race", "EverChanging Race", "yellow", Coords("460 3 -331 -90 0"), "ecr", select_coords=Coords("450 0 -353 574 30 -308"))
示例#9
0
print(str(TEAMS))
print(repr(TEAMS))
print(TEAMS.cmd_init())
print(TEAMS.cmd_term())


# Constant integers
CONST_INTS.add_consts(25, 35, 1, 20)
CONST_INTS.add_consts(64, 23, 6, 1)

print(CONST_INTS.cmd_init())
print(repr(CONST_INTS.cmd_term()))


# Coordinates
coordRegion = Coords("-32 33 320 -52 28 320")
print(coordRegion)
print(str(coordRegion))
print(coordRegion.to_selector())

# Floo network
FlooRace = FlooEvent(ICE_RACE)
FlooPVP = FlooEvent(VIRUS_1, pvp="true")
FlooDeathPit = FlooEvent(DEATH_PIT, saturation="false")

print(FlooRace, FlooPVP, FlooDeathPit)
print(repr(ICE_RACE))
print(repr(VIRUS_1))
print(repr(DEATH_PIT))

places1 = ("belowName", "list", "sidebar", *("sidebar.team." + color for color in Colors.ALL if color != "reset"))