Bonus Module

This module implement a simple bonus system for Bomberman game. Currently, it’s quite limited, and not yet used by the game.

Warning

Warning

By now, the bonus system is not yet ready.

List of Bonuses:

  • no – nothing,
  • apple – a poisoned apple, decrease the life of the player (and can kill him),
  • dice – change randomly the life of the player,
  • fire – increase the force of player’s bomb (i.e. the distance of explosion),
  • ice – increase the timer of player’s bomb,
  • life[1|2|3] – increase (by *2, by +1 or by +2) the player’s life,
  • sword – increase the power of player’s bomb (they hit more !)

About:

This bonus use the method Bonus.affect to change the game, so some modifications can be unable to do.
Bonus.BONUS_NOBONUS = 'no'

For now, there is no bonus system used in the server or in the client, so this constant represent the default bonus (i.e. no bonus). Those constants are different bonus type. From here.

Bonus.BONUS_APPLE = '\xe2\x98\xa0apple'

a poisoned apple, decrease the life of the player (and can kill him),

Bonus.BONUS_DICE = '\xe2\x9a\x84dice'

change randomly the life of the player,

Bonus.BONUS_FIRE = '\xe2\x99\xa8fire'

increase the force of player’s bomb (i.e. the distance of explosion),⚡

Bonus.BONUS_ICE = '\xe2\x98\x83ice'

increase the timer of player’s bomb,

Bonus.BONUS_LIFE1 = '\xe2\x9b\x82life1'

increase (by *2) the player’s life,

Bonus.BONUS_LIFE2 = '\xe2\x98\xbalife2'

increase (by +1) the player’s life,

Bonus.BONUS_LIFE3 = '\xe2\x9b\x80life3'

increase (by +2) the player’s life,

Bonus.BONUS_SWORD = '\xe2\x9a\x94sword'

increase the power of player’s bomb (they hit more !)

Bonus.List_available_bonuses = ['\xe2\x9a\x84dice', '\xe2\x9a\x94sword']

List of all availables bonuses.

class Bonus.Bonus(kind='no')[source]

A Class to define a Bomberman bonus.

Attributes:
  • kind – reference of the bonus (by now, integer).
This class can be used both by the client and the server,
but reasonably, have just to be used from Player and Board.
__init__(kind='no')[source]

Simple constructor of a bomb.

kind = None
reference of the bonus (by now, integer).
strNoUtf()[source]

Simple conversion to string, with no UTF caracters.

__str__()
return self.kind[1].capitalize()
strUtf()[source]

Simple conversion to string, with UTF caracters..

__repr__()[source]

Toplevel representation of [self].

affect(self, player, board) -> (player, board)[source]

When the player get this bonus, run this effect. board is the current state of the game (the Board.Board instance), args can be anything (see later).

Table Of Contents

Previous topic

IRCserver Module

Next topic

Bomb Module

This Page