public bool DamageBlock(float damage) { Type.Contents.ReduceHealth(damage); if (Type.Contents.Health <= 0) { Type = new BS_Empty(); return(false); } return(true); }
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); }