- Joined
- Apr 23, 2011
- Messages
- 322
So I'm trying to make a periodic trigger that will set all units' MS according to their HP and mana.
MS of all units on the map depends on their current HP.
100% HP=100% MS
85% HP=90% MS
70% HP=80% MS
55% HP=70% MS
40% HP=60% MS
25% HP=50% MS
10% HP=40% MS
<1% HP=30% MS
Table should have numbers in the middle as well.(77% HP=85% MS)I could write for each %, but you get the point.
(the table doesn't have to look literally the same)
On the other hand, MS of all alive (not undead) units depends on their current mana as well.
100% MP=100 MS
...
same as above
Examples:
Footman (alive) 40% HP=60% MS
Ghoul (undead) 85% HP=90% MS (if a unit has only HP, it doesn't matter if it's undead or alive)
Priest (alive) 100% HP, 0 MP=65% MS (not sure about this)
Sorceress (alive) 10% HP, 70 MP=60% MS (not sure about this)
Necromancer (undead) 100% HP, 0 MP=100% MS (undead casters' MP doesn't affect their MS)
Banshee (undead) 25% HP, 100% MP=50% MS (undead casters' MP doesn't affect their MS)
The current trigger is pretty bad and needs fixing.
According to the current one, 50% HP=50% MS, which is bad.
(note that there are MS increasing auras in the map)
MS of all units on the map depends on their current HP.
100% HP=100% MS
85% HP=90% MS
70% HP=80% MS
55% HP=70% MS
40% HP=60% MS
25% HP=50% MS
10% HP=40% MS
<1% HP=30% MS
Table should have numbers in the middle as well.(77% HP=85% MS)I could write for each %, but you get the point.
(the table doesn't have to look literally the same)
On the other hand, MS of all alive (not undead) units depends on their current mana as well.
100% MP=100 MS
...
same as above
Examples:
Footman (alive) 40% HP=60% MS
Ghoul (undead) 85% HP=90% MS (if a unit has only HP, it doesn't matter if it's undead or alive)
Priest (alive) 100% HP, 0 MP=65% MS (not sure about this)
Sorceress (alive) 10% HP, 70 MP=60% MS (not sure about this)
Necromancer (undead) 100% HP, 0 MP=100% MS (undead casters' MP doesn't affect their MS)
Banshee (undead) 25% HP, 100% MP=50% MS (undead casters' MP doesn't affect their MS)
The current trigger is pretty bad and needs fixing.
According to the current one, 50% HP=50% MS, which is bad.
(note that there are MS increasing auras in the map)
-
Speed
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
Set AllunitsMana = (Units in (Playable map area) matching (((Matching unit) is Undead) Equal to False))
-
Unit Group - Pick every unit in AllunitsMana and do (Actions)
-
Loop - Actions
-
Unit - Set (Picked unit) movement speed to ((Default movement speed of (Picked unit)) x ((Percentage mana of (Picked unit)) / 100.00))
-
-
-
Custom script: call DestroyGroup (udg_AllunitsMana)
-
Set AllunitsAlive = (Units in (Playable map area))
-
Unit Group - Pick every unit in AllunitsAlive and do (Actions)
-
Loop - Actions
-
Unit - Set (Picked unit) movement speed to ((Current movement speed of (Picked unit)) x ((Percentage life of (Picked unit)) / 100.00))
-
-
-
Custom script: call DestroyGroup (udg_AllunitsAlive)
-
-