Code: Select all
actor fyop2 : fyip 10007
{
health 70
translation "fyip3"
Speed 7
xScale 0.078
yScale 0.072
states
{
Spawn:
fepd i 1 A_RadiusGive("hat2", 16, RGF_GIVESELF, 1) //A_GiveInventory ("hat2") didn't seem to work
idle:
fepd im 10 A_Look
loop
See:
fepd abcdefgh 3 A_Chase
Loop
nohatsee:
fepf abcdefgh 3
{
A_wander;
A_JumpIfInventory("hat2", 1, "gethat");
}
fepf abcdefgh 3
{
A_chase;
A_JumpIfInventory("hat2", 1, "gethat");
}
loop
Missile:
fefp a 0 A_JumpIfInventory("hat2", 0, "nohatmissile")
fepd i 10 A_FaceTarget
fepd j 3 a_startsound ("fyip/zupe")
fepd k 1 bright a_SpawnProjectile ("zipzupezip", 26, 0, 0)
fepd k 1 bright a_SpawnProjectile ("zipzupezip", 26, 0, 0)
fepd k 1 bright a_SpawnProjectile ("zipzupezip", 26, 0, 0)
fepd l 3 a_SpawnProjectile ("casingthing", 24, 12, -192)
fepd m 8 A_FaceTarget
fepd j 3 a_startsound ("fyip/zupe")
fepd k 1 bright a_SpawnProjectile ("zipzupezip", 26, 0, 0)
fepd k 1 bright a_SpawnProjectile ("zipzupezip", 26, 0, 0)
fepd k 1 bright a_SpawnProjectile ("zipzupezip", 26, 0, 0)
fepd l 3 a_SpawnProjectile("casingthing", 24, 12, -192)
fepd mjn 3
GoTo See
nohatmissile:
fepf i 10
{
A_FaceTarget;
A_JumpIfInventory("hat2", 1, "gethat");
}
fepf j 3 a_startsound ("fyip/zupe")
fepf k 1 bright a_SpawnProjectile ("zipzupezip", 26, 0, 0)
fepf k 1 bright a_SpawnProjectile ("zipzupezip", 26, 0, 0)
fepf k 1 bright a_SpawnProjectile ("zipzupezip", 26, 0, 0)
fepf l 3 a_SpawnProjectile ("casingthing", 24, 12, -192)
fepf mjn 3
goto nohatsee
pain.slap:
fefp a 0
fefp a 0 A_JumpIfInventory("hat2", 0, "nohatpain")
fedp a 2 A_spawnitemex ("hatthing2", random (0, -1), random (-2, 2), random (32, 48), random (0, -4), random (-2, 2), random (1, 4), 0, SXF_TRANSFERTRANSLATION)
fefp a 2 {
A_TakeInventory("hat2", 1);
a_setuservar ("user_fyop2hatloss", 1);
}
fefp b 2
fefp b 2 A_Pain
fefp aabb 2
goto nohatsee
nohatpain:
fefp a 0 a_changevelocity (0,0,2, CVF_RELATIVE)
fefp a 0 A_Jump (128, "nohatpain2")
fefp aab 2
fefp b 2 A_Pain
fefp aabb 2
GoTo nohatSee
nohatPain2:
fefp ccd 2
fefp d 2 A_Pain
fefp ccdd 2
GoTo nohatSee
Pain:
fedp a 0 A_JumpIfInventory("hat2", 0, "nohatpain")
fedp a 0 A_Jump (128, "pain2")
fedp aab 2
fedp b 2 A_Pain
GoTo See
Pain2:
fedp ccd 2
fedp d 2 A_Pain
GoTo See
gethat:
fedg a 4 a_removechildren
fedg bcdef 4
goto see
//an a_facechild or equivalent code would be nice but for the time being I have only drawn it picking up a hat from the front anyway.
death:
fynv a 0 A_JumpIfInventory("hat2", 0, "nohatflop")
FYNV ab 4
FYnv c 4 A_Scream
fynv d 0 A_TakeInventory("hat2", 1)
dropgun:
FYnv d 0 A_spawnitemex ("gunthing2", random (1, 3), random (-1, -3), random (16, 32), random (.5, 2), random (.5, 1), random (3, 6), 0, SXF_TRANSFERTRANSLATION)
FYnv c 0 A_spawnitemex ("hatthing2", random (0, -1), random (-2, 2), random (32, 48), random (0, -4), random (-2, 2), random (1, 4), 0, SXF_TRANSFERTRANSLATION)
fynv e 0 a_changevelocity (0,0,random (.5, 2),0,0)
fypf b 0 ThrustThing(angle * 256 / 360 + 128, random (0.5, 2), 0, 0)
FYnv e 4
FYnv f 0 A_Fall
Fynv ghi 4
FYnv j -1
Stop
nohatflop:
FYNV kl 4
FYnv m 4 A_Scream
goto dropgun
}
}
Code: Select all
actor hatthing2 : hatthing
{
States
{
Spawn:
fyoy ab 5
fyoy c -1
stop
death:
fyoy d 1
fyoy d 3 A_Fall
fyoy efg 4
hatgive:
fyoy h 10 A_RadiusGive("hat2", 16, RGF_NOMASTER, RGF_EXFILTER, 1)
//this hopefully will attempt to and potentially succeed returning itself to its "master"
goto hatgive
}}
ACTOR hat2 : CustomInventory
{
States
{
Spawn:
fyoy h -1
Stop
//Pickup:
//goto gethat
}
}