- Joined
- Jun 27, 2010
- Messages
- 2,710
I wondered how to do this and I invented a way, but I'm not sure what complications might happen. Now it's just a theory, that's why I'm asking you, if you know what would be the most intuative way to do this. Opinions?
every 0.10 secs set cur_Hp[1] of hero_units[1] to Current HP
every 0.10 secs set cur_Hp[2] of hero_units[2] to Current HP
every 0.10 secs set cur_Hp[3] of hero_units[3] to Current HP
every 0.10 secs set cur_Hp[4] of hero_units[4] to Current HP
unit is attacked
attacked unit equal to hero units[1]
attacked unit equal to hero units[2]
attacked unit equal to hero units[3]
attacked unit equal to hero units[4]
--------------------------------------------------
if current hp of hero_units[owner of attacked unit] < cur_hp[owner of attacked unit] then
set resultHP = cur_hp[owner of attacked unit] - current hp of hero_units[owner of attacked unit]
display floating text above attacked unit "-resulthp[owner of attacked unit]"
--------------------------------------------------
if crrent hp of hero_units[owner of attacked unit] > cur_hp[owner of attacked unit] then
set resultHP = cur_hp[owner of attacked unit] - current hp of hero_units[owner of attacked unit]
display floating text above attacked unit "+resulthp[owner of attacked unit]"
--------------------------------------------------
every 0.10 secs set cur_Hp[1] of hero_units[1] to Current HP
every 0.10 secs set cur_Hp[2] of hero_units[2] to Current HP
every 0.10 secs set cur_Hp[3] of hero_units[3] to Current HP
every 0.10 secs set cur_Hp[4] of hero_units[4] to Current HP
unit is attacked
attacked unit equal to hero units[1]
attacked unit equal to hero units[2]
attacked unit equal to hero units[3]
attacked unit equal to hero units[4]
--------------------------------------------------
if current hp of hero_units[owner of attacked unit] < cur_hp[owner of attacked unit] then
set resultHP = cur_hp[owner of attacked unit] - current hp of hero_units[owner of attacked unit]
display floating text above attacked unit "-resulthp[owner of attacked unit]"
--------------------------------------------------
if crrent hp of hero_units[owner of attacked unit] > cur_hp[owner of attacked unit] then
set resultHP = cur_hp[owner of attacked unit] - current hp of hero_units[owner of attacked unit]
display floating text above attacked unit "+resulthp[owner of attacked unit]"
--------------------------------------------------