Status, Summon and Support

from dgisim import Status, Summon, Support

Status is the superclass of Summon and Support.

Status is used to implement all statuses in the game, character statuses, combat statuses…

Summon and Support, as their names suggest, corresponds to the implementation of summons and supports.

The way how each individual status (summon or support) is implemented can be vastly different to each other, please check the source code for more information.

For simple usages, you only need to access the attributes of each status without calling any methods.

class Status
REACTABLE_SIGNALS: ClassVar[frozenset[dgisim.effect.enums.TriggeringSignal]] = frozenset({})

The set of signals the status may react to. This is used to improve the performance.

add(other: type[typing_extensions.Self]) None | Self

Defines how the status update itself with the addition of the same type.

encoding(encoding_plan: EncodingPlan) list[int]
Returns:

the encoding of the content of the status. (excluding the type of status)

classmethod has_perspective_view() bool

Returns True if the status has a perspective view.

inform(game_state: GameState, status_source: StaticTarget, info_type: Informables, information: InformableEvent) GameState
Parameters:
  • game_state – the current game state.

  • status_source – the position of this status.

  • info_type – the type of information.

  • information – the information.

Returns:

the updated game state.

perspective_view() Self

Returns the self in the eyes of the opponent, hiding relevant information.

preprocess(game_state: GameState, status_source: StaticTarget, item: PreprocessableEvent, signal: Preprocessables) tuple[PreprocessableEvent, None | Self]
Parameters:
  • game_state – the current game state.

  • status_source – the position of this status.

  • item – data to be preprocessed.

  • signal – proprocessing signal.

Returns:

the preprocessed PreprocessableEvent and updated self. If None is returned instead of a new self, then the status is removed.

react_to_signal(game_state: GameState, source: StaticTarget, signal: TriggeringSignal, detail: None | InformableEvent = None) list[eft.Effect]
Parameters:
  • game_state – the current game state.

  • source – the status position in the game.

  • signal – the triggering signal.

  • silent – ignores some post checkers if True. (just leave it as False)

Returns:

a list of effects generated.

update(other: Self) None | Self

Defines how the status update itself with an incoming status of the same type.

class Summon(*, usages: 'int' = -1)

Bases: Status

class Support(*, sid: 'int')

Bases: Status

sid: int

a unique identifier for each support, used to distinguish supports of the same type.

The implementations of Status, Summon and Support could be imported from:

from dgisim.status import *
from dgisim.summon import *
from dgisim.support import *

There are too many statuses implemented, so the details will not be elaborated here. Please refer to the source code for more information.