actor EddieSummon : CustomInventory 10046
{
//$Category MM8BDM-Assists
//$Title Eddie
inventory.amount 1
inventory.maxamount 1
inventory.pickupmessage "$PU_EDDIECALL"
Tag "$TAG_EDDIE"
inventory.icon "EDDIEC"
Inventory.PickupSound "item/1up"
+INVENTORY.RESTRICTABSOLUTELY 
Inventory.RestrictedTo megamans
scale 2.0
+COUNTITEM
+INVBAR
states
{
Spawn:
WEAP Q 1
Loop
Use:
EDDI O 0 A_PlaySoundEx("item/refill","Voice")
EDDI O 0 A_SpawnItemEx("EddieTeleport", 80, 0, 256, 0, 0, -24, 0, SXF_NOCHECKPOSITION, 0)
stop
Death:
TNT1 A 0
stop
}
}

actor EddieTeleport
{
Radius 8
Height 8
scale 2.5
+NOINTERACTION
PROJECTILE
+DONTBLAST
+SKYEXPLODE
states
{
Spawn:
RUSH D 0
RUSH D 9
RUSH D 0 A_ChangeFlag("NOINTERACTION", 0)
RUSH DDDDDDDDDD 1 A_CheckFloor("Next")
Goto Next
Next:
RUSH D 0 //A_ChangeFlag(NOGRAVITY, false)
Goto Death
Death:
TNT1 A 0 A_SpawnItemEx("Eddie",0,0,3,0,0,momz,0,SXF_NOCHECKPOSITION,0) 
stop
}
}

actor Eddie
{
-SOLID
+DONTBLAST
+NOCLIP
+SKYEXPLODE
+MISSILE
+DONTBLAST
-ISMONSTER
scale 2.5
Radius 24
Height 32
speed 10
meleerange 80
reactiontime 250
states
{
Spawn:
RUSH D 0 A_Jump(256,"Death")
RUSH D 0 A_ChangeFlag("MISSILE",0)
RUSH D 0 A_ChangeVelocity(0, 0, -32, CVF_REPLACE)
RUSH D 1 A_JumpIf(z-floorz<=0, "Search")
Goto Spawn+2
Search:
EDDI A 0 A_ChangeFlag("NOCLIP",0)
EDDI A 1
EDDI AABBAACCDD 1 A_Chase
EDDI A 0 A_CountDown
Goto Search+3
Melee:
EDDI E 2 A_FaceTarget
EDDI F 10 A_SpawnItemEx("RandomWeapon",0,0,32,0,0,0)
EDDI F 0 A_Die
Goto Death
Death:
RUSH D 0 ThrustThingZ(0, 34, 0, 1)
RUSH D 0 A_ChangeFlag("NOGRAVITY", 1)
RUSH D 1 A_JumpIf(z-ceilingz==0-32, "Bye")
Goto Death+2
Bye:
RUSH D 1
stop
}
}

actor RandomWeapon
{
+NOINTERACTION
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_JumpIf(random(1,425)==1,"MannCoWeapons")
TNT1 A 0 ACS_ExecuteAlways(256, 0)
TNT1 A 2
stop
MannCoWeapons:
TNT1 A 0 A_PlaySoundEx("misc/secret","Voice",0,1)
TNT1 A 0 ACS_NamedExecuteAlways("MannCoWeapons", 0)
TNT1 A 2
stop
}
}