Permalink
Browse files

updated udebs

  • Loading branch information...
1 parent bd7d8bd commit 9746c1cc432853c964f51068fc32295befa32741 @recrm committed May 13, 2012
Showing with 148 additions and 77 deletions.
  1. +5 −19 chess.py
  2. +48 −7 chess.xml
  3. +95 −51 udebs.py
View
@@ -135,28 +135,14 @@
#draw the tile
pygame.draw.rect(mainSurface, colour, tile)
+ #draw any unit on the tile.
unit = udebs.getMap((x, y))
- if udebs.getStat(unit, udebs.ID) != 'empty':
- if 'black' in udebs.getStat(unit, udebs.GROUP):
- sprite_colour = (100, 100, 100)
- else:
- sprite_colour = (0, 250, 0 )
+ if unit != 'empty':
- #selects sprites
-
- if 'black_pawn' in udebs.getStat(unit, udebs.GROUP) or 'white_pawn' in udebs.getStat(unit, udebs.GROUP):
- sprite_symbol = "P"
- elif 'rook' in udebs.getStat(unit, udebs.GROUP):
- sprite_symbol = 'R'
- elif 'bishop' in udebs.getStat(unit, udebs.GROUP):
- sprite_symbol = 'B'
- elif 'knight' in udebs.getStat(unit, udebs.GROUP):
- sprite_symbol = 'N'
- elif 'queen' in udebs.getStat(unit, udebs.GROUP):
- sprite_symbol = 'Q'
- elif 'king' in udebs.getStat(unit, udebs.GROUP):
- sprite_symbol = 'K'
+ colour_list = udebs.getStat(unit, 'colour')
+ sprite_colour = tuple([int(number) for number in colour_list])
+ sprite_symbol = udebs.getStat(unit, 'sprite')[0]
mainSurface.blit(basicFont.render(sprite_symbol, True, sprite_colour, colour), (x*50+10, y*50+10))
del colour
View
@@ -4,6 +4,11 @@
<revert>5</revert>
</config>
+<lists>
+ <item>colour</item>
+ <item>sprite</item>
+</lists>
+
<entities>
@@ -146,6 +151,10 @@
<entity>
<ID>captured</ID>
+ <effect>
+ <item>TARGET GETS status SELF</item>
+ </effect>
+
<require>
<item>SELF not in TARGET status</item>
<item>CASTER CLASS player not in TARGET group</item>
@@ -402,6 +411,12 @@
<ACT>1</ACT>
<SPD>1</SPD>
</stats>
+ <colour>
+ <item>100</item>
+ <item>100</item>
+ <item>100</item>
+ </colour>
+ <item>sprite</item>
</unit>
<unit tick='tick'>
@@ -411,6 +426,11 @@
<ACT>2</ACT>
<SPD>1</SPD>
</stats>
+ <colour>
+ <item>0</item>
+ <item>250</item>
+ <item>0</item>
+ </colour>
</unit>
<unit>
@@ -420,7 +440,10 @@
<item>white_pawn_double</item>
<item>white_pawn_capture</item>
<item>white_pawn_passant</item>
- </movelist>
+ </movelist>
+ <sprite>
+ <item>P</item>
+ </sprite>
</unit>
<unit>
@@ -430,44 +453,62 @@
<item>black_pawn_double</item>
<item>black_pawn_capture</item>
<item>black_pawn_passant</item>
- </movelist>
+ </movelist>
+ <sprite>
+ <item>P</item>
+ </sprite>
</unit>
<unit>
<ID>bishop</ID>
<movelist>
<item>bishop_travel</item>
- </movelist>
+ </movelist>
+ <sprite>
+ <item>B</item>
+ </sprite>
</unit>
<unit>
<ID>rook</ID>
<movelist>
<item>rook_travel</item>
- </movelist>
+ </movelist>
+ <sprite>
+ <item>R</item>
+ </sprite>
</unit>
<unit>
<ID>queen</ID>
<movelist>
<item>bishop_travel</item>
<item>rook_travel</item>
- </movelist>
+ </movelist>
+ <sprite>
+ <item>Q</item>
+ </sprite>
</unit>
<unit>
<ID>king</ID>
<movelist>
<item>king_castle</item>
<item>king_travel</item>
- </movelist>
+ </movelist>
+ <sprite>
+ <item>K</item>
+ </sprite>
</unit>
<unit>
<ID>knight</ID>
<movelist>
<item>knight_travel</item>
- </movelist>
+ </movelist>
+ <sprite>
+ <item>N</item>
+ </sprite>
</unit>
<!-- white units -->
Oops, something went wrong.

0 comments on commit 9746c1c

Please sign in to comment.