private void actionKeyMappingAbility_ActionTriggered(object sender, ActionTriggeredEventArgs e) { var abilityIndex = e.Action.Id - 12; if (abilityIndex == -1) { if (world.PerformAbility(CharacterPowerIdentity.DefaultAttack, world.PlayerCharacter)) { network.PerformAbility(world.PlayerCharacter, CharacterPowerIdentity.DefaultAttack); } } else { if (world.PlayerCharacter.Powers.Count > abilityIndex) { CharacterPowerIdentity abilityId = world.PlayerCharacter.Powers[abilityIndex]; if (world.PerformAbility(abilityId, world.PlayerCharacter)) { network.PerformAbility(world.PlayerCharacter, abilityId); } } } }