Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // MESSAGE CONSTANTE :
- global MSG_EnDanger = "MSG_EnDanger";
- global MSG_EnemyToFocus = "MSG_EnemyToFocus";
- global MSG_SpecialAction = "MSG_SpecialAction";
- // NE PAS TOUCHER !
- global _PROTECTION = false;
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- function SendMessage (MSG, target)
- {
- var _OK = false;
- if (MSG === MSG_EnDanger && isAlive(target)) _OK = true;
- if (MSG === MSG_EnemyToFocus && isAlive(target)) _OK = true;
- if (MSG === MSG_SpecialAction /*&& A DEFINIR */) _OK = true;
- if (_OK) sendAll(MESSAGE_CUSTOM, [MSG,target]);
- return _OK;
- }
- function getMessageOfType (MSG) //Ne pas appeler cette fonction...
- {
- if (_PROTECTION !== true) {debugE("Cette fonction ne dois pas être appelé directement, utiliser getLeeksInDanger / getEnemiesToFocus / getSpecialsActions à la place."); return null;}
- else _PROTECTION = false;
- var List = [];
- for (var msg in getMessages())
- {
- if (msg[2][0] == MSG) push(List, msg[2][1]);
- }
- return List;
- }
- function getLeeksInDanger () {_PROTECTION = true; return getMessageOfType (MSG_EnDanger); }
- function getEnemiesToFocus () {_PROTECTION = true; return getMessageOfType (MSG_EnemyToFocus); }
- function getSpecialsActions () {_PROTECTION = true; return getMessageOfType (MSG_SpecialAction); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement