diff options
author | PanFritz <redstonenoobpan@gmail.com> | 2015-01-17 00:01:00 +0100 |
---|---|---|
committer | PanFritz <redstonenoobpan@gmail.com> | 2015-01-17 00:01:00 +0100 |
commit | 8cc089a11b3df677e576fb7d6e02ae5fe933d0d8 (patch) | |
tree | 28315de5a6868b6c1e17171a708e236296bbcdca /snowbrawl.py | |
parent | 496a5d27350aa6054d7c462a4ff6f3cfe3dab49a (diff) |
added snowbrawl.py
Diffstat (limited to 'snowbrawl.py')
-rw-r--r-- | snowbrawl.py | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/snowbrawl.py b/snowbrawl.py new file mode 100644 index 0000000..4525819 --- /dev/null +++ b/snowbrawl.py @@ -0,0 +1,98 @@ +#Snowbrawl +from helpers import * + +arenas = {} + +""" +ArenaName +PlayersPerGame +Objective +PlayersInQue +""" + +@hook.event("Entity.ProjectileHitEvent", "high") +def onHit(event): + if event.getEntity().getType() != EntityType.SNOWBALL: + return + if event.getWorld().getName() != "minigames": + return + event.getWorld().createExplosion(event.getLocation(),1) + + + + + +@hook.event("PlayerInteractEvent") +def onClick(event): + if (event.getAction() != Action.RIGHT_CLICK_BLOCK): + return + block = event.getClickedBlock() + if not block.getMaterial() in [Material.SIGN_POST, Material.WALL_SIGN]: + return + sign_state = block.getState() + lines = bukkit.block.Sign.getLines(sign_state) + + + +class Queue(Object): + + queue = [] + + def __init__(self): + + def add(name): + queue.append(name) + def rem(names): + for name in names: + queue.remove(name) + def shrink(): + queue.remove(0) + +class Arena(Object): + + queue = Queue() + size = 0 + coordinate = Coordinate(0, 0) + + def __init__(self, coordinate, size): + self.coordinate = coordinate + self.size = size + + def getLocation(): + return coordinate + def getSize(): + return size + def getQueue(): + return queue + +class Coordinate(Object): + + x = 0 + z = 0 + + def __init__(self, x, z): + self.x = x + self.z = z + + def getX(): + return x + def getZ(): + return z + + def inRange(location, range): + xd = location.getBlockX() - getX() + zd = location.getBlockZ() - getZ() + return xd >= 0 and xd <= range_ and zd >= 0 and zd <= range_ +""" +class Match(Object): + + names = [] + + def __init__(self, ): +""" +def getArena(location): + for name in arenas: + arena = arenas.get(name) + if arena.getLocation().inRange(location, arena.getSize() - 1) + return arena + return None
\ No newline at end of file |