2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
20 //------------------------------------------------------------
21 // A refueling center is one segment... to identify it in the
22 // segment structure, the "special" field is set to
23 // SEGMENT_IS_FUELCEN. The "value" field is then used for how
24 // much fuel the center has left, with a maximum value of 100.
26 //-------------------------------------------------------------
27 // To hook into Inferno:
28 // * When all segents are deleted or before a new mine is created
29 // or loaded, call fuelcen_reset().
30 // * Add call to fuelcen_create(segment * segp) to make a segment
31 // which isn't a fuel center be a fuel center.
32 // * When a mine is loaded call fuelcen_activate(segp) with each
33 // new segment as it loads. Always do this.
34 // * When a segment is deleted, always call fuelcen_delete(segp).
35 // * Call fuelcen_replentish_all() to fill 'em all up, like when
36 // a new game is started.
37 // * When an object that needs to be refueled is in a segment, call
38 // fuelcen_give_fuel(segp) to get fuel. (Call once for any refueling
39 // object once per frame with the object's current segment.) This
40 // will return a value between 0 and 100 that tells how much fuel
44 // Destroys all fuel centers, clears segment backpointer array.
46 // Create materialization center
47 int create_matcen( segment * segp );
48 // Makes a segment a fuel center.
49 void fuelcen_create( segment * segp);
50 // Makes a fuel center active... needs to be called when
51 // a segment is loaded from disk.
52 void fuelcen_activate( segment * segp, int station_type );
53 // Deletes a segment as a fuel center.
54 void fuelcen_delete( segment * segp );
56 // Charges all fuel centers to max capacity.
57 void fuelcen_replentish_all();
59 // Create a matcen robot
60 extern object *create_morph_robot(segment *segp, vms_vector *object_pos, int object_id);
62 // Returns the amount of fuel this segment can give up.
63 // Can be from 0 to 100.
64 fix fuelcen_give_fuel(segment *segp, fix MaxAmountCanTake );
66 // Call once per frame.
67 void fuelcen_update_all();
69 // Called when hit by laser.
70 void fuelcen_damage(segment *segp, fix AmountOfDamage );
72 // Called to repair an object
73 //--repair-- int refuel_do_repair_effect( object * obj, int first_time, int repair_seg );
75 #define MAX_NUM_FUELCENS 70
77 extern char Special_names[MAX_CENTER_TYPES][11];
79 //--repair-- //do the repair center for this frame
80 //--repair-- void do_repair_sequence(object *obj);
82 //--repair-- //see if we should start the repair center
83 //--repair-- void check_start_repair_center(object *obj);
85 //--repair-- //if repairing, cut it short
86 //--repair-- abort_repair_center();
88 // An array of pointers to segments with fuel centers.
89 typedef struct FuelCenter {
94 byte Lives; // Number of times this can be enabled.
98 fix Timer; //used in matcen for when next robot comes out
99 fix Disable_time; // Time until center disabled.
100 // object * last_created_obj;
101 // int last_created_sig;
103 } __pack__ FuelCenter;
105 // The max number of robot centers per mine.
106 #define MAX_ROBOT_CENTERS 20
108 extern int Num_robot_centers;
110 typedef struct matcen_info {
111 int robot_flags[2]; // Up to 64 different robots
112 fix hit_points; // How hard it is to destroy this particular matcen
113 fix interval; // Interval between materialogrifizations
114 short segnum; // Segment this is attached to.
115 short fuelcen_num; // Index in fuelcen array.
116 } __pack__ matcen_info;
118 extern matcen_info RobotCenters[MAX_ROBOT_CENTERS];
120 //--repair-- extern object *RepairObj; //which object getting repaired, or NULL
122 // Called when a materialization center gets triggered by the player flying through some trigger!
123 extern void trigger_matcen(int segnum);
125 extern void disable_matcens(void);
127 extern FuelCenter Station[MAX_NUM_FUELCENS];
128 extern int Num_fuelcenters;
130 extern void init_all_matcens(void);
132 extern fix EnergyToCreateOneRobot;
134 void fuelcen_check_for_hoard_goal(segment *segp);