mirror of
https://github.com/cxong/cdogs-sdl.git
synced 2025-07-23 07:23:01 +02:00
Fix loading old missions in editor
Fix feet and hair colours for old missions Add cryogun model #455
This commit is contained in:
BIN
graphics/chars/guns/cryogun_30x22.png
Normal file
BIN
graphics/chars/guns/cryogun_30x22.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.9 KiB |
@@ -7,5 +7,6 @@
|
||||
"WeaponPersist": false,
|
||||
"SkipWeaponMenu": false,
|
||||
"RandomPickups": true,
|
||||
"DoorOpenTicks": 70,
|
||||
"Missions": 7
|
||||
}
|
@@ -9,7 +9,7 @@
|
||||
"Hair": "ff0202ff",
|
||||
"Feet": "3c5f56ff",
|
||||
"speed": 240,
|
||||
"Gun": "Knife",
|
||||
"Gun": "Fists",
|
||||
"maxHealth": 20,
|
||||
"flags": 1024,
|
||||
"probabilityToMove": 90,
|
||||
|
@@ -162,7 +162,6 @@
|
||||
}],
|
||||
"EnemyDensity": 10,
|
||||
"Weapons": ["Knife", "Pistol"],
|
||||
"Song": "",
|
||||
"TileClasses": {
|
||||
"Wall": {
|
||||
"Name": "wall",
|
||||
@@ -302,7 +301,6 @@
|
||||
}],
|
||||
"EnemyDensity": 10,
|
||||
"Weapons": ["Knife", "Pistol"],
|
||||
"Song": "",
|
||||
"TileClasses": {
|
||||
"Wall": {
|
||||
"Name": "wall",
|
||||
@@ -367,7 +365,8 @@
|
||||
"Doors": {
|
||||
"Enabled": true,
|
||||
"Min": 2,
|
||||
"Max": 3
|
||||
"Max": 3,
|
||||
"RandomPos": false
|
||||
},
|
||||
"Pillars": {
|
||||
"Count": 6,
|
||||
@@ -437,7 +436,6 @@
|
||||
"Weapons": ["Knife",
|
||||
"Pistol",
|
||||
"Shotgun"],
|
||||
"Song": "",
|
||||
"TileClasses": {
|
||||
"Wall": {
|
||||
"Name": "wall",
|
||||
@@ -542,16 +540,16 @@
|
||||
"Pistol"],
|
||||
"Song": "graveintent1.xm",
|
||||
"TileClasses": {
|
||||
"2": {
|
||||
"Name": "door",
|
||||
"Type": "Door",
|
||||
"Style": "blast",
|
||||
"Mask": "ffffffff",
|
||||
"MaskAlt": "ffffffff",
|
||||
"CanWalk": false,
|
||||
"IsOpaque": true,
|
||||
"Shootable": true,
|
||||
"IsRoom": true
|
||||
"0": {
|
||||
"Name": "tile",
|
||||
"Type": "Floor",
|
||||
"Style": "cobble",
|
||||
"Mask": "c0c0c0ff",
|
||||
"MaskAlt": "008400ff",
|
||||
"CanWalk": true,
|
||||
"IsOpaque": false,
|
||||
"Shootable": false,
|
||||
"IsRoom": false
|
||||
},
|
||||
"1": {
|
||||
"Name": "wall",
|
||||
@@ -564,6 +562,17 @@
|
||||
"Shootable": true,
|
||||
"IsRoom": false
|
||||
},
|
||||
"2": {
|
||||
"Name": "door",
|
||||
"Type": "Door",
|
||||
"Style": "blast",
|
||||
"Mask": "ffffffff",
|
||||
"MaskAlt": "ffffffff",
|
||||
"CanWalk": false,
|
||||
"IsOpaque": true,
|
||||
"Shootable": true,
|
||||
"IsRoom": true
|
||||
},
|
||||
"3": {
|
||||
"Name": "tile",
|
||||
"Type": "Floor",
|
||||
@@ -574,17 +583,6 @@
|
||||
"IsOpaque": false,
|
||||
"Shootable": false,
|
||||
"IsRoom": true
|
||||
},
|
||||
"0": {
|
||||
"Name": "tile",
|
||||
"Type": "Floor",
|
||||
"Style": "cobble",
|
||||
"Mask": "c0c0c0ff",
|
||||
"MaskAlt": "008400ff",
|
||||
"CanWalk": true,
|
||||
"IsOpaque": false,
|
||||
"Shootable": false,
|
||||
"IsRoom": false
|
||||
}
|
||||
},
|
||||
"Tiles": ["1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1",
|
||||
@@ -846,50 +844,164 @@
|
||||
}],
|
||||
"StaticCharacters": [{
|
||||
"Index": 0,
|
||||
"Positions": [[14, 16],
|
||||
[17, 12],
|
||||
[18, 18],
|
||||
[5, 14],
|
||||
[1, 18],
|
||||
[7, 37],
|
||||
[10, 40],
|
||||
[7, 42],
|
||||
[13, 44],
|
||||
[13, 62],
|
||||
[7, 56],
|
||||
[9, 58],
|
||||
[3, 69],
|
||||
[5, 71],
|
||||
[14, 87],
|
||||
[16, 82],
|
||||
[17, 86],
|
||||
[13, 84],
|
||||
[3, 88],
|
||||
[7, 91],
|
||||
[2, 93],
|
||||
[6, 96],
|
||||
[17, 75],
|
||||
[16, 76]]
|
||||
"Places": [{
|
||||
"Pos": [14, 16],
|
||||
"Dir": 1
|
||||
},
|
||||
{
|
||||
"Pos": [17, 12],
|
||||
"Dir": 3
|
||||
},
|
||||
{
|
||||
"Pos": [18, 18],
|
||||
"Dir": 6
|
||||
},
|
||||
{
|
||||
"Pos": [5, 14],
|
||||
"Dir": 4
|
||||
},
|
||||
{
|
||||
"Pos": [1, 18],
|
||||
"Dir": 1
|
||||
},
|
||||
{
|
||||
"Pos": [7, 37],
|
||||
"Dir": 4
|
||||
},
|
||||
{
|
||||
"Pos": [10, 40],
|
||||
"Dir": 6
|
||||
},
|
||||
{
|
||||
"Pos": [7, 42],
|
||||
"Dir": 6
|
||||
},
|
||||
{
|
||||
"Pos": [13, 44],
|
||||
"Dir": 2
|
||||
},
|
||||
{
|
||||
"Pos": [13, 62],
|
||||
"Dir": 0
|
||||
},
|
||||
{
|
||||
"Pos": [7, 56],
|
||||
"Dir": 1
|
||||
},
|
||||
{
|
||||
"Pos": [9, 58],
|
||||
"Dir": 1
|
||||
},
|
||||
{
|
||||
"Pos": [3, 69],
|
||||
"Dir": 1
|
||||
},
|
||||
{
|
||||
"Pos": [5, 71],
|
||||
"Dir": 3
|
||||
},
|
||||
{
|
||||
"Pos": [14, 87],
|
||||
"Dir": 1
|
||||
},
|
||||
{
|
||||
"Pos": [16, 82],
|
||||
"Dir": 3
|
||||
},
|
||||
{
|
||||
"Pos": [17, 86],
|
||||
"Dir": 3
|
||||
},
|
||||
{
|
||||
"Pos": [13, 84],
|
||||
"Dir": 6
|
||||
},
|
||||
{
|
||||
"Pos": [3, 88],
|
||||
"Dir": 3
|
||||
},
|
||||
{
|
||||
"Pos": [7, 91],
|
||||
"Dir": 4
|
||||
},
|
||||
{
|
||||
"Pos": [2, 93],
|
||||
"Dir": 7
|
||||
},
|
||||
{
|
||||
"Pos": [6, 96],
|
||||
"Dir": 4
|
||||
},
|
||||
{
|
||||
"Pos": [17, 75],
|
||||
"Dir": 6
|
||||
},
|
||||
{
|
||||
"Pos": [16, 76],
|
||||
"Dir": 1
|
||||
}]
|
||||
},
|
||||
{
|
||||
"Index": 2,
|
||||
"Positions": [[1, 35],
|
||||
[7, 45],
|
||||
[10, 44],
|
||||
[2, 64],
|
||||
[10, 71],
|
||||
[12, 88],
|
||||
[3, 97],
|
||||
[8, 97]]
|
||||
"Places": [{
|
||||
"Pos": [1, 35],
|
||||
"Dir": 4
|
||||
},
|
||||
{
|
||||
"Pos": [7, 45],
|
||||
"Dir": 6
|
||||
},
|
||||
{
|
||||
"Pos": [10, 44],
|
||||
"Dir": 5
|
||||
},
|
||||
{
|
||||
"Pos": [2, 64],
|
||||
"Dir": 4
|
||||
},
|
||||
{
|
||||
"Pos": [10, 71],
|
||||
"Dir": 6
|
||||
},
|
||||
{
|
||||
"Pos": [12, 88],
|
||||
"Dir": 7
|
||||
},
|
||||
{
|
||||
"Pos": [3, 97],
|
||||
"Dir": 7
|
||||
},
|
||||
{
|
||||
"Pos": [8, 97],
|
||||
"Dir": 6
|
||||
}]
|
||||
},
|
||||
{
|
||||
"Index": 4,
|
||||
"Positions": [[18, 38],
|
||||
[16, 65],
|
||||
[14, 67],
|
||||
[1, 79],
|
||||
[2, 81],
|
||||
[17, 73]]
|
||||
"Places": [{
|
||||
"Pos": [18, 38],
|
||||
"Dir": 3
|
||||
},
|
||||
{
|
||||
"Pos": [16, 65],
|
||||
"Dir": 2
|
||||
},
|
||||
{
|
||||
"Pos": [14, 67],
|
||||
"Dir": 5
|
||||
},
|
||||
{
|
||||
"Pos": [1, 79],
|
||||
"Dir": 0
|
||||
},
|
||||
{
|
||||
"Pos": [2, 81],
|
||||
"Dir": 3
|
||||
},
|
||||
{
|
||||
"Pos": [17, 73],
|
||||
"Dir": 3
|
||||
}]
|
||||
}],
|
||||
"StaticObjectives": [],
|
||||
"StaticKeys": [{
|
||||
@@ -905,7 +1017,8 @@
|
||||
6],
|
||||
"Mission": 5,
|
||||
"Hidden": false
|
||||
}]
|
||||
}],
|
||||
"AltFloorsEnabled": true
|
||||
},
|
||||
{
|
||||
"Title": "Pandemonium",
|
||||
@@ -991,7 +1104,6 @@
|
||||
"Shotgun",
|
||||
"Flamer",
|
||||
"Pistol"],
|
||||
"Song": "",
|
||||
"TileClasses": {
|
||||
"Wall": {
|
||||
"Name": "wall",
|
||||
@@ -1056,7 +1168,8 @@
|
||||
"Doors": {
|
||||
"Enabled": true,
|
||||
"Min": 2,
|
||||
"Max": 2
|
||||
"Max": 2,
|
||||
"RandomPos": false
|
||||
},
|
||||
"Pillars": {
|
||||
"Count": 0,
|
||||
@@ -1156,7 +1269,6 @@
|
||||
"Flamer",
|
||||
"Shotgun",
|
||||
"Pistol"],
|
||||
"Song": "",
|
||||
"TileClasses": {
|
||||
"Wall": {
|
||||
"Name": "wall",
|
||||
@@ -1221,7 +1333,8 @@
|
||||
"Doors": {
|
||||
"Enabled": true,
|
||||
"Min": 3,
|
||||
"Max": 3
|
||||
"Max": 3,
|
||||
"RandomPos": false
|
||||
},
|
||||
"Pillars": {
|
||||
"Count": 10,
|
||||
|
@@ -2,6 +2,7 @@
|
||||
"Version": 1,
|
||||
"Guns": [
|
||||
{
|
||||
"Pic": "zapper",
|
||||
"Name": "Mining laser",
|
||||
"Bullet": "laser_point",
|
||||
"Icon": "browny_gun",
|
||||
@@ -71,9 +72,9 @@
|
||||
"CanDrop": false
|
||||
},
|
||||
{
|
||||
"Pic": "cryogun",
|
||||
"Name": "Cryo gun",
|
||||
"Icon": "cryo_gun",
|
||||
"Pic": "blaster",
|
||||
"Bullet": "cryo_gas",
|
||||
"Cost": 1,
|
||||
"Lock": 6,
|
||||
|
@@ -173,7 +173,7 @@ void CharacterLoadJSON(
|
||||
}
|
||||
if (version < 12)
|
||||
{
|
||||
ConvertHairColors(ch);
|
||||
ConvertHairColors(ch, ch->Class->Name);
|
||||
}
|
||||
LoadStr(&ch->PlayerTemplateName, child, "PlayerTemplateName");
|
||||
LoadFullInt(&ch->speed, child, "speed");
|
||||
|
@@ -22,7 +22,7 @@
|
||||
This file incorporates work covered by the following copyright and
|
||||
permission notice:
|
||||
|
||||
Copyright (c) 2013-2016, 2018-2020 Cong Xu
|
||||
Copyright (c) 2013-2016, 2018-2021 Cong Xu
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -169,8 +169,14 @@ int ScanCampaignOld(const char *filename, char **title, int *missions)
|
||||
f_read(f, setting.author, sizeof(setting.author));
|
||||
f_read(f, setting.description, sizeof(setting.description));
|
||||
f_read32(f, &setting.missionCount, sizeof(setting.missionCount));
|
||||
CSTRDUP(*title, setting.title);
|
||||
*missions = setting.missionCount;
|
||||
if (title)
|
||||
{
|
||||
CSTRDUP(*title, setting.title);
|
||||
}
|
||||
if (missions)
|
||||
{
|
||||
*missions = setting.missionCount;
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
|
||||
@@ -279,35 +285,36 @@ void ConvertCharacterColors(
|
||||
c->Body = ColorTint(PaletteToColor(cShadePalettes[body]), tint);
|
||||
c->Legs = ColorTint(PaletteToColor(cShadePalettes[leg]), tint);
|
||||
c->Hair = ColorTint(PaletteToColor(cShadePalettes[hair]), tint);
|
||||
c->Feet = c->Legs;
|
||||
}
|
||||
|
||||
// Hair colour correction; some characters had no hair but now with
|
||||
// specific parts of the head colourised using the hair colour; set
|
||||
// default "hair" colour based on the head type
|
||||
void ConvertHairColors(Character *ch)
|
||||
void ConvertHairColors(Character *ch, const char *face)
|
||||
{
|
||||
const color_t darkRed = {0xC0, 0, 0, 0xFF};
|
||||
if (strcmp(ch->Class->Name, "Cyborg") == 0)
|
||||
if (strcmp(face, "Cyborg") == 0)
|
||||
{
|
||||
// eye
|
||||
ch->Colors.Hair = colorRed;
|
||||
}
|
||||
else if (strcmp(ch->Class->Name, "Ice") == 0)
|
||||
else if (strcmp(face, "Ice") == 0)
|
||||
{
|
||||
// shades
|
||||
ch->Colors.Hair = colorBlack;
|
||||
}
|
||||
else if (strcmp(ch->Class->Name, "Ogre") == 0)
|
||||
else if (strcmp(face, "Ogre") == 0)
|
||||
{
|
||||
// eyes
|
||||
ch->Colors.Hair = darkRed;
|
||||
}
|
||||
else if (strcmp(ch->Class->Name, "Snake") == 0)
|
||||
else if (strcmp(face, "Snake") == 0)
|
||||
{
|
||||
// eyepatch
|
||||
ch->Colors.Hair = colorBlack;
|
||||
}
|
||||
else if (strcmp(ch->Class->Name, "WarBaby") == 0)
|
||||
else if (strcmp(face, "WarBaby") == 0)
|
||||
{
|
||||
// beret
|
||||
ch->Colors.Hair = colorRed;
|
||||
@@ -349,7 +356,7 @@ void ConvertCharacter(Character *c, TBadGuy *b)
|
||||
ConvertCharacterColors(
|
||||
b->skinColor, b->armColor, b->bodyColor, b->legColor, b->hairColor,
|
||||
&c->Colors);
|
||||
ConvertHairColors(c);
|
||||
ConvertHairColors(c, face);
|
||||
c->maxHealth = b->health;
|
||||
c->flags = b->flags;
|
||||
}
|
||||
|
@@ -204,7 +204,7 @@ void ConvertCampaignSetting(CampaignSetting *dest, CampaignSettingOld *src);
|
||||
void ConvertCharacterColors(
|
||||
const int skin, const int arm, const int body, const int leg,
|
||||
const int hair, CharColors *c);
|
||||
void ConvertHairColors(Character *ch);
|
||||
void ConvertHairColors(Character *ch, const char *face);
|
||||
|
||||
int ScanCampaignOld(const char *filename, char **title, int *missions);
|
||||
int IsCampaignOldFile(const char *filename);
|
||||
|
Reference in New Issue
Block a user