Shotgun Spell

Uszi

New Member
Reaction score
5
I'm working on a passive "Shot gun" spell.

Right now, the leveling the spell causes you to research an upgrade that Enables attack two (a splash missile) and then increases the spill radius of the damage.

But what I need help with is coming up with a distance based damage system.

Ideally, I would like the system to figure out if a target is within or outside of a 400 range. Inside 400, it applies some sort of +damage modifier based on how close it is. Outside of 400, I would use the same modifier to reduce the damage. At 400 normal damage.

I was thinking I could set some sort of temporary integer = 0+Distance, and add some sort of divisor to make it reasonable. So like, at 50 distance from the target, your 350 distance from the zero point, and if we divide it by like, 5 then you get a +70 damage modifier. Conversely, if your 750 distance away from the target, your distance is -350 now, and you get a -70 damage modifier.

My question is: How do I detect how far away a unit is? How do I use that value as an integer?
 

free_killing

TH.net Regular
Reaction score
23
Trigger:
  • distance
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shotgun
    • Actions
      • Set ShotgunPos[1] = (Position of (Casting unit))
      • Set ShotgunPos[2] = (Position of (Targeted unit))
      • Unit - Cause (Casting unit) to damage (Targeted unit), dealing (1000.00 - (Distance between ShotgunPos[1] and ShotgunPos[2])) damage of attack type Spells and damage type Normal
      • Custom script: call RemoveLocation(udg_ShotgunPos[1])
      • Custom script: call RemoveLocation(udg_ShotgunPos[2])

Thus im not sure what you meant ..
 

Uszi

New Member
Reaction score
5
Similar.

Right now though, shotgun isn't an ability that... does anything on its own. It's a passive spell based on devotion aura. I'm using triggers to research an upgrade for the shotgun to increase the damage spill radius whenever you level it.

So I don't think I can use "Starts the effect of an ability."

I've also read that Unit - A unit is attacked isn't a good way to go about things. Something about the game not doing a great job of keeping track of attacked and attacking units.

So yeah, my main problem is the event to start the trigger off.

The other thing, is I would like the unit to deal its normal damage, and then +/- a modifier. So I don't particularly want Unit - Damage other unit, unless I can add that damage to the damage already done. Maybe have the trigger go off after an attack, and use unit damage other unit to just purely add the bonus...

I was originally working it like this:

Trigger:
  • Shotgun Damage Bonus
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) has buff Shot Gun) Equal to True
    • Actions
      • Set shotgunTempInt = (Integer((Distance between (Position of (Attacked Unit)) and (Position of (Attacking Unit)))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • shotgunTempInt Less than 400
    • Then - Actions
    • Set shotgunTempInt = (400 - shotgunTempint)/(10 - Level of ability Shotgun for Attacking Unit)
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • shotgunTempInt Greater than 400
    • Then - Actions
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • shotgunTempInt Equal to 400


Something along those lines. But I'm a bit stuck.
I suppose an active shotgun ability would be much easier to make.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top