A stable modding interface between Techblox and mods https://mod.exmods.org/
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

79 строки
1.8KB

  1. using System;
  2. using RobocraftX.Blocks;
  3. using RobocraftX.Common;
  4. using Gamecraft.CharacterVulnerability;
  5. using Svelto.ECS;
  6. using Unity.Mathematics;
  7. using TechbloxModdingAPI;
  8. using TechbloxModdingAPI.Utility;
  9. namespace TechbloxModdingAPI.Blocks
  10. {
  11. public class SpawnPoint : Block
  12. {
  13. public SpawnPoint(EGID id) : base(id)
  14. {
  15. }
  16. public SpawnPoint(uint id) : base(new EGID(id, CommonExclusiveGroups.SPAWNPOINT_BLOCK_GROUP))
  17. {
  18. }
  19. // custom spawn point properties
  20. /// <summary>
  21. /// The lives the player spawns in with.
  22. /// </summary>
  23. public uint Lives
  24. {
  25. get => BlockEngine.GetBlockInfo<SpawnPointStatsEntityStruct>(this).lives;
  26. set
  27. {
  28. BlockEngine.GetBlockInfo<SpawnPointStatsEntityStruct>(this).lives = value;
  29. }
  30. }
  31. /// <summary>
  32. /// Whether the spawned player can take damage.
  33. /// </summary>
  34. public bool Damageable
  35. {
  36. get => BlockEngine.GetBlockInfo<SpawnPointStatsEntityStruct>(this).canTakeDamage;
  37. set
  38. {
  39. BlockEngine.GetBlockInfo<SpawnPointStatsEntityStruct>(this).canTakeDamage = value;
  40. }
  41. }
  42. /// <summary>
  43. /// Whether the game over screen will be displayed
  44. /// </summary>
  45. public bool GameOverEnabled
  46. {
  47. get => BlockEngine.GetBlockInfo<SpawnPointStatsEntityStruct>(this).gameOverScreen;
  48. set
  49. {
  50. BlockEngine.GetBlockInfo<SpawnPointStatsEntityStruct>(this).gameOverScreen = value;
  51. }
  52. }
  53. /// <summary>
  54. /// The team id for players who spawn here.
  55. /// </summary>
  56. public byte Team
  57. {
  58. get => BlockEngine.GetBlockInfo<SpawnPointIdsEntityStruct>(this).teamId;
  59. set
  60. {
  61. BlockEngine.GetBlockInfo<SpawnPointIdsEntityStruct>(this).teamId = value;
  62. }
  63. }
  64. }
  65. }