Start of fighter database.
This commit is contained in:
parent
ca64978d20
commit
41ce0e2281
|
@ -13,7 +13,7 @@ OBJS += battle.o bullets.o
|
||||||
OBJS += capitalShips.o challengeHome.o challenges.o cJSON.o controls.o credits.o
|
OBJS += capitalShips.o challengeHome.o challenges.o cJSON.o controls.o credits.o
|
||||||
OBJS += debris.o dev.o draw.o
|
OBJS += debris.o dev.o draw.o
|
||||||
OBJS += effects.o entities.o
|
OBJS += effects.o entities.o
|
||||||
OBJS += fighters.o
|
OBJS += fighters.o fighterDatabase.o
|
||||||
OBJS += galacticMap.o game.o
|
OBJS += galacticMap.o game.o
|
||||||
OBJS += hud.o
|
OBJS += hud.o
|
||||||
OBJS += i18n.o init.o input.o io.o items.o
|
OBJS += i18n.o init.o input.o io.o items.o
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Civilian",
|
"name" : "Civilian",
|
||||||
|
"description" : "",
|
||||||
"health" : 15,
|
"health" : 15,
|
||||||
"speed" : 1.85,
|
"speed" : 1.85,
|
||||||
"texture" : "gfx/craft/civilian01.png",
|
"texture" : "gfx/craft/civilian01.png",
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "INF Tug",
|
"name" : "INF Tug",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 50,
|
"health" : 50,
|
||||||
"speed" : 1.85,
|
"speed" : 1.85,
|
||||||
"reloadTime" : 10,
|
"reloadTime" : 10,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Munitions Transport",
|
"name" : "Munitions Transport",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 150,
|
"health" : 150,
|
||||||
"shield" : 50,
|
"shield" : 50,
|
||||||
"speed" : 1.5,
|
"speed" : 1.5,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Shuttle",
|
"name" : "Shuttle",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 15,
|
"health" : 15,
|
||||||
"shield" : 15,
|
"shield" : 15,
|
||||||
"speed" : 2,
|
"speed" : 2,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Supply Ship",
|
"name" : "Supply Ship",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 150,
|
"health" : 150,
|
||||||
"shield" : 50,
|
"shield" : 50,
|
||||||
"speed" : 1.5,
|
"speed" : 1.5,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Tug",
|
"name" : "Tug",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 50,
|
"health" : 50,
|
||||||
"speed" : 1.85,
|
"speed" : 1.85,
|
||||||
"reloadTime" : 10,
|
"reloadTime" : 10,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Angel",
|
"name" : "Angel",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 40,
|
"health" : 40,
|
||||||
"shield" : 40,
|
"shield" : 40,
|
||||||
"speed" : 1.8,
|
"speed" : 1.8,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "ATAF",
|
"name" : "ATAF",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 150,
|
"health" : 150,
|
||||||
"shield" : 2500,
|
"shield" : 2500,
|
||||||
"speed" : 2.25,
|
"speed" : 2.25,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Blizzard",
|
"name" : "Blizzard",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 120,
|
"health" : 120,
|
||||||
"shield" : 70,
|
"shield" : 70,
|
||||||
"speed" : 1.85,
|
"speed" : 1.85,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Cannon Dart",
|
"name" : "Cannon Dart",
|
||||||
|
"description" : "",
|
||||||
"health" : 15,
|
"health" : 15,
|
||||||
"speed" : 2.1,
|
"speed" : 2.1,
|
||||||
"reloadTime" : 24,
|
"reloadTime" : 24,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Dart",
|
"name" : "Dart",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 15,
|
"health" : 15,
|
||||||
"speed" : 2.1,
|
"speed" : 2.1,
|
||||||
"reloadTime" : 24,
|
"reloadTime" : 24,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Firefly",
|
"name" : "Firefly",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 50,
|
"health" : 50,
|
||||||
"shield" : 50,
|
"shield" : 50,
|
||||||
"speed" : 1.85,
|
"speed" : 1.85,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Hammerhead",
|
"name" : "Hammerhead",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 60,
|
"health" : 60,
|
||||||
"shield" : 50,
|
"shield" : 50,
|
||||||
"speed" : 1.7,
|
"speed" : 1.7,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Hyena-A",
|
"name" : "Hyena-A",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 90,
|
"health" : 90,
|
||||||
"shield" : 45,
|
"shield" : 45,
|
||||||
"speed" : 1.85,
|
"speed" : 1.85,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Hyena-B",
|
"name" : "Hyena-B",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 90,
|
"health" : 90,
|
||||||
"shield" : 45,
|
"shield" : 45,
|
||||||
"speed" : 1.85,
|
"speed" : 1.85,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Jackal",
|
"name" : "Jackal",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 75,
|
"health" : 75,
|
||||||
"shield" : 75,
|
"shield" : 75,
|
||||||
"speed" : 2,
|
"speed" : 2,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Khepri",
|
"name" : "Khepri",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 60,
|
"health" : 60,
|
||||||
"shield" : 50,
|
"shield" : 50,
|
||||||
"speed" : 1.7,
|
"speed" : 1.7,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Kingfisher",
|
"name" : "Kingfisher",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 65,
|
"health" : 65,
|
||||||
"shield" : 65,
|
"shield" : 65,
|
||||||
"speed" : 1.85,
|
"speed" : 1.85,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Leopard",
|
"name" : "Leopard",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 125,
|
"health" : 125,
|
||||||
"shield" : 75,
|
"shield" : 75,
|
||||||
"speed" : 1.7,
|
"speed" : 1.7,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Lynx",
|
"name" : "Lynx",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 75,
|
"health" : 75,
|
||||||
"shield" : 50,
|
"shield" : 50,
|
||||||
"speed" : 1.7,
|
"speed" : 1.7,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Mantis",
|
"name" : "Mantis",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 50,
|
"health" : 50,
|
||||||
"shield" : 75,
|
"shield" : 75,
|
||||||
"speed" : 1.85,
|
"speed" : 1.85,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Missile Dart",
|
"name" : "Missile Dart",
|
||||||
|
"description" : "",
|
||||||
"health" : 15,
|
"health" : 15,
|
||||||
"speed" : 2.1,
|
"speed" : 2.1,
|
||||||
"reloadTime" : 24,
|
"reloadTime" : 24,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Nymph",
|
"name" : "Nymph",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 45,
|
"health" : 45,
|
||||||
"shield" : 40,
|
"shield" : 40,
|
||||||
"speed" : 2,
|
"speed" : 2,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Ray",
|
"name" : "Ray",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 70,
|
"health" : 70,
|
||||||
"shield" : 70,
|
"shield" : 70,
|
||||||
"speed" : 1.85,
|
"speed" : 1.85,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Razor",
|
"name" : "Razor",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 45,
|
"health" : 45,
|
||||||
"shield" : 55,
|
"shield" : 55,
|
||||||
"speed" : 1.75,
|
"speed" : 1.75,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Rocket Dart",
|
"name" : "Rocket Dart",
|
||||||
|
"description" : "",
|
||||||
"health" : 15,
|
"health" : 15,
|
||||||
"speed" : 2.1,
|
"speed" : 2.1,
|
||||||
"reloadTime" : 35,
|
"reloadTime" : 35,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Rook",
|
"name" : "Rook",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 110,
|
"health" : 110,
|
||||||
"shield" : 80,
|
"shield" : 80,
|
||||||
"speed" : 1.7,
|
"speed" : 1.7,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Scarab",
|
"name" : "Scarab",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 80,
|
"health" : 80,
|
||||||
"shield" : 65,
|
"shield" : 65,
|
||||||
"speed" : 1.7,
|
"speed" : 1.7,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Shale",
|
"name" : "Shale",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 50,
|
"health" : 50,
|
||||||
"shield" : 50,
|
"shield" : 50,
|
||||||
"speed" : 2,
|
"speed" : 2,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Simple Dart",
|
"name" : "Simple Dart",
|
||||||
|
"description" : "",
|
||||||
"health" : 15,
|
"health" : 15,
|
||||||
"speed" : 2.1,
|
"speed" : 2.1,
|
||||||
"reloadTime" : 24,
|
"reloadTime" : 24,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "SK-31",
|
"name" : "SK-31",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 85,
|
"health" : 85,
|
||||||
"shield" : 50,
|
"shield" : 50,
|
||||||
"speed" : 1.8,
|
"speed" : 1.8,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "SK-34",
|
"name" : "SK-34",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 100,
|
"health" : 100,
|
||||||
"shield" : 45,
|
"shield" : 45,
|
||||||
"speed" : 1.7,
|
"speed" : 1.7,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Sphinx",
|
"name" : "Sphinx",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 110,
|
"health" : 110,
|
||||||
"shield" : 75,
|
"shield" : 75,
|
||||||
"speed" : 1.85,
|
"speed" : 1.85,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Static Dart",
|
"name" : "Static Dart",
|
||||||
|
"description" : "",
|
||||||
"health" : 15,
|
"health" : 15,
|
||||||
"speed" : 0,
|
"speed" : 0,
|
||||||
"reloadTime" : 24,
|
"reloadTime" : 24,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Swarmer",
|
"name" : "Swarmer",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 5,
|
"health" : 5,
|
||||||
"speed" : 2,
|
"speed" : 2,
|
||||||
"reloadTime" : 8,
|
"reloadTime" : 8,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "TAF",
|
"name" : "TAF",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 35,
|
"health" : 35,
|
||||||
"shield" : 35,
|
"shield" : 35,
|
||||||
"speed" : 2,
|
"speed" : 2,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Thunderhead",
|
"name" : "Thunderhead",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 90,
|
"health" : 90,
|
||||||
"shield" : 65,
|
"shield" : 65,
|
||||||
"speed" : 1.7,
|
"speed" : 1.7,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Unarmed Dart",
|
"name" : "Unarmed Dart",
|
||||||
|
"description" : "",
|
||||||
"health" : 15,
|
"health" : 15,
|
||||||
"speed" : 2.1,
|
"speed" : 2.1,
|
||||||
"reloadTime" : 24,
|
"reloadTime" : 24,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Unique Sphinx",
|
"name" : "Unique Sphinx",
|
||||||
|
"description" : "",
|
||||||
"health" : 999,
|
"health" : 999,
|
||||||
"shield" : 999,
|
"shield" : 999,
|
||||||
"speed" : 1.6,
|
"speed" : 1.6,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Plasma Turret",
|
"name" : "Plasma Turret",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 150,
|
"health" : 150,
|
||||||
"shield" : 25,
|
"shield" : 25,
|
||||||
"speed" : 0,
|
"speed" : 0,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Rapid Plasma Turret",
|
"name" : "Rapid Plasma Turret",
|
||||||
|
"description" : "",
|
||||||
"health" : 150,
|
"health" : 150,
|
||||||
"shield" : 25,
|
"shield" : 25,
|
||||||
"speed" : 0,
|
"speed" : 0,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Rocket Turret",
|
"name" : "Rocket Turret",
|
||||||
|
"description" : "TODO",
|
||||||
"health" : 125,
|
"health" : 125,
|
||||||
"shield" : 25,
|
"shield" : 25,
|
||||||
"speed" : 0,
|
"speed" : 0,
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name" : "prev",
|
||||||
|
"group" : "fighterDB",
|
||||||
|
"type" : "WT_IMG_BUTTON",
|
||||||
|
"x" : 540,
|
||||||
|
"y" : 110,
|
||||||
|
"w" : 150,
|
||||||
|
"h": 34,
|
||||||
|
"texture" : "gfx/widgets/optionsLeft.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "next",
|
||||||
|
"group" : "fighterDB",
|
||||||
|
"type" : "WT_IMG_BUTTON",
|
||||||
|
"x" : 720,
|
||||||
|
"y" : 110,
|
||||||
|
"w" : 150,
|
||||||
|
"h": 34,
|
||||||
|
"texture" : "gfx/widgets/optionsRight.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "ok",
|
||||||
|
"group" : "fighterDB",
|
||||||
|
"type" : "WT_BUTTON",
|
||||||
|
"text" : "OK",
|
||||||
|
"x" : 640,
|
||||||
|
"y" : 635,
|
||||||
|
"w" : 150,
|
||||||
|
"h": 34
|
||||||
|
}
|
||||||
|
]
|
|
@ -15,7 +15,7 @@
|
||||||
"type" : "WT_BUTTON",
|
"type" : "WT_BUTTON",
|
||||||
"text" : "Challenges",
|
"text" : "Challenges",
|
||||||
"x" : -1,
|
"x" : -1,
|
||||||
"y" : 280,
|
"y" : 260,
|
||||||
"w" : 200,
|
"w" : 200,
|
||||||
"h": 34
|
"h": 34
|
||||||
},
|
},
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
"type" : "WT_BUTTON",
|
"type" : "WT_BUTTON",
|
||||||
"text" : "Trophies",
|
"text" : "Trophies",
|
||||||
"x" : -1,
|
"x" : -1,
|
||||||
"y" : 360,
|
"y" : 320,
|
||||||
"w" : 200,
|
"w" : 200,
|
||||||
"h": 34
|
"h": 34
|
||||||
},
|
},
|
||||||
|
@ -35,6 +35,16 @@
|
||||||
"type" : "WT_BUTTON",
|
"type" : "WT_BUTTON",
|
||||||
"text" : "Stats",
|
"text" : "Stats",
|
||||||
"x" : -1,
|
"x" : -1,
|
||||||
|
"y" : 380,
|
||||||
|
"w" : 200,
|
||||||
|
"h": 34
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "fighterDB",
|
||||||
|
"group" : "title",
|
||||||
|
"type" : "WT_BUTTON",
|
||||||
|
"text" : "Fighter Database",
|
||||||
|
"x" : -1,
|
||||||
"y" : 440,
|
"y" : 440,
|
||||||
"w" : 200,
|
"w" : 200,
|
||||||
"h": 34
|
"h": 34
|
||||||
|
@ -45,7 +55,7 @@
|
||||||
"type" : "WT_BUTTON",
|
"type" : "WT_BUTTON",
|
||||||
"text" : "Options",
|
"text" : "Options",
|
||||||
"x" : -1,
|
"x" : -1,
|
||||||
"y" : 520,
|
"y" : 500,
|
||||||
"w" : 200,
|
"w" : 200,
|
||||||
"h": 34
|
"h": 34
|
||||||
},
|
},
|
||||||
|
@ -55,7 +65,7 @@
|
||||||
"type" : "WT_BUTTON",
|
"type" : "WT_BUTTON",
|
||||||
"text" : "Credits",
|
"text" : "Credits",
|
||||||
"x" : -1,
|
"x" : -1,
|
||||||
"y" : 600,
|
"y" : 560,
|
||||||
"w" : 200,
|
"w" : 200,
|
||||||
"h": 34
|
"h": 34
|
||||||
},
|
},
|
||||||
|
@ -65,7 +75,7 @@
|
||||||
"type" : "WT_BUTTON",
|
"type" : "WT_BUTTON",
|
||||||
"text" : "Quit",
|
"text" : "Quit",
|
||||||
"x" : -1,
|
"x" : -1,
|
||||||
"y" : 680,
|
"y" : 620,
|
||||||
"w" : 200,
|
"w" : 200,
|
||||||
"h": 34
|
"h": 34
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2015-2016 Parallel Realities
|
Copyright (C) 2015-2017 Parallel Realities
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -747,6 +747,36 @@ static Entity *getFighterDef(char *name)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Entity **getDBFighters(int *num)
|
||||||
|
{
|
||||||
|
Entity *e, **dbFighters;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
i = *num = 0;
|
||||||
|
|
||||||
|
for (e = defHead.next ; e != NULL ; e = e->next)
|
||||||
|
{
|
||||||
|
if (strlen(e->description) > 0)
|
||||||
|
{
|
||||||
|
*num = *num + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dbFighters = malloc(sizeof(Entity*) * *num);
|
||||||
|
|
||||||
|
for (e = defHead.next ; e != NULL ; e = e->next)
|
||||||
|
{
|
||||||
|
if (strlen(e->description) > 0)
|
||||||
|
{
|
||||||
|
dbFighters[i] = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return dbFighters;
|
||||||
|
}
|
||||||
|
|
||||||
void loadFighterDefs(void)
|
void loadFighterDefs(void)
|
||||||
{
|
{
|
||||||
memset(&defHead, 0, sizeof(Entity));
|
memset(&defHead, 0, sizeof(Entity));
|
||||||
|
@ -802,6 +832,7 @@ static void loadFighterDef(char *filename)
|
||||||
|
|
||||||
STRNCPY(e->name, cJSON_GetObjectItem(root, "name")->valuestring, MAX_NAME_LENGTH);
|
STRNCPY(e->name, cJSON_GetObjectItem(root, "name")->valuestring, MAX_NAME_LENGTH);
|
||||||
STRNCPY(e->defName, e->name, MAX_NAME_LENGTH);
|
STRNCPY(e->defName, e->name, MAX_NAME_LENGTH);
|
||||||
|
STRNCPY(e->description, cJSON_GetObjectItem(root, "description")->valuestring, MAX_NAME_LENGTH);
|
||||||
e->health = e->maxHealth = cJSON_GetObjectItem(root, "health")->valueint;
|
e->health = e->maxHealth = cJSON_GetObjectItem(root, "health")->valueint;
|
||||||
e->shield = e->maxShield = getJSONValue(root, "shield", 0);
|
e->shield = e->maxShield = getJSONValue(root, "shield", 0);
|
||||||
e->speed = cJSON_GetObjectItem(root, "speed")->valuedouble;
|
e->speed = cJSON_GetObjectItem(root, "speed")->valuedouble;
|
||||||
|
|
|
@ -0,0 +1,84 @@
|
||||||
|
/*
|
||||||
|
Copyright (C) 2015-2017 Parallel Realities
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
See the GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "fighterDatabase.h"
|
||||||
|
|
||||||
|
static int page;
|
||||||
|
static int maxPages;
|
||||||
|
static Widget *prev;
|
||||||
|
static Widget *next;
|
||||||
|
static char *DB_TEXT;
|
||||||
|
static char *PAGE_TEXT;
|
||||||
|
static void prevFighter(void);
|
||||||
|
static void nextFighter(void);
|
||||||
|
|
||||||
|
void initFighterDatabase(void)
|
||||||
|
{
|
||||||
|
DB_TEXT = _("Fighter Database");
|
||||||
|
PAGE_TEXT = _("Page %d / %d");
|
||||||
|
}
|
||||||
|
|
||||||
|
void initFighterDatabaseDisplay(void)
|
||||||
|
{
|
||||||
|
page = 0;
|
||||||
|
maxPages = 1;
|
||||||
|
|
||||||
|
prev = getWidget("prev", "fighterDB");
|
||||||
|
prev->action = prevFighter;
|
||||||
|
prev->visible = 0;
|
||||||
|
|
||||||
|
next = getWidget("next", "fighterDB");
|
||||||
|
next->action = nextFighter;
|
||||||
|
next->visible = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void drawFighterDatabase(void)
|
||||||
|
{
|
||||||
|
SDL_Rect r;
|
||||||
|
|
||||||
|
SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_BLEND);
|
||||||
|
SDL_SetRenderDrawColor(app.renderer, 0, 0, 0, 128);
|
||||||
|
SDL_RenderFillRect(app.renderer, NULL);
|
||||||
|
SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_NONE);
|
||||||
|
|
||||||
|
r.w = 800;
|
||||||
|
r.h = 650;
|
||||||
|
r.x = (SCREEN_WIDTH / 2) - r.w / 2;
|
||||||
|
r.y = (SCREEN_HEIGHT / 2) - r.h / 2;
|
||||||
|
|
||||||
|
SDL_SetRenderDrawColor(app.renderer, 0, 0, 0, 0);
|
||||||
|
SDL_RenderFillRect(app.renderer, &r);
|
||||||
|
SDL_SetRenderDrawColor(app.renderer, 200, 200, 200, 255);
|
||||||
|
SDL_RenderDrawRect(app.renderer, &r);
|
||||||
|
|
||||||
|
drawText(SCREEN_WIDTH / 2, 50, 28, TA_CENTER, colors.white, DB_TEXT);
|
||||||
|
|
||||||
|
drawText(SCREEN_WIDTH / 2, 90, 16, TA_CENTER, colors.lightGrey, PAGE_TEXT, page + 1, (int)maxPages);
|
||||||
|
|
||||||
|
drawWidgets("fighterDB");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void prevFighter(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void nextFighter(void)
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
/*
|
||||||
|
Copyright (C) 2015-2017 Parallel Realities
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
See the GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
|
||||||
|
extern void drawWidgets(char *groupName);
|
||||||
|
extern Widget *getWidget(const char *name, const char *group);
|
||||||
|
extern char *getTranslatedString(char *string);
|
||||||
|
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
|
||||||
|
|
||||||
|
extern App app;
|
||||||
|
extern Colors colors;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2015-2016 Parallel Realities
|
Copyright (C) 2015-2017 Parallel Realities
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -30,6 +30,7 @@ static void campaign(void);
|
||||||
static void challenges(void);
|
static void challenges(void);
|
||||||
static void trophies(void);
|
static void trophies(void);
|
||||||
static void stats(void);
|
static void stats(void);
|
||||||
|
static void fighterDatabase(void);
|
||||||
static void ok(void);
|
static void ok(void);
|
||||||
static void options(void);
|
static void options(void);
|
||||||
static void credits(void);
|
static void credits(void);
|
||||||
|
@ -82,6 +83,7 @@ void initTitle(void)
|
||||||
getWidget("challenges", "title")->action = challenges;
|
getWidget("challenges", "title")->action = challenges;
|
||||||
getWidget("trophies", "title")->action = trophies;
|
getWidget("trophies", "title")->action = trophies;
|
||||||
getWidget("stats", "title")->action = stats;
|
getWidget("stats", "title")->action = stats;
|
||||||
|
getWidget("fighterDB", "title")->action = fighterDatabase;
|
||||||
getWidget("options", "title")->action = options;
|
getWidget("options", "title")->action = options;
|
||||||
getWidget("credits", "title")->action = credits;
|
getWidget("credits", "title")->action = credits;
|
||||||
getWidget("quit", "title")->action = quit;
|
getWidget("quit", "title")->action = quit;
|
||||||
|
@ -181,7 +183,7 @@ static void draw(void)
|
||||||
|
|
||||||
blit(pandoranWar, SCREEN_WIDTH / 2, 110, 1);
|
blit(pandoranWar, SCREEN_WIDTH / 2, 110, 1);
|
||||||
|
|
||||||
drawText(10, SCREEN_HEIGHT - 25, 14, TA_LEFT, colors.white, "Copyright Parallel Realities, 2015-2016");
|
drawText(10, SCREEN_HEIGHT - 25, 14, TA_LEFT, colors.white, "Copyright Parallel Realities, 2015-2017");
|
||||||
drawText(SCREEN_WIDTH - 10, SCREEN_HEIGHT - 25, 14, TA_RIGHT, colors.white, "Version %.2f-%d", VERSION, REVISION);
|
drawText(SCREEN_WIDTH - 10, SCREEN_HEIGHT - 25, 14, TA_RIGHT, colors.white, "Version %.2f-%d", VERSION, REVISION);
|
||||||
|
|
||||||
switch (show)
|
switch (show)
|
||||||
|
@ -201,6 +203,10 @@ static void draw(void)
|
||||||
case SHOW_TROPHIES:
|
case SHOW_TROPHIES:
|
||||||
drawTrophies();
|
drawTrophies();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SHOW_FIGHTER_DB:
|
||||||
|
drawFighterDatabase();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,6 +256,13 @@ static void trophies(void)
|
||||||
initTrophiesDisplay();
|
initTrophiesDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void fighterDatabase(void)
|
||||||
|
{
|
||||||
|
show = SHOW_FIGHTER_DB;
|
||||||
|
|
||||||
|
initFighterDatabaseDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
static void options(void)
|
static void options(void)
|
||||||
{
|
{
|
||||||
selectWidget("ok", "options");
|
selectWidget("ok", "options");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2015-2016 Parallel Realities
|
Copyright (C) 2015-2017 Parallel Realities
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#define SHOW_STATS 1
|
#define SHOW_STATS 1
|
||||||
#define SHOW_OPTIONS 2
|
#define SHOW_OPTIONS 2
|
||||||
#define SHOW_TROPHIES 3
|
#define SHOW_TROPHIES 3
|
||||||
|
#define SHOW_FIGHTER_DB 4
|
||||||
|
|
||||||
#define NUM_FIGHTERS 12
|
#define NUM_FIGHTERS 12
|
||||||
|
|
||||||
|
@ -60,6 +61,8 @@ extern void clearInput(void);
|
||||||
extern void initTrophiesDisplay(void);
|
extern void initTrophiesDisplay(void);
|
||||||
extern void drawTrophies(void);
|
extern void drawTrophies(void);
|
||||||
extern void initCredits(void);
|
extern void initCredits(void);
|
||||||
|
extern void drawFighterDatabase(void);
|
||||||
|
extern void initFighterDatabaseDisplay(void);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Battle battle;
|
extern Battle battle;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2015-2016 Parallel Realities
|
Copyright (C) 2015-2017 Parallel Realities
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -100,6 +100,7 @@ struct Entity {
|
||||||
char name[MAX_NAME_LENGTH];
|
char name[MAX_NAME_LENGTH];
|
||||||
char defName[MAX_NAME_LENGTH];
|
char defName[MAX_NAME_LENGTH];
|
||||||
char groupName[MAX_NAME_LENGTH];
|
char groupName[MAX_NAME_LENGTH];
|
||||||
|
char description[MAX_DESCRIPTION_LENGTH];
|
||||||
int active;
|
int active;
|
||||||
int spawned;
|
int spawned;
|
||||||
int id;
|
int id;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2015-2016 Parallel Realities
|
Copyright (C) 2015-2017 Parallel Realities
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -141,7 +141,8 @@ void initGameSystem(void)
|
||||||
initBackground,
|
initBackground,
|
||||||
initStars,
|
initStars,
|
||||||
initControls,
|
initControls,
|
||||||
initTrophies
|
initTrophies,
|
||||||
|
initFighterDatabase
|
||||||
};
|
};
|
||||||
|
|
||||||
numInitFuns = sizeof(initFuncs) / sizeof(void*);
|
numInitFuns = sizeof(initFuncs) / sizeof(void*);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2015-2016 Parallel Realities
|
Copyright (C) 2015-2017 Parallel Realities
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -48,6 +48,7 @@ extern void initWidgets(void);
|
||||||
extern void initBackground(void);
|
extern void initBackground(void);
|
||||||
extern void initResources(void);
|
extern void initResources(void);
|
||||||
extern void initControls(void);
|
extern void initControls(void);
|
||||||
|
extern void initFighterDatabase(void);
|
||||||
extern void destroyLookups(void);
|
extern void destroyLookups(void);
|
||||||
extern void destroyFonts(void);
|
extern void destroyFonts(void);
|
||||||
extern void destroySounds(void);
|
extern void destroySounds(void);
|
||||||
|
|
Loading…
Reference in New Issue