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

Migrate cough #35263

Merged
merged 97 commits into from
Nov 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
daa7960
get this centralized for me
Ramza13 Oct 10, 2019
98e88b3
commit for me
Ramza13 Oct 10, 2019
49b5652
Merge pull request #1 from CleverRaven/master
Ramza13 Oct 11, 2019
4fd3956
Merge branch 'master' of https://github.com/Ramza13/Cataclysm-DDA
Ramza13 Oct 12, 2019
c5ba1eb
Disallow running with broken legs and slow walking if you are on the …
Ramza13 Oct 12, 2019
3e56438
Undo checking in .gitignore
Ramza13 Oct 12, 2019
d8bd80c
Undo updating proj files
Ramza13 Oct 12, 2019
ed491ea
Migrate method to character
Ramza13 Oct 13, 2019
048b567
Revert "Migrate method to character"
Ramza13 Oct 13, 2019
5dd9f78
Migrated can_run into Character per reviewer advice
Ramza13 Oct 13, 2019
4da1c2b
Update src/character.h
Ramza13 Oct 13, 2019
88637aa
Astyled code
Ramza13 Oct 13, 2019
7750b7d
Revert "Astyled code"
Ramza13 Oct 13, 2019
9e5f092
Merge branch 'broken_limb_debuffs' of https://github.com/Ramza13/Cata…
Ramza13 Oct 13, 2019
2fc4407
AStyle Merged version
Ramza13 Oct 13, 2019
3765a0d
Merge branch 'master' into broken_limb_debuffs
Ramza13 Oct 13, 2019
5a77f9b
Upgraded debug damage self command to allow body part choice
Ramza13 Oct 13, 2019
de28e0d
Updated logic to prevent wielding with two broken arms and force drop…
Ramza13 Oct 13, 2019
39ce02e
Merge branch 'master' into broken_limb_debuffs
Ramza13 Oct 13, 2019
9984bf4
Prevent using martial arts while on the ground or with two broken arm…
Ramza13 Oct 14, 2019
225a8a8
Merge branch 'broken_limb_debuffs' of https://github.com/Ramza13/Cata…
Ramza13 Oct 14, 2019
3f6b547
Merge pull request #2 from CleverRaven/master
Ramza13 Oct 16, 2019
452b617
get this centralized for me
Ramza13 Oct 10, 2019
5c8fb32
commit for me
Ramza13 Oct 10, 2019
cddd683
Revert "commit for me"
Ramza13 Oct 14, 2019
882a9b7
Revert "get this centralized for me"
Ramza13 Oct 14, 2019
8bd3216
Added back penalty for hindered legs as it woul dstill have effect an…
Ramza13 Oct 16, 2019
9690ede
Astyle
Ramza13 Oct 16, 2019
a9f5095
Merge pull request #3 from CleverRaven/master
Ramza13 Oct 16, 2019
bbd31db
Fix some typos (#34730)
Cyrano7 Oct 14, 2019
48d38fe
Add a strong antibiotic.
TheRafters Oct 12, 2019
8d57919
Less than half the chance of antibiotics
TheRafters Oct 12, 2019
b09fe69
Add to hospital_lab and hard_drugs itemgroups
TheRafters Oct 12, 2019
7137c74
Use the STRONG_ANTIBIOTIC flag
TheRafters Oct 12, 2019
fe23abb
Commas!
TheRafters Oct 12, 2019
5e50a3a
Remove redundant field
TheRafters Oct 12, 2019
df3d1f0
renamed to dapterocozamin
TheRafters Oct 12, 2019
5155089
Dapterocozamin was too damned long
TheRafters Oct 13, 2019
c6a96f1
too slang like
TheRafters Oct 13, 2019
3ce4fc0
translocation ignores fall damage
KorGgenT Oct 13, 2019
a0c4d1e
move spores() and blossoms() from player:: to Character:: (#34736)
KorGgenT Oct 14, 2019
5c6cfc0
add some domestic furniture and terrain (#34734)
curstwist Oct 14, 2019
488d4d6
Vertical move effects (#34732)
Ramza13 Oct 14, 2019
8d710ec
add roof, landscaping, cosmetic changes to house_w_1
curstwist Oct 13, 2019
ecb383f
player::position to Character
KorGgenT Oct 13, 2019
e5cf9a7
npctrade: use drop_invalid_inventory() instead of drop_items()
mlangsdorf Oct 13, 2019
ca1af9f
Update clang-tidy text style check (#34716)
Qrox Oct 14, 2019
4620bac
Autoclave menu gives more information about denials (#34722)
Fris0uman Oct 14, 2019
716f606
Fix furniture door pathfinding
KnightosMaster Oct 13, 2019
5ceffdf
Get rid of auto in favor of proper types
ZhilkinSerg Oct 14, 2019
838e617
Fix pull request template misleading formatting (#34763)
reed501 Oct 15, 2019
b4ab731
Martial Arts Rebalance for Taekwondo
Hymore246 Oct 13, 2019
53a2ab1
take_weapon has priority over disarm
Hymore246 Oct 13, 2019
fc169a7
Fix for item variable
Hymore246 Oct 14, 2019
f3efabe
Astyle fix
Hymore246 Oct 14, 2019
c224dbb
Astyle fix again
Hymore246 Oct 15, 2019
2224555
mon_centipede looks like mon_centipede_giant
barsoosayque Oct 15, 2019
9a289d1
Fuji's Military Professions Mod (#34767)
NotFuji Oct 15, 2019
2f370dc
Fixed inactive incendiary grenades not exploding if thrown in fire (#…
Night-Pryanik Oct 15, 2019
d9ed534
Fixed speed indicator overlapping stamina indicator
Night-Pryanik Oct 15, 2019
9861854
Running/crouching while swimming will result in faster/slower swim sp…
Night-Pryanik Oct 15, 2019
7568ee9
Fix disabled limb check for bicycles
AlexMooney Oct 14, 2019
4e3ab76
add tele_sight to itemgroups
snipercup Oct 14, 2019
ef15602
changed celery volume to better reflect the mass-to-volume ratio in r…
y2s82 Oct 14, 2019
32f1ef1
Revert "add tele_sight to itemgroups"
ZhilkinSerg Oct 15, 2019
5733a0e
Fix astyle regression (2019-10-15) (#34772)
ZhilkinSerg Oct 15, 2019
588654d
Check for duplicate entries in active_npc before inserting.
ipcyborg Oct 14, 2019
7d70f76
Changelog thru october (#34731)
kevingranade Oct 15, 2019
1b523e3
Crafting display infinite (#34726)
Ramza13 Oct 15, 2019
35fe1d9
Switched the Stats and Traits tab in the character creation screen
Xanderga Oct 13, 2019
b95bf4c
Prevent counterattacks if tired or dead (#34793)
Hymore246 Oct 16, 2019
b80ac4d
BUG: Fix redundancy error in cattail-jelly recipe
Oddant1 Oct 16, 2019
8d462d6
Fix immersion suit Iuse
John-Candlebury Oct 16, 2019
f86ef30
Updated type section of technique description
Hymore246 Oct 15, 2019
8224120
move clothes item_groups
curstwist Oct 16, 2019
91f0a94
Fix repair activity for tools in vehicle
ifreund Oct 15, 2019
87f02ca
Remove unneeded code from read_do_turn
KnightosMaster Oct 15, 2019
a0b378d
add roof, landscaping to house_w_2
curstwist Oct 15, 2019
bd40106
Usuable not dirty bionics in inv always green
RDru Oct 15, 2019
d386e87
finish reorganizing furniture.json (#34758)
curstwist Oct 16, 2019
a6aef18
change crossed_threshold() scope and test_crossing_threshold() parame…
KorGgenT Oct 16, 2019
3f7b1f3
Migrate move mode and related code from player (#34762)
ifreund Oct 16, 2019
7b8ef1b
Tweaked NPC "Trade how many" menu
Night-Pryanik Oct 15, 2019
c75cf5d
Allow auto targeting mode for turrets only with installed turret cont…
Night-Pryanik Oct 16, 2019
73565ed
Changed how unarmed xp is calculated (#34723)
Xanderga Oct 16, 2019
19dc3c3
Fixed targeting UI issue for reach attack.
ipcyborg Oct 14, 2019
aaedbe8
removes extra capacity
Oct 14, 2019
0d14c25
Mythological replicas work with martial arts
TheShadowFerret Oct 15, 2019
0a10873
Fix: Dialogs not showing while tailoring.
OzoneH3 Oct 16, 2019
806d5fb
Magiclysm - Introducing Channel Wands and Disposable Wands (#34653)
foulman Oct 16, 2019
a096b1e
Merge pull request #4 from CleverRaven/master
Ramza13 Oct 22, 2019
b872eb6
Complete merge
Ramza13 Oct 22, 2019
356458d
Merge pull request #5 from CleverRaven/master
Ramza13 Nov 1, 2019
469af14
Move cough from player to character and weaken coughing
Ramza13 Nov 2, 2019
8b9107f
Undo change
Ramza13 Nov 2, 2019
3cef37f
Undo rebalance
Ramza13 Nov 2, 2019
8b9e139
Fix make
Ramza13 Nov 2, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const efftype_id effect_cold( "cold" );
const efftype_id effect_common_cold( "common_cold" );
const efftype_id effect_contacts( "contacts" );
const efftype_id effect_controlled( "controlled" );
const efftype_id effect_cough_suppress( "cough_suppress" );
const efftype_id effect_crushed( "crushed" );
const efftype_id effect_darkness( "darkness" );
const efftype_id effect_disinfected( "disinfected" );
Expand Down Expand Up @@ -5061,6 +5062,36 @@ int Character::item_store_cost( const item &it, const item & /* container */, bo
return item_handling_cost( it, penalties, base_cost ) / ( ( lvl + 10.0f ) / 10.0f );
}

void Character::cough( bool harmful, int loudness )
{
if( harmful ) {
const int stam = get_stamina();
const int malus = get_stamina_max() * 0.05; // 5% max stamina
mod_stat( "stamina", -malus );
if( stam < malus && x_in_y( malus - stam, malus ) && one_in( 6 ) ) {
apply_damage( nullptr, bp_torso, 1 );
}
}

if( has_effect( effect_cough_suppress ) ) {
return;
}

if( !is_npc() ) {
add_msg( m_bad, _( "You cough heavily." ) );
}
sounds::sound( pos(), loudness, sounds::sound_t::speech, _( "a hacking cough." ), false, "misc",
"cough" );

moves -= 80;

if( has_effect( effect_sleep ) && !has_effect( effect_narcosis ) &&
( ( harmful && one_in( 3 ) ) || one_in( 10 ) ) ) {
wake_up();
}
}


void Character::wake_up()
{
remove_effect( effect_sleep );
Expand Down
1 change: 1 addition & 0 deletions src/character.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ class Character : public Creature, public visitable<Character>
// any side effects that might happen when the Character hits a Creature
void did_hit( Creature &target );

void cough( bool harmful = false, int loudness = 4 );
/**
* Check for relevant passive, non-clothing that can absorb damage, and reduce by specified
* damage unit. Only flat bonuses are checked here. Multiplicative ones are checked in
Expand Down
9 changes: 8 additions & 1 deletion src/debug_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class vehicle;

#define dbg(x) DebugLog((x),D_GAME) << __FILE__ << ":" << __LINE__ << ": "
const efftype_id effect_riding( "riding" );
const efftype_id effect_flu( "flu" );
namespace debug_menu
{

Expand Down Expand Up @@ -435,7 +436,7 @@ void character_edit_menu()
enum {
D_NAME, D_SKILLS, D_STATS, D_ITEMS, D_DELETE_ITEMS, D_ITEM_WORN,
D_HP, D_STAMINA, D_MORALE, D_PAIN, D_NEEDS, D_HEALTHY, D_STATUS, D_MISSION_ADD, D_MISSION_EDIT,
D_TELE, D_MUTATE, D_CLASS, D_ATTITUDE, D_OPINION
D_TELE, D_MUTATE, D_CLASS, D_ATTITUDE, D_OPINION, D_FLU
};
nmenu.addentry( D_NAME, true, 'N', "%s", _( "Edit [N]ame" ) );
nmenu.addentry( D_SKILLS, true, 's', "%s", _( "Edit [s]kills" ) );
Expand All @@ -453,6 +454,7 @@ void character_edit_menu()
nmenu.addentry( D_MUTATE, true, 'u', "%s", _( "M[u]tate" ) );
nmenu.addentry( D_STATUS, true, '@', "%s", _( "Status Window [@]" ) );
nmenu.addentry( D_TELE, true, 'e', "%s", _( "t[e]leport" ) );
nmenu.addentry( D_FLU, true, 'f', "%s", _( "Give the [f]lu" ) );
nmenu.addentry( D_MISSION_EDIT, true, 'M', "%s", _( "Edit [M]issions (WARNING: Unstable!)" ) );
if( p.is_npc() ) {
nmenu.addentry( D_MISSION_ADD, true, 'm', "%s", _( "Add [m]ission" ) );
Expand Down Expand Up @@ -818,6 +820,11 @@ void character_edit_menu()
np->set_attitude( attitudes[attitudes_ui.ret] );
}
}
break;
case D_FLU: {
p.add_effect( effect_flu, 1000_minutes );
break;
}
}
}

Expand Down
29 changes: 0 additions & 29 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3171,35 +3171,6 @@ void player::siphon( vehicle &veh, const itype_id &desired_liquid )
}
}

void player::cough( bool harmful, int loudness )
{
if( harmful ) {
const int stam = get_stamina();
const int malus = get_stamina_max() * 0.05; // 5% max stamina
mod_stat( "stamina", -malus );
if( stam < malus && x_in_y( malus - stam, malus ) && one_in( 6 ) ) {
apply_damage( nullptr, bp_torso, 1 );
}
}

if( has_effect( effect_cough_suppress ) ) {
return;
}

if( !is_npc() ) {
add_msg( m_bad, _( "You cough heavily." ) );
}
sounds::sound( pos(), loudness, sounds::sound_t::speech, _( "a hacking cough." ), false, "misc",
"cough" );

moves -= 80;

if( has_effect( effect_sleep ) && !has_effect( effect_narcosis ) &&
( ( harmful && one_in( 3 ) ) || one_in( 10 ) ) ) {
wake_up();
}
}

void player::add_pain_msg( int val, body_part bp ) const
{
if( has_trait( trait_NOPAIN ) ) {
Expand Down
2 changes: 0 additions & 2 deletions src/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,6 @@ class player : public Character
/** Returns perceived pain (reduced with painkillers)*/
int get_perceived_pain() const override;

void cough( bool harmful = false, int loudness = 4 );

void add_pain_msg( int val, body_part bp ) const;

/** Knocks the player to a specified tile */
Expand Down