
------------------------------------------
Finishing up the Abyss Mite. Small swarming and leaping enemy. It's a small sprite, so won't take long to finish.

20 health, 30 height, 16 radius, 10 speed (5 per tic, 10 on nightmare, same as Pinky).Blue Shadow wrote:I hope it won't be one of those critters that's annoying to kill because it's too small and darts around fast.
Amuscaria wrote:Completed.
They were SUPPOSED to explode when they leap. But I couldn't get that to work with Decorate, and without ZScript, I don't think I can make an expression that sums up the caller and target pointer's radius, since I can only access the caller's properties via ACS with GetActorProperty(). Be nice if there was a way to do something like A_JumpIfCloser(AAPTR_TARGET.radius + GetActorProperty(0,APROP_Radius) + 5, "Explode"), unlesss I'm missing something. Guess it's a good time to convert all HF2 actors to ZScript before I have too many to manage.ActionAlligator wrote:ahhhh, do the mites only explode when they leap at you, or do they explode when you come within range? and is 'mite jumping' onto ledges a thing? xD
Code: Select all
ACTOR Mite 32102
{
Health 20
Radius 16
Height 30
Mass 50
Speed 10
PainChance 200
PainChance "wepkick", 256
Monster
MaxTargetRange 200
MeleeRange 30
BloodColor "95 91 16"
Tag "Abyss Mite"
SeeSound "mite/sight"
PainSound "mite/pain"
DeathSound "mite/death"
ActiveSound "mite/active"
Obituary "%o was liquified by a mite."
+DONTHARMSPECIES
+DONTHARMCLASS
+FLOORCLIP
+SHORTMISSILERANGE
States
{
Spawn:
MITE M 10 A_Look
Loop
See:
MITE AABBCCDDEEFF 2 Fast A_Chase
Loop
Rest:
MITE AABBCCDDEEFF 2 Fast A_Chase("Melee","")
goto See
Missile:
MITE G 12 {A_PlaySoundEX("mite/attack", "Auto"); A_FaceTarget;}
MITE H 0 {A_SetGravity(0.5); A_Recoil(-20); ThrustThingZ(0,28,0,0);}
MITE H 8
MITE H 1 A_CheckFloor("Land")
goto Missile+2
Melee:
MITE K 1 Bright A_Die("Suicide")
stop
Land:
MITE I 3 A_SetGravity(1.0)
goto Rest
Pain:
MITE J 2 Fast A_SetGravity(1.0)
MITE J 2 Fast A_Pain
Goto See
Pain.wepkick:
MITE J 2 Fast A_SetGravity(1.0)
MITE J 50 A_Pain
Goto See
Death:
MITE N 0 A_SetGravity(1.0)
MITE N 5 A_Scream
MITE O 5 A_NoBlocking
MITE PQR 5
MITE S -1
Death.Suicide:
MITE K 2 Bright {A_Stop; A_NoGravity; A_NoBlocking;}
MITE K 0 A_CustomMissile("MiteExplosion",15)
stop
Raise:
MITE RQPON 5
Goto See
}
}
ACTOR MiteExplosion : BasiliskFire
{
Speed 0
Damagetype weppoison
Obituary "%o was liquified by a mite."
SeeSound "weapons/splatter4"
States
{
Spawn:
MFX1 Q 0
MFX1 Q 3 Bright {A_Explode(12 * random(1,4),64,0,0,32); A_SetTranslucent(1,1);}
MFX1 RSTU 3 Bright
stop
}
}
Code: Select all
States
{
Spawn:
MITE M 10 A_Look
Loop
See:
MITE AABBCCDDEEFF 2 Fast A_Chase
Loop
Rest:
MITE AABBCCDDEEFF 2 Fast A_Chase("Melee","")
goto See
Missile:
MITE G 12 {A_PlaySoundEX("mite/attack", "Auto"); A_FaceTarget;}
MITE H 0 {A_SetGravity(0.5); A_Recoil(-20); ThrustThingZ(0,28,0,0);}
MITE H 8
MITE H 1 { A_CheckFloor("Land"); A_JumpIfCloser(20, "Explode");}
goto Missile+2
Explode:
MITE K 1 Bright A_Die("Suicide")
stop
Land:
MITE I 3 A_SetGravity(1.0)
goto Rest
Pain:
MITE J 2 Fast A_SetGravity(1.0)
MITE J 2 Fast A_Pain
Goto See
Pain.wepkick:
MITE J 2 Fast A_SetGravity(1.0)
MITE J 50 A_Pain
Goto See
Death:
MITE N 0 A_SetGravity(1.0)
MITE N 5 A_Scream
MITE O 5 A_NoBlocking
MITE PQR 5
MITE S -1
Death.Suicide:
MITE K 2 Bright {A_Stop; A_NoGravity; A_NoBlocking;}
MITE K 0 A_CustomMissile("MiteExplosion",15)
stop
Raise:
MITE RQPON 5
Goto See
}
}
You don't really need to get the caller's properties since you know them -- you're writing the caller's actor code after all -- and radius isn't a property that can get dynamically changed.Amuscaria wrote:They were SUPPOSED to explode when they leap. But I couldn't get that to work with Decorate, and without ZScript, I don't think I can make an expression that sums up the caller and target pointer's radius, since I can only access the caller's properties via ACS with GetActorProperty().
Cool I'll give that a try! Thx.Gez wrote:You don't really need to get the caller's properties since you know them -- you're writing the caller's actor code after all -- and radius isn't a property that can get dynamically changed.Amuscaria wrote:They were SUPPOSED to explode when they leap. But I couldn't get that to work with Decorate, and without ZScript, I don't think I can make an expression that sums up the caller and target pointer's radius, since I can only access the caller's properties via ACS with GetActorProperty().
But more generally, I think you don't need to reinvent the wheel: [wiki]A_JumpIfTargetInsideMeleeRange[/wiki] should be doing what you want. Define a MeleeRange of 5, and that'll correspond to your check of target radius + caller radius + 5.