
^Husk:
	Health:
		HP: 10000	

dummyShrapnelThrower:
	Inherits: ^Dummy
	KillsSelf:
		Delay: 0
	HitShape:
		Type: Circle
			Radius: 16
	Health:
		HP: 1
	ThrowsShrapnel@derbis:
		Weapons: Debris, Debris2, debris_vehicle01, debris_vehicle02, DeathHandClusterDebris
		Pieces: 5, 10
		Range: 1c0, 6c0

^VehicleHusk:
	Inherits: ^Husk
	Husk:
		AllowedTerrain: Sand, Rock, Transition, Concrete, Spice, SpiceSand, SpiceBlobs, Dune
	Targetable:
		TargetTypes: Ground, Vehicle
		RequiresForceFire: true
	-WithColoredOverlay@IDISABLE:
	WithColoredOverlay@deadPallete:
		Palette: huskPalette
	Explodes:
		Weapon: huskExplode01
		EmptyWeapon: huskExplode01
		Chance: 70
	WithIdleOverlay@Burns:
		Image: fire
		Sequence: 1
		IsDecoration: True
	ChangesHealth:
		Step: -70
		StartIfBelow: 101
		Delay: 4

^AircraftHusk:
	FallsToEarth:
		Explosion: ExplosionAircraft
	HitShape:
		Type: Rectangle
			TopLeft: -512, -512
			BottomRight: 512, 512

carryall.husk:
	Inherits: ^AircraftHusk
	Tooltip:
		Name: Carryall
	Aircraft:
		TurnSpeed: 4
		Speed: 95
		CanSlide: True
		VTOL: true
	RenderSprites:
		Image: carryall
	FallsToEarth:
		MaximumSpinSpeed: 14
		Explosion: ExplosionAircraft
	AmbientSound:
		SoundFiles: explosion_Carryall.wav
		Interval: 5000
	SpawnActorOnDeath@carry:
		Actor: carryall.husk_on_land
		OwnerType: InternalName
	Contrail@1:
		Offset: -300,-383,0
		Color: 000000
		UsePlayerColor:	false
	Contrail@2:
		Offset: -598,383,0
		Color: 000000
		UsePlayerColor:	false

ornithopter.husk:
	Inherits: ^AircraftHusk
	Tooltip:
		Name: Ornithopter
	Aircraft:
		TurnSpeed: 20
		Speed: 190
	FallsToEarth:
		MaximumSpinSpeed: 1
		Explosion: ExplosionAircraft
		Velocity: 0c35
	RenderSprites:
		Image: ornithopter
	Contrail@1:
		Offset: -300,-383,0
		Color: 000000
		TrailWidth: 0c128
		UsePlayerColor:	false
	Contrail@2:
		Offset: -598,383,0
		Color: 000000
		TrailWidth: 0c80
		UsePlayerColor:	false
	SpawnActorOnDeath:
		Actor: dummyShrapnelThrower
	AmbientSound@falldown:
		SoundFiles: ornithroperFall01.wav
		Delay: 10


rotor:
	Inherits: ^AircraftHusk
	-WithFacingSpriteBody:
	WithIdleOverlay:
		Image: debris_rotor_anim
		Sequence: idle
	FallsToEarth:
		MaximumSpinSpeed: 2
		Explosion: debris.rotor
		Velocity: 0c35
	Aircraft:
		TurnSpeed: 16
		Speed: 144
		CanSlide: True
		VTOL: true

rotor.flyingdown:
	Inherits: ^AircraftHusk
	-WithFacingSpriteBody:
	Aircraft:
		TurnSpeed: 16
		Speed: 144
		CanSlide: True
	RenderSprites:
		Image: debris_rotor_anim
		Palette: palette_d2k
	FallsToEarth:
		Explosion: ExplosionWithDamege_large

carryall.huskVTOL_reinforce:
	Inherits: carryall.huskVTOL
	SpawnActorOnDeath:
		Actor: carryall.husk_on_land
		OwnerType: InternalName

carryall.husk_on_land:
	Inherits: ^VehicleHusk
	Health:
		HP: 10000
	-WithColoredOverlay@deadPallete:
	WithIdleOverlay@Burns:
		Image: fire_slow
		Sequence: 1
		IsDecoration: True
		Palette: effect
	WithIdleOverlay@Smoke:
		Image: smoke_m
		Sequence: smokLandFromR_idle
		StartSequence: smokLandFromRA_Open
		Palette: disabled
		IsDecoration: True
		Offset: 512, 0, 512
	RenderSprites:
		Image: carryall.husk_on_land # USE ONLY '_' UperCase dont work
	ThrowsShrapnel:
		Weapons: Debris3, Debris4
		Pieces: 1, 4
		Range: 1c0, 3c0


carryall.huskVTOL:
	Inherits: ^AircraftHusk
	Tooltip:
		Name: Carryall
	FallsToEarth:
	Aircraft:
		TurnSpeed: 16
		CanSlide: True
		VTOL: true
	RenderSprites:
		Image: carryall


siege_tank.husk:
	Inherits: ^VehicleHusk
	Health:
		HP: 10000
	Tooltip:
		Name: Siege Tank (Destroyed)
	-ThrowsParticle@turret:
	TransformOnCapture:
		IntoActor: siege_tank
	WithIdleOverlay@Burns:
		Image: fire
		StartSequence: 2
		Sequence: 1
		IsDecoration: True

^combat_tank.husk:
	Inherits: ^VehicleHusk
	Health:
		HP: 12000
	Tooltip:
		Name: Combat Tank (Destroyed)
	ThrowsParticle@turret:
		Anim: turret
		TurnSpeed: 10

combat_tank_a.husk:
	-ThrowsParticle@turret:

combat_tank_a.husk02:
	Inherits: ^combat_tank.husk 
	Health:
		HP: 10000
	WithIdleOverlay@Burns:
		Image: smoke_m
		Sequence: smokeFromRA01loop
		IsDecoration: True
	ThrowsParticle@turret:

combat_tank_a.husk03:
	Inherits: ^combat_tank.husk
	Health:
		HP: 13000
	WithIdleOverlay@Burns:
		Image: smoke_m
		Sequence: smokeFromRA01loop
		IsDecoration: True
	ThrowsParticle@turret:
		Anim: turret
		MinThrowRange:	0c112
		MaxThrowRange:	1c768
		MinThrowAngle:	30	
		MaxThrowAngle:	150
		Velocity: 50
		TurnSpeed: 50

combat_tank_a.husk04:
	Inherits: ^combat_tank.husk
	Health:
		HP: 9000
	WithIdleOverlay@Burns:
		Image: smoke_m
		Sequence: smokLandFromR_idle
		StartSequence: smokLandFromRA_Open
		Palette: disabled
		IsDecoration: True
		Offset: -512, 0, 312
	ThrowsParticle@turret:
		Anim: turret
		MinThrowRange:	0c512
		MaxThrowRange:	1c768
		MinThrowAngle:	150	
		MaxThrowAngle:	240
		Velocity: 40
		TurnSpeed: 100

combat_tank_h.husk:
	-ThrowsParticle@turret:

combat_tank_h.husk02:
	Inherits: ^combat_tank.husk 
	Health:
		HP: 13000
	WithIdleOverlay@Burns:
		Image: fire
		Sequence: 2
		IsDecoration: True
	ThrowsParticle@turret:


combat_tank_h.husk03:
	Inherits: ^combat_tank.husk
	Health:
		HP: 11000
	WithIdleOverlay@Burns:
		Image: smoke_m
		Sequence: smokeFromRA01loop
		IsDecoration: True
	ThrowsParticle@turret:
		Anim: turret
		MinThrowRange:	0c512
		MaxThrowRange:	4c768
		MinThrowAngle:	20	
		MaxThrowAngle:	120
		Velocity: 50
		TurnSpeed: 50

