Alright guys, I have a vamps game, and for those of you that don't know about it: the humans build towers around their base in order to defend themselves from the vampires. In my game, vampires gain blood from attacking a unit, and also gain Blood(their currency) based on the damage dealt.
My problem here is:
Each tower has the ability: "Blood Barrier", which would prevent the Vampire from gaining any Blood off of it. I have problems recognizing which tower has used the Blood Barrier ability for when the vampire attacks it (resulting in no blood gain, and which I'm trying to detect in the "Blood" Trigger)
Note: I couldn't make this an upgrade from the tower, or an actual effect because I'm not good with those parts of the editor, I tried basing it off of the orc "Spiked Barrier" or whatever, so I resulted to triggers and damage detection. So if there's a easier way around this, please let me know.
I know what parts are having problems, and what part of the trigger is messed up, but I just don't know what to replace them with that will make it work.
Here is the code:
NOTE: I used the GDD(GUI-Friendly Damage Detection) system.
When the tower uses the ability:
My problem here is:
Each tower has the ability: "Blood Barrier", which would prevent the Vampire from gaining any Blood off of it. I have problems recognizing which tower has used the Blood Barrier ability for when the vampire attacks it (resulting in no blood gain, and which I'm trying to detect in the "Blood" Trigger)
Note: I couldn't make this an upgrade from the tower, or an actual effect because I'm not good with those parts of the editor, I tried basing it off of the orc "Spiked Barrier" or whatever, so I resulted to triggers and damage detection. So if there's a easier way around this, please let me know.
I know what parts are having problems, and what part of the trigger is messed up, but I just don't know what to replace them with that will make it work.
Here is the code:
NOTE: I used the GDD(GUI-Friendly Damage Detection) system.
When the tower uses the ability:
-
Blood Barrier Upgrade
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Blood Barrier
-
-
Actions
-
Set Caster = (Casting unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Owner of Caster) Current lumber) Greater than or equal to 50
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
BloodBarrierUnit[NumberOfBloodUnits[(Player number of (Triggering player))]] Equal to Caster
-
-
Then - Actions
-
Game - Display to (Player group((Owner of Caster))) the text: (playercolor[1] + Error: This unit already has Blood Barrier activated.)
-
-
Else - Actions
-
Set NumberOfBloodUnits[(Player number of (Triggering player))] = (NumberOfBloodUnits[(Player number of (Triggering player))] + 1)
-
Set BloodBarrierUnit[NumberOfBloodUnits[(Player number of (Triggering player))]] = Caster
-
Unit Group - Add Caster to BloodBarrierGroup[(Player number of (Triggering player))]
-
Player - Set (Owner of Caster) Current lumber to (((Owner of Caster) Current lumber) - 50)
-
Game - Display to (Player group((Owner of Caster))) the text: (playercolor[7] + Blood Barrier has been activated on this unit.)
-
-
-
-
Else - Actions
-
Game - Display to (Player group((Owner of Caster))) the text: (playercolor[1] + Error: Not enough Lumber.)
-
-
-
-
-
Blood
-
Events
-
Game - GDD_Event becomes Equal to 0.00
-
-
Conditions
-
And - All (Conditions) are true
-
Conditions
-
(Unit-type of GDD_DamagedUnit) Not equal to Vampire
-
(Unit-type of GDD_DamageSource) Equal to Vampire
-
-
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
BloodBarrierUnit[NumberOfBloodUnits[(Player number of (Owner of GDD_DamagedUnit))]] Equal to GDD_DamagedUnit
-
-
Then - Actions
-
Else - Actions
-
Player - Set (Owner of GDD_DamageSource) Current gold to (((Owner of GDD_DamageSource) Current gold) + ((Integer(GDD_Damage)) / Blood))
-
-
-
-