示例#1
0
    public bool DamageBlock(float damage)
    {
        Type.Contents.ReduceHealth(damage);
        if (Type.Contents.Health <= 0)
        {
            Type = new BS_Empty();

            return(false);
        }
        return(true);
    }
示例#2
0
文件: Map.cs 项目: sybrid1982/DFState
    private BlockState GetNewType(Point point)
    {
        BlockState returnType = new BS_Empty();

        if (sigmoidalInflectionPoint <= 0)
        {
            sigmoidalInflectionPoint = 1;
        }

        float sigmoidPoint = Sigmoid(point.x, sigmoidalInflectionPoint);

        float chanceToProduceSolidBlock = sigmoidPoint * blockChance;

        if (Random.Range(0f, 1f) < chanceToProduceSolidBlock)
        {
            returnType = new BS_Solid(GetNewContents());
        }

        return(returnType);
    }