グラデーションの始点にしたい色のブロックを持つ /grf と入力 → gradient from color is now :( 数字 ) とメッセージ 終点にしたい色のブロック持つ /grt と入力 → gradient to color is now :( 数字 ) とメッセージ /gr と入力 → gradient enable d. colors are:( 数字 )( 数字 ) とメッセージ この状態で右クリックでブロックを置くと、始点にした色のブロックから終点にした色のブロックまでの色がグラデーションで出る ブロックを長く置けばより細かいグラデーションになる ちなみにこの時持ってるブロックの色はどんな色持ってても関係ない /gr と再び入力するとno longer making gradients とメッセージが出て、右クリックしてもグラデーションつかない普通の状態に戻る さらに再び/grを入力すれば、先ほどの色味のグラデーションが再び使えるようになる
def get_spawn_location(connection): if connection.team is connection.protocol.blue_team: x, y, z = random.choice(spawn_locations_blue) elif connection.team is connection.protocol.green_team: x, y, z = random.choice(spawn_locations_green) z -= 2.4 # magic numbers x += 0.5 y += 0.5 if connection.protocol.map.get_z(x, y) <= z: # allows spawning lower if the ground is destroyed return x, y, z else: return x, y, connection.protocol.map.get_z(x, y) ---- これのspawn_locationsを弄くれ
from pyspades.contained import BlockAction from pyspades.server import block_action from pyspades.common import Vertex3 from pyspades.constants import * //よく分からないので関係ありそうなライブラリを適当に読み込んでます
protectpoint = [[[0 for z in xrange(0, 62)] for y in xrange(0, 512)] for x in xrange(0, 512)] //マップに最初から入ってる建築物のうち保護したいブロックを記憶する3次元配列です
//最初に配列を初期化するときに、指定された座標にブロックがあるかを判定する関数です def getMapProtection(map, x, y, z): if map.get_solid(x, y, z): return 1 else: return 0
//配列を初期化する関数です。on_map_changeで呼び出してます。中でgetMapProtectionを呼び出します。 def initMapProtection(map): x = 0 y = 0 z = 0 for z in xrange(3, 62, 5): for y in xrange(0, 512): for x in xrange(0, 512): protectpoint[x][y][z] = getMapProtection(map, x, y, z)
//ブロックが破壊されると呼び出される、そのブロックが保護対象かを判定する関数です。 def checkMapProtection(x, y, z): return protectpoint[x][y][z]
def apply_script(protocol, connection, config): class BuildingProtectionConnection(connection): def on_block_destroy(self, x, y, z, mode): if z%5 == 3 and checkMapProtection(x, y, z) == 1://高さ5ごとにフロアがあるので、フロアの破壊を判定 self.send_chat('stop destroy default buildings') return False elif mode == SPADE_DESTROY://右クリックで掘った場合も同様に判定 if z%5 == 4 and checkMapProtection(x, y, z-1) == 1: self.send_chat('stop destroy default buildings') return False elif z%5 == 2 and checkMapProtection(x, y, z+1) == 1: self.send_chat('stop destroy default buildings') return False elif x%64 >= 31 and x%64 <= 32 and y%64 >= 31 and y%64 <= 32://塔の骨組みの破壊を判定 self.send_chat('stop destroy default buildings') return False
class BuildingProtectionProtocol(protocol): def on_map_change(self, map): initMapProtection(map) protocol.on_map_change(self, map)