- Joined
- Mar 3, 2006
- Messages
- 1,564
I want to make a damage formula as:
CONST FACTOR + (LEVEL FACTOR * AbilityLevel) + (PREV LEVEL FACTOR * PrevLevelDamage)
The CONST FACTOR and LEVEL FACTOR * AbilityLevel was easy to make but the problem is with the PREV LEVEL FACTOR * PrevLevelDamage
Here is a part of the script:
This is the same script that good
Element of Water fixed it to me, I just wanted to add a damage function but I was stuck by that problem.
CONST FACTOR + (LEVEL FACTOR * AbilityLevel) + (PREV LEVEL FACTOR * PrevLevelDamage)
The CONST FACTOR and LEVEL FACTOR * AbilityLevel was easy to make but the problem is with the PREV LEVEL FACTOR * PrevLevelDamage
Here is a part of the script:
JASS:
scope AoETemplate initializer Init
private keyword Data
globals
// Constants
private constant real TIMER_INTERVAL = 0.015
private constant real DIST = 16.00
private constant real NOVA_RADIUS = 512.00 // radius of the Nova
private constant integer NOVA_SIZE = 36 // number of the Nova Units
private constant real dA = 360/NOVA_SIZE
private constant integer UNIT_ID = 'e001' // rawcode of the Nova Unit
private constant integer ABIL_ID = 'A001' // rawcode of the Dummy Spell
private constant attacktype ATKTYPE = ATTACK_TYPE_MAGIC
private constant damagetype DMGTYPE = DAMAGE_TYPE_FIRE
private constant real AB_CONST_FACTOR = 50.00
private constant real AB_LEVEL_FACTOR = 50.00
private constant real AB_PREV_LVL_FACTOR = 1
// Variables
private timer tm = CreateTimer()
private Data array temp_dat
private integer index = 0
private Data iFilter // Filter Data
private boolexpr fFilter // Filter function
private group TempGroup = CreateGroup()
endglobals
private struct Data
unit Caster
unit array Nova[NOVA_SIZE]
real expand
real Cx
real Cy
player Owner
group dGroup = CreateGroup() // Damaged Units Group
real dmg
real prev
static method Damage takes integer AbiLevel returns real
local real damage = AB_CONST_FACTOR + AB_LEVEL_FACTOR * AbiLevel //+ AB_PREV_LVL_FACTOR * prev
return damage
endmethod
// ...
//rest of the script
// ...
static method create takes unit caster returns Data
local thistype dat = thistype.allocate()
local integer i = 0
local real A = 0.00
set dat.Caster = caster
set dat.Owner = GetOwningPlayer(dat.Caster)
set dat.Cx = GetUnitX(dat.Caster)
set dat.Cy = GetUnitY(dat.Caster)
set dat.dmg = Data.Damage(GetUnitAbilityLevel(dat.Caster,ABIL_ID))
// ...
// To the end of the script
// ...
This is the same script that good
