core.components.ai module

class core.components.ai.AI[source]

Bases: object

A class for an AI model object. This object can be used to make combat decisions during battle.

make_decision(npc, opponent)[source]

Examples:

>>> npc
{'action': None,
 'monster': <core.monster.Monster instance at 0x7f9d80733680>,
 'monster_last_hp': 50,
 'monster_sprite': {'position': (960, 0), 'surface': <Surface(320x320x32 SW)>},
 'player': <core.player.Npc instance at 0x7f9d807338c0>}
>>> opponent
{'action': None,
 'monster': <core.monster.Monster instance at 0x7f9d80733a70>,
 'monster_last_hp': 30,
 'monster_level_text': {'font': <pygame.font.Font object at 0x7f9d8094b290>,
                        'position': (1210, 385),
                        'surface': <Surface(35x36x32 SW)>},
 'monster_sprite': {'position': (0, 280), 'surface': <Surface(320x320x32 SW)>},
 'player': <core.player.Player instance at 0x7f9d80977c20>}
class core.components.ai.PseudoAI(npc)[source]

Bases: object

A class to provide networking input to an opponents Npc object. This object can be used to push combat decisions during battle from one client to another.

make_decision(npc, opponent)[source]

Examples:

>>> npc
{'action': None,
 'monster': <core.monster.Monster instance at 0x7f9d80733680>,
 'monster_last_hp': 50,
 'monster_sprite': {'position': (960, 0), 'surface': <Surface(320x320x32 SW)>},
 'player': <core.player.Npc instance at 0x7f9d807338c0>}
>>> opponent
{'action': None,
 'monster': <core.monster.Monster instance at 0x7f9d80733a70>,
 'monster_last_hp': 30,
 'monster_level_text': {'font': <pygame.font.Font object at 0x7f9d8094b290>,
                        'position': (1210, 385),
                        'surface': <Surface(35x36x32 SW)>},
 'monster_sprite': {'position': (0, 280), 'surface': <Surface(320x320x32 SW)>},
 'player': <core.player.Player instance at 0x7f9d80977c20>}