by NeuralStunner » Sun Dec 20, 2009 5:00 pm
It has a few parameters already, a few extra might not hurt. Although, if the tracers were like hitscans, and [wiki=Classes:BFGExtra]BFGExtra[/wiki] was handled as a puff, it would be less of an issue.
If you like, check out this code which I wrote up. It doesn't do damage in quite the same way, but I got it (kinda) close.
Spoiler: Hitscanned BFGBall
46 hitscans (1 per 2 degrees in a 90 degree arc, "0" included) each doing 32, 64, or 96 damage (for a total potential of 1472 to 4416, which has a lower maximum than the original tracers, but a much higher minimum).
Thanks to the BFG's slow refire rate, the iteration system works fine to prevent an excess 88 lines of duplicate code!
Code: Select all
Actor NewBFGBall : BFGBall Replaces BFGBall
{
States
{
Death:
BFE1 AB 8 Bright
BFE1 C 8 Bright A_GiveToTarget ("BFGTracers", 1)
BFE1 DEF 8 Bright
Stop
}
}
Actor BFGTracers : CustomInventory
{
Game Doom
+INVENTORY.ALWAYSPICKUP
Inventory.Amount 1
Inventory.MaxAmount 1
States
{
Spawn:
TNT1 A 1
Loop
Pickup:
TNT1 A 0 A_TakeInventory ("CountBFGTracers", 45)
TNT1 A 0 A_SetAngle (Angle - 45)
TNT1 A 0 A_FireBullets (0, 0, 1, 32, "BFGPuff", 0, 1024)
Pickup1:
TNT1 A 0 A_JumpIfInventory ("CountBFGTracers", 45, "Pickup2")
TNT1 A 0 A_GiveInventory ("CountBFGTracers", 1)
TNT1 A 0 A_SetAngle (Angle + 2)
TNT1 A 0 A_FireBullets (0, 0, 1, 32, "BFGPuff", 0, 1024)
Loop
Pickup2:
TNT1 A 0 A_TakeInventory ("CountBFGTracers", 45)
TNT1 A 1 A_SetAngle (Angle - 45)
Stop
}
}
Actor BFGPuff : BulletPuff Replaces BFGExtra
{
VSpeed 0
+EXTREMEDEATH
+NODAMAGETHRUST
+PUFFONACTORS
RenderStyle Add
Alpha 0.75
States
{
Spawn:
BFE2 ABCD 8 Bright
Stop
Crash:
TNT1 A 1
Stop
}
}
Actor CountBFGTracers : Inventory
{
Inventory.Amount 1
Inventory.MaxAmount 45
}
It has a few parameters already, a few extra might not hurt. Although, if the tracers were like hitscans, and [wiki=Classes:BFGExtra]BFGExtra[/wiki] was handled as a puff, it would be less of an issue.
If you like, check out this code which I wrote up. It doesn't do damage in quite the same way, but I got it (kinda) close.
[spoiler=Hitscanned BFGBall]46 hitscans (1 per 2 degrees in a 90 degree arc, "0" included) each doing 32, 64, or 96 damage (for a total potential of 1472 to 4416, which has a lower maximum than the original tracers, but a much higher minimum).
Thanks to the BFG's slow refire rate, the iteration system works fine to prevent an excess 88 lines of duplicate code!
[code]
Actor NewBFGBall : BFGBall Replaces BFGBall
{
States
{
Death:
BFE1 AB 8 Bright
BFE1 C 8 Bright A_GiveToTarget ("BFGTracers", 1)
BFE1 DEF 8 Bright
Stop
}
}
Actor BFGTracers : CustomInventory
{
Game Doom
+INVENTORY.ALWAYSPICKUP
Inventory.Amount 1
Inventory.MaxAmount 1
States
{
Spawn:
TNT1 A 1
Loop
Pickup:
TNT1 A 0 A_TakeInventory ("CountBFGTracers", 45)
TNT1 A 0 A_SetAngle (Angle - 45)
TNT1 A 0 A_FireBullets (0, 0, 1, 32, "BFGPuff", 0, 1024)
Pickup1:
TNT1 A 0 A_JumpIfInventory ("CountBFGTracers", 45, "Pickup2")
TNT1 A 0 A_GiveInventory ("CountBFGTracers", 1)
TNT1 A 0 A_SetAngle (Angle + 2)
TNT1 A 0 A_FireBullets (0, 0, 1, 32, "BFGPuff", 0, 1024)
Loop
Pickup2:
TNT1 A 0 A_TakeInventory ("CountBFGTracers", 45)
TNT1 A 1 A_SetAngle (Angle - 45)
Stop
}
}
Actor BFGPuff : BulletPuff Replaces BFGExtra
{
VSpeed 0
+EXTREMEDEATH
+NODAMAGETHRUST
+PUFFONACTORS
RenderStyle Add
Alpha 0.75
States
{
Spawn:
BFE2 ABCD 8 Bright
Stop
Crash:
TNT1 A 1
Stop
}
}
Actor CountBFGTracers : Inventory
{
Inventory.Amount 1
Inventory.MaxAmount 45
}
[/code][/spoiler]