Skip to content

Commit

Permalink
Noah E1L2 items #712
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Jun 30, 2024
1 parent 936adcc commit 60afe48
Show file tree
Hide file tree
Showing 18 changed files with 103 additions and 33 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ endif()

# this must be 4 numbers
set(VERSION_RC "${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},0")
set(YEAR "2024")
set(WEBSITE "http://cxong.github.io/cdogs-sdl/")

option(DEBUG "Enable debug build" OFF)
Expand Down
2 changes: 1 addition & 1 deletion build/windows/cdogs.rc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ BEGIN
VALUE "FileVersion", "@VERSION@\0"
VALUE "Comments", "@WEBSITE@\0"
VALUE "InternalName", "cdogs\0"
VALUE "LegalCopyright", "Copyright (C) 1997-2019 C-Dogs SDL Team\0"
VALUE "LegalCopyright", "Copyright (C) 1997-@YEAR@ C-Dogs SDL Team\0"
VALUE "OriginalFilename", "cdogs-sdl.exe\0"
VALUE "ProductName", "C-Dogs SDL\0"
VALUE "ProductVersion", "@VERSION@\0"
Expand Down
Binary file added data/.wolf3d/N3Ddata.cdogscpn/graphics/birdcage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file removed data/.wolf3d/N3Ddata.cdogscpn/graphics/gibbet.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed data/.wolf3d/N3Ddata.cdogscpn/graphics/sink.png
Binary file not shown.
4 changes: 0 additions & 4 deletions data/.wolf3d/N3Ddata.cdogscpn/graphics/sink.txt

This file was deleted.

Binary file added data/.wolf3d/N3Ddata.cdogscpn/graphics/stairs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 31 additions & 10 deletions data/.wolf3d/N3Ddata.cdogscpn/map_objects.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
"Health": 80,
"Flags": ["Inside", "OneOrMoreWalls"]
},
{
"Name": "stairs",
"Pic": {
"Type": "Normal",
"Pic": "stairs"
},
"Offset": [-8, -23],
"Health": 0,
"Flags": ["Inside", "OnWall"]
},
{
"Name": "pillar_candle",
"Pic": {
Expand All @@ -40,14 +50,26 @@
"Flags": ["Inside", "NoWalls"]
},
{
"Name": "sink",
"Name": "water_pitcher",
"Pic": {
"Type": "Normal",
"Pic": "sink"
"Pic": "water_pitcher"
},
"Size": [8, 6],
"Wreck": "water_pitcher_wreck",
"Health": 50,
"Flags": ["Inside", "OnWall"]
"Flags": ["Inside", "OneOrMoreWalls"]
},
{
"Name": "water_pitcher_wreck",
"Pic": {
"Type": "Normal",
"Pic": "water_pitcher_wreck"
},
"Health": 0,
"DrawBelow": true,
"FootstepSound": "footsteps/water",
"FootprintMask": "00000099"
},
{
"Name": "skull_pillar",
Expand Down Expand Up @@ -112,14 +134,13 @@
"Flags": ["Inside", "OneOrMoreWalls", "FreeInFront"]
},
{
"Name": "gibbet",
"Name": "birdcage",
"Pic": {
"Type": "Normal",
"Pic": "gibbet"
"Pic": "birdcage"
},
"Offset": [-7, -33],
"Health": 40,
"Flags": ["Inside", "NoWalls"]
"Health": 40
},
{
"Name": "gibbet_skeleton",
Expand All @@ -142,13 +163,13 @@
"Flags": ["Inside", "NoWalls"]
},
{
"Name": "well",
"Name": "water_trough",
"Pic": {
"Type": "Normal",
"Pic": "well"
"Pic": "water_trough"
},
"Health": 80,
"Flags": ["Outside", "NoWalls"]
"Flags": ["OneOrMoreWalls"]
},
{
"Name": "well_water",
Expand Down
13 changes: 13 additions & 0 deletions data/.wolf3d/N3Ddata.cdogscpn/pickups.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,19 @@
"Amount": 5
}],
"Sound": "pickup"
},
{
"Name": "large_feed_box",
"Pic": {
"Type": "Normal",
"Pic": "large_feed_box"
},
"Effects": [{
"Type": "Ammo",
"Ammo": "Feed",
"Amount": 25
}],
"Sound": "pickup"
}
]
}
2 changes: 1 addition & 1 deletion src/cdogs/ammo.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Ammo *AmmoGetById(AmmoClasses *ammo, const int id)
return CArrayGet(&ammo->Ammo, id);
}
const int id2 = id - (int)ammo->Ammo.size;
if (id < (int)ammo->CustomAmmo.size)
if (id2 < (int)ammo->CustomAmmo.size)
{
return CArrayGet(&ammo->CustomAmmo, id2);
}
Expand Down
70 changes: 54 additions & 16 deletions src/cdogs/map_wolf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,7 @@ static void TryLoadWallObject(
e.R.Pos = exitV;
e.R.Size = svec2i_zero();
MissionStaticTryAddExit(m, &e);
MissionStaticTryAddItem(m, StrMapObject("stairs"), exitV);
}
}
}
Expand Down Expand Up @@ -2269,8 +2270,7 @@ static void LoadEntity(
{
case CWMAPTYPE_N3D:
MissionStaticTryAddItem(
&m->u.Static, StrMapObject("chandelier"), v);
// TODO: wrong item
&m->u.Static, StrMapObject("bookshelf2_wreck"), v);
break;
default:
MissionStaticTryAddItem(
Expand Down Expand Up @@ -2331,21 +2331,45 @@ static void LoadEntity(
}
break;
case CWENT_SKELETON:
MissionStaticTryAddItem(&m->u.Static, StrMapObject("bone_blood"), v);
switch (map->type)
{
case CWMAPTYPE_N3D:
MissionStaticTryAddItem(&m->u.Static, StrMapObject("birdcage"), v);
break;
default:
MissionStaticTryAddItem(
&m->u.Static, StrMapObject("bone_blood"), v);
break;
}
break;
case CWENT_SINK_SKULLS_ON_STICK:
if (map->type == CWMAPTYPE_SOD)
switch (map->type)
{
case CWMAPTYPE_N3D:
MissionStaticTryAddItem(
&m->u.Static, StrMapObject("water_pitcher"), v);
break;
case CWMAPTYPE_SOD:
MissionStaticTryAddItem(
&m->u.Static, StrMapObject("skull_pillar"), v);
}
else
{
break;
default:
MissionStaticTryAddItem(&m->u.Static, StrMapObject("sink"), v);
break;
}
break;
case CWENT_BROWN_PLANT:
MissionStaticTryAddItem(&m->u.Static, StrMapObject("plant_brown"), v);
switch (map->type)
{
case CWMAPTYPE_N3D:
MissionStaticTryAddItem(
&m->u.Static, StrMapObject("water_pitcher_wreck"), v);
break;
default:
MissionStaticTryAddItem(
&m->u.Static, StrMapObject("plant_brown"), v);
break;
}
break;
case CWENT_VASE:
switch (map->type)
Expand Down Expand Up @@ -2388,8 +2412,7 @@ static void LoadEntity(
{
case CWMAPTYPE_N3D:
MissionStaticTryAddItem(
&m->u.Static, StrMapObject("chandelier"), v);
// TODO: wrong item
&m->u.Static, StrMapObject("water_trough"), v);
break;
default:
MissionStaticTryAddItem(
Expand All @@ -2414,16 +2437,33 @@ static void LoadEntity(
&m->u.Static, StrMapObject("suit_of_armor"), v);
break;
case CWENT_CAGE:
MissionStaticTryAddItem(&m->u.Static, StrMapObject("gibbet"), v);
MissionStaticTryAddItem(&m->u.Static, StrMapObject("shadow"), v);
switch (map->type)
{
case CWMAPTYPE_N3D:
MissionStaticAddKey(&m->u.Static, 2, v);
break;
default:
MissionStaticTryAddItem(&m->u.Static, StrMapObject("gibbet"), v);
MissionStaticTryAddItem(&m->u.Static, StrMapObject("shadow"), v);
break;
}
break;
case CWENT_CAGE_SKELETON:
MissionStaticTryAddItem(
&m->u.Static, StrMapObject("gibbet_skeleton"), v);
MissionStaticTryAddItem(&m->u.Static, StrMapObject("shadow"), v);
break;
case CWENT_BONES1:
MissionStaticTryAddItem(&m->u.Static, StrMapObject("skull"), v);
switch (map->type)
{
case CWMAPTYPE_N3D:
MissionStaticTryAddPickup(
&m->u.Static, StrPickupClass("large_feed_box"), v);
break;
default:
MissionStaticTryAddItem(&m->u.Static, StrMapObject("skull"), v);
break;
}
break;
case CWENT_KEY_GOLD:
switch (map->type)
Expand All @@ -2442,7 +2482,6 @@ static void LoadEntity(
switch (map->type)
{
case CWMAPTYPE_N3D:

MissionStaticTryAddPickup(
&m->u.Static, StrPickupClass("large_bandage"), v);
break;
Expand Down Expand Up @@ -2485,8 +2524,7 @@ static void LoadEntity(
{
case CWMAPTYPE_N3D:
MissionStaticTryAddPickup(
&m->u.Static, StrPickupClass("small_bandage"), v);
// TODO: wrong type
&m->u.Static, StrPickupClass("gun_Super Feeder"), v);
break;
default:
MissionStaticTryAddPickup(&m->u.Static, StrPickupClass("meal"), v);
Expand Down
3 changes: 2 additions & 1 deletion src/cdogs/pickup_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,13 @@ static void LoadPickupEffect(PickupClass *c, json_t *node, const int version)
case PICKUP_AMMO: {
tmp = GetString(node, "Ammo");
p.u.Ammo.Id = StrAmmoId(tmp);
CFREE(tmp);
const Ammo *ammo = AmmoGetById(&gAmmo, p.u.Ammo.Id);
CASSERT(ammo, "Ammo type not found");
// Set default ammo amount
int amount = ammo->Amount;
LoadInt(&amount, node, "Amount");
p.u.Ammo.Amount = amount;
CFREE(tmp);
break;
}
case PICKUP_KEYCARD:
Expand Down

0 comments on commit 60afe48

Please sign in to comment.