Skip to content

Commit 2f8f395

Browse files
authored
Merge pull request #82843 from RenechCDDA/remove_STK
Remove Stats Through Kills and supporting code
2 parents fd7cc97 + a51d577 commit 2f8f395

File tree

12 files changed

+10
-171
lines changed

12 files changed

+10
-171
lines changed

.github/reviewers.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ files:
2323
- Fris0uman
2424
'data/mods/ruralbiome/**':
2525
- I-am-Erk
26-
'data/mods/stats_through_kills/**':
27-
- KorGgenT
2826
'data/mods/Xedra_Evolved/**':
2927
- Maleclypse
3028
'data/mods/MindOverMatter/**':

data/core/external_options.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,6 @@
202202
"stype": "bool",
203203
"value": false
204204
},
205-
{
206-
"type": "EXTERNAL_OPTION",
207-
"name": "STATS_THROUGH_KILLS",
208-
"//": "Stats through Kills. A mod that allows your stats to increase by killing zombies.",
209-
"stype": "bool",
210-
"value": false
211-
},
212205
{
213206
"type": "EXTERNAL_OPTION",
214207
"name": "WEARY_BMR_MULT",

data/core/mod_migrations.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
"id": "StatsThroughSkills",
1818
"removal_reason": "Hardcode that enabled this was removed and it doesn't meet repo inclusion criteria, non-hardcoded alternatives are available out of repo."
1919
},
20+
{
21+
"type": "mod_migration",
22+
"//": "Removed in 0.J",
23+
"id": "stats_through_kills",
24+
"removal_reason": "Does not meet repo requirements of offering a different, curated gameplay experience."
25+
},
2026
{
2127
"type": "mod_migration",
2228
"//": "Removed in 0.I",

data/mods/stats_through_kills/modinfo.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/avatar.cpp

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,91 +1165,6 @@ void avatar::reset_stats()
11651165

11661166
}
11671167

1168-
// based on D&D 5e level progression
1169-
static const std::array<int, 20> xp_cutoffs = { {
1170-
300, 900, 2700, 6500, 14000,
1171-
23000, 34000, 48000, 64000, 85000,
1172-
100000, 120000, 140000, 165000, 195000,
1173-
225000, 265000, 305000, 355000, 405000
1174-
}
1175-
};
1176-
1177-
int avatar::free_upgrade_points() const
1178-
{
1179-
int lvl = 0;
1180-
for( const int &xp_lvl : xp_cutoffs ) {
1181-
if( kill_xp >= xp_lvl ) {
1182-
lvl++;
1183-
} else {
1184-
break;
1185-
}
1186-
}
1187-
return lvl - spent_upgrade_points;
1188-
}
1189-
1190-
void avatar::upgrade_stat_prompt( const character_stat &stat )
1191-
{
1192-
const int free_points = free_upgrade_points();
1193-
1194-
if( free_points <= 0 ) {
1195-
const std::size_t lvl = spent_upgrade_points + free_points;
1196-
if( lvl >= xp_cutoffs.size() ) {
1197-
popup( _( "You've already reached maximum level." ) );
1198-
} else {
1199-
popup( _( "Needs %d more experience to gain next level." ), xp_cutoffs[lvl] - kill_xp );
1200-
}
1201-
return;
1202-
}
1203-
1204-
std::string stat_string;
1205-
switch( stat ) {
1206-
case character_stat::STRENGTH:
1207-
stat_string = _( "strength" );
1208-
break;
1209-
case character_stat::DEXTERITY:
1210-
stat_string = _( "dexterity" );
1211-
break;
1212-
case character_stat::INTELLIGENCE:
1213-
stat_string = _( "intelligence" );
1214-
break;
1215-
case character_stat::PERCEPTION:
1216-
stat_string = _( "perception" );
1217-
break;
1218-
case character_stat::DUMMY_STAT:
1219-
stat_string = _( "invalid stat" );
1220-
debugmsg( "Tried to use invalid stat" );
1221-
break;
1222-
default:
1223-
return;
1224-
}
1225-
1226-
if( query_yn( _( "Are you sure you want to raise %s? %d points available." ), stat_string,
1227-
free_points ) ) {
1228-
switch( stat ) {
1229-
case character_stat::STRENGTH:
1230-
str_max++;
1231-
spent_upgrade_points++;
1232-
recalc_hp();
1233-
break;
1234-
case character_stat::DEXTERITY:
1235-
dex_max++;
1236-
spent_upgrade_points++;
1237-
break;
1238-
case character_stat::INTELLIGENCE:
1239-
int_max++;
1240-
spent_upgrade_points++;
1241-
break;
1242-
case character_stat::PERCEPTION:
1243-
per_max++;
1244-
spent_upgrade_points++;
1245-
break;
1246-
case character_stat::DUMMY_STAT:
1247-
debugmsg( "Tried to use invalid stat" );
1248-
break;
1249-
}
1250-
}
1251-
}
1252-
12531168
faction *avatar::get_faction() const
12541169
{
12551170
return g->faction_manager_ptr->get( faction_your_followers );

src/character.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,8 @@ class Character : public Creature, public visitable
581581
int ppen_per;
582582
int ppen_spd;
583583

584+
// Legacy value, used by several mods via eoc.
584585
int kill_xp = 0;
585-
// Level-up points spent on Stats through Kills
586-
int spent_upgrade_points = 0;
587586

588587
float cached_organic_size;
589588

src/debug_menu.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2444,9 +2444,7 @@ static void character_edit_menu()
24442444
nmenu.addentry( D_HEALTHY, true, 'a', "%s", _( "Set health" ) );
24452445
nmenu.addentry( D_NEEDS, true, 'n', "%s", _( "Set needs" ) );
24462446
nmenu.addentry( D_NORMALIZE_BODY, true, 'N', "%s", _( "Normalize body stats" ) );
2447-
if( get_option<bool>( "STATS_THROUGH_KILLS" ) ) {
2448-
nmenu.addentry( D_KILL_XP, true, 'X', "%s", _( "Set kill XP" ) );
2449-
}
2447+
nmenu.addentry( D_KILL_XP, true, 'X', "%s", _( "Set kill XP (for mods)" ) );
24502448
nmenu.addentry( D_MUTATE, true, 'u', "%s", _( "Mutate" ) );
24512449
nmenu.addentry( D_BIONICS, true, 'b', "%s", _( "Edit [b]ionics" ) );
24522450
nmenu.addentry( D_STATUS, true,

src/kill_tracker.cpp

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,6 @@ int kill_tracker::total_kill_count() const
8686
return monster_kill_count() + npc_kill_count();
8787
}
8888

89-
int kill_tracker::legacy_kill_xp() const
90-
{
91-
int ret = 0;
92-
for( const std::pair<const mtype_id, int> &pair : kills ) {
93-
ret += ( pair.first->difficulty + pair.first->difficulty_base ) * pair.second;
94-
}
95-
ret += npc_kills.size() * 10;
96-
return ret;
97-
}
98-
9989
void kill_tracker::clear()
10090
{
10191
kills.clear();
@@ -114,8 +104,6 @@ static Character *get_avatar_or_follower( const character_id &id )
114104
return nullptr;
115105
}
116106

117-
static constexpr int npc_kill_xp = 10;
118-
119107
void kill_tracker::notify( const cata::event &e )
120108
{
121109
switch( e.type() ) {
@@ -124,17 +112,16 @@ void kill_tracker::notify( const cata::event &e )
124112
if( Character *killer = get_avatar_or_follower( killer_id ) ) {
125113
const mtype_id victim_type = e.get<mtype_id>( "victim_type" );
126114
kills[victim_type]++;
127-
killer->kill_xp += e.get<int>( "exp" );
128115
victim_type.obj().families.practice_kill( *killer );
129116
}
130117
break;
131118
}
132119
case event_type::character_kills_character: {
133120
const character_id killer_id = e.get<character_id>( "killer" );
134-
if( Character *killer = get_avatar_or_follower( killer_id ) ) {
121+
// player is credited for NPC kills they or their followers make
122+
if( get_avatar_or_follower( killer_id ) ) {
135123
const std::string victim_name = e.get<cata_variant_type::string>( "victim_name" );
136124
npc_kills.push_back( victim_name );
137-
killer->kill_xp += npc_kill_xp;
138125
}
139126
break;
140127
}

src/kill_tracker.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class kill_tracker : public event_subscriber
2929
int monster_kill_count() const;
3030
int npc_kill_count() const;
3131
int total_kill_count() const;
32-
// TEMPORARY until 0.G
33-
int legacy_kill_xp() const;
3432

3533
void clear();
3634
using event_subscriber::notify;

src/player_display.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <vector>
1515

1616
#include "addiction.h"
17-
#include "avatar.h"
1817
#include "bionics.h"
1918
#include "bodygraph.h"
2019
#include "bodypart.h"
@@ -41,7 +40,6 @@
4140
#include "itype.h"
4241
#include "magic_enchantment.h"
4342
#include "mutation.h"
44-
#include "options.h"
4543
#include "output.h"
4644
#include "pimpl.h"
4745
#include "point.h"
@@ -1396,8 +1394,6 @@ static bool handle_player_display_action( Character &you, unsigned int &line,
13961394
case player_display_tab::stats:
13971395
if( header_clicked ) {
13981396
display_bodygraph( you );
1399-
} else if( line < 4 && get_option<bool>( "STATS_THROUGH_KILLS" ) && you.is_avatar() ) {
1400-
you.as_avatar()->upgrade_stat_prompt( static_cast<character_stat>( line ) );
14011397
}
14021398

14031399
invalidate_tab( curtab );

0 commit comments

Comments
 (0)