Add an explosions.plist file to manage explosion types
Create a separate setting for asteroid explosions
This commit is contained in:
parent
b95a26d8d2
commit
6f85948528
25
Resources/Config/explosions.plist
Normal file
25
Resources/Config/explosions.plist
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"oolite-default-ship-explosion" = {
|
||||||
|
"alpha" = 0.85;
|
||||||
|
"color_order" = "rgb";
|
||||||
|
"count" = 25;
|
||||||
|
"duration" = 1.5;
|
||||||
|
"growth_rate" = 1.5;
|
||||||
|
"size" = 2.5;
|
||||||
|
"texture" = "oolite-particle-cloud2.png";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
"oolite-default-asteroid-explosion" = {
|
||||||
|
"alpha" = 0.15;
|
||||||
|
"color_order" = "white";
|
||||||
|
"count" = 10;
|
||||||
|
"duration" = 1.5;
|
||||||
|
"growth_rate" = 1.2;
|
||||||
|
"size" = 0.6;
|
||||||
|
"texture" = "oolite-particle-cloud.png";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -525,9 +525,10 @@
|
|||||||
ai_type = "dumbAI.plist";
|
ai_type = "dumbAI.plist";
|
||||||
bounty = 10;
|
bounty = 10;
|
||||||
cargo_type = "CARGO_NOT_CARGO";
|
cargo_type = "CARGO_NOT_CARGO";
|
||||||
energy_recharge_rate = 0;
|
|
||||||
debris_role = "boulder";
|
debris_role = "boulder";
|
||||||
density = 5;
|
density = 5;
|
||||||
|
energy_recharge_rate = 0;
|
||||||
|
explosion_type = "oolite-default-asteroid-explosion";
|
||||||
forward_weapon_type = "WEAPON_NONE";
|
forward_weapon_type = "WEAPON_NONE";
|
||||||
has_ecm = no;
|
has_ecm = no;
|
||||||
has_escape_pod = no;
|
has_escape_pod = no;
|
||||||
@ -925,6 +926,7 @@
|
|||||||
debris_role = "splinter";
|
debris_role = "splinter";
|
||||||
density = 5;
|
density = 5;
|
||||||
energy_recharge_rate = 0;
|
energy_recharge_rate = 0;
|
||||||
|
explosion_type = "oolite-default-asteroid-explosion";
|
||||||
forward_weapon_type = "WEAPON_NONE";
|
forward_weapon_type = "WEAPON_NONE";
|
||||||
has_ecm = no;
|
has_ecm = no;
|
||||||
has_escape_pod = no;
|
has_escape_pod = no;
|
||||||
@ -3394,6 +3396,7 @@
|
|||||||
bounty = 1;
|
bounty = 1;
|
||||||
cargo_type = "CARGO_MINERALS";
|
cargo_type = "CARGO_MINERALS";
|
||||||
energy_recharge_rate = 0;
|
energy_recharge_rate = 0;
|
||||||
|
explosion_type = "oolite-default-asteroid-explosion";
|
||||||
forward_weapon_type = "WEAPON_NONE";
|
forward_weapon_type = "WEAPON_NONE";
|
||||||
has_ecm = no;
|
has_ecm = no;
|
||||||
has_escape_pod = no;
|
has_escape_pod = no;
|
||||||
|
@ -37,13 +37,13 @@ MA 02110-1301, USA.
|
|||||||
#define kExplosionDefaultSize 2.5f
|
#define kExplosionDefaultSize 2.5f
|
||||||
|
|
||||||
// keys for plist file
|
// keys for plist file
|
||||||
static NSString * const kExplosionGrowth = @"growth_rate";
|
|
||||||
static NSString * const kExplosionAlpha = @"alpha";
|
static NSString * const kExplosionAlpha = @"alpha";
|
||||||
static NSString * const kExplosionDuration = @"duration";
|
|
||||||
static NSString * const kExplosionTexture = @"texture";
|
|
||||||
static NSString * const kExplosionColors = @"color_order";
|
static NSString * const kExplosionColors = @"color_order";
|
||||||
static NSString * const kExplosionCount = @"count";
|
static NSString * const kExplosionCount = @"count";
|
||||||
|
static NSString * const kExplosionDuration = @"duration";
|
||||||
|
static NSString * const kExplosionGrowth = @"growth_rate";
|
||||||
static NSString * const kExplosionSize = @"size";
|
static NSString * const kExplosionSize = @"size";
|
||||||
|
static NSString * const kExplosionTexture = @"texture";
|
||||||
|
|
||||||
|
|
||||||
@interface OOExplosionCloudEntity (OOPrivate)
|
@interface OOExplosionCloudEntity (OOPrivate)
|
||||||
|
@ -322,6 +322,8 @@ typedef enum
|
|||||||
NSString *displayName; // name shown on screen
|
NSString *displayName; // name shown on screen
|
||||||
OORoleSet *roleSet; // Roles a ship can take, eg. trader, hunter, police, pirate, scavenger &c.
|
OORoleSet *roleSet; // Roles a ship can take, eg. trader, hunter, police, pirate, scavenger &c.
|
||||||
NSString *primaryRole; // "Main" role of the ship.
|
NSString *primaryRole; // "Main" role of the ship.
|
||||||
|
|
||||||
|
NSString *explosionType; // explosion.plist entry
|
||||||
|
|
||||||
// AI stuff
|
// AI stuff
|
||||||
Vector jink; // x and y set factors for offsetting a pursuing ship's position
|
Vector jink; // x and y set factors for offsetting a pursuing ship's position
|
||||||
|
@ -448,6 +448,7 @@ static ShipEntity *doOctreesCollide(ShipEntity *prime, ShipEntity *other);
|
|||||||
// Get scriptInfo dictionary, containing arbitrary stuff scripts might be interested in.
|
// Get scriptInfo dictionary, containing arbitrary stuff scripts might be interested in.
|
||||||
scriptInfo = [[shipDict oo_dictionaryForKey:@"script_info" defaultValue:nil] retain];
|
scriptInfo = [[shipDict oo_dictionaryForKey:@"script_info" defaultValue:nil] retain];
|
||||||
|
|
||||||
|
explosionType = [[shipDict oo_stringForKey:@"explosion_type" defaultValue:@"oolite-default-ship-explosion"] retain];
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
|
|
||||||
@ -1037,6 +1038,8 @@ static ShipEntity *doOctreesCollide(ShipEntity *prime, ShipEntity *other);
|
|||||||
DESTROY(_beaconLabel);
|
DESTROY(_beaconLabel);
|
||||||
DESTROY(_beaconDrawable);
|
DESTROY(_beaconDrawable);
|
||||||
|
|
||||||
|
DESTROY(explosionType);
|
||||||
|
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8319,7 +8322,8 @@ NSComparisonResult ComparePlanetsBySurfaceDistance(id i1, id i2, void* context)
|
|||||||
}
|
}
|
||||||
// and a visual sign of the explosion
|
// and a visual sign of the explosion
|
||||||
// "fireball" explosion effect
|
// "fireball" explosion effect
|
||||||
[UNIVERSE addEntity:[OOExplosionCloudEntity explosionCloudFromEntity:self withSize:range*3.0 andSettings:nil]];
|
NSDictionary *explosion = [UNIVERSE explosionSetting:@"oolite-default-ship-explosion"];
|
||||||
|
[UNIVERSE addEntity:[OOExplosionCloudEntity explosionCloudFromEntity:self withSize:range*3.0 andSettings:explosion]];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8618,8 +8622,9 @@ NSComparisonResult ComparePlanetsBySurfaceDistance(id i1, id i2, void* context)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
NSDictionary *explosion = [UNIVERSE explosionSetting:explosionType];
|
||||||
// "fireball" explosion effect
|
// "fireball" explosion effect
|
||||||
[UNIVERSE addEntity:[OOExplosionCloudEntity explosionCloudFromEntity:self withSettings:nil]];
|
[UNIVERSE addEntity:[OOExplosionCloudEntity explosionCloudFromEntity:self withSettings:explosion]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 3. flash
|
// 3. flash
|
||||||
|
@ -261,7 +261,8 @@ enum
|
|||||||
NSDictionary *roleCategories; // Categories for roles from role-categories.plist, extending the old pirate-victim-roles.plist
|
NSDictionary *roleCategories; // Categories for roles from role-categories.plist, extending the old pirate-victim-roles.plist
|
||||||
NSDictionary *autoAIMap; // Default AIs for roles from autoAImap.plist.
|
NSDictionary *autoAIMap; // Default AIs for roles from autoAImap.plist.
|
||||||
NSDictionary *screenBackgrounds; // holds filenames for various screens backgrounds, loaded at initialisation
|
NSDictionary *screenBackgrounds; // holds filenames for various screens backgrounds, loaded at initialisation
|
||||||
|
NSDictionary *explosionSettings; // explosion settings from explosions.plist
|
||||||
|
|
||||||
NSDictionary *cargoPods; // template cargo pods
|
NSDictionary *cargoPods; // template cargo pods
|
||||||
|
|
||||||
OOGalaxyID galaxyID;
|
OOGalaxyID galaxyID;
|
||||||
@ -604,6 +605,7 @@ enum
|
|||||||
- (NSDictionary *) characters;
|
- (NSDictionary *) characters;
|
||||||
- (NSDictionary *) missiontext;
|
- (NSDictionary *) missiontext;
|
||||||
- (NSArray *) scenarios;
|
- (NSArray *) scenarios;
|
||||||
|
- (NSDictionary *) explosionSetting:(NSString *)explosion;
|
||||||
|
|
||||||
- (OOSystemDescriptionManager *) systemManager;
|
- (OOSystemDescriptionManager *) systemManager;
|
||||||
|
|
||||||
|
@ -441,6 +441,7 @@ static GLfloat docked_light_specular[4] = { DOCKED_ILLUM_LEVEL, DOCKED_ILLUM_LEV
|
|||||||
[system_repopulator release];
|
[system_repopulator release];
|
||||||
[allPlanets release];
|
[allPlanets release];
|
||||||
[allStations release];
|
[allStations release];
|
||||||
|
[explosionSettings release];
|
||||||
|
|
||||||
[activeWormholes release];
|
[activeWormholes release];
|
||||||
[characterPool release];
|
[characterPool release];
|
||||||
@ -7335,6 +7336,12 @@ static void VerifyDesc(NSString *key, id desc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (NSDictionary *) explosionSetting:(NSString *)explosion
|
||||||
|
{
|
||||||
|
return [explosionSettings oo_dictionaryForKey:explosion defaultValue:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
- (NSArray *) scenarios
|
- (NSArray *) scenarios
|
||||||
{
|
{
|
||||||
return _scenarios;
|
return _scenarios;
|
||||||
@ -9550,8 +9557,11 @@ static OOComparisonResult comparePrice(id dict1, id dict2, void *context)
|
|||||||
NSArray *equipmentTemp = [ResourceManager arrayFromFilesNamed:@"equipment.plist" inFolder:@"Config" andMerge:YES];
|
NSArray *equipmentTemp = [ResourceManager arrayFromFilesNamed:@"equipment.plist" inFolder:@"Config" andMerge:YES];
|
||||||
equipmentData = [[equipmentTemp sortedArrayUsingFunction:equipmentSort context:NULL] retain];
|
equipmentData = [[equipmentTemp sortedArrayUsingFunction:equipmentSort context:NULL] retain];
|
||||||
|
|
||||||
|
|
||||||
[OOEquipmentType loadEquipment];
|
[OOEquipmentType loadEquipment];
|
||||||
|
|
||||||
|
[explosionSettings autorelease];
|
||||||
|
explosionSettings = [[ResourceManager dictionaryFromFilesNamed:@"explosions.plist" inFolder:@"Config" andMerge:YES] retain];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user