Beispiel #1
0
    public static void BloodSplat(Vector3 worldPos, BloodSplatSize splatSize, BloodSplatType bloodColorType)
    {
        EnsureInit();
        GameObject chosenTile = null;

        switch (bloodColorType)
        {
        case BloodSplatType.red:
            switch (splatSize)
            {
            case BloodSplatSize.small:
                chosenTile = smallBloodTile;
                break;

            case BloodSplatSize.medium:
                chosenTile = mediumBloodTile;
                break;

            case BloodSplatSize.large:
                chosenTile = largeBloodTile;
                break;

            case BloodSplatSize.Random:
                int rand = Random.Range(0, 3);
                BloodSplat(worldPos, (BloodSplatSize)rand, bloodColorType);
                return;
            }
            break;

        case BloodSplatType.green:
            switch (splatSize)
            {
            case BloodSplatSize.small:
                chosenTile = smallXenoBloodTile;
                break;

            case BloodSplatSize.medium:
                chosenTile = medXenoBloodTile;
                break;

            case BloodSplatSize.large:
                chosenTile = largeXenoBloodTile;
                break;

            case BloodSplatSize.Random:
                int rand = Random.Range(0, 3);
                BloodSplat(worldPos, (BloodSplatSize)rand, bloodColorType);
                return;
            }
            break;
        }

        if (chosenTile != null)
        {
            Spawn.ServerPrefab(chosenTile, worldPos,
                               MatrixManager.AtPoint(Vector3Int.RoundToInt(worldPos), true).Objects);
        }
    }
    public void BloodSplat(Vector3 worldPos, BloodSplatSize splatSize, BloodSplatType bloodColorType)
    {
        switch (bloodColorType)
        {
        case BloodSplatType.red:
            SpawnRedBlood(worldPos, splatSize);
            break;

        case BloodSplatType.green:
            SpawnXenoBlood(worldPos, splatSize);
            break;
        }
    }
Beispiel #3
0
 //Initial setting for blood type. Server only
 public void SetBloodType(DNAandBloodType dnaBloodType)
 {
     bloodType       = dnaBloodType;
     bloodSplatColor = dnaBloodType.BloodColor;
 }
    public static void BloodSplat(Vector3 worldPos, ReagentMix bloodReagents = default, BloodSplatSize splatSize = default, BloodSplatType bloodColorType = default)
    {
        EnsureInit();

        GameObject chosenTile;
        string     sizeDesc;


        if (bloodReagents.Total < SmallBleedThreshold)
        {
            chosenTile = smallBloodTile;
            sizeDesc   = "drop";
        }
        else if (bloodReagents.Total > SmallBleedThreshold && bloodReagents.Total < MedBleedThreshold)
        {
            chosenTile = mediumBloodTile;
            sizeDesc   = "splat";
        }
        else
        {
            chosenTile = largeBloodTile;
            sizeDesc   = "pool";
        }

        var bloodTileInst = Spawn.ServerPrefab(chosenTile, worldPos, MatrixManager.AtPoint(worldPos.CutToInt(), true).Objects, Quaternion.identity);

        if (bloodTileInst.Successful)
        {
            var colorDesc = TextUtils.ColorToString(bloodReagents.MixColor);
            bloodTileInst.GameObject.name = $"{colorDesc} blood {sizeDesc}";

            var bloodTileGO  = bloodTileInst.GameObject;
            var tileReagents = bloodTileGO.GetComponent <ReagentContainer>();
            if (bloodTileGO)
            {
                var decal = bloodTileGO.GetComponent <FloorDecal>();
                if (decal)
                {
                    decal.color = bloodReagents.MixColor;
                    tileReagents.Add(bloodReagents);
                }
            }
        }
    }