Blast_ActorSplitsAfterTriangleDamage.py 1.2 KB

1234567891011121314151617181920212223242526
  1. """
  2. Copyright (c) Contributors to the Open 3D Engine Project.
  3. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. SPDX-License-Identifier: Apache-2.0 OR MIT
  5. """
  6. def Blast_ActorSplitsAfterTriangleDamage():
  7. from BaseDamageTest import base_run as internal_run
  8. from BlastUtils import Constants
  9. def TriangleDamage(target_id, position):
  10. # Some points that form a triangle that contains the given position
  11. position0 = azlmbr.object.construct('Vector3', position.x, position.y + 1.0, position.z)
  12. position1 = azlmbr.object.construct('Vector3', position.x + 1.0, position.y - 1.0, position.z)
  13. position2 = azlmbr.object.construct('Vector3', position.x - 1.0, position.y - 1.0, position.z)
  14. azlmbr.destruction.BlastFamilyDamageRequestBus(azlmbr.bus.Event, "Triangle Damage", target_id,
  15. position0, position1, position2,
  16. Constants.DAMAGE_AMOUNT)
  17. internal_run(TriangleDamage)
  18. if __name__ == "__main__":
  19. from editor_python_test_tools.utils import Report
  20. Report.start_test(Blast_ActorSplitsAfterTriangleDamage)