actor PenpenEVf
{
Projectile
+FLOORHUGGER
+BOUNCEONWALLS
+NOEXPLODEFLOOR
+SEEKERMISSILE
+LOOKALLAROUND
-NOGRAVITY
+RIPPER

height 16
radius 21
speed 0
damage (20)
damagetype "PenpenFrostman"
Obituary "%o tried to take a shortcut against %k's \chPenpen EV\c-."
WallBounceFactor 1
bouncecount 5
ReactionTime 30
Scale 2.5
var int user_angle;

States
{
Spawn:
TNT1 AA 0 A_GiveInventory("ProjectileCode",1)
GAYO A 0 A_GiveInventory("LimitFlag", 1, AAPTR_TARGET)
GAYO A 0 A_ChangeFlag("FLOORHUGGER",0)
PEEV A 1 A_ChangeVelocity(8, 0, 0, CVF_RELATIVE | CVF_REPLACE)
RegularMove:
PEEV A 0 A_SetAngle(angle + 36)
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists",0)==0,"Death")
TNT1 A 0 A_SetUserVar("user_angle",angle)
TNT1 A 0 A_SeekerMissile(0, 0, SMF_LOOK, 256)
TNT1 A 0 A_SetAngle(user_angle)
PEEV A 1 A_JumpIfTargetInLOS("FastMove", 0, JLOSF_PROJECTILE,300)
PEEV A 0 A_JumpIfCloser(30,"PunchAwayCheck")
PEEV A 1 A_JumpIfTargetInLOS("FastMove", 0, JLOSF_PROJECTILE,300)
loop
FastMove:
MWSH A 0 A_PlaySoundEx("weapon/WaterHose","Weapon")
GAYO A 0 A_SeekerMissile(0, 0, SMF_LOOK, 256)
PEEV B 1 A_FaceTracer(0, 0)
PEEV C 1 A_ChangeVelocity(16, 0, 0, CVF_RELATIVE | CVF_REPLACE)
FastMoveLoop:
PEEV B 1
PEEV CDE 1 A_JumpIfCloser(30,"PunchAwayCheck2")//A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists",0)==0,"Death")
loop

PunchAwayCheck:
TNT1 A 0 A_JumpIfInTargetInventory("CutterFlag",1,"PunchAway")
TNT1 A 0 A_JumpIfInTargetInventory("NoSpeed",1,"PunchAway")
goto RegularMove

PunchAwayCheck2:
TNT1 A 0 A_JumpIfInTargetInventory("CutterFlag",1,"PunchAway")
TNT1 A 0 A_JumpIfInTargetInventory("NoSpeed",1,"PunchAway")
goto FastMoveLoop

PunchAway:
PEEV B 1 ACS_ExecuteAlways(548,0,0)
MWSH A 0 A_PlaySoundEx("weapon/chillland","Weapon")
TNT1 A 0 A_ChangeVelocity(30, 0, 0, CVF_RELATIVE | CVF_REPLACE)
TNT1 A 0 A_SpawnItemEx("PenpenEVf2",0,0,0,30,0,-sin(pitch)*30)

Death:
GAYO A 0 A_SpawnItemEx("GenericAssistDeath", 0, 0, height/2)
GAYO A 0 A_TakeInventory("LimitFlag", 1, 0, AAPTR_TARGET)
stop
}
}


Actor PenpenEVf2 : PenpenEVf
{
WallBounceSound "weapon/chillland"
-FLOORHUGGER
+BOUNCEONACTORS
	States
		{
		Spawn:
		TNT1 AA 0 A_GiveInventory("ProjectileCode",1)
		GAYO A 0 A_GiveInventory("LimitFlag", 1, AAPTR_TARGET)
		goto RegularMove
		}
}


Actor PenpenFrostmanProtect : PowerProtection
{
	Powerup.Duration 20
	DamageFactor "PenpenFrostman", 0.0
}