2020-05-21 00:42:02 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
using RobocraftX.Blocks;
|
2020-07-10 22:30:58 +00:00
|
|
|
|
using RobocraftX.Common;
|
2020-05-21 00:42:02 +00:00
|
|
|
|
using Gamecraft.CharacterVulnerability;
|
|
|
|
|
using Svelto.ECS;
|
|
|
|
|
using Unity.Mathematics;
|
|
|
|
|
|
|
|
|
|
using GamecraftModdingAPI;
|
|
|
|
|
using GamecraftModdingAPI.Utility;
|
|
|
|
|
|
|
|
|
|
namespace GamecraftModdingAPI.Blocks
|
|
|
|
|
{
|
|
|
|
|
public class SpawnPoint : Block
|
|
|
|
|
{
|
2020-07-13 19:55:48 +00:00
|
|
|
|
public SpawnPoint(EGID id) : base(id)
|
2020-05-21 00:42:02 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-10 22:30:58 +00:00
|
|
|
|
public SpawnPoint(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SPAWNPOINT_BLOCK_GROUP))
|
2020-05-21 00:42:02 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// custom spawn point properties
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The lives the player spawns in with.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public uint Lives
|
|
|
|
|
{
|
2020-07-15 19:58:24 +00:00
|
|
|
|
get => BlockEngine.GetBlockInfo(this, (SpawnPointStatsEntityStruct st) => st.lives);
|
2020-05-21 00:42:02 +00:00
|
|
|
|
|
2020-07-15 19:58:24 +00:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
BlockEngine.SetBlockInfo(this, (ref SpawnPointStatsEntityStruct st, uint val) => st.lives = val, value);
|
|
|
|
|
}
|
2020-05-21 00:42:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether the spawned player can take damage.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool Damageable
|
|
|
|
|
{
|
2020-07-15 19:58:24 +00:00
|
|
|
|
get => BlockEngine.GetBlockInfo(this, (SpawnPointStatsEntityStruct st) => st.canTakeDamage);
|
2020-05-21 00:42:02 +00:00
|
|
|
|
|
2020-07-15 19:58:24 +00:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
BlockEngine.SetBlockInfo(this, (ref SpawnPointStatsEntityStruct st, bool val) => st.canTakeDamage = val, value);
|
|
|
|
|
}
|
2020-05-21 00:42:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether the game over screen will be displayed
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool GameOverEnabled
|
|
|
|
|
{
|
2020-07-15 19:58:24 +00:00
|
|
|
|
get => BlockEngine.GetBlockInfo(this, (SpawnPointStatsEntityStruct st) => st.gameOverScreen);
|
2020-05-21 00:42:02 +00:00
|
|
|
|
|
2020-07-15 19:58:24 +00:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
BlockEngine.SetBlockInfo(this, (ref SpawnPointStatsEntityStruct st, bool val) => st.gameOverScreen = val, value);
|
|
|
|
|
}
|
2020-05-21 00:42:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The team id for players who spawn here.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public byte Team
|
|
|
|
|
{
|
2020-07-15 19:58:24 +00:00
|
|
|
|
get => BlockEngine.GetBlockInfo(this, (SpawnPointIdsEntityStruct st) => st.teamId);
|
2020-05-21 00:42:02 +00:00
|
|
|
|
|
2020-07-15 19:58:24 +00:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
BlockEngine.SetBlockInfo(this, (ref SpawnPointIdsEntityStruct st, byte val) => st.teamId = val, value);
|
|
|
|
|
}
|
2020-05-21 00:42:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|