Ejemplo n.º 1
0
def GivePlayerItemAmountSpecifiedByFlagValue(item_type: ItemType,
                                             item: ItemTyping, flag: FlagInt,
                                             bit_count: int):
    """Gives player some amount of items read from a flag array. Probably used when taking items out of storage
    (i.e. the reverse of the above instruction)."""
    instruction_info = (2003, 43)
    return to_numeric(instruction_info, item_type, item, flag, bit_count)
Ejemplo n.º 2
0
def AddSpecialEffect_WithUnknownEffect(character: CharacterTyping,
                                       special_effect: int,
                                       affect_npc_parts_hp: bool):
    """Unknown additional affect from the standard instruction, presumably."""
    instruction_info = (2004, 55)
    return to_numeric(instruction_info, character, special_effect,
                      affect_npc_parts_hp)
Ejemplo n.º 3
0
def GotoIfClientTypeCountComparison(label: Label, client_type: ClientType,
                                    comparison_type: ComparisonType,
                                    value: int):
    """Value from 0 to 4."""
    instruction_info = (1003, 15, [0, 0, 0, 0])
    return to_numeric(instruction_info, label, client_type, comparison_type,
                      value)
Ejemplo n.º 4
0
def SetBossHealthBarState(character: CharacterTyping, name: EventTextTyping,
                          slot, state: bool):
    """Note: slot number can be 0-2 in Bloodborne."""
    instruction_info = (2003, 11)
    if isinstance(slot, int) and slot not in (0, 1, 2):
        raise ValueError("Boss health bar slot must be 0, 1, or 2.")
    return to_numeric(instruction_info, state, character, slot, name)
Ejemplo n.º 5
0
def PlayLogParameterOutput(
    category: PlayerPlayLogParameter,
    name: StringOffsetTyping,
    output_multiplayer_state: PlayLogMultiplayerType,
):
    instruction_info = (2013, 4, [0, 0, 0])
    return to_numeric(instruction_info, category, name,
                      output_multiplayer_state)
Ejemplo n.º 6
0
def HandleMinibossDefeat(miniboss_id: int):
    """Called instead of `KillBoss` for bosses that aren't the final boss of the area.

    Note that outside of Chalice Dungeons, this is ONLY used when you have defeated Gehrman and are about to fight Moon
    Presence.
    """
    instruction_info = (2003, 15, [0])
    return to_numeric(instruction_info, miniboss_id)
Ejemplo n.º 7
0
def SetBossMusicState(sound_id: int, state: bool):
    """Not sure how this differs from the standard map sound instructions, but my guess is that it fades the music out
    rather than abruptly stopping it.

    TODO: Can probably be used to fade out ANY music. Not sure why it would only work for boss music.
    TODO: Argument -1 is sometimes used. Fades out ALL music?
    """
    instruction_info = (2010, 4, [0, 0])
    return to_numeric(instruction_info, sound_id, state)
Ejemplo n.º 8
0
def IfActionButtonParam(condition: int, action_button_id: int,
                        entity: CoordEntityTyping):
    """Streamlined version of `IfActionButton` that uses information from an `ActionButtonParam` entry.

    Note that the original `IfActionButton` is NEVER used in Bloodborne in favor of this param system. I'm not sure if
    the original instruction works, but it probably does.
    """
    instruction_info = (3, 24, [0, -1, -1])
    return to_numeric(instruction_info, condition, action_button_id, entity)
Ejemplo n.º 9
0
def IfPlayerArmorType(
    condition: int,
    armor_type: ArmorTyping,
    required_armor_range_first: ArmorTyping,
    required_armor_range_last: ArmorTyping,
):
    instruction_info = (3, 25, [0])
    return to_numeric(instruction_info, condition, armor_type,
                      required_armor_range_first, required_armor_range_last)
Ejemplo n.º 10
0
def SkipLinesIfClientTypeCountComparison(
    skip_lines: int,
    client_type: ClientType,
    comparison_type: ComparisonType,
    value: int,
):
    """Value from 0 to 4."""
    instruction_info = (1003, 14, [0, 0, 0, 0])
    return to_numeric(instruction_info, skip_lines, client_type,
                      comparison_type, value)
Ejemplo n.º 11
0
def SummonNPC(
    sign_type: tp.Union[SingleplayerSummonSignType, int],
    character: CharacterTyping,
    region: RegionTyping,
    summon_flag: FlagInt,
    dismissal_flag: FlagInt,
):
    instruction_info = (2003, 51)
    return to_numeric(instruction_info, sign_type, character, region,
                      summon_flag, dismissal_flag)
