#NEWLINE# def initialise_factories( self , context ) : #NEWLINE# #INDENT# '\n        Initialises action factory, sub factories and various generators\n        ' #NEWLINE# dying_rules = Dying ( ) #NEWLINE# move_factory = MoveFactory ( self . level_generator_factory , dying_rules ) #NEWLINE# effect_config = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# configurators = self . get_configurators ( context . config_package , 'init_effects' ) #NEWLINE# for configurator in configurators : #NEWLINE# #INDENT# effects = configurator ( context ) #NEWLINE# for effect in effects : #NEWLINE# #INDENT# effect_config [ effect [ 0 ] ] = effect [ 1 ] #NEWLINE# #UNINDENT# #UNINDENT# effect_factory = get_effect_creator ( effect_config ) #NEWLINE# unarmed_combat_factory = UnarmedCombatFactory ( effect_factory , dying_rules ) #NEWLINE# melee_combat_factory = MeleeCombatFactory ( effect_factory , dying_rules ) #NEWLINE# ranged_combat_factory = RangedCombatFactory ( effect_factory , dying_rules ) #NEWLINE# attack_factory = AttackFactory ( [ unarmed_combat_factory , melee_combat_factory , ranged_combat_factory ] ) #NEWLINE# drink_factory = DrinkFactory ( effect_factory , dying_rules ) #NEWLINE# inventory_factory = InventoryFactory ( [ PickUpFactory ( ) , DropFactory ( ) , EquipFactory ( ) , UnEquipFactory ( ) ] ) #NEWLINE# wait_factory = WaitFactory ( ) #NEWLINE# spell_factory = SpellGenerator ( ) #NEWLINE# spell_casting_factory = SpellCastingFactory ( spell_factory , effect_factory , dying_rules ) #NEWLINE# mitosis_factory = MitosisFactory ( self . creature_generator , self . rng , 60 , dying_rules ) #NEWLINE# metamorphosis_factory = MetamorphosisFactory ( self . creature_generator , self . rng ) #NEWLINE# dig_factory = DigFactory ( self . rng ) #NEWLINE# trapping_factory = TrappingFactory ( self . trap_generator ) #NEWLINE# self . action_factory = ActionFactory ( self . model , [ move_factory , attack_factory , drink_factory , inventory_factory , wait_factory , spell_casting_factory , mitosis_factory , metamorphosis_factory , dig_factory , trapping_factory ] ) #NEWLINE# set_action_factory ( self . action_factory ) #NEWLINE# self . rules_engine = RulesEngine ( self . action_factory , effect_config )