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 1 commit
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
Prev Previous commit
Next Next commit
change crossed_threshold() scope and test_crossing_threshold() parame…
…ter to Character (#34761)

* change scope of crossed_threshold()

* moved crossed_threshold to character.cpp

* change parameter of test_crossing_threshold to Character

* change "p" to "guy"
  • Loading branch information
KorGgenT authored and Ramza13 committed Oct 16, 2019
commit a6aef181d46bdb2e8e2103614bd10a33660e9eb6
10 changes: 10 additions & 0 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4690,6 +4690,16 @@ void Character::on_hurt( Creature *source, bool disturb /*= true*/ )
}
}

bool Character::crossed_threshold() const
{
for( const std::pair<trait_id, Character::trait_data> &mut : my_mutations ) {
if( mut.first->threshold ) {
return true;
}
}
return false;
}

void Character::spores()
{
fungal_effects fe( *g, g->m );
Expand Down
4 changes: 4 additions & 0 deletions src/character.h
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,10 @@ class Character : public Creature, public visitable<Character>
*/
void add_traits();
void add_traits( points_left &points );
/** Returns true if the player has crossed a mutation threshold
* Player can only cross one mutation threshold.
*/
bool crossed_threshold() const;

// --------------- Values ---------------
std::string name;
Expand Down
46 changes: 23 additions & 23 deletions src/mutation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1339,10 +1339,10 @@ mutagen_attempt mutagen_common_checks( player &p, const item &it, bool strong,
return mutagen_attempt( true, 0 );
}

void test_crossing_threshold( player &p, const mutation_category_trait &m_category )
void test_crossing_threshold( Character &guy, const mutation_category_trait &m_category )
{
// Threshold-check. You only get to cross once!
if( p.crossed_threshold() ) {
if( guy.crossed_threshold() ) {
return;
}

Expand All @@ -1355,11 +1355,11 @@ void test_crossing_threshold( player &p, const mutation_category_trait &m_catego
std::string mutation_category = m_category.id;
int total = 0;
for( const auto &iter : mutation_category_trait::get_all() ) {
total += p.mutation_category_level[ iter.first ];
total += guy.mutation_category_level[ iter.first ];
}
// Threshold-breaching
const std::string &primary = p.get_highest_category();
int breach_power = p.mutation_category_level[primary];
const std::string &primary = guy.get_highest_category();
int breach_power = guy.mutation_category_level[primary];
// Only if you were pushing for more in your primary category.
// You wanted to be more like it and less human.
// That said, you're required to have hit third-stage dreams first.
Expand All @@ -1374,33 +1374,33 @@ void test_crossing_threshold( player &p, const mutation_category_trait &m_catego
}
int breacher = breach_power + booster;
if( x_in_y( breacher, total ) ) {
p.add_msg_if_player( m_good,
_( "Something strains mightily for a moment... and then... you're... FREE!" ) );
p.set_mutation( mutation_thresh );
g->events().send<event_type::crosses_mutation_threshold>( p.getID(), m_category.id );
guy.add_msg_if_player( m_good,
_( "Something strains mightily for a moment... and then... you're... FREE!" ) );
guy.set_mutation( mutation_thresh );
g->events().send<event_type::crosses_mutation_threshold>( guy.getID(), m_category.id );
// Manually removing Carnivore, since it tends to creep in
// This is because carnivore is a prerequisite for the
// predator-style post-threshold mutations.
if( mutation_category == "URSINE" && p.has_trait( trait_CARNIVORE ) ) {
p.unset_mutation( trait_CARNIVORE );
p.add_msg_if_player( _( "Your appetite for blood fades." ) );
if( mutation_category == "URSINE" && guy.has_trait( trait_CARNIVORE ) ) {
guy.unset_mutation( trait_CARNIVORE );
guy.add_msg_if_player( _( "Your appetite for blood fades." ) );
}
}
} else if( p.has_trait( trait_NOPAIN ) ) {
} else if( guy.has_trait( trait_NOPAIN ) ) {
//~NOPAIN is a post-Threshold trait, so you shouldn't
//~legitimately have it and get here!
p.add_msg_if_player( m_bad, _( "You feel extremely Bugged." ) );
guy.add_msg_if_player( m_bad, _( "You feel extremely Bugged." ) );
} else if( breach_power > 100 ) {
p.add_msg_if_player( m_bad, _( "You stagger with a piercing headache!" ) );
p.mod_pain_noresist( 8 );
p.add_effect( effect_stunned, rng( 3_turns, 5_turns ) );
guy.add_msg_if_player( m_bad, _( "You stagger with a piercing headache!" ) );
guy.mod_pain_noresist( 8 );
guy.add_effect( effect_stunned, rng( 3_turns, 5_turns ) );
} else if( breach_power > 80 ) {
p.add_msg_if_player( m_bad,
_( "Your head throbs with memories of your life, before all this..." ) );
p.mod_pain_noresist( 6 );
p.add_effect( effect_stunned, rng( 2_turns, 4_turns ) );
guy.add_msg_if_player( m_bad,
_( "Your head throbs with memories of your life, before all this..." ) );
guy.mod_pain_noresist( 6 );
guy.add_effect( effect_stunned, rng( 2_turns, 4_turns ) );
} else if( breach_power > 60 ) {
p.add_msg_if_player( m_bad, _( "Images of your past life flash before you." ) );
p.add_effect( effect_stunned, rng( 2_turns, 3_turns ) );
guy.add_msg_if_player( m_bad, _( "Images of your past life flash before you." ) );
guy.add_effect( effect_stunned, rng( 2_turns, 3_turns ) );
}
}
2 changes: 1 addition & 1 deletion src/mutation.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,6 @@ struct mutagen_attempt {
mutagen_attempt mutagen_common_checks( player &p, const item &it, bool strong,
mutagen_technique technique );

void test_crossing_threshold( player &p, const mutation_category_trait &m_category );
void test_crossing_threshold( Character &guy, const mutation_category_trait &m_category );

#endif
10 changes: 0 additions & 10 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2012,16 +2012,6 @@ bool player::has_same_type_trait( const trait_id &flag ) const
return false;
}

bool player::crossed_threshold() const
{
for( auto &mut : my_mutations ) {
if( mut.first->threshold ) {
return true;
}
}
return false;
}

bool player::purifiable( const trait_id &flag ) const
{
return flag->purifiable;
Expand Down
4 changes: 0 additions & 4 deletions src/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,6 @@ class player : public Character
bool has_higher_trait( const trait_id &flag ) const;
/** Returns true if the player has a trait that shares a type with the entered trait */
bool has_same_type_trait( const trait_id &flag ) const;
/** Returns true if the player has crossed a mutation threshold
* Player can only cross one mutation threshold.
*/
bool crossed_threshold() const;
/** Returns true if the entered trait may be purified away
* Defaults to true
*/
Expand Down