Skip to content

Commit

Permalink
Revert "Migrate method to character"
Browse files Browse the repository at this point in the history
This reverts commit ed491ea.
  • Loading branch information
Ramza13 committed Oct 13, 2019
1 parent ed491ea commit 048b567
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 38 deletions.
12 changes: 2 additions & 10 deletions msvc-full-features/Cataclysm-App.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
Expand Down Expand Up @@ -58,14 +58,6 @@
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt;$(IncludePath)</IncludePath>
<LibraryPath>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt</IncludePath>
<LibraryPath>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level1</WarningLevel>
Expand Down Expand Up @@ -140,4 +132,4 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
</Project>
11 changes: 2 additions & 9 deletions msvc-full-features/Cataclysm-Lib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
Expand Down Expand Up @@ -58,13 +58,6 @@
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LibraryPath>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;$(LibraryPath)</LibraryPath>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level1</WarningLevel>
Expand Down Expand Up @@ -127,4 +120,4 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
</Project>
12 changes: 2 additions & 10 deletions msvc-full-features/Cataclysm-Tests.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
Expand Down Expand Up @@ -59,14 +59,6 @@
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt;$(IncludePath)</IncludePath>
<LibraryPath>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LibraryPath>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;$(LibraryPath)</LibraryPath>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level1</WarningLevel>
Expand Down Expand Up @@ -144,4 +136,4 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
</Project>
6 changes: 0 additions & 6 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ const efftype_id effect_riding( "riding" );
const efftype_id effect_sleep( "sleep" );
const efftype_id effect_slept_through_alarm( "slept_through_alarm" );
const efftype_id effect_webbed( "webbed" );
const efftype_id effect_winded( "winded" );

const skill_id skill_dodge( "dodge" );
const skill_id skill_throw( "throw" );
Expand Down Expand Up @@ -478,11 +477,6 @@ bool Character::is_limb_disabled( hp_part limb ) const
return hp_cur[limb] <= hp_max[limb] * .125;
}

bool Character::can_run() const
{
return (stamina > 0 && !has_effect( effect_winded ) && get_working_leg_count() >= 2);
}

// this is the source of truth on if a limb is broken so all code to determine
// if a limb is broken should point here to make any future changes to breaking easier
bool Character::is_limb_broken( hp_part limb ) const
Expand Down
3 changes: 0 additions & 3 deletions src/character.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,6 @@ class Character : public Creature, public visitable<Character>
bool is_limb_disabled( hp_part limb ) const;
/** Returns true if the limb is broken */
bool is_limb_broken( hp_part limb ) const;
/** Source of truth of whether a player can run*/
bool can_run() const;

/**
* Displays menu with body part hp, optionally with hp estimation after healing.
* Returns selected part.
Expand Down
5 changes: 5 additions & 0 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2501,6 +2501,11 @@ void player::toggle_run_mode()
}
}

bool player::can_run()
{
return stamina > 0 && !has_effect( effect_winded ) && get_working_leg_count() >= 2;
}

void player::toggle_crouch_mode()
{
if( move_mode == PMM_CROUCH ) {
Expand Down
1 change: 1 addition & 0 deletions src/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ class player : public Character
void cycle_move_mode(); // Cycles to the next move mode.
void reset_move_mode(); // Resets to walking.
void toggle_run_mode(); // Toggles running on/off.
bool can_run(); // source of truth of whether a player can run
void toggle_crouch_mode(); // Toggles crouching on/off.

// martialarts.cpp
Expand Down

0 comments on commit 048b567

Please sign in to comment.