Cloak_Master
Active Member
- Reaction score
- 41
Alright folks, I'm having another problem with JASS (What's new...) Anyways, I'm trying to make an ability that shrugs off damage for the unit. The code is like this.
The problem?
This line...
It shows the damage shrugged off as a real, and I want to round it up to an integer. But I can't find where to put the code. Any thoughts? Thanks.
Code:
function Trig_Steel_Shell_Ability_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttackedUnitBJ()) == 'o00T' ) ) then
return false
endif
return true
endfunction
function Trig_Steel_Shell_Ability_Func002C takes nothing returns boolean
if ( not ( udg_DiceRoll[1] <= 9 ) ) then
return false
endif
return true
endfunction
function Trig_Steel_Shell_Ability_Actions takes nothing returns nothing
set udg_DiceRoll[1] = GetRandomInt(1, 100)
if ( Trig_Steel_Shell_Ability_Func002C() ) then
set udg_RandomREAL[1] = GetUnitStateSwap(UNIT_STATE_LIFE, GetAttackedUnitBJ())
call TriggerSleepAction( 0.30 )
call CreateTextTagUnitBJ( ( R2S ((udg_RandomREAL[1] - GetUnitStateSwap(UNIT_STATE_LIFE,GetAttackedUnitBJ()))) + " damage shrugged off" ), GetAttackedUnitBJ(), 0, 10, 0.00, 100, 0.00, 0 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
call SetUnitLifeBJ( GetAttackedUnitBJ(), udg_RandomREAL[1] )
call AddSpecialEffectLocBJ( GetUnitLoc(GetAttackedUnitBJ()), "Abilities\\Spells\\NightElf\\Taunt\\TauntCaster.mdl" )
set udg_LeakControl[10] = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_LeakControl[10] )
else
call DoNothing( )
endif
endfunction
The problem?
This line...
Code:
call CreateTextTagUnitBJ( ( R2S ((udg_RandomREAL[1] - GetUnitStateSwap(UNIT_STATE_LIFE,GetAttackedUnitBJ()))) + " damage shrugged off" ), GetAttackedUnitBJ(), 0, 10, 0.00, 100, 0.00, 0 )
It shows the damage shrugged off as a real, and I want to round it up to an integer. But I can't find where to put the code. Any thoughts? Thanks.