Crossfire Server, Trunk
CFTowerDefense Namespace Reference

Functions

def create_tower (player, current_map, tile, builder)
 
def destroy_tower (tile, towerlist)
 
list player_objects (player, current_map)
 
list player_tile_objects (player, current_map)
 
def replace_tower (current_map, tile, towerlist, level=0)
 

Variables

list bulletwall
 
list firewall
 
list lightningwall
 

Function Documentation

◆ create_tower()

def CFTowerDefense.create_tower (   player,
  current_map,
  tile,
  builder 
)
If a builder is dropped on a tower placement tile, a tower is built

player: the player object
current_map: the map object the player is in
tile: all objects on a tile (a list of Crossfire objects)
builder: the tower builder (a Crossfire object)

Returns: True if a tower was built, False otherwise.

Definition at line 37 of file CFTowerDefense.py.

◆ destroy_tower()

def CFTowerDefense.destroy_tower (   tile,
  towerlist 
)
If an object in tile exists in towerlist, the object is removed

tile: all objects on a tile (a list of Crossfire objects)
towerlist: bulletwall, firewall, or lightningwall

Returns: True if a tower was destroyed, False otherwise.

Definition at line 70 of file CFTowerDefense.py.

◆ player_objects()

list CFTowerDefense.player_objects (   player,
  current_map 
)
Returns all objects in the direction the player faces

player: the player object
current_map: the map object the player is in

Definition at line 119 of file CFTowerDefense.py.

◆ player_tile_objects()

list CFTowerDefense.player_tile_objects (   player,
  current_map 
)
Returns all objects in the tile the player is standing on

player: the player object
current_map: the map object the player is in

Definition at line 148 of file CFTowerDefense.py.

◆ replace_tower()

def CFTowerDefense.replace_tower (   current_map,
  tile,
  towerlist,
  level = 0 
)
If an object in tile exists in towerlist, the object is replaced with the
next direction in towerlist

current_map: the map object the player is in
tile: all objects on a tile (a list of Crossfire objects)
towerlist: bulletwall, firewall, or lightningwall
level: the spell level of the tower

Returns: True if a tower was replaced, False otherwise.

Definition at line 86 of file CFTowerDefense.py.

Variable Documentation

◆ bulletwall

list CFTowerDefense.bulletwall
Initial value:
1 = [
2  'lbulletwall_1',
3  'lbulletwall_2',
4  'lbulletwall_3',
5  'lbulletwall_4',
6  'lbulletwall_5',
7  'lbulletwall_6',
8  'lbulletwall_7',
9  'lbulletwall_8',
10 ]

Definition at line 3 of file CFTowerDefense.py.

◆ firewall

list CFTowerDefense.firewall
Initial value:
1 = [
2  'firewall_1',
3  'firewall_2',
4  'firewall_3',
5  'firewall_4',
6  'firewall_5',
7  'firewall_6',
8  'firewall_7',
9  'firewall_8',
10 ]

Definition at line 25 of file CFTowerDefense.py.

◆ lightningwall

list CFTowerDefense.lightningwall
Initial value:
1 = [
2  'lightningwall_1',
3  'lightningwall_2',
4  'lightningwall_3',
5  'lightningwall_4',
6  'lightningwall_5',
7  'lightningwall_6',
8  'lightningwall_7',
9  'lightningwall_8',
10 ]

Definition at line 14 of file CFTowerDefense.py.