readme.NOW

readme.NOW · 26.0 KB

From the archive spacev2.zip

Download the archive   « Back to the archive contents

______________________________________________________________________________
foreword and disclaimer:

  from a discontinued project, an improved version of the space system. vast
  improvements include a part-based ship. all weapons, shield generators, any
  hyperdrive/sled, onboard computers, etc. comprise the whole of the ship.
  this allows for an unlimited combination of weaponry on a ship, limited only
  by its maximum size. included in this package is quite a few things, as this
  is a fairly complicated snippet:

  space.c: sorry 'bout this. major revamp, too lazy to skim through and figure
    out what all exactly was changed. off the top of head, though, there is
    less spammy combat (two lines per shot), with easier-to-decypher color.
    mob ship combat is -incomplete-. more 'realistic' interaction with a ship,
    switching between weapon systems, turning on/off tarcoms, what be it. ion
    damage calculation is -incomplete-. target, possibly radar do not identify
    parts yet (they should, to calc targetting times, and, uh, yeah). firing
    is a little simpler, just switch (weapon system) and fire.

  ships.c: just gonna throw the entire file in here also. don't see any big
    reason why fote's would change much in it.

  add_timer changeup: instead of ticks, timers must now run in seconds. used
    to time torpedo/missile tube reloading, target acquisition, and whatever
    else. feel free to integrate it into other things (like grenade timers).

  const.c addition: prefabricated ship parts. ships do not -require- prefab'd
    parts, these are just provided as a, uh, whatnot. purchasing them (and
    converting to item form) is -not- completed.
  
  handler.c addition: small function, remove_part_timer

  tables.c addition: to recognize commands. new ones are throttle, switch, 
    partlist, and partstat. maybe more.

  mud.h addition: defines, declarations, and structs. yep.


  as for the disclaimer:

  i am well aware that a good deal of this is unrefined and/or incomplete. it
  was taken from a discontinued project, and was felt that should be made
  available instead of sitting idly on a hard drive. expect bugs, expect more
  changes to be done. expect to -work- a bit to get this fully operational.
  it's damn cool, and worth it. but only you can make it happen.

  and to be perfectly legal: i am in no way responsible for any damages that
  you incur if you incur when you incur them using this code. the code is 
  solid, just not fully complete, and possibly just damned complicated. 
  use at own risk.

  that's about it. keep in mind: it's a major overhaul. you'll need to make
  entirely new ship prototypes. any changes done from stock fote to space will
  need be redone.

  another thing to keep in mind: just because it's released like this, doesn't
  mean you can't re-release it when you've refined, completed, bughunted, or
  whatever else. i'd actually prefer that. so would most everyone else. as a
  personal challenge to you: if you take this snippet, i dare you to complete
  it, make it better, and release it. you chicken, or what? yeah. that's what
  i thought.

  uh, one more note. my memory seems to be lacking in my old age, so i'm not
  entirely sure this is complete (as, is). if it isn't, let me know, i'll see 
  what else i've forgotten.

  enjoy.
                                                -- Yerok G'Nik
______________________________________________________________________________




((( add to mud.h, throw these up top )))

/*
 *
 * space v2, (c) 2004 Yerok G'Nik
 *
 * freely distribute, modify, as long as
 * header and any subsequent headers are
 * unmodified.
 *
 * various declarations and definitions
 *
 */

typedef struct	part_data		PART_DATA;
typedef struct	payload_data		PAYLOAD_DATA;

#define MAX_PART		  168 // as per const.c

/*
 *
 * kinda hackish, beam fires once, abeam fires thrice. was included
 * to support autoblaster fire, probably a cleaner way to do it, as
 * the model was based from stock fote space. the other part types
 * are fairly self explanitory, 'cept:
 *
 * PART_TARCOM: targetting computer. no autotrack without it.
 * PART_NAVCOM: navigation computer, no hyper/calc without.
 * PART_SENSOR: designates radar whatnots.
 * PART_COUNTERMEASURE: chaff, was planned to support jamming, or whatever else.
 *
 */

typedef enum {
 PART_BEAM, PART_ABEAM, PART_TUBE, PART_TURRET, PART_ENGINE, PART_HYPER, 
 PART_SHIELD, PART_TARCOM, PART_NAVCOM, PART_SENSOR, PART_CARGOHOLD, 
 PART_MISSILE, PART_TORPEDO, PART_COUNTERMEASURE
} parts;




((( middle, or bottom works for the following )))

/*
 *
 * space v2, (c) 2004 Yerok G'Nik
 *
 * freely distribute, modify, as long as
 * header and any subsequent headers are
 * unmodified.
 *
 * part and payload structures
 *
 */

struct part_data
{
	PART_DATA *next;
	PART_DATA *prev;
	PAYLOAD_DATA *first_payload;
	PAYLOAD_DATA *last_payload;
	PAYLOAD_DATA *firing;
	TIMER *first_timer;
	TIMER *last_timer;
	char *name;
	int type;
	int count;
	int hit;         // support part damage/destruction
	int maxhit;      
	int v1;          /*
	int v2;           * these vary per part, i'll go ahead and
	int v3;           * give a brief rundown in the const.c
	int v4;           * addition for what does what.
	int v5;           *
	int v6;           */
	int cost;
	float size;
	int military;   // imperial-restricted or no
	int fired;
};

struct payload_data
{
	PAYLOAD_DATA *next;
	PAYLOAD_DATA *prev;
	char *name;
	int type;
	int salvo;
	int class;
	int v1;
	int v2;
	int v3;
	int v4;
	int v5;
	int v6;
	int cost;
	float size;
	int military;
};



((( add to struct ship_data )))

    PART_DATA * first_part;  /*
    PART_DATA * last_part;    *  space v2 shits
    PART_DATA * firing;       */


((( declare do_fun and add these to tables where necessary )))

 do_payload		// should have no problems naming this 'payload'
 do_weaponswitch	// suggest changing old switch (into mob) name to mswitch
 do_partlist
 do_partstat

((( end mud.h additions )))


((( add to const.c )))


/*
 *
 * space v2, (c) 2004 Yerok G'Nik
 *
 * freely distribute, modify, as long as
 * header and any subsequent headers are
 * unmodified.
 *
 * pre-fab'd ship parts.
 * 
 * highly suggest creating function that itemizes parts, and
 * an accompanying one that allows installation. can then buy
 * from the part list, or have tech/eng able to create.
 *
 */

const struct part_type part_table [MAX_PART] =
{
 /*
    beam weapon: physical damage, shield damage, ion damage rating, fuel drain, HP, 0, cost, size, part type, military
    warhead tube: missile salvo, torpedo salvo, class accepted, 0, HP, cost, size, part type, military
    engine: speed rating, maneuver rating, fuel rating, class size, HP, cost, size, part type, military
    hyperdrive: hyper rating, 0, 0, 0, hp, cost, size, part type, military
    shield gen: rating, ion damage resistance, fuel drain
    target comp: t
    nav comp: hyper calc time, hyper efficiency (- to fuel drain)
    warhead: physical damage, shield drain, speed, ion damage, 0, cost, size, part type, military
	hull: rating, cost, size
    turret: physical damage, shield damage, fuel drain, ion damage rating, HP, cost, size, part type, military
    countermeasures: salvo, type, cost, size


    *** to the best of my knowledge, the above is correct. good chance it is not, though ***
 */

// begin BEAM parts

 { "Taim and Bak IX-4 Light Laser",
	5, 2, 0, 2, 0, 0, 25, 5750, 0.2, PART_BEAM, 0 },
 { "Taim and Bak KX-9 Medium Laser",
	7, 3, 0, 4, 0, 0, 28, 16400, 0.6, PART_BEAM, 0 },
 { "Taim and Bak KT-6 Heavy Blaster",
	26, 11, 0, 9, 0, 0, 95, 89750, 1.9, PART_BEAM, 0 },
 { "Gyrhil Technologies R-9x Light Laser",
	6, 3, 0, 2, 0, 0, 30, 9540, 0.3, PART_BEAM, 0 },
 { "Gyrhil Technologies AA-72 Twin Autoblaster",
	2, 1, 0, 1, 0, 0, 20, 6220, 0.4, PART_ABEAM, 0 },
 { "Merr-Sonn Mark 4e/S Heavy Laser",
        28, 10, 0, 15, 0, 0, 105, 101050, 3.6, PART_BEAM, 0 },
 { "Senko Systems Tru-Lok 5000 Light Laser",
        5, 3, 0, 3, 0, 0, 22, 5990, 0.3, PART_BEAM, 0 },
 { "Senko Systems Tru-Lok 5000x2 Medium Laser",
        11, 6, 0, 5, 0, 0, 30, 17250, 0.7, PART_BEAM, 0 },
 { "Sund Arms x2-100 Light Laser",
	6, 1, 0, 2, 0, 0, 22, 5150, 0.2, PART_BEAM, 0 },
 { "Seinar Fleet Systems L-s7.2 Medium Laser",
	8, 4, 0, 3, 0, 0, 30, 19940, 0.8, PART_BEAM, 1 },
 { "Seinar Fleet Systems L-s9.3 Medium Laser",
	11, 4, 0, 5, 0, 0, 35, 22010, 0.8, PART_BEAM, 1 },
 { "Seinar Fleet Systems L-x3.1 Heavy Laser",
	35, 12, 0, 19, 0, 0, 110, 125010, 3.8, PART_BEAM, 1 },
 { "Incom k-43 Heavy Laser",
	24, 9, 0, 10, 0, 0, 70, 85600, 3.2, PART_BEAM, 0 },
 { "Incom k-98 Heavy Laser",
	31, 10, 0, 15, 0, 0, 85, 110600, 3.5, PART_BEAM, 0 },
 { "BlasTech Corporation HY-6 Heavy Laser",
        30, 12, 0, 16, 0, 0, 98, 95150, 3.6, PART_BEAM, 1 },
 { "BlasTech Corporation Prm-3 Light Autoblaster",
	2, 0, 0, 1, 0, 0, 20, 3800, 0.2, PART_ABEAM, 0 },
 { "BlasTech Corporation Ax-108 Autoblaster",
	2, 2, 0, 1, 0, 0, 27, 9010, 0.4, PART_ABEAM, 0 },
 { "BlasTech Corporation MICI Light Ion",
	0, 2, 1, 1, 0, 0, 18, 4505, 0.2, PART_BEAM, 0 },
 { "Borstel NK-3 Light Ion",
	0, 5, 1, 2, 0, 0, 20, 7100, 0.2, PART_BEAM, 0 },
 { "Borstel RH-8 Medium Laser",
	8, 3, 0, 3, 0, 0, 30, 13900, 1.2, PART_BEAM, 0 },
 { "Borstel RG-4 Light Laser",
	3, 1, 0, 1, 0, 0, 22, 1950, 0.3, PART_BEAM, 0 },
 { "Mendarn Arms DAR-2 Medium Ion",
	0, 9, 3, 8, 0, 0, 31, 16100, 0.9, PART_BEAM, 0 },
 { "ArMek Technologies SW-4 Light Ion",
	0, 4, 1, 4, 0, 0, 25, 5900, 0.2, PART_BEAM, 0 },
 { "ArMek Technologies SW-7a Medium Ion",
	0, 8, 2, 6, 0, 0, 27, 16950, 0.9, PART_BEAM, 0 },
 { "ArMek Technologies RAC-2b Repeating Ion",
	0, 3, 2, 3, 0, 0, 20, 35010, 1.4, PART_BEAM, 1 },
 { "GenaTech Zeta-1 Medium Ion",
	0, 9, 3, 7, 0, 0, 30, 15450, 1.1, PART_BEAM, 0 },
 { "GenaTech Adna-5 Heavy Ion",
	0, 25, 4, 12, 0, 0, 70, 90510, 3.3, PART_BEAM, 0 },
 { "Comar Systems f-2 Light Ion",
	0, 4, 1, 3, 0, 0, 20, 6550, 0.2, PART_BEAM, 0 },
 { "Comar Systems f-2a Repeating Ion",
	0, 1, 1, 1, 0, 0, 20, 12100, 0.4, PART_ABEAM, 0 },
 { "Comar Systems f-9 Heavy Ion",
	0, 32, 5, 18, 0, 0, 55, 138500, 3.6, PART_BEAM, 0 },

// end BEAM parts (30)
// begin TUBE parts

	{ "Krupx Munitions MG5 Missile Tube",
		4, 0, 1, 1, 6, 0, 25, 4650, 0.5, PART_TUBE, 0 },
	{ "Krupx Munitions MG7 Torpedo Tube",
	    0, 6, 1, 1, 8, 0, 28, 7200, 0.7, PART_TUBE, 0 },
	{ "Krupx Munitions MG9 Torpedo Tube",
	    0, 2, 2, 1, 10, 0, 30, 16400, 0.9, PART_TUBE, 0 },
	{ "Dymek Arms HM-6 Missile Tube",
		6, 0, 1, 1, 8, 0, 24, 8100, 0.5, PART_TUBE, 0 },
	{ "Dymek Arms HM-8 Torpedo Tube",
		0, 6, 1, 1, 8, 0, 26, 9850, 0.8, PART_TUBE, 0 },
	{ "Arakyd Industries Hi-fex Torpedo Tube",
		0, 12, 1, 2, 10, 0, 40, 24850, 1.6, PART_TUBE, 0 },
	{ "Arakyd Industries Morne-3 Missile Tube",
		10, 0, 1, 2, 20, 0, 36, 13300, 1.1, PART_TUBE, 0 },
	{ "Arakyd Industries Flex Torpedo Tube",
		0, 4, 1, 1, 11, 0, 22, 5510, 0.5, PART_TUBE, 0 },
	{ "Seinar M-g2 General Purpose Tube",
		3, 3, 1, 1, 8, 0, 28, 26100, 0.9, PART_TUBE, 1 },
	{ "Seinar M-s3 Missile Tube",
		8, 0, 1, 1, 8, 0, 25, 14900, 1.0, PART_TUBE, 1 },
	{ "Seinar T-s5 Torpedo Tube",
		0, 8, 1, 1, 8, 0, 27, 17150, 1.0, PART_TUBE, 1 },
	{ "Corellian CEC-m3 Missile Tube",
		6, 0, 1, 1, 7, 0, 24, 8750, 0.6, PART_TUBE, 0 },
	{ "Corellian CEC-m8 Missile Tube",
		2, 0, 2, 1, 18, 0, 32, 17210, 1.2, PART_TUBE, 0 },

// end TUBE parts (13)
// begin ENGINE parts

    { "Koensayr R200 Ion Fission Engine", 
		44, 28, 950, 1, 0, 0, 125, 21300, 2.6, PART_ENGINE, 0 },
	{ "Koensayr R950 Ion Fission Engine",
		15, 5, 3500, 3, 0, 0, 225, 290500, 14.2, PART_ENGINE, 0 },
	{ "Slayn and Korpil JZ-5 Fusial Thrust Engine",
		21, 18, 550, 1, 0, 0, 120, 17550, 1.6, PART_ENGINE, 0 },
	{ "Slayn and Korpil JZ-5g7 Fusial Thrust Engine",
		23, 21, 550, 1, 0, 0, 130, 20050, 1.7, PART_ENGINE, 0 },
    { "Sorosuub 9X2 Fusial Thrust Engine",
		22, 27, 750, 1, 0, 0, 80, 16010, 1.4, PART_ENGINE, 0 },
	{ "Sorosuub Viper 40 Fusial Thrust Engine",
		44, 34, 1600, 2, 0, 0, 205, 105400, 5.6, PART_ENGINE, 0 },
	{ "Seinar Fleet Systems P-s4 Ion Fission Engine",
		53, 71, 400, 1, 0, 0, 75, 34310, 4.1, PART_ENGINE, 1 },
	{ "Seinar Fleet Systems P-s5.6 Ion Fission Engine",
		39, 46, 850, 1, 0, 0, 87, 37900, 4.1, PART_ENGINE, 1 },
	{ "Seinar Fleet Systems P-s7.4 Ion Fission Engine",
		64, 68, 700, 1, 0, 0, 90, 41050, 4.2, PART_ENGINE, 1 },
	{ "Seinar Fleet Systems Starscream-9 Ion Drive",
		20, 4, 2750, 3, 0, 0, 240, 327050, 16.0, PART_ENGINE, 1 },
	{ "Telgorn Corporation IA/4 Fusial Thrust Engine",
		29, 22, 1400, 2, 0, 0, 110, 121050, 3.9, PART_ENGINE, 0 },
	{ "Corellian Engineering Corp. Evader GT Ion Drive",
		22, 49, 1100, 2, 0, 0, 130, 139200, 3.3, PART_ENGINE, 0 },
	{ "Corellian Engineering Corp. Dyne 2577 Ion Drive",
		72, 45, 2350, 2, 0, 0, 132, 163150, 8.4, PART_ENGINE, 0 },
	{ "Cygnus Spaceworks Gemon-4 Ion Fission Engine",
		14, 6, 2200, 3, 0, 0, 235, 370500, 14.9, PART_ENGINE, 0 },
	{ "Cygnus Spaceworks 4-K7 Ion Fission Engine",
		37, 18, 1250, 2, 0, 0, 90, 110440, 4.6, PART_ENGINE, 0 },
    { "Novaldex Technologies J-77 Fusial Thrust Engine",
		66, 41, 600, 1, 0, 0, 75, 18910, 2.4, PART_ENGINE, 0 },
    { "Novaldex Technologies JV-71 Fusial Thrust Engine",
		34, 38, 950, 1, 0, 0, 92, 23000, 2.6, PART_ENGINE, 0 },
	{ "Novaldex Technologies O-4Z Fusial Thrust Engine",
		26, 20, 450, 1, 0, 0, 88, 16700, 1.4, PART_ENGINE, 0 },
	{ "Novaldex Technologies O3-R Fusial Thrust Engine",
		38, 36, 300, 1, 0, 0, 60, 19900, 1.7, PART_ENGINE, 0 },
	{ "Incom 6x4 Fusial Thrust Engine",
		24, 18, 500, 1, 0, 0, 65, 15610, 1.5, PART_ENGINE, 0 },
	{ "Incom 4j.4 Fusial Thrust Engine",
		28, 22, 650, 1, 0, 0, 98, 21100, 1.8, PART_ENGINE, 0 },
	{ "Incom BG2300 Fusial Thrust Engine",
		11, 10, 2250, 3, 0, 0, 242, 441100, 15.2, PART_ENGINE, 0 },
    { "Kuat Drive Yards Galaxy-15 Ion Drive",
		18, 4, 2000, 3, 0, 0, 260, 399500, 16.2, PART_ENGINE, 1 },
	{ "Kuat Drive Yards T-c40 Ion Fission Engine",
		16, 2, 2850, 3, 0, 0, 255, 385000, 16.0, PART_ENGINE, 0 },
	{ "Kuat Drive Yards A-9x Ion Fission Engine",
		33, 21, 600, 1, 0, 0, 60, 27900, 2.0, PART_ENGINE, 0 },

// end ENGINE parts (25)
// begin HYPER parts

    { "Seinar Fleet Systems N.D9 Hyperdrive Unit",
		17, 1, 0, 0, 0, 0, 65, 41500, 2.4, PART_HYPER, 1 },
	{ "Rendili StarDrives ATA-9a Hyperdrive Unit",
		16, 1, 0, 0, 0, 0, 33, 39150, 2.3, PART_HYPER, 0 },
	{ "Rendili StarDrives ATA-9b Hyperdrive Unit",
		11, 1, 0, 0, 0, 0, 35, 59010, 2.6, PART_HYPER, 0 },
	{ "Rendili StarDrives ATX-5 Hyperdrive Unit",
		15, 2, 0, 0, 0, 0, 72, 110900, 5.7, PART_HYPER, 0 },
	{ "Rendili StarDrives ATX-7 Hyperdrive Unit",
		10, 2, 0, 0, 0, 0, 75, 147400, 5.9, PART_HYPER, 0 },
	{ "Rendili StarDrives CI-4-A Hyperdrive Unit",
		11, 3, 0, 0, 0, 0, 280, 533020, 14.0, PART_HYPER, 0 },
    { "Incom GBk-435 Hyperdrive Unit",
		20, 1, 0, 0, 0, 0, 42, 30100, 2.4, PART_HYPER, 0 },
	{ "Incom GBk-785 Hyperdrive Unit",
		18, 1, 0, 0, 0, 0, 45, 36050, 2.3, PART_HYPER, 0 },
	{ "Incom GBp-629 Hyperdrive Unit",
		12, 1, 0, 0, 0, 0, 51, 51450, 2.2, PART_HYPER, 0 },
	{ "Cygnus Spaceworks HD7 Hyperdrive Unit",
		15, 2, 0, 0, 0, 0, 81, 139010, 5.4, PART_HYPER, 0 },
	{ "Cygnus Spaceworks Nova-1 Hyperdrive Unit",
		9, 2, 0, 0, 0, 0, 65, 195100, 5.8, PART_HYPER, 0 },
	{ "Sorosuub Griffyn-XTG Hyperdrive Unit",
		13, 2, 0, 0, 0, 0, 95, 105100, 5.8, PART_HYPER, 0 },
	{ "Sorosuub SolarSail-LS Hyper-sled",
		27, 1, 0, 0, 0, 0, 23, 23000, 1.7, PART_HYPER, 0 },
	{ "Koensayr R300-H Hyperdrive Unit",
		13, 1, 0, 0, 0, 0, 61, 43050, 2.5, PART_HYPER, 0 },
	{ "Koensayr CL-1400 Hyperdrive Unit",
		19, 1, 0, 0, 0, 0, 65, 31900, 2.0, PART_HYPER, 0 },
	{ "TriLuna Systems 400-MGS Hyperdrive Unit",
		14, 3, 0, 0, 0, 0, 310, 439050, 13.8, PART_HYPER, 0 },
	{ "TriLuna Systems 450-MGT Hyperdrive Unit",
		12, 3, 0, 0, 0, 0, 340, 476000, 14.2, PART_HYPER, 0 },
	{ "Corellian Engineering Corp. H2-1 Hyperdrive Unit",
		21, 1, 0, 0, 0, 0, 59, 33450, 2.2, PART_HYPER, 0 },
	{ "Corellian Engineering Corp. HSU-6 Hyper-sled",
		36, 1, 0, 0, 0, 0, 30, 14770, 1.6, PART_HYPER, 0 },
	{ "Corellian Engineering Corp. HSU-8 Hyper-sled",
		32, 1, 0, 0, 0, 0, 32, 19300, 1.6, PART_HYPER, 0 },
	{ "Slayn and Korpil HYd-997 Hyperdrive Unit",
		12, 1, 0, 0, 0, 0, 42, 49650, 2.8, PART_HYPER, 0 },
	{ "Seinar Fleet Systems I-a2b Hyperdrive Unit",
		10, 3, 0, 0, 0, 0, 325, 521050, 14.8, PART_HYPER, 1 },

// end HYPER parts (22)
// begin SHIELD parts
	{ "Phoah-Kingsmeyer 484-J4e Shield Projector",
		20, 0, 6, 1, 0, 0, 42, 20970, 2.2, PART_SHIELD, 0 },
	{ "Phoah-Kingsmeyer 501-A2c Shield Projector",
		35, 0, 6, 1, 0, 0, 50, 26610, 2.6, PART_SHIELD, 0 },
	{ "Phoah-Kingsmeyer 009-Ion-D Ion Dissipatory Field",
		0, 3, 11, 1, 0, 0, 38, 58700, 3.3, PART_SHIELD, 0 },
	{ "Kuat Drive Yards ISD-72x Shield Generator",
		240, 1, 35, 1, 0, 0, 310, 394050, 10.6, PART_SHIELD, 1 },
	{ "Delphus JA-140 Shield Generator",
		110, 1, 18, 2, 0, 0, 228, 205000, 8.9, PART_SHIELD, 0 },
	{ "Delphus JC-671 Shield Generator",
		125, 1, 20, 2, 0, 0, 249, 241100, 9.2, PART_SHIELD, 0 },
	{ "Novaldex Industries DuR-1 Shield Projector",
		18, 0, 4, 1, 0, 0, 28, 17550, 1.7, PART_SHIELD, 0 },
	{ "Novaldex Industries DuR-4 Shield Projector",
		62, 0, 7, 1, 0, 0, 63, 67810, 5.3, PART_SHIELD, 0 },
	{ "Novaldex Industries MM-2a Shield Projector",
		46, 1, 16, 2, 0, 0, 32, 89300, 5.5, PART_SHIELD, 0 },
	{ "Novaldex Industries AuG-90 Shield Projector",
		95, 0, 18, 2, 0, 0, 110, 149050, 8.6, PART_SHIELD, 0 },
	{ "Sirplex, Inc. Z-9 Shield Projector",
		23, 0, 3, 1, 0, 0, 25, 23990, 1.9, PART_SHIELD, 0 },
	{ "Sirplex, Inc. Zr-41 Shield Projector",
		48, 0, 5, 1, 0, 0, 31, 47070, 2.5, PART_SHIELD, 0 },
	{ "Sirplex, Inc. Zd-1 Shield Projector",
		57, 0, 7, 2, 0, 0, 58, 61000, 3.3, PART_SHIELD, 0 },
	{ "Sirplex, Inc. S-4d Shield Projector",
		15, 0, 2, 1, 0, 0, 24, 15200, 1.5, PART_SHIELD, 0 },
	{ "Sirplex, Inc. S-4f Shield Projector",
		18, 0, 2, 1, 0, 0, 25, 16750, 1.7, PART_SHIELD, 0 },
	{ "Om Thaim Systems BB-6 Shield Generator",
		165, 1, 10, 3, 0, 0, 138, 310400, 9.8, PART_SHIELD, 0 },
	{ "Om Thaim Systems BB-8 Shield Generator",
		188, 1, 12, 3, 0, 0, 144, 360000, 10.1, PART_SHIELD, 0 },
	{ "Om Thaim Systems IR-f/11 Ion Flux Generator",
		60, 3, 21, 3, 0, 0, 109, 679090, 12.0, PART_SHIELD, 0 },

// end SHIELD parts (18)
// begin COMPUTER parts
	{ "Jung Flexsystems ALm-2000 Targetting System",
		4, 1, 0, 0, 0, 0, 15, 9710, 0.1, PART_TARCOM, 0 },
	{ "Jung Flexsystems ALp-2100 Targetting System",
		4, 2, 0, 0, 0, 0, 15, 16150, 0.1, PART_TARCOM, 0 },
	{ "Microaxial Tr-10/a Targetting System",
		3, 0, 0, 0, 0, 0, 15, 12900, 0.1, PART_TARCOM, 0 },
	{ "Microaxial Tr-10/b Targetting System",
		3, 1, 0, 0, 0, 0, 15, 14400, 0.1, PART_TARCOM, 0 },
	{ "Narmox Sr-1100 Targetting System",
		3, 2, 0, 0, 0, 0, 15, 26870, 0.2, PART_TARCOM, 0 },
	{ "Fabritech ANq-2.1 'Sightline' Targetting System",
		3, -2, 0, 0, 0, 0, 15, 9710, 0.1, PART_TARCOM, 0 },
	{ "Fabritech ANq-2.4 Targetting System",
		4, 1, 0, 0, 0, 0, 15, 11000, 0.1, PART_TARCOM, 0 },
	{ "Fabritech ANq-3.6 Targetting System",
		3, 1, 0, 0, 0, 0, 15, 16950, 0.1, PART_TARCOM, 0 },
	{ "Fabritech ANc-2.7 Targetting System",
		4, 2, 0, 0, 0, 0, 15, 18100, 0.1, PART_TARCOM, 0 },
	{ "Seinar Fleet Systems T-s7b Tracking System",
		2, 0, 0, 0, 0, 0, 15, 8450, 0.1, PART_TARCOM, 1 },
	{ "Seinar Fleet Systems T-s8 Tracking System",
		2, -1, 0, 0, 0, 0, 15, 7710, 0.1, PART_TARCOM, 1 },
	{ "Seinar Fleet Systems T-s9a Tracking System",
		1, -1, 0, 0, 0, 0, 15, 18840, 0.1, PART_TARCOM, 1 },
	{ "Seinar Fleet Systems N-s4 Navcom Unit",
		9, 2, 0, 0, 0, 0, 15, 16110, 0.1, PART_NAVCOM, 1 },
	{ "Seinar Fleet Systems N-s6.8 Navcom Unit",
		7, 2, 0, 0, 0, 0, 15, 19870, 0.1, PART_NAVCOM, 1 },
	{ "Fabritech LCa-2.3 Navcom Unit",
		14, 4, 0, 0, 0, 0, 15, 3950, 0.1, PART_NAVCOM, 0 },
	{ "Fabritech LCa-2.9 Navcom Unit",
		10, 3, 0, 0, 0, 0, 15, 5100, 0.1, PART_NAVCOM, 0 },
    { "Microaxial LpL-449 Navcom Unit",
		10, 3, 0, 0, 0, 0, 15, 15490, 0.1, PART_NAVCOM, 0 },
	{ "Microaxial LpM-549 Navcom Unit",
		8, 2, 0, 0, 0, 0, 15, 20350, 0.1, PART_NAVCOM, 0 },
	{ "Astronav P127 Navcom Unit",
	    2, 1, 0, 0, 0, 0, 15, 76010, 0.1, PART_NAVCOM, 0 },
	{ "Astronav P120 Navcom Unit",
		6, 1, 0, 0, 0, 0, 0, 51000, 0.1, PART_NAVCOM, 0 },
	{ "Narmox Zr-390 Navcom Unit",
		12, 3, 0, 0, 0, 0, 0, 4210, 0.1, PART_NAVCOM, 0 },
	{ "Novastar L-17a Quickjump Navcom Unit",
		3, 3, 0, 0, 0, 0, 0, 41500, 0.1, PART_NAVCOM, 0 },
	{ "Seinar Fleet Systems S-s3a Sensor Array",
		1250, 4, 0, 0, 0, 0, 0, 13940, 0.1, PART_SENSOR, 1 },
	{ "Fabritech ANs-9.5w Sensor Array",
		900, 3, 0, 0, 0, 0, 0, 10430, 0.1, PART_SENSOR, 0 },
	{ "Fabritech ANs-9q Sensor Array",
		920, 3, 0, 0, 0, 0, 0, 11160, 0.1, PART_SENSOR, 0 },
	{ "Fabritech ANx-y/2 Sensor Array",
		880, 2, 0, 0, 0, 0, 0, 17100, 0.1, PART_SENSOR, 0 },
	{ "Fabritech LongView-382.X Sensor Array",
		1720, 5, 0, 0, 0, 0, 0, 41920, 0.2, PART_SENSOR, 0 },
	{ "Fabritech ANs-5d Sensor Array",
		950, 3, 0, 0, 0, 0, 0, 16050, 0.1, PART_SENSOR, 0 },
	{ "Jung Flexsystems JF-4a/L Sensor Array",
		1100, 4, 0, 0, 0, 0, 0, 31900, 0.1, PART_SENSOR, 0 },
	{ "Remind me to make more computer shit. Tired now.",
		0, 0, 0, 0, 0, 0, 0, 0, 0.1, PART_SENSOR, 0 },

// end COMPUTER parts (29)
// begin WARHEAD parts
	{ "Krupx MG-5 Concussion Missile",
		22, 11, 0, 140, 1, 0, 0, 310, 0.1, PART_MISSILE, 0 },
	{ "Krupx MG-7 Proton Torpedo",
		46, 20, 0, 87, 1, 0, 0, 405, 0.1, PART_TORPEDO, 0 },
	{ "Krupx T-33 Plasma Torpedo",
		0, 95, 0, 80, 2, 0, 0, 1670, 0.2, PART_TORPEDO, 0 },
	{ "Arakyd ACM-9 Concussion Missile",
		25, 13, 0, 130, 1, 0, 0, 325, 0.1, PART_MISSILE, 0 },
	{ "Arakyd APT-4 Proton Torpedo",
		48, 18, 0, 80, 1, 0, 0, 440, 0.1, PART_TORPEDO, 0 },
	{ "Arakyd APT-4i Ion Torpedo",
		0, 41, 3, 75, 1, 0, 0, 730, 0.1, PART_TORPEDO, 0 },
	{ "Arakyd ST2 Heavy Concussion Missile",
		70, 12, 0, 125, 2, 0, 0, 1800, 0.2, PART_MISSILE, 0 },
	{ "Arakyd XM-15 Concussion Missile",
		22, 10, 0, 175, 1, 0, 0, 505, 0.1, PART_MISSILE, 0 },
	{ "Frei-Tek CM-5 Concussion Missile",
		30, 11, 0, 118, 1, 0, 0, 380, 0.1, PART_MISSILE, 0 },
	{ "Frei-Tek CM-9 Concussion Missile",
		36, 13, 0, 115, 1, 0, 0, 425, 0.1, PART_MISSILE, 0 },
	{ "Frei-Tek EchoBurst Ion Missile",
		0, 23, 5, 110, 2, 0, 0, 3120, 0.2, PART_MISSILE, 0 },
	{ "Frei-Tek PT55 Proton Torpedo",
		52, 18, 0, 78, 1, 0, 0, 470, 0.1, PART_TORPEDO, 0 },
	{ "Imperial M.3 Concussion Missile",
		26, 16, 0, 121, 1, 0, 0, 160, 0.1, PART_MISSILE, 1 },
	{ "Imperial M.3/i Ion Missile",
		0, 41, 2, 118, 1, 0, 0, 395, 0.1, PART_MISSILE, 1 },
	{ "Imperial T.2 Proton Torpedo",
		55, 17, 0, 70, 1, 0, 0, 285, 0.1, PART_TORPEDO, 1 },

// end WARHEAD parts (15)
// begin HULL parts

// end HULL parts (0)
// begin TURRET parts

    { "Corellian Engineering AG-1G Quad Laser Turret",
		6, 3, 0, 4, 2, 0, 0, 20930, 2.2, PART_TURRET, 0 },
	{ "Corellian Engineering AG-2G Quad Laser Turret",
		8, 4, 0, 4, 2, 0, 0, 29100, 2.3, PART_TURRET, 0 },
	{ "Taim and Bak H6 Single Turbolaser Turret",
		13, 6, 0, 1, 2, 0, 0, 8900, 1.9, PART_TURRET, 0 },
	{ "Taim and Bak H9 Dual Turbolaser Turret",
		13, 6, 0, 2, 2, 0, 0, 18350, 4.2, PART_TURRET, 0 },
	{ "Taim and Bak XI7 Dual Turbolaser Battery",
		38, 17, 0, 2, 3, 0, 0, 206050, 13.4, PART_TURRET, 0 },
	{ "Taim and Bak XV9 Dual Turbolaser Battery",
		40, 20, 0, 2, 3, 0, 0, 233000, 14.0, PART_TURRET, 0 },
	{ "Taim and Bak XX-9 Dual Turbolaser Battery",
		32, 15, 0, 2, 3, 0, 0, 374100, 20.2, PART_TURRET, 1 },
	{ "Incom W-20 Medium Turbolaser Turret",
		21, 10, 0, 1, 2, 0, 0, 22060, 4.2, PART_TURRET, 0 },
	{ "Incom W-22 Medium Turbolaser Turret",
		24, 12, 0, 1, 2, 0, 0, 24150, 4.4, PART_TURRET, 0 },
	{ "Incom W-34t Dual Turbolaser Battery",
		36, 16, 0, 2, 3, 0, 0, 194500, 12.9, PART_TURRET, 1 },
	{ "ArMek Technologies IOT-9a Ion Turret",
		0, 9, 1, 1, 2, 0, 0, 20990, 1.8, PART_TURRET, 0 },
	{ "ArMek Technologies IOT-9b Dual Ion Turret",
		0, 9, 1, 2, 2, 0, 0, 28100, 2.0, PART_TURRET, 0 },
	{ "ArMek Technologies XOT-4 Dual Ion Battery",
		0, 32, 3, 2, 3, 0, 0, 243400, 13.7, PART_TURRET, 0 },
	{ "Mendarn Arms TAR-11 Single Ion Turret",
		0, 12, 2, 1, 2, 0, 0, 25150, 2.1, PART_TURRET, 0 },
	{ "Mendarn Arms TAR-11/d Quad Ion Turret",
		0, 8, 1, 4, 2, 0, 0, 61010, 3.9, PART_TURRET, 0 }

// end TURRET parts (15)
// begin COUNTERMEASURE parts

};

((( end const.c )))

((( in update.c, update_handler )))
((( inside of: if ( --pulse_second   <= 0 ) )))

/*
 *
 * space v2, (c) 2004 Yerok G'Nik
 *
 * freely distribute, modify, as long as
 * header and any subsequent headers are
 * unmodified.
 *
 * per-second deprecation on ship timers
 *
 */
  // stress tested with about 400 ships, no in-game command lag. 
  // minimal (if any) cpu increase on a P2 @166mhz

  for(ship = first_ship; ship; ship = ship->next)
  {
	if(!ship->first_part) continue;
	for(part = ship->first_part; part; part = part_next)
	{
		part_next = part->next;
		if(!part->first_timer) continue;

		if(part->first_timer)
		{
			for(timer = part->first_timer; timer; timer = timer_next)
			{
				timer_next = timer->next;
					
				if( --timer->count <= 0)
				{
					if(timer->type == TIMER_RELOAD)
					{
					  part->fired = 0;
					  sprintf(buf, "&R&z[&gShip Computer&z]&R&G %s reloaded.", part->name);
					  echo_to_room(AT_PLAIN, get_room_index(ship->gunseat), buf);
					}
					extract_part_timer(part, timer);
				}
			}
		}
	}
  }

((( end update.c )))

((( begin handler.c )))
((( underneath extract_timer )))

/*
 *
 * space v2, (c) 2004 Yerok G'Nik
 *
 * freely distribute, modify, as long as
 * header and any subsequent headers are
 * unmodified.
 *
 * basically a copy of the above function.
 * utilized for ship timers.
 *
 */

void extract_part_timer( PART_DATA *part, TIMER *timer)
{
    if ( !timer )
    {
	bug( "extract_part_timer: NULL timer", 0 );
	return;
    }

    UNLINK( timer, part->first_timer, part->last_timer, next, prev );
    DISPOSE( timer );
    return;
}

Site Stats

Snippets: 1791
Codebases: 571