Mercurial > ~darius > hgwebdir.cgi > paradise_server
comparison src/structdesc.c @ 8:0836fb919dfa
First entry of Paradise Server 2.9 patch 10 Beta
author | darius |
---|---|
date | Sat, 06 Dec 1997 04:37:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
7:814de70c9f67 | 8:0836fb919dfa |
---|---|
1 /*-------------------------------------------------------------------------- | |
2 NETREK II -- Paradise | |
3 | |
4 Permission to use, copy, modify, and distribute this software and its | |
5 documentation, or any derivative works thereof, for any NON-COMMERCIAL | |
6 purpose and without fee is hereby granted, provided that this copyright | |
7 notice appear in all copies. No representations are made about the | |
8 suitability of this software for any purpose. This software is provided | |
9 "as is" without express or implied warranty. | |
10 | |
11 Xtrek Copyright 1986 Chris Guthrie | |
12 Netrek (Xtrek II) Copyright 1989 Kevin P. Smith | |
13 Scott Silvey | |
14 Paradise II (Netrek II) Copyright 1993 Larry Denys | |
15 Kurt Olsen | |
16 Brandon Gillespie | |
17 --------------------------------------------------------------------------*/ | |
18 | |
19 | |
20 #include "config.h" | |
21 #include "structdesc.h" | |
22 #include "struct.h" | |
23 | |
24 #define OFFSET_OF(field) ( (char*)(&((struct ship*)0)->field) -\ | |
25 (char*)0) | |
26 | |
27 static char *all_ship_flag_names[] = { | |
28 "UNDOCKABLE", | |
29 "CANORBIT", | |
30 "CANWARP", | |
31 "CANFUEL", | |
32 "CANREPAIR", | |
33 "CANREFIT", | |
34 "ARMYNEEDKILL", | |
35 "HASPHASERS", | |
36 "PLASMASTYLE", | |
37 "HASPLASMA", /* obsolete */ | |
38 "PLASMAARMED", | |
39 "HASMISSILE", | |
40 "HASFIGHTERS", | |
41 0 | |
42 }; | |
43 | |
44 struct field_desc ship_fields[] = { | |
45 {"alttype", FT_SHORT, OFFSET_OF(s_alttype)}, | |
46 {"name", FT_STRING, OFFSET_OF(s_name[0])}, | |
47 | |
48 {"turns", FT_INT, OFFSET_OF(s_turns)}, | |
49 | |
50 {"imp.acc", FT_INT, OFFSET_OF(s_imp.acc)}, | |
51 {"imp.dec", FT_INT, OFFSET_OF(s_imp.dec)}, | |
52 {"imp.cost", FT_INT, OFFSET_OF(s_imp.cost)}, | |
53 {"imp.maxspeed", FT_INT, OFFSET_OF(s_imp.maxspeed)}, | |
54 {"imp.etemp", FT_INT, OFFSET_OF(s_imp.etemp)}, | |
55 | |
56 {"after.acc", FT_INT, OFFSET_OF(s_after.acc)}, | |
57 {"after.dec", FT_INT, OFFSET_OF(s_after.dec)}, | |
58 {"after.cost", FT_INT, OFFSET_OF(s_after.cost)}, | |
59 {"after.maxspeed", FT_INT, OFFSET_OF(s_after.maxspeed)}, | |
60 {"after.etemp", FT_INT, OFFSET_OF(s_after.etemp)}, | |
61 | |
62 {"warp.acc", FT_INT, OFFSET_OF(s_warp.acc)}, | |
63 {"warp.dec", FT_INT, OFFSET_OF(s_warp.dec)}, | |
64 {"warp.cost", FT_INT, OFFSET_OF(s_warp.cost)}, | |
65 {"warp.maxspeed", FT_INT, OFFSET_OF(s_warp.maxspeed)}, | |
66 {"warp.etemp", FT_INT, OFFSET_OF(s_warp.etemp)}, | |
67 | |
68 {"warpinitcost", FT_INT, OFFSET_OF(s_warpinitcost)}, | |
69 {"warpinittime", FT_INT, OFFSET_OF(s_warpinittime)}, | |
70 {"warpprepspeed", FT_INT, OFFSET_OF(s_warpprepspeed)}, | |
71 | |
72 {"mass", FT_SHORT, OFFSET_OF(s_mass)}, | |
73 | |
74 {"tractstr", FT_SHORT, OFFSET_OF(s_tractstr)}, | |
75 {"tractrng", FT_FLOAT, OFFSET_OF(s_tractrng)}, | |
76 {"tractcost", FT_INT, OFFSET_OF(s_tractcost)}, | |
77 {"tractetemp", FT_INT, OFFSET_OF(s_tractetemp)}, | |
78 | |
79 {"torp.damage", FT_SHORT, OFFSET_OF(s_torp.damage)}, | |
80 {"torp.speed", FT_SHORT, OFFSET_OF(s_torp.speed)}, | |
81 {"torp.cost", FT_SHORT, OFFSET_OF(s_torp.cost)}, | |
82 {"torp.fuse", FT_SHORT, OFFSET_OF(s_torp.fuse)}, | |
83 {"torp.wtemp", FT_SHORT, OFFSET_OF(s_torp.wtemp)}, | |
84 {"torp.wtemp_halfarc", FT_SHORT, OFFSET_OF(s_torp.wtemp_halfarc)}, | |
85 {"torp.wtemp_factor", FT_SHORT, OFFSET_OF(s_torp.wtemp_factor)}, | |
86 {"torpturns", FT_SHORT, OFFSET_OF(s_torp.aux)}, /* name anomaly */ | |
87 | |
88 {"phaser.damage", FT_SHORT, OFFSET_OF(s_phaser.damage)}, | |
89 {"phaser.range", FT_SHORT, OFFSET_OF(s_phaser.speed)}, /* name anomaly */ | |
90 {"phaser.cost", FT_SHORT, OFFSET_OF(s_phaser.cost)}, | |
91 {"phaser.fuse", FT_SHORT, OFFSET_OF(s_phaser.fuse)}, | |
92 {"phaser.wtemp", FT_SHORT, OFFSET_OF(s_phaser.wtemp)}, | |
93 | |
94 {"missile.damage", FT_SHORT, OFFSET_OF(s_missile.damage)}, | |
95 {"missile.speed", FT_SHORT, OFFSET_OF(s_missile.speed)}, | |
96 {"missile.cost", FT_SHORT, OFFSET_OF(s_missile.cost)}, | |
97 {"missile.fuse", FT_SHORT, OFFSET_OF(s_missile.fuse)}, | |
98 {"missile.wtemp", FT_SHORT, OFFSET_OF(s_missile.wtemp)}, | |
99 {"missile.count", FT_SHORT, OFFSET_OF(s_missile.count)}, | |
100 {"missileturns", FT_SHORT, OFFSET_OF(s_missile.aux)}, /* name anomaly */ | |
101 {"missilestored", FT_SHORT, OFFSET_OF(s_missilestored)}, | |
102 | |
103 {"plasma.damage", FT_SHORT, OFFSET_OF(s_plasma.damage)}, | |
104 {"plasma.speed", FT_SHORT, OFFSET_OF(s_plasma.speed)}, | |
105 {"plasma.cost", FT_SHORT, OFFSET_OF(s_plasma.cost)}, | |
106 {"plasma.fuse", FT_SHORT, OFFSET_OF(s_plasma.fuse)}, | |
107 {"plasma.wtemp", FT_SHORT, OFFSET_OF(s_plasma.wtemp)}, | |
108 {"plasmaturns", FT_SHORT, OFFSET_OF(s_plasma.aux)}, /* name anomaly */ | |
109 | |
110 {"maxwpntemp", FT_INT, OFFSET_OF(s_maxwpntemp)}, | |
111 {"wpncoolrate", FT_SHORT, OFFSET_OF(s_wpncoolrate)}, | |
112 | |
113 {"maxegntemp", FT_INT, OFFSET_OF(s_maxegntemp)}, | |
114 {"egncoolrate", FT_SHORT, OFFSET_OF(s_egncoolrate)}, | |
115 | |
116 {"maxfuel", FT_INT, OFFSET_OF(s_maxfuel)}, | |
117 {"recharge", FT_SHORT, OFFSET_OF(s_recharge)}, | |
118 {"mingivefuel", FT_INT, OFFSET_OF(s_mingivefuel)}, | |
119 {"takeonfuel", FT_INT, OFFSET_OF(s_takeonfuel)}, | |
120 | |
121 {"explodedamage", FT_SHORT, OFFSET_OF(s_expldam)}, | |
122 {"fueldamage", FT_SHORT, OFFSET_OF(s_fueldam)}, | |
123 | |
124 {"armyperkill", FT_FLOAT, OFFSET_OF(s_armyperkill)}, | |
125 {"maxarmies", FT_SHORT, OFFSET_OF(s_maxarmies)}, | |
126 {"bomb", FT_INT, OFFSET_OF(s_bomb)}, | |
127 | |
128 {"repair", FT_SHORT, OFFSET_OF(s_repair)}, | |
129 {"maxdamage", FT_INT, OFFSET_OF(s_maxdamage)}, | |
130 {"maxshield", FT_INT, OFFSET_OF(s_maxshield)}, | |
131 {"shieldcost", FT_INT, OFFSET_OF(s_shieldcost)}, | |
132 | |
133 {"detcost", FT_SHORT, OFFSET_OF(s_detcost)}, | |
134 {"cloakcost", FT_SHORT, OFFSET_OF(s_cloakcost)}, | |
135 | |
136 {"scanrange", FT_SHORT, OFFSET_OF(s_scanrange)}, | |
137 | |
138 {"numports", FT_SHORT, OFFSET_OF(s_numports)}, | |
139 | |
140 {"letter", FT_CHAR, OFFSET_OF(s_letter)}, | |
141 {"desig1", FT_CHAR, OFFSET_OF(s_desig1)}, | |
142 {"desig2", FT_CHAR, OFFSET_OF(s_desig2)}, | |
143 | |
144 {"bitmap", FT_SHORT, OFFSET_OF(s_bitmap)}, | |
145 {"width", FT_SHORT, OFFSET_OF(s_width)}, | |
146 {"height", FT_SHORT, OFFSET_OF(s_height)}, | |
147 | |
148 {"timer", FT_INT, OFFSET_OF(s_timer)}, | |
149 {"maxnum", FT_INT, OFFSET_OF(s_maxnum)}, | |
150 {"rank", FT_INT, OFFSET_OF(s_rank)}, | |
151 {"numdefn", FT_INT, OFFSET_OF(s_numdefn)}, | |
152 {"numplan", FT_INT, OFFSET_OF(s_numplan)}, | |
153 | |
154 {"nflags", FT_LONGFLAGS, OFFSET_OF(s_nflags), (void *) all_ship_flag_names}, | |
155 | |
156 {0}, | |
157 }; | |
158 | |
159 #undef OFFSET_OF |