Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heavy mining mod added. Add a mining car. #34228

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,4 @@ Xcode/
/.flatpak-builder/
/repo/
/build-dir/
/out/build/x64-Debug
12 changes: 12 additions & 0 deletions data/mods/HeavyMining/modinfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"type": "MOD_INFO",
"ident": "Heavy miners",
"name": "Roadheader and other mining vehicles",
"authors": [ "Ckpyt" ],
"maintainers": [ "Ckpyt in the forest" ],
"description": "Adds a few mining vehicles, requires Vehicle Additions Pack.",
"category": "vehicles",
"dependencies": [ "dda", "blazemod" ]
}
]
78 changes: 78 additions & 0 deletions data/mods/HeavyMining/parts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
[
{
"type": "GENERIC",
"id": "v_roadheader_item",
"symbol": "&",
"name": "roadheader",
"color": "dark_gray",
"description": "A large and heavy jagged metalhead with a lot of spikes for destroying mine walls.",
"weight": "6200000 g",
"material": "steel",
"category": "veh_parts",
"price": 9500,
"volume": "140000 ml"
},
{
"type": "GENERIC",
"id": "v_balance_item",
"symbol": "&",
"name": "Balancer",
"color": "dark_gray",
"description": "A large and heavy metal bar for balancing a vehicle.",
"weight": "1000000 g",
"material": "steel",
"category": "veh_parts",
"price": 9500,
"volume": "140000 ml"
},
{
"id": "balancer",
"type": "vehicle_part",
"name": "Balancer",
"item": "v_balance_item",
"location": "inside",
"symbol": "o",
"broken_symbol": "x",
"color": "white",
"broken_color": "light_gray",
"looks_like": "55gal_drum",
"difficulty": 8,
"damage_modifier": 100,
"durability": 300,
"description": "A large and heavy metal drum for balancing a vehicle.",
"folded_volume": 12,
"breaks_into": [
{ "item": "steel_lump", "count": [ 4, 26 ] },
{ "item": "steel_chunk", "count": [ 4, 15 ] },
{ "item": "scrap", "count": [ 4, 100 ] }
],
"flags": [ "PROTRUSION", "EXTRA_DRAG"],
"damage_reduction": { "all": 132 }
},
{
"id": "roadheader",
"type": "vehicle_part",
"name": "roadheader",
"item": "v_roadheader_item",
"location": "structure",
"symbol": "&",
"broken_symbol": "x",
"color": "light_gray",
"broken_color": "light_gray",
"looks_like": "crane_medium",
"difficulty": 8,
"damage_modifier": 100,
"durability": 300,
"description": "A large metal jagged metalhead, powered by the vehicle's engines. Use the vehicle controls to turn it on or off. When turned on, it will stop the vehicle unless it has a strong engine. When turned on, it will destroy walls near it.",
"folded_volume": 12,
"power": -70000,
"breaks_into": [
{ "item": "steel_lump", "count": [ 4, 26 ] },
{ "item": "steel_chunk", "count": [ 4, 15 ] },
{ "item": "scrap", "count": [ 4, 100 ] }
],
"transform_terrain": { "pre_flags": [ "MINEABLE"], "post_terrain": "don't used"},
"flags": [ "PROTRUSION", "EXTRA_DRAG", "ROADHEAD", "CRASH_TERRAIN_AROUND"],
"damage_reduction": { "all": 132 }
}
]
17 changes: 17 additions & 0 deletions data/mods/HeavyMining/vehicle_groups.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"type": "vehicle_group",
"id": "industrial_vehicles",
"vehicles":[ ["roadheader", 40] ]
},
{
"type": "vehicle_group",
"id": "junkyard_vehicles",
"vehicles":[ ["roadheader", 2000] ]
},
{
"type": "vehicle_group",
"id": "workshop_vehicles",
"vehicles":[ ["roadheader", 10] ]
}
]
67 changes: 67 additions & 0 deletions data/mods/HeavyMining/vehicles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[
{
"id": "roadheader",
"type": "vehicle",
"name": "Roadheader",
"blueprint": [
["o-o "],
["|X--&"],
["o-o "]
],
"parts": [
{ "x": 0, "y": 0, "part": "hdframe_vertical"},
{ "x": 0, "y": 0, "part": "diesel_engine_i6" },
{ "x": 0, "y": 0, "part": "alternator_truck" },
{ "x": 0, "y": 0, "part": "battery_car" },
{ "x": 0, "y": 0, "part": "reinforced_windshield" },


{ "x": 0, "y": -1, "part": "hdframe_nw" },
{ "x": 0, "y": -1, "part": "tread2" },
{ "x": 0, "y": -1, "part": "halfboard_nw" },
{ "x": 0, "y": -1, "part": "headlight_reinforced" },

{ "x": 0, "y": 1, "part": "hdframe_ne"},
{ "x": 0, "y": 1, "part": "tread2" },
{ "x": 0, "y": 1, "part": "halfboard_ne" },
{ "x": 0, "y": 1, "part": "headlight_reinforced" }
,
{ "x": -1, "y": 0, "part": "hdframe_cross" },
{ "x": -1, "y": 0, "part": "seat" },
{ "x": -1, "y": 0, "part": "seatbelt" },
{ "x": -1, "y": 0, "part": "floodlight" },
{ "x": -1, "y": 0, "part": "controls" },
{ "x": -1, "y": 0, "part": "dashboard" },
{ "x": -1, "y": 0, "part": "horn_big" },
{ "x": -1, "y": 0, "part": "roof" },
{ "x": -1, "y": 1, "part": "hdframe_vertical" },
{ "x": -1, "y": 1, "part": "door" },
{ "x": -1, "y": 1, "part": "tread2" },
{ "x": -1, "y": -1, "part": "hdframe_vertical" },
{ "x": -1, "y": -1, "part": "door" },
{ "x": -1, "y": -1, "part": "tread2" },

{ "x": -2, "y": 1, "part": "hdframe_se" },
{ "x": -2, "y": 1, "part": "balancer" },

{ "x": -2, "y": 1, "part": "tread2" },
{ "x": -2, "y": 1, "part": "board_se" },

{ "x": -2, "y": 0, "part": "hdframe_horizontal" },
{ "x": -2, "y": 0, "part": "hatch" },
{ "x": -2, "y": 0, "part": "muffler" },
{ "x": -2, "y": 0, "part": "balancer" },

{ "x": -2, "y": -1, "part": "hdframe_sw" },
{ "x": -2, "y": -1, "part": "tread2" },
{ "x": -2, "y": -1, "part": "board_sw" },
{ "x": -2, "y": -1, "part": "tank", "fuel": "diesel" },
{ "x": -2, "y": -1, "part": "balancer" },


{ "x": 1, "y": 0, "part": "hdframe_vertical" },
{ "x": 1, "y": 0, "part": "halfboard_horizontal" },
{ "x": 2, "y": 0, "part": "roadheader" }
]
}
]
4 changes: 2 additions & 2 deletions msvc-full-features/Cataclysm-vcpkg.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<ProjectGuid>{2586F32C-9F3B-4410-88D1-4543C38511D7}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Cataclysm</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<VcpkgTriplet Condition="'$(Platform)'=='Win32'">x86-windows</VcpkgTriplet>
<VcpkgTriplet Condition="'$(Platform)'=='x64'">x64-windows</VcpkgTriplet>
</PropertyGroup>
Expand Down Expand Up @@ -128,4 +128,4 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
</Project>
7 changes: 6 additions & 1 deletion src/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,8 @@ int vehicle::install_part( const point &dp, const vehicle_part &new_part )
"SPACE_HEATER",
"COOLER",
"WATER_PURIFIER",
"ROCKWHEEL"
"ROCKWHEEL",
"ROADHEAD"
}
};

Expand Down Expand Up @@ -4656,6 +4657,10 @@ void vehicle::idle( bool on_map )
play_chimes();
}

if (has_part("CRASH_TERRAIN_AROUND", true)) {
crash_terrain_around();
}

if( is_alarm_on ) {
alarm();
}
Expand Down
2 changes: 2 additions & 0 deletions src/vehicle.h
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,8 @@ class vehicle
//scoop operation,pickups, battery drain, etc.
void operate_scoop();
void operate_reaper();
// for destorying any terrain around viehicle part. Automated mining tool.
void crash_terrain_around();
void transform_terrain();
void add_toggle_to_opts( std::vector<uilist_entry> &options,
std::vector<std::function<void()>> &actions, const std::string &name, char key,
Expand Down
44 changes: 44 additions & 0 deletions src/vehicle_use.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ void vehicle::set_electronics_menu_options( std::vector<uilist_entry> &options,
add_toggle( _( "reaper" ), keybind( "TOGGLE_REAPER" ), "REAPER" );
add_toggle( _( "planter" ), keybind( "TOGGLE_PLANTER" ), "PLANTER" );
add_toggle( _( "rockwheel" ), keybind( "TOGGLE_PLOW" ), "ROCKWHEEL" );
add_toggle(_("rockhead"), keybind("TOGGLE_PLOW"), "ROADHEAD");
add_toggle( _( "scoop" ), keybind( "TOGGLE_SCOOP" ), "SCOOP" );
add_toggle( _( "water purifier" ), keybind( "TOGGLE_WATER_PURIFIER" ), "WATER_PURIFIER" );

Expand Down Expand Up @@ -1092,6 +1093,49 @@ void vehicle::play_chimes()
}
}

void vehicle::crash_terrain_around() {
const tripoint around[] = { {1, 1, 0}, { 0,1,0 }, {-1, 1, 0},
{ 1, 0, 0}, {0, 0, 0}, { -1, 0, 0},
{1, -1, 0}, {0, -1, 0}, {-1, -1, 0}
};

if (total_power_w() <= 0)
return;

for (const vpart_reference& vp : get_enabled_parts("CRASH_TERRAIN_AROUND")) {
tripoint crush_target(0, 0, -OVERMAP_LAYERS);
const tripoint start_pos = vp.pos();
const transform_terrain_data& ttd = vp.info().transform_terrain;

for (int i = 0; i < 9 && crush_target.z == -OVERMAP_LAYERS; i++) {
tripoint cur_pos = start_pos + around[i];

bool busy_pos = false;

for (const vpart_reference& vp_tmp : get_all_parts()) {
busy_pos |= vp_tmp.pos() == cur_pos;
}

for (const std::string& flag : ttd.pre_flags) {
if (g->m.has_flag(flag, cur_pos) && !busy_pos) {
crush_target = cur_pos;
break;
}
}
}
if (crush_target.z != -OVERMAP_LAYERS) { //target chosen
velocity = 0;
cruise_velocity = 0;
g->m.destroy(crush_target);

sounds::sound(crush_target, 500, sounds::sound_t::combat, _("Clanggggg!"), false,
"smash_success", "hit_vehicle");
}

}
}


void vehicle::transform_terrain()
{
for( const vpart_reference &vp : get_enabled_parts( "TRANSFORM_TERRAIN" ) ) {
Expand Down