Determine damage causer

game_action_causer is a marker interface. I haven’t worked with it myself but it looks like the only class currently implementing the interface is fort_character. I suspect that in the future as the APIs are expanded other classes like weapon and vehicle will also implement this interface.

To work with damaged_result you would attempt to cast the game_action_causer to different types to determine what type of object caused damage to the player. For example:

OnDamaged(DamagedEvent:damaged_event):void =
    if (CauserCharacter := fort_character[DamagedEvent.Source?]):
        # Game code...
3 Likes