def get_description_text(self): all_text = self.description + '\n\n' options = [ getattr(self, 'option_' + str(i + 1)) for i in xrange(6) if getattr(self, 'option_' + str(i + 1)) != 'None' ] all_text += '\n'.join(options) print all_text print format_text_linebreaks(all_text) return format_text_linebreaks(all_text)
def get_description_text(self): return format_text_linebreaks(self.description)
def get_description_text(self): """ Text description of card """ description = self.description return format_text_linebreaks(description,limit = 26)
def get_passive_text(self): return format_text_linebreaks(self.passive, limit=40)
def get_passive_text(self): if self.passive == None: return 'None'.format(self.passive) passive_text = [] if 'damage_reduced_to' in self.passive: passive_text += [ 'All direct damage is reduced to {}.'.format( self.passive['damage_reduced_to']) ] if 'damage_reduction' in self.passive: passive_text += [ 'Direct damage is reduced by {}.'.format( self.passive['damage_reduction']) ] if 'block_per_damage' in self.passive: passive_text += [ 'Whenever damage is taken, gain {} block for each HP lost this turn.' .format(self.passive['block_per_damage']) ] if 'starting_strength' in self.passive: passive_text += [ 'Start combat with {} strength.'.format( self.passive['starting_strength']) ] if 'strength_each_turn' in self.passive: passive_text += [ 'Gain {} strength at the start of each turn.'.format( self.passive['strength_each_turn']) ] if 'strength_per' in self.passive: if self.passive['strength_per'] == 'card': passive_text += ['Gain 1 strength each time a card is played.'] else: passive_text += [ 'Gain 1 strength each time a {} is played.'.format( ' or '.join(self.passive['strength_per'])) ] if 'block_each_turn' in self.passive: passive_text += [ 'Gain {} block at the start of each turn.'.format( self.passive['block_each_turn']) ] if 'instances' in self.passive: passive_text += [ 'Start combat with {} copies of this creature.'.format( self.passive['instances']) ] if 'no_block_expiration' in self.passive: passive_text += ['Block does not expire at end of turn.'] if 'starting_block' in self.passive: passive_text += [ 'Starts combat with {} block.'.format( self.passive['starting_block']) ] if 'consume_gold' in self.passive: passive_text += [ 'Consumes {} available gold each turn.'.format( self.passive['consume_gold']) ] if 'block_damage_multiplier' in self.passive: passive_text += [ 'If an attack is blocked, removes x{} block.'.format( self.passive['block_damage_multiplier']) ] if 'card_cost_change' in self.passive: passive_text += [ 'Cards that cost {} now cost {}.'.format( *self.passive['card_cost_change']) ] if 'block_convert_to_damage' in self.passive: passive_text += [ 'All block remaining at end of turn becomes damage to ALL players.' ] if 'spawn_spiders' in self.passive: d = self.passive['spawn_spiders'] if d['count'] == 1: word = 'spider' else: word = 'spiders' passive_text += [( 'Each turn, spawn {} {} with {} HP each. Each deal {} damage to ALL players per turn.' ).format(d['count'], word, d['hp'], d['damage_all'])] if 'lose_strength_on_attack' in self.passive: passive_text += ['Lose all strength on attack.'] return format_text_linebreaks(' '.join(passive_text), 40)