Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.    
  3.     Notes:
  4.        
  5. */
  6.  
  7. // CONSTANTS
  8. vector  vMIN_BIRTH_SIZE     = < 0.023, 0.027, 0.100 >;
  9.  
  10. float   fGROWTH_RATE        = 0.10000;
  11. integer iGROWTH_CYCLE_LIMIT = 10;
  12. float   fAGE_RATE           = 10.00000;
  13.  
  14. float   fMAX_GROWTH_AGE     = 7.00000;
  15. float   fMAX_AGE            = 21.00000;
  16. float   fPUBERTY            = 7.00000;
  17. float   fOLD                = 16.00000;
  18.  
  19.  
  20.  
  21. integer iDEBUG_CHANNEL      = -999999;
  22. list    lUSER_COMMANDS      = ["restart", "stop clock", "start clock", "status"];
  23.  
  24.  
  25. // VARIBLES
  26. float   fAge            = 0.00000;
  27. integer iGrowthCycle    = 0;
  28.  
  29. /*
  30. Rat Markings
  31. Berkshire – coloured top, white belly
  32.  
  33. Hooded – colour runs from full head down spine
  34.  
  35. Capped – colour on full head only
  36.  
  37. Variegated – a blaze, or short white strip on the forehead, with a fully coloured head and splotches or flecks of colour run down the back only
  38.  
  39. Irish or English Irish – In England the Irish is standardized by the NFRS as an equilateral triangle of white with a side that begins at the chest, or between the front legs, and where the point ends mid length. In the United States and elsewhere, clubs like the AFRMA distinguish this marking as the English Irish and allow for another standard Irish in which the rat may have white of an even or symmetrical nature anywhere along its underside.
  40.  
  41. Other marking varieties include Dalmatian-like spotting, blazes, masks, Siamese (typically a gradient of colour along the body, darkest at the base of the tail), and "downunders" (an Australian variety which has a solid colour stripe on the belly or a colour marking that corresponds to those on top).
  42. */
  43. list    lMarkings   = [];
  44.  
  45. /*
  46. Rat Eye Colors
  47. black, pink, ruby,
  48. */
  49. list    lEyeColors  = [];
  50.  
  51. /*
  52. Rat Coat Colors
  53. "agouti" colouring of the wild brown rat (three tones on the same hair)
  54. Black based colours include black, beige, and chocolate.
  55.  
  56.  
  57. */
  58. list    lCoatColors = [];
  59.  
  60.  
  61. // FUNCTIONS
  62. int_all()
  63. {
  64.     DEBUG("Intitalizing...");
  65.    
  66.     llListen(iDEBUG_CHANNEL, "", NULL_KEY, "");
  67.     DEBUG("Listening to channel " + (string)iDEBUG_CHANNEL);
  68.    
  69.     llSetTimerEvent(fAGE_RATE);
  70.     DEBUG("Timer set to " + (string)fAGE_RATE);
  71.    
  72.     llSetScale(vMIN_BIRTH_SIZE);
  73.     DEBUG("Scale set to " + (string)vMIN_BIRTH_SIZE);
  74.    
  75.     DEBUG("Intitalization complete.");
  76. }
  77.  
  78. grow()
  79. {
  80.     llSetScale( llGetScale() + vMIN_BIRTH_SIZE*fGROWTH_RATE);
  81.     DEBUG("Scale set to " + (string)llGetScale() );
  82. }
  83.  
  84. breed()
  85. {
  86.    
  87.     DEBUG("Breed function.");
  88. }
  89.  
  90. die()
  91. {
  92.     llSetTimerEvent(0.00);
  93.     DEBUG("Your rat is dead.");
  94. }
  95.  
  96. DEBUG(string sString)
  97. {
  98.     //OwnerSay( sString );
  99.     //llSay( 0, sString );
  100.    
  101.     float i; for(i=0; i<1.1; i+=0.1) {
  102.         llSetText(sString, < 1.0, 1.0, 1.0 > - < i, i, i >, 1.0-i);
  103.         llSleep(0.1);
  104.     }
  105. }
  106.  
  107. end()
  108. {
  109.    
  110. }
  111.  
  112.  
  113. // STATES
  114. default
  115. {
  116.     state_entry()
  117.     {
  118.         int_all();
  119.     }
  120.    
  121.     touch_start( integer num_detected)
  122.     {
  123.         llInstantMessage(llDetectedKey(0), "Possible commands: " + llList2CSV(lUSER_COMMANDS) );
  124.         llTextBox( llDetectedKey(0), "Input command: ", iDEBUG_CHANNEL);
  125.     }
  126.    
  127.     timer()
  128.     {
  129.         if( fAge < fMAX_GROWTH_AGE ) {
  130.             grow();
  131.         }
  132.         if( fAge > fPUBERTY && fAge < fOLD ) {
  133.             breed();
  134.         }
  135.         if( fAge > fOLD ) {
  136.             die();
  137.         }
  138.        
  139.         ++iGrowthCycle;
  140.         if(iGrowthCycle > iGROWTH_CYCLE_LIMIT) {
  141.             iGrowthCycle = 0;
  142.             ++fAge;
  143.             DEBUG("Age: " + (string)fAge );
  144.             if( fAge >= fMAX_AGE ) {
  145.                 llSetTimerEvent(0.00);
  146.                 DEBUG("Timer stopped.");
  147.             }
  148.         }
  149.     }
  150.    
  151.     listen(integer channel, string name, key id, string message)
  152.     {
  153.         if(message == "restart") {
  154.             DEBUG("Reseting script...");
  155.             llResetScript();
  156.         }
  157.         if(message == "stop_clock") {
  158.             llSetTimerEvent(0.00);
  159.             DEBUG("Timer stopped.");
  160.         }
  161.         if(message == "start_clock") {
  162.             llSetTimerEvent(fAGE_RATE);
  163.             DEBUG("Timer set to " + (string)fAGE_RATE);
  164.         }
  165.         if(message == "status") {
  166.             DEBUG("Max growth age: " + (string)fMAX_GROWTH_AGE );
  167.             DEBUG("Age: " + (string)fAge );
  168.             DEBUG("Max age: " + (string)fMAX_AGE );
  169.             DEBUG("Scale set to " + (string)llGetScale() );
  170.         }
  171.     }
  172.  
  173. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement