Bulletdef:
"Insect",
8,8, ; width and height
3,3, ; visheight, visOffY
16,16, ; sprite size
Img_Bullets, ; sprite sheet
0,0, ; top-left of sprites
TeamGood, ; team
BehaviorProjectile, ; basic behavior, just zooms forward and can hit enemies
3,40, ; base damage and speed
120 ; base range
AnimDef: Attack1(6,1,0 7,1,0)
End
On_Init:
Set(Bullet.DZ,2)
Set(Bullet.Gravity,0)
Set(Bullet.Bounce,0)
Set(Bullet.Z,0)
End
On_Update:
If(Bullet.Z>4.5)
Sub(Bullet.DZ,3)
If(Bullet.Z>5)
Set(Bullet.Z,5)
EndIf
Else
If(Bullet.Z<3.5)
Add(Bullet.DZ,3)
If(Bullet.Z<2)
If(Bullet.DZ<0)
Set(Bullet.DZ,0)
EndIf
EndIf
EndIf
EndIf
; me->speed = weaponflightspeed-weaponflightspeed*(timer/weaponrange)
; we're slowing down over the course of our time (timer counts up from 0 to weaponrange)
Set(T1,Bullet.Timer)
Mul(T1,Weapon.FlightSpeed)
Div(T1,Weapon.Range)
Set(Bullet.Speed,Weapon.FlightSpeed)
Sub(Bullet.Speed,T1)
If(Bullet.Speed<=0)
DeleteSelf
EndIf
; accuracy of 100 has no randomizing, accuracy of 0 randomizes by 1 degree per frame
Set(T1,100)
Sub(T1,Weapon.Accuracy)
Mul(T1,0.01)
Rand(T2,0,T1)
Add(Bullet.dAngle,T2)
End
On_HitEnemy:
; special2 is the dot damage, special1 is the dot duration
Div(Bullet.DX,8)
Div(Bullet.DY,8)
PushTarget(Bullet.DX,Bullet.DY)
BuffTarget("Infested",Weapon.Special2,0,Weapon.Special1)
HurtTarget(Bullet.Damage,Weapon.CritChance,Weapon.CritDamage)
Die
End
On_Death:
ParticleEvent(1,Bullet.X,Bullet.Y,60,0)
End
|