- Joined
- May 16, 2020
- Messages
- 660
Hi guys,
I want to create a system with which I can trigger all crits in my map.
So far, I created all my crits in this fashion:
The problem with this: If crits happen at the same time (for example because a unit has a crit ability and crit item), the crits overlap and happen both at once.
Instead of overlapping, I want the crit with the higher multiplier amount to have priority over the other (i.e. so only 1 crit happens).
@Bribe helped get started:
...but I'm still struggling with the implementation. To create a crit system which stores everything, I think I will need two things:
1) A trigger to define the crit chance + multiplier per unit:
2) The system to trigger the crits. But here is were I'm stuck:
But this will not work, as the chances/multipliers[custom value] will overwrite each others.
Can anyone help please?
I want to create a system with which I can trigger all crits in my map.
So far, I created all my crits in this fashion:
-
The Crit system so far
-
Events
- Game - DamageModifierEvent becomes Equal to 1.10
-
Conditions
- (Level of ABILITY for DamageEventSource) Greater than 0
- (DamageEventTarget is A structure) Equal to False
- DamageEventAttackT Equal to ATTACK_TYPE_HERO
- DamageEventDamageT Equal to DAMAGE_TYPE_NORMAL
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random percentage) Less than or equal to 15.00
-
Then - Actions
- Set VariableSet Temp_Point = (Position of DamageEventSource)
- Set VariableSet DamageEventAmount = (DamageEventAmount x (0.75 + (1.25 x (Real((Level of Coup de Grace for DamageEventSource))))))
- -------- --------
- Floating Text - Create floating text that reads ((String((Integer((DamageEventAmount + 0.50))))) + !) at Temp_Point with Z offset -25.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Set VariableSet Global_FloatingText = (Last created floating text)
- -------- --------
- Floating Text - Hide Global_FloatingText for (All players)
- Set VariableSet Global_PlayerGroup = (All players matching ((DamageEventSource is visible to (Matching player).) Equal to True).)
- Floating Text - Show Global_FloatingText for Global_PlayerGroup
- Custom script: call DestroyForce(udg_Global_PlayerGroup)
- -------- --------
- Floating Text - Change Global_FloatingText: Disable permanence
- Floating Text - Set the velocity of Global_FloatingText to 72.00 towards 90.00 degrees
- Floating Text - Change the lifespan of Global_FloatingText to 5.00 seconds
- Floating Text - Change the fading age of Global_FloatingText to 2.00 seconds
- -------- --------
- Custom script: call RemoveLocation (udg_Temp_Point)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
The problem with this: If crits happen at the same time (for example because a unit has a crit ability and crit item), the crits overlap and happen both at once.
Instead of overlapping, I want the crit with the higher multiplier amount to have priority over the other (i.e. so only 1 crit happens).
@Bribe helped get started:
The most efficient method is to put these all in one trigger as someone suggested.
The logic flow in your case is to create a variable called CritAmount (or whatever you want it to be called) and do:
Set CritAmount = 1.00
——check your crit conditions and change CritAmount to the multiplier ONLY if the multiplier is greater than CritAmount ——
Multiply the damageeventamount by CritAmount.
...but I'm still struggling with the implementation. To create a crit system which stores everything, I think I will need two things:
1) A trigger to define the crit chance + multiplier per unit:
-
Events
- Unit - A unit Learns a skill
- Unit - A unit Acquires an item
- Unit - A unit Loses an item
- Conditions
-
Actions
- Set VariableSet Crit_Chance[unit custom value] = 25.0
- Set VariableSet Crit_Multiplier[unit custom value] = 1.75
2) The system to trigger the crits. But here is were I'm stuck:
-
Events
- Game - DamageModifierEvent becomes Equal to 1.10
-
Conditions
- (DamageEventTarget is A structure) Equal to False
- DamageEventAttackT Equal to ATTACK_TYPE_HERO
- DamageEventDamageT Equal to DAMAGE_TYPE_NORMAL
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random percentage) Less than or equal to Crit_Chance[unit custom value]
-
Then - Actions
- .... this will not work, the crit chance/multiplier are overwritten if the unit has an ability + item...
- So the suggested loop will not work.
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
But this will not work, as the chances/multipliers[custom value] will overwrite each others.
Can anyone help please?