- Joined
- Jul 24, 2009
- Messages
- 5,630
Since my computer is stuffed, I need to check something. Will this work?:
Shoot:
A Unit Casts Shoot
Condition Blah Blah cooldown, buffs etc
For Each Int A From 1 - (number of bullet types) Do:
If GunTypeArmed[Int A] = True
Then Create 1 BulletType[Int A] at Position of Caster Offset by 100 Facing Facing Angle of Caster
Add Last Created Unit to Bullets
Pick Every Unit In Bullets
Add Event to Damage: Picked Unit Comes within Range of a Unit
This creates a bullet dummy every time someone triggers it and adds an event to Damage.
BulletTravel:
Every 0.01 Seconds of Game
For Each Int From 1 - Number of Units In Bullets Do:
Pick Random Unit from Bullets
Remove Picked Unit from Bullets
Add Picked Unit to AlreadyMovedBullets
Set TempPoint = Position of Picked Unit Offset by 50 Facing Picked Unit Facing Angle
Move Instantly Picked Unit to TempPoint
call RemoveLocation(udg_TempPoint)
-------------------------------------
Add All Units In AlreadyMovedBullets into Bullets
This moves the dummy a little further depending on speed and type ie. moves it.
Damage:
Condition Blah blah invulnerability, unit type etc
Picke Every Unit Within 100 of Triggering Unit And Do:
For Each Int A From 1 - (number of bullet types) Do:
If Unit Type of Triggering Unit = BulletType[Int A]
Then Set Life of Picked Unit = Current Life - AmountofDamage[Int A]
Kill Triggering Unit
This detects if the bullet 'hits' a unit using a previously added event. Can be copied to damage destructables, specific targets etc.
All those For Each Int and array variables(must be preset to the right values) are for determining the bullet type from a picked up item (or whatever else) therefore dealing the right amount of damage.
Not very neat, and not perfected, but the concept is right. Don't go on about leaks and stuff. So, just tell me if this works, and find any bugs or shortcuts. Thanks.
Shoot:
A Unit Casts Shoot
Condition Blah Blah cooldown, buffs etc
For Each Int A From 1 - (number of bullet types) Do:
If GunTypeArmed[Int A] = True
Then Create 1 BulletType[Int A] at Position of Caster Offset by 100 Facing Facing Angle of Caster
Add Last Created Unit to Bullets
Pick Every Unit In Bullets
Add Event to Damage: Picked Unit Comes within Range of a Unit
This creates a bullet dummy every time someone triggers it and adds an event to Damage.
BulletTravel:
Every 0.01 Seconds of Game
For Each Int From 1 - Number of Units In Bullets Do:
Pick Random Unit from Bullets
Remove Picked Unit from Bullets
Add Picked Unit to AlreadyMovedBullets
Set TempPoint = Position of Picked Unit Offset by 50 Facing Picked Unit Facing Angle
Move Instantly Picked Unit to TempPoint
call RemoveLocation(udg_TempPoint)
-------------------------------------
Add All Units In AlreadyMovedBullets into Bullets
This moves the dummy a little further depending on speed and type ie. moves it.
Damage:
Condition Blah blah invulnerability, unit type etc
Picke Every Unit Within 100 of Triggering Unit And Do:
For Each Int A From 1 - (number of bullet types) Do:
If Unit Type of Triggering Unit = BulletType[Int A]
Then Set Life of Picked Unit = Current Life - AmountofDamage[Int A]
Kill Triggering Unit
This detects if the bullet 'hits' a unit using a previously added event. Can be copied to damage destructables, specific targets etc.
All those For Each Int and array variables(must be preset to the right values) are for determining the bullet type from a picked up item (or whatever else) therefore dealing the right amount of damage.
Not very neat, and not perfected, but the concept is right. Don't go on about leaks and stuff. So, just tell me if this works, and find any bugs or shortcuts. Thanks.