Ejemplo n.º 12
0
def SetMapHitGridCorrespondence(
    collision: CollisionTyping,
    level: int,
    grid_coord_x: int,
    grid_coord_y: int,
    state: bool,
):
    instruction_info = (2003, 45)
    return to_numeric(instruction_info, collision, level, grid_coord_x,
                      grid_coord_y, state)
Ejemplo n.º 13
0
def ReturnIfClientTypeCountComparison(
    event_return_type: EventReturnType,
    client_type: ClientType,
    comparison_type: ComparisonType,
    value: int,
):
    """Value from 0 to 4."""
    instruction_info = (1003, 16, [0, 0, 0, 0])
    return to_numeric(instruction_info, event_return_type, client_type,
                      comparison_type, value)
Ejemplo n.º 14
0
def IfAttackedWithDamageType(
    condition: int,
    attacked_entity: AnimatedTyping,
    attacker: CharacterTyping = -1,
    damage_type: DamageType = DamageType.Unspecified,
):
    """Similar to `IfAttacked` (which is still used sometimes), but optionally can require a certain `DamageType`."""
    instruction_info = (3, 23, [0, 0, -1, 0])
    return to_numeric(instruction_info, condition, attacked_entity, attacker,
                      damage_type)
Ejemplo n.º 15
0
def AddSpecialEffect(character: CharacterTyping, special_effect_id: int,
                     affect_npc_part_hp: bool):
    """'Special effect' as in a buff/debuff, not graphical effects (though they may come with one). This will do
    nothing if the character already has the special effect active (i.e. they do not stack or even reset timers).

    The Bloodborne version has an additional argument that determines whether any HP changes caused by the special
    effect should also affect NPC parts.
    """
    instruction_info = (2004, 8)
    return to_numeric(instruction_info, character, special_effect_id,
                      affect_npc_part_hp)
Ejemplo n.º 16
0
def PlayCutsceneAndRandomlyWarpPlayer_WithUnknownEffect2(
    condition: int,
    cutscene_type: CutsceneType,
    first_region: RegionTyping,
    last_region: RegionTyping,
    game_map: MapTyping,
):
    instruction_info = (2002, 7)
    area_id, block_id = tuple(game_map)
    return to_numeric(instruction_info, condition, cutscene_type, first_region,
                      last_region, area_id, block_id)
Ejemplo n.º 17
0
def ActivateObjectWithSpecificCharacter(
    obj: ObjectTyping,
    objact_id: int,
    relative_index: int,
    character: CharacterTyping,
):
    """The standard version of this 'grabs' the nearest character and uses them in the ObjAct (e.g. Patches pulling the
    lever in the Catacombs in DS1). I presume this version lets you specify which character should be involved in the
    ObjAct."""
    instruction_info = (2005, 16, [-1, 0, 0, -1])
    return to_numeric(instruction_info, obj, objact_id, relative_index,
                      character)
Ejemplo n.º 18
0
def Unknown_2003_48(
    entity: AnimatedTyping,
    arg1: int,
    model_point: int,
    magic_id: int,
    shoot_angle_x: int,
    shoot_angle_y: int,
    shoot_angle_z: int,
):
    instruction_info = (2003, 48)
    return to_numeric(instruction_info, entity, arg1, model_point, magic_id,
                      shoot_angle_x, shoot_angle_y, shoot_angle_z)
Ejemplo n.º 19
0
def RotateToFaceEntity(
    character: CharacterTyping,
    target_entity: CoordEntityTyping,
    animation: int,
    wait_for_completion: bool = False,
):
    """Rotate a character to face a target map entity of any type.
    WARNING: This instruction will crash its event script (silently) if used on a disabled character! (In DS1 at least.)

    The Bloodborne version allows you to force an animation at the same time (post-rotation) and optionally wait until
    that animation is completed. (I assume a value of -1 avoids it.)
    """
    instruction_info = (2004, 14, [0, 0, -1, 0])
    return to_numeric(instruction_info, character, target_entity, animation,
                      wait_for_completion)
Ejemplo n.º 20
0
def RegisterLantern(
    flag: FlagInt,
    obj: ObjectTyping,
    reaction_distance: float,
    reaction_angle: float,
    initial_sword_number: int = 0,
    sword_level: int = 0,
):
    """Register a Lantern. Used instead of the bonfire registration.

    No idea what the 'sword' arguments do, but they default to zero and are always zero when this is called.
    """
    instruction_info = (2009, 5)
    return to_numeric(instruction_info, flag, obj, reaction_distance,
                      reaction_angle, initial_sword_number, sword_level)
Ejemplo n.º 21
0
def Test_RequestRagdollRestraint(
    recipient_character: CharacterTyping,
    recipient_target_rigid_index: int,
    recipient_model_point: int,
    attachment_character: CharacterTyping,
    attachment_target_rigid_index: int,
    attachment_model_point: int,
):
    instruction_info = (2004, 51)
    return to_numeric(
        instruction_info,
        recipient_character,
        recipient_target_rigid_index,
        recipient_model_point,
        attachment_character,
        attachment_target_rigid_index,
        attachment_model_point,
    )
Ejemplo n.º 22
0
def EventValueOperation(
    source_flag: FlagInt,
    source_flag_bit_count: int,
    operand: int,
    target_flag: FlagInt,
    target_flag_bit_count: int,
    calculation_type: CalculationType,
):
    """Performs a binary operation on the source flag and operand value, and stores the result in the target flag."""
    instruction_info = (2003, 41)
    return to_numeric(
        instruction_info,
        source_flag,
        source_flag_bit_count,
        operand,
        target_flag,
        target_flag_bit_count,
        calculation_type,
    )
Ejemplo n.º 23
0
def PlayCutsceneAndMovePlayerAndSetTimePeriod(
    cutscene: int,
    cutscene_type: CutsceneType,
    move_to_region: RegionTyping,
    move_to_map: MapTyping,
    player_id: int,
    time_period_id: int,
):
    """Warp a particular player to a region and set the time period. I assume that this must be a map that is
    already loaded, like in DS1, but possibly not.

    It's used only twice: to play the cutscene when you first reach Cathedral Ward (time period 1) and when you examine
    Laurence's skull after defeating Vicar Amelia (time period 2). It's NOT used after you defeat Rom, when the blood
    moon begins. The time period ID may in fact be unused.
    """
    instruction_info = (2002, 6)
    area_id, block_id = tuple(move_to_map)
    return to_numeric(instruction_info, cutscene, cutscene_type,
                      move_to_region, area_id, block_id, player_id,
                      time_period_id)
Ejemplo n.º 24
0
def RotateToFaceEntity(character: CharacterTyping, target_entity: CoordEntityTyping):
    """ Rotate a character to face a target map entity of any type.
    WARNING: This instruction will crash its event script (silently) if used on a disabled character! (In DS1 at least.)
    """
    instruction_info = (2004, 14)
    return to_numeric(instruction_info, character, target_entity)
Ejemplo n.º 25
0
def RegisterHealingFountain(flag: FlagInt, obj: ObjectTyping):
    """ No idea what this is. Clearly unused. The Bloodborne version has more arguments. """
    instruction_info = (2009, 5)
    return to_numeric(instruction_info, flag, obj)
Ejemplo n.º 26
0
def AddSpecialEffect(character: CharacterTyping, special_effect_id: int):
    """ 'Special effect' as in a buff/debuff, not graphical effects (though they may come with one). This will do
    nothing if the character already has the special effect active (i.e. they do not stack or even reset timers). """
    instruction_info = (2004, 8)
    return to_numeric(instruction_info, character, special_effect_id)
Ejemplo n.º 27
0
def ActivateKillplaneForModel(game_map: MapTyping, y_threshold, target_model_id):
    """ Not used much. Activates a horizontal killplane that only affects a particular model ID. """
    instruction_info = (2003, 41)
    return to_numeric(instruction_info, game_map.area_id, game_map.block_id, y_threshold, target_model_id)
Ejemplo n.º 28
0
def IfMultiplayerState(condition: int, state: MultiplayerState):
    instruction_info = (3, 6)
    return to_numeric(instruction_info, condition, state)
Ejemplo n.º 29
0
def ReturnIfMultiplayerState(event_return_type: EventReturnType, state: MultiplayerState):
    instruction_info = (1003, 6)
    return to_numeric(instruction_info, event_return_type, state)
Ejemplo n.º 30
0
def SkipLinesIfMultiplayerState(line_count, state: MultiplayerState):
    instruction_info = (1003, 5)
    return to_numeric(instruction_info, line_count, state)