User:Eoin Avro/wand: Difference between revisions
Jump to navigation
Jump to search
New page: *Source code for magic wand *Carried nicely in the hand this classic magician's wand uses coloured particles to emulate a glow from the tip of the wand. The user touches the end of the wan... |
(No difference)
|
Revision as of 02:29, 3 March 2008
- Source code for magic wand
- Carried nicely in the hand this classic magician's wand uses coloured particles to emulate a glow from the tip of the wand. The user touches the end of the wand to change colours or to switch off.
//2008 Eoin Avro //Setup pride flag colours list rainbow = [<1,0,0>, //1 red <1,.5,0>, //2 orange <1,1,0>, //3 yellow <0,1,0>, //4 green <0,0,1>, //5 blue <1,0,1>]; //6 purple integer i; default { state_entry() { llOwnerSay("Touch end of wand to activate glow"); state off; } } state off { state_entry() { llOwnerSay("Wand rests and a slight buzzing noise stops"); } touch_start(integer total_number) { state glow_black; } } state glow_black { state_entry() { llOwnerSay("Dark wand radiates pure evil"); llParticleSystem( [ 0, PSYS_PART_WIND_MASK | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_EMISSIVE_MASK, PSYS_SRC_BURST_RATE, 0.05, PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_DROP, PSYS_PART_START_COLOR,<0.01,0.0,0.0>, //Black light cannot be zero PSYS_PART_END_COLOR,<0.01,0.0,0.0>, PSYS_PART_START_ALPHA,1., PSYS_PART_END_ALPHA,1., PSYS_PART_START_SCALE, <0.25,0.25,0.>, PSYS_PART_MAX_AGE,1.5 ] ); } touch_start(integer totol_number) { llParticleSystem([]); state glow_purple; } } state glow_purple { state_entry() { llOwnerSay("You feel dark and mysterious"); llParticleSystem( [ 0, PSYS_PART_WIND_MASK | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_EMISSIVE_MASK, PSYS_SRC_BURST_RATE, 0.05, PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_DROP, PSYS_PART_START_COLOR,<0.3,0.1,0.6>, PSYS_PART_END_COLOR,<0.1,0.03,0.2>, PSYS_PART_START_ALPHA,1., PSYS_PART_END_ALPHA,1., PSYS_PART_START_SCALE, <0.25,0.25,0.>, PSYS_PART_MAX_AGE,1.5 ] ); } touch_start(integer totol_number) { llParticleSystem([]); state glow_white; } } state glow_white { state_entry() { llOwnerSay("The wand glows brightly and dark shadows flee"); llParticleSystem( [ 0, PSYS_PART_WIND_MASK | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_EMISSIVE_MASK, PSYS_SRC_BURST_RATE, 0.05, PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_DROP, PSYS_PART_START_COLOR,<1.,.9,.9>, PSYS_PART_END_COLOR,<1.,1.,1.>, PSYS_PART_START_ALPHA,1., PSYS_PART_END_ALPHA,1., PSYS_PART_START_SCALE, <0.25,0.25,0.>, PSYS_PART_MAX_AGE,1.5 ] ); } touch_start(integer totol_number) { llParticleSystem([]); state burn; } } state burn { state_entry() { llOwnerSay("Wand burns with a nasty smell"); llParticleSystem( [ 0, PSYS_PART_WIND_MASK | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_EMISSIVE_MASK, PSYS_SRC_BURST_RATE, 0.05, PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_DROP, PSYS_PART_START_COLOR,<1.,.2,.1>, PSYS_PART_END_COLOR,<0.1,0.,0.>, PSYS_PART_START_ALPHA,1., PSYS_PART_END_ALPHA,1., PSYS_PART_START_SCALE, <0.25,0.25,0.>, PSYS_PART_MAX_AGE,1.5 ] ); } touch_start(integer totol_number) { llParticleSystem([]); state gay; } } state gay { state_entry() { llOwnerSay("Wand whistles 'sing if you're glad to be gay'"); i=0; llSetTimerEvent(0.2); } timer() { i++; i=i % 6; llParticleSystem( [ 0, PSYS_PART_WIND_MASK | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_EMISSIVE_MASK, PSYS_SRC_BURST_RATE, 0.05, PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_DROP, PSYS_PART_START_COLOR,llList2Vector(rainbow,i), PSYS_PART_END_COLOR,llList2Vector(rainbow,i)*0.2, PSYS_PART_START_ALPHA,1., PSYS_PART_START_SCALE, <0.25,0.25,0.>, PSYS_PART_MAX_AGE,1.5 ] ); } touch_start(integer total_number) { llParticleSystem([]); llSetTimerEvent(0.0); state off; } }