Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //start_unprocessed_text
  2. /*hp_display()
  3. {
  4.     integer t;
  5.     string display="[";
  6.     for(t=10;t!=0;--t)
  7.     {
  8.         if(hp>((10-t)*max_hp/10))display+="█";
  9.         else display+="-";
  10.     }
  11.     display+="]";
  12.     llSetText(display,<1.-(float)hp/max_hp,(float)hp/max_hp,0.>,1);
  13.     if(hp==0)llDie();
  14. }
  15.  
  16. rotation adjustRotByDegrees(rotation rot, float degrees) {
  17.     return llEuler2Rot((llRot2Euler(rot)*RAD_TO_DEG+<0,0,degrees>)*DEG_TO_RAD);
  18. }
  19. integer comm_channel = 0;
  20. key rez_id;
  21.  
  22. integer hp = 40;
  23. integer max_hp = 40;
  24. default
  25. {
  26.     on_rez(integer startParam) {
  27.         if(startParam) {
  28.             hp = 40;
  29.             hp_display();
  30.             rez_id = llList2Key(llGetObjectDetails(llGetKey(),[OBJECT_REZZER_KEY]),0);
  31.             comm_channel = startParam;
  32.             llListen(comm_channel,"","","");
  33.             llSay(comm_channel,llGetKey());
  34.         }
  35.     }
  36.     state_entry(){
  37.         hp_display();
  38.     }
  39.     listen(integer channel,string name,key id,string message) {
  40.     }
  41.     collision_start(integer cs){
  42.         hp-=1;
  43.         if(hp<=0)hp=0;
  44.         if(hp>=max_hp)hp=max_hp;
  45.         hp_display();
  46.     }
  47. }
  48. */
  49. //end_unprocessed_text
  50. //nfo_preprocessor_version 0
  51. //program_version Firestorm-Release 5.0.1.52150 - FailedScience
  52. //last_compiled 04/01/2017 10:52:53
  53. //mono
  54.  
  55.  
  56.  
  57. integer comm_channel = 0;
  58. key rez_id;
  59.  
  60. integer hp = 40;
  61. integer max_hp = 40;
  62.  
  63. hp_display()
  64. {
  65.     integer t;
  66.     string display="[";
  67.     for(t=10;t!=0;--t)
  68.     {
  69.         if(hp>((10-t)*max_hp/10))display+="█";
  70.         else display+="-";
  71.     }
  72.     display+="]";
  73.     llSetText(display,<1.-(float)hp/max_hp,(float)hp/max_hp,0.>,1);
  74.     if(hp==0)llDie();
  75. }
  76. integer hexOwner;
  77. default
  78. {
  79.     on_rez(integer startParam) {
  80.         if(startParam) {
  81.             hp = 40;
  82.             hp_display();
  83.             rez_id = llList2Key(llGetObjectDetails(llGetKey(),[OBJECT_REZZER_KEY]),0);
  84.            
  85.             hexOwner = ((integer)("0x"+(string)llGetOwnerKey(rez_id)));
  86.             hexOwner = DEBUG_CHANNEL - hexOwner;
  87.             hexOwner = hexOwner - 5001;
  88.             hexOwner = -hexOwner;
  89.            
  90.             comm_channel = startParam;
  91.            
  92.             llListen(comm_channel,"","","");
  93.             llListen(hexOwner,"","","");
  94.             llSay(comm_channel,llGetKey());
  95.         }
  96.     }
  97.     state_entry(){
  98.         hp_display();
  99.     }
  100.     listen(integer channel,string name,key id,string message) {
  101.         if(channel == hexOwner){
  102.             llSetObjectDesc("RECONNECT");
  103.         }
  104.     }
  105.    
  106.     collision_start(integer cs){
  107.         hp-=1;
  108.         if(hp<=0)hp=0;
  109.         if(hp>=max_hp)hp=max_hp;
  110.         hp_display();
  111.     }
  112. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement