Skip to content

Commit

Permalink
[MOD] INT Based Learning (#37075)
Browse files Browse the repository at this point in the history
  • Loading branch information
1n17 authored and ZhilkinSerg committed Jan 20, 2020
1 parent 9c24dec commit 90bd793
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
7 changes: 7 additions & 0 deletions data/json/game_balance.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,12 @@
"info": "Stats through Kills. A mod that allows your stats to increase by killing zombies.",
"stype": "bool",
"value": false
},
{
"type": "EXTERNAL_OPTION",
"name": "INT_BASED_LEARNING",
"info": "INT Based Learning mod. Enables rebalance of practice and reading gains.",
"stype": "bool",
"value": false
}
]
22 changes: 22 additions & 0 deletions data/mods/intbasedlearning/modinfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"type": "MOD_INFO",
"ident": "intbasedlearning",
"name": "INT Based Learning",
"authors": [ "1n17" ],
"maintainers": [ "1n17" ],
"description": "Learning through practice and reading is highly dependent on INT and focus. Respective traits are disabled.",
"category": "rebalance",
"dependencies": [ "dda" ]
},
{
"type": "EXTERNAL_OPTION",
"name": "INT_BASED_LEARNING",
"stype": "bool",
"value": true
},
{
"type": "TRAIT_BLACKLIST",
"traits": [ "SLOWLEARNER", "FASTLEARNER" ]
}
]
4 changes: 4 additions & 0 deletions src/avatar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,10 @@ void avatar::do_read( item &book )
if( has_active_bionic( bio_memory ) ) {
min_ex += 2;
}
if( get_option<bool>( "INT_BASED_LEARNING" ) ) {
min_ex = adjust_for_focus( min_ex );
max_ex = adjust_for_focus( max_ex );
}
if( max_ex < 2 ) {
max_ex = 2;
}
Expand Down
3 changes: 3 additions & 0 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5575,6 +5575,9 @@ int player::adjust_for_focus( int amount ) const
if( has_trait( trait_SLOWLEARNER ) ) {
effective_focus -= 15;
}
if( get_option<bool>( "INT_BASED_LEARNING" ) ) {
effective_focus += ( get_int_base() - 8 ) * 5;
}
double tmp = amount * ( effective_focus / 100.0 );
return roll_remainder( tmp );
}
Expand Down

0 comments on commit 90bd793

Please sign in to comment.