//	PX PY PZ - current point to modify
//	MX MY    - modifier position
//	MH MR    - modifier height and radius
//	MAXZ     - max z value of the grid
//	MINZ     - min z value of the grid
//	PI       - pigreco 3.14 etc etc
//
//	NEWZ     - when you want, load here the new value for Z


beginSETUP
// MODE 'Add' can be applied
fl_modeAdd	= 0

// MODE 'Compare' can be applied
fl_modeCompare	= 0

// MODE 'Force' can be applied
fl_modeForce	= 1

// Computes points only within modifier square radius
fl_squareRadius	= 0

// Computes points only within modifier radius
fl_Radius	= 0

// Height can't never be negative
fl_positiveHeight	= 1

description = Applies to whole terrain.\n\nUse if you have too high mountains and you want to level them to a lower height without brutally cutting their tops.\n\nModifier height: the new lower height.\nModifier radius: the range of smoothness (is along Z axis!)
endSETUP



beginCODE

	mov ref,MH
	sub ref,MR

	cmp ref,PZ
	jl doit_1
	abort
	doit_1:
	cmp MH,MAXZ
	jl doit
	abort
	doit:

	mov alfa,PZ
	sub alfa,ref

	mov beta,MAXZ
	sub beta,ref

	div alfa,beta
	mul alfa,MR
	add alfa,ref

	mov NEWZ,alfa

endCODE
