Go to the source code of this file.
◆ OOShipLibraryCargo()
NSString * OOShipLibraryCargo |
( |
ShipEntity * | demo_ship | ) |
|
◆ OOShipLibraryCategoryPlural()
NSString * OOShipLibraryCategoryPlural |
( |
NSString * | category | ) |
|
◆ OOShipLibraryCategorySingular()
NSString * OOShipLibraryCategorySingular |
( |
NSString * | category | ) |
|
◆ OOShipLibraryGenerator()
NSString * OOShipLibraryGenerator |
( |
ShipEntity * | demo_ship | ) |
|
Definition at line 117 of file OOShipLibraryDescriptions.m.
118{
119 float rate = [demo_ship energyRechargeRate];
120 NSString *result =
nil;
121 if (rate < 2.5)
122 {
123 result =
DESC(
@"oolite-ship-library-generator-weak");
124 }
125 else if (rate < 3.75)
126 {
127 result =
DESC(
@"oolite-ship-library-generator-average");
128 }
129 else
130 {
131 result =
DESC(
@"oolite-ship-library-generator-strong");
132 }
133 return result;
134}
References DESC, ShipEntity::energyRechargeRate, and nil.
◆ OOShipLibraryShields()
NSString * OOShipLibraryShields |
( |
ShipEntity * | demo_ship | ) |
|
Definition at line 137 of file OOShipLibraryDescriptions.m.
138{
139
140 float shields = [demo_ship maxEnergy];
141 NSString *result =
nil;
142 if (shields < 128)
143 {
144 result =
DESC(
@"oolite-ship-library-shields-veryweak");
145 }
146 else if (shields < 192)
147 {
148 result =
DESC(
@"oolite-ship-library-shields-weak");
149 }
150 else if (shields < 256)
151 {
152 result =
DESC(
@"oolite-ship-library-shields-average");
153 }
154 else if (shields < 320)
155 {
156 result =
DESC(
@"oolite-ship-library-shields-strong");
157 }
158 else
159 {
160 result =
DESC(
@"oolite-ship-library-shields-verystrong");
161 }
162 return result;
163}
References DESC, Entity::maxEnergy, and nil.
◆ OOShipLibrarySize()
NSString * OOShipLibrarySize |
( |
ShipEntity * | demo_ship | ) |
|
Definition at line 206 of file OOShipLibraryDescriptions.m.
207{
208 BoundingBox bb = [demo_ship totalBoundingBox];
209 return [NSString stringWithFormat:
DESC(
@"oolite-ship-library-size-u-u-u"),(unsigned)(bb.max.x-bb.min.x),(unsigned)(bb.max.y-bb.min.y),(unsigned)(bb.max.z-bb.min.z)];
210}
References ShipEntity::totalBoundingBox.
◆ OOShipLibrarySpeed()
NSString * OOShipLibrarySpeed |
( |
ShipEntity * | demo_ship | ) |
|
Definition at line 41 of file OOShipLibraryDescriptions.m.
42{
43 GLfloat param = [demo_ship maxFlightSpeed];
44 NSString *result =
nil;
45 if (param <= 1)
46 {
47 result =
DESC(
@"oolite-ship-library-speed-stationary");
48 }
49 else if (param <= 150)
50 {
51 result =
DESC(
@"oolite-ship-library-speed-veryslow");
52 }
53 else if (param <= 250)
54 {
55 result =
DESC(
@"oolite-ship-library-speed-slow");
56 }
57 else if (param <= 325)
58 {
59 result =
DESC(
@"oolite-ship-library-speed-average");
60 }
61 else if (param <= 425)
62 {
63 result =
DESC(
@"oolite-ship-library-speed-fast");
64 }
65 else
66 {
67 result =
DESC(
@"oolite-ship-library-speed-veryfast");
68 }
69 return result;
70}
References DESC, ShipEntity::maxFlightSpeed, and nil.
◆ OOShipLibraryTurnRate()
NSString * OOShipLibraryTurnRate |
( |
ShipEntity * | demo_ship | ) |
|
Definition at line 73 of file OOShipLibraryDescriptions.m.
74{
75 GLfloat param = [demo_ship maxFlightRoll] + (2*[demo_ship maxFlightPitch]);
76 NSString *result =
nil;
77 if (param <= 2)
78 {
79 result =
DESC(
@"oolite-ship-library-turn-veryslow");
80 }
81 else if (param <= 2.75)
82 {
83 result =
DESC(
@"oolite-ship-library-turn-slow");
84 }
85 else if (param <= 4.5)
86 {
87 result =
DESC(
@"oolite-ship-library-turn-average");
88 }
89 else if (param <= 6)
90 {
91 result =
DESC(
@"oolite-ship-library-turn-fast");
92 }
93 else
94 {
95 result =
DESC(
@"oolite-ship-library-turn-veryfast");
96 }
97 return result;
98}
References DESC, ShipEntity::maxFlightPitch, ShipEntity::maxFlightRoll, and nil.
◆ OOShipLibraryTurrets()
NSString * OOShipLibraryTurrets |
( |
ShipEntity * | demo_ship | ) |
|
Definition at line 192 of file OOShipLibraryDescriptions.m.
193{
194 NSUInteger turretCount = [demo_ship turretCount];
195 if (turretCount > 0)
196 {
197 return [NSString stringWithFormat:
DESC(
@"oolite-ship-library-turrets-u"), turretCount];
198 }
199 else
200 {
201 return @"";
202 }
203}
References ShipEntity::turretCount.
◆ OOShipLibraryWeapons()
NSString * OOShipLibraryWeapons |
( |
ShipEntity * | demo_ship | ) |
|
Definition at line 179 of file OOShipLibraryDescriptions.m.
180{
182 NSUInteger fixed = (facings&1)+(facings&2)/2+(facings&4)/4+(facings&8)/8;
183 NSUInteger pylons = [demo_ship missileCapacity];
184 if (fixed == 0 && pylons == 0)
185 {
186 return DESC(
@"oolite-ship-library-weapons-none");
187 }
188 return [NSString stringWithFormat:
DESC(
@"oolite-ship-library-weapons-u-u"),fixed,pylons];
189}
uint8_t OOWeaponFacingSet
References DESC, ShipEntity::missileCapacity, and ShipEntity::weaponFacings.
◆ OOShipLibraryWitchspace()
NSString * OOShipLibraryWitchspace |
( |
ShipEntity * | demo_ship | ) |
|
Definition at line 166 of file OOShipLibraryDescriptions.m.
167{
168 if ([demo_ship hasHyperspaceMotor])
169 {
170 return DESC(
@"oolite-ship-library-witchspace-yes");
171 }
172 else
173 {
174 return DESC(
@"oolite-ship-library-witchspace-no");
175 }
176}
References DESC.
◆ kOODemoShipCargo
NSString* const kOODemoShipCargo = @"@"cargo" |
|
static |
◆ kOODemoShipClass
NSString* const kOODemoShipClass = @"@"class" |
|
static |
◆ kOODemoShipConditions
NSString* const kOODemoShipConditions = @"@"condition_script" |
|
static |
◆ kOODemoShipDescription
NSString* const kOODemoShipDescription = @"@"description" |
|
static |
◆ kOODemoShipGenerator
NSString* const kOODemoShipGenerator = @"@"generator" |
|
static |
◆ kOODemoShipKey
NSString* const kOODemoShipKey = @"@"ship" |
|
static |
◆ kOODemoShipName
NSString* const kOODemoShipName = @"@"name" |
|
static |
◆ kOODemoShipShields
NSString* const kOODemoShipShields = @"@"shields" |
|
static |
◆ kOODemoShipShipData
NSString* const kOODemoShipShipData = @"@"ship_data" |
|
static |
◆ kOODemoShipSize
NSString* const kOODemoShipSize = @"@"size" |
|
static |
◆ kOODemoShipSpeed
NSString* const kOODemoShipSpeed = @"@"speed" |
|
static |
◆ kOODemoShipSummary
NSString* const kOODemoShipSummary = @"@"summary" |
|
static |
◆ kOODemoShipTurnRate
NSString* const kOODemoShipTurnRate = @"@"turn_rate" |
|
static |
◆ kOODemoShipTurrets
NSString* const kOODemoShipTurrets = @"@"turrets" |
|
static |
◆ kOODemoShipWeapons
NSString* const kOODemoShipWeapons = @"@"weapons" |
|
static |
◆ kOODemoShipWitchspace
NSString* const kOODemoShipWitchspace = @"@"witchspace" |
|
static |