Made many attributes optional.

This commit is contained in:
Steve 2016-03-14 17:55:34 +00:00
parent 1fbf31e56c
commit 13344ddc06
14 changed files with 30 additions and 25 deletions

View File

@ -1,10 +1,7 @@
{
"name" : "Civilian",
"health" : 15,
"shield" : 0,
"speed" : 2,
"reloadTime" : 0,
"shieldRechargeRate" : 0,
"texture" : "gfx/craft/civilian01.png",
"flags" : "EF_MISSION_TARGET+EF_RETREATING+EF_TAKES_DAMAGE",
"aiFlags" : "AIF_GOAL_JUMPGATE+AIF_AVOIDS_COMBAT+AIF_FOLLOWS_PLAYER"

View File

@ -1,10 +1,8 @@
{
"name" : "INF Tug",
"health" : 50,
"shield" : 0,
"speed" : 1.85,
"reloadTime" : 10,
"shieldRechargeRate" : 0,
"texture" : "gfx/craft/infTug.png",
"flags" : "EF_HAS_ROPE+EF_TAKES_DAMAGE",
"aiFlags" : "AIF_AVOIDS_COMBAT+AIF_TOWS"

View File

@ -4,7 +4,6 @@
"shield" : 50,
"speed" : 1.5,
"reloadTime" : 10,
"shieldRechargeRate" : 0,
"texture" : "gfx/craft/munitionsTransport.png",
"flags" : "EF_TAKES_DAMAGE",
"aiFlags" : "AIF_AVOIDS_COMBAT"

View File

@ -3,7 +3,6 @@
"health" : 15,
"shield" : 15,
"speed" : 2,
"reloadTime" : 0,
"shieldRechargeRate" : 60,
"texture" : "gfx/craft/shuttle.png",
"flags" : "EF_COLLECTS_ITEMS+EF_TAKES_DAMAGE+EF_NO_EPIC",

View File

@ -1,10 +1,8 @@
{
"name" : "Tug",
"health" : 50,
"shield" : 0,
"speed" : 1.85,
"reloadTime" : 10,
"shieldRechargeRate" : 0,
"texture" : "gfx/craft/tug.png",
"guns" : [
{

View File

@ -1,10 +1,8 @@
{
"name" : "CannonDart",
"health" : 15,
"shield" : 0,
"speed" : 2.1,
"reloadTime" : 24,
"shieldRechargeRate" : 0,
"texture" : "gfx/fighters/dart01.png",
"guns" : [
{

View File

@ -1,10 +1,8 @@
{
"name" : "Dart",
"health" : 15,
"shield" : 0,
"speed" : 2.1,
"reloadTime" : 24,
"shieldRechargeRate" : 0,
"texture" : "gfx/fighters/dart01.png",
"guns" : [
{

View File

@ -1,10 +1,8 @@
{
"name" : "MissileDart",
"health" : 15,
"shield" : 0,
"speed" : 2.1,
"reloadTime" : 24,
"shieldRechargeRate" : 0,
"texture" : "gfx/fighters/dart01.png",
"missiles" : 999,
"flags" : "EF_TAKES_DAMAGE"

View File

@ -1,10 +1,8 @@
{
"name" : "SimpleDart",
"health" : 15,
"shield" : 0,
"speed" : 2.1,
"reloadTime" : 24,
"shieldRechargeRate" : 0,
"texture" : "gfx/fighters/dart01.png",
"guns" : [
{

View File

@ -1,10 +1,8 @@
{
"name" : "StaticDart",
"health" : 15,
"shield" : 0,
"speed" : 0,
"reloadTime" : 24,
"shieldRechargeRate" : 0,
"texture" : "gfx/fighters/dart01.png",
"flags" : "EF_TAKES_DAMAGE"
}

View File

@ -1,10 +1,8 @@
{
"name" : "UnarmedDart",
"health" : 15,
"shield" : 0,
"speed" : 2.1,
"reloadTime" : 24,
"shieldRechargeRate" : 0,
"texture" : "gfx/fighters/dart01.png",
"flags" : "EF_TAKES_DAMAGE"
}

View File

@ -0,0 +1,26 @@
{
"name" : "Clarke Defence #5",
"description" : "",
"requires" : 28,
"background" : "gfx/backgrounds/background06.jpg",
"planet" : "gfx/planets/bluePlanet.png",
"music" : "music/battle/heroism.ogg",
"unwinnable" : 1,
"objectives" : [
{
"description" : "Eliminate all enemy forces",
"targetName" : "Enemy",
"targetValue" : 1,
"targetType" : "TT_DESTROY",
"isEliminateAll" : 1
}
],
"player" : {
"type" : "Lynx",
"side" : "SIDE_ALLIES",
"pilot" : "-",
"squadron" : "-",
"x" : 25,
"y" : 45
}
}

View File

@ -1,7 +1,7 @@
{
"name" : "Rebel Assault #1",
"description" : "",
"requires" : 28,
"requires" : 99,
"background" : "gfx/backgrounds/background03.jpg",
"planet" : "gfx/planets/spirit.png",
"music" : "music/battle/InnerCore_Low.ogg",

View File

@ -676,10 +676,10 @@ static void loadFighterDef(char *filename)
STRNCPY(e->name, cJSON_GetObjectItem(root, "name")->valuestring, MAX_NAME_LENGTH);
STRNCPY(e->defName, e->name, MAX_NAME_LENGTH);
e->health = e->maxHealth = cJSON_GetObjectItem(root, "health")->valueint;
e->shield = e->maxShield = cJSON_GetObjectItem(root, "shield")->valueint;
e->shield = e->maxShield = getJSONValue(root, "shield", 0);
e->speed = cJSON_GetObjectItem(root, "speed")->valuedouble;
e->reloadTime = cJSON_GetObjectItem(root, "reloadTime")->valueint;
e->shieldRechargeRate = cJSON_GetObjectItem(root, "shieldRechargeRate")->valueint;
e->reloadTime = getJSONValue(root, "reloadTime", 0);
e->shieldRechargeRate = getJSONValue(root, "shieldRechargeRate", 0);
e->texture = getTexture(cJSON_GetObjectItem(root, "texture")->valuestring);
SDL_QueryTexture(e->texture, NULL, NULL, &e->w, &e->h);