/* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * * New Triggers and Switches. * */ #include #include #include #include #include "gauges.h" #include "game.h" #include "switch.h" #include "inferno.h" #ifdef EDITOR #include "editor/editor.h" #endif #include "segment.h" #include "error.h" #include "gameseg.h" #include "wall.h" #include "texmap.h" #include "fuelcen.h" #include "newdemo.h" #include "player.h" #include "endlevel.h" #include "gameseq.h" #include "multi.h" #include "network.h" #include "palette.h" trigger Triggers[MAX_TRIGGERS]; int Num_triggers; //link Links[MAX_WALL_LINKS]; //int Num_links; #ifdef EDITOR fix trigger_time_count=F1_0; //----------------------------------------------------------------- // Initializes all the switches. void trigger_init() { int i; Num_triggers = 0; // Num_links = 0; for (i=0;isides[side].wall_num; if ( wall_num == -1 ) return; trigger_num = Walls[wall_num].trigger; if (trigger_num == -1) return; if (check_trigger_sub(trigger_num, Player_num)) return; if (Triggers[trigger_num].flags & TRIGGER_ONE_SHOT) { Triggers[trigger_num].flags &= ~TRIGGER_ON; csegp = &Segments[seg->children[side]]; cside = find_connect_side(seg, csegp); Assert(cside != -1); wall_num = csegp->sides[cside].wall_num; if ( wall_num == -1 ) return; ctrigger_num = Walls[wall_num].trigger; Triggers[ctrigger_num].flags &= ~TRIGGER_ON; } #ifndef SHAREWARE #ifdef NETWORK if (Game_mode & GM_MULTI) multi_send_trigger(trigger_num); #endif #endif } } void triggers_frame_process() { int i; for (i=0;i= 0) Triggers[i].time -= FrameTime; } /* * reads a v29_trigger structure from a CFILE */ extern void trigger_read(trigger *t, CFILE *fp) { int i; t->type = cfile_read_byte(fp); t->flags = cfile_read_short(fp); t->value = cfile_read_fix(fp); t->time = cfile_read_fix(fp); t->link_num = cfile_read_byte(fp); t->num_links = cfile_read_short(fp); for (i=0; iseg[i] = cfile_read_short(fp); for (i=0; iside[i] = cfile_read_short(fp); }