- Joined
- Feb 13, 2019
- Messages
- 128
So what I've done (this may be the issue, maybe I'm trying to cut a corner here where I need a hashtable?)
Is set variables as "stats" for units, using Bribe's Unit Indexer, as sort of a shortcut to an MUI system?
So where I have a bit of a brain fart is setting the "Attacking Unit" or "CombatDexSource" to the correct "HeroAGI[UDex]" we created.
So my thought process was to just convert it to custom text, and look inside the JASS to see if I could just tinker a bit and set this all up.
So this seems simple enough for a JASS newbie to understand, I just need to "Get" my custom variable instead of the "GetHeroStatBJ(bj_HEROSTAT_AGI, udg_AttackingUnit, true)" ?
I imagine that's actually quite simple and along the lines of like?
Get udg_UDexUnits[udg_UDex] ? But I'm not sure of the correct syntax and I'm currently on the JASS manual but I really wish there was a search function that would probably help me narrow this down ??
Is set variables as "stats" for units, using Bribe's Unit Indexer, as sort of a shortcut to an MUI system?
-
Hero Group
-
Events
- Game - UnitIndexEvent becomes Equal to 1.00
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (UDexUnits[UDex] is A Hero) Equal to True
-
Then - Actions
- Unit Group - Add (Triggering unit) to Hero_Group
-
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
-
Loop - Actions
- Set VariableSet HeroAGI[UDex] = 3
- Hero - Modify Agility of (Picked unit): Set to HeroAGI[UDex].
-
Loop - Actions
-
Else - Actions
- Do nothing
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
Combat
-
Events
- Game - DamageEvent becomes Equal to 1.00
- Conditions
-
Actions
- Set VariableSet AttackingUnit = DamageEventSource
- Set VariableSet AttackedUnit = DamageEventTarget
- Set VariableSet CombatDexSource = (Agility of AttackingUnit (Include bonuses))
- Set VariableSet CombatTarget = (Agility of AttackedUnit (Include bonuses))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- CombatDexSource Less than CombatTarget
-
Then - Actions
- Set VariableSet DamageEventAmount = 0.00
-
Else - Actions
- Do nothing
-
If - Conditions
-
Events
So where I have a bit of a brain fart is setting the "Attacking Unit" or "CombatDexSource" to the correct "HeroAGI[UDex]" we created.
So my thought process was to just convert it to custom text, and look inside the JASS to see if I could just tinker a bit and set this all up.
JASS:
function Trig_CDC_Func005C takes nothing returns boolean
if ( not ( udg_CombatDexSource < udg_CombatTarget ) ) then
return false
endif
return true
endfunction
function Trig_CDC_Actions takes nothing returns nothing
set udg_AttackingUnit = udg_DamageEventSource
set udg_DamageEventTarget = udg_AttackedUnit
set udg_CombatDexSource = GetHeroStatBJ(bj_HEROSTAT_AGI, udg_AttackingUnit, true)
set udg_CombatTarget = GetHeroStatBJ(bj_HEROSTAT_AGI, udg_AttackedUnit, true)
if ( Trig_CDC_Func005C() ) then
set udg_DamageEventAmount = 0.00
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_CDC takes nothing returns nothing
set gg_trg_CDC = CreateTrigger( )
call TriggerRegisterVariableEvent( gg_trg_CDC, "udg_DamageEvent", EQUAL, 1.00 )
call TriggerAddAction( gg_trg_CDC, function Trig_CDC_Actions )
endfunction
So this seems simple enough for a JASS newbie to understand, I just need to "Get" my custom variable instead of the "GetHeroStatBJ(bj_HEROSTAT_AGI, udg_AttackingUnit, true)" ?
I imagine that's actually quite simple and along the lines of like?
Get udg_UDexUnits[udg_UDex] ? But I'm not sure of the correct syntax and I'm currently on the JASS manual but I really wish there was a search function that would probably help me narrow this down ??