BroodMother

class games.spiders.brood_mother.BroodMother

Bases: games.spiders.spider.Spider

The class representing the BroodMother in the Spiders game.

The Spider Queen. She alone can spawn Spiderlings for each Player, and if she dies the owner loses.

consume(spiderling: games.spiders.spiderling.Spiderling) → bool

Consumes a Spiderling of the same owner to regain some eggs to spawn more Spiderlings.

Parameters

spiderling (games.spiders.spiderling.Spiderling) – The Spiderling to consume. It must be on the same Nest as this BroodMother.

Returns

True if the Spiderling was consumed. False otherwise.

Return type

bool

property eggs

How many eggs the BroodMother has to spawn Spiderlings this turn.

Type

int

property game_object_name

String representing the top level Class that this game object is an instance of. Used for reflection to create new instances on clients, but exposed for convenience should AIs want this data.

Type

str

property health

How much health this BroodMother has left. When it reaches 0, she dies and her owner loses.

Type

int

property id

A unique id for each instance of a GameObject or a sub class. Used for client and server communication. Should never change value after being set.

Type

str

property is_dead

If this Spider is dead and has been removed from the game.

Type

bool

log(message: str) → None

Adds a message to this GameObject’s logs. Intended for your own debugging purposes, as strings stored here are saved in the gamelog.

Parameters

message (str) – A string to add to this GameObject’s log. Intended for debugging.

property logs

Any strings logged will be stored here. Intended for debugging.

Type

list[str]

property nest

The Nest that this Spider is currently on. None when moving on a Web.

Type

games.spiders.nest.Nest or None

property owner

The Player that owns this Spider, and can command it.

Type

games.spiders.player.Player

spawn(spiderling_type: str) → Optional[games.spiders.spiderling.Spiderling]

Spawns a new Spiderling on the same Nest as this BroodMother, consuming an egg.

Parameters

spiderling_type ('Spitter', 'Weaver', or 'Cutter') – The string name of the Spiderling class you want to Spawn. Must be ‘Spitter’, ‘Weaver’, or ‘Cutter’.

Returns

The newly spawned Spiderling if successful. None otherwise.

Return type

games.spiders.spiderling.Spiderling or None