Life and Continues System
Hello and welcome. This is my first system so bear with me. I realize it's not the best life/continue system out there. If you've played a maze or an escape you'll know that sometimes you get lives and once your lives are depleted you lose the game. Well, this system is easy to implant into your own map for your players to have lives! The amount of lives is easy to edit. It's just one value you change. The way to gain lives is fairly easy to change. It comes with a trigger that adds lives every time you pick up the item labeled Life or, in the conditions that the Tower Defense life trigger set is enabled, every five levels. When you lose all of your lives it will tell you and you can also force life loss by typing "die". There are a few test functions. To list them they are die, reset, and td. reset will revive your hero and set your lives to 3. td will turn on Tower Defense mode and you have to move up to the top left corner where the lane is. It's fairly tiny but it works . You enter and kill as many people as you want. There are 10 levels and I have yet to put in a command to reset the TD levels. It isn't as good as it could be, yet. Once I learn JASS and to make very efficient codes it won't improve unless someone out there decides to update it themselves. All comments are welcome. I really want to get better .
Code:
Init
Events
Map initialization
Conditions
Actions
For each (Integer A) from 1 to (Number of players in (All players controlled by a User player)), do (Actions)
Loop - Actions
Set Lives[(Integer A)] = 3
Code:
LoseLife
Events
Unit - A unit Dies
Conditions
Actions
For each (Integer A) from 1 to (Number of players in (All players controlled by a User player)), do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Dying unit)) Equal to (Player((Integer A)))
Then - Actions
Set Lives[(Integer A)] = (Lives[(Integer A)] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Lives[(Integer A)] Less than or equal to 0
Then - Actions
Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + has lost all of his or her lives.)
Game - Defeat (Player((Integer A))) with the message: You lost all of you...
Else - Actions
Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + ('s + ((Name of (Dying unit)) + ( has died. + ((Name of (Owner of (Dying unit))) + ( now has only + ((String(Lives[(Player number of (Owner of (Dying unit)))])) + lives left.)))))))
Set RevPoint = (Position of (Dying unit))
Hero - Instantly revive (Dying unit) at RevPoint, Show revival graphics
Custom script: call RemoveLocation(udg_RevPoint)
Else - Actions
Code:
Gainlife
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to Life
Actions
Item - Remove (Item being manipulated)
For each (Integer A) from 1 to (Number of players in (All players controlled by a User player)), do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Hero manipulating item)) Equal to (Player((Integer A)))
Then - Actions
Set Lives[(Integer A)] = (Lives[(Integer A)] + 1)
Game - Display to (All players) the text: ((Name of (Owner of (Hero manipulating item))) + ( has gained a life. + ( He now has + ((String(Lives[(Integer A)])) + lives.))))
Else - Actions
Check the map for more codes.
I've fixed it up a little and changed some code. I'll fix it up tomorrow. I have to sleep for school -_-'