combat_tank_h.husk04:
	Inherits: ^combat_tank.husk
	Health:
		HP: 9000
	WithIdleOverlay@Burns:
		Image: smoke_m
		Sequence: smokLandFromR_idle
		StartSequence: smokLandFromRA_Open
		Palette: disabled
		IsDecoration: True
		Offset: -512, 0, 312
	ThrowsParticle@turret:
		Anim: turret
		MinThrowRange:	0c512
		MaxThrowRange:	3c768
		MinThrowAngle:	150	
		MaxThrowAngle:	240
		Velocity: 40
		TurnSpeed: 20

combat_tank_o.husk:
	-ThrowsParticle@turret:

combat_tank_o.husk02:
	Inherits: ^combat_tank.husk 
	Health:
		HP: 15000
	WithIdleOverlay@Burns:
		Image: fire
		Sequence: 2
		IsDecoration: True
	-ThrowsParticle@turret:


combat_tank_o.husk03:
	Inherits: ^combat_tank.husk
	Health:
		HP: 9000
	WithIdleOverlay@Burns:
		Image: smoke_m
		Sequence: smokeFromRA01loop
		IsDecoration: True
	ThrowsParticle@turret:
		Anim: turret
		MinThrowRange:	1c0
		MaxThrowRange:	3c768
		MinThrowAngle:	30	
		MaxThrowAngle:	150
		Velocity: 50
		TurnSpeed: 50

combat_tank_o.husk04:
	Inherits: ^combat_tank.husk
	Health:
		HP: 12000
	WithIdleOverlay@Burns:
		Image: smoke_m
		Sequence: smokLandFromR_idle
		StartSequence: smokLandFromRA_Open
		Palette: disabled
		IsDecoration: True
		Offset: 20, -30, 300
	ThrowsParticle@turret:
		Anim: turret
		MinThrowRange:	0c512
		MaxThrowRange:	3c768
		MinThrowAngle:	60	
		MaxThrowAngle:	170
		Velocity: 40
		TurnSpeed: 20

devastator.husk:
	Inherits: ^VehicleHusk
	Health:
		HP: 12500
	Tooltip:
		Name: Devastator (Destroyed)
	TransformOnCapture:
		IntoActor: devastator

missile_tank.husk:
	Inherits: ^VehicleHusk

deviator.husk:
	Inherits: ^VehicleHusk
	ProximityExternalCondition@isHuskAlive:
		Condition: devation_husk_still_alive
		Range: 2c112
		MaximumVerticalOffset: 1c0
		AffectsParent: true
		ValidRelationships: Ally, Neutral, Enemy
	Tooltip:
		Name: Deviator (Destroyed)
	TransformOnCapture:
		IntoActor: deviator
	WithIdleOverlay@Burns:
		Image: smoke_m
		Sequence: smoke_player
		Palette: deviatorgas
		IsPlayerPalette: True
		IsDecoration: True
		Offset: -100, -200, 312



^dummygas:
	Inherits:^Dummy
	ExternalCondition@huskCheck:
		Condition: devation_husk_still_alive
	Explodes:
		Weapon: DeviatorGas
		EmptyWeapon: DeviatorGas
		RequiresCondition: devation_husk_still_alive
	KillsSelf:
		Delay: 10
	HitShape:
		Type: Circle
			Radius: 16
	Health:
		HP: 1

dummygas01:
	Inherits: ^dummygas
	KillsSelf:
		Delay: 100

dummygas02:
	Inherits: ^dummygas
	KillsSelf:
		Delay: 130

dummygas03:
	Inherits: ^dummygas
	KillsSelf:
		Delay: 160

dummygas04:
	Inherits: ^dummygas
	KillsSelf:
		Delay: 200

dummygas05:
	Inherits: ^dummygas
	KillsSelf:
		Delay: 250
dummygas06:
	Inherits: ^dummygas
	KillsSelf:
		Delay: 300
dummygas07:
	Inherits: ^dummygas
	KillsSelf:
		Delay: 350
#
# BUILDINGS HUSKS
#

^BuildingHusk:
	Inherits@1: ^SpriteActor
	GrantRandomCondition:
		Conditions: decoration01, decoration02, decoration03
	Interactable:
	Health:
		HP: 20000
	Armor:
		Type: wood
	FrozenUnderFog:

	Tooltip:
		GenericName: Destroyed Building
	WithSpriteBody:
	HitShape:
		UseTargetableCellsOffsets: true
		Type: Rectangle
			TopLeft: -512, -512
			BottomRight: 512, 512
	MapEditorData:
		Categories: Husk
	Targetable:
		TargetTypes: Ground, Vehicle
		RequiresForceFire: true
	Building:
		Dimensions: 1,1
		Footprint: x
		TerrainTypes: Rock, Concrete
	WithColoredOverlay@darker:
		Palette: huskBuilding
	WithBuildingBib:
	ChangesHealth:
		Step: -70
		StartIfBelow: 101
		Delay: 4
	ChangesHealth@damageidle:
		Step: -160
		StartIfBelow: 50
		Delay: 4
	Tooltip:
		Name: Building (destroyed)

windTrap.husk:
	Inherits: ^BuildingHusk
	RenderSprites:
		Image: husk_wind_trap.ordos
		FactionImages: 
			atreides: husk_wind_trap.atreides
			harkonnen: husk_wind_trap.harkonnen
	Health:
		HP: 27000
	Building:
		Footprint: xx xx ==
		Dimensions: 2,3
		LocalCenterOffset: 0,-512,0
	HitShape:
		Type: Rectangle
			TopLeft: -1024, -1024
			BottomRight: 1024, 1024
	WithIdleOverlay@smoke:
		Image: smoke_big
		Sequence: loop
		StartSequence: start
		Palette: disabled
		IsDecoration: True
		Offset: 250, 0, 312
		RequiresCondition: decoration02 || decoration03
	WithIdleOverlay@fire:
		Image: fire_fromts
		Palette: effect
		Sequence: 1
		IsDecoration: True
		Offset: 2000, 0, 0
		RequiresCondition: decoration01 || decoration02
	WithIdleOverlay@fire2:
		Image: fire_slow
		StartSequence: 1
		Sequence: 2
		IsDecoration: True
		Offset: 0,-512,0
		RequiresCondition: decoration01 || decoration03


refinery_ruins:
	Inherits: ^BuildingHusk
	Building:
		Dimensions: 3,3
		Footprint:=== === ===
		LocalCenterOffset: 0,-512,0
	WithIdleOverlay@smokeSmall:
		Image: smoke_m
		StartSequence: smokeFromRA01idle
		Sequence: smokeFromRA01loop
		IsDecoration: True
		Offset: 1024, 1500, 0
		Palette: huskPalette
		RequiresCondition: decoration01 ||  decoration02
	WithIdleOverlay@smokeCenter:
		Image: smoke_m
		StartSequence: smokeFromRA01idle
		Sequence: smokeFromRA01loop
		IsDecoration: True
		Offset: 0, 0, -1024
		Palette: huskPalette
		RequiresCondition: decoration03 || decoration02 

refinery_husk.ordos:
	Inherits: ^BuildingHusk
	RenderSprites:
		Image: husk_refinery.ordos
	WithIdleOverlay@front:
		Sequence: idle-front
	WithIdleOverlay@top:
		Sequence: idle-top
	Building:
		Dimensions: 3,3
		Footprint: =xx x=x ===
		LocalCenterOffset: 0,-512,0
	HitShape:
		Type: Rectangle
			TopLeft: -512, -1024
			BottomRight: 1536, 0
	HitShape@BOTTOM:
		Type: Rectangle
			TopLeft: -1536, 0
			BottomRight: 512, 1024
	WithIdleOverlay@smoke:
		Image: smoke_big
		Sequence: loop
		StartSequence: start
		Palette: disabled
		IsDecoration: True
		Offset: 1400, 600, 0
		RequiresCondition: decoration01 || decoration02
	WithIdleOverlay@smoke2:
		Image: smoke_m
		Sequence: smokLandFromR_idle
		StartSequence: smokLandFromRA_Open
		Palette: disabled
		IsDecoration: True
		Offset: 0,0,0
		RequiresCondition: decoration02 || decoration03
	WithIdleOverlay@fire2:
		Image: fire_slow
		StartSequence: 1
		Sequence: 2
		IsDecoration: True
		Offset: 0,-1024,0
		RequiresCondition: decoration01 || decoration03
	SpawnActorOnDeath@ruins:
		Actor: refinery_ruins


refinery_husk.atreides:
	Inherits: ^BuildingHusk
	RenderSprites:
		Image: husk_refinery.atreides
	WithIdleOverlay@front:
		Sequence: idle-front
	WithIdleOverlay@top:
		Sequence: idle-top
	Building:
		Footprint: =xx xx= ===
		Dimensions: 3,3
		LocalCenterOffset: 0,-512,0
	HitShape:
		Type: Rectangle
			TopLeft: -512, -1024
			BottomRight: 1536, 0
	HitShape@BOTTOM:
		Type: Rectangle
			TopLeft: -1536, 0
			BottomRight: 512, 1024
	WithIdleOverlay@smoke:
		Image: smoke_big
		Sequence: loop
		StartSequence: start
		Palette: disabled
		IsDecoration: True
		Offset: -500,-700, 0
		RequiresCondition: decoration01 || decoration03
	WithIdleOverlay@smoke2:
		Image: smoke_m
		Sequence: smokLandFromR_idle
		StartSequence: smokLandFromRA_Open
		Palette: disabled
		IsDecoration: True
		Offset: 0,0,0
		RequiresCondition: decoration02 || decoration03
	WithIdleOverlay@fire2:
		Image: fire_slow
		StartSequence: 1
		Sequence: 2
		IsDecoration: True
		Offset: 1400, 600, 0
		RequiresCondition: decoration01 || decoration03  || decoration02
	SpawnActorOnDeath@ruins:
		Actor: refinery_ruins

refinery_husk.harkonnen:
	Inherits: ^BuildingHusk
	RenderSprites:
		Image: husk_refinery.harkonnen
	WithIdleOverlay@front:
		Sequence: idle-front
	WithIdleOverlay@top:
		Sequence: idle-top
	Building:
		Footprint: =xx =x= =X=
		Dimensions: 3,3
		LocalCenterOffset: 0,-512,0
	HitShape:
		Type: Rectangle
			TopLeft: -512, -1024
			BottomRight: 1536, 0
	HitShape@BOTTOM:
		Type: Rectangle
			TopLeft: -1536, 0
			BottomRight: 512, 1024
	WithIdleOverlay@smokeLeft:
		Image: smoke_big
		Sequence: loop
		StartSequence: start
		Palette: disabled
		IsDecoration: True
		Offset: 1024, 1500, 500
		RequiresCondition: decoration01 || decoration02
	WithIdleOverlay@smoke2:
		Image: smoke_m
		Sequence: smokLandFromR_idle
		Palette: disabled
		IsDecoration: True
		Offset: -512,-500,0
		RequiresCondition: decoration02 || decoration03 || decoration01
	WithIdleOverlay@smokeSmall:
		Image: smoke_m
		StartSequence: smokeFromRA01idle
		Sequence: smokeFromRA01loop
		IsDecoration: True
		Offset: 1024, 1500, 0
		Palette: huskPalette
		RequiresCondition: decoration01 || decoration03 || decoration02
	WithIdleOverlay@fire2:
		Image: fire_slow
		StartSequence: 1
		Sequence: 2
		IsDecoration: True
		Offset: 1024, 1000, 0
		RequiresCondition: decoration03  || decoration02
	SpawnActorOnDeath@ruins:
		Actor: refinery_ruins

