Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ffc script Temp_Trigger{
- void run(int trigger_lw,int offset, int sfx, int window){
- int loc = ComboAt(this->X,this->Y);
- int combo = Screen->ComboD[loc];
- bool triggered;
- int timer = window;
- while(!Screen->State[ST_SECRET]){
- if(!triggered){
- for(int i = Screen->NumLWeapons();i>0;i--){
- lweapon wpn = Screen->LoadLWeapon(i);
- if(wpn->ID==trigger_lw && WeaponCollision(this,wpn))
- triggered = true;
- }
- }
- else{
- Screen->ComboD[loc]+=offset;
- Game->PlaySound(sfx);
- while(timer>0){
- timer--;
- Waitframe();
- }
- timer= window;
- Screen->ComboD[loc]-=offset;
- triggered= false;
- }
- Waitframe();
- }
- }
- }
- //D0- Combo ID of trigger
- //D1- Sound to be made
- //D2- Number of triggers in the room.
- //D3- Whether screen secrets are triggered.
- //D4- Screen->D register to store secrets in.
- ffc script Combo_Change{
- void run(int comboid, int sfx, int numTriggers, bool secret,int perm, bool temp){
- bool isBlock[176];
- bool SoundMade[176];
- bool playSound=false;
- int numChanged;
- bool triggered = false;
- int i;
- for(i=0; i<176; i++){
- SoundMade[i] = false;
- if(Screen->ComboD[i]==comboid)isBlock[i]= true;
- }
- if (Screen->D[perm])triggered = true;
- while(!triggered){
- if(temp){
- for(i=0; i<176; i++)
- SoundMade[i]=false;
- numChanged = 0;
- }
- for(i=0; i<176; i++){
- if(isBlock[i] && !SoundMade[i] && Screen->ComboD[i]!=comboid){
- SoundMade[i]=true;
- if(sfx>0)playSound = true;
- if(secret)numChanged++;
- }
- }
- if(playSound){
- Game->PlaySound(sfx);
- playSound=false;
- }
- if(numChanged == numTriggers && secret)
- triggered = true;
- Waitframe();
- }
- if(secret){
- Screen->TriggerSecrets();
- Screen->State[ST_SECRET] = true;
- }
- Screen->D[perm]= 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement