+float W_Tuba_HasPlayed(entity pl, string melody)
+{
+ float i;
+ float n = tokenize_console(melody);
+ if(n > pl.tuba_lastnotes_cnt)
+ return FALSE;
+ for(i = 0; i < n; ++i)
+ {
+ vector v = pl.(tuba_lastnotes[mod(pl.tuba_lastnotes_last - i + MAX_TUBANOTES, MAX_TUBANOTES)]);
+ float ai = stof(argv(n - i - 1));
+ // n counts the last played notes BACKWARDS
+ // _x is start
+ // _y is end
+ // _z is note pitch
+ if(v_z != floor(ai))
+ return FALSE;
+ // FIXME verify rhythm
+ }
+ pl.tuba_lastnotes_cnt = 0;
+ return TRUE;
+}
+