コード例 #1
0
ファイル: marker.py プロジェクト: Kiva-Entertainment/yohk
def add(space, markerName):
	# If space is in bounds
	if not check.outOfBounds(space):
		position = getPosition.onGround(space)
		
		# Get battlefield scene
		battlefield = sceneControl.get('battlefield')
		
		# NOTE(kgeffen) Ground is arbitrarily the object adding the marker
		obj = battlefield.addObject(markerName, 'ground')
		obj.worldPosition = position
コード例 #2
0
def spaceValid(actorPosition, targetSpace, rng):
	# Invalid if space out of bounds
	if check.outOfBounds(targetSpace):
		return False
	
	targetPosition = getPosition.onGround(targetSpace)

	# Invalid if target space has height 0
	if targetPosition[2] == 0:
		return False
	
	# Invalid if height difference outside acceptable bounds
	dz = targetPosition[2] - actorPosition[2]
	if dz > rng['okDz']['max'] or dz < rng['okDz']['min']:
		return False
	
	return True
コード例 #3
0
ファイル: determine.py プロジェクト: Kiva-Entertainment/yohk
def spaceValid(space, h1, maxDh):
	if check.outOfBounds(space):
		return False
	
	# The height of space in decimeters
	h2 = round( logic.globalDict['groundHeight'][space[0]][space[1]] * 10 )
	
	# Space invalid if its height is 0 (Gaps/unreachable have h = 0)
	if h2 == 0:
		return False
	
	# Space invalid if unit is already in it (Can't pass through unit)
	occupyingUnit = unitControl.get.inSpace(space) 
	spaceOccupied = occupyingUnit is not None
	if spaceOccupied:
		return False
	
	# Space invalid if height too great
	if (h2 - h1) > maxDh:
		return False
		
	return True