Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Notes:
- */
- // CONSTANTS
- vector vMIN_BIRTH_SIZE = < 0.023, 0.027, 0.100 >;
- float fGROWTH_RATE = 0.10000;
- integer iGROWTH_CYCLE_LIMIT = 10;
- float fAGE_RATE = 10.00000;
- float fMAX_GROWTH_AGE = 7.00000;
- float fMAX_AGE = 21.00000;
- float fPUBERTY = 7.00000;
- float fOLD = 16.00000;
- integer iDEBUG_CHANNEL = -999999;
- list lUSER_COMMANDS = ["restart", "stop clock", "start clock", "status"];
- // VARIBLES
- float fAge = 0.00000;
- integer iGrowthCycle = 0;
- /*
- Rat Markings
- Berkshire – coloured top, white belly
- Hooded – colour runs from full head down spine
- Capped – colour on full head only
- 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
- 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.
- 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).
- */
- list lMarkings = [];
- /*
- Rat Eye Colors
- black, pink, ruby,
- */
- list lEyeColors = [];
- /*
- Rat Coat Colors
- "agouti" colouring of the wild brown rat (three tones on the same hair)
- Black based colours include black, beige, and chocolate.
- */
- list lCoatColors = [];
- // FUNCTIONS
- int_all()
- {
- DEBUG("Intitalizing...");
- llListen(iDEBUG_CHANNEL, "", NULL_KEY, "");
- DEBUG("Listening to channel " + (string)iDEBUG_CHANNEL);
- llSetTimerEvent(fAGE_RATE);
- DEBUG("Timer set to " + (string)fAGE_RATE);
- llSetScale(vMIN_BIRTH_SIZE);
- DEBUG("Scale set to " + (string)vMIN_BIRTH_SIZE);
- DEBUG("Intitalization complete.");
- }
- grow()
- {
- llSetScale( llGetScale() + vMIN_BIRTH_SIZE*fGROWTH_RATE);
- DEBUG("Scale set to " + (string)llGetScale() );
- }
- breed()
- {
- DEBUG("Breed function.");
- }
- die()
- {
- llSetTimerEvent(0.00);
- DEBUG("Your rat is dead.");
- }
- DEBUG(string sString)
- {
- //OwnerSay( sString );
- //llSay( 0, sString );
- float i; for(i=0; i<1.1; i+=0.1) {
- llSetText(sString, < 1.0, 1.0, 1.0 > - < i, i, i >, 1.0-i);
- llSleep(0.1);
- }
- }
- end()
- {
- }
- // STATES
- default
- {
- state_entry()
- {
- int_all();
- }
- touch_start( integer num_detected)
- {
- llInstantMessage(llDetectedKey(0), "Possible commands: " + llList2CSV(lUSER_COMMANDS) );
- llTextBox( llDetectedKey(0), "Input command: ", iDEBUG_CHANNEL);
- }
- timer()
- {
- if( fAge < fMAX_GROWTH_AGE ) {
- grow();
- }
- if( fAge > fPUBERTY && fAge < fOLD ) {
- breed();
- }
- if( fAge > fOLD ) {
- die();
- }
- ++iGrowthCycle;
- if(iGrowthCycle > iGROWTH_CYCLE_LIMIT) {
- iGrowthCycle = 0;
- ++fAge;
- DEBUG("Age: " + (string)fAge );
- if( fAge >= fMAX_AGE ) {
- llSetTimerEvent(0.00);
- DEBUG("Timer stopped.");
- }
- }
- }
- listen(integer channel, string name, key id, string message)
- {
- if(message == "restart") {
- DEBUG("Reseting script...");
- llResetScript();
- }
- if(message == "stop_clock") {
- llSetTimerEvent(0.00);
- DEBUG("Timer stopped.");
- }
- if(message == "start_clock") {
- llSetTimerEvent(fAGE_RATE);
- DEBUG("Timer set to " + (string)fAGE_RATE);
- }
- if(message == "status") {
- DEBUG("Max growth age: " + (string)fMAX_GROWTH_AGE );
- DEBUG("Age: " + (string)fAge );
- DEBUG("Max age: " + (string)fMAX_AGE );
- DEBUG("Scale set to " + (string)llGetScale() );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement