- Joined
- Sep 19, 2006
- Messages
- 152
In the following set of commands, how does the Force aspect relate to the Texttag aspect? They seem almost independent of one another, yet always are written together. (I'm just wondering because I have a global "udg_HumanPlayers" that could be used in lieu of the always-created "f" force, but I don't know how/where I would insert it.)
JASS:
// ** Death Penalty **
set trig_unitE = GetHeroLevel (trig_unit)
set t_1000 = bj_randDistID [trig_unitQ + 1000]
set t_1500 = bj_randDistID [trig_unitQ + 1500]
set t_1860 = bj_randDistID [trig_unitQ + 1860]
if t_1500 == 0 and t_1860 == 0 then
set y = GetPlayerState (Player (trig_unitQ), PLAYER_STATE_RESOURCE_GOLD)
set n = ((100 - trig_unitE) * y) / 100
call SetPlayerState (Player (trig_unitQ), PLAYER_STATE_RESOURCE_GOLD, n)
set f = CreateForce ()
call ForceAddPlayer (f, Player (trig_unitQ))
set tt = CreateTextTag ()
call SetTextTagText (tt, "|CffFFFF00-" + I2S (y - n) + " Gold|r", 0.025)
call SetTextTagPos (tt, trig_unitX - 100.00, trig_unitY, 50.00)
call SetTextTagColor (tt, 255, 255, 255, 0)
call SetTextTagPermanent (tt, false)
call SetTextTagLifespan (tt, 3.00)
call SetTextTagFadepoint (tt, 0.00)
call SetTextTagVelocity (tt, 0.03 * Cos (1.57079), 0.03 * Sin (1.57079))
call SetTextTagVisibility (tt, true)
call DestroyForce (f)
set f = null
set tt = null
